query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
15a47bfd4d6981056e02c196e68b9578
function that returns the minimum cost and path to reach Finish
[ { "docid": "492bb475a362bcb40dce22e9adf73293", "score": "0.7013489", "text": "function calculate (graph, startp, finishp) {\n\n const processed = [startp]\n const costs = Object.assign({[finishp]: Infinity}, graph[startp]);\n // track patth\n const parents = {[finishp]: null};\n for (let child in graph[startp]) {\n parents[child] = startp;\n }\n\n let node = lowestCostNode(costs, processed);\n while (node) {\n //console.log(node)\n let cost = costs[node];\n let children = graph[node];\n for (let n in children) {\n if (!processed.includes(n)) {\n let newCost = cost + children[n];\n if (!costs[n]) {\n costs[n] = newCost;\n parents[n] = node;\n }\n if (costs[n] > newCost) {\n costs[n] = newCost;\n parents[n] = node;\n }\n }\n }\n processed.push(node);\n node = lowestCostNode(costs, processed);\n }\n\n let optimalPath = [finishp];\n let parent = parents[finishp];\n while (parent) {\n optimalPath.push(parent);\n parent = parents[parent];\n }\n optimalPath.reverse();\n\n const results = {\n distance: costs[finishp],\n path: optimalPath\n };\n\n return results.path;\n}", "title": "" } ]
[ { "docid": "3c6673db51d896189856b8ebfcdf1fab", "score": "0.69479144", "text": "function calulatePath(){\n // we need two selected nodes to have a chance at a path, make sure the tuple is full. \n if(selectedNodes.indexOf(undefined) < 0){\n // get a copy of the nodes and apply initial minPath and min Distance to them. \n unsettledNodes = JSON.parse(JSON.stringify(nodes));\n settledNodes = [];\n\n for (var ind in unsettledNodes) {\n if (unsettledNodes.hasOwnProperty(ind)) {\n var curNode = unsettledNodes[ind];\n curNode.minPath = [];\n curNode.minDistance = maxMinWeight;\n }\n };\n // we have a path potentially!\n var firstNode = unsettledNodes[selectedNodes[0].name];\n firstNode.minDistance = 0;\n var destNode = unsettledNodes[selectedNodes[1].name];\n lastAddedNode = firstNode; \n\n settledNodes.push(firstNode);\n delete unsettledNodes[selectedNodes[0].name];\n\n while(lastAddedNode != undefined &&\n lastAddedNode.name != destNode.name)\n {\n relaxNeighbors(lastAddedNode);\n lastAddedNode = extractMinimum(unsettledNodes);\n }\n }\n }", "title": "" }, { "docid": "604c9aae72fd178f8a1945d37df34c07", "score": "0.68735063", "text": "function minimumCostPath(matrix, i = 0, j = 0) {\n let n = matrix.length;\n let m = matrix[0].length;\n if (i == n - 1 && j == m - 1) return matrix[i][j];\n else if (i == n - 1) return matrix[i][j] + minimumCostPath(matrix, i, j + 1);\n else if (j == m - 1) return matrix[i][j] + minimumCostPath(matrix, i + 1, j);\n else\n return (\n matrix[i][j] +\n Math.min(\n minimumCostPath(matrix, i + 1, j),\n minimumCostPath(matrix, i, j + 1)\n )\n );\n}", "title": "" }, { "docid": "27c1557875502345adf02ab488c5d0f2", "score": "0.6824322", "text": "function minimumCostPath(matrix) {\n let n = matrix.length;\n let m = matrix[0].length;\n let costs = [...Array(n)].map((row) => [...Array(m)].map((x) => 0));\n costs[0][0] = matrix[0][0];\n for (let i = 1; i < m; i++) costs[0][i] = costs[0][i - 1] + matrix[0][i];\n for (let i = 1; i < n; i++) costs[i][0] = costs[i - 1][0] + matrix[i][0];\n for (let i = 1; i < n; i++)\n for (let j = 1; j < m; j++)\n costs[i][j] = Math.min(costs[i - 1][j], costs[i][j - 1]) + matrix[i][j];\n return costs[n - 1][m - 1];\n}", "title": "" }, { "docid": "3882c577f7d20db2ab143724a2b4dbea", "score": "0.6819067", "text": "function shortestCurrentPath() {\n\n }", "title": "" }, { "docid": "5fa3e3b59573105347fa91672437930c", "score": "0.6593368", "text": "function findPath(from, constraints, goal = getNode(StreamType.Opus), path = [], depth = 5) {\n if (from === goal && constraints(path)) {\n return { cost: 0 };\n }\n else if (depth === 0) {\n return { cost: Infinity };\n }\n let currentBest = undefined;\n for (const edge of from.edges) {\n if (currentBest && edge.cost > currentBest.cost)\n continue;\n const next = findPath(edge.to, constraints, goal, [...path, edge], depth - 1);\n const cost = edge.cost + next.cost;\n if (!currentBest || cost < currentBest.cost) {\n currentBest = { cost, edge, next };\n }\n }\n return currentBest !== null && currentBest !== void 0 ? currentBest : { cost: Infinity };\n}", "title": "" }, { "docid": "85a6e8eb4fc91aabf2200f899b41e1ca", "score": "0.6505519", "text": "dijkstra(start, finish) {\n const nodes = new PriorityQueue();\n const distances = {};\n const previous = {};\n let path = []; // to return at end;\n let smallest;\n // Build up initial state\n for (let vertex in this.adjacencyList) {\n if (vertex === start) {\n distances[vertex] = 0;\n nodes.enqueue(vertex, 0);\n } else {\n distances[vertex] = Infinity;\n nodes.enqueue(vertex, Infinity);\n }\n previous[vertex] = null;\n }\n\n // as long as there is something to visit\n while (nodes.values.length) {\n smallest = nodes.dequeue().val;\n if (smallest === finish) {\n // we are done, build up path to return at end\n while (previous[smallest]) {\n path.push(smallest);\n smallest = previous[smallest];\n }\n break;\n }\n\n if (smallest || distances[smallest] !== Infinity) {\n for (let neighbor in this.adjacencyList[smallest]) {\n //find neighboring node\n let nextNode = this.adjacencyList[smallest][neighbor];\n // calculate new distance to neighboring node\n let candidate = distances[smallest] + nextNode.weight;\n let nextNeighbor = nextNode.node;\n if (candidate < distances[nextNeighbor]) {\n // updating new smallest distance to neighbor\n distances[nextNeighbor] = candidate;\n //updating previous- how we got to neighbor\n previous[nextNeighbor] = smallest;\n // enqueue in priority queue with new priority\n nodes.enqueue(nextNeighbor, candidate);\n }\n }\n }\n }\n return path.concat(smallest).reverse();\n }", "title": "" }, { "docid": "290f24a5091b32a880cfac0d15982808", "score": "0.64703226", "text": "getPathFromGraphReachedNodes() {\r\n\t\tif(this.goal_reached_nodes.length === 0) \r\n\t\t\tconsole(\"No path found using this graph!\");\r\n\t\telse {\r\n\t\t\tthis.path.push(new Vector(this.gx+this.gw/2,this.gy+this.gh/2));\r\n\r\n\t\t\tlet lowest_cost = 10000;\r\n\t\t\tlet lowest_node = null;\r\n\t\t\tfor(var i = 0; i < this.goal_reached_nodes.length; i++) {\r\n\t\t\t \tlet node = this.goal_reached_nodes[i];\r\n\r\n\t\t\t \tif(node.cost < lowest_cost) {\r\n\t\t\t \t\tlowest_cost = node.cost;\r\n\t\t\t \t\tlowest_node = node;\r\n\t\t\t \t\t\r\n\t\t\t \t}\r\n\t\t\t}\r\n\t\t\tvar node = lowest_node.from;\r\n\t\t\twhile(node != this.nodes[0]) {\r\n\t\t\t\tthis.path.push(new Vector(node.pos.x, node.pos.y));\r\n\t\t\t\tnode = node.from;\r\n\t\t\t}\r\n\r\n\t\t\t// reverse order of path\r\n\t\t\tthis.path = this.path.reverse();\r\n\r\n\t\t\tthis.hasPath = true;\r\n\t\t\tconsole('Amount of nodes: ' + this.nodes.length);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "290f24a5091b32a880cfac0d15982808", "score": "0.64703226", "text": "getPathFromGraphReachedNodes() {\r\n\t\tif(this.goal_reached_nodes.length === 0) \r\n\t\t\tconsole(\"No path found using this graph!\");\r\n\t\telse {\r\n\t\t\tthis.path.push(new Vector(this.gx+this.gw/2,this.gy+this.gh/2));\r\n\r\n\t\t\tlet lowest_cost = 10000;\r\n\t\t\tlet lowest_node = null;\r\n\t\t\tfor(var i = 0; i < this.goal_reached_nodes.length; i++) {\r\n\t\t\t \tlet node = this.goal_reached_nodes[i];\r\n\r\n\t\t\t \tif(node.cost < lowest_cost) {\r\n\t\t\t \t\tlowest_cost = node.cost;\r\n\t\t\t \t\tlowest_node = node;\r\n\t\t\t \t\t\r\n\t\t\t \t}\r\n\t\t\t}\r\n\t\t\tvar node = lowest_node.from;\r\n\t\t\twhile(node != this.nodes[0]) {\r\n\t\t\t\tthis.path.push(new Vector(node.pos.x, node.pos.y));\r\n\t\t\t\tnode = node.from;\r\n\t\t\t}\r\n\r\n\t\t\t// reverse order of path\r\n\t\t\tthis.path = this.path.reverse();\r\n\r\n\t\t\tthis.hasPath = true;\r\n\t\t\tconsole('Amount of nodes: ' + this.nodes.length);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7ade8d3e3e34dda6c750cf138cedfc83", "score": "0.6453085", "text": "function findpath() {\n\tq.clear(); link.fill(0); Cost.fill(Infinity);\n\tCost[g.source] = 0; q.enq(g.source);\n\tlet pass = 0; let last = q.last();\n\twhile (!q.empty()) {\n\t\tlet u = q.deq();\n\t\tfor (let e = g.firstAt(u); e; e = g.nextAt(u,e)) {\n\t\t\tif (g.res(e,u) == 0) continue;\n\t\t\tlet v = g.mate(u,e); steps++;\n\t\t\tif (Cost[v] > Cost[u] + g.costFrom(e,u)) {\n\t\t\t\tCost[v] = Cost[u] + g.costFrom(e,u); link[v] = e;\n\t\t\t\tif (!q.contains(v)) q.enq(v);\n\t\t\t}\n\t\t}\n\t\tif (u == last) {\n\t\t\tea && assert(pass < g.n, 'mcflowJ: negative cost cycle detected');\n\t\t\tpass++; last = q.last();\n\t\t}\n\t}\n\treturn link[g.sink] ? true : false;\n}", "title": "" }, { "docid": "c9c794c3f71144b94d278cce348c284f", "score": "0.64445126", "text": "function TSPfromStartNode(cost,startNode){\n\tconst n = cost.length;\n\tconst d = new DP(1<<n,n);\n\n\td._(1<<startNode,startNode)._ = 0; //When starting from node startNode, the binary representation of the subset is 1 << startNode.\n \n\tfor(var s=0; s<(1<<n); s++){ //A set of visited nodes s\n\t\tfor(var i=0; i<n; i++){ //Full search for the last visited node i\n\t\t\tif(!(s&(1<<i))) continue; //It can not be yet visited to the last visited node\n\t\t\tfor(var j=0; j<n; j++){ //Full search for the next visited node j \n\t\t\t\tif(s&(1<<j)) continue; //It can not have already visited the next node to visit\n\t\t\t\td._(s|(1<<j),j)._ = Math.min(d.$(s|(1<<j),j), d.$(s,i)+cost[i][j]);\n\t\t\t}\n\t\t}\n\t}\n\treturn Math.min(...Array(n).fill().map((e,i)=> d.$((1<<n)-1, i))); \n //Search for the minimum value from the state of visiting all nodes (s = 1111 ...)\n}", "title": "" }, { "docid": "24c65ccab62cc60e3e5e6d6901ace582", "score": "0.6382082", "text": "findShortestPath(startNode, targetNode) {\n\n let distances = this.calcualateDistances(startNode);\n let pathStack = [];\n let vertex = targetNode;\n\n if (!distances.has(vertex)) return null;\n pathStack.push(vertex);\n\n do {\n vertex = distances.get(vertex).pred;\n pathStack.push(vertex);\n\n } while (vertex != startNode);\n\n return this.reverseArray(pathStack);\n }", "title": "" }, { "docid": "dc0451eb1dbaedd13b59ab3515ac965c", "score": "0.6362788", "text": "nextVertex(){\n const candidates = this.getCandidateVertices();\n //if there are candidates, find the one\n //with lowest cost\n if(candidates.length > 0){\n return candidates.reduce((prev, curr) => {\n return prev.cost < curr.cost ? prev : curr;\n });\n }else{\n //otherwise return null\n //this will help determine if we need to\n //iterate\n return null;\n }\n }", "title": "" }, { "docid": "adeb8b46a912b9fe0efdf3852d8ded01", "score": "0.6336236", "text": "pickSmallestCostFromOpenList() {\n let minCost = this.openList[0].dCost;\n let minIndex = 0;\n // if openList has nodes?\n this.openList.forEach((dStarNode, index) => {\n this.updateGeneralNode(dStarNode.generalNode, 2);\n if (dStarNode.dCost < minCost) {\n minCost = dStarNode.dCost;\n minIndex = index;\n }\n });\n return this.openList.splice(minIndex, 1)[0];\n }", "title": "" }, { "docid": "e0a7dc25f8d032ffb0c809a3f16d8cdd", "score": "0.6322637", "text": "function calculatePath()\n {\n //Nodes for the start and ending points\n var mypathStart = Node(null, {x:pathStart[0], y:pathStart[1]});\n var mypathEnd = Node(null, {x:pathEnd[0], y:pathEnd[1]});\n \n //Array used to track all nodes\n var AStar = new Array(worldSize);\n //List of nodes that have not been calculated\n var Open = [mypathStart];\n // Final path to be output by A*\n var result = [];\n\n //All available nearby nodes\n var myNeighbours;\n var myNode;\n var myPath;\n\n //Iterate through all nodes in the Open array\n var length, max, min, i, j;\n while(length = Open.length)\n {\n max = worldSize;\n min = -1;\n for(i = 0; i < length; i++)\n {\n if(Open[i].f < max)\n {\n max = Open[i].f;\n min = i;\n }\n }\n //Pop a value from the start of the array\n myNode = Open.splice(min, 1)[0];\n \n //Determine if the end of the path has been found\n if(myNode.value === mypathEnd.value)\n {\n myPath = myNode;\n do\n {\n result.push([myPath.x, myPath.y]);\n }\n while (myPath = myPath.Parent);\n AStar = Open = [];\n result.reverse();\n }\n else\n {\n //Add all adjacent nodes to the list of available nodes\n myNeighbours = Neighbours(myNode.x, myNode.y);\n \n for(i = 0, j = myNeighbours.length; i < j; i++)\n {\n myPath = Node(myNode, myNeighbours[i]);\n //Only check if the value has not been closed\n if (!AStar[myPath.value])\n {\n //Add the cost values for the current path\n myPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\n myPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n \n //Add this path to the array of possible paths toexplore\n Open.push(myPath);\n\n //Close this node for reuse\n AStar[myPath.value] = true;\n }\n }\n }\n } \n return result;\n }", "title": "" }, { "docid": "82369671b1aeb38069912431d92a5e10", "score": "0.6317418", "text": "function shortestPath(mat, init, end) {\r\n const paths = findPaths(mat, init, end);\r\n \r\n return paths.length <= 0 ? -1 : Math.min(...paths);\r\n }", "title": "" }, { "docid": "2bff17bdd831c8a802551a11835638ac", "score": "0.6292744", "text": "function calculatePath(terrain,startSpace,goalSpace,returnAllSolutions,raider) { \n\t/*find shortest path from startSpace to a space satisfying desiredProperty (note: path goes from end to start, not from start to end)*/\n\t//if startSpace meets the desired property, return it without doing any further calculations\n\tif (startSpace == goalSpace || (goalSpace == null && raider.canPerformTask(startSpace))) {\n\t\tif (!returnAllSolutions) {\n\t\t\treturn [startSpace];\n\t\t}\n\t\treturn [[startSpace]];\n\t}\n\t\n\t//initialize starting variables\n\tif (goalSpace != null) {\n\t\tgoalSpace.parents = [];\t\n\t}\n\t\n\tstartSpace.startDistance = 0;\n\tstartSpace.parents = [];\n\tvar closedSet = [];\n\tvar solutions = [];\n\tvar finalPathDistance = -1;\n\tvar openSet = [startSpace]; //TODO: we can speed up the algorithm quite a bit if we use hashing for lookup rather than lists\n\t//main iteration: keep popping spaces from the back until we have found a solution (or all equal solutions if returnAllSolutions is True) or openSet is empty (in which case there is no solution)\n\twhile (openSet.length > 0) {\n\t\t\t\t\n\t\tvar currentSpace = openSet.shift(); //TODO: keep the list sorted in reverse for this algorithm so that you can insert and remove from the back of the list rather than shifting all of the elements when inserting and removing (minor performance improvement)\n\t\tclosedSet.push(currentSpace);\n\t\tvar adjacentSpaces = [];\n\t\tadjacentSpaces.push(adjacentSpace(terrain,currentSpace.listX,currentSpace.listY,\"up\"));\n\t\tadjacentSpaces.push(adjacentSpace(terrain,currentSpace.listX,currentSpace.listY,\"down\"));\n\t\tadjacentSpaces.push(adjacentSpace(terrain,currentSpace.listX,currentSpace.listY,\"left\"));\n\t\tadjacentSpaces.push(adjacentSpace(terrain,currentSpace.listX,currentSpace.listY,\"right\"));\n\t\t\n\t\t//main inner iteration: check each space in adjacentSpaces for validity\n\t\tfor (var k = 0; k < adjacentSpaces.length; k++) {\n\t\t\t//if returnAllSolutions is True and we have surpassed finalPathDistance, exit immediately\n\t\t\tif ((finalPathDistance != -1) && (currentSpace.startDistance + 1 > finalPathDistance)) {\n\t\t\t\treturn solutions;\n\t\t\t}\n\t\t\t\n\t\t\tvar newSpace = adjacentSpaces[k];\n\t\t\t\n\t\t\t//check this here so that the algorithm is a little bit faster, but also so that paths to non-walkable terrain pieces (such as for drilling) will work\n\t\t\t//if the newSpace is a goal, find a path back to startSpace (or all equal paths if returnAllSolutions is True)\n\t\t\tif (newSpace == goalSpace || (goalSpace == null && raider.canPerformTask(newSpace))) {\n\t\t\t\tgoalSpace = newSpace;\n\t\t\t\tnewSpace.parents = [currentSpace]; //start the path with currentSpace and work our way back\n\t\t\t\tpathsFound = [[newSpace]];\n\t\t\t\t\n\t\t\t\t//grow out the list of paths back in pathsFound until all valid paths have been exhausted\n\t\t\t\twhile (pathsFound.length > 0) {\n\t\t\t\t\tif (pathsFound[0][pathsFound[0].length-1].parents[0] == startSpace) { //we've reached the start space, thus completing this path\n\t\t\t\t\t\tif (!returnAllSolutions) {\n\t\t\t\t\t\t\treturn pathsFound[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinalPathDistance = pathsFound[0].length;\n\t\t\t\t\t\tsolutions.push(pathsFound.shift());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//branch additional paths for each parent of the current path's current space\n\t\t\t\t\tfor (var i = 0; i < pathsFound[0][pathsFound[0].length-1].parents.length; i++) {\n\t\t\t\t\t\tif (i == pathsFound[0][pathsFound[0].length-1].parents.length - 1) {\n\t\t\t\t\t\t\tpathsFound[0].push(pathsFound[0][pathsFound[0].length-1].parents[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tpathsFound.push(pathsFound[0].slice());\n\t\t\t\t\t\t\tpathsFound[pathsFound.length-1].push(pathsFound[0][pathsFound[0].length-1].parents[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//attempt to keep branching from newSpace as long as it is a walkable type\n\t\t\tif ((newSpace != null) && (newSpace.walkable == true)) {\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tvar newStartDistance = currentSpace.startDistance + 1;\n\t\t\t\tvar notInOpenSet = openSet.indexOf(newSpace) == -1;\n\t\t\t\t\n\t\t\t\t//don't bother with newSpace if it has already been visited unless our new distance from the start space is smaller than its existing startDistance\n\t\t\t\tif ((closedSet.indexOf(newSpace) != -1) && (newSpace.startDistance < newStartDistance)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//accept newSpace if newSpace has not yet been visited or its new distance from the start space is equal to its existing startDistance\n\t\t\t\tif (notInOpenSet || newSpace.startDistance == newStartDistance) { \n\t\t\t\t\tif (notInOpenSet) { //only reset parent list if this is the first time we are visiting newSpace\n\t\t\t\t\t\tnewSpace.parents = [];\n\t\t\t\t\t}\n\t\t\t\t\tnewSpace.parents.push(currentSpace);\n\t\t\t\t\tnewSpace.startDistance = newStartDistance;\n\t\t\t\t\tif (notInOpenSet) { //if newSpace does not yet exist in the open set, insert it into the appropriate position using a binary search\n\t\t\t\t\t\topenSet.splice(binarySearch(openSet,newSpace,\"startDistance\",true),0,newSpace);\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}\n\tif (solutions.length == 0) { //if solutions is null then that means that no path was found\n\t\treturn null;\n\t}\n\treturn solutions; \n}", "title": "" }, { "docid": "5cab373b224a934dd5b513d43561b1ae", "score": "0.6281232", "text": "function pathfinder(originX, originY, destinationX, destinationY, limit) {\n let sub_grid = createSubGrid(originX, originY, destinationX, destinationY, limit);\n if (sub_grid.length > 0) {\n let height = sub_grid.length;\n let width = sub_grid[0].length;\n let solution_grid = Array.from(Array(height), () => new Array(width));\n solution_grid[0][0] = {'index': sub_grid[0][0].index, 'cost': 0};\n for (let i = 1; i < width; i++) {\n solution_grid[0][i] = {'index': sub_grid[0][i].index, 'cost': sub_grid[0][i].cost + solution_grid[0][i-1].cost}\n }\n\n for (let i = 1; i < height; i++) {\n solution_grid[i][0] = {'index': sub_grid[i][0].index, 'cost': sub_grid[i][0].cost + solution_grid[i-1][0].cost}\n }\n\n for (let row = 1; row < height; row++) {\n for (let col = 1; col < width; col++) {\n solution_grid[row][col] = {'index': sub_grid[row][col].index, 'cost': sub_grid[row][col].cost + Math.min(solution_grid[row-1][col].cost, solution_grid[row][col-1].cost)}\n }\n }\n console.log(solution_grid);\n return limit - (solution_grid[height-1][width-1].cost);\n }\n return -1;\n}", "title": "" }, { "docid": "5ae1f014ef459f0969e3649ae8ec9312", "score": "0.6237011", "text": "distanceOfShortestPath(start, end) { \n if (start === end) {\n return 0;\n }\n \n let queue = [start];\n let visited = new Set();\n let predecessors = {};\n let path = [];\n \n while (queue.length) {\n let currentVertex = queue.shift();\n\n if (currentVertex === end) {\n let stop = predecessors[end.value];\n while (stop) {\n path.push(stop);\n stop = predecessors[stop];\n }\n path.unshift(start.value);\n path.reverse();\n return path;\n }\n\n visited.add(currentVertex);\n for (let vertex of currentVertex.adjacent) {\n if (!visited.has(vertex)) {\n predecessors[vertex.value] = currentVertex.value;\n queue.push(vertex);\n }\n }\n }\n }", "title": "" }, { "docid": "327a8f2f06b3603d2f50f1c14c740981", "score": "0.62343186", "text": "function TSP(cost){\n\tconst n = cost.length;\n\tconst d = new DP(1<<n,n);\n \n\tfor(var s=0; s<(1<<n); s++){ //A set of visited nodes s\n\t\tfor(var i=0; i<n; i++){ //Full search for the last visited node i\n\t\t\tif(!(s&(1<<i))) continue; //It can not be yet visited to the last visited node\n\t\t\td._(1<<i,i)._ = 0; //When starting from node i, the binary representation of the subset is 1<<i.\n\t\t\tfor(var j=0; j<n; j++){ //Full search for the next visited node j \n\t\t\t\tif(s&(1<<j)) continue; //It can not have already visited the next node to visit\n\t\t\t\td._(s|(1<<j),j)._ = Math.min(d.$(s|(1<<j),j), d.$(s,i)+cost[i][j]);\n\t\t\t}\n\t\t}\n\t}\n\treturn Math.min(...Array(n).fill().map((e,i)=> d.$((1<<n)-1, i))); \n //Search for the minimum value from the state of visiting all nodes (s = 1111 ...)\n}", "title": "" }, { "docid": "e0c4ab6562453d00547b064e875a5cc2", "score": "0.62290645", "text": "findShortestPath(startCoordinates, endCoordinates) { \n\n let distanceFromLeft = startCoordinates.x;\n let distanceFromTop = startCoordinates.y;\n\n // Each \"location\" will store its coordinates\n // and the shortest path required to arrive there\n let location = {\n distanceFromTop: distanceFromTop,\n distanceFromLeft: distanceFromLeft,\n path: [],\n status: 'Start',\n coordinates:[]\n };\n\n // Initialize the queue with the start location already inside\n let queue = [location]; \n \n while (queue.length > 0) { \n // Take the first location off the queue\n let currentLocation = queue.shift(); \n let directions = [\"South\", \"East\",\"North\",\"West\",\"SouthEast\", \"NorthEast\",\"NorthWest\",\"SouthWest\"];\n for( let dir in directions){\n let newLocation = this.exploreInDirection(currentLocation, directions[dir]);\n if (newLocation.status === 'End') { \n newLocation.coordinates.push(endCoordinates); \n return newLocation;\n } else if (newLocation.status === 'Valid') {\n queue.push(newLocation);\n }\n }\n } \n // No valid path found\n return false;\n }", "title": "" }, { "docid": "edbc4ead28de70074c6410546743f281", "score": "0.62192655", "text": "function minPathSum(grid) {\n\n}", "title": "" }, { "docid": "026e965ba130bcb066bbae4c1aa87e36", "score": "0.6184484", "text": "pathCost(c, state1, action, state2) {\n\n }", "title": "" }, { "docid": "829f84d0246634161925f9c97e125206", "score": "0.61844355", "text": "Dijsktras(startNode, finish){\n const nodes = new PriorityQ();\n // stores the distance from the startNode\n const distances = {};\n // store the visited nodes\n const previous = {};\n // traversed Path\n let path = [], smallest;\n\n //Buliding the initial Value\n for(let vertex in this.adjacencyList){\n if(vertex === startNode){\n distances[vertex] = 0;\n nodes.enqueue(vertex,0);\n } else{\n distances[vertex] = Infinity;\n nodes.enqueue(vertex, Infinity);\n }\n }\n\n //while there's node in the PriorityQ\n while(nodes.values.length){\n smallest = nodes.dequeue().val;\n if(smallest === finish){\n // Done\n // Push the values in Path\n while(previous[smallest]){\n path.push(smallest);\n smallest = previous[smallest];\n }\n break;\n }\n\n if(smallest || distances[smallest] !== Infinity){\n for(let neighbor in this.adjacencyList[smallest]){\n // finding neighboring node\n let nextNode = this.adjacencyList[smallest][neighbor];\n // calculate the total distances\n let candidate = distances[smallest] + nextNode.weight;\n let nextNeighbor = nextNode.node;\n \n if(candidate < distances[nextNeighbor]){\n //updating new smallest distance\n distances[nextNeighbor] = candidate;\n //updating previous - How we got to neighbor\n previous[nextNeighbor] = smallest;\n //enqueue in priority queue with new priority\n nodes.enqueue(nextNeighbor, candidate);\n }\n }\n }\n \n } \n // returning path in reverse order as we build it in reverse order\n return path.concat(\"A\").reverse();; \n }", "title": "" }, { "docid": "41b158969955fe9e94d37d7302136daa", "score": "0.6155792", "text": "cost(nodeFather,neighboorCoords){\n /*console.log(\"cost\")\n console.log(\"cost padre\")\n console.log(nodeFather.coordinate)*/\n let size = this.board.length;\n let fatherRow = Math.floor(nodeFather.coordinate / size);\n let fatherCol = nodeFather.coordinate % size;\n let neighboorRow = Math.floor(neighboorCoords / size);\n let neighboorCol = neighboorCoords % size;\n if (this.board[fatherRow][fatherCol] === this.idAgent){\n //el padre tiene una jugada propia\n if(this.board[neighboorRow][neighboorCol] === 0){\n //console.log(\"el vecino no tiene jugada pero padre si \")\n //si el vecino NO tiene jugada\n //costo vecino es el del padre mas uno\n return nodeFather.weigth + 1;\n //se reemplaza si tiene valor mejor al anterior\n }else{\n if(this.board[neighboorRow][neighboorCol] === this.idAgent){\n //si el vecino tiene jugada propia \n //costo vecino es el mismo que llegar al padre\n return nodeFather.weigth;\n //se reemplaza si existe\n }else{\n //si el vecino tiene jugada del oponente\n //costo vecino es infinito\n return Infinity;\n }\n }\n }else{\n if(this.board[fatherRow][fatherCol] === 0){\n //el padre tiene no tienen jugada\n if(this.board[neighboorRow][neighboorCol] === 0){\n //console.log(\"vecino no tiene jugada y padre tampoco\")\n //si el vecino NO tiene jugada\n //costo vecino es el del padre mas uno\n return nodeFather.weigth + 1;\n //se reemplaza si tiene un valor menor al que ya existe\n\n }else{\n if(this.board[neighboorRow][neighboorCol] === this.idAgent){\n //si el vecino tiene jugada propia\n //costo vecino es el costo del padre\n return nodeFather.weigth;\n //y si ya existe se reemplaza\n \n \n }else{\n //si el vecino tiene jugada del oponente\n //costo vecino es infinito\n return Infinity;\n //reemplazar el que exista si no es infinito\n }\n }\n }else{\n //el padre tiene una jugada del oponente\n return Infinity\n }\n }\n \n }", "title": "" }, { "docid": "e39861fc1817335ef1f5afb6c5cfb95a", "score": "0.61340725", "text": "function BoardLite_Path_Min_getDist(b, turn) { //G* - Distance only\n \n var pawn = b[turn]; \n \n g_breadcrumbs = g_breadcrumbs.fill(FLOOR_SPACES); //Use for distance\n g_breadcrumbs[pawn] = 0; \n var pawnTheoMin = THEORETICAL_MIN[turn][pawn];\n\n g_stack[0] = pawn;\n var stackTop = 1;\n\n var minPathLength = FLOOR_SPACES; //Current best\n \n \n //The following label is used to 'continue' from a nested loop \n mainLoop:\n\twhile (stackTop > 0) {\n var topPos = g_stack[--stackTop]; //Pop the stack \n var dist = g_breadcrumbs[topPos]+1;\n \n if (dist+THEORETICAL_MIN[turn][topPos] >= minPathLength) continue; //Already have a better solution\n \n var searchDests = SEARCH_DESTS_BY_PLAYER_POS[turn][topPos]; \n for (var d = 0; d < searchDests.length; d+=3) {\n \n var dir = searchDests[d]; //Dir \n var destR = searchDests[d+1]; //DestR\n var dest = searchDests[d+2]; //Dest pos\n \n if (dist >= g_breadcrumbs[dest]) continue; //Already checked - or not better\n else if (BoardLite_isWallBetween(b, topPos, dir)) continue; //Wall between\n else if (destR == WIN_ROWS[turn]) { //End reached \n\n //Straight line - Can't do better than this \n if (dist == pawnTheoMin) return pawnTheoMin;\n \n\n //Maybe not min - see if any other ones in the stack need to be considered\n else if (dist < minPathLength) {\n minPathLength = dist;\n do { //Pop down looking for better \n var potentialPos = g_stack[--stackTop]; \n var theoDist = g_breadcrumbs[potentialPos]+THEORETICAL_MIN[turn][potentialPos]; \n if (theoDist < minPathLength) {\n stackTop++; //Add back to stack\n continue mainLoop; \n }\n }\n while (stackTop > 0);\n \n //Nothing better found, so this must be the min\n return minPathLength; \n } \n }\n \n g_stack[stackTop++] = dest; //Push on to stack\n g_breadcrumbs[dest] = dist; \n }\n\n }\n \n if (minPathLength == FLOOR_SPACES) throw new Error('BoardLite_Path_Min_getDist: no path available- ' + BoardLite_toString(b, turn)); \n return minPathLength; \n}", "title": "" }, { "docid": "14040d284dfb2bb78811cea573ec6d53", "score": "0.6125253", "text": "solve(estDistance) {\n let openSet = new MinHeap();\n let closedSet = new Set();\n this.openSetList.length = 0;\n this.closedSetList.length = 0;\n\n let startTile = this.grid.startTile;\n let endTile = this.grid.endTile;\n\n startTile.pathCostToTile = 0;\n let priority = 0;\n openSet.add(startTile, priority);\n\n while (openSet.size > 0) {\n let current = openSet.pop();\n if (current === endTile) {\n this.goal = current;\n if (this.shouldVisualize) {\n this.visualize();\n } else {\n this.tracePath()\n }\n return true;\n }\n let neighbours = this.grid.getNeighbourTiles(current);\n let newOpenSet = new Set();\n for (let i = 0; i < neighbours.length; i++) {\n const neighbour = neighbours[i];\n let tentativePathCostToTile = current.pathCostToTile + 1;\n if (tentativePathCostToTile < neighbour.pathCostToTile) {\n neighbour.cameFromTile = current;\n neighbour.pathCostToTile = tentativePathCostToTile;\n priority = tentativePathCostToTile;\n priority += this.breakTies(current, neighbour);\n openSet.add(neighbour, priority);\n newOpenSet.add(neighbour);\n closedSet.delete(neighbour);\n }\n }\n closedSet.add(current);\n this.openSetList.push(newOpenSet);\n this.closedSetList.push(current);\n }\n\n this.goal = this.getClosest(closedSet, endTile, estDistance);\n if (!this.goal.isStart)\n if (this.shouldVisualize) {\n this.visualize();\n } else {\n this.tracePath()\n }\n return false;\n }", "title": "" }, { "docid": "71b0c0151aacccb1f766ce1fe8bcd34e", "score": "0.6119693", "text": "shortestPath(startIndex, destinationIndex, mapArray, mapWidthInTiles, obstacleGids = [], heuristic = 'manhattan', useDiagonalNodes = true) {\n // The `nodes` function creates the array of node objects\n const nodes = (mapArray, mapWidthInTiles) => mapArray.map((cell, index) => {\n // Figure out the row and column of this cell\n const column = index % mapWidthInTiles\n const row = Math.floor(index / mapWidthInTiles) // The node object\n\n return {\n f: 0,\n g: 0,\n h: 0,\n parent: null,\n column,\n row,\n index\n }\n }) // Initialize theShortestPath array\n\n\n const theShortestPath = [] // Initialize the node map\n\n const nodeMap = nodes(mapArray, mapWidthInTiles) // Initialize the closed and open list arrays\n\n const closedList = []\n let openList = [] // Declare the \"costs\" of travelling in straight or\n // diagonal lines\n\n const straightCost = 10\n const diagonalCost = 14 // Get the start node\n\n const startNode = nodeMap[startIndex] // Get the current center node. The first one will\n // match the path's start position\n\n let centerNode = startNode // Push the `centerNode` into the `openList`, because\n // it's the first node that we're going to check\n\n openList.push(centerNode) // Get the current destination node. The first one will\n // match the path's end position\n\n const destinationNode = nodeMap[destinationIndex] // All the nodes that are surrounding the current map index number\n\n const surroundingNodes = (index, mapArray, mapWidthInTiles, useDiagonalNodes) => {\n // Find out what all the surrounding nodes are, including those that\n // might be beyond the borders of the map\n const allSurroundingNodes = [nodeMap[index - mapWidthInTiles - 1], nodeMap[index - mapWidthInTiles], nodeMap[index - mapWidthInTiles + 1], nodeMap[index - 1], nodeMap[index + 1], nodeMap[index + mapWidthInTiles - 1], nodeMap[index + mapWidthInTiles], nodeMap[index + mapWidthInTiles + 1]] // Optionaly exlude the diagonal nodes, which is often perferable\n // for 2D maze games\n\n const crossSurroundingNodes = [nodeMap[index - mapWidthInTiles], nodeMap[index - 1], nodeMap[index + 1], nodeMap[index + mapWidthInTiles]] // Use either `allSurroundingNodes` or `crossSurroundingNodes` depending\n // on the the value of `useDiagonalNodes`\n\n let nodesToCheck\n\n if (useDiagonalNodes) {\n nodesToCheck = allSurroundingNodes\n } else {\n nodesToCheck = crossSurroundingNodes\n } // Find the valid sourrounding nodes, which are ones inside\n // the map border that don't incldue obstacles. Change `allSurroundingNodes`\n // to `crossSurroundingNodes` to prevent the path from choosing diagonal routes\n\n\n const validSurroundingNodes = nodesToCheck.filter(node => {\n // The node will be beyond the top and bottom edges of the\n // map if it is `undefined`\n const nodeIsWithinTopAndBottomBounds = node !== undefined // Only return nodes that are within the top and bottom map bounds\n\n if (nodeIsWithinTopAndBottomBounds) {\n // Some Boolean values that tell us whether the current map index is on\n // the left or right border of the map, and whether any of the nodes\n // surrounding that index extend beyond the left and right borders\n const indexIsOnLeftBorder = index % mapWidthInTiles === 0\n const indexIsOnRightBorder = (index + 1) % mapWidthInTiles === 0\n const nodeIsBeyondLeftBorder = node.column % (mapWidthInTiles - 1) === 0 && node.column !== 0\n const nodeIsBeyondRightBorder = node.column % mapWidthInTiles === 0 // Find out whether of not the node contains an obstacle by looping\n // through the obstacle gids and and returning `true` if it\n // finds any at this node's location\n\n const nodeContainsAnObstacle = obstacleGids.some(obstacle => mapArray[node.index] === obstacle) // If the index is on the left border and any nodes surrounding it are beyond the\n // left border, don't return that node\n\n if (indexIsOnLeftBorder) {\n // console.log(\"left border\")\n return !nodeIsBeyondLeftBorder\n } // If the index is on the right border and any nodes surrounding it are beyond the\n // right border, don't return that node\n else if (indexIsOnRightBorder) {\n // console.log(\"right border\")\n return !nodeIsBeyondRightBorder\n } // Return `true` if the node doesn't contain any obstacles\n else if (nodeContainsAnObstacle) {\n return false\n } // The index must be inside the area defined by the left and right borders,\n // so return the node\n // console.log(\"map interior\")\n\n\n return true\n }\n }) // console.log(validSurroundingNodes)\n // Return the array of `validSurroundingNodes`\n\n return validSurroundingNodes\n } // Diagnostic\n // console.log(nodeMap);\n // console.log(centerNode);\n // console.log(destinationNode);\n // console.log(wallMapArray);\n // console.log(surroundingNodes(86, mapArray, mapWidthInTiles));\n // Heuristic methods\n // 1. Manhattan\n\n\n const manhattan = (testNode, destinationNode) => {\n const h = Math.abs(testNode.row - destinationNode.row) * straightCost + Math.abs(testNode.column - destinationNode.column) * straightCost\n return h\n } // 2. Euclidean\n\n\n const euclidean = (testNode, destinationNode) => {\n let vx = destinationNode.column - testNode.column\n let vy = destinationNode.row - testNode.row\n let h = Math.floor(Math.sqrt(vx * vx + vy * vy) * straightCost)\n return h\n } // 3. Diagonal\n\n\n const diagonal = (testNode, destinationNode) => {\n let vx = Math.abs(destinationNode.column - testNode.column)\n let vy = Math.abs(destinationNode.row - testNode.row)\n let h = 0\n\n if (vx > vy) {\n h = Math.floor(diagonalCost * vy + straightCost * (vx - vy))\n } else {\n h = Math.floor(diagonalCost * vx + straightCost * (vy - vx))\n }\n\n return h\n } // Loop through all the nodes until the current `centerNode` matches the\n // `destinationNode`. When they they're the same we know we've reached the\n // end of the path\n\n\n while (centerNode !== destinationNode) {\n // Find all the nodes surrounding the current `centerNode`\n const surroundingTestNodes = surroundingNodes(centerNode.index, mapArray, mapWidthInTiles, useDiagonalNodes) // Loop through all the `surroundingTestNodes` using a classic `for` loop\n // (A `for` loop gives us a marginal performance boost)\n\n for (let i = 0; i < surroundingTestNodes.length; i++) {\n // Get a reference to the current test node\n const testNode = surroundingTestNodes[i] // Find out whether the node is on a straight axis or\n // a diagonal axis, and assign the appropriate cost\n // A. Declare the cost variable\n\n let cost = 0 // B. Do they occupy the same row or column?\n\n if (centerNode.row === testNode.row || centerNode.column === testNode.column) {\n // If they do, assign a cost of \"10\"\n cost = straightCost\n } else {\n // Otherwise, assign a cost of \"14\"\n cost = diagonalCost\n } // C. Calculate the costs (g, h and f)\n // The node's current cost\n\n\n const g = centerNode.g + cost // The cost of travelling from this node to the\n // destination node (the heuristic)\n\n let h\n\n switch (heuristic) {\n case 'manhattan':\n h = manhattan(testNode, destinationNode)\n break\n\n case 'euclidean':\n h = euclidean(testNode, destinationNode)\n break\n\n case 'diagonal':\n h = diagonal(testNode, destinationNode)\n break\n\n default:\n throw new Error('Oops! It looks like you misspelled the name of the heuristic')\n } // The final cost\n\n\n const f = g + h // Find out if the testNode is in either\n // the openList or closedList array\n\n const isOnOpenList = openList.some(node => testNode === node)\n const isOnClosedList = closedList.some(node => testNode === node) // If it's on either of these lists, we can check\n // whether this route is a lower-cost alternative\n // to the previous cost calculation. The new G cost\n // will make the difference to the final F cost\n\n if (isOnOpenList || isOnClosedList) {\n if (testNode.f > f) {\n testNode.f = f\n testNode.g = g\n testNode.h = h // Only change the parent if the new cost is lower\n\n testNode.parent = centerNode\n }\n } // Otherwise, add the testNode to the open list\n else {\n testNode.f = f\n testNode.g = g\n testNode.h = h\n testNode.parent = centerNode\n openList.push(testNode)\n } // The `for` loop ends here\n\n } // Push the current centerNode into the closed list\n\n\n closedList.push(centerNode) // Quit the loop if there's nothing on the open list.\n // This means that there is no path to the destination or the\n // destination is invalid, like a wall tile\n\n if (openList.length === 0) {\n return theShortestPath\n } // Sort the open list according to final cost\n\n\n openList = openList.sort((a, b) => a.f - b.f) // Set the node with the lowest final cost as the new centerNode\n\n centerNode = openList.shift() // The `while` loop ends here\n } // Now that we have all the candidates, let's find the shortest path!\n\n\n if (openList.length !== 0) {\n // Start with the destination node\n let testNode = destinationNode\n theShortestPath.push(testNode) // Work backwards through the node parents\n // until the start node is found\n\n while (testNode !== startNode) {\n // Step through the parents of each node,\n // starting with the destination node and ending with the start node\n testNode = testNode.parent // Add the node to the beginning of the array\n\n theShortestPath.unshift(testNode) // ...and then loop again to the next node's parent till you\n // reach the end of the path\n }\n } // Return an array of nodes that link together to form\n // the shortest path\n\n\n return theShortestPath\n }", "title": "" }, { "docid": "cae9934baab0cf16e61acf1a13aa74b8", "score": "0.61162996", "text": "function CalcPathToPlayer()\n{\n\tplayerCell = playerMovementScript.currentCell;\n\t\t\n\tfor(var doorCheckNow : GameObject in currentCell.GetComponent(AIpathCellScript).doors)\n\t{\n\t\tfor(var i:int = 0; i < doorCheckNow.GetComponent(AIpathDoorScript).cells.length; i++)\n\t\t{\n\t\t\tif(doorCheckNow.GetComponent(AIpathDoorScript).cells[i] == playerCell)\n\t\t\t{\n\t\t\t\tif(doorCheckNow.GetComponent(AIpathDoorScript).doorsToCells[i] < shortestPathSoFar)\n\t\t\t\t{\n\t\t\t\t\tgoalDoor = doorCheckNow;\n\t\t\t\t\tshortestPathSoFar = doorCheckNow.GetComponent(AIpathDoorScript).doorsToCells[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tshortestPathSoFar = Mathf.Infinity;\t\n}", "title": "" }, { "docid": "f1d34c018d6ff55a9cd16995ea444d58", "score": "0.6110342", "text": "function calculatePath()\n\t\t{\n\t\t\t// create Nodes from the Start and End x,y coordinates\n\t\t\tvar\tmypathStart = Node(null, {x:pathStart.x, y:pathStart.y});\n\t\t\tvar mypathEnd = Node(null, {x:pathEnd.x, y:pathEnd.y});\n\t\t\t// create an array that will contain all world cells\n\t\t\tvar AStar = new Array(worldSize);\n\t\t\t// list of currently open Nodes\n\t\t\tvar Open = [mypathStart];\n\t\t\t// list of closed Nodes\n\t\t\tvar Closed = [];\n\t\t\t// list of the final output array\n\t\t\tvar result = [];\n\t\t\t// reference to a Node (that is nearby)\n\t\t\tvar myNeighbours;\n\t\t\t// reference to a Node (that we are considering now)\n\t\t\tvar myNode;\n\t\t\t// reference to a Node (that starts a path in question)\n\t\t\tvar myPath;\n\t\t\t// temp integer variables used in the calculations\n\t\t\tvar length, max, min, i, j;\n\t\t\t// iterate through the open list until none are left\n\t\t\twhile(length = Open.length)\n\t\t\t{\n\t\t\t\tmax = worldSize;\n\t\t\t\tmin = -1;\n\t\t\t\tfor(i = 0; i < length; i++)\n\t\t\t\t{\n\t\t\t\t\tif(Open[i].f < max)\n\t\t\t\t\t{\n\t\t\t\t\t\tmax = Open[i].f;\n\t\t\t\t\t\tmin = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// grab the next node and remove it from Open array\n\t\t\t\tmyNode = Open.splice(min, 1)[0];\n\t\t\t\t// is it the destination node?\n\t\t\t\tif(myNode.value === mypathEnd.value)\n\t\t\t\t{\n\t\t\t\t\tmyPath = Closed[Closed.push(myNode) - 1];\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tresult.push([myPath.x, myPath.y]);\n\t\t\t\t\t}\n\t\t\t\t\twhile (myPath = myPath.Parent);\n\t\t\t\t\t// clear the working arrays\n\t\t\t\t\tAStar = Closed = Open = [];\n\t\t\t\t\t// we want to return start to finish\n\t\t\t\t\tresult.reverse();\n\t\t\t\t}\n\t\t\t\telse // not the destination\n\t\t\t\t{\n\t\t\t\t\t// find which nearby nodes are walkable\n\t\t\t\t\tmyNeighbours = Neighbours(myNode.x, myNode.y);\n\t\t\t\t\t// test each one that hasn't been tried already\n\t\t\t\t\tfor(i = 0, j = myNeighbours.length; i < j; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tmyPath = Node(myNode, myNeighbours[i]);\n\t\t\t\t\t\tif (!AStar[myPath.value])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// estimated cost of this particular route so far\n\t\t\t\t\t\t\tmyPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\n\t\t\t\t\t\t\t// estimated cost of entire guessed route to the destination\n\t\t\t\t\t\t\tmyPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n\t\t\t\t\t\t\t// remember this new path for testing above\n\t\t\t\t\t\t\tOpen.push(myPath);\n\t\t\t\t\t\t\t// mark this node in the world graph as visited\n\t\t\t\t\t\t\tAStar[myPath.value] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// remember this route as having no more untested options\n\t\t\t\t\tClosed.push(myNode);\n\t\t\t\t}\n\t\t\t} // keep iterating until the Open list is empty\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "d398bd92897d73bacd85e1421e665840", "score": "0.60600954", "text": "function estimateCost(from, endPoints) {\n\t\n\t var min = Infinity;\n\t\n\t for (var i = 0, len = endPoints.length; i < len; i++) {\n\t var cost = from.manhattanDistance(endPoints[i]);\n\t if (cost < min) min = cost;\n\t };\n\t\n\t return min;\n\t }", "title": "" }, { "docid": "9f60a7206699b3df141fe289769067de", "score": "0.6038395", "text": "function dijkstraAlgorithm(originNode,graph){\n\n const maxCost = (Number.MAX_VALUE - 1); // constante para custo máximo de caminho de um nó a outro.\n d = [ maxCost, maxCost, maxCost, maxCost, maxCost, maxCost, maxCost, maxCost]; // é o vetor de distâncias da origem até cada destino\n pi = [ -1, -1, -1, -1, -1, -1, -1, -1]; // identifica o vértice de onde se origina uma conexão até v de maneira a formar um caminho mínimo\n d[originNode] = 0; // distancia inicial para o nó de origem.\n \n Q = [0, 1, 2, 3, 4, 5, 6, 7]; // vertices\n \n while( Q.length > 0){\n \n dInQ = d.map( (dist, index) => !Q.includes(index) ? maxCost + 1 : dist ); // vector dist in Q. obs: Foi utilizado (maxCost+1) para indicar que aquela distancia ja foi calculada.\n u = indexOfSmallest(dInQ);\n Q = Q.filter(v => v != u);\n adjacents = graph[u].adjacents;\n adjacents.forEach(v => {\n\n if (d[v.node] > d[u] + v.cost ){ // se existe um caminho mais curto\n d[v.node] = d[u] + v.cost; // atualzia o custo do caminho\n pi[v.node] = u; // atualiza a referência do caminho \n }\n\n });\n \n }\n\n return { dist: d, lastPaths : pi }; // retorna o vetor de menores distancias e os últimos caminhos para cada nó \n\n}", "title": "" }, { "docid": "ee599b5b0d4d62e5da0c83943f03408e", "score": "0.60293895", "text": "paint(costs) {\n if (!costs || !costs.length) return 0;\n \n for (let i = 1; i < costs.length; i++) {\n costs[i][0] += Math.min(costs[i - 1][1], costs[i - 1][2]);\n costs[i][1] += Math.min(costs[i - 1][0], costs[i - 1][2]);\n costs[i][2] += Math.min(costs[i - 1][0], costs[i - 1][1]);\n }\n \n return Math.min(...costs[costs.length - 1])\n }", "title": "" }, { "docid": "c1fcc56e0016d5674455cc4bc57ebb20", "score": "0.60251695", "text": "genPath(fromID, fromMajor, toID, path = [fromID]) {\n\n //Base case, will fire once a suitable node is found.\n if (fromID == toID) {\n return {path: path, length: path.length}\n }\n\n //Get the current from node and start looking for candidate paths.\n const fromNode = this.hallways[fromID];\n let candidates = [];\n\n //Try to filter out branches in the opposite direction of motion to prevent U turns unless absolutely necessary.\n let filteredBranches = fromNode.branches.filter(b => b.major == fromMajor);\n if (filteredBranches.length == 0) {\n filteredBranches = fromNode.branches;\n }\n\n //Go through each branch and use it as a root for candidate path.\n for (let i = 0; i < filteredBranches.length; i++) {\n let branch = filteredBranches[i];\n\n //Prevent backtracking.\n if (!path.includes(branch.id)) {\n const updatedPath = [...path, branch.id];\n //Keep track of relative direction, whether up or down the hallway.\n //Necessary for guidance.\n let newDirection = 0;\n\n //This was needed to handle all exception cases for relative guidance.\n if (branch.minor == 0) {\n newDirection = branch.major;\n } else {\n if (branch.major == branch.minor) {\n newDirection = MAJOR.UP;\n } else {\n newDirection = MAJOR.DOWN;\n }\n if (fromNode.horizontal) {\n newDirection = -newDirection;\n }\n }\n\n //Push the candidate.\n candidates.push(this.genPath(branch.id, newDirection, toID, updatedPath));\n }\n }\n //Look for the shortest candidate\n let min = {path: undefined, length: undefined};\n candidates.forEach(candidate => {\n if ((min.length == undefined && candidate.length != undefined || candidate.length < min.length) && candidate.path[candidate.path.length - 1] == toID) {\n min = candidate;\n }\n });\n if (min.path == undefined) {\n return min;\n } else {\n return min;\n }\n }", "title": "" }, { "docid": "d18414b4a6f015972ed4471a0d377bba", "score": "0.6013616", "text": "function minCost(arr, index, X, Y, sum, hashMap) {\n // base cases\n if(sum <= 0) return 0; // adding <= because even if we generate more energy than required with min. cost it will be fine\n if(index >= arr.length) return Infinity;\n\n // using hashMap to re-use existing computed solution\n let hashKey = index + \"_\" + sum;\n if(hashMap.hasOwnProperty(hashKey)) {\n return hashMap[hashKey];\n }\n\n let noPlantInstCost = minCost(arr, index+1, X, Y, sum, hashMap);\n let xPlantInstCost = minCost(arr, index+1, X, Y, sum - arr[index] , hashMap) + X;\n let yPlantInstCost = minCost(arr, index+1, X, Y, sum - (2 * arr[index]) , hashMap) + Y;\n\n let cost = Math.min(noPlantInstCost, xPlantInstCost, yPlantInstCost);\n hashMap[hashKey] = cost;\n return hashMap[hashKey];\n}", "title": "" }, { "docid": "5678b4013e034bbb82ad2a2013b59342", "score": "0.6011493", "text": "function least(start, finish) {\n if (finish[0] == start[0] && finish[1] == start[1]) {\n return 0;\n } else if (finish[0] < start[0] || finish[1] < start[1]) {\n return 'impossible';\n }\n\n if (finish[0] < finish[1]) {\n return least(start, [finish[0], finish[1] - finish[0]]) + 1;\n } else if (finish[1] < finish[0]) {\n return least(start, [finish[0] - finish[1], finish[1]]) + 1;\n } else if (finish[0] == finish[1]) {\n return 'impossible';\n }\n}", "title": "" }, { "docid": "9f9074d58bdd588a141acc4e2cc58e5d", "score": "0.6004861", "text": "getGraph() {\r\n\t\tthis.nodes = [];\r\n\r\n\t\t// set initial node at start\r\n\t\tthis.addNode(null, this.sx, this.sy); \r\n\r\n\t\t// iterate until max nodes is reached\r\n\t\twhile(!this.hasPath && this.nodes.length < this.max_nodes) {\r\n\t\t\tvar pos = this.getRandomVectorWithinExpansion(); // get a position vector within the expansion circle\r\n\r\n\t\t\t// go through all nodes and see if they are connectable, if connectable, add the to the tree the one with the lowest cost (half RRT*)\r\n\t\t\tvar lowest_cost_node = null;\r\n\t\t\tvar lowest_cost = 10000;\r\n\t\t\tfor(var i = 0; i < this.nodes.length; i++) {\r\n\t\t\t\tvar node = this.nodes[i];\r\n\r\n\t\t\t\t// find lowest cost connecting node\r\n\t\t\t\tvar distance = this.feasibleDistancePathToNode(node, pos.x, pos.y);\r\n\t\t\t\tif(distance != false) {\r\n\t\t\t\t\tvar cost = node.cost + distance;\r\n\t\t\t\t\tif(cost < lowest_cost) {\r\n\t\t\t\t\t\tlowest_cost = cost;\r\n\t\t\t\t\t\tlowest_cost_node = node;\r\n\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\t// add node\r\n\t\t\tif(lowest_cost_node != null) {\r\n\t\t\t\tthis.addNode(lowest_cost_node, pos.x, pos.y);\r\n\t\t\t\tvar last_node = this.nodes[this.nodes.length-1];\r\n\r\n\t\t\t\t// check if graph has reached the goal\r\n\t\t\t\tif(pos.x > this.gx && pos.y > this.gy && pos.x < this.gx + this.gw && pos.y < this.gy + this.gh) {\r\n\t\t\t\t\tif(this.search_for_optimal) this.goal_reached_nodes.push(last_node);\r\n\t\t\t\t\telse this.getPathFromGraph();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.search_for_optimal) this.getPathFromGraphReachedNodes();\r\n\t}", "title": "" }, { "docid": "7c2e5cd557ff30126141677d599d4eac", "score": "0.6002265", "text": "shortestPath()\n {\n \tvar visited = []; \n\t\tvar stack = []; \n // Mark all the vertices as not visited\n\t\tfor(var i=0;i<this.len;i++) visited[i] = false; \n // Call the recursive helper function to store\n // Topological Sort starting from all vertices\n // one by one\n for (var i = 0; i < this.len; i++) {\n \tif (visited[i] == false)\n this.topologicalSortUtil(this.v.vertices[i], visited, stack);\n \t}\n \t\n // Initialize distances to all vertices as infinite and\n // distance to source as 0\n var dist = new Array(this.len).fill(Number.MAX_SAFE_INTEGER); \n \n dist[stack[stack.length-1]] = 0;\n // Process vertices in topological order\n while(stack.length>0)\n {\n // Get the next vertex from topological order\n var u = stack.pop();\n\n // Update distances of all adjacent vertices\n if (dist[u] !== Number.MAX_SAFE_INTEGER)\n {\n var it = this.v.adjList.items[u]\n for(var i=0; i<it.length;i++) {\n \tvar node = it[i].w\n \tvar weight = it[i].negWeight\n\t\t \tif (dist[node] > dist[u] + weight)\n dist[node] = dist[u] + weight\n\t\t }\n }\n }\n \n // Print the calculated shortest distances\n /*\n for (var i = 0; i < this.len; i++)\n {\n if (dist[i] == Number.MAX_SAFE_INTEGER)\n \tconsole.log(\"INF \"); \n else\n console.log(dist[i]);\n }\n */\n // Negate back \n return -1*dist[dist.length-1]; \n }", "title": "" }, { "docid": "d264754c7f4207924a30d050fce51b81", "score": "0.599788", "text": "computePath(stTile, endTiles, distToleranceStop) {\n\t\t\tlet startNode = new Node(stTile),\n\t\t\t\tendNodes = [];\n\n\t\t\tfor (let tile of endTiles) {\n\t\t\t\tendNodes.push(new Node(tile))\n\t\t\t}\n\n\t\t\t// if visited visited[id] is the node with id\n\t\t\tlet visited = [],\n\t\t\t\tOPEN = [startNode], currNode;\n\n\t\t\t// startNode was visited\n\t\t\tvisited[startNode.id] = startNode;\n\n\t\t\tthis.algorithmStartTime = new Date().getTime();\n\n\t\t\twhile (OPEN.length) {\n\t\t\t\t// probably not going to find a path. don't let the user waiting (the game is probably going to freeze)\n\t\t\t\tif (new Date().getTime() - this.algorithmStartTime > AStar.MAX_WAIT_TIME) {\n\t\t\t\t\t// no solution\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// get first element\n\t\t\t\tcurrNode = OPEN.shift();\n\n\t\t\t\t/*console.log(\"OPEN\", OPEN);\n\t\t\t\tconsole.log(\"currNode\", currNode);\n\t\t\t\tdebugger;*/\n\n\t\t\t\tif (distToleranceStop !== undefined) {\n\t\t\t\t\tif (currNode.f !== 0 && currNode.f <= distToleranceStop) {\n\t\t\t\t\t\treturn currNode.getPath();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if we reached any of the endNodes\n\t\t\t\tfor (let endNode of endNodes) {\n\t\t\t\t\tif (currNode.equals(endNode)) {\n\t\t\t\t\t\treturn currNode.getPath();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet successorTiles = currNode.getSuccessors();\n\n\t\t\t\tfor (let succTile of successorTiles) {\n\t\t\t\t\tlet successorNode = new Node(succTile, currNode), visitedNode;\n\n\t\t\t\t\t// distance from the start node to this node\n\n\t\t\t\t\t/*successorNode.g = currNode.g + this.distanceFunction(Node.translateToMapCoords(currNode.tile),\n\t\t\t\t\t\tNode.translateToMapCoords(succTile));*/\n\n\t\t\t\t\t// f is the minimum distance to one of the endTiles\n\t\t\t\t\tsuccessorNode.f = Infinity;\n\n\t\t\t\t\tfor (let endTile of endTiles) {\n\t\t\t\t\t\tsuccessorNode.f = Math.min(successorNode.f, this.distanceFunction(Node.translateToMapCoords(endTile),\n\t\t\t\t\t\t\tNode.translateToMapCoords(succTile)));\n\t\t\t\t\t}\n\n\t\t\t\t\t// this node was already visited so we check if this time we\n\t\t\t\t\t// improved the distance to it and update it accordingly\n\t\t\t\t\tif ((visitedNode = visited[successorNode.id])) {\n\t\t\t\t\t\tif (visitedNode.f > successorNode.f && !visitedNode.equals(currNode.parentNode)) {\n\t\t\t\t\t\t\t// update the values with the better values\n\t\t\t\t\t\t\tvisitedNode.f = successorNode.f;\n\t\t\t\t\t\t\t//visitedNode.g = successorNode.g;\n\t\t\t\t\t\t\tvisitedNode.parentNode = currNode;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// hasn't been visited before\n\t\t\t\t\telse {\n\t\t\t\t\t\tvisited[successorNode.id] = successorNode;\n\t\t\t\t\t\tsuccessorNode.parentNode = currNode;\n\t\t\t\t\t\tOPEN.push(successorNode);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// sort ascending by f values, descending by g values\n\t\t\t\tOPEN.sort(function (a, b) {\n\t\t\t\t\treturn a.f - b.f;\n\t\t\t\t});\n\t\t\t}\n\t\t\t// no solution\n\t\t\treturn null;\n\t\t}", "title": "" }, { "docid": "31a51e152c4339621124d43250bc9405", "score": "0.59830797", "text": "function evaluateCost(node){\n // heuristic: cost = cost so far (depth) + distance for each block to destination\n let thisGrid = node.state.stateGrid;\n let cost = node.depth;\n for(let i in thisGrid){\n for(let j in thisGrid[i]){\n if(thisGrid[i][j] != 0 && thisGrid[i][j] != \"*\"){\n\n let xDist = Math.abs(parseInt(j) - goalCoords[thisGrid[i][j]].x);\n let yDist = Math.abs(parseInt(i) - goalCoords[thisGrid[i][j]].y);\n cost += (xDist + yDist);\n }\n }\n }\n node.pathCost = cost;\n }", "title": "" }, { "docid": "fe6ff7150d3d2f646ae56a119e4f6113", "score": "0.5976146", "text": "function shortestPath(graph, start, end) {\n var distance = {};\n var visited = {};\n var queue = [graph.vertices[start]];\n var current;\n var currentValue;\n \n for(var i in graph.vertices) {\n if(graph.vertices[i].value === start) {\n distance[graph.vertices[i].value] = 0; \n }\n else {\n distance[graph.vertices[i].value] = Number.POSITIVE_INFINITY;\n }\n visited[graph.vertices[i].value] = false;\n }\n \n while(queue.length) {\n current = queue.shift();\n currentValue = current.value;\n visited[current.value] = true;\n \n for(var j in current.edges) {\n if(!visited[current.edges[j].value]) {\n distance[current.edges[j].value] = Math.min(distance[current.edges[j].value], distance[currentValue] +1);\n queue.push(current.edges[j]);\n }\n }\n }\n //console.log(distance)\n return distance[end]\n}", "title": "" }, { "docid": "a1a6ac0f4cb9e75f93bedbc23711d5c7", "score": "0.5975586", "text": "function calShortestPath(graph, start, end, path=[]) {\n path = path.concat(start);\n if (start == end) {\n return path;\n }\n if (!graph.hasOwnProperty(start)) {\n return [];\n }\n let shortest = [];\n for (let node of graph[start]) {\n if (path.indexOf(node) == -1) {\n let newPath = calShortestPath(graph, node, end, path);\n if (newPath.length > 0) {\n if ( shortest.length == 0 | (newPath.length < shortest.length) ) {\n shortest = newPath;\n }\n }\n }\n };\n return shortest;\n }", "title": "" }, { "docid": "6b72cbaf9efb31fa63072f504d971fe5", "score": "0.59630364", "text": "allShortestPaths(initialNode) {\n let visitedNodes = new Set()\n let unvisitedNodes = new Set([initialNode])\n let nodesDistance = Object.keys(this.map).reduce((acc, element) => {\n acc[element] = {\n value: Infinity,\n path: []\n }\n\n return acc\n }, {})\n\n // distance to initial node is zero\n nodesDistance[initialNode] = {\n value: 0,\n path: [initialNode]\n }\n\n // get next node\n const nextUnvisitedWithLowestDistance = () => {\n let next = Array.from(unvisitedNodes.entries()).map((el) => {\n return {\n node: el[0],\n distance: nodesDistance[el[0]]\n }\n }).reduce((last, current) => {\n return (last.distance.value < current.distance.value) ? last : current\n }, {distance: {value: Infinity}})\n\n\n return next.node\n }\n\n // while exists nodes to visit\n while (unvisitedNodes.size > 0) {\n let currentNode = nextUnvisitedWithLowestDistance()\n unvisitedNodes.delete(currentNode)\n visitedNodes.add(currentNode)\n\n // for each neighboor\n this.map[currentNode].neighboors.forEach((element) => {\n if (!visitedNodes.has(element.node)) {\n // for a big map it is possibly an overkill to calculate paths for all locations\n // we could add a limitation here to handle this situation if necessary, for example\n // limiting the distance in a given radius\n unvisitedNodes.add(element.node)\n if ((nodesDistance[currentNode].value + element.distance) < nodesDistance[element.node].value) {\n nodesDistance[element.node] = {\n value: nodesDistance[currentNode].value + element.distance,\n path: nodesDistance[currentNode].path.concat([element.node])\n }\n }\n }\n })\n\n }\n\n return nodesDistance\n }", "title": "" }, { "docid": "54fadd0df6e7431a5d380bb8cfc020e6", "score": "0.59588957", "text": "function dijkstra_algorithm(start) {\n var passed_point = [start];\n var close_point = Array(adj_matrix.length).fill(start);\n\n var shortest_way = adj_matrix[start - 1];\n for (var i = 0; i < shortest_way.length - 1; i++) {\n\n // Find the point which close to the recent point\n var min = 1000;\n var min_point = 0;\n for (var j = 0; j < shortest_way.length; j++) {\n if (shortest_way[j] !== 0 && shortest_way[j] < min && !passed_point.includes(j + 1)) {\n min_point = j;\n min = shortest_way[j];\n }\n }\n passed_point.push(min_point + 1);\n\n // Add the distances of this point that be just found\n var choices_point = adj_matrix[min_point];\n for (var k = 0; k < choices_point.length; k++) {\n\n if (!passed_point.includes(k + 1)) {\n if (choices_point[k] !== 0) {\n\n var new_distance = choices_point[k] + shortest_way[min_point];\n if (new_distance < shortest_way[k]) {\n shortest_way[k] = new_distance;\n close_point[k] = min_point + 1\n\n }\n if (shortest_way[k] === 0) {\n shortest_way[k] = new_distance;\n close_point[k] = min_point + 1\n }\n }\n }\n }\n start = k + 1;\n }\n\n console.log(\"Shortest distance: \" + shortest_way)\n console.log(\"Closest point: \" + close_point)\n return close_point\n}", "title": "" }, { "docid": "b3d55da6cfeb8d7a4827779b3d41d196", "score": "0.59294116", "text": "function determineShortestPath() {\n\t\tif (!labelGraph())\n\t\t\treturn false;\n\t\tvar vertex = end;\n\t\tprevCostRatio = end.cost / start.getDistance(end);\n\n\t\tvar nextVertex;\n\t\twhile (!vertex.equals(start)) {\n\t\t\tnextVertex = vertex.label;\n\t\t\tif (!nextVertex)\n\t\t\t\treturn false;\n\t\t\tsegments.push(new Segment(nextVertex, vertex));\n\t\t\tvertex = nextVertex;\n\t\t}\n\n\t\tCollections.reverse(segments);\n\t\treturn true;\n\t}", "title": "" }, { "docid": "0eec914a458ff3adafe68e35fc0be33a", "score": "0.59107333", "text": "function minPathSum(grid) {\n var dp = [[]];\n dp[0].push(grid[0][0]);\n for (var i = 1; i < grid[0].length; i++) {\n dp[0].push(dp[0][i - 1] + grid[0][i]);\n }\n for (var i = 1; i < grid.length; i++) {\n dp.push([]);\n dp[i].push(dp[i - 1][0] + grid[i][0]);\n }\n for (var i = 1; i < grid.length; i++) {\n for (var j = 1; j < grid[0].length; j++) {\n dp[i].push(grid[i][j] + Math.min(dp[i - 1][j], dp[i][j - 1]));\n }\n }\n return dp[grid.length - 1][grid[0].length - 1];\n}", "title": "" }, { "docid": "05ba820e8199d89c849be21fdcb4bd87", "score": "0.5884828", "text": "function solution_1 (costs) {\r\n costs.sort((a, b) => (a[1] - a[0]) - (b[1] - b[0])); // sort by marginal cost of going to city B (low to high)\r\n let total = 0;\r\n for (let i = 0; i < costs.length; ++i) {\r\n if (i < costs.length / 2) {\r\n total += costs[i][1]; // those people with lower marginal cost of going to city B should go to city B\r\n } else {\r\n total += costs[i][0]; // the other half should go to city A\r\n }\r\n }\r\n return total;\r\n}", "title": "" }, { "docid": "895da00917c585200b29dafe472873ed", "score": "0.58783823", "text": "_updateMinDistance() {\n if (this.paths.length == 0)\n return;\n let pathIndex = -1;\n let minDist = Number.MAX_VALUE;\n let closestPoint = null;\n let closestT = 0.0;\n for (var i = 0; i < this.paths.length; i++) {\n let path = this.paths[i];\n let t = path.getClosestT(this.currentB);\n let point = path.getPointAt(t);\n let dist = point.distance(this.currentB);\n if (dist < minDist) {\n pathIndex = i;\n minDist = dist;\n closestT = t;\n closestPoint = point;\n }\n }\n this.currentT = closestT;\n this.currentPathIndex = pathIndex;\n this.currentDistance = minDist;\n this.currentA.set(closestPoint);\n }", "title": "" }, { "docid": "fbb4cae07a0326bda4319e77e55d128e", "score": "0.5867526", "text": "getGraph() {\r\n\t\tthis.nodes = [];\r\n\r\n\t\t// set initial node at start\r\n\t\tthis.addNode(null, this.sx, this.sy); \r\n\r\n\t\t// iterate until max nodes is reached\r\n\t\twhile(!this.hasPath && this.nodes.length < this.max_nodes) {\r\n\t\t\tvar pos = this.getRandomVectorWithinExpansion(); // get a position vector within the expansion circle\r\n\r\n\t\t\t// go through all nodes and see if they are connectable, if connectable, add the to the tree the one with the lowest cost (half RRT*)\r\n\t\t\tvar lowest_cost_node = null;\r\n\t\t\tvar lowest_cost = 10000;\r\n\t\t\tfor(var i = 0; i < this.nodes.length; i++) {\r\n\t\t\t\tvar node = this.nodes[i];\r\n\r\n\t\t\t\t// find lowest cost connecting node\r\n\t\t\t\tvar distance = this.feasibleDistancePathToNode(node, pos.x, pos.y);\r\n\t\t\t\tif(distance != false) {\r\n\t\t\t\t\tvar cost = node.cost + distance;\r\n\t\t\t\t\tif(cost < lowest_cost) {\r\n\t\t\t\t\t\tlowest_cost = cost;\r\n\t\t\t\t\t\tlowest_cost_node = node;\r\n\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\t// add node\r\n\t\t\tif(lowest_cost_node != null) {\r\n\t\t\t\tthis.addNode(lowest_cost_node, pos.x, pos.y);\r\n\t\t\t\tvar last_node = this.nodes[this.nodes.length-1];\r\n\r\n\t\t\t\t// check if graph has reached the goal\r\n\t\t\t\tif(pos.x > this.gx && pos.y > this.gy && pos.x < this.gx + this.gw && pos.y < this.gy + this.gh) {\r\n\t\t\t\t\tif(this.search_for_optimal) this.goal_reached_nodes.push(last_node);\r\n\t\t\t\t\telse this.getPathFromGraph();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// reroute old nodes if new cost is more efficient (the star part)\r\n\t\t\t\t//let reroute_distance = this.min_reroute_distance;\r\n\t\t\t\tlet reroute_distance = this.reroute_factor/this.nodes.length;\r\n\t\t\t\tfor(var i = 0; i < this.nodes.length; i++) {\r\n\t\t\t\t\tvar node_i = this.nodes[i];\r\n\t\t\t\t\tif(last_node.pos.distanceToVector(node_i) > reroute_distance) continue; // only check other points within the rerouting distance of the last point\r\n\t\t\t\t\tfor(var j = 0; j < this.nodes.length; j++) {\r\n\t\t\t\t\t\tif(i === j) continue;\r\n\t\t\t\t\t\tvar node_j = this.nodes[j];\r\n\t\t\t\t\t\tvar distance = node_i.pos.distanceToVector(node_j.pos); \r\n\t\t\t\t\t\tif(distance < reroute_distance) { // only check feasibility if other point is within rerouting distance\r\n\t\t\t\t\t\t\tif(this.feasibleDistancePathToNode(node_i, node_j.pos.x, node_j.pos.y) != false) {\r\n\t\t\t\t\t\t\t\tlet alternative_cost = node_i.cost+distance;\r\n\t\t\t\t\t\t\t\tif(alternative_cost < node_j.cost) {\r\n\t\t\t\t\t\t\t\t\tnode_j.from = node_i;\r\n\t\t\t\t\t\t\t\t\tnode_j.cost = alternative_cost;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.search_for_optimal) this.getPathFromGraphReachedNodes();\r\n\t}", "title": "" }, { "docid": "80c08db49fb0f0f415c8a714d6419d84", "score": "0.5854491", "text": "function minPathSum(grid) {\n const dpArr = [];\n for (let i = 0; i < grid.lengh; i++) {\n const row = [];\n for (let j = 0; j < grid[i].length; j++) {\n row[j] = j;\n }\n dpArr.push(row);\n }\n dpArr[0][0] = grid[0][0];\n\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid[i].length; j++) {\n if (i === 0 && j === 0) {\n continue;\n } else if (i === 0) {\n dpArr[i][j] = dpArr[i][j-1] + grid[i][j];\n } else if (j === 0) {\n dpArr[i][j] = dpArr[i-1][j] + grid[i][j];\n } else {\n dpArr[i][j] = grid[i][j] + Math.min(dpArr[i-1][j], dpArr[i][j-1]);\n }\n }\n }\n return dpArr[grid.length-1][grid[0].length-1];\n}", "title": "" }, { "docid": "add851ba3663e769f9f3540174a3b0d9", "score": "0.5846938", "text": "function minPathSum(grid) {\n let row = grid[0].length;\n let column = grid.length;\n\n for (let i = 0; i < column; i++) {\n for (let j = 0; j < row; j++) {\n if (i > 0 && j > 0) grid[i][j] += Math.min(grid[i - 1][j], grid[i][j - 1]);\n else if (i > 0) grid[i][j] += grid[i - 1][j]; \n else if (j > 0) grid[i][j] += grid[i][j - 1];\n }\n }\n\n return grid[column - 1][row - 1]; \n}", "title": "" }, { "docid": "6f9cea7a61b8e1c3176ab8f059fce253", "score": "0.5845185", "text": "calculateTree(startNode, targetNode) {\n var tree = {};\n var currentCosts = {};\n var currentList = [[0, startNode]];\n var self = this;\n var mesh = this.meshHolder.getMesh();\n\n currentCosts[startNode] = 0;\n\n /* the Breadth-first Search - Search with Costs algorithm */\n while (true) {\n var currentPlace = currentList.shift();\n\n /* the target place was found */\n if (currentPlace[1] === targetNode) {\n break;\n }\n\n /* add the new nodes connected to currentPlace */\n for (var i = 0; i < mesh[currentPlace[1]].length; i++) {\n var node = mesh[currentPlace[1]][i];\n var key = self.meshHolder.getKey(currentPlace[1], node);\n\n /* add current cost */\n var cost = currentPlace[0];\n\n /* add cost (breadthFirstSearch and aStarSearch) */\n if (['breadthFirstSearch', 'aStarSearch'].indexOf(this.name) !== -1) {\n cost += this.costFunction(\n self.meshHolder.nodes[currentPlace[1]],\n self.meshHolder.nodes[node],\n self.meshHolder.nodes[targetNode],\n self.meshHolder.getConnection(key)\n );\n }\n\n /* add heuristic cost (greedySearch and aStarSearch) */\n if (['greedySearch', 'aStarSearch'].indexOf(this.name) !== -1) {\n cost += this.heuristicFunction(\n self.meshHolder.nodes[currentPlace[1]],\n self.meshHolder.nodes[node],\n self.meshHolder.nodes[targetNode],\n self.meshHolder.getConnection(key)\n );\n }\n\n /* if we have already reached this node and the costs to this node are lower than the current cost:\n * stop here (avoid loops)\n */\n if ((node in currentCosts) && currentCosts[node] < cost) {\n continue;\n }\n\n currentList.push([cost, node]);\n currentCosts[node] = cost;\n\n tree[node] = currentPlace[1];\n }\n\n /* sort the FIFO list */\n currentList.sort(function (a, b) {\n return a[0] - b[0];\n });\n }\n\n return tree;\n }", "title": "" }, { "docid": "d08fa581636e0a457c10efa74479d36a", "score": "0.5833333", "text": "getFinalCost() {\r\n if (this.points.length === 2) {\r\n this.setCredit(MAX_COST);\r\n\r\n let zonesCrossed = this.getZonesCrossed(this.points[0], this.points[1]);\r\n let isZoneOneCrossed = this.didCrossedZoneOne(this.points[0], this.points[1]);\r\n let cost = this.getCostByZone(zonesCrossed, isZoneOneCrossed);\r\n this.fare = cost;\r\n } else {\r\n this.fare = MAX_COST;\r\n }\r\n }", "title": "" }, { "docid": "0b65ce5854b1ac6c04438b2c2bf7e4c8", "score": "0.5828322", "text": "function CreatePath(endNode) {\n let node = endNode;\n let pathQueue = [];\n let costOfPath = 0;\n while (node.from) {\n node = node.from;\n node.isPath = true;\n if (node != startNode) { \n pathQueue.push({node: node, type: \"path\"});\n costOfPath += node.weight;\n }\n }\n document.getElementById(\"cost-of-path\").textContent = costOfPath;\n return pathQueue.reverse();;\n}", "title": "" }, { "docid": "d98ddf8c040f3495473911812489346e", "score": "0.5815021", "text": "getWalkableCost(x, y) {\n return this.maze[x][y] != 1 ? 10 : -1;\n }", "title": "" }, { "docid": "364a438204f141bcfea07a26b5ef8d3f", "score": "0.5792389", "text": "function minimaxFxnforPlayer2(newBoard, player) {\n\t var availablePlaces = availableSquares(newBoard);\n\t \n\t if (checkingWin(newBoard, ai)) {\n\t return {points: -1};\n\t } else if (checkingWin(newBoard, player2)) {\n\t return {points: 1};\n\t } else if (availablePlaces.length === 0) {\n\t return {points: 0};\n\t }\n\t \n\t var paths = [];\n\t for (let i = 0; i < availablePlaces.length; i ++) {\n\t var path = {};\n\t path.index = newBoard[availablePlaces[i]];\n\t newBoard[availablePlaces[i]] = player;\n\t \n\t if (player === ai)\n\t path.points = minimaxFxnforPlayer2(newBoard, player2).points;\n\t else\n\t path.points = minimaxFxnforPlayer2(newBoard, ai).points;\n\t newBoard[availablePlaces[i]] = path.index;\n\t if ((player === player2 && path.points === 1) || (player === ai && path.points === -1))\n\t return path;\n\t else \n\t paths.push(path);\n\t }\n\t let bestPath, bestPoints;\n\t if (player === player2) {\n\t bestPoints = -1000;\n\t for(let i = 0; i < paths.length; i++) {\n\t if (paths[i].points > bestPoints) {\n\t bestPoints = paths[i].points;\n\t bestPath = i;\n\t }\n\t }\n\t } else {\n\t bestPoints = 1000;\n\t for(let i = 0; i < paths.length; i++) {\n\t if (paths[i].points < bestPoints) {\n\t bestPoints = paths[i].points;\n\t bestPath = i;\n\t }\n\t }\n\t }\n\t \n\t return paths[bestPath];\n}", "title": "" }, { "docid": "361ddf7104b14337053bafe8ecf61581", "score": "0.57876754", "text": "function astar() {\n\n //1. Initialize the open list\n var openList = [];\n\n //2. Initialize the closed list\n //put the starting node on the open \n //list (you can leave its f at zero)\n var closedList = [];\n startpoint.f = 0;\n startpoint.g = 0;\n openList.push(startpoint); \n //3. while the open list is not empty\n\n var branch = setInterval(searchTree, 50);\n \n function searchTree()\n {\n if (openList.length == 0)\n {\n clearInterval(branch);\n astar2();\n return;\n }\n //a) find the node with the least f on \n //the open list, call it \"min\"\n var min = openList[0];\n for (var i = 0; i < openList.length; i ++)\n {\n if (openList[i].h < min.h)\n {\n min = openList[i];\n }\n }\n\n //div for coloring gradient\n var div = grid[min.col][min.row];\n\n //b) pop min off the open list\n openList.splice(openList.indexOf(min), 1);\n\n //c) generate min's 8 successors\n var paths = min.surrounding();\n if (paths.indexOf(startpoint) != -1)\n {\n paths.splice(paths.indexOf(startpoint), 1);\n }\n for (var i = 0; i < paths.length; i++)\n {\n //and set their parents to min\n var successor = paths[i];\n\n // i) if successor is the goal, stop search\n if (successor.type == \"end\")\n {\n if (div.style.backgroundColor == \"white\")\n {\n div.style.backgroundColor = getColorCode(min.counter + 1, startpoint.counter);\n }\n successor.parent = min;\n clearInterval(branch);\n astar2();\n return;\n }\n\n // successor.g = q.g + distance between successor and q\n var dist = min.g + 1;\n\n // successor.h = distance from goal to successor\n // For the heuristic value we will be using Manhattan distance rather than Euclidean or Diagonal\n var heur = Math.abs(successor.col - endpoint.col) + Math.abs(successor.row - endpoint.row);\n\n //calculate potential f cost for successor\n var totalCost = dist + heur;\n\n //if a node with the same position as \n //successor is in the OPEN list which has a \n //lower f than successor, skip this successor\n var inOpen = false;\n for (var j = 0; j < openList.length; j++)\n {\n if (openList.length != 0 && successor.col == openList[j].col && successor.row == openList[j].row && totalCost > openList[j].f)\n {\n inOpen = true;\n }\n }\n\n //if a node with the same position as \n //successor is in the CLOSED list which has\n //a lower f than successor, skip this successor\n var inClosed = false;\n for (var k = closedList.length - 1; k >= 0; k--)\n {\n if (closedList.length != 0 && successor.col == closedList[k].col && successor.row == closedList[k].row && totalCost > closedList[k].f)\n {\n inClosed = true;\n }\n }\n if (!inOpen && !inClosed)\n {\n successor.parent = min;\n successor.g = dist;\n successor.h = heur;\n successor.f = totalCost;\n openList.push(successor);\n\n }\n }\n closedList.push(min)\n if (div.style.backgroundColor == \"white\")\n {\n div.style.backgroundColor = getColorCode(min.counter + 1, startpoint.counter);\n }\n div.onmouseover = null;\n div.onmouseout = null;\n }\n\n function astar2()\n {\n var cur = endpoint;\n var path = [];\n while (cur.type != \"start\")\n {\n path.push(cur);\n cur = cur.parent;\n }\n\n var iterator = path.length - 1;\n var displayAlgo = setInterval(displayAstar, 150);\n function displayAstar()\n {\n if (iterator < 0)\n {\n clearInterval(displayAlgo);\n createConsoleMsg(\"Visualization completed successfully\");\n }\n else\n {\n path[iterator].markVisited();\n iterator --;\n }\n }\n }\n }", "title": "" }, { "docid": "22735752a34e72d61ba9033d67732415", "score": "0.5778891", "text": "function findMinManaSpent(hard) {\n var minManaSpent = Infinity;\n var bestPlan = Infinity;\n for (var p = 1; p <= 188926; p++) {\n var spent = heroSpentMana(hero, boss, p, minManaSpent, hard);\n if (spent < minManaSpent) {\n minManaSpent = spent;\n bestPlan = p;\n var planSteps = bestPlan.toString(5).split(\"\").reverse().join(\"\");\n console.log('Action plan ' + bestPlan + ' (' + planSteps + ') succeeded and cost ' + minManaSpent);\n }\n }\n return minManaSpent;\n}", "title": "" }, { "docid": "7077dc7bf0c8cc7a27299d8e6c213e75", "score": "0.5751437", "text": "function updateCosts() {\n costForward = new Array(currPath.length);\n costBackward = new Array(currPath.length);\n\n costForward[0] = 0.0;\n for (var i = 1; i < currPath.length; ++i) {\n costForward[i] = costForward[i-1] + dur[currPath[i-1]][currPath[i]];\n }\n bestTrip = costForward[currPath.length-1];\n\n costBackward[currPath.length-1] = 0.0;\n for (var i = currPath.length - 2; i >= 0; --i) {\n costBackward[i] = costBackward[i+1] + dur[currPath[i+1]][currPath[i]];\n }\n }", "title": "" }, { "docid": "b9a6ab1c3318c5ed4961d66fde5909ae", "score": "0.5745832", "text": "findGoal(target, max) {\n let d = distance(this, target);\n if (d < max)\n return target;\n let goal = {\n x: target.x,\n y: target.y,\n z: target.z\n };\n\n while (d > max) {\n goal.x = start.x + ((Math.abs(start.x - goal.x)) / 1.001); // more 0 == more precision\n goal.y = start.y + ((Math.abs(start.y - goal.y)) / 1.001); // more 0 == more precision\n goal.z = start.z + ((Math.abs(start.z - goal.z)) / 1.001); // more 0 == more precision\n d = distance(this, goal);\n }\n\n return goal;\n }", "title": "" }, { "docid": "3cf3c41ac71ff240e8347565afb9148b", "score": "0.5727248", "text": "function shortestPath(start, end) {\n output = { distance, previous } = graph.dijkstra(start);\n var temp = end;\n var stack = new Stack();\n stack.push(temp);\n while ((temp !== null) && (temp !== start)) {\n previous.forEach((value, key) => {\n if (key === temp) {\n stack.push(value)\n temp = value;\n }\n });\n }\n while (!stack.isEmpty()) {\n console.log(stack.pop());\n }\n}", "title": "" }, { "docid": "93e0f1444bfdad2e77ae178eeca37a36", "score": "0.5727074", "text": "function calculateShortest() {\n var graph = $('#graph').val();\n var origin = $('#shortest-origin').val();\n var destiny = $('#shortest-destiny').val();\n\n var $answer = $('#shortest-answer');\n var url = '../api/' + graph + '/ShortestRoute';\n var params = {\n origin: origin,\n destiny: destiny\n };\n\n doRequest(url, params, $answer);\n}", "title": "" }, { "docid": "fb061067cd107a55104ab39f6e0f9c6d", "score": "0.5724255", "text": "function pathProps() {\n\tlet u = g.sink; let rcap = Infinity; let cost = 0;\n\tfor (let e = link[u]; e != 0; e = link[u]) {\n\t\tu = g.mate(u,e);\n\t\trcap = Math.min(rcap, g.res(e,u));\n\t\tcost += g.costFrom(e,u);\n\t}\n\treturn [rcap,cost];\n}", "title": "" }, { "docid": "4689b35417247c9f632aa3bca18dd607", "score": "0.5710894", "text": "function pathFinding(a, b) {\n\tlet current = a.x + ',' + a.y; // ;\n\tlet naval = Tiles[current].type == 'water';\n\tlet owner = Tiles[current].unit.owner;\n\tlet open = {};\n\topen[current] = {x: a.x, y: b.y, travelled: 0, distance: World.offset_distance(a, b), last: 'start'};\n\tlet done = {};\n\tlet lowest = [null, 99999];\n\n\tvar i = 0;\n\twhile (current != b.x + ',' + b.y) {\n\t\ti++;\n\t\t// get adjacent nodes\n\t\tlet x = Tiles[current].x;\n\t\tlet y = Tiles[current].y;\n\t\tlet neighbors = World.getAdjacentTiles(x, y);\n\t\tfor (let n in neighbors) {\n\t\t\tlet id = neighbors[n].x + ',' + neighbors[n].y;\n\t\t\tlet isEnemy = Tiles[id].owner && Tiles[id].owner != owner;\n\t\t\tlet isPassable = (naval && Tiles[id].type == 'water') || (!naval && Tiles[id].type != 'water');\n\t\t\tlet isDiscovered = Tiles[id].terrain != undefined;\n\t\t\tlet isDestination = id == (b.x + ',' + b.y);\n\t\t\t// avoid enemy territory, only destination tile on enemy territory allowed (ie. you can only attack the edge of enemy territory)\n\t\t\tif (!open[id] && !done[id] && (isPassable || (isDestination && !isDiscovered)) && (!isEnemy || isDestination)) {\n\t\t\t\topen[id] = {x: neighbors[n].x, y: neighbors[n].y, travelled: open[current].travelled + 1, distance: open[current].travelled + World.offset_distance(neighbors[n], b), last: current};\n\t\t\t}\n\t\t}\n\t\t// move current to done\n\t\tdone[current] = open[current];\n\t\tdelete open[current];\n\n\t\t// get nearest adjacent node\n\t\tfor (let o in open) {\n\t\t\tif (open[o].distance < lowest[1]) {\n\t\t\t\tlowest = [o, open[o].distance];\n\t\t\t}\n\t\t}\n\n\t\t// if dead end, find next nearestnode\n\t\tif (lowest[0] == current) {\n\t\t\tif (!done[current]) {\n\t\t\t\tdelete open[current];\n\t\t\t\tdone[current] = null;\n\t\t\t}\n\t\t\tlowest = [null, 99999];\n\t\t\tfor (let o in open) {\n\t\t\t\tif (open[o].distance < lowest[1]) {\n\t\t\t\t\tlowest = [o, open[o].distance];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// travel\n\t\tcurrent = lowest[0];\n\n\t\t// no path\n\t\tif (current == null && Object.keys(open).length == 0) {\n\t\t\treturn false;\n\t\t}\n\t\tif (i > 400) { // if cannot find\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// build path\n\tpath = [(b.x + ',' + b.y)];\n\tcurrent = lowest[0];\n\tif (current != path[0]) {\n\t\treturn [];\n\t}\n\tvar i = 0;\n\twhile (current != a.x + ',' + a.y && current != 'start') {\n\t\ti++;\n\t\tactive = current;\n\t\tif (done[current]) {\n\t\t\tcurrent = done[current].last;\n\t\t} else {\n\t\t\tcurrent = open[current].last;\n\t\t}\n\t\tpath.push(current);\n\t\tif (i > 50) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn path;\n}", "title": "" }, { "docid": "887b16a1635eae6f6786c74372954022", "score": "0.57100147", "text": "shortestPath(startCoordinates) {\n var distanceFromTop = Math.floor(startCoordinates.y / this.squaresize);\n var distanceFromLeft = Math.floor(startCoordinates.x / this.squaresize);\n\n var location = {\n distanceFromTop: distanceFromTop,\n distanceFromLeft: distanceFromLeft,\n path: [],\n status: 'Start'\n };\n\n const dirs = ['North', 'South', 'East', 'West'];\n\n var queue = [location];\n let grid = this.copy_grid();\n\n while (queue.length > 0) {\n var currentLocation = queue.shift();\n\n for (let i = 0; i < dirs.length; i++) {\n let newLocation = this.exploreInDirection(currentLocation, dirs[i], grid);\n if (newLocation.status === 'Player') return newLocation.path;\n else if (newLocation.status === 'Valid') queue.push(newLocation);\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "caf613d9290f5d93591c5d4a043b859f", "score": "0.5689878", "text": "calculateHeuristic(start, end) {\n let d1 = Math.abs(end.x - start.x);\n let d2 = Math.abs(end.y - start.y);\n return d1 + d2;\n }", "title": "" }, { "docid": "ca4a467333078cdfed309d84aabde8ba", "score": "0.56835717", "text": "evaluateHeadPaths() {\n const lastNode = this.head.nodes.at(-1); // Ultimo nodo de la pila seleccionada\n // Foreach; cada arista que llega a nodos no checkeados\n lastNode.getAllNonCheckedEdges().forEach((edge) => {\n // Por cada arista no checkeada:\n const temporaryPath = new Path([...this.head.nodes, edge.node]); // Se crea un camino\n temporaryPath.calculateIsFinal(this.to); // Se calcula si es un camino final\n if (edge.node.minLengthToPath > temporaryPath.pathWeight) {\n // Si el peso minimo registrado para el nodo al que llega ese camino es mayor al peso del camino calculado:\n edge.node.minLengthToPath = temporaryPath.pathWeight; // Se asigna un nuevo peso minimo al nodo\n // No es obligatorio, pero aquí se puede eliminar el camino a ese nodo que queda obsoleto\n this.pile.push(temporaryPath); // Se agrega el nuevo camino a la pila\n }\n });\n }", "title": "" }, { "docid": "b98ce5caa665fe0299bad85150b1796d", "score": "0.5681312", "text": "getPathCost() {\n return this.pathCost;\n }", "title": "" }, { "docid": "66a49c4f34890f9dbf642f43fb5379e4", "score": "0.5675397", "text": "function findRoute(start, end, map, opt) {\n\t\n\t var step = opt.step;\n\t var startPoints, endPoints;\n\t var startCenter, endCenter;\n\t\n\t // set of points we start pathfinding from\n\t if (start instanceof g.rect) {\n\t startPoints = getRectPoints(start, opt.startDirections, opt);\n\t startCenter = start.center().snapToGrid(step);\n\t } else {\n\t startCenter = start.clone().snapToGrid(step);\n\t startPoints = [startCenter];\n\t }\n\t\n\t // set of points we want the pathfinding to finish at\n\t if (end instanceof g.rect) {\n\t endPoints = getRectPoints(end, opt.endDirections, opt);\n\t endCenter = end.center().snapToGrid(step);\n\t } else {\n\t endCenter = end.clone().snapToGrid(step);\n\t endPoints = [endCenter];\n\t }\n\t\n\t // take into account only accessible end points\n\t startPoints = _.filter(startPoints, map.isPointAccessible, map);\n\t endPoints = _.filter(endPoints, map.isPointAccessible, map);\n\t\n\t // Check if there is a accessible end point.\n\t // We would have to use a fallback route otherwise.\n\t if (startPoints.length > 0 && endPoints.length > 0) {\n\t\n\t // The set of tentative points to be evaluated, initially containing the start points.\n\t var openSet = new SortedSet();\n\t // Keeps reference to a point that is immediate predecessor of given element.\n\t var parents = {};\n\t // Cost from start to a point along best known path.\n\t var costs = {};\n\t\n\t _.each(startPoints, function(point) {\n\t var key = point.toString();\n\t openSet.add(key, estimateCost(point, endPoints));\n\t costs[key] = 0;\n\t });\n\t\n\t // directions\n\t var dir, dirChange;\n\t var dirs = opt.directions;\n\t var dirLen = dirs.length;\n\t var loopsRemain = opt.maximumLoops;\n\t var endPointsKeys = _.invoke(endPoints, 'toString');\n\t\n\t // main route finding loop\n\t while (!openSet.isEmpty() && loopsRemain > 0) {\n\t\n\t // remove current from the open list\n\t var currentKey = openSet.pop();\n\t var currentPoint = g.point(currentKey);\n\t var currentDist = costs[currentKey];\n\t var previousDirAngle = currentDirAngle;\n\t var currentDirAngle = parents[currentKey]\n\t ? getDirectionAngle(parents[currentKey], currentPoint, dirLen)\n\t : opt.previousDirAngle != null ? opt.previousDirAngle : getDirectionAngle(startCenter, currentPoint, dirLen);\n\t\n\t // Check if we reached any endpoint\n\t if (endPointsKeys.indexOf(currentKey) >= 0) {\n\t // We don't want to allow route to enter the end point in opposite direction.\n\t dirChange = getDirectionChange(currentDirAngle, getDirectionAngle(currentPoint, endCenter, dirLen));\n\t if (currentPoint.equals(endCenter) || dirChange < 180) {\n\t opt.previousDirAngle = currentDirAngle;\n\t return reconstructRoute(parents, currentPoint, startCenter, endCenter);\n\t }\n\t }\n\t\n\t // Go over all possible directions and find neighbors.\n\t for (var i = 0; i < dirLen; i++) {\n\t\n\t dir = dirs[i];\n\t dirChange = getDirectionChange(currentDirAngle, dir.angle);\n\t // if the direction changed rapidly don't use this point\n\t // Note that check is relevant only for points with previousDirAngle i.e.\n\t // any direction is allowed for starting points\n\t if (previousDirAngle && dirChange > opt.maxAllowedDirectionChange) {\n\t continue;\n\t }\n\t\n\t var neighborPoint = currentPoint.clone().offset(dir.offsetX, dir.offsetY);\n\t var neighborKey = neighborPoint.toString();\n\t // Closed points from the openSet were already evaluated.\n\t if (openSet.isClose(neighborKey) || !map.isPointAccessible(neighborPoint)) {\n\t continue;\n\t }\n\t\n\t // The current direction is ok to proccess.\n\t var costFromStart = currentDist + dir.cost + opt.penalties[dirChange];\n\t\n\t if (!openSet.isOpen(neighborKey) || costFromStart < costs[neighborKey]) {\n\t // neighbor point has not been processed yet or the cost of the path\n\t // from start is lesser than previously calcluated.\n\t parents[neighborKey] = currentPoint;\n\t costs[neighborKey] = costFromStart;\n\t openSet.add(neighborKey, costFromStart + estimateCost(neighborPoint, endPoints));\n\t };\n\t };\n\t\n\t loopsRemain--;\n\t }\n\t }\n\t\n\t // no route found ('to' point wasn't either accessible or finding route took\n\t // way to much calculations)\n\t return opt.fallbackRoute(startCenter, endCenter, opt);\n\t }", "title": "" }, { "docid": "e2a346fb2493f8e9825f6fce3cdbc202", "score": "0.5672131", "text": "function solveMaze() {\n state.isSolving = true;\n\n const reconstruct_path = (cameFrom, curr) => {\n let current = curr;\n const total_path = [current];\n while (cameFrom[current.x][current.y] !== undefined) {\n current = cameFrom[current.x][current.y];\n total_path.push(current);\n }\n total_path.reverse();\n return total_path;\n };\n\n const heuristic_cost_estimate = (start, goal) => {\n return Math.abs(goal.x - start.x) + Math.abs(goal.y - start.y);\n };\n\n const dist_between = (start, end) => {\n return Math.abs(start.x - end.x) + Math.abs(start.y - end.y);\n };\n\n const AStar = (start, goal) => {\n // The set of nodes already evaluated\n const closedSet = [];\n\n // The set of currently discovered nodes that are not evaluated yet.\n // Initially, only the start node is known.\n let openSet = [start];\n\n // For each node, which node it can most efficiently be reached from.\n // If a node can be reached from many nodes, cameFrom will eventually contain the\n // most efficient previous step.\n const cameFrom = new Array(state.numXCells).fill()\n .map(col => new Array(state.numYCells).fill());\n\n // For each node, the cost of getting from the start node to that node.\n const gScore = new Array(state.numXCells).fill()\n .map(col => new Array(state.numYCells).fill(Infinity));\n\n // The cost of going from start to start is zero.\n gScore[start.x][start.y] = 0;\n\n // For each node, the total cost of getting from the start node to the goal\n // by passing by that node. That value is partly known, partly heuristic.\n const fScore = new Array(state.numXCells).fill()\n .map(col => new Array(state.numYCells).fill(Infinity));\n\n // For the first node, that value is completely heuristic.\n fScore[start.x][start.y] = heuristic_cost_estimate(start, goal);\n\n while (openSet.length > 0) {\n // Set current to the node in openSet having the lowest fScore\n let current = openSet[0];\n if (openSet.length > 1) {\n for (var i = 1; i < openSet.length; i++) {\n const currCell = openSet[i];\n if (fScore[currCell.x][currCell.y] < fScore[current.x][current.y])\n current = currCell;\n }\n }\n\n // if current == goal, return the found path\n if (current.x === goal.x && current.y === goal.y) {\n return reconstruct_path(cameFrom, current);\n }\n\n // Remove the current from the openSet\n let removeIndex;\n for (var i = 0; i < openSet.length && removeIndex === undefined; i++) {\n const cell = openSet[i];\n if (cell.x === current.x && cell.y === current.y)\n removeIndex = i;\n }\n openSet.splice(removeIndex, 1);\n\n // Add the current to the closedSet\n closedSet.push(current);\n\n // Get all the neighbours\n const neighbours = [];\n for (var i = 0; i < CELL_WALLS.length; i++) {\n const wall = CELL_WALLS[i];\n const hasWall = current.walls.includes(wall);\n if (!hasWall) {\n switch (wall) {\n case CELL_WALL_NORTH:\n neighbours.push(state.mazeData[current.x][current.y - 1]);\n break;\n case CELL_WALL_EAST:\n neighbours.push(state.mazeData[current.x + 1][current.y]);\n break;\n case CELL_WALL_SOUTH:\n neighbours.push(state.mazeData[current.x][current.y + 1]);\n break;\n case CELL_WALL_WEST:\n neighbours.push(state.mazeData[current.x - 1][current.y]);\n break;\n default:\n return current;\n }\n }\n }\n\n // for each neighbour of current...\n for (var i = 0; i < neighbours.length; i++) {\n const neighbour = neighbours[i];\n\n // if neighbor in closedSet, continue (ignore the neighbour which is already evaluated)\n if (closedSet.some(cell => cell.x === neighbour.x && cell.y === neighbour.y))\n continue;\n\n // The distance from start to a neighbour\n const tentative_gScore = gScore[current.x][current.y] + dist_between(current, neighbour);\n\n // if neighbour is not in the openSet, we've just discover a new node\n if (openSet.find(cell => cell.x === neighbour.x && cell.y === neighbour.y) === undefined) {\n openSet.push(neighbour);\n } else if (tentative_gScore >= gScore[neighbour.x][neighbour.y]) {\n // This is a worse path\n continue;\n }\n\n // This path is the best until now. Record it!\n cameFrom[neighbour.x][neighbour.y] = current;\n gScore[neighbour.x][neighbour.y] = tentative_gScore;\n fScore[neighbour.x][neighbour.y] = gScore[neighbour.x][neighbour.y] + heuristic_cost_estimate(neighbour, goal);\n };\n }\n };\n const startAStar = Date.now();\n const result = AStar(\n state.mazeData[state.startCell.x][state.startCell.y],\n state.mazeData[state.endCell.x][state.endCell.y]\n );\n const timeTook = Date.now() - startAStar;\n console.log(`Done, took ${timeTook} ms`);\n state.solutionPath = result;\n state.traveller.idx = 0;\n}", "title": "" }, { "docid": "73c89ce62e844561d1e564f7147f3c8c", "score": "0.56710714", "text": "function minimaxFxnforAi(newBoard, player) {\n\t var availablePlaces = availableSquares(newBoard);\n\t \n\t if (checkingWin(newBoard, player2)) {\n\t return {points: -1};\n\t } else if (checkingWin(newBoard, ai)) {\n\t return {points: 1};\n\t } else if (availablePlaces.length === 0) {\n\t return {points: 0};\n\t }\n\t \n\t var paths = [];\n\t for (let i = 0; i < availablePlaces.length; i ++) {\n\t var path = {};\n\t path.index = newBoard[availablePlaces[i]];\n\t newBoard[availablePlaces[i]] = player;\n\t \n\t if (player === ai)\n\t path.points = minimaxFxnforAi(newBoard, player2).points;\n\t else\n\t path.points = minimaxFxnforAi(newBoard, ai).points;\n\t newBoard[availablePlaces[i]] = path.index;\n\t if ((player === ai && path.points === 1) || (player === player2 && path.points === -1))\n\t return path;\n\t else \n\t paths.push(path);\n\t }\n\t let bestPath, bestPoints;\n\t if (player === ai) {\n\t bestPoints = -1000;\n\t for(let i = 0; i < paths.length; i++) {\n\t if (paths[i].points > bestPoints) {\n\t bestPoints = paths[i].points;\n\t bestPath = i;\n\t }\n\t }\n\t } else {\n\t bestPoints = 1000;\n\t for(let i = 0; i < paths.length; i++) {\n\t if (paths[i].points < bestPoints) {\n\t bestPoints = paths[i].points;\n\t bestPath = i;\n\t }\n\t }\n\t }\n\t \n\t return paths[bestPath];\n}", "title": "" }, { "docid": "9abd1821be106ffd6a5be1176a8d85ec", "score": "0.5666916", "text": "function findPath(initX, initY, finalX, finalY)\n{\n\t//set of nodes done being considered\n\tvar closedSet = [];\n\n\t//list of currently discovered nodes (current node + neighbors) waiting to be evaluated. First tile\n\t//to add to open set is the start tile\n\tvar startTile = {\n\t\ttile: ProtectorGame.map_controller.map.getTileWorldXY(initX, initY),\n\t\tparent: null\n\t};\n\tvar openSet = [startTile];\n\n\t//the parent of each node at the given index in the closedLiset.\n\t//USAGE : parents[i] will give the parent node of the node stored in closedList[i]\n\tvar parents = [];\n\n\t//this variable will contain the currently selected tile, meaning the current furthest known tile in the \n\t//path\n\tvar selected;\n\n\t//tells if the algorithm found the desired tile (handles events where tile is in blockedLayer or impossible to get to)\n\tvar found = false;\n\n\t//this variable will contain\n\tvar selectedTile = {};\n\n\t//correct target values to nearest tile\n\twhile(finalX%64 != 0) {\n\t\tfinalX--;\n\t}\n\twhile(finalY%64 != 0) {\n\t\tfinalY--;\n\t}\n\t//console.log(ProtectorGame.map_controller.map.getTileWorldXY(finalX, finalY, 64, 64, ProtectorGame.map_controller.backgroundLayer, true));\n\t\n\ttargetTileX = finalX;\n\ttargetTileY = finalY;\n\n\tif(ProtectorGame.map_controller.map.getTileWorldXY(finalX, finalY, 64, 64, ProtectorGame.map_controller.blockedLayer, true) != null) {\n\t\tconsole.log(\"canceling path find. . .\");\n\t\trandom = false;\n\t\tcurrentlyMoving = false;\n\t\treturn;\n\t}\n\n\tconsole.log(\"TARGET - X : \" + finalX + \" , Y : \" + finalY);\n\twhile(openSet.length != 0) {\n\t//for(var z=0; z < 50; z++) {\n\t\t//if were at the target, done with the loop\n\t\tif(selected != null && selected.worldX == finalX && selected.worldY == finalY) {\n\t\t\t//console.log(\"ALGO FOUND TARGET!!\");\n\t\t\tfound = true;\n\t\t\tbreak;\n\t\t}\n\n\t\tif(selected != null) {\n\t\t\t//console.log(\"selected - X : \" + selected.worldX + \" , Y : \" + selected.worldY);\n\t\t}\n\n\t\t//get fScores every loop iteration\n\t\tvar fScores = [];\n\n\t\t//compute the f scores of all the tiles in the open set\n\t\tfScores = getFScores(openSet, selected, finalX, finalY);\n\t\t//console.log(fScores);\n\n\t\t//loop through fScores and find the index of lowest score\n\t\tvar lowestScore = fScores[0];\n\t\tvar lowestIndex = 0;\n\n\t\tfor(var i=0; i < fScores.length; i++) {\n\t\t\t//if lower score, change lowest score variable\n\t\t\tif(fScores[i] < lowestScore) {\n\t\t\t\tlowestScore = fScores[i];\n\t\t\t\tlowestIndex = i;\n\t\t\t}\n\t\t}\n\n\t\t//push the tile with the lowest score to the closed set, and remove it from the open set\n\t\tclosedSet.push(selectedTile)\n\t\tselected = openSet[lowestIndex].tile;\t//also set the selected tile to this one\n\n\t\t//This is a wrapper object that is used to store the tile data in the arrays. Each Tile object will have two fields: a reference\n\t\t//to the node represented by this tile, Tile.tile, and a reference to the node's parent, Tile.parent.\n\t\tselectedTile = {\n\t\t\ttile: openSet[lowestIndex].tile,\n\t\t\tparent: openSet[lowestIndex].parent\n\t\t};\n\t\topenSet.splice(lowestIndex, 1);\t//remove the selected tile from open set, since it's now in the closed set\n\n\t\t//console.log(\"CLOSED SET : \" + closedSet);\n\t\t//console.log(\"OPEN SET : \" + openSet);\n\n\t\t//get an array of all the walkable adjacent tiles to consider, using a helper method\n\t\tvar adjacentTiles = [];\n\t\tadjacentTiles = getAdjacentTiles(selected);\n\t\tif(adjacentTiles == null) {\n\t\t\tfound = false;\n\t\t\tbreak;\n\t\t}\n\n\t\t//now for all adjacent tiles NOT already in the openSet, add to openSet\n\t\tfor(var i=0; i < adjacentTiles.length; i++) {\n\t\t\t//don't consider this node if it has already been considered\n\t\t\tif(arrayContains(adjacentTiles[i], closedSet)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//check to see if this node is in the open set. If not, add it. else, check if it is a better path\n\t\t\tif(!arrayContains(adjacentTiles[i], openSet)) {\n\t\t\t\t//create the new tile wrapper object\n\t\t\t\tvar newTile = {\n\t\t\t\t\ttile: adjacentTiles[i],\n\t\t\t\t\tparent: selectedTile\n\t\t\t\t};\n\t\t\t\topenSet.push(newTile);\n\t\t\t\t//openSet.push(adjacentTiles[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\t//if the tile was not found then that means it was either invalid (not in the ProtectorGame.map_controller.map) or unreachable. don't trigger movement and return.\n\tif(!found) {\n\t\tconsole.log(\"err: unable to find the target\");\n\t\trandom = false;\n\t\tcurrentlyMoving = false;\n\t\treturn;\n\t}\n\n\t//now reconstruct the path by backtracking from the target location, through the parents, back to the start\n\tvar path = [];\t//the array to hold the final path\n\tvar atTile = closedSet[closedSet.length - 1];\t//this holds the next tile to add to the path\n\n\twhile(atTile != null) {\n\t//for(vari=0; i < 20; i++) {\n\t\tpath.push(atTile.tile);\n\t\tatTile = atTile.parent;\n\t}\n\tconsole.log(path);\n\t// when they backtrace, it looks like it's only the last tile we need to remove, so let's try popping it.\n\tif(path.length > 1) //path must be greater than 1\n\t\tpath.pop();\n\t//set the vals required to start movement\n\tcurrentlyMoving = true;\n\tcurrentPath = path;\n\tsavedPath = [];\n\tfor(var i=0; i < path.length; i++) {\n\t\tsavedPath.push(path[i]);\n\t}\n}", "title": "" }, { "docid": "c854ccf00d996fdd4dde0ab90e0f940c", "score": "0.5663262", "text": "function generateShortestPath(allObstacles) {\n\t\tcreateVisibilityGraph(allObstacles);\n\n\t\tif (visibleVertices.length == 0)\n\t\t\treturn false;\n\n\t\treturn determineShortestPath();\n\t}", "title": "" }, { "docid": "ce26a05ca09afcae11f92b5e2761a97f", "score": "0.5661374", "text": "function astar(start, goal, getNeighbours, heuristic) {\n var closedNodes = [];\n var openNodes = [start];\n var paths = {}; // (destination -> coming from)\n var bestScores = {}; // g\n var estimateScores = {}; // f\n\n function estimator(s) {\n return estimateScores[s];\n }\n\n bestScores[start] = 0;\n estimateScores[start] = bestScores[start] + heuristic(start, goal);\n\n while (openNodes.length > 0) {\n console.log('openset.length: ', openNodes.length);\n\n // move current from open to closed\n openNodes = _.sortBy(openNodes, estimator);\n var currentNode = openNodes.shift();\n closedNodes.push(currentNode);\n\n // console.log('current: ', currentNode, 'estimateScore:', estimateScores[currentNode]);\n\n if (currentNode === goal) {\n return reconstructPath(paths, goal);\n }\n\n // console.log('Finding neighbours of', currentNode);\n var neighbours = getNeighbours(currentNode);\n\n // console.log('Neighbours:');\n\n for (var nn in neighbours) {\n var neighbor = neighbours[nn];\n if (_.contains(closedNodes, neighbor)) {\n // console.log('ignoring ', neighbor);\n continue;\n }\n var tentativeBestScore = bestScores[currentNode] + heuristic(currentNode, neighbor);\n\n // console.log('c, n, ts, bs', currentNode, neighbor, tentativeBestScore, bestScores[neighbor]);\n\n if (!_.contains(openNodes, neighbor) || tentativeBestScore < bestScores[neighbor]) {\n\n paths[neighbor] = currentNode;\n bestScores[neighbor] = tentativeBestScore;\n estimateScores[neighbor] = bestScores[neighbor] + heuristic(neighbor, goal);\n\n if (!_.contains(openNodes, neighbor)) {\n openNodes.push(neighbor);\n }\n }\n }\n }\n // we failed to find a solution\n return;\n}", "title": "" }, { "docid": "b7183a98f434412bc4c383c0c82cbf30", "score": "0.5660558", "text": "function loadAstarNode(prevNode,currNode,goalNode){\r\n\t\t//Path is first empty\r\n\t\tvar path=[];\r\n\t\tresetAstarList();\r\n\t\t//console.log(\"\");\r\n\t\t//console.log(\"\");\r\n\t\t//console.log(\"pRINT AT THE START!!! ONLY!!!!\");\r\n\t\t//console.log(\"P:\"+prevNode+\" C:\"+currNode+\" G:\"+goalNode);\r\n\t\t\r\n\t\tif(currNode == undefined){\r\n\t\t\tif(prevNode == 117) currNode = 118;\r\n\t\t\telse if(prevNode == 118) currNode = 117;\r\n\t\t\telse if(prevNode == 119) currNode = 120;\r\n\t\t\telse if(prevNode == 120) currNode = 119;\r\n\t\t\telse if(mapNodes[prevNode].North != -1) currNode = mapNodes[prevNode].North;\r\n\t\t\telse if(mapNodes[prevNode].East != -1) currNode = mapNodes[prevNode].East;\r\n\t\t\telse if(mapNodes[prevNode].South != -1) currNode = mapNodes[prevNode].South;\r\n\t\t\telse currNode = mapNodes[prevNode].West;\r\n\t\t\tconsole.log(\"Corrected P:\"+prevNode+\" C:\"+currNode+\" G:\"+goalNode);\r\n\t\t}\r\n\t\t\r\n\t\tvar openList = [];\r\n\t\tvar closedList = [];\r\n\t\t//console.log(\"openList LengthA:\"+openList.length);\r\n\t\topenList.push(nodesList[currNode]);\r\n\t\tclosedList.push(nodesList[prevNode]);\r\n\t\t//console.log(\"openList LengthB:\"+openList.length);\r\n\t\t//console.log(\"openList Length:\"+openList.length+\" contents: \"+openList[0].id);\r\n\t\twhile (openList.length >= 1 && path.length == 0){\r\n\t\t\t//First we need the lowest f(x)\r\n\t\t\t//if(openList[0] == null) console.log(\"Null Found at zero\");\r\n\t\t\t//else console.log(\" i: 0 id:\"+openList[0].id);\r\n\t\t\tvar lowestIndex=0;\r\n\t\t\tfor(var i=0; i < openList.length; i++){\r\n\t\t\t\t//if(openList[i] == null) console.log(\"Null Found at \"+i+\", Checking next value: \"+(i+1)+\": \"+openList[(i+1)]+\", Checking next value: \"+(i+2)+\": \"+openList[(i+2)]+\", Checking next value: \"+(i+3)+\": \"+openList[(i+3)]);\r\n\t\t\t\tif(openList[i].f < openList[lowestIndex].f)\r\n\t\t\t\t\tlowestIndex = i;\r\n\t\t\t\t\r\n\t\t\t\t//Preprint out the next entry\r\n\t\t\t\t//if((i+1) < openList.length)\r\n\t\t\t\t\t//console.log(\" i:\"+ (i+1) + \" id:\"+openList[(i+1)].id);\r\n\t\t\t}\r\n\t\t\tvar lowestNode = openList[lowestIndex];\r\n\t\t\t//console.log(\"Current node ID: \"+lowestNode.id);\r\n\t\t\t\r\n\t\t\t//End case- Found the shortest path\t\t\t\r\n\t\t\tif(lowestNode.id == goalNode){\r\n\t\t\t\tvar curr = lowestNode;\r\n\t\t\t\t\r\n\t\t\t\twhile(curr.parent){\r\n\t\t\t\t\tpath.push(curr.id);\r\n\t\t\t\t\tcurr = curr.parent;\t\t\t\t\t\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\t//console.log( \"Path: \"+path.reverse());\r\n\t\t\t\topenList = [];\r\n\t\t\t\tclosedList = [];\r\n\t\t\t\topenList.splice(0,openList.length);\r\n\t\t\t\t//console.log(\"This is printed before the return....\")\r\n\t\t\t\t//return path[path.length-1];\r\n\t\t\t\treturn path.reverse();\r\n\t\t\t\t//console.log(\"This is continuing the program after returning a value!!!\")\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Still searching\r\n\t\t\tclosedList.push(lowestNode);\r\n\t\t\topenList.splice(lowestIndex,1);\r\n\t\t\t//console.log(\"****List****\");\r\n\t\t\t//console.log(\"\");\r\n\t\t\t//console.log(openList);\r\n\t\t\t//console.log(\"****Done****\");\r\n\t\t\t\r\n\t\t\tfor(var x = 0; x < lowestNode.Connectednodes.length; x++){\r\n\t\t\t\tvar node = nodesList[lowestNode.Connectednodes[x]];\r\n\t\t\t\t\r\n\t\t\t\t//Check if this node is in the \r\n\t\t\t\tvar found = false;\r\n\t\t\t\tfor(var y = 0; y < closedList.length && 0 != closedList.length; y++)\r\n\t\t\t\t\tif(node.id == closedList[y].id){\r\n\t\t\t\t\t\tfound =true;\r\n\t\t\t\t\t\t//console.log(\"node \"+node.id+\" is already in the closed list\")\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(lowestNode.id==currNode || closedList[y].id==goalNode)\r\n\t\t\t\t\t\t\tclosedList.splice(y,1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\tif(!found){\r\n\t\t\t\t\t//\r\n\t\t\t\t\tvar gScore = lowestNode.g + 1;\r\n\t\t\t\t\tvar gScoreIsBest = false;\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(var z = 0; z < openList.length && 0 != openList.length; z++)\r\n\t\t\t\t\t\tif(node.id == openList[z].id)\r\n\t\t\t\t\t\t\tfound =true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!found){\r\n\t\t\t\t\t\tgScoreIsBest = true;\r\n\t\t\t\t\t\tnode.h = Math.abs(node.x-nodesList[goalNode].x)+ Math.abs(node.y-nodesList[goalNode].y);\r\n\t\t\t\t\t\topenList.push(node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(gScore < node.g)\r\n\t\t\t\t\t\tgScoreIsBest = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(gScoreIsBest){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tnode.parent = lowestNode;\r\n\t\t\t\t\t\tnode.g = gScore;\r\n\t\t\t\t\t\tnode.f = node.g+node.h;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tconsole.log(\"Ended A*\");\r\n\t\t\r\n\t\t //return path.reverse();\r\n\t\t //Created with guidance from:\r\n\t\t //https://briangrinstead.com/blog/astar-search-algorithm-in-javascript/\r\n\t }", "title": "" }, { "docid": "178a8085a2bbfc3b87ed55936c4a94f5", "score": "0.5655589", "text": "function lowestCostCell(costs, processed) {\n const costedCells = Object.keys(costs)\n let lowest = null\n \n // setup cached loop settings\n // this approach avoids referencing variables\n // in the function arguement object which gives\n // some speed advantages\n let i=0\n let cellId\n const len=costedCells.length\n for (; i<len; i++) {\n cellId = costedCells[i]\n if (lowest === null || ( costs[cellId]+calcH(cells[cellId])) < (costs[lowest]+calcH(cells[lowest])) ) { \n // check the cellId has not been processed (or is blocked)\n if (!processed.includes(cellId)) {\n lowest = cellId\n }\n }\n }\n \n return lowest\n }", "title": "" }, { "docid": "fdf831bb1179dabcbc345cbf940ee4c0", "score": "0.56309676", "text": "function findBestChild(city, toCity){\n let children = [];\n connections.forEach(connection => {\n if(connection.from == city.name){\n let cityObj = findCityObjInTheArray(connection.to)\n if(cityObj != null) {\n let child = {\n \"city\": {...cityObj, \"distance\": connection.distance },\n \"cost\": calculateTotalCost(cityObj.heuristic, connection.distance)\n }\n children.push(child);\n }\n }\n })\n //console.log(children)\n\n return children.length != 0 ? findMinCostChild(children, toCity) : null;\n}", "title": "" }, { "docid": "511822aeb5f5e14cd2b7910c15ade0e9", "score": "0.5623368", "text": "function getMaxSumPath(triangle){\n\tlet choices=[];\n\tfor(let i=triangle.length-2;i>=0;i--){\n\t\tfor(let n=0;n<triangle[i].length;n++){\n\t\t\tchoices= [ triangle[i+1][n], triangle[i+1][n+1] ];\n\t\t\tif(choices[0]>choices[1]) \n\t\t\t\ttriangle[i][n]+= choices[0];\n\t\t\telse \n\t\t\t\ttriangle[i][n]+= choices[1];\n\t\t}\n\t}\n\treturn triangle[0][0];\n}", "title": "" }, { "docid": "c88d1b33448943c24492f5326997e2d6", "score": "0.56208897", "text": "function calcDirectRoute($start, $list) {\n // create copy of (list) array\n let tempList = [];\n for (let i = 0; i < $list.length; i++) tempList.push($list[i]);\n // create copy of (start) array\n let tempStart = $start;\n // empty tripList array to return values calculated by this method\n let tripList = [];\n // loop through list and find the quickest route from point to point\n while (tempList.length > 1) {\n if (tempList.indexOf(tempStart) >= 0) {\n tempList.splice(tempList.indexOf(tempStart), 1); // check if (start) is in the (list), remove it\n }\n tempList.unshift(tempStart); // add (start) to beginning of (list)\n // create array to hold distances from (start) location\n let tempDistance = [];\n // fill array with distances from (start)\n for (let i = 1; i < tempList.length; i++) {\n tempDistance.push([\n tempStart,\n tempList[i],\n calcDistance(tempStart, tempList[i]),\n ]);\n }\n // create variable to hold shortest distance value, set to first element of distances\n let short = tempDistance[0];\n // check verse other distance values to determine shortest value\n for (let i = 0; i < tempDistance.length; i++) {\n // check next element in distance values vs current short value\n if (tempDistance[i][2] < short[2]) {\n short = tempDistance[i]; // set short to value if less than next element\n }\n }\n tripList.push(short); // add shortest trip to the the trip list\n tempList.shift(); // remove start location\n // check and set next start location\n if (short[0] === tempStart) {\n tempStart = short[1];\n } else if (short[1] === tempStart) {\n tempStart = short[0];\n } else {\n console.log(\"ERROR\"); // not sure if error is ever produced\n }\n }\n tempStart = $start; // set back to original start value\n // add final trip from last location back to original position\n tripList.push([tempList[0], tempStart, calcDistance(tempList[0], tempStart)]);\n return tripList; // return array with each trip and distances\n}", "title": "" }, { "docid": "afa9745e7c1a4f0620e2cb102bf82e8d", "score": "0.56033754", "text": "function dijkstra(point, road_to, link_list, total_node_num) {\n // initialization\n var start_vertex = point.start;\n\tvar end_vertex = point.end;\n\tif (start_vertex == end_vertex) return { nodes: {}, paths: {}, total_cost: 0 };\n\n var d = []; // the shortest distance to every node\n var previous = []; // save previous node\n\n for (var i = 0; i < total_node_num; i++) {\n d.push(INF);\n previous.push(\"UNDEFINED\");\n }\n\n var S = []; // nodes already in shortest path\n var Q = []; // nodes not in shortest path\n S.push(start_vertex);\n for (var i = 0; i < total_node_num; i++) {\n if (road_to[start_vertex][i])\n d[i] = road_to[start_vertex][i];\n if (i != start_vertex)\n Q.push(i);\n }\n d[start_vertex] = 0;\n\n // main algorithm\n var cur_vertex = start_vertex;\n while (Q.length && cur_vertex != end_vertex) {\n // find min distance\n var d_min = INF;\n for (var i = 0; i < Q.length; i++) {\n var vertex = Q[i];\n if (d[vertex] <= d_min) {\n d_min = d[vertex];\n cur_vertex = vertex;\n }\n }\n\n // add current node to S, erase current node from Q\n S.push(cur_vertex);\n Q.splice(Q.indexOf(cur_vertex), 1);\n\n // update distance\n for (var i = 0; i < Q.length; i++) {\n var vertex = Q[i];\n if (d[vertex] > d[cur_vertex] + road_to[cur_vertex][vertex]) {\n d[vertex] = d[cur_vertex] + road_to[cur_vertex][vertex];\n previous[vertex] = cur_vertex;\n }\n }\n }\n\n var node_result = [];\n\tvar edge_result = [];\n\tvar total_cost = 0;\n\n // no path\n if (d[end_vertex] == INF) {\n\t\tnode_result[0] = [];\n\t\tedge_result[0] = [];\n node_result[0].push(\"Path not found\");\n edge_result[0].push(\"Path not found\");\n return { nodes: node_result, paths: edge_result, total_cost: INF};\n }\n\n\tnode_result.push(cur_vertex);\n while (true) {\n if (previous[cur_vertex] == \"UNDEFINED\") break;\n\t\tnode_result.push(previous[cur_vertex]);\n\t\tedge_result.push(link_list[cur_vertex][previous[cur_vertex]]);\n\t\ttotal_cost += links[link_list[cur_vertex][previous[cur_vertex]]].cost;\n cur_vertex = previous[cur_vertex];\n }\n node_result.push(start_vertex);\n\tedge_result.push(link_list[start_vertex][cur_vertex]);\n\ttotal_cost += links[link_list[start_vertex][cur_vertex]].cost;\n\n return { nodes: node_result, paths: edge_result, total_cost: total_cost };\n}", "title": "" }, { "docid": "5cc98bfa179431a3f66980233ae47273", "score": "0.5588725", "text": "function draw() {\n //if openSet is not empty\n if(openSet.length > 0) {\n var lowestIndex = 0; //for openSet with lowest index\n for(var i = 0; i < openSet.length; i++) { //loop through openSet\n if(openSet[i].f < openSet[lowestIndex].f) { //to find if f at openSet is smaller at i than the one at lowestIndex\n lowestIndex = i; //if so then set lowestIndex to i bc we want smallest f value for shortest distance\n }\n }\n var current = openSet[lowestIndex];\n\n //if openSet at lowestIndex is equal to end --> we're done!\n if(current === end) {\n noLoop();\n console.log(\"DONE\");\n }\n\n removeFromArray(openSet, current); //remove current from openSet\n closedSet.push(current); //item has been viewed, so put in closedSet\n\n var neighbors = current.neighbors; //get all neighbors for current spot\n for(var i = 0; i < neighbors.length; i++) { //keep getting each neighbor and evaluate accordingly\n var neighbor = neighbors[i];\n var newPath = false;\n\n if(!closedSet.includes(neighbor) && !neighbor.wall) { //if neighbor is not in closedSet && neighbor is not wall\n var tempG = current.g + 1; //add 1 to current spot's cost and store in tempG\n\n if(openSet.includes(neighbor)) { //if openSet has the neighbor\n if(tempG < neighbor.g) { //and if tempG has less cost than neighbor's cost\n neighbor.g = tempG; //neighbor's cost is set to the shorter cost in tempG\n newPath = true; //newPath is set to true bc better g has been found\n }\n }\n else { //if neighbor is not in openSet\n neighbor.g = tempG; //set neighbor's cost to tempG cost bc neighbor didn't have g\n newPath = true; //has to have newPath\n openSet.push(neighbor); //push openSet to neighbor\n }\n\n if(newPath) { //if new amount of time it took to get here is better aka true\n neighbor.h = heuristic(neighbor, end); //find distance between this neighbor and end aka find heuristic\n neighbor.f = neighbor.g + neighbor.h; //add cost and heuristic to find total distance\n neighbor.previous = current; //update previous if g has improved\n }\n\n }\n }\n }\n\n else {\n console.log(\"No solution!\");\n noLoop();\n return;\n }\n\n background(0);\n\n//trying to get each spot to show itself\n for(var i = 0; i < cols; i++) {\n for(var j = 0; j < rows; j++) {\n grid[i][j].show(color(255));\n }\n }\n\n //make closedSet visible with color\n for(var i = 0; i < closedSet.length; i++) {\n closedSet[i].show(color(255, 0, 0));\n }\n\n //make openSet visible with color\n for(var i = 0; i < openSet.length; i++) {\n openSet[i].show(color(0, 255, 0));\n }\n\n //find path\n path = []; //start with empty list\n var temp = current;\n path.push(temp); //put end spot in list\n while(temp.previous) { //while there is sth before end spot\n path.push(temp.previous); //keep adding to array\n temp = temp.previous;\n }\n\n\n //make path visible with color\n for(var i = 0; i < path.length; i++) {\n //path[i].show(color(0, 0, 255));\n }\n\n noFill();\n stroke(255, 0, 100);\n strokeWeight(w / 2);\n beginShape();\n for(var i = 0; i < path.length; i++) {\n vertex(path[i].i * w + w / 2, path[i].j * h + h / 2);\n }\n endShape();\n}", "title": "" }, { "docid": "ecf6dd7ad247b6180936b801deb2aa76", "score": "0.5584725", "text": "function getShortestPath(){\n let source = document.getElementById('source').value.trim();\n let destination = document.getElementById('destination').value.trim();\n\n let result = document.getElementById('path');\n\n if(stationsList.has(source) && stationsList.has(destination))\n result.innerText = stationsGraph.findPathWithDijkstra(source,destination);\n else\n if(stationsList.has(source))\n alert(\"Destination not found\");\n else\n alert(\"Source not found\");\n\n}", "title": "" }, { "docid": "fc806c04859c54b87bb0e73f125e72bc", "score": "0.55805933", "text": "function findClosestStartPath(startObject,paths) {\n\t//console.log(paths);\n\tif (paths == null) {\n\t\treturn null;\n\t}\n\tvar closestDistance = -1;\n\tvar closestIndex = -1;\n\tvar startObjectCenterX = startObject.centerX();\n\tvar startObjectCenterY = startObject.centerY();\n\t//console.log(\"CENTERX: \" + startObjectCenterX + \" CENTERY: \" + startObjectCenterY);\n\tfor (var i = 0; i < paths.length; i++) {\n\t\t//console.log(path);\n\t\tvar curDistance = getDistance(startObjectCenterX,startObjectCenterY,paths[i][paths[i].length-1].centerX(),paths[i][paths[i].length-1].centerY());\n\t\t//console.log(\"curDistance: \" + curDistance);\n\t\t//console.log(\"myIdx: \" + startObject.space.listX + \" myIDy: \" + startObject.space.listY + \" path[\" + i + \"] centerx: \" + paths[i][paths[i].length-1].centerX() + \" centery: \" + paths[i][paths[i].length-1].centerY() + \" idx: \" + paths[i][paths[i].length-1].listX + \" idy: \" + paths[i][paths[i].length-1].listY); //nice infoDump\n\t\t//printPath(paths[i]);\n\t\tif (closestDistance == -1 || curDistance < closestDistance) {\n\t\t\tclosestDistance = curDistance;\n\t\t\tclosestIndex = i;\n\t\t}\n\t}\n\t//console.log(\"findClosestStartPath closestDistance: \" + closestDistance);\n\treturn paths[closestIndex];\n}", "title": "" }, { "docid": "1d1eafc914ffd02db10146655445a89c", "score": "0.55797267", "text": "function solveTSP()\r\n\t\t{\t\r\n\t\t\tvar stack=[];\r\n\t\t\tvar visited=[];\r\n\t\t\t// mark all places as unvisited\r\n\t\t\tfor(var i=0;i<sno;i++)\r\n\t\t\t\tvisited.push(0);\r\n\r\n\t\t\tvisited[srcindex]=1;\r\n\t\t\tstack.push(srcindex);\r\n\t\t\tvar elem,dst,i;\r\n\r\n\t\t\tvar min=Number.MAX_VALUE;\r\n\t\t\tvar minflag=false;\r\n\t\t\tfinalpath.push(srcindex); \r\n\r\n\t\t\twhile(stack.length>0)\r\n\t\t\t{\r\n\t\t\t\telem=stack[stack.length-1];\r\n\t\t\t\tvar i=0;\r\n\t\t\t\tmin=Number.MAX_VALUE;\r\n\r\n\t\t\t\twhile(i<sno)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(dmatrix[elem][i] > 0 && visited[i]==0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(min > dmatrix[elem][i])\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tmin=dmatrix[elem][i];\r\n\t\t\t\t\t\t\tdst=i;\r\n\t\t\t\t\t\t\tminflag=true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti+=1\r\n\t\t\t\t}\r\n\t\t\t\tif(minflag)\r\n\t\t\t\t{\r\n\t\t\t\t\tvisited[dst]=1;\r\n\t\t\t\t\tstack.push(dst);\r\n\t\t\t\t\tfinalpath.push(dst);\r\n\t\t\t\t\tminflag=false;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tstack.pop()\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "52b663368d8d01cac726f7c597cb5f1e", "score": "0.55754185", "text": "function WeightedPath(strArr) {\n var nodesCount = Number(strArr[0]);\n var nodes = new Map();\n\n for (var i = 0; i < nodesCount; i++) {\n nodes.set(strArr[i + 1], []);\n }\n\n for (var i = nodesCount + 1; i < strArr.length; i++) {\n var points = strArr[i].split('|');\n nodes.get(points[0]).push([points[1], Number(points[2])]);\n nodes.get(points[1]).push([points[0], Number(points[2])]);\n }\n\n var toFind = strArr[nodesCount];\n\n var shortestPath = null;\n var shortestCost = Number.MAX_VALUE;\n\n function findTarget(currentSet, currentCost, nextNode, cost) {\n currentCost += cost;\n if (shortestCost <= currentCost)\n return;\n currentSet.add(nextNode);\n var children = nodes.get(nextNode);\n if (toFind === nextNode) {\n shortestPath = currentSet;\n shortestCost = currentCost;\n return;\n } else {\n for (n of children) {\n if (currentSet.has(n[0]))\n continue;\n findTarget(new Set(currentSet), currentCost, n[0], n[1])\n }\n }\n }\n\n findTarget(new Set(), 0, strArr[1], 0);\n if (!shortestPath)\n return -1;\n var res = \"\";\n var i = 0;\n for (n of shortestPath) {\n if (i > 0)\n res += '-';\n i++;\n res += n;\n }\n\n\n return res;\n\n}", "title": "" }, { "docid": "9caf56b32e4640e3ff16dc4b2c644aee", "score": "0.5572805", "text": "function calculatePath(terrain,startSpace,goalSpace, goalCondition, adjacentSpacesMethod, validityCondition, useHeuristics) { \t\n\t//if the start space is the goal space, then the path is just that space\n\tif (goalCondition(startSpace,goalSpace)) {\n\t\treturn [startSpace];\n\t}\n\t\n\t//initialize goal and parent space properties\n\tstartSpace.parent = null;\n\tstartSpace.startDistance = 0;\n\t\n\t//initialize open and closed sets for traversal (closed set is kept global for visual representation)\n\tclosedSet = [];\n\topenSet = [startSpace];\n\t\n\t//main iteration: keep popping spaces from the back until we have found a solution or openSet is empty (no path found)\n\twhile (openSet.length > 0) {\n\t\t//grab another space from the open set and push it to the closed set\n\t\tvar currentSpace = openSet.shift();\n\t\tclosedSet.push(currentSpace);\n\t\t\n\t\t//gather a list of adjacent spaces\n\t\tvar adjacentSpaces = adjacentSpacesMethod(terrain,currentSpace.x,currentSpace.y);\n\t\t\n\t\t//main inner iteration: check each space in adjacentSpaces for validity\n\t\tfor (var k = 0; k < adjacentSpaces.length; ++k) {\t\n\t\t\tvar newSpace = adjacentSpaces[k];\n\t\t\t//if the new space is the goal, compose the path back to startSpace\n\t\t\tif (goalCondition(newSpace,goalSpace)) {\n\t\t\t\tnewSpace.parent = currentSpace; //start the path with currentSpace and work our way back\n\t\t\t\treturn composePath(startSpace, newSpace);\n\t\t\t}\n\t\t\t\n\t\t\t//add newSpace to the openSet if it isn't in the closedSet or if the new start distance is lower\n\t\t\tif (validityCondition(terrain, newSpace.x,newSpace.y)) {\t\t\t\t\n\t\t\t\tvar newStartDistance = currentSpace.startDistance + 1;\n\n\t\t\t\t//if newSpace already exists in either the open set or the closed set, grab it now so we maintain startDistance\n\t\t\t\tvar openSetIndex = openSet.findIndex(checkCoords,newSpace);\n\t\t\t\tvar inOpenSet = openSetIndex!= -1;\n\t\t\t\tif (inOpenSet) {\n\t\t\t\t\tnewSpace = openSet[openSetIndex];\n\t\t\t\t}\n\t\t\t\tvar closedSetIndex = closedSet.findIndex(checkCoords,newSpace);\n\t\t\t\tvar inClosedSet = closedSetIndex != -1;\n\t\t\t\tif (inClosedSet) {\n\t\t\t\t\tnewSpace = closedSet[closedSetIndex];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//don't bother with newSpace if it has already been visited unless our new distance from the start space is smaller than its existing startDistance\n\t\t\t\tif (inClosedSet && (newSpace.startDistance <= newStartDistance)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//accept newSpace if newSpace has not yet been visited or its new distance from the start space is less than its existing startDistance\n\t\t\t\tif ((!inOpenSet) || newSpace.startDistance > newStartDistance) { \n\t\t\t\t\tnewSpace.parent = currentSpace;\n\t\t\t\t\tnewSpace.startDistance = newStartDistance;\n\t\t\t\t\tnewSpace.totalCost = newSpace.startDistance + (useHeuristics ? calculateHeuristics(newSpace,goalSpace) : 0);\n\t\t\t\t\t//remove newSpace from openSet, then add it back via binary search to ensure that its position in the open set is up to date\n\t\t\t\t\tif (inOpenSet) {\n\t\t\t\t\t\topenSet.splice(openSetIndex,1);\n\t\t\t\t\t}\n\t\t\t\t\topenSet.splice(binarySearch(openSet,newSpace,\"totalCost\",true),0,newSpace);\n\t\t\t\t\t//if newSpace is in the closed set, remove it now\n\t\t\t\t\tif (inClosedSet) {\n\t\t\t\t\t\tclosedSet.splice(closedSetIndex,1);\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}\n\t//no path was found; simply return an empty list\n\treturn [];\n}", "title": "" }, { "docid": "4ec6f0343540257a62fe9741b9747953", "score": "0.55524063", "text": "function minDistCell() {\r\n let min=Number.POSITIVE_INFINITY; \r\n for (let i = 0; i < col; i++) {\r\n for (let j = 0; j < row; j++) {\r\n if (grid[i][j].obstacle==false && grid[i][j].partofQueue==true && grid[i][j].dist<=min) {\r\n min=grid[i][j];\r\n } \r\n } \r\n } \r\n return min;\r\n}", "title": "" }, { "docid": "1769effcff74ff0f75b6895baab0a826", "score": "0.555217", "text": "function getMinimum(){\n\t\tvar currentMinimumIndex = -1;\n\t\tvar currentBestWeight = 2000;\n\t\t//Loop through and find the minimum weight\n\t\tfor(var i = 0; i < frontier.length; i++){\n\t\t\tif(frontier[i].weight < currentBestWeight){\n\t\t\t\tcurrentBestWeight = frontier[i].weight;\n\t\t\t\tcurrentMinimumIndex = i;\n\t\t\t}\n\t\t}\n\n\t\t//Error Check\n\t\tif(currentMinimumIndex == -1){\n\t\t\tconsole.log(\"Wuh woah: Error line 92 - Frontier is empty, yet was still called\");\n\t\t} else {\n\t\t\t//Return the minimum\n\t\t\tvar temp = frontier.splice(currentMinimumIndex,1)[0];\n\t\t\t//console.log(\"Removed \" + temp.x + \" \" + temp.y);\n\t\t\treturn temp;\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "f4bdae689a560907b140c74a95d72883", "score": "0.55483186", "text": "function optimalLeastWalkingRoute(origin, destination) {\n var stopTimeList = [];\n\n for (routes of harvRoutes) {\n routeSpecs = new Object();\n routeSpecs.route = routes.name;\n var holder = combinedClosestDistance(routes.stops, origin, destination)\n routeSpecs.combinedDistance = holder.combinedDistance;\n routeSpecs.originStop = holder.originStop;\n routeSpecs.destinationStop = holder.destinationStop\n stopTimeList.push(routeSpecs);\n }\n\n stopTimeList.sort(function(a, b) {\n return a.combinedDistance - b.combinedDistance\n });\n\n return stopTimeList[0]\n}", "title": "" }, { "docid": "2ae0c087400b3e149746dee091f3918e", "score": "0.55458844", "text": "function findPath() {\n if (openList.length == 0) {\n alert(\"NO PATH COULD BE FOUND\")\n reset()\n return false\n } else {\n const lowest = getMinFPoint()\n if (lowest.comparePoint(endPoint)) {\n endPoint.parent = lowest\n calculateFinalPath()\n return false\n } else {\n removeFromOpenList(lowest)\n closedList.push(lowest)\n addSurroundingsToOpenList(lowest)\n return true\n }\n }\n}", "title": "" }, { "docid": "f9c97caa193843faa08304a0572b0c73", "score": "0.55458456", "text": "function calcPath() {\n let bug = this.startPort.open\n // bug ? console.log(\"---------------FUNCTION RUN: calcPath from \", this.id.substr(-4),\"--------------------\") : {}\n \n\n //1 a temp x and y are created \n let sX = this.sX\n let sY = this.sY\n let eX = this.B.snapToGrid(this.eX)\n let eY = this.B.snapToGrid(this.eY)\n\n //2 an open set, the first positioin (defining the starting position)\n let openSet = [{\n x:sX, \n y:sY,\n g:0,\n h: this.p.dist(sX, sY, eX, eY),\n f: 0 + this.p.dist(sX, sY, eX, eY),\n prev: []\n }]\n\n //3 nodes are the list that will be returned and later drawn in this.display()\n //closedSet are items that have been checked and added to the openset\n //debug count each whileloop run and stops on 300 to make sure that no endless loope will run\n let nodes = [\n // {x: this.sX, y: this.sY}\n ]\n let closedSet = []\n let debug = 0\n \n while(openSet.length > 0) {\n //counts times loop iterates\n debug++\n\n // let lowInd = 0\n // for(var i=0; i<openSet.length; i++) {\n // if(openSet[i].f < openSet[lowInd].f) { lowInd = i; }\n // } \n\n\n // //5.2 - defines the most optimal currentNode that will be evaluated\n // let currentNode = openSet[lowInd];\n\n openSet = openSet.sort((a,b)=>{return a.f-b.f})\n let currentNode = openSet[0];\n \n //5.3 remove currentNode from openlist and puts it n the closed list as it will be checked\n openSet.splice(0, 1)\n closedSet.push(currentNode)\n // console.log(currentNode, openSet)\n\n // bug ? console.log(\"cur->\", currentNode.x, currentNode.y, \"end_>\", eX, eY)\n // :{}\n\n if((currentNode.x == eX && currentNode.y == eY)) {\n // bug ? console.log(debug, \"---------------------------->found goal, trace path and return nodeList\") : {}\n //add last node if necesary and return\n nodes = [...nodes, ...currentNode.prev, currentNode]\n openSet = []\n } else {\n //create neigbour that need to be checked\n let neighbours = [\n {x: currentNode.x, y: currentNode.y-this.B.gridSize}, //north\n {x: currentNode.x+this.B.gridSize, y: currentNode.y}, //east\n {x: currentNode.x, y: currentNode.y+this.B.gridSize}, //south\n {x: currentNode.x-this.B.gridSize, y: currentNode.y} //west\n ]\n\n // console.log(\"current is \", currentNode, \"north is\", neighbours[0],\n // \"east is\", neighbours[1],\"south is\", neighbours[2],\"west is\", neighbours[3],\n // )\n\n //filters out neighbours that already exist or don't pass the test\n neighbours = neighbours.filter((neighbour, index)=>{\n //by default all neigbors pass\n let pass = true\n\n //removes if neigbour exist in closed set\n if(closedSet.find(item=>item.x==neighbour.x && item.y==neighbour.y) != undefined) {\n // console.log(\"YES - in CLOSED set -1\")\n pass = false\n }\n\n //removes if neighbour exist in openSet\n if(openSet.find(item=>item.x==neighbour.x && item.y==neighbour.y) != undefined) {\n // console.log(\"YES - in OPEN set -1\")\n pass = false\n }\n\n //adds props to heighbours that arn't in open or closed set\n neighbour.g = this.p.dist(sX, sY, neighbour.x, neighbour.y) \n neighbour.h = this.p.dist(neighbour.x, neighbour.y, eX, eY)\n neighbour.f = neighbour.g+neighbour.h\n neighbour.prev = [...currentNode.prev, currentNode]\n\n //return true if pass else false and is filtered out\n return pass\n })\n\n // adds neigburs to open set\n // openSet = openSet.concat(neighbours).sort((a,b)=>{a.f-b.f})\n openSet = openSet.concat(neighbours)\n\n }\n\n //stops loop if it bugs\n if(debug > 300) {\n console.log(\"pathfinder passed\", debug, \"check for bug\")\n openSet = []\n }\n \n }\n\n //return list of path pos\n // bug ? console.log(nodes) : {}\n return nodes\n}", "title": "" }, { "docid": "2a917f6855977cb0f956257a55866975", "score": "0.55451274", "text": "heuristic (node) {\n return 0\n }", "title": "" }, { "docid": "67465a093bbff3caa9240eef3f2df885", "score": "0.55328953", "text": "function dijkstra(graph, startNodeName, endNodeName) {\n\n // track the lowest cost to reach each node\n let costs = {};\n costs[endNodeName] = \"Infinity\";\n costs = Object.assign(costs, graph[startNodeName]);\n\n // track paths\n const parents = {endNodeName: null};\n for (let child in graph[startNodeName]) {\n parents[child] = startNodeName;\n }\n\n // track nodes that have already been processed\n const processed = [];\n\n let node = lowestCostNode(costs, processed);\n\n while (node) {\n let cost = costs[node];\n let children = graph[node];\n for (let n in children) {\n if (String(n) === String(startNodeName)) {\n log(\"WE DON'T GO BACK TO START\");\n } else {\n log(\"StartNodeName: \" + startNodeName);\n log(\"Evaluating cost to node \" + n + \" (looking from node \" + node + \")\");\n log(\"Last Cost: \" + costs[n]);\n let newCost = cost + children[n];\n log(\"New Cost: \" + newCost);\n if (!costs[n] || costs[n] > newCost) {\n costs[n] = newCost;\n parents[n] = node;\n log(\"Updated cost und parents\");\n } else {\n log(\"A shorter path already exists\");\n }\n }\n }\n processed.push(node);\n node = lowestCostNode(costs, processed);\n }\n\n let optimalPath = [endNodeName];\n let parent = parents[endNodeName];\n while (parent) {\n optimalPath.push(parent);\n parent = parents[parent];\n }\n optimalPath.reverse();\n\n const results = {\n dijkstraCost: costs[endNodeName],\n path: optimalPath\n };\n\n return results;\n}", "title": "" }, { "docid": "8833731b8c54648db4d7b38698c008a6", "score": "0.55251735", "text": "stepCost() {\n if (this.problemType === 'PUZZLE') {\n return 1\n } else {\n return 1;\n }\n }", "title": "" }, { "docid": "0cce28ff61b92b8cdf7b1d23407ef336", "score": "0.5521953", "text": "findShortestPath() {\n if (this.state.origin && this.state.destination) {\n this.state.distanceTable.forEach((row) => {\n if (row.src === this.state.origin && row.dest === this.state.destination) {\n this.setState({\n currentPath: row\n });\n }\n });\n }\n }", "title": "" }, { "docid": "f8343799bb2fa7d82be2c6429c9fdd55", "score": "0.551877", "text": "function findBestRouteAndStats(path) {\r\n debug.info(\"Launching \"+(path.length-1)+\" Directions API requests\");\r\n // separate origin from the other points\r\n let origin = path[0];\r\n let points = path.slice(1);\r\n\r\n // make multiple parameter objects,\r\n let params_batch = points.map(\r\n (v, i) => // one for each non-origin point 'v'.\r\n ({\r\n units: \"metric\",\r\n mode: \"driving\",\r\n origin: origin,\r\n // set 'v' as the destination\r\n destination: v,\r\n // and use other points except 'v' as waypoints to optimize\r\n waypoints: points.filter((x,y) => y!= i),\r\n optimize: true\r\n })\r\n );\r\n\r\n return Promise.all(\r\n // send each param object as a Google Directions API request\r\n params_batch.map(b => googleMapsClient.directions(b).asPromise())\r\n )\r\n // then once all are done,\r\n .then( results => {\r\n debug.debug(\"Directions API requests all returned\");\r\n // get total distance of each result\r\n let total_distances = results.map( resp =>\r\n // for each result, there's only one route object\r\n // (we only set 1 destination per request)\r\n resp.json.routes[0]\r\n .legs // each route object has multiple steps, or 'legs'\r\n .map(v => v.distance.value) // get each leg's distance value\r\n .reduce((a, b) => a + b) // and add them to get total sum\r\n );\r\n\r\n // then find which request has the shortest distance\r\n let best_index = total_distances.reduce(\r\n (best_i, val, cur_i) => (val < total_distances[best_i]) ? cur_i :best_i,\r\n 0\r\n );\r\n\r\n // & get its relevant values, formatted as PathingRequest doc attributes\r\n let best_route = results[best_index].json.routes[0];\r\n let best_params = params_batch[best_index];\r\n return {\r\n total_distance: total_distances[best_index],\r\n // same as total_distance calculation, but for total duration\r\n total_time: best_route.legs.map(v => v.duration.value).reduce((a, b) => a + b),\r\n // update path to the optimized order given to us by the best result\r\n path: [].concat(\r\n [best_params.origin],\r\n best_route.waypoint_order.map(i => best_params.waypoints[i]),\r\n [best_params.destination]\r\n )\r\n };\r\n })\r\n .catch( e => {\r\n // catch API call errors, log\r\n debug.error(\"Error when sending/resolving Google API calls:\");\r\n debug.error(e);\r\n // & hide specifics from user (data may be sensitive)\r\n throw new Error(\"Something went wrong when querying Google\");\r\n });\r\n}", "title": "" }, { "docid": "00fd07fa777470616d283ed51e5d8781", "score": "0.5518583", "text": "function minimumValue()\n{\n var min = undefined;\n for (var i = 0; i < EdgeArray.length; i++)\n if(!selected[i] && (min == undefined || min > EdgeArray[i].length))\n {\n if(!sameTree(getIndex(EdgeArray[i].point1), getIndex(EdgeArray[i].point2)))\n min = EdgeArray[i].length;\n }\n return min;\n}", "title": "" }, { "docid": "5750598f290a3600fcf98aa735abf38f", "score": "0.5517619", "text": "function findPath(sourceID, targetID, centrality_flag) {\n\tvar total_node_num = nodes.length;\n\n // init road_to and edge_list\n var road_to = new Array(nodes.length); // distance between two nodes\n var edge_list = new Array(links.length); // edge id between two nodes\n for (var i = 0; i < total_node_num; i++) {\n road_to[i] = new Array(total_node_num);\n edge_list[i] = new Array(links.length);\n\n for (var j = 0; j < total_node_num; j++)\n road_to[i][j] = INF;\n road_to[i][i] = 0;\n }\n\n for (var index in links) {\n\t\tvar link = links[index];\n var source_id = link.source.id;\n var target_id = link.target.id;\n var cost = link.cost;\n\n road_to[source_id][target_id] = cost;\n road_to[target_id][source_id] = cost;\n\n edge_list[source_id][target_id] = link.id;\n edge_list[target_id][source_id] = link.id;\n }\n\n\t// get the shortest path between two nodes\n\tif (!centrality_flag)\n\t\treturn dijkstra({start: sourceID, end: targetID}, road_to, edge_list, total_node_num);\n\t\n // get centrality (closeness and betweenness)\n\tvar graphStats = {};\n\tfor (var i in nodes) {\n\t\tgraphStats[nodes[i].id] = {};\n\t\tgraphStats[nodes[i].id][\"Closeness\"] = 0;\n\t\tgraphStats[nodes[i].id][\"Betweenness\"] = 0;\n\t\tgraphStats[nodes[i].id][\"Total Connectivity\"] = 0;\n\t}\n\n\tfor (var i in nodes) {\n\t\tvar sourceID = nodes[i].id;\n\t\tvar connected_node_num = 0;\n\t\tvar total_connected_distance = 0;\n\n\t\t// get all shortest path cost from source node\n\t\tfor (var j in nodes) {\n\t\t\tvar targetID = nodes[j].id;\n\t\t\tvar result_obj = dijkstra({start: sourceID, end: targetID}, road_to, edge_list, total_node_num);\n\n\t\t\t// for closeness\n\t\t\tvar cost = result_obj.total_cost;\n\t\t\tif (cost != INF) {\n\t\t\t\tconnected_node_num++;\n\t\t\t\ttotal_connected_distance += cost;\n\t\t\t}\n\n\t\t\t// for betweenness\n\t\t\tvar node_ids = result_obj.nodes;\n\t\t\tif (node_ids[0] != \"Path not found\") {\n\t\t\t\tfor (var index in node_ids) {\n\t\t\t\t\tvar node_id = node_ids[index]\n\t\t\t\t\tif (node_id == sourceID || node_id == targetID) continue;\n\n\t\t\t\t\tgraphStats[node_id][\"Betweenness\"] += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// calculate closeness\n\t\tgraphStats[sourceID][\"Total Connectivity\"] = connected_node_num;\n\t\tif(connected_node_num == 0)\n\t\t\tgraphStats[sourceID][\"Closeness\"] = 0; \n\t\telse\n\t\t\tgraphStats[sourceID][\"Closeness\"] = total_connected_distance / connected_node_num;\n\t}\n\n\treturn graphStats;\n}", "title": "" }, { "docid": "01b4bef4285d25fefe39e1cc242f6a9d", "score": "0.551449", "text": "function findRoute(graph, from, to) { //Pathfinding search problem. Finding shortest route from a to b.\n let work = [{at: from, route: []}]; //List of places that should be explored next, along with the route that got there. Starts with just start position and empty route.\n for (let i = 0; i < work.length; i++) { //\n let {at, route} = work[i];\n for (let place of graph[at]) { //Looking at graph of town, check all the locations accessible from the curent place\n if (place == to) return route.concat(place); //If this location is the goal, return the complete route leading to this place!\n if (!work.some(w => w.at == place)) { //If this location hasnt been checked before (this place isnt in the work list's \"at\" values yet...)\n work.push({at: place, route: route.concat(place)}); //Add this new location to the list with new complete corresponding route\n }\n }\n } //\"Web of known routes crawling out from the start location, growing evenly on all sides but never tangling back into itself. As soon as the first thread reaches the goal location, that thread is traced back to the start, giving the correct route.\"\n}", "title": "" }, { "docid": "f26ac01ef766d0c30a0c63bb8a2c6545", "score": "0.5490982", "text": "getLongestPathFromNode(start) {\n\t\tlet adjacencyList = this.adjacencyList()\n\t\tlet todo = new Stack()\n\t\tlet parent = []\n\t\tlet length = []\n\t\tlet maxLength = 0\n\t\tlet maxNode = 0\n\t\tfor (var i = 0; i < this.width * this.height; i++) {\n\t\t\tparent[i] = -1\n\t\t\tlength[i] = -1\n\t\t}\n\t\tparent[start] = start\n\t\tlength[start] = 0\n\t\ttodo.push(start)\n\t\t// basic DFS\n\t\twhile(todo.length > 0) {\n\t\t\tlet node = todo.pop()\n\t\t\tfor (var child of adjacencyList[node]) {\n\t\t\t\tif (parent[child] == -1) {\n\t\t\t\t\ttodo.push(child)\n\t\t\t\t\tparent[child] = node\n\t\t\t\t\tlet childLength = length[node] + 1\n\t\t\t\t\tlength[child] = childLength\n\t\t\t\t\tif (childLength > maxLength) {\n\t\t\t\t\t\tmaxLength = childLength\n\t\t\t\t\t\tmaxNode = child\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Iterate through path, starting at the end\n\t\tlet path = [maxNode]\n\t\tlet node = maxNode\n\t\twhile(node != start) {\n\t\t\tnode = parent[node]\n\t\t\tpath.push(node)\n\t\t}\n\t\treturn path.reverse()\n\t}", "title": "" }, { "docid": "1926aebff12db3690c1194593751497e", "score": "0.5478894", "text": "function reconstructPath(howWeReachedNodes, startNode, endNode) {\n const shortestPath = [];\n //start from end of the path and work backwards\n let currentNode = endNode;\n\n while (currentNode !== null) {\n shortestPath.push(currentNode);\n currentNode = howWeReachedNodes[currentNode];\n }\n //since we started backtracking at the recipient's node, our path is going to come out backward so we need to reverse it\n return shortestPath.reverse();\n}", "title": "" } ]
43e199d9125f89520348db85a031fbdd
Send message to client no matter whether handshake.
[ { "docid": "7d0d00cb778e2207463e3529fb62a5e3", "score": "0.6159362", "text": "sendForce(msg) {\n if (this.state === ST_CLOSED) {\n return;\n }\n this.socket.send(msg, { binary: true });\n }", "title": "" } ]
[ { "docid": "b7d564834bb36d0798efc902e72d12b9", "score": "0.6828012", "text": "function send(message){\n console.log(\"[C] sending message...\");\n eventsHandler.emit('clientSendMessage', message);\n}", "title": "" }, { "docid": "f511464d6910926bfb37ab558773e68a", "score": "0.6650709", "text": "function send(message) {\n if (!window.WebSocket) {\n return;\n }\n if (socket.readyState == WebSocket.OPEN) {\n socket.send(message);\n } else {\n showError(\"The socket is not opened.\")\n }\n}", "title": "" }, { "docid": "e4fe8650df7e6291c8e33761f1d8a5d4", "score": "0.6444531", "text": "function socketSend(msg) {\n if (sockEcho != null && sockEcho.readyState == WebSocket.OPEN) {\n sockEcho.send(JSON.stringify(msg));\n } else {\n console.log(\"Socket isn't OPEN\");\n }\n}", "title": "" }, { "docid": "d509dd9dea6eb7c715b7bd388d17f4fc", "score": "0.64438206", "text": "sendMessage(msg) {\n if (this.available) {\n this.socket.write(msg);\n }\n }", "title": "" }, { "docid": "af4093497cd843ba7cbfa237d25e3079", "score": "0.6424278", "text": "send(data){\r\n const message = JSON.stringify(data);\r\n console.log(`Sending message ${message}`);\r\n this.connection.send(message, function ack(err){\r\n if (err){\r\n console.error('Message failed', err, message);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "bad711cf7faabaf5043e70aa242fc096", "score": "0.637774", "text": "function send(data){\r\n if (connection.readyState === WebSocket.OPEN){\r\n connection.send(data);\r\n } else {\r\n throw 'Non connecté.';\r\n }\r\n }", "title": "" }, { "docid": "00c98d437ab47a7ce0bde4dc9f8a5111", "score": "0.636489", "text": "function sendText(input){\nif (peerSocket.readyState === peerSocket.OPEN) {\n peerSocket.send(input);\n console.log (\"Message Sent\");\n}}", "title": "" }, { "docid": "d00a9288fd6d9b503f688ba58b0a6146", "score": "0.6358628", "text": "function sendMessage () {\r\n\r\n var msg = wolfPos;\r\n msg=msg.toUpperCase();\r\n\r\n if(!websocket || websocket.readyState === 3) {\r\n outputLog('Klienten är inte uppkopplad mot server, koppla upp');\r\n } else {\r\n var result=checkmessage(msg);\r\n //Wolf won\r\n if(result.indexOf('Ok,Vargen vann') > -1) {\r\n msg=msg.substring(2,4);\r\n websocket.send('Vargen' + ' säger: '+msg);\r\n websocket.send('Vargen vann');\r\n //Send message to Hunters\r\n } else if(result.indexOf('Ok') > -1) {\r\n msg=msg.substring(2,4);\r\n websocket.send('Vargen' + ' säger: '+msg);\r\n wolfmoved =true;\r\n //Something went wrong with the input, display fault\r\n }\telse {\r\n outputLog(result);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "48c9cf91faa262de6fc5bb361779c59a", "score": "0.63494366", "text": "function sendMessage(message){\n console.log('Client sending message: ', message);\n socket.emit('message', message);\n}", "title": "" }, { "docid": "4f4096b08d43620295771c70d92b9772", "score": "0.6345469", "text": "function doSend(message) {\n writeToScreen(\"SENT: \" + message);\n websocket.send(message);\n}", "title": "" }, { "docid": "33074501800e85b8babebd17dbfed0ab", "score": "0.6328707", "text": "function sendMsg(msg) {\n\tif (websocket.readyState == websocket.OPEN) {\n\t\twebsocket.send(JSON.stringify(msg));\n\t} else {\n\t\tshowErlangOutputScreen('websocket is not connected');\n\t};\n}", "title": "" }, { "docid": "97f32bf22de9a7fd15dd9c7abd4e76f3", "score": "0.6313431", "text": "function send_to_server(message)\n\t{\n\t\tsocket.send(message);\n\t}", "title": "" }, { "docid": "e3dade3ccfd48fc519525dfc1a0c01f0", "score": "0.63087386", "text": "function sendTheMessage() {}", "title": "" }, { "docid": "928d3c846aabba61e67deb18c9d4bc72", "score": "0.6252698", "text": "function sendData(data) {\n if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {\n messaging.peerSocket.send(data);\n }\n}", "title": "" }, { "docid": "c44f417621f2ccac4d9fb3d95f2447de", "score": "0.62349445", "text": "function sendMessageToServer(message) {\r\n socket.send(message);\r\n}", "title": "" }, { "docid": "7ac097d22dbfb98fe0614008a65b867a", "score": "0.623436", "text": "static send(command) {\n const socket = WebSocketNodeJs.get();\n if (Object.keys(socket).length) {\n socket.send(command + END_CHAR);\n console.log(command + END_CHAR); // For debugging\n }\n }", "title": "" }, { "docid": "1882136c90602622fdd85aa22cd70f06", "score": "0.6206975", "text": "function send (data) {\n socket.write(data)\n }", "title": "" }, { "docid": "09faf4514f8598cce97530f600f9511a", "score": "0.6166533", "text": "send(msg) {\r\n send(msg);\r\n }", "title": "" }, { "docid": "64ddf3ee7a2b4cb40dab10bd65d1b6cf", "score": "0.6159924", "text": "sendMessageToServer(message) {\n log.debug('Sending message to server: ', {message: message});\n\n let msgString = serializeMessage(message);\n if (this.serverConnection === undefined || this.serverConnection === null) {\n log.info('Server connection closed.');\n } else {\n this.serverConnection.send(msgString);\n }\n }", "title": "" }, { "docid": "366c1dde4c324c094d343e0f13d7b2b9", "score": "0.615943", "text": "send(data) {\n if (this.currentStatus.connected) {\n this.socket.send(data);\n }\n }", "title": "" }, { "docid": "6fda83e728d89528dc9166fccaa3ae3b", "score": "0.6156846", "text": "sendMessage(message) {\n if(this.socket.readyState === WebSocket.OPEN) {\n this.socket.send(JSON.stringify(message));\n }\n }", "title": "" }, { "docid": "b5208626dbc5376fbb3ca31bbdbd9dad", "score": "0.6147072", "text": "async sendBye() {\n if (this.isConnected === false) {\n return new Error(Constants.ERROR_CONNECTION_NOT_ESTABLISHED);\n }\n let mesg = {\n cmd: 'send',\n msg: JSON.stringify({ type: 'bye' }),\n };\n try {\n this._connection.send(JSON.stringify(mesg));\n } catch (error) {\n console.error('Failed to send bye message: ', mesg);\n throw error;\n }\n }", "title": "" }, { "docid": "20c8feb954ec00b5d73d66042722ec96", "score": "0.61378014", "text": "function send(message) { \r\n //attach the other peer username to our messages \r\n if (connectedUser) { \r\n message.name = connectedUser; \r\n } \r\n\t\r\n conn.send(JSON.stringify(message)); \r\n}", "title": "" }, { "docid": "20c8feb954ec00b5d73d66042722ec96", "score": "0.61378014", "text": "function send(message) { \r\n //attach the other peer username to our messages \r\n if (connectedUser) { \r\n message.name = connectedUser; \r\n } \r\n\t\r\n conn.send(JSON.stringify(message)); \r\n}", "title": "" }, { "docid": "bd470226024e17f4f175544f4ff035df", "score": "0.6134245", "text": "function send(message) { \n connection.send(JSON.stringify(message)); \n}", "title": "" }, { "docid": "9800bd6d4b002ecd86faf80973e9639b", "score": "0.61027235", "text": "function sendmessage(id){\n\tif(isConnected){\n\t\tconect.send(id);\n\t}\n}", "title": "" }, { "docid": "1489094f0ee315a631e89309757ac28b", "score": "0.6099321", "text": "handshake(user_token) {\n this.socket.emit('handshake',{\n client: this.name,\n token: user_token\n });\n }", "title": "" }, { "docid": "f0a8166cb252ac6683437a0f012e04d3", "score": "0.6095941", "text": "_send() {\n this._conn.flush();\n }", "title": "" }, { "docid": "f0a8166cb252ac6683437a0f012e04d3", "score": "0.6095941", "text": "_send() {\n this._conn.flush();\n }", "title": "" }, { "docid": "99c3eb862ea53b4b23bce55bcf198fdf", "score": "0.6094938", "text": "function sendMessage(message) {\n if (message !== \"\") {\n webSocket.send(message);\n }\n}", "title": "" }, { "docid": "9f6289e6d233da3577da1c185e1b0b82", "score": "0.607246", "text": "function clientMessageHandler(msg) {\n\tunixSocket.write(msg);\n}", "title": "" }, { "docid": "98123513476751fa6e87dc824e87249c", "score": "0.60637367", "text": "function sendText(msg) {\n console.log(\"sending text: \" + msg);\n //Client-initiated message to the server\n websocket.send(msg);\n}", "title": "" }, { "docid": "63bf7a7fcbaf549e90cc819c3c895994", "score": "0.6048591", "text": "function sendMessage (message){\n socket.emit('message', message);\n}", "title": "" }, { "docid": "ca920bbc46a2228de1d0578f5ad69b82", "score": "0.60333294", "text": "function sendVal(data) {\n if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {\n messaging.peerSocket.send(data);\n }\n}", "title": "" }, { "docid": "ca920bbc46a2228de1d0578f5ad69b82", "score": "0.60333294", "text": "function sendVal(data) {\n if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {\n messaging.peerSocket.send(data);\n }\n}", "title": "" }, { "docid": "ca920bbc46a2228de1d0578f5ad69b82", "score": "0.60333294", "text": "function sendVal(data) {\n if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {\n messaging.peerSocket.send(data);\n }\n}", "title": "" }, { "docid": "11078115404cfbebdfd9eab5456ac238", "score": "0.60247004", "text": "function sendMessage(data) {\n socket.emit(\"message\", data);\n}", "title": "" }, { "docid": "a3fa8ecdfc9b84ce5468d85102850a98", "score": "0.602469", "text": "send(data) {\n if (this.currentStatus.connected) {\n this.socket.send(data);\n }\n }", "title": "" }, { "docid": "ca4cca3f084105caad996dfdf1e13ae3", "score": "0.6022258", "text": "function send(message) {\n if(connected) {\n\n console.log(\"send message to the server\");\n message = JSON.stringify(message);\n console.log(message);\n socket.send(message);\n \n // not connected, put in queue\n } else {\n pill.push(message);\n console.log(\"not connected yet, dude\");\n }\n }", "title": "" }, { "docid": "9c1562ebbab666c5d9a975a1918e12ea", "score": "0.60202235", "text": "function sendMessage(message) {\n socket.emit(\"sendMessage\", message);\n }", "title": "" }, { "docid": "8e8ed500cc5fdc43005f8e5a7511a192", "score": "0.6018732", "text": "function sendClientMsg(msgObj) {\n\tif (connection === undefined) {\n\t\tlogger.log(\"error\", \"OBS hasn't been started or the browser source is not configured to load automatically. Unable to create websocket.\");\n\t\treturn;\n\t}\n\tconnection.sendUTF(JSON.stringify(msgObj));\n}", "title": "" }, { "docid": "cf81ed63a2dbf7d7aeb2b9aa231e674e", "score": "0.60053885", "text": "function send(message) {\r\n socket.emit(\r\n \"message\",\r\n message+\"\\n\"+\r\n // To stop message being blocked, random number\r\n \"ID: \"+Math.random()*100\r\n );\r\n}", "title": "" }, { "docid": "13bac6bcf51648723b5c89e62bb4d464", "score": "0.5996726", "text": "function respond(message) {\n\n let ws = this;\n let data = message;\n\n if (typeof message !== 'string') {\n message.ts = Date.now();\n data = JSON.stringify(message);\n }\n\n ws.send(data, function ack(error) {\n // if error is not defined, the send has been completed,\n // otherwise the error object will indicate what failed.\n if (error) {\n console.log(error);\n }\n });\n\n}", "title": "" }, { "docid": "0a05657d4def70d3a5bb338494688b60", "score": "0.5996382", "text": "function sendMessageToServer(message) {\n console.log(\"sending message to server\");\n socket.emit('msg',message);\n}", "title": "" }, { "docid": "b90a373dab4a07c941124e1c964d8f71", "score": "0.5993031", "text": "function sendMessage(message) {\n\tconsole.log('Client sending message: ', message);\n socket.emit('message', room, message);\n}", "title": "" }, { "docid": "696e7b51fcc0987ad1a57f53c93b36b5", "score": "0.5978717", "text": "send (clientId, message) {\n\n const client = this.getClient(clientId)\n if (!client) {\n return\n }\n const ws = client.ws\n try {\n message = JSON.stringify(message)\n }\n catch (err) {\n winston.debug('An error convert object message to string', err)\n }\n\n ws.send(message)\n }", "title": "" }, { "docid": "0dec284123075916da559b0a39911eae", "score": "0.5971775", "text": "function _socket_send(obj) {\n if ( !socket ) {\n update_log('-- NOT CONNECTED --');\n return;\n }\n socket.send(JSON.stringify(obj));\n}", "title": "" }, { "docid": "fd383f393139936a49350a35d160a21a", "score": "0.59487516", "text": "clientHandshake() {\n // if handshake already in progress\n if (this.awaitingHandshake) {\n return this.awaitingHandshake;\n }\n // make a handshake\n this.awaitingHandshake = new Promise((resolve) => {\n if (!this.clientUuid) {\n this.client.emit('handshake', { type: 'client' }, (res) => {\n this.setClientUuid(res);\n resolve();\n this.awaitingHandshake = null;\n });\n } else {\n this.awaitingHandshake = null;\n resolve();\n }\n });\n return this.awaitingHandshake;\n }", "title": "" }, { "docid": "397747ed25d7afd4474fac16ca7959e6", "score": "0.59368795", "text": "function sendMessageToClient (connectionId, message) {\n if (connections[connectionId]) {\n connections[connectionId].send(message)\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "67245006a16acff38f48096e573f4cb2", "score": "0.59355587", "text": "function send(msg) {\n switch(ps.readyState) {\n case 0: // CONNECTING\n setTimeout(function () { send(msg); }, 1000);\n break;\n case 2: // CLOSING\n case 3: // CLOSED\n _event('dev', 'pubsub - reconnect: send() - closing/closed state');\n connect();\n setTimeout(function () { send(msg); }, 2000);\n break;\n case 1: // OPEN\n try {\n ps.send(msg);\n } catch (err) {\n console.error(err);\n setTimeout(function () { send(msg); }, 1500);\n }\n break;\n default:\n break;\n\t\t}\n }", "title": "" }, { "docid": "eb087fff43a5fbe642e0342edb289da9", "score": "0.5934878", "text": "function Send(data) {\n if (socketStatus == SOCKET_STATUS_ONLINE) {\n socket.sendText(data);\n }\n}", "title": "" }, { "docid": "64531bf9f273ce4fc0867b815b2d9585", "score": "0.5927256", "text": "static handshakeTest () {\n const req = {\n headers: {\n 'sec-websocket-key': acceptKey\n }\n }\n\n // Test du retour du socket mis à jour\n runner('deepEqual', WebSocketServerTest.object.handshake(req, socket), socket)\n\n // Test de l'entête envoyée par le serveur\n runner('equal', socket.data, 'HTTP/1.1 101 Web Socket Protocol Handshake\\r\\nUpgrade: WebSocket\\r\\nConnection: Upgrade\\r\\nSec-WebSocket-Accept: PCTVnEp5Fgk+FSRxTmDP8XrJlSk= \\r\\n\\r\\n')\n\n // Suppression du socket enregistrer\n WebSocketServer.registeredWebsocket.delete(acceptKey)\n }", "title": "" }, { "docid": "e982c3deda49ab0e5455d61d68570e2b", "score": "0.5920716", "text": "handshake(binary, socket) {\n\t\t\n\t\tconsole.log('SV GOT HANDSHAKE:', socket.name);\n\t\t\n\t\tbinary.pos = 4;\n\t\tconst identity = binary.pullString();\n\t\t\n\t\t// Check protocol identity\n\t\tif (identity === this._protocol.identity) {\n\t\t\tthis.addSocket(socket);\n\t\t} else {\n\t\t\tconsole.log('SV CLIENT REJECTED!');\n\t\t\tsocket.close();\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "b271969693a035742db292d23a5baa80", "score": "0.5908921", "text": "function sendMessage(data) {\n socket.emit('message', JSON.stringify(data));\n }", "title": "" }, { "docid": "c1263faa8e6c3e295b352b235f479fcf", "score": "0.5888823", "text": "send(message) {\n this.socket.send(new Buffer(JSON.stringify(message), 'utf8'));\n }", "title": "" }, { "docid": "37042b58185d5cbb8ffed4824abd87ea", "score": "0.5888648", "text": "function send(message) {\n socket.emit(\"send-chat\", message);\n return \"sent message ✅\";\n}", "title": "" }, { "docid": "150c10b8806e9a7a07d5d98e52fc5818", "score": "0.5886844", "text": "function sendMessage(data) {\n\ttry {\n\n\t\tif (SASocket == null) {\n\n\t\t\tconnect();\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tSASocket.sendData(CHANNEL_ID, data);\n\n\t} catch (err) {\n\n\t\tconsole.log(\"exception [\" + err.name + \"] msg[\" + err.message + \"]\");\n\n\t}\n}", "title": "" }, { "docid": "770f0095643d093e391d0f6801c0b9c9", "score": "0.58849823", "text": "function SendMessage(peerId, message) {\n console.log('Client sending message: ', message);\n socket.emit('message', { ID: peerId, message });\n}", "title": "" }, { "docid": "e57a52ddcfd5ec4b41c2bb06c6e4535f", "score": "0.588254", "text": "function sendMessage() {\n ws4redis.send_message('A message');\n }", "title": "" }, { "docid": "e57a52ddcfd5ec4b41c2bb06c6e4535f", "score": "0.588254", "text": "function sendMessage() {\n ws4redis.send_message('A message');\n }", "title": "" }, { "docid": "0f17851b9aa12a9c735d4ffa33b4a70e", "score": "0.58753216", "text": "function sendMessage(message) {\n socket.emit('sendMessage', message);\n}", "title": "" }, { "docid": "fede61935806c34d3c7a5b66f30de195", "score": "0.58614707", "text": "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "title": "" }, { "docid": "dcd7c03724dab5fbd40fbb2243dff29d", "score": "0.5847525", "text": "[_clientHello]() {\n debug('send Client Hello');\n\n const clientHello = {\n clientVersion: this.session.version,\n random: this.session.clientRandom,\n sessionId: EMPTY_BUFFER, // We do not support resuming session. So, send empty id.\n cookie: this.session.cookie || EMPTY_BUFFER,\n cipherSuites: this.session.cipherSuites,\n compressionMethods: defaultCompressionMethods,\n };\n\n const output = createEncode();\n encode(clientHello, output, ClientHello);\n\n const extensions = [];\n\n // Send Extended Master Secret Extension if need.\n if (this.session.extendedMasterSecret) {\n extensions.push({\n type: extensionTypes.EXTENDED_MASTER_SECRET,\n data: EMPTY_BUFFER,\n });\n }\n\n extensions.push({\n type: extensionTypes.ELLIPTIC_CURVES,\n data: namedCurvesExtension,\n });\n\n if (this.session.alpnProtocols.length > 0) {\n const alpnOutput = encode(\n this.session.alpnProtocols,\n ALPNProtocolNameList\n );\n\n extensions.push({\n type: extensionTypes.APPLICATION_LAYER_PROTOCOL_NEGOTIATION,\n data: alpnOutput,\n });\n }\n\n extensions.push({\n type: extensionTypes.EC_POINT_FORMATS,\n data: ecPointFormatExtension,\n });\n\n if (extensions.length > 0) {\n encode(extensions, output, ExtensionList);\n }\n\n this.sendHandshake(output.slice(), handshakeType.CLIENT_HELLO);\n }", "title": "" }, { "docid": "4669784b6fb38e4507b9815fb4560dce", "score": "0.58353364", "text": "send(data) {\n this.socket.send(data);\n }", "title": "" }, { "docid": "1f24bc221cb5595b3591e0f0a9d7c919", "score": "0.58222073", "text": "function send_to_server(message_object) {\n if (ws.readyState === ws.OPEN) {ws.send(JSON.stringify(message_object))}\n}", "title": "" }, { "docid": "6a540684070469a94b91506f04451936", "score": "0.58199394", "text": "function send() {\n if (!disconnected) {\n try {\n socket.send(queue.join('\\n'));\n queue = [];\n } catch (e) {\n failure(\"WebSocket send failure\", \"send\", e);\n disconnect = true;\n }\n }\n }", "title": "" }, { "docid": "d556acb14d68254da0bb06382aa8bef3", "score": "0.581378", "text": "function send(text) {\r\n Server.send('message', text); \r\n}", "title": "" }, { "docid": "24af3ad0b20db98095b9a732476060b1", "score": "0.5813017", "text": "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n}", "title": "" }, { "docid": "417015d29b152842de41f46c78db0815", "score": "0.5803517", "text": "send(data){\r\n const message = JSON.stringify(data);\r\n console.log(`Sending message ${message}`);\r\n this.connection.send(message);\r\n }", "title": "" }, { "docid": "24ff903306d9c851edcc2704dbe85a74", "score": "0.5797875", "text": "function Send(data) {\n\tif (socketStatus == SOCKET_STATUS_ONLINE) {\n\t\tsocket.sendText(data);\n\t}\n}", "title": "" }, { "docid": "7396eae35bc2b39d0bfd5c465c2f81c6", "score": "0.5796959", "text": "function sendToServer(msg) {\n msg = JSON.stringify({msg});\n msg = JSON.parse(msg)['msg'];\n if (window.user === 'r') {\n msg.client = 's';\n } else {\n msg.client = 'r';\n }\n console.log('sending...!', msg);\n msg = JSON.stringify({msg});\n chatSocket.send(msg);\n}", "title": "" }, { "docid": "51e08e3ed0122940a25ea3b30bae4e2a", "score": "0.57918763", "text": "function sendMsg () {\n if (!ws) {\n console.log('No WebSocket connection');\n return;\n }\n let msg = {\n body: document.forms.msg.message.value,\n roomId,\n targetId,\n type: 'newMsg'\n }\n msg = JSON.stringify(msg);\n console.log(msg);\n ws.send(msg);\n console.log('msg has been sanded');\n document.forms.msg.message.value = '';\n }", "title": "" }, { "docid": "2dd4229a3c410b05e03f68791e6b9489", "score": "0.57898784", "text": "sendCommand(msg){\r\n return this.tcpClient.write(this.config.deviceID + \" \" + msg + \"\\r\\n\");\r\n }", "title": "" }, { "docid": "ee2b58ccb990b31ee3cbef25b01b477d", "score": "0.57856107", "text": "function sendMessage(messageType, client, data) {\n\t\t//console.log(\"SEND WERE CALLED\");\n\t\tclient.emit('serverResponse', messageType, data);\n\t}", "title": "" }, { "docid": "4bb216691d887de75ec29f4caac801b8", "score": "0.57737064", "text": "function send(message, info) {\n ws.send(message);\n }", "title": "" }, { "docid": "036732d015a5e9a59ca17bf7f87d4713", "score": "0.5768374", "text": "function send(text) {\n var data = {\n type: \"message\",\n data: text,\n username: sessionStorage.username,\n channel: config.channel,\n key: config.key\n };\n socket.send(JSON.stringify(data));\n }", "title": "" }, { "docid": "d29900930ed511974884ffe6dc996e94", "score": "0.5764783", "text": "function broadcast(msg){\n wss.clients.forEach(function each(client) {\n if (client.readyState === WebSocket.OPEN) {\n client.send(msg);\n }\n });\n }", "title": "" }, { "docid": "4708bc1845346d54ee5879d8e10877e9", "score": "0.5758816", "text": "function _send () {\n if (userInput.value != \"\") {\n websocket.send(\n JSON.stringify({\n username: settings.username,\n message: userInput.value\n }\n ));\n\n userInput.value = \"\";\n }\n }", "title": "" }, { "docid": "7693be1a1db7e083ba6c2d28b5a44f8e", "score": "0.5758562", "text": "function send(conn, data) {\n sleep(1).then(() => {\n conn.send(JSON.stringify(data));\n });\n}", "title": "" }, { "docid": "8f44ec7942e0b7caf866e3d90d30c155", "score": "0.57576174", "text": "function send(ws, msg) {\n if (ws.readyState !== WebSocket.OPEN) {\n return;\n }\n\n // Incase the `msg` is already a string\n if (typeof msg === 'string') {\n ws.send(msg);\n } else {\n ws.send(JSON.stringify(msg));\n console.log('[WS]: Sending', msg);\n }\n}", "title": "" }, { "docid": "c4fdf7224aceb8957ed1e73cc2b4ce48", "score": "0.5738961", "text": "function broadcast(data) {\n\t\tif (!wss) {\n return;\n }\n\t\twss.clients.forEach(function each(client) {\n if (client.readyState === WebSocket.OPEN) {\n client.send(data);\n }\n });\n\t}", "title": "" }, { "docid": "d7a4040fc7a24d23310819fd78b4c171", "score": "0.5738115", "text": "sendMessageToClient(clientId, data) {\n\n if (typeof data !== 'string') {\n data = JSON.stringify(data);\n }\n const client = this.getClient(clientId);\n\n\n if (client) {\n client.ws.send(data);\n }\n }", "title": "" }, { "docid": "6e7ab159c88818eb893cbe9f3395e2a5", "score": "0.57372326", "text": "sendMessage(message, data) {\n\t\tconsole.log('Sending message: ' + message);\n\t\tsocket.emit(message, data);\n\t}", "title": "" }, { "docid": "6ec0bbe8776e78247ce93b66ceb277b0", "score": "0.5726652", "text": "function broadcast(wss, message) {\n wss.clients.forEach((client) => {\n if (client.readyState === WebSocket.OPEN) {\n client.send(JSON.stringify(message));\n }\n });\n}", "title": "" }, { "docid": "3217acd2b795a8b43cb151da470675f5", "score": "0.5718447", "text": "function send(msg) {\r\n if (process.send) process.send(msg);\r\n}", "title": "" }, { "docid": "8f27235de5148730e0b2a9222eaafbcf", "score": "0.5716458", "text": "function sendcmd(command) {\n if (wsStatus == true) {\n ws.send(command)\n return \"Sent.\"\n \n }\n else {\n Materialize.toast(\"We can't tell JMRI whatever you just did, because your WebSockets connection is not up and running yet.\", 4000)\n console.error(\"Tried to send something, but we're not connected yet.\")\n return \"Can't send!\"\n \n }\n}", "title": "" }, { "docid": "01cca5a624c53e97717121ab72af6031", "score": "0.57146704", "text": "function broadcast(message) {\n wss.getWss().clients.forEach((client) => {\n if (client.readyState === 1) {\n client.send(JSON.stringify(message))\n }\n });\n}", "title": "" }, { "docid": "f2ed5df0c8d326a97d1ddd38b70127be", "score": "0.57137555", "text": "function wsSend(msg) {\n\t var stringMsg = JSON.stringify((0, _serialization.serialize)(msg));\n\t\n\t ws.send(stringMsg);\n\t }", "title": "" }, { "docid": "ecd87c01cc39602984889a833f44b607", "score": "0.5711481", "text": "function sendMessageToServer(message, cb) {\r\n\t//console.log(\"Sending Message:\");\r\n\t//console.log(message);\r\n\tif (isRoomConnected) {\r\n\t\tnetSocket.write(message, \"UTF8\", cb);\r\n\t} else {\r\n\t\tcb();\r\n\t}\r\n}", "title": "" }, { "docid": "556e12e7e520e74d9bceae8225e4792f", "score": "0.5710849", "text": "function transmitMessage(peer, message)\n {\n\n if(!peer.established) return true; \n\n let peername = peer.username;\n \n if (peer.datachannel.readyState === \"open\")\n {\n try\n {\n peer.datachannel.send(message); \n }\n catch(err)\n {\n debug_log(\"Error sending msg to peer \" + peername + \" \" + err);\n peer.datachannel.close();\n return false;\n\n }\n }\n else if(peer.datachannel.readyState === \"closing\" \n || peer.datachannel.readyState === \"closed\")\n {\n debug_log(\"Error sending msg to peer \" + peername);\n return false;\n }\n\n return true;\n \n }", "title": "" }, { "docid": "c64bbf0b843f081e7dca9938c48ccf07", "score": "0.57035035", "text": "function SendMyMsg() {\r\n if (msg.value.length != 0) {\r\n console.log(msg.value);\r\n socket.emit(\"send_msg\", msg.value)\r\n msg.value = '';\r\n }\r\n}", "title": "" }, { "docid": "ff58ec4e94b0c63a91a7d3f3b58defb4", "score": "0.5703161", "text": "function sendSignalMessage(obj)\n {\n /* websocket is not open */\n if(socket.readyState !== 1 )\n {\n displayChatMessage(\"\", \"Websocket error cannot send to Signal Server\");\n debug_log(\"Websocket error \");\n return;\n }\n\n try\n {\n socket.send(JSON.stringify(obj));\n }\n catch(err)\n {\n displayChatMessage(\"\", \"Websocket error cannot send to Signal Server\");\n debug_log(\"Websocket error \" + err);\n }\n\n }", "title": "" }, { "docid": "531c85cad1af642aecb0b0d9511fec7a", "score": "0.57008785", "text": "function sendMessage(message) {\n socket.emit('signaling', message, partnerID);\n}", "title": "" }, { "docid": "1d1f1803e3213003dd39db0c77017cb7", "score": "0.56942767", "text": "function sendMsg(msg) {\n ws.send( JSON.stringify( { msg: msg } ) );\n}", "title": "" }, { "docid": "14b4ce532771b55e84e72badaefb07e3", "score": "0.5694077", "text": "function sendIfOpen(client, serialized) {\n if (client.readyState === ws.OPEN) {\n client.send(serialized);\n }\n}", "title": "" }, { "docid": "9dfae07cd396e01821bf9b3d19c147ff", "score": "0.56871665", "text": "function send(){\n\t var text = document.getElementById(\"messageinput\").value;\n\t webSocket.send(text);\n\t alert(\"Message is sent...\");\n\t }", "title": "" }, { "docid": "150b394a6702bd422e6162c007b15c49", "score": "0.56843054", "text": "function onSocketConnect() {\n\tthis.connector.send(HANDSHAKE);\n\tthis.log.info('Connected');\n\tthis.emit('connect');\n}", "title": "" }, { "docid": "150b394a6702bd422e6162c007b15c49", "score": "0.56843054", "text": "function onSocketConnect() {\n\tthis.connector.send(HANDSHAKE);\n\tthis.log.info('Connected');\n\tthis.emit('connect');\n}", "title": "" }, { "docid": "9c4f57180a8ac00182dd797acc6c7dff", "score": "0.56822085", "text": "onConnect() {\n this.state = constants_1.SocksClientState.Connected;\n // Send initial handshake.\n if (this._options.proxy.type === 4) {\n this.sendSocks4InitialHandshake();\n }\n else {\n this.sendSocks5InitialHandshake();\n }\n this.state = constants_1.SocksClientState.SentInitialHandshake;\n }", "title": "" }, { "docid": "c3a9bb7d704a507e7a2d6297c7390dde", "score": "0.56536806", "text": "sendSocketMessage(message) {\n clients.forEach((client) => {\n if (client.readyState === WebSocket.OPEN) {\n client.send(message || 'refresh', (err) => {\n if (err) {\n npmlog.error(err);\n }\n });\n }\n });\n }", "title": "" } ]
7412fe5d41060eee5add29e8f5ff39a8
if there's something in the buffer waiting, then process it
[ { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.0", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" } ]
[ { "docid": "cd6b6d4d8ceaa30d66404c596958a3de", "score": "0.6765402", "text": "function processNext() {\n if (!ready || waitingForData || queue.length == 0) return;\n\n const entry = queue[0];\n\n if (entry.waitForInput) {\n waitingForData = true;\n port.write(entry.command);\n } else {\n port.write(entry.command);\n queue.shift(); // Remove processed entry\n entry.resolve();\n processNext();\n }\n}", "title": "" }, { "docid": "66ef8e7170cee0703f722b2b2cf1d0a8", "score": "0.5969891", "text": "function nextBuffer(num) {\n bufNum++;\n if (THIS.clear) {\n //console.info(\"buffer has stopped at item \" + bufNum);\n //console.info(bufOrderFinal);\n bufObjArr.splice(THIS.path, 1);\n } else {\n window.setTimeout(function () {\n var split = bufOrderFinal[num];\n if (split) {\n //book[split[2]-1].progressgraph.update(5,10);\n bufferElement(split[0], split[1], split[2] - 1);\n } else {\n // NOTE fully buffered\n THIS.running = false;\n }\n }, testWait);\n }\n }", "title": "" }, { "docid": "100391de1eb39995629af4ae43ff180b", "score": "0.5951508", "text": "buffering(){\n\n }", "title": "" }, { "docid": "aa4d313000fea654771e88eb35e21eed", "score": "0.59414977", "text": "_processQueue() {\n if (requestIdleCallback == null) return this._runNextFunction();\n\n this.processing = true;\n requestIdleCallback(deadline => {\n while((deadline.timeRemaining() > 0 || deadline.didTimeout) && this._list.length) {\n this._runNextFunction();\n }\n this.processing = false;\n }, {timeout: 1000})\n }", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.59402966", "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.59402966", "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.59402966", "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.59402966", "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": "28ce674bf716b66715ea316daaade2bf", "score": "0.585917", "text": "function process() {\n var event,\n message = '';\n\n while (event = queue.shift()) {\n message += event.data;\n }\n console.log(message);\n }", "title": "" }, { "docid": "14f74908e53cf6fcb3ffcc6c9e2dec09", "score": "0.5841523", "text": "function bufferLoadCompleted() {\n // console.log(\"bufferLoadCompleted\");\n}", "title": "" }, { "docid": "39fd99c02787980558ddc689156f446c", "score": "0.58267325", "text": "function WaitForHit()\n\t{\n\t\tvar time : float = 0.0f;\n\t\t\n\t\twhile(!whacked && time < timeLimit)\n\t\t{\n\t\t\ttime += Time.deltaTime;\n\t\t\tyield;\n\t\t}\n\t}", "title": "" }, { "docid": "2ba88c3bc27e4ad7acc7c939a76d04c8", "score": "0.5826696", "text": "function checkForCompletion() {\n if (queuedObjects.length === 0) {\n returnCallback(derezObj);\n } \n }", "title": "" }, { "docid": "bc250d2382d9c89b8d4b287865bc3f2a", "score": "0.5825306", "text": "function drain () {\n\t if (!cb) return\n\t\n\t if (abort) callback(abort)\n\t else if (!buffer.length && ended) callback(ended)\n\t else if (buffer.length) callback(null, buffer.shift())\n\t }", "title": "" }, { "docid": "cd598fcfbd9d83964e64a5edbcab1039", "score": "0.5824985", "text": "function rQwait(msg, num, goback) {\n var rQlen = rQ.length - rQi; // Skip rQlen() function call\n if (rQlen < num) {\n if (goback) {\n if (rQi < goback) {\n throw(\"rQwait cannot backup \" + goback + \" bytes\");\n }\n rQi -= goback;\n }\n //Util.Debug(\" waiting for \" + (num-rQlen) +\n // \" \" + msg + \" byte(s)\");\n return true; // true means need more data\n }\n return false;\n }", "title": "" }, { "docid": "63986054486d8a7e8cec6413cf206d50", "score": "0.5818511", "text": "function drain() {\n if (!cb) return;\n if (abort) callback(abort);else if (!buffer.length && ended) callback(ended);else if (buffer.length) callback(null, buffer.shift());\n } // `callback` calls back to waiting sink,", "title": "" }, { "docid": "e6f2bd91e8db7da4e23face830a3ec66", "score": "0.58134717", "text": "async processCommands() {\n while(this.newData && !this.processing && this.commands.length > 0) {\n this.processing = true;\n this.newData = false;\n\n // Empty the current buffer\n const currentBuffer = this.buffer;\n this.buffer = new Uint8Array();\n const command = this.commands[0];\n\n /**\n * If a timeout is not yet active, set it.\n */\n const timeout = command.timeout;\n if(!this.timeout) {\n this.timeout = setTimeout(() => {\n /*\n * If we are not currently processing, we can Immediately handle the\n * timeout. Ohterwise we mark the command to be quit and it will\n * timout after processing is done, in case not enough data was\n * available.\n */\n if(!this.processing) {\n return this.resolveTimout();\n }\n\n this.quit = true;\n }, timeout);\n }\n\n /**\n * Get the first command int he pipe and start processing it - this can\n * have three outcomes:\n * resolve: The resolve Callback is called and we are done.\n * reject: - NotEnoughDataError: We neiter resolve nor reject, just\n * wait for more data to come in - the command is kept in\n * the pipe for the next invokation.\n * - Any other error: we reject passing on the error from the\n * command.\n */\n const promise = new Promise((resolve, reject) => {\n command.command(currentBuffer, resolve, reject);\n });\n\n try {\n const result = await promise;\n\n /**\n * At this point we are done - the command can be removed from the\n * command can be remove from the queue and the promise can be\n * resolved.\n */\n clearTimeout(this.timeout);\n this.timeout = null;\n this.commands.shift();\n this.quit = false;\n this.processing = false;\n\n return command.resolveCallback(result);\n } catch(e) {\n if(e instanceof NotEnoughDataError) {\n /**\n * We don't have enough data yet, we put it back on the buffer and\n * do nothing.\n */\n this.buffer = this.appendBuffer(currentBuffer, this.buffer);\n this.processing = false;\n\n // Timeout was triggered while we aere processing, in this case we\n // quit now.\n if(this.quit) {\n this.resolveTimout();\n }\n return;\n } else {\n /**\n * The command failed on its own terms - not for lack of data.\n * Remove it from the queue.\n */\n clearTimeout(this.timeout);\n this.timeout = null;\n this.commands.shift();\n this.quit = false;\n this.processing = false;\n\n return command.rejectCallback(e);\n }\n }\n\n this.processing = false;\n }\n }", "title": "" }, { "docid": "febdf8bdbb5aeea9570f7cdcb878265f", "score": "0.5790436", "text": "function rQwait(msg, num, goback) {\n\t\t\tvar rQlen = rQ.length - rQi; // Skip rQlen() function call\n\t\t\tif (rQlen < num) {\n\t\t\t\tif (goback) {\n\t\t\t\t\tif (rQi < goback) {\n\t\t\t\t\t\tthrow('rQwait cannot backup ' + goback + ' bytes');\n\t\t\t\t\t}\n\t\t\t\t\trQi -= goback;\n\t\t\t\t}\n\t\t\t\t//Util.Debug(' waiting for ' + (num-rQlen) +\n\t\t\t\t// ' ' + msg + ' byte(s)');\n\t\t\t\treturn true; // true means need more data\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "8daed3d61a3242da7acea9418ada72b1", "score": "0.57826066", "text": "function rQwait(msg, num, goback) {\n var rQlen = rQ.length - rQi; // Skip rQlen() function call\n if (rQlen < num) {\n if (goback) {\n if (rQi < goback) {\n throw(\"rQwait cannot backup \" + goback + \" bytes\");\n }\n rQi -= goback;\n }\n //Util.Debug(\" waiting for \" + (num-rQlen) +\n // \" \" + msg + \" byte(s)\");\n return true; // true means need more data\n }\n return false;\n}", "title": "" }, { "docid": "d0c9d798e397c0f0d537004d07a59bdb", "score": "0.57802486", "text": "function checkForCompletion() {\n\t if (queuedObjects.length === 0) {\n\t returnCallback(derezObj);\n\t } \n\t }", "title": "" }, { "docid": "21c793b45bc0095ab4cee7b512a80a91", "score": "0.5713156", "text": "fillBuffer_() {\n // see if we need to begin loading immediately\n const segmentInfo = this.chooseNextRequest_();\n if (!segmentInfo) {\n return;\n }\n if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {\n // We don't have the timestamp offset that we need to sync subtitles.\n // Rerun on a timestamp offset or user interaction.\n const checkTimestampOffset = () => {\n this.state = 'READY';\n if (!this.paused()) {\n // if not paused, queue a buffer check as soon as possible\n this.monitorBuffer_();\n }\n };\n this.syncController_.one('timestampoffset', checkTimestampOffset);\n this.state = 'WAITING_ON_TIMELINE';\n return;\n }\n this.loadSegment_(segmentInfo);\n }", "title": "" }, { "docid": "59f8df35435ce45873f3950416d2f14a", "score": "0.5620762", "text": "async triggerOutgoingHandler(buffer) {\n const bufferLength = buffer.size;\n this.executingOutgoingHandlers++;\n this.offset += bufferLength;\n try {\n await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength);\n }\n catch (err) {\n this.emitter.emit(\"error\", err);\n return;\n }\n this.executingOutgoingHandlers--;\n this.reuseBuffer(buffer);\n this.emitter.emit(\"checkEnd\");\n }", "title": "" }, { "docid": "58370320d0200db10a06d1b56497aa1d", "score": "0.5618988", "text": "function process_queue(timestamp) {\n if (!webworker_busy) {\n var message = webworker_queue.pop();\n if (message != null) {\n webworker_busy = true;\n webworker.postMessage(message);\n }\n }\n window.requestAnimationFrame(process_queue);\n }", "title": "" }, { "docid": "eca51b7c2d23883d423adf2682402dfd", "score": "0.5578097", "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": "d927db7a54d1924f5aff9b378f704c9d", "score": "0.55710125", "text": "function process_outbox() {\n // don't make new requests if we're waiting for old ones\n if (!waiting_for_response) {\n // don't send a request if there are no messages\n if (outbox_queue.length > 0) {\n // don't send any more requests while we're waiting for this one\n waiting_for_response = true;\n\n // send the messages\n for (var i in outbox_queue) {\n ajax(outbox_queue[i], callback)\n }\n }\n\n // we sent all the messages at once so clear the outbox\n outbox_queue = [];\n }\n}", "title": "" }, { "docid": "b7568a212e2a4c7783ae5ecc9fbf1625", "score": "0.5565567", "text": "function eventBuffer() {\n\t clearTimer();\n\t setInput(event);\n\n\t buffer = true;\n\t timer = window.setTimeout(function () {\n\t buffer = false;\n\t }, 650);\n\t }", "title": "" }, { "docid": "5ec26ab09f25e52dbe26deea6016119f", "score": "0.55560935", "text": "async run() { \n\t//loop read from the input channel \n\twhile(true ) {\n\t this.feedback(\"continue\")\n\t let text = await this.get_input() \n\t if (text == undefined || text == \"finished\") { break }\n\t this.append(text) \n\t}\n\t//input channel has been closed \n\tthis.finish({result : \"OK\"}) \n }", "title": "" }, { "docid": "2699c21558c42be3c0450b39fd24a043", "score": "0.5555705", "text": "_continueProcessing() {\n if (this._closed) {\n this.close();\n } else {\n setTimeout(() => this._processMessages(), 100);\n }\n }", "title": "" }, { "docid": "fc9005d098d2655b54e5c4e73994712b", "score": "0.5545455", "text": "_bufferLoaded(callback) {\n this._loadingCount--;\n if (this._loadingCount === 0 && callback) {\n callback();\n }\n }", "title": "" }, { "docid": "943d25ea919ebee471fa2d8d425a1d52", "score": "0.5543172", "text": "monitorBuffer_() {\n if (this.checkBufferTimeout_) {\n window.clearTimeout(this.checkBufferTimeout_);\n }\n\n this.checkBufferTimeout_ = window.setTimeout(this.monitorBufferTick_.bind(this), 1);\n }", "title": "" }, { "docid": "e765e16596afecd03387e03a2a816da1", "score": "0.55383396", "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": "e765e16596afecd03387e03a2a816da1", "score": "0.55383396", "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": "e765e16596afecd03387e03a2a816da1", "score": "0.55383396", "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": "04bb89feaa9dd42eca8dac4be7c226c7", "score": "0.5535207", "text": "function eventBuffer() {\n clearTimer();\n setInput(event);\n\n buffer = true;\n timer = window.setTimeout(function () {\n buffer = false;\n }, 650);\n }", "title": "" }, { "docid": "85a6e85b1fd89f9d8be43f8b09229ca5", "score": "0.5514994", "text": "function f(e){8<e.bi_valid?l(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}", "title": "" }, { "docid": "e6e0af0e1fdfeee2acbe8f5da3d96c29", "score": "0.5512444", "text": "function processQueue(){\n try {\n // mark queue as processing to avoid concurrency\n processing = true;\n\n // process queue\n var item;\n while (item = queue.shift())\n item.fn.call(item.context);\n } finally {\n // queue is not processing anymore\n processing = false;\n\n // if any function in queue than exception was occured,\n // run rest functions in next code frame\n if (queue.length)\n timer = setImmediate(process);\n }\n }", "title": "" }, { "docid": "33136b1405b9d581dd3bbe6b60cd5b09", "score": "0.5505043", "text": "waiting_() {\n if (this.techWaiting_()) {\n return;\n } // All tech waiting checks failed. Use last resort correction\n\n const currentTime = this.tech_.currentTime();\n const buffered = this.tech_.buffered();\n const currentRange = findRange(buffered, currentTime); // Sometimes the player can stall for unknown reasons within a contiguous buffered\n // region with no indication that anything is amiss (seen in Firefox). Seeking to\n // currentTime is usually enough to kickstart the player. This checks that the player\n // is currently within a buffered region before attempting a corrective seek.\n // Chrome does not appear to continue `timeupdate` events after a `waiting` event\n // until there is ~ 3 seconds of forward buffer available. PlaybackWatcher should also\n // make sure there is ~3 seconds of forward buffer before taking any corrective action\n // to avoid triggering an `unknownwaiting` event when the network is slow.\n\n if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {\n this.resetTimeUpdate_();\n this.tech_.setCurrentTime(currentTime);\n this.logger_(`Stopped at ${currentTime} while inside a buffered region ` + `[${currentRange.start(0)} -> ${currentRange.end(0)}]. Attempting to resume ` + 'playback by seeking to the current time.'); // unknown waiting corrections may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-unknown-waiting'\n });\n return;\n }\n }", "title": "" }, { "docid": "67584d82b7b04daea82929cb84dfd758", "score": "0.5498635", "text": "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) { }\n }", "title": "" }, { "docid": "67584d82b7b04daea82929cb84dfd758", "score": "0.5498635", "text": "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) { }\n }", "title": "" }, { "docid": "5d40a272302e5d152e391063ab473b30", "score": "0.5491878", "text": "monitorBufferTick_() {\n if (this.state === 'READY') {\n this.fillBuffer_();\n }\n\n if (this.checkBufferTimeout_) {\n window.clearTimeout(this.checkBufferTimeout_);\n }\n\n this.checkBufferTimeout_ = window.setTimeout(this.monitorBufferTick_.bind(this),\n CHECK_BUFFER_DELAY);\n }", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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.54828423", "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": "0c15a11a434f804e6bb6ae87478028a9", "score": "0.5476027", "text": "function flushQueue () {\n var remainingQueue = context.queue.slice(),\n currentFn = context.queue.shift(),\n lastLine = stdout[stdout.length - 1];\n\n if (!lastLine) {\n onError(createUnexpectedEndError(\n 'No data from child with non-empty queue.', remainingQueue));\n return false;\n }\n else if (context.queue.length > 0) {\n onError(createUnexpectedEndError(\n 'Non-empty queue on spawn exit.', remainingQueue));\n return false;\n }\n else if (!validateFnType(currentFn)) {\n // onError was called\n return false;\n }\n else if (currentFn.name === '_sendline') {\n onError(new Error('Cannot call sendline after the process has exited'));\n return false;\n }\n else if (currentFn.name === '_wait' || currentFn.name === '_expect') {\n if (currentFn(lastLine) !== true) {\n onError(createExpectationError(currentFn.expectation, lastLine));\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "bec17bfd739e3b18c7000877e2bab9d6", "score": "0.5470992", "text": "function getNextResponse(){\n if (_waitingForInput !== null){\n throw new Error('concurreny error - receive listener already in-queue');\n }\n\n return new Promise(function(resolve){\n // data received ?\n if (_inputbuffer.length > 0){\n resolve(_inputbuffer.shift());\n }else{\n // add as waiting instance (no concurrent!)\n _waitingForInput = resolve;\n }\n });\n}", "title": "" }, { "docid": "e5376e1c4c031ba5d6ca0d5e5dd29944", "score": "0.5457874", "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.5457874", "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.5457874", "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.5451891", "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.5451891", "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": "8743bda62ceabf6bbab3a42465bfd8d3", "score": "0.54470336", "text": "bufGotLonger() {\n if(this._buf.length < 16 ) {\n return;\n }\n // console.log('bufGotLonger2 ' + _buf);\n\n // trim zeros first cuz why not\n for(let i = 0; i < this._buf.length; i++) {\n let word = this._buf[i];\n if( word != 0 ) {\n // if this isn't the first loop\n if( i != 0 ) {\n // trim buf\n this._buf = this._buf.slice(i);\n\n if( this._jamming !== -1 )\n {\n if( this.printPackets ) {\n console.log('jamming for ' + this._jamming);\n this._jamming = -1;\n }\n }\n\n }\n break; // break if we trimmed or not\n } else {\n if( this._jamming === -1 ) {\n this._jamming = 1;\n } else {\n this._jamming++;\n }\n }\n } // for\n\n // console.log('bufGotLonger2a ' + this._buf);\n\n for(let i = 0; i < this._buf.length; i++) {\n\n let word = this._buf[i];\n\n // console.log('bufGotLonger3 i:' + i + ' ' + word);\n\n if( word != 0 ) {\n let [adv_error, advance, is_mapmov] = this.feedback_word_length(this._buf);\n\n if( advance > this._buf.length ) {\n return;\n } else {\n\n if( this.printPackets ) {\n if( adv_error && advance !== 1 ) {\n console.log('advance: ' + advance + ' error: ' + adv_error + ' mapmov: ' + is_mapmov);\n }\n }\n\n\n if( !adv_error ) {\n // we got a match, emit the event\n let t0 = g_type(this._buf);\n let t1 = g_vtype(this._buf);\n\n // fixme this could be done without entirePacket temporary value\n let entirePacket = this._buf.slice(i, advance);\n let header = entirePacket.slice(0,16);\n let buf = entirePacket.slice(16);\n const tag = strForType(t0,t1);\n this._notify.emit(tag, header, buf);\n\n if( this.printUnhandled ) {\n let listners = this._notify.listenerCount(tag);\n if( listners === 0 ) {\n console.log(\"UNHANDLED feedbackbus to \" + tag);\n }\n }\n \n // console.log(\"t0: \" + t0 + \" t1: \" + t1);\n // console.log('bufGotLonger4a ' + this._buf);\n\n this._buf = this._buf.slice(i + advance);\n\n // console.log('bufGotLonger4b ' + this._buf);\n\n if( this._buf.length >= 16 ) {\n // console.log('will recurse for remaining ' + this._buf.length);\n this._notify.emit('newp'); // recurse back in\n }\n\n break;\n }\n }\n }\n\n } // for\n }", "title": "" }, { "docid": "bd31465a5df341527500456dff7a35fb", "score": "0.54454964", "text": "resolveData() {\n while (this.unresolvedLength >= this.bufferSize) {\n let buffer;\n if (this.incoming.length > 0) {\n buffer = this.incoming.shift();\n this.shiftBufferFromUnresolvedDataArray(buffer);\n }\n else {\n if (this.numBuffers < this.maxBuffers) {\n buffer = this.shiftBufferFromUnresolvedDataArray();\n this.numBuffers++;\n }\n else {\n // No available buffer, wait for buffer returned\n return false;\n }\n }\n this.outgoing.push(buffer);\n this.triggerOutgoingHandlers();\n }\n return true;\n }", "title": "" }, { "docid": "6d4dda8a98b86469d73bee0290cfc54c", "score": "0.5435837", "text": "monitorBufferTick_() {\n if (this.state === 'READY') {\n this.fillBuffer_();\n }\n if (this.checkBufferTimeout_) {\n window__default[\"default\"].clearTimeout(this.checkBufferTimeout_);\n }\n this.checkBufferTimeout_ = window__default[\"default\"].setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);\n }", "title": "" }, { "docid": "c66bf2e7f4e36d37a7f5d63b3d7ac712", "score": "0.5435565", "text": "finishProcessing() {\n this.busy = false;\n this.successful = true;\n }", "title": "" }, { "docid": "27ce074b6eded53d36f9c5878aa5a9fd", "score": "0.5415329", "text": "function processData(buffer){\n try {\n //Parse the buffer into pduList.\n var bufferDecoded = pduDecoder.parseBuffer(buffer, pduSplitPacket);\n\n //Assign the part of the pdu that is incomplete to be attached to the next pdu received in this socket.\n pduSplitPacket = bufferDecoded.pduSplitPacket;\n\n //Execute the corresponding process for each pdu\n bufferDecoded.decodedPDUList.forEach(function(decodedPdu){\n //If the pdu is a submit_sm response, attach the sent message before callback\n //To send all the SM to the connection.\n if(decodedPdu.command_id === commands.submit_sm_resp.id || decodedPdu.command_id === commands.submit_multi_resp.id || decodedPdu.command_id === commands.data_sm_resp.id){\n if(pendingResponseSMList[decodedPdu.sequence_number]){\n //In pendingResponseSMList the object is referenced by sequence_number, attach to it the part of the message received in response.\n pendingResponseSMList[decodedPdu.sequence_number].message_id = decodedPdu.message_id;\n pendingResponseSMList[decodedPdu.sequence_number].status = decodedPdu.status;\n pendingResponseSMList[decodedPdu.sequence_number].no_unsuccess = decodedPdu.no_unsuccess;\n pendingResponseSMList[decodedPdu.sequence_number].unsuccess_smes = decodedPdu.unsuccess_smes;\n //If command callback is defined execute sending the shortMessage or dataMessage as parameter\n if (commandsCallbacks[decodedPdu.command_id]) {\n commandsCallbacks[decodedPdu.command_id](pendingResponseSMList[decodedPdu.sequence_number]); //ShortMessage or DataMessage completed\n }\n //remove from the list to avoid unnecessary increasing\n delete pendingResponseSMList[decodedPdu.sequence_number];\n }\n }\n else {\n //If command received is a deliver_sm, respond with a deliver_sm_resp\n switch(decodedPdu.command_id){\n case commands.deliver_sm.id:\n var seq_num = decodedPdu.sequence_number;\n var pdu = pduGenerator.deliver_sm_resp(seq_num);\n sendPdu(pdu);\n break;\n case commands.unbind.id:\n var seq_num = decodedPdu.sequence_number;\n var pdu = pduGenerator.unbind_resp(seq_num);\n sendPdu(pdu);\n break;\n }\n //If command callback is defined execute\n if (commandsCallbacks[decodedPdu.command_id])\n commandsCallbacks[decodedPdu.command_id](decodedPdu);\n }\n });\n\n //Send a generic_nack pdu to the SMSC for each error in PDUs.\n bufferDecoded.errorList.forEach(function(err){\n //If any error decoding binding PDU, send a generic_nack to the pdu originator.\n console.log(err);\n //Get the generic_nack pdu and send it to the socket\n generic_nack(err.status, err.sequence_number);\n });\n }\n catch (err){\n //If any error decoding binding PDU, send a generic_nack to the pdu originator.\n console.log(err);\n\n //Try to get the incoming sequence number if exists and can parse it\n var pduSequenceNumber;\n if(buffer && buffer.length > 16 && buffer.slice(12, 16).readUInt32BE(0)){\n pduSequenceNumber = buffer.slice(12, 16).readUInt32BE(0);\n }\n\n //Get the generic_nack pdu and send it to the socket\n generic_nack(err.status, pduSequenceNumber);\n }\n}", "title": "" }, { "docid": "de04d6c3d1b85111ded549de9df7258d", "score": "0.5400334", "text": "function wait(){\n}", "title": "" }, { "docid": "a5134b692fbb47c2eddffdeaa3b77b97", "score": "0.53866726", "text": "function processMessagesQueue() {\n var message = messageQ.next();\n while (message !== null) {\n processMessage(message.data);\n message = messageQ.next();\n }\n }", "title": "" }, { "docid": "95ec7194a01623781377f16408d39da5", "score": "0.53843063", "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": "0f783d4aefc1757017e6d1f97e7c93ba", "score": "0.537736", "text": "monitorBuffer_() {\n if (this.checkBufferTimeout_) {\n window__default[\"default\"].clearTimeout(this.checkBufferTimeout_);\n }\n this.checkBufferTimeout_ = window__default[\"default\"].setTimeout(this.monitorBufferTick_.bind(this), 1);\n }", "title": "" }, { "docid": "10e90a45d73eb72a2304bb32d3a1a85f", "score": "0.53722864", "text": "async _queue_tick() {\n if (this.#state.busy) return null;\n const currentTime = this.#ctx.currentTime;\n this._queue_clearScheduledHead(currentTime);\n this._queue_schedulePendingChunks(currentTime);\n if (this.#state.playing === 1) {\n await this._queue_refillPendingChunks();\n };\n }", "title": "" }, { "docid": "90754b66e29263fac35785145265902b", "score": "0.53707874", "text": "_processQueue() {\n if (this._messageQueue.length === 0) {\n return;\n }\n\n const [text, resolve] = this._messageQueue.shift();\n\n this.bot.chat(text);\n this._messageLastSentTime = Date.now();\n resolve();\n\n if (this._messageQueue.length > 0) {\n setTimeout(()=>{\n this._processQueue();\n }, this.options.chatDelay);\n }\n }", "title": "" }, { "docid": "020b75d7ac25a1b72c140d60700737e2", "score": "0.53599715", "text": "async waitUntilOK(){\n var times = 0;\n\n while (this.DISCONNECT == false) {\n var tempLines = this.COLLECTED_DATA.split('\\r\\n');\n\n for(var i=0; i<tempLines.length; i++){\n if(tempLines[i] == \"OK\" || tempLines[i] == \"\u0004>\"){\n return;\n }\n }\n\n times = times + 1;\n if(times >= 15){\n this.writeToDevice('\u0003');\n console.error(\"Had to use ugly hack for hanging raw prompt...\");\n return;\n }\n await new Promise(resolve => setTimeout(resolve, 5));\n }\n }", "title": "" }, { "docid": "b7f54c60d9803f53af07d9beeef44614", "score": "0.5341016", "text": "dequeue () {\n while (!this.deflating && this.queue.length) {\n const params = this.queue.shift();\n\n this.bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "b7f54c60d9803f53af07d9beeef44614", "score": "0.5341016", "text": "dequeue () {\n while (!this.deflating && this.queue.length) {\n const params = this.queue.shift();\n\n this.bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "8e502d539ee8051924337ead79fb619a", "score": "0.53375804", "text": "function wait(){\r\n\t\tBerekenen();\r\n\t}", "title": "" }, { "docid": "8e502d539ee8051924337ead79fb619a", "score": "0.53375804", "text": "function wait(){\r\n\t\tBerekenen();\r\n\t}", "title": "" }, { "docid": "c40f684712a61f869d6bef55f337e5f6", "score": "0.5313394", "text": "function drainQueue() {\n // return if no live socket\n if (!(socket && selectedPort)) return;\n\n // return if paused or empty outbound buffer\n if (gcPaused || localQueue.length === 0) return;\n\n // return if waiting or queued to queue too large\n if (waitingForAck.length > 0 || spjsQueueCount > spjsQueueCountMax) {\n return;\n }\n\n // blast out next batch of queued to queue\n var toolChange = false,\n count = 0,\n data = [],\n line,\n next;\n\n while (count++ < sendBatchMax && localQueue.length > 0) {\n next = (nextID++).toString();\n waitingForAck.push(next);\n line = localQueue.shift();\n if (line.indexOf(\"M6\") === 0) {\n toolChange = true;\n // grbl doesn't support M6 so\n // just stop sending until unpaused\n if (selectedMode === 'grbl') break;\n }\n data.push({D:line, Id:next});\n // for tinyg pause after M6 sent\n if (toolChange) break;\n }\n\n socket.send('sendjson '+o2js({\n P: selectedPort.Name,\n Data: data\n }));\n\n if (toolChange) {\n emit(\"** tool change\");\n setPause(true);\n var alertToolChange = SDB['sender-alert-toolchange'];\n if (!alertToolChange && !confirm(\"tool change. unpause to continue.\\nshow this dialog in the future?\")) {\n SDB['sender-alert-toolchange'] = 'no';\n }\n // alert(\"tool change. click unpause to continue\");\n // setPause(false);\n }\n }", "title": "" }, { "docid": "e6bbd3e799d4c0b192750299ce91fd3c", "score": "0.53131473", "text": "function dadProcessNextWaitingFile() {\n if (dadGlobal.filesInWaiting.length === 0) {\n // no more files in waiting\n return;\n }\n\n if (dadGetUploadingCount() >= dadGlobal.MAXIMUM_PARALLEL_UPLOADS) {\n // still more pending uploads\n return;\n }\n\n var item = dadGlobal.filesInWaiting.shift();\n dadUploadFile(item.file, item.folderId, item.header, item.textBox, item.subListId, item.lineId);\n}", "title": "" }, { "docid": "9fe04b6c5265199b150a59e83b17ec6f", "score": "0.5311329", "text": "async function pollmonitor(){\n\twhile(true){\n\t\tlet response = await fetch('/nextmsg',{headers: {'csrftoken': window.csrftok}});\n\t\tif(response.ok){\n\t\t\tif(response.headers.get('content-type').toLowerCase() == 'application/octet-stream'){\n\t\t\t\tlet sender = response.headers.get('X-From');\n\t\t\t\tlet cid = response.headers.get('X-Convo-Id');\n\t\t\t\tlet ts = parseInt(response.headers.get('X-Timestamp'), 10);\n\t\t\t\tif(Math.abs(new Date().getTime() - ts) > 5 * 60 * 1000){\n\t\t\t\t\tconsole.log('Bad audio timestamp ', Math.abs(ts - new Date().getTime()) / 1000, ' sec off');\n\t\t\t\t}else if(response.headers.get('X-Media') === '16bitaud'){\n\t\t\t\t\tresponse.arrayBuffer().then((respdata) => {\n\t\t\t\t\t\tshowCall(cid, () => {\n\t\t\t\t\t\t\tif(!(sender in window.pb)){ //starting audio\n\t\t\t\t\t\t\t\twindow.pb[sender] = new SnippetBuffer();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twindow.pb[sender].addSnippet(respdata); //queue up next audio chunk\n\t\t\t\t\t\t\twindow.answertimeout = setTimeout(stopCall, 5000);// if remote end drops for 5 seconds, end call\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}else if(response.headers.get('X-Media') === 'vid'){\n\t\t\t\t\tlet vidStreamId = response.headers.get('X-Stream');\n\t\t\t\t\tlet packetNum = parseInt(response.headers.get('X-Packet'), 10);\n\t\t\t\t\tlet offset = parseInt(response.headers.get('X-Offset'), 10);\n\t\t\t\t\tlet total = parseInt(response.headers.get('X-Total'), 10);\n\t\t\t\t\tresponse.arrayBuffer().then((respdata) => {\n\t\t\t\t\t\thandleVidPacket(vidStreamId, packetNum, offset, total, cid, sender, new Uint8Array(respdata));\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('bad bin response header?', response.headers.get('X-Media'));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresponse.json().then(process);\n\t\t\t}\n\t\t}else{\n\t\t\tlet txt = await response.text();\n\t\t\tif(txt !== 'timeout waiting for something to happen')\n\t\t\t\tconsole.log('Error response',txt);\n\t\t\tif(txt === 'Bad CSRF token')\n\t\t\t\tbreak;\n\t\t}\n\t}\n\talertish('Broken connection to schadnfreude, possibly opened in new tab or exited. Recommend closing this tab.');\n}", "title": "" }, { "docid": "2023bd9cf18201017491717314572186", "score": "0.5292645", "text": "function fill_queue() {\n //read a line from the file. note: we're using synchronous reads here because this is a command line utility\n //and blocking is just fine\n function read_line() {\n var line = \"\";\n var char = new Buffer(1);//Buffer.alloc(1);\n var bytes_read=0;\n while(true) {\n bytes_read = fs.readSync(replay_file_fd, char, 0, 1);\n if(bytes_read==0)\n return \"eof\";\n if (char.toString('utf8') == \"\\n\")\n return line;\n line += char;\n }\n }\n \n while(true) {\n //if the queue is flooded, wait 1ms and try again\n if (replay_queue.length >= assigned_options.queue_size)\n return setTimeout(fill_queue, 1);\n\n var line = read_line();\n line_count++;\n if(line == \"eof\") {\n console.log(\"Finished reading replay file, draining queue...\");\n replay_complete = true;\n return;\n }\n var request;\n try {\n request = JSON.parse(line);\n }\n catch (err) {\n console.error(\"Error parsing JSON on line: \" + line_count + \" - \" + err);\n }\n \n request.line_number = line_count;\n \n var content_length = request.content_length;\n if(content_length > 0) {\n var body = new Buffer(content_length);//Buffer.alloc(content_length);\n fs.readSync(replay_file_fd, body, 0, content_length);\n request.body = body;\n }\n var tail = read_line(); //advance the fp past the trailing \\n\n if(tail) { //this should be blank\n console.error(\"Found trailing characters after parsing body on line: \" + line_count);\n }\n line_count++;\n \n \n //give any passed in processors the opportunity to mutate the request\n if(processors.length)\n processors.forEach(\n function(processor) {\n processor(request);\n }\n );\n \n replay_queue.unshift(request);\n }\n \n setTimeout(fill_queue,1);\n \n}", "title": "" } ]
6fd2678a8cdb277a5f9a407cfb86d023
TODO: REMOVE NURSERY CODE.
[ { "docid": "55aa7356ff0fc7dd9cc74c1661d5a9f7", "score": "0.0", "text": "function doAjaxMainSubmit(pageMessageDivId, successMessage, overrideAction) {\n\t'use strict';\n\n\tvar form = $('form'),\n\t\taction = form.attr('action'),\n\t\tserializedData = form.serialize();\n\n\tif (overrideAction) {\n\t\taction = overrideAction;\n\t}\n\n\t$.ajax({\n\t\turl: action,\n\t\ttype: 'POST',\n\t\tdata: serializedData,\n\t\tsuccess: function(html) {\n\t\t\t// Paste the whole html\n\t\t\t$('.container .row').first().html(html);\n\t\t\tif (pageMessageDivId) {\n\t\t\t\tshowSuccessfulMessage(pageMessageDivId, successMessage);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" } ]
[ { "docid": "acffe366305a123ddf65c9f97713c0bb", "score": "0.6817778", "text": "function ___PRIVATE___(){}", "title": "" }, { "docid": "00384aef7750a0072e9f145a0bcdcb35", "score": "0.6266609", "text": "function _7jo0mRmmKDKvJeSkk629VQ(){}", "title": "" }, { "docid": "53c3defd6e34b27cd30da525a63f667e", "score": "0.6122077", "text": "function __avguVaGrgDi0RzjV63Di8A(){}", "title": "" }, { "docid": "29c381407775382f0f741bd830448439", "score": "0.5817256", "text": "function gfbFNv596j_aor3Vx6iAI2g(){}", "title": "" }, { "docid": "756f3d5f137619fce37e19ecfd727d8c", "score": "0.5805954", "text": "function egouDNY33j68H_aZQYc4FRw(){}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "e6c3e81fe2a1da250ea36513c6884f2d", "score": "0.5740058", "text": "\n\n () {}", "title": "" }, { "docid": "170945dac3d5cf7b843e57c13c982ced", "score": "0.5684045", "text": "function helper () {}", "title": "" }, { "docid": "bca64c111bc28c3b5f35801ba5645832", "score": "0.551856", "text": "function aE_aho94IYz6JkiGcp_buUsA(){}", "title": "" }, { "docid": "8a5ac0553fa35f2e0b160d352334b777", "score": "0.5406427", "text": "function sn(){}", "title": "" }, { "docid": "fc766a8f00efdd01b6fb3de41abdd15f", "score": "0.5379202", "text": "function aT4QTT6AjDWT6PYg1Srvkg(){}", "title": "" }, { "docid": "b742181b53334a0244342b773022c911", "score": "0.5378506", "text": "function se(){}", "title": "" }, { "docid": "0c3858945c9020fcc70a5f617e8df6b0", "score": "0.5292905", "text": "function JB9mC6S80TCV9LF_aI7AnXQ(){}", "title": "" }, { "docid": "ae5bcafc4a9fb491a8f852cfa9122b4f", "score": "0.52760917", "text": "function ConyugeRequiered()\n{\n\n}", "title": "" }, { "docid": "8dc9979ebdbb2d6007cc18a2a4f57b65", "score": "0.52500725", "text": "extract() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "19cc3a0260d5b74096a377457a866679", "score": "0.52400994", "text": "function cr(){}", "title": "" }, { "docid": "76d8961a10328672cd3f68e801d9235d", "score": "0.5195087", "text": "function RavenUtils() { }", "title": "" }, { "docid": "0234e73843ec55cb0f857d6bb68f93dc", "score": "0.5183331", "text": "function BJwjmju_bQzuieaLNynM0gA(){}", "title": "" }, { "docid": "ddc6262e01beb9155cb1717738f2f451", "score": "0.516758", "text": "function _0x518fac(_0x97d77,_0x291d34){0x0;}", "title": "" }, { "docid": "f2aaaf1475bbf317ba0b21da70de5d89", "score": "0.51516074", "text": "function bloviate() {}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5143407", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5122748", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5122748", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5122748", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5122748", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5122748", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5122748", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5122748", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5122748", "text": "initialize() {}", "title": "" }, { "docid": "8657d01809f8b8b75eb4b846917ac21a", "score": "0.51223993", "text": "_getData() {\n \n }", "title": "" }, { "docid": "8a0fe3130625f433a5429e63db45a7c3", "score": "0.51196086", "text": "function avataxHelper() { }", "title": "" }, { "docid": "45dcbab4c5e1a05801bf5265e3115f90", "score": "0.51107347", "text": "function KfOpI2qDZDSXafWSr6SCUQ(){}", "title": "" }, { "docid": "2034b22fbb67eca5e2782c902d75636d", "score": "0.51005846", "text": "get phasing() {\n return false;\n }", "title": "" }, { "docid": "5ce99b058ee2e3afa99a3e4d19b0e7ee", "score": "0.5091872", "text": "function meineFunktion1() {}", "title": "" }, { "docid": "2dd59e301876f29b0356c2aac95940c2", "score": "0.5069695", "text": "raw() {\n return null;\n }", "title": "" }, { "docid": "4aa0b97e43092636a5fe38cff5704aad", "score": "0.50479615", "text": "initialize() {\n return;\n }", "title": "" }, { "docid": "4aa0b97e43092636a5fe38cff5704aad", "score": "0.50479615", "text": "initialize() {\n return;\n }", "title": "" }, { "docid": "4aa0b97e43092636a5fe38cff5704aad", "score": "0.50479615", "text": "initialize() {\n return;\n }", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.5044696", "text": "init() {\n\t}", "title": "" }, { "docid": "575d103806dce8be85be0b7e4cd814cf", "score": "0.5043272", "text": "function Rd(){}", "title": "" }, { "docid": "ca19998e6b4fe854c8935d95db340400", "score": "0.50203985", "text": "function Pagy() {}", "title": "" }, { "docid": "414d474a88840667f7d5444c32f6cf37", "score": "0.50059044", "text": "onReady() {/* For override */}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.4991377", "text": "function r(){}", "title": "" } ]
583b0fb19bc5b7b6d79e0f49255cdbaa
Backup for browsers that don't support transformstyle: preserve3d
[ { "docid": "b58cd92c007dfeded81e1f18d0d9cb4f", "score": "0.0", "text": "function rotateSlidesOld(rotation) {\n\tjQuery(\".intro-slides .intro-slide\").css('z-index', 1)\n\t.each(function(i, j) {\n\t\tvar rotDeg = (-i + rotation) * degBase;\n\t\trotDeg = (rotDeg >= 360 ? rotDeg - 360 : rotDeg);\n\t\trotDeg = (rotDeg <= -360 ? rotDeg + 360 : rotDeg);\n\t\trotDeg = (rotDeg > 180 ? rotDeg - 360 : rotDeg);\n\t\trotDeg = (rotDeg < -180 ? rotDeg + 360 : rotDeg);\n\t\tif(rotDeg === degBase || rotDeg === -degBase) {\n\t\t\tjQuery(j).css('z-index', 2);\n\t\t}\n\t\tif(rotDeg === 0) {\n\t\t\tjQuery(j).css('z-index', 3);\n\t\t}\n \tvar angle = 180 / jQuery(\".intro-slides .intro-slide\").length;\n \tvar sliderLen = (100 / (2 * Math.tan(angle * (Math.PI / 180))));\n\t\tjQuery(j).css('transform', 'rotateY(' + rotDeg + 'deg) translateZ(' + sliderLen + 'vw)');\n\t});\n}", "title": "" } ]
[ { "docid": "f60251dcad7e04b0a58f9150d8c58765", "score": "0.7219232", "text": "function checkTransform3dSupport() {\r\n div.style[support.transform] = '';\r\n div.style[support.transform] = 'rotateY(90deg)';\r\n return div.style[support.transform] !== '';\r\n }", "title": "" }, { "docid": "f60251dcad7e04b0a58f9150d8c58765", "score": "0.7219232", "text": "function checkTransform3dSupport() {\r\n div.style[support.transform] = '';\r\n div.style[support.transform] = 'rotateY(90deg)';\r\n return div.style[support.transform] !== '';\r\n }", "title": "" }, { "docid": "f60251dcad7e04b0a58f9150d8c58765", "score": "0.7219232", "text": "function checkTransform3dSupport() {\r\n div.style[support.transform] = '';\r\n div.style[support.transform] = 'rotateY(90deg)';\r\n return div.style[support.transform] !== '';\r\n }", "title": "" }, { "docid": "e05e4c2ac324043a91b68e62e40729d5", "score": "0.71334505", "text": "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "title": "" }, { "docid": "e05e4c2ac324043a91b68e62e40729d5", "score": "0.71334505", "text": "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "title": "" }, { "docid": "e05e4c2ac324043a91b68e62e40729d5", "score": "0.71334505", "text": "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "title": "" }, { "docid": "e05e4c2ac324043a91b68e62e40729d5", "score": "0.71334505", "text": "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "title": "" }, { "docid": "e05e4c2ac324043a91b68e62e40729d5", "score": "0.71334505", "text": "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "title": "" }, { "docid": "683d4e83c1d09ca577c2f48718ede37d", "score": "0.7087747", "text": "function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = \"translate3d(1px,1px,1px)\";\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== \"none\");\r\n }", "title": "" }, { "docid": "bdb9f34e56d7a6bde59294bb1e281f84", "score": "0.708004", "text": "function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = 'translate3d(1px,1px,1px)';\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\r\n }", "title": "" }, { "docid": "ed74744591f1f727f0930fbf9ce1c194", "score": "0.70443547", "text": "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "title": "" }, { "docid": "ed74744591f1f727f0930fbf9ce1c194", "score": "0.70443547", "text": "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "title": "" }, { "docid": "ed74744591f1f727f0930fbf9ce1c194", "score": "0.70443547", "text": "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "title": "" }, { "docid": "ed74744591f1f727f0930fbf9ce1c194", "score": "0.70443547", "text": "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "title": "" }, { "docid": "ed74744591f1f727f0930fbf9ce1c194", "score": "0.70443547", "text": "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "title": "" }, { "docid": "ed74744591f1f727f0930fbf9ce1c194", "score": "0.70443547", "text": "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "title": "" }, { "docid": "cc579c06ccddfccf74defa9fae3f2070", "score": "0.7032746", "text": "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform': '-webkit-transform',\n 'OTransform': '-o-transform',\n 'msTransform': '-ms-transform',\n 'MozTransform': '-moz-transform',\n 'transform': 'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return has3d !== undefined && has3d.length > 0 && has3d !== 'none';\n }", "title": "" }, { "docid": "f97f78006790eca963f3bd2e0bdb278b", "score": "0.70307034", "text": "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "title": "" }, { "docid": "f97f78006790eca963f3bd2e0bdb278b", "score": "0.70307034", "text": "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "title": "" }, { "docid": "f97f78006790eca963f3bd2e0bdb278b", "score": "0.70307034", "text": "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "title": "" }, { "docid": "b34d7c3790006fcee3f5d0d8a2948ed1", "score": "0.7030655", "text": "function support3d(){var el=document.createElement('p'),has3d,transforms={'webkitTransform':'-webkit-transform','OTransform':'-o-transform','msTransform':'-ms-transform','MozTransform':'-moz-transform','transform':'transform'};//preventing the style p:empty{display: none;} from returning the wrong result\nel.style.display='block';// Add it to the body to get the computed style.\ndocument.body.insertBefore(el,null);for(var t in transforms){if(el.style[t]!==undefined){el.style[t]='translate3d(1px,1px,1px)';has3d=window.getComputedStyle(el).getPropertyValue(transforms[t]);}}document.body.removeChild(el);return has3d!==undefined&&has3d.length>0&&has3d!=='none';}", "title": "" }, { "docid": "28a7ace5b6c4fef26a6d2b210f34c195", "score": "0.70098287", "text": "detect3d() {\n var el = document.createElement('p'),\n t, has3d,\n transforms = {\n 'WebkitTransform': '-webkit-transform',\n 'OTransform': '-o-transform',\n 'MSTransform': '-ms-transform',\n 'MozTransform': '-moz-transform',\n 'transform': 'transform'\n };\n\n document.body.insertBefore(el, document.body.lastChild);\n\n for (t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n el.parentNode.removeChild(el);\n\n if (has3d !== undefined) {\n return has3d !== 'none';\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "60b344305cc5dd66da16f943d1aeabb0", "score": "0.6980632", "text": "function checkTransform3dSupport() {\n\t\tdiv.style[support.transform] = '';\n\t\tdiv.style[support.transform] = 'rotateY(90deg)';\n\t\treturn div.style[support.transform] !== '';\n\t}", "title": "" }, { "docid": "2b10906749fb71a53fec002b4bfbe567", "score": "0.6896375", "text": "function detect3dSupport(){\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n // Add it to the body to get the computed style\n document.body.insertBefore(el, null);\n for(var t in transforms){\n if( el.style[t] !== undefined ){\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n document.body.removeChild(el);\n return (has3d !== undefined && has3d.length > 0 && has3d !== \"none\");\n }", "title": "" }, { "docid": "751fe9d4845bc142f1a6a288d13fdd34", "score": "0.6814709", "text": "function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n //preventing the style p:empty{display: none;} from returning the wrong result\r\n el.style.display = 'block';\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = 'translate3d(1px,1px,1px)';\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\r\n }", "title": "" }, { "docid": "9af70c6b171d92025eae28932f1c163f", "score": "0.6804895", "text": "function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n //preventing the style p:empty{display: none;} from returning the wrong result\r\n el.style.display = 'block'\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = 'translate3d(1px,1px,1px)';\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\r\n }", "title": "" }, { "docid": "6c34e6309217c9b0ed7074c787e8915d", "score": "0.6782586", "text": "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n //preventing the style p:empty{display: none;} from returning the wrong result\n el.style.display = 'block';\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "title": "" }, { "docid": "598a31e10e067db6a6acf0c92ad5936c", "score": "0.6780075", "text": "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n //preventing the style p:empty{display: none;} from returning the wrong result\n el.style.display = 'block'\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "title": "" }, { "docid": "a6cb15a0f65fc40757e68ca984aeac5b", "score": "0.66936266", "text": "function detect3dSupport() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform': '-webkit-transform',\n 'msTransform': '-ms-transform',\n 'transform': 'transform'\n };\n // Add it to the body to get the computed style\n document.body.insertBefore(el, null);\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n document.body.removeChild(el);\n return (has3d !== undefined && has3d.length > 0 && has3d !== \"none\");\n }", "title": "" }, { "docid": "5ceb93aacfb53856da2b4ff6928fe6bd", "score": "0.6684159", "text": "function supportCssTransforms3d() {\r\n\t\tif (typeof(window.Modernizr) !== 'undefined') {\r\n\t\t\treturn Modernizr.csstransforms3d;\r\n\t\t}\r\n\t\t\r\n\t\tvar props = [ 'perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective' ],\r\n\t\t\tprefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),\r\n\t\t\tret = false;\r\n\t\tfor ( var i in props ) {\r\n\t\t\tif ( m_style[ props[i] ] !== undefined ) {\r\n\t\t\t\tret = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// webkit has 3d transforms disabled for chrome, though\r\n\t\t// it works fine in safari on leopard and snow leopard\r\n\t\t// as a result, it 'recognizes' the syntax and throws a false positive\r\n\t\t// thus we must do a more thorough check:\r\n\t\tif (ret) {\r\n\t\t\tvar st = document.createElement('style'),\r\n\t\t\t\tdiv = document.createElement('div');\r\n\t\t\t\t\r\n\t\t\t// webkit allows this media query to succeed only if the feature is enabled.\t\r\n\t\t\t// \"@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){#modernizr{height:3px}}\"\r\n\t\t\tst.textContent = '@media ('+prefixes.join('transform-3d),(')+'modernizr){#modernizr{height:3px}}';\r\n\t\t\tdocument.getElementsByTagName('head')[0].appendChild(st);\r\n\t\t\tdiv.id = 'modernizr';\r\n\t\t\tdocElement.appendChild(div);\r\n\t\t\t\r\n\t\t\tret = div.offsetHeight === 3;\r\n\t\t\t\r\n\t\t\tst.parentNode.removeChild(st);\r\n\t\t\tdiv.parentNode.removeChild(div);\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "title": "" }, { "docid": "47d17787a42eba76c76e2c5f4b7778e2", "score": "0.63187546", "text": "function transform3dTest() {\n\tvar prop = \"transform-3d\";\n\treturn validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( \"(-\" + vendors.join( \"-\" + prop + \"),(-\" ) + \"-\" + prop + \"),(\" + prop + \")\" );\n}", "title": "" }, { "docid": "47d17787a42eba76c76e2c5f4b7778e2", "score": "0.63187546", "text": "function transform3dTest() {\n\tvar prop = \"transform-3d\";\n\treturn validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( \"(-\" + vendors.join( \"-\" + prop + \"),(-\" ) + \"-\" + prop + \"),(\" + prop + \")\" );\n}", "title": "" }, { "docid": "b619ab4d6ffc8d5bc86e1a8b2ae57c26", "score": "0.6274363", "text": "function getTransforms(translate3d){return{'-webkit-transform':translate3d,'-moz-transform':translate3d,'-ms-transform':translate3d,'transform':translate3d};}", "title": "" }, { "docid": "98214375cbe9f4ba2b21b3c20582c99c", "score": "0.6266753", "text": "function getTrans3D() {\r\n\r\n var prefix = (pfx('transform'));\r\n var trans = $(\"#slideArea>div\")[0].style['' + prefix + ''].match(/.+?\\(.+?\\)/g);\r\n var dico = {};\r\n for (var el in trans) {\r\n var ele = trans[el];\r\n var key = ele.match(/.+?\\(/g).join(\"\").match(/[a-zA-Z0-9]/g).join(\"\");\r\n var value = ele.match(/\\(.+\\)/g)[0].split(\",\");\r\n if (value.length <= 1) {\r\n value = parseFloat(value[0].match(/-[0-9]+|[0-9]+/g)[0]);\r\n dico[key] = value;\r\n } else {\r\n dico[key] = {};\r\n for (val in value) {\r\n var vale = parseFloat(value[val].match(/-[0-9]+|[0-9]+/g)[0]);\r\n dico[key][val] = vale;\r\n }\r\n }\r\n }\r\n return dico;\r\n\r\n}", "title": "" }, { "docid": "c1c700de8254cfa60fa7df4ba1677b0b", "score": "0.620463", "text": "function getTrans3D() {\n\n var prefix = (pfx('transform'));\n var trans = $(\"#slideArea>div\")[0].style['' + prefix + ''].match(/.+?\\(.+?\\)/g);\n var dico = {};\n for (var el in trans) {\n var ele = trans[el];\n var key = ele.match(/.+?\\(/g).join(\"\").match(/[a-zA-Z0-9]/g).join(\"\");\n var value = ele.match(/\\(.+\\)/g)[0].split(\",\");\n if (value.length <= 1) {\n value = parseFloat(value[0].match(/-[0-9]+|[0-9]+/g)[0]);\n dico[key] = value;\n } else {\n dico[key] = {};\n for (val in value) {\n var vale = parseFloat(value[val].match(/-[0-9]+|[0-9]+/g)[0]);\n dico[key][val] = vale;\n }\n }\n }\n return dico;\n\n}", "title": "" }, { "docid": "55265c811d239586926dfe8133f9399f", "score": "0.6112322", "text": "setUse3dTransform (use3dTransform) {\n this._use3dTransform = use3dTransform\n }", "title": "" }, { "docid": "b83d3c9361c874a603da44090e004a92", "score": "0.6061689", "text": "function detectPrefixes() {\n\t var transform = void 0;\n\t var transition = void 0;\n\t var transitionEnd = void 0;\n\t var hasTranslate3d = void 0;\n\t\n\t (function () {\n\t var el = document.createElement('_');\n\t var style = el.style;\n\t\n\t var prop = void 0;\n\t\n\t if (style[prop = 'webkitTransition'] === '') {\n\t transitionEnd = 'webkitTransitionEnd';\n\t transition = prop;\n\t }\n\t\n\t if (style[prop = 'transition'] === '') {\n\t transitionEnd = 'transitionend';\n\t transition = prop;\n\t }\n\t\n\t if (style[prop = 'webkitTransform'] === '') {\n\t transform = prop;\n\t }\n\t\n\t if (style[prop = 'msTransform'] === '') {\n\t transform = prop;\n\t }\n\t\n\t if (style[prop = 'transform'] === '') {\n\t transform = prop;\n\t }\n\t\n\t document.body.insertBefore(el, null);\n\t style[transform] = 'translate3d(0, 0, 0)';\n\t hasTranslate3d = !!global.getComputedStyle(el).getPropertyValue(transform);\n\t document.body.removeChild(el);\n\t })();\n\t\n\t return {\n\t transform: transform,\n\t transition: transition,\n\t transitionEnd: transitionEnd,\n\t hasTranslate3d: hasTranslate3d\n\t };\n\t}", "title": "" }, { "docid": "dd23288066b85c0ed0bea726d4d98aa9", "score": "0.6055145", "text": "_applyTransform () {\n var matrix = this._style.transform.domMatrix;\n\n // XXX: is this in the right order? UPDATE: It is.\n // TODO: Apply DOMMatrix directly to the Element once browser APIs\n // support it.\n var transform = `matrix3d(\n ${ matrix.m11 },\n ${ matrix.m12 },\n ${ matrix.m13 },\n ${ matrix.m14 },\n ${ matrix.m21 },\n ${ matrix.m22 },\n ${ matrix.m23 },\n ${ matrix.m24 },\n ${ matrix.m31 },\n ${ matrix.m32 },\n ${ matrix.m33 },\n ${ matrix.m34 },\n ${ matrix.m41 },\n ${ matrix.m42 },\n ${ matrix.m43 },\n ${ matrix.m44 }\n )`;\n\n this._applyStyle('transform', transform);\n }", "title": "" }, { "docid": "74b1626f29592baf958129f9c923afd8", "score": "0.5907977", "text": "function _go_to_3d (scale, translate, svg_scale, svg_translate) {\n var n_scale = scale / svg_scale\n var n_translate = utils.c_minus_c(translate,\n utils.c_times_scalar(svg_translate, n_scale))\n var transform = ('translate(' + n_translate.x + 'px,' + n_translate.y + 'px) '\n + 'scale(' + n_scale + ')')\n this.css3_transform_container.style('transform', transform)\n this.css3_transform_container.style('-webkit-transform', transform)\n this.css3_transform_container.style('transform-origin', '0 0')\n this.css3_transform_container.style('-webkit-transform-origin', '0 0')\n}", "title": "" }, { "docid": "d4f49f3a87fed37e88f73fbe62bddbcc", "score": "0.58891255", "text": "function Pn(e){return{\" transform\":e,\"-moz-transform\":e,\"-webkit-transform\":e,\"-o-transform\":e,\"-ms-transform\":e}}", "title": "" }, { "docid": "e03625bd6237c33d8273770cad6f119e", "score": "0.58826274", "text": "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "title": "" }, { "docid": "e03625bd6237c33d8273770cad6f119e", "score": "0.58826274", "text": "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "title": "" }, { "docid": "e03625bd6237c33d8273770cad6f119e", "score": "0.58826274", "text": "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "title": "" }, { "docid": "ccf87bf9a940ee7b560f89a9fb0d5df6", "score": "0.5869991", "text": "function G(){var m=\"perspective\",g=[\"Webkit\",\"Moz\",\"O\",\"ms\",\"Ms\"],h;for(h=0;h<g.length;h++)\"undefined\"!==typeof document.documentElement.style[g[h]+\"Perspective\"]&&(m=g[h]+\"Perspective\");\"undefined\"!==typeof document.documentElement.style[m]?\"webkitPerspective\"in document.documentElement.style?(m=document.createElement(\"style\"),g=document.createElement(\"div\"),h=document.head||document.getElementsByTagName(\"head\")[0],m.textContent=\"@media (-webkit-transform-3d) {#ggswhtml5{height:5px}}\",h.appendChild(m),\ng.id=\"ggswhtml5\",document.documentElement.appendChild(g),h=5===g.offsetHeight,m.parentNode.removeChild(m),g.parentNode.removeChild(g)):h=!0:h=!1;return h}", "title": "" }, { "docid": "1201b7e953b992432d1f413eedb05bea", "score": "0.5868932", "text": "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "title": "" }, { "docid": "1201b7e953b992432d1f413eedb05bea", "score": "0.5868932", "text": "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "title": "" }, { "docid": "1201b7e953b992432d1f413eedb05bea", "score": "0.5868932", "text": "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "title": "" }, { "docid": "1201b7e953b992432d1f413eedb05bea", "score": "0.5868932", "text": "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "title": "" }, { "docid": "1201b7e953b992432d1f413eedb05bea", "score": "0.5868932", "text": "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "title": "" }, { "docid": "1201b7e953b992432d1f413eedb05bea", "score": "0.5868932", "text": "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "title": "" }, { "docid": "1201b7e953b992432d1f413eedb05bea", "score": "0.5868932", "text": "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "title": "" }, { "docid": "1201b7e953b992432d1f413eedb05bea", "score": "0.5868932", "text": "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "title": "" }, { "docid": "0e5c5cff82e1963e408a79e6ffc3f757", "score": "0.58634084", "text": "function getMatrix(obj){var matrix=obj.css(\"-webkit-transform\") || obj.css(\"-moz-transform\") || obj.css(\"-ms-transform\") || obj.css(\"-o-transform\") || obj.css(\"transform\");return matrix;}", "title": "" }, { "docid": "1f402edf1805cb32543bc4d4355f24d7", "score": "0.5783459", "text": "function with3DAcceleration(element, action, args) {\r\n\t var property = \"-webkit-transform\",\r\n enabler = \"translate3d(0,0,0)\",\r\n\t origValue = element.css(property);\r\n\r\n\t var isNone = !(origValue && origValue.match(/^\\s*none\\s*$/i));\r\n\t element.css(property, isNone ? enabler : origValue + \" \" + enabler);\r\n\t try {\r\n\t return action.apply(this, args);\r\n\t } finally {\r\n\t element.css(property, origValue);\r\n\t }\r\n\t}", "title": "" }, { "docid": "d1a88c74ffc40b82c6a52b25e9168a3c", "score": "0.576479", "text": "function getTransforms(translate3d) {\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform': translate3d,\n 'transform': translate3d\n };\n }", "title": "" }, { "docid": "491b078a2901eb12ee2363434a5243f9", "score": "0.57517546", "text": "_saveOriginAndTransform() {\n\n var xspace = this.getMetadata(\"xspace\");\n var yspace = this.getMetadata(\"yspace\");\n var zspace = this.getMetadata(\"zspace\");\n\n var startx = xspace.start;\n var starty = yspace.start;\n var startz = zspace.start;\n var cx = xspace.direction_cosines;\n var cy = yspace.direction_cosines;\n var cz = zspace.direction_cosines;\n var stepx = xspace.step;\n var stepy = yspace.step;\n var stepz = zspace.step;\n\n // voxel_origin\n var o = {\n x: startx * cx[0] + starty * cy[0] + startz * cz[0],\n y: startx * cx[1] + starty * cy[1] + startz * cz[1],\n z: startx * cx[2] + starty * cy[2] + startz * cz[2]\n };\n\n this.setMetadata(\"voxel_origin\", o);\n\n var tx = (-o.x * cx[0] - o.y * cx[1] - o.z * cx[2]) / stepx;\n var ty = (-o.x * cy[0] - o.y * cy[1] - o.z * cy[2]) / stepy;\n var tz = (-o.x * cz[0] - o.y * cz[1] - o.z * cz[2]) / stepz;\n\n var w2v = [\n [cx[0] / stepx, cx[1] / stepx, cx[2] / stepx, tx],\n [cy[0] / stepy, cy[1] / stepy, cy[2] / stepy, ty],\n [cz[0] / stepz, cz[1] / stepz, cz[2] / stepz, tz]\n ];\n\n this.setMetadata(\"w2v\", w2v);\n }", "title": "" }, { "docid": "a8f568c646773d7f60dce983f725fe1c", "score": "0.57447267", "text": "transform3(a) {\n const w = a.x * this.m14 + a.y * this.m24 + a.z * this.m34 + this.m44;\n const invW = 1 / w;\n const x = (a.x * this.m11 + a.y * this.m21 + a.z * this.m31 + this.m41) * invW;\n const y = (a.x * this.m12 + a.y * this.m22 + a.z * this.m32 + this.m42) * invW;\n const z = (a.x * this.m13 + a.y * this.m23 + a.z * this.m33 + this.m43) * invW;\n return new Vec3(x, y, z);\n }", "title": "" }, { "docid": "6d1f3570da3c00512d3de3ad9f644c59", "score": "0.5744022", "text": "function set_use_3d_transform (use_3d_transform) {\n this._use_3d_transform = use_3d_transform\n}", "title": "" }, { "docid": "c462a9ffcfe88dc226e8129228b33ec6", "score": "0.57186586", "text": "function testTransformsSupport() {\n var div = create('div');\n return typeof div.style.perspective !== 'undefined' || typeof div.style.webkitPerspective !== 'undefined';\n }", "title": "" }, { "docid": "c462a9ffcfe88dc226e8129228b33ec6", "score": "0.57186586", "text": "function testTransformsSupport() {\n var div = create('div');\n return typeof div.style.perspective !== 'undefined' || typeof div.style.webkitPerspective !== 'undefined';\n }", "title": "" }, { "docid": "7b00b7825f59adcc50a13a2258b876c4", "score": "0.57076955", "text": "function getTranslate3d(){\r\n if (options.direction !== 'vertical') {\r\n return 'translate3d(-100%, 0px, 0px)';\r\n }\r\n\r\n return 'translate3d(0px, -100%, 0px)';\r\n }", "title": "" }, { "docid": "eb71b796afeb287f88eb2d516d562a73", "score": "0.5677909", "text": "function supportsCSS3D() {\n var props = [\n 'perspectiveProperty', 'WebkitPerspective', 'MozPerspective'\n ], testDom = document.createElement('a');\n\n for(var i=0; i<props.length; i++){\n if(props[i] in testDom.style){\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "d184893ff25bd870814c1b51c748b1bc", "score": "0.5646525", "text": "function trackTransforms(ctx){\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\",'svg');\n var xform = svg.createSVGMatrix();\n ctx.getTransform = function(){\n return xform;\n };\n\n var savedTransforms = [];\n var save = ctx.save;\n ctx.save = function(){\n savedTransforms.push(xform.translate(0,0));\n return save.call(ctx);\n };\n var restore = ctx.restore;\n ctx.restore = function(){\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n var scale = ctx.scale;\n ctx.scale = function(sx,sy){\n xform = xform.scaleNonUniform(sx,sy);\n return scale.call(ctx,sx,sy);\n };\n var rotate = ctx.rotate;\n ctx.rotate = function(radians){\n xform = xform.rotate(radians*180/Math.PI);\n return rotate.call(ctx,radians);\n };\n var translate = ctx.translate;\n ctx.translate = function(dx,dy){\n translationTrace.x += dx;\n translationTrace.y += dy;\n xform = xform.translate(dx,dy);\n return translate.call(ctx,dx,dy);\n };\n var transform = ctx.transform;\n ctx.transform = function(a,b,c,d,e,f){\n var m2 = svg.createSVGMatrix();\n m2.a=a;\n m2.b=b;\n m2.c=c;\n m2.d=d;\n m2.e=e;\n m2.f=f;\n xform = xform.multiply(m2);\n return transform.call(ctx,a,b,c,d,e,f);\n };\n var setTransform = ctx.setTransform;\n ctx.setTransform = function(a,b,c,d,e,f){\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx,a,b,c,d,e,f);\n };\n var pt = svg.createSVGPoint();\n ctx.transformedPoint = function(x,y){\n pt.x=x;\n pt.y=y;\n return pt.matrixTransform(xform.inverse());\n }\n}", "title": "" }, { "docid": "ff0dd692d895393debf55fc567c594ec", "score": "0.5614264", "text": "function translate3DToObject(value) {\n value = value.toString();\n var pattern = /([0-9\\-]+)+(?![3d]\\()/gi,\n positionMatched = value.match(pattern);\n\n return {\n x: parseFloat(positionMatched[0]),\n y: parseFloat(positionMatched[1]),\n z: parseFloat(positionMatched[2])\n };\n }", "title": "" }, { "docid": "aeb5f008f972fa741dcedda07fad425e", "score": "0.5612263", "text": "_setTransforms () {\n this.transforms = {\n 'effect-1-2': {\n 'next': [\n `translate3d(0, ${win.height / 4 + 5}px, 0)`,\n `translate3d(-${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, ${win.height / 4 + 5}px, 0)`,\n `translate3d(-${win.width / 4 + 5}px, 0, 0)`,\n\n `translate3d(${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, -${win.height / 4 + 5}px, 0)`,\n `translate3d(${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, -${win.height / 4 + 5}px, 0)`,\n\n `translate3d(0, ${win.height / 4 + 5}px, 0)`,\n `translate3d(-${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, ${win.height / 4 + 5}px, 0)`,\n `translate3d(-${win.width / 4 + 5}px, 0, 0)`,\n\n `translate3d(${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, -${win.height / 4 + 5}px, 0)`,\n `translate3d(${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, -${win.height / 4 + 5}px, 0)`,\n ],\n 'prev': [\n `translate3d(0, -${win.height / 4 + 5}px, 0)`,\n `translate3d(${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, -${win.height / 4 + 5}px, 0)`,\n `translate3d(${win.width / 4 + 5}px, 0, 0)`,\n\n `translate3d(-${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, ${win.height / 4 + 5}px, 0)`,\n `translate3d(-${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, ${win.height / 4 + 5}px, 0)`,\n\n `translate3d(0, -${win.height / 4 + 5}px, 0)`,\n `translate3d(${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, -${win.height / 4 + 5}px, 0)`,\n `translate3d(${win.width / 4 + 5}px, 0, 0)`,\n\n `translate3d(-${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, ${win.height / 4 + 5}px, 0)`,\n `translate3d(-${win.width / 4 + 5}px, 0, 0)`,\n `translate3d(0, ${win.height / 4 + 5}px, 0)`,\n ]\n },\n };\n }", "title": "" }, { "docid": "3283574cba5340720d26a7ba999d3128", "score": "0.55946773", "text": "function updateSvgTransformAttr(window, element) {\n if (!element.namespaceURI || element.namespaceURI.indexOf('/svg') == -1) {\n return false;\n }\n if (!(SVG_TRANSFORM_PROP in window)) {\n window[SVG_TRANSFORM_PROP] =\n /Trident|MSIE|IEMobile|Edge|Android 4/i.test(window.navigator.userAgent);\n }\n return window[SVG_TRANSFORM_PROP];\n }", "title": "" }, { "docid": "4349d7dfca371f7623daf88ec92f6fca", "score": "0.5544996", "text": "function supportsCSS3D() {\n\t\tvar props = [\n\t\t\t'perspectiveProperty', 'WebkitPerspective', 'MozPerspective'\n\t\t], testDom = document.createElement('a');\n\t\t \n\t\tfor(var i=0; i<props.length; i++){\n\t\t\tif(props[i] in testDom.style){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "title": "" }, { "docid": "4349d7dfca371f7623daf88ec92f6fca", "score": "0.5544996", "text": "function supportsCSS3D() {\n\t\tvar props = [\n\t\t\t'perspectiveProperty', 'WebkitPerspective', 'MozPerspective'\n\t\t], testDom = document.createElement('a');\n\t\t \n\t\tfor(var i=0; i<props.length; i++){\n\t\t\tif(props[i] in testDom.style){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "title": "" }, { "docid": "b560cc633f44932cb5df076cbe5599cd", "score": "0.55217516", "text": "bakeTransformsOnEntity( el ) {\n\t\tlet mesh = el.object3D;\n\t\tmesh.updateMatrix();\n\t\tmesh.updateMatrixWorld( true );\n\n\t\tlet vertices = el.getObject3D( 'obj' ).geometry.vertices;\n\t\tvertices.forEach( vertex => {\n\t\t\tvertex.applyMatrix4( mesh.matrixWorld );\n\t\t});\n\n\t\tel.removeAttribute( 'scale' );\n\t\tel.removeAttribute( 'rotation' );\n\t\tel.removeAttribute( 'position' );\n\n\t}", "title": "" }, { "docid": "17318382e18c05840f09a9e83efe6935", "score": "0.5449706", "text": "function getMatrix(obj) {\n\t\t var matrix = obj.css(\"-webkit-transform\") ||\n\t\t obj.css(\"-moz-transform\") ||\n\t\t obj.css(\"-ms-transform\") ||\n\t\t obj.css(\"-o-transform\") ||\n\t\t obj.css(\"transform\");\n\t\t return matrix;\n\t\t}", "title": "" }, { "docid": "714ec99d9f514b58f1f4a4e417762d61", "score": "0.54494673", "text": "function transformFunction(x, y, z) {\n\t\tif (threedTransforms === true){\n\t\t\ttransformValue = 'translate3d(' + x + 'px, ' + y + 'px, ' + z + 'px)';\n\t\t} else {\n\t\t\ttransformValue = 'translateX(' + x + 'px) translateY(' + y + 'px) translateZ(' + z + 'px)';\n\t\t}\n\t return transformValue;\n\t}", "title": "" }, { "docid": "cbeb6dc83590b0348b6d7fa8fbe5b175", "score": "0.54413", "text": "unpackTransform() {\n const { position, quaternion } = this.getWorldCoordinates();\n this.setWorldCoordinates({ position, quaternion });\n }", "title": "" }, { "docid": "6cac14f65d66d29e7ef847bcfca4db51", "score": "0.5438101", "text": "_getTransform (position) {\n return `translate3d(0, ${position}px, 0)`\n }", "title": "" }, { "docid": "604c4310723f02c926fe6b26fa7e6618", "score": "0.5406835", "text": "function ws_book(i,g,a){var d=jQuery;var e=d(\"ul\",a);var c=i.duration;var b={backgroundColor:\"#000\",position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",transformStyle:\"preserve-3d\",zIndex:3,outline:\"1px solid transparent\"};var f;this.go=function(p,n){if(h.cssTransitions()&&h.cssTransforms3d()){if(f){return n}var s=g.get(p),k=g.get(n),u=a.parent().width()*2;var l=((n==0&&p!=n+1)||(p==n-1))?{p:true,cont1back:s.src,cont2back:k.src,item1back:k.src,item2back:s.src,item1deg:\"0.1deg\",item2deg:\"-82.9deg\",item1dodeg:\"82.9deg\",item2dodeg:\"0deg\",trans1:\"ease-in \",trans2:\"ease-out \"}:{p:false,cont1back:k.src,cont2back:s.src,item1back:s.src,item2back:k.src,item1deg:\"82.9deg\",item2deg:\"-0.1deg\",item1dodeg:\"0deg\",item2dodeg:\"-82.9deg\",trans1:\"ease-out \",trans2:\"ease-in \"};var v=d(\"<div>\").css(b).appendTo(a.parent());var t=d(\"<div>\").css(b).css({background:\"url(\"+l.cont1back+\")\",backgroundSize:\"auto 100%\",width:\"50%\",perspective:u}).appendTo(v);var q=d(\"<div>\").css(b).css({left:\"50%\",background:\"url(\"+l.cont2back+\") right\",backgroundSize:\"auto 100%\",width:\"50%\",perspective:u}).appendTo(v);var o=d(\"<div>\").css(b).css({background:\"url(\"+l.item1back+\")\",backgroundSize:\"auto 100%\",transform:\"rotateY(\"+l.item1deg+\")\",transition:l.trans1+c/2000+\"s\",transformOrigin:\"right\",marginRight:\"-100%\",display:l.p?\"block\":\"none\"}).appendTo(t);var m=d(\"<div>\").css(b).css({background:\"url(\"+l.item2back+\") right\",backgroundSize:\"auto 100%\",transform:\"rotateY(\"+l.item2deg+\")\",transition:l.trans2+c/2000+\"s\",transformOrigin:\"left\",marginRight:\"-100%\",display:l.p?\"none\":\"block\"}).appendTo(q);var r=d(\"<div>\").css(b).css({opacity:0.2,zIndex:2}).appendTo((l.p?t:q)).css(\"opacity\",1).clone().appendTo((l.p?m:o)).css(\"opacity\",0.2).clone().appendTo((l.p?q:t)).css(\"opacity\",1).hide().clone().appendTo((l.p?o:m)).css(\"opacity\",0.2).hide();f=new j(l,t,q,o,m,function(){e.css({left:-p+\"00%\"}).show();v.remove();f=0})}else{a.find(\"ul\").stop(true).animate({left:(p?-p+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))},i.duration,\"easeInOutExpo\")}function j(C,G,F,E,D,H){var B=G,A=F,z=E,y=D,x=\"rotateY(\"+C.item1dodeg+\")\";var w=\"rotateY(\"+C.item2dodeg+\")\";if(!C.p){B=F;A=G;z=D;y=E;x=\"rotateY(\"+C.item2dodeg+\")\";w=\"rotateY(\"+C.item1dodeg+\")\"}z.css(\"transform\",x);z.children().fadeIn(c/2);B.children().fadeOut(c/2,function(){y.show();y.css(\"transform\",w);y.children().fadeOut(c/2);A.children().fadeIn(c/2)});setTimeout(H,c);return{stop:function(){H()}}}return p};var h={domPrefixes:\" Webkit Moz ms O Khtml\".split(\" \"),testDom:function(k){var j=this.domPrefixes.length;while(j--){if(typeof document.body.style[this.domPrefixes[j]+k]!==\"undefined\"){return true}}return false},cssTransitions:function(){return this.testDom(\"Transition\")},cssTransforms3d:function(){if(typeof document.body.style.perspectiveProperty!==\"undefined\"){return true}return this.testDom(\"Perspective\")}}}", "title": "" }, { "docid": "d9f8a2e3ed9b294a40083cbef7e57786", "score": "0.5402626", "text": "function ws_book(o,m,b){var f=jQuery;var l=f(this);var i=f(\"ul\",b);b=b.parent();var j=f(\"<div>\").addClass(\"ws_effect\").appendTo(b),e=o.duration,d=o.perspective||0.4,g=o.shadow||0.35,a=o.noCanvas||false,k=o.no3d||false;var n={domPrefixes:\" Webkit Moz ms O Khtml\".split(\" \"),testDom:function(q){var p=this.domPrefixes.length;while(p--){if(typeof document.body.style[this.domPrefixes[p]+q]!==\"undefined\"){return true}}return false},cssTransitions:function(){return this.testDom(\"Transition\")},cssTransforms3d:function(){var q=(typeof document.body.style.perspectiveProperty!==\"undefined\")||this.testDom(\"Perspective\");if(q&&/AppleWebKit/.test(navigator.userAgent)){var s=document.createElement(\"div\"),p=document.createElement(\"style\"),r=\"Test3d\"+Math.round(Math.random()*99999);p.textContent=\"@media (-webkit-transform-3d){#\"+r+\"{height:3px}}\";document.getElementsByTagName(\"head\")[0].appendChild(p);s.id=r;document.body.appendChild(s);q=s.offsetHeight===3;p.parentNode.removeChild(p);s.parentNode.removeChild(s)}return q},canvas:function(){if(typeof document.createElement(\"canvas\").getContext!==\"undefined\"){return true}}};if(!k){k=n.cssTransitions()&&n.cssTransforms3d()}if(!a){a=n.canvas()}this.go=function(q,p){var D=(p==0&&q!=p+1)||(q==p-1),u=m.get(q),F=m.get(p);var r=f(\"<div>\").appendTo(j);if(k){var x={backgroundColor:\"#000\",position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",transformStyle:\"preserve-3d\",zIndex:3,outline:\"1px solid transparent\"};r.css(x);perspect=b.width()*(3-d*2);var y=83.5;var C=f(\"<div>\").css(x).css({background:\"url(\"+(D?u:F).src+\")\",backgroundSize:\"auto 100%\",width:\"50%\",perspective:perspect}).appendTo(r);var B=f(\"<div>\").css(x).css({left:\"50%\",background:\"url(\"+(D?F:u).src+\") right\",backgroundSize:\"auto 100%\",width:\"50%\",perspective:perspect}).appendTo(r);var H=f(\"<div>\").css(x).css({background:\"url(\"+(D?F:u).src+\")\",backgroundSize:\"auto 100%\",transform:\"rotateY(\"+(D?0.1:y)+\"deg)\",transition:(D?\"ease-in \":\"ease-out \")+e/2000+\"s\",transformOrigin:\"right\",marginRight:\"-100%\",display:D?\"block\":\"none\"}).appendTo(C);var E=f(\"<div>\").css(x).css({background:\"url(\"+(D?u:F).src+\") right\",backgroundSize:\"auto 100%\",transform:\"rotateY(-\"+(D?y:0.1)+\"deg)\",transition:(D?\"ease-out \":\"ease-in \")+e/2000+\"s\",transformOrigin:\"left\",marginRight:\"-100%\",display:D?\"none\":\"block\"}).appendTo(B);var t=f(\"<div>\").css(x).css({zIndex:1,opacity:1}).appendTo((D?C:B)).clone().appendTo((D?E:H)).css(\"opacity\",g).clone().appendTo((D?B:C)).css(\"opacity\",1).hide().clone().appendTo((D?H:E)).css(\"opacity\",g).hide()}else{if(a){var w=f(\"<div>\").css({position:\"absolute\",top:0,left:D?0:\"50%\",width:\"50%\",height:\"100%\",overflow:\"hidden\",zIndex:6}).append(f(m.get(q)).clone().css({position:\"absolute\",height:\"100%\",right:D?\"auto\":0,left:D?0:\"auto\"})).appendTo(r).hide();var A=f(\"<div>\").css({position:\"absolute\",width:\"100%\",height:\"100%\",left:0,top:0,zIndex:8}).appendTo(r).hide();var G=f(\"<canvas>\").css({position:\"absolute\",zIndex:2,left:0,top:-A.height()*d/2}).attr({width:A.width(),height:A.height()*(d+1)}).appendTo(A);var z=G.clone().css({top:0,zIndex:1}).attr({width:A.width(),height:A.height()}).appendTo(A);var v=G.get(0).getContext(\"2d\");var s=z.get(0).getContext(\"2d\")}else{i.stop(true).animate({left:(q?-q+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))},e,\"easeInOutExpo\")}}if(!k&&a){var C=v;var B=s;var H=F;var E=u}h(D,y,C,B,H,E,A,G,z,w,function(){l.trigger(\"effectEnd\");r.remove()})};function c(F,r,z,u,t,D,C,B,A,s,q){numSlices=t/2,widthScale=t/A,heightScale=(1-D)/numSlices;F.clearRect(0,0,q.width(),q.height());for(var p=0;p<numSlices+widthScale;p++){var v=(C?p*o.width/t+o.width/2:(numSlices-p)*o.width/t);var G=z+(C?2:-2)*p,E=u+s*heightScale*p/2;if(v<0){v=0}if(G<0){G=0}if(E<0){E=0}F.drawImage(r,v,0,2.5,o.height,G,E,2,s*(1-(heightScale*p)))}F.save();F.beginPath();F.moveTo(z,u);F.lineTo(z+(C?2:-2)*(numSlices+widthScale),u+s*heightScale*(numSlices+widthScale)/2);F.lineTo(z+(C?2:-2)*(numSlices+widthScale),s*(1-heightScale*(numSlices+widthScale))+u+s*heightScale*(numSlices+widthScale)/2);F.lineTo(z,u+s);F.closePath();F.clip();F.fillStyle=\"rgba(0,0,0,\"+Math.round(B*100)/100+\")\";F.fillRect(0,0,q.width(),q.height());F.restore()}function h(z,r,B,A,x,w,u,v,t,y,D){if(k){if(!z){r*=-1;var C=A;A=B;B=C;C=w;w=x;x=C}x.css(\"transform\",\"rotateY(\"+r+\"deg)\").children().fadeIn(e/2);B.children().fadeOut(e/2,function(){w.show().css(\"transform\",\"rotateY(0deg)\").children().fadeOut(e/2);A.children().fadeIn(e/2)})}else{if(a){u.show();var q=new Date;var s=true;var p=setInterval(function(){var E=(new Date-q)/e;if(E>1){E=1}var H=jQuery.easing.easeInOutQuint(1,E,0,1,1),G=jQuery.easing.easeInOutCubic(1,E,0,1,1),K=!z;if(E<0.5){H*=2;G*=2;var F=x}else{K=z;H=(1-H)*2;G=(1-G)*2;var F=w}var I=u.height()*d/2,M=(1-H)*u.width()/2,L=1+G*d,J=u.width()/2;c(B,F,J,I,M,L,K,G*g,J,u.height(),v);if(s){y.show();s=false}A.clearRect(0,0,t.width(),t.height());A.fillStyle=\"rgba(0,0,0,\"+(g-G*g)+\")\";A.fillRect(K?J:0,0,t.width()/2,t.height());if(E==1){clearInterval(p)}},15)}}setTimeout(D,e)}}", "title": "" }, { "docid": "b3c47965c1a75e9bb3ec0817b438860f", "score": "0.53782076", "text": "cssToMatrix(elementId) {\n const element = document.getElementById(elementId),\n style = window.getComputedStyle(element)\n\n return style.getPropertyValue('-webkit-transform') ||\n style.getPropertyValue('-moz-transform') ||\n style.getPropertyValue('-ms-transform') ||\n style.getPropertyValue('-o-transform') ||\n style.getPropertyValue('transform')\n\n\t }", "title": "" }, { "docid": "0bd0885cc44b5c025dbf80c92741dc9b", "score": "0.5366111", "text": "_goTo3d (scale, translate, svgScale, svgTranslate) {\n const nScale = scale / svgScale\n const nTranslate = utils.c_minus_c(translate,\n utils.c_times_scalar(svgTranslate, nScale))\n const transform = ('translate(' + nTranslate.x + 'px,' + nTranslate.y + 'px) ' +\n 'scale(' + nScale + ')')\n this.css3TransformContainer.style('transform', transform)\n this.css3TransformContainer.style('-webkit-transform', transform)\n this.css3TransformContainer.style('transform-origin', '0 0')\n this.css3TransformContainer.style('-webkit-transform-origin', '0 0')\n }", "title": "" }, { "docid": "00bec8dd5e72c6e016add8ebf83da07d", "score": "0.5349423", "text": "function transformContainer(translate3d,animated){if(animated){addAnimation(container);}else{removeAnimation(container);}css(container,getTransforms(translate3d));FP.test.translate3d=translate3d;//syncronously removing the class after the animation has been applied.\nsetTimeout(function(){removeClass(container,NO_TRANSITION);},10);}", "title": "" }, { "docid": "158329240e074dbf482a5e98922a081c", "score": "0.5339758", "text": "function toO3D(n) {\n return n !== true ? n : false;\n} // Returns an element position", "title": "" }, { "docid": "11fa292c44c7dbba146186d2b4ff6648", "score": "0.5322618", "text": "function Awake()\n{\n myTransform = transform; //cache transform data for easy access/preformance\n}", "title": "" }, { "docid": "11fa292c44c7dbba146186d2b4ff6648", "score": "0.5322618", "text": "function Awake()\n{\n myTransform = transform; //cache transform data for easy access/preformance\n}", "title": "" }, { "docid": "c1cd1a26ca2cff23330db6621b43ed14", "score": "0.53139055", "text": "function getComputedTranslateXY(obj) {\n const transArr = [];\n if (!window.getComputedStyle) return;\n const style = getComputedStyle(obj),\n transform = style.transform || style.webkitTransform || style.mozTransform;\n let mat = transform.match(/^matrix3d\\((.+)\\)$/);\n if (mat) return parseFloat(mat[1].split(', ')[13]);\n mat = transform.match(/^matrix\\((.+)\\)$/);\n mat ? transArr.push(parseFloat(mat[1].split(', ')[4])) : 0;\n mat ? transArr.push(parseFloat(mat[1].split(', ')[5])) : 0;\n return transArr;\n}", "title": "" }, { "docid": "22c9a48b123b83cd62c91b970c9ee67d", "score": "0.52962893", "text": "function supportsTransforms() {\n var testStyle = document.createElement(\"dummy\").style, testProps = [\n \"transform\", \"WebkitTransform\", \"MozTransform\", \"OTransform\", \"msTransform\", \"KhtmlTransform\"\n ], i = 0;\n\n for (; i < testProps.length; i++) {\n if (testStyle[testProps[i]] !== undefined) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "3eadd7fe0e931335c524a8113f572239", "score": "0.5267733", "text": "decompose(scale, rotation, translation) {\n if (this._isIdentity) {\n if (translation) {\n translation.setAll(0);\n }\n if (scale) {\n scale.setAll(1);\n }\n if (rotation) {\n rotation.copyFromFloats(0, 0, 0, 1);\n }\n return true;\n }\n const m = this._m;\n if (translation) {\n translation.copyFromFloats(m[12], m[13], m[14]);\n }\n const usedScale = scale || preallocatedVariables_1$3.MathTmp.Vector3[0];\n usedScale.x = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);\n usedScale.y = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]);\n usedScale.z = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]);\n if (this.determinant() <= 0) {\n usedScale.y *= -1;\n }\n if (usedScale.x === 0 || usedScale.y === 0 || usedScale.z === 0) {\n if (rotation) {\n rotation.copyFromFloats(0.0, 0.0, 0.0, 1.0);\n }\n return false;\n }\n if (rotation) {\n // tslint:disable-next-line:one-variable-per-declaration\n const sx = 1 / usedScale.x, sy = 1 / usedScale.y, sz = 1 / usedScale.z;\n Matrix.FromValuesToRef(m[0] * sx, m[1] * sx, m[2] * sx, 0.0, m[4] * sy, m[5] * sy, m[6] * sy, 0.0, m[8] * sz, m[9] * sz, m[10] * sz, 0.0, 0.0, 0.0, 0.0, 1.0, preallocatedVariables_1$3.MathTmp.Matrix[0]);\n Quaternion_1$2.Quaternion.FromRotationMatrixToRef(preallocatedVariables_1$3.MathTmp.Matrix[0], rotation);\n }\n return true;\n }", "title": "" }, { "docid": "07a997188ef9f63746bfe23c047a6402", "score": "0.5261139", "text": "function preserveOriginalCRS(dataset, jsonObj) {\n var info = dataset.info || {};\n if (!info.crs && 'input_geojson_crs' in info) {\n // use input geojson crs if available and coords have not changed\n jsonObj.crs = info.input_geojson_crs;\n\n }\n\n // Removing the following (seems ineffectual at best)\n // else if (info.crs && !isLatLngCRS(info.crs)) {\n // // Setting output crs to null if coords have been projected\n // // \"If the value of CRS is null, no CRS can be assumed\"\n // // source: http://geojson.org/geojson-spec.html#coordinate-reference-system-objects\n // jsonObj.crs = null;\n // }\n}", "title": "" }, { "docid": "7ff43f84a4d3528b73bc838dadd3a67f", "score": "0.52565527", "text": "function toO3D(n) {\n return n !== true ? n : false;\n}", "title": "" }, { "docid": "afafa645bd35ce7701d9ceffa157aa98", "score": "0.52565444", "text": "function rotate3D(x, y, z, angles) {\n return {\n x: angles.cosB * x - angles.sinB * z,\n y: -angles.sinA * angles.sinB * x + angles.cosA * y - angles.cosB * angles.sinA * z,\n z: angles.cosA * angles.sinB * x + angles.sinA * y + angles.cosA * angles.cosB * z\n };\n} // Perspective3D function is available in global Highcharts scope because is", "title": "" }, { "docid": "fc83e4bc8ea8b9036ac3ab882baf4bc2", "score": "0.52523893", "text": "function converge() {\n\t\t\t\t\tshape.style.transition = 'all 0.75s linear';\n\t\t\t\t\tvar transform =\n\t\t\t\t\t\t'rotate(' + scope.shape.angle + 'deg) ' +\n\t\t\t\t\t\t'translate3d(0px, -' + shape.offsetWidth / 2 + 'px, 0px)';\n\t\t\t\t\tshape.style.transform = transform;\n\t\t\t\t\tshape.style.webkitTransform = transform;\n\t\t\t\t}", "title": "" }, { "docid": "56a56e9365b94cd53af8019419241414", "score": "0.5249466", "text": "resetTransform() {\n _wl_object_reset_translation_rotation(this.objectId);\n _wl_object_reset_scaling(this.objectId);\n }", "title": "" }, { "docid": "360277d018763d6c598b54be7a3d5047", "score": "0.5233473", "text": "toMatrix3d(result) {\n const rot = result !== undefined ? result : new Matrix3d_1.Matrix3d();\n const axisOrder = this.order;\n const x = this.xAngle, y = this.yAngle, z = this.zAngle;\n const a = x.cos();\n let b = x.sin();\n const c = y.cos();\n let d = y.sin();\n const e = z.cos();\n let f = z.sin();\n if (OrderedRotationAngles.treatVectorsAsColumns) {\n b = -b;\n d = -d;\n f = -f;\n }\n if (axisOrder === 0 /* XYZ */) {\n const ae = a * e, af = a * f, be = b * e, bf = b * f;\n rot.setRowValues(c * e, af + be * d, bf - ae * d, -c * f, ae - bf * d, be + af * d, d, -b * c, a * c);\n }\n else if (axisOrder === 5 /* YXZ */) {\n const ce = c * e, cf = c * f, de = d * e, df = d * f;\n rot.setRowValues(ce + df * b, a * f, cf * b - de, de * b - cf, a * e, df + ce * b, a * d, -b, a * c);\n }\n else if (axisOrder === 2 /* ZXY */) {\n const ce = c * e, cf = c * f, de = d * e, df = d * f;\n rot.setRowValues(ce - df * b, cf + de * b, -a * d, -a * f, a * e, b, de + cf * b, df - ce * b, a * c);\n }\n else if (axisOrder === 6 /* ZYX */) {\n const ae = a * e, af = a * f, be = b * e, bf = b * f;\n rot.setRowValues(c * e, c * f, -d, be * d - af, bf * d + ae, b * c, ae * d + bf, af * d - be, a * c);\n }\n else if (axisOrder === 1 /* YZX */) {\n const ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n rot.setRowValues(c * e, f, -d * e, bd - ac * f, a * e, ad * f + bc, bc * f + ad, -b * e, ac - bd * f);\n }\n else if (axisOrder === 4 /* XZY */) {\n const ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n rot.setRowValues(c * e, ac * f + bd, bc * f - ad, -f, a * e, b * e, d * e, ad * f - bc, bd * f + ac);\n }\n if (OrderedRotationAngles.treatVectorsAsColumns)\n rot.transposeInPlace();\n return rot;\n }", "title": "" }, { "docid": "b4df00604046e3f4f83621c55a1fe230", "score": "0.5213125", "text": "function handleOut2() {\r\n this.style.transform = 'initial';\r\n}", "title": "" }, { "docid": "e975596ffa7173e24a4b62c1fc15595d", "score": "0.5204767", "text": "function transform(el, value) {\n el.style['transform'] = value;\n el.style['webkitTransform'] = value;\n}", "title": "" }, { "docid": "b5436cc082a5073c60a4d95203d5c1b9", "score": "0.52040946", "text": "function trackTransforms(ctx) {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n let xform = svg.createSVGMatrix();\n ctx.getTransform = function () { return xform; };\n\n const savedTransforms = [];\n const { save } = ctx;\n ctx.save = function () {\n savedTransforms.push(xform.translate(0, 0));\n return save.call(ctx);\n };\n const { restore } = ctx;\n ctx.restore = function () {\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n const { scale } = ctx;\n ctx.scale = function (sx, sy) {\n xform = xform.scaleNonUniform(sx, sy);\n return scale.call(ctx, sx, sy);\n };\n const { rotate } = ctx;\n ctx.rotate = function (radians) {\n // eslint-disable-next-line no-mixed-operators\n xform = xform.rotate(radians * 180 / Math.PI);\n return rotate.call(ctx, radians);\n };\n const { translate } = ctx;\n ctx.translate = function (dx, dy) {\n xform = xform.translate(dx, dy);\n return translate.call(ctx, dx, dy);\n };\n const { transform } = ctx;\n ctx.transform = function (a, b, c, d, e, f) {\n const m2 = svg.createSVGMatrix();\n m2.a = a; m2.b = b; m2.c = c; m2.d = d; m2.e = e; m2.f = f;\n xform = xform.multiply(m2);\n return transform.call(ctx, a, b, c, d, e, f);\n };\n const { setTransform } = ctx;\n ctx.setTransform = function (a, b, c, d, e, f) {\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx, a, b, c, d, e, f);\n };\n const pt = svg.createSVGPoint();\n ctx.transformedPoint = function (x, y) {\n pt.x = x; pt.y = y;\n return pt.matrixTransform(xform.inverse());\n };\n }", "title": "" }, { "docid": "57bae10f23c208133d8b80ab479e0684", "score": "0.51986617", "text": "function _trackTransforms(ctx) {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n let xform = svg.createSVGMatrix();\n ctx.getTransform = () => xform;\n\n const savedTransforms = [];\n const save = ctx.save;\n ctx.save = () => {\n savedTransforms.push(xform.translate(0, 0));\n return save.call(ctx);\n };\n\n const restore = ctx.restore;\n ctx.restore = () => {\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n const scale = ctx.scale;\n ctx.scale = (sx, sy) => {\n xform = xform.scaleNonUniform(sx, sy);\n return scale.call(ctx, sx, sy);\n };\n\n const rotate = ctx.rotate;\n ctx.rotate = radians => {\n xform = xform.rotate(radians * 180 / Math.PI);\n return rotate.call(ctx, radians);\n };\n\n const translate = ctx.translate;\n ctx.translate = (dx, dy) => {\n xform = xform.translate(dx, dy);\n return translate.call(ctx, dx, dy);\n };\n\n const transform = ctx.transform;\n ctx.transform = (a, b, c, d, e, f) => {\n const m2 = svg.createSVGMatrix();\n m2.a = a;\n m2.b = b;\n m2.c = c;\n m2.d = d;\n m2.e = e;\n m2.f = f;\n xform = xform.multiply(m2);\n return transform.call(ctx, a, b, c, d, e, f);\n };\n\n const setTransform = ctx.setTransform;\n ctx.setTransform = (a, b, c, d, e, f) => {\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx, a, b, c, d, e, f);\n };\n\n const pt = svg.createSVGPoint(); // convert mouse pos on the screen to pos on canvas\n ctx.transformedPoint = (x, y) => {\n pt.x = x;\n pt.y = y;\n return pt.matrixTransform(xform.inverse());\n };\n\n ctx.clear = (preserveTransform = true) => {\n if (preserveTransform) {\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n\n if (preserveTransform) {\n ctx.restore();\n }\n };\n}", "title": "" }, { "docid": "b85cb07e5a549f6e603f40d2d5d3c536", "score": "0.51803994", "text": "function restoreTrans(tA) {\n for(var i=0; i<scene.nodes.count; i++){\n var nd=scene.nodes.getByIndex(i);\n if(tA[nd.name]) nd.transform.set(tA[nd.name]);\n }\n}", "title": "" }, { "docid": "88ec2f43a3f81b96eb9c929b683e2ba8", "score": "0.5177874", "text": "function convertToV3NoCombine (points2d) // points2d is an array of 2d polygons.\r\n{\r\n var points_all =[]; //THREE.js Vector3 array.\r\n var box = getDataRange(points2d);// for my own projection.\r\n for (var i=0; i< points2d.length; i++)\r\n {\r\n var points = [];\r\n for (var j=0; j<points2d[i].length; j++)\r\n {\r\n //var v3 = inv_stereo(points2d[i][j]);\r\n // var v3 = mapToOne4thSphere(points2d[i][j][0], points2d[i][j][1], box);\r\n var v3 = wrapOnSphere (points2d[i][j][0], points2d[i][j][1]);\r\n points.push(v3);\r\n }\r\n points_all.push(points);\r\n }\r\n return points_all;\r\n}", "title": "" }, { "docid": "33c6828391cbabb009db68b40895950f", "score": "0.51469934", "text": "function unmatrix(matrix) {\r\n\tvar\r\n\t\t\tscaleX\r\n\t\t, scaleY\r\n\t\t, skew\r\n\t\t, A = matrix[0]\r\n\t\t, B = matrix[1]\r\n\t\t, C = matrix[2]\r\n\t\t, D = matrix[3]\r\n\t\t;\r\n\r\n\t// Make sure matrix is not singular\r\n\tif ( A * D - B * C ) {\r\n\t\t// step (3)\r\n\t\tscaleX = Math.sqrt( A * A + B * B );\r\n\t\tA /= scaleX;\r\n\t\tB /= scaleX;\r\n\t\t// step (4)\r\n\t\tskew = A * C + B * D;\r\n\t\tC -= A * skew;\r\n\t\tD -= B * skew;\r\n\t\t// step (5)\r\n\t\tscaleY = Math.sqrt( C * C + D * D );\r\n\t\tC /= scaleY;\r\n\t\tD /= scaleY;\r\n\t\tskew /= scaleY;\r\n\t\t// step (6)\r\n\t\tif ( A * D < B * C ) {\r\n\t\t\tA = -A;\r\n\t\t\tB = -B;\r\n\t\t\tskew = -skew;\r\n\t\t\tscaleX = -scaleX;\r\n\t\t}\r\n\r\n\t// matrix is singular and cannot be interpolated\r\n\t} else {\r\n\t\t// In this case the elem shouldn't be rendered, hence scale == 0\r\n\t\tscaleX = scaleY = skew = 0;\r\n\t}\r\n\r\n\t// The recomposition order is very important\r\n\t// see http://hg.mozilla.org/mozilla-central/file/7cb3e9795d04/layout/style/nsStyleAnimation.cpp#l971\r\n\treturn [\r\n\t\t[_translate, [+matrix[4], +matrix[5]]],\r\n\t\t[_rotate, Math.atan2(B, A)],\r\n\t\t[_skew + \"X\", Math.atan(skew)],\r\n\t\t[_scale, [scaleX, scaleY]]\r\n\t];\r\n}", "title": "" }, { "docid": "63f687333ed7fa4ac7d5d4b6a8793039", "score": "0.5145699", "text": "function clientToLocal(el, e, out, calculate) {\n out = out || {};\n\n // According to the W3C Working Draft, offsetX and offsetY should be relative\n // to the padding edge of the target element. The only browser using this convention\n // is IE. Webkit uses the border edge, Opera uses the content edge, and FireFox does\n // not support the properties.\n // (see http://www.jacklmoore.com/notes/mouse-position/)\n // In zr painter.dom, padding edge equals to border edge.\n\n // FIXME\n // When mousemove event triggered on ec tooltip, target is not zr painter.dom, and\n // offsetX/Y is relative to e.target, where the calculation of zrX/Y via offsetX/Y\n // is too complex. So css-transfrom dont support in this case temporarily.\n if (calculate || !env.canvasSupported) {\n defaultGetZrXY(el, e, out);\n }\n // Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned\n // ancestor element, so we should make sure el is positioned (e.g., not position:static).\n // BTW1, Webkit don't return the same results as FF in non-simple cases (like add\n // zoom-factor, overflow / opacity layers, transforms ...)\n // BTW2, (ev.offsetY || ev.pageY - $(ev.target).offset().top) is not correct in preserve-3d.\n // <https://bugs.jquery.com/ticket/8523#comment:14>\n // BTW3, In ff, offsetX/offsetY is always 0.\n else if (env.browser.firefox && e.layerX != null && e.layerX !== e.offsetX) {\n out.zrX = e.layerX;\n out.zrY = e.layerY;\n }\n // For IE6+, chrome, safari, opera. (When will ff support offsetX?)\n else if (e.offsetX != null) {\n out.zrX = e.offsetX;\n out.zrY = e.offsetY;\n }\n // For some other device, e.g., IOS safari.\n else {\n defaultGetZrXY(el, e, out);\n }\n\n return out;\n}", "title": "" }, { "docid": "65e37050b7ddc9080be941ba57b1f812", "score": "0.51455164", "text": "function Awake()\n {\n myTransform = transform; //cache transform data for easy access/preformance\n }", "title": "" }, { "docid": "23fc4e45c65f11765508bec56a7697ec", "score": "0.5127236", "text": "function transform(el, value) {\n el.style['transform'] = value;\n el.style['webkitTransform'] = value;\n}", "title": "" }, { "docid": "ce27754db68fec30a85e5edbb9390524", "score": "0.51204723", "text": "transform(a) {\n const x = a.x * this.m11 + a.y * this.m21 + a.z * this.m31;\n const y = a.x * this.m12 + a.y * this.m22 + a.z * this.m32;\n const z = a.x * this.m13 + a.y * this.m23 + a.z * this.m33;\n return new Vec3(x, y, z);\n }", "title": "" } ]
19d7c4817d22837e50d8e106c22b6e63
display an overview above the overview table
[ { "docid": "a91d03c3277a72956582af9b7277abdd", "score": "0.0", "text": "function display_overview() {\n const overview_tag = document.getElementsByClassName('breadcrumb')[0];\n const regex = /[A-Z]+[0-9]+/g;\n var subject = \"\";\n var catalog = \"\";\n for (var link_tag of overview_tag.getElementsByTagName('a')) {\n const match_result = link_tag.innerText.match(regex);\n if (match_result) {\n subject = link_tag.innerText.match(/[A-Z]+/g)[0];\n catalog = link_tag.innerText.match(/[0-9]+/g)[0];\n }\n }\n\n if (subject && catalog) {\n update_total_students(subject, catalog);\n }\n}", "title": "" } ]
[ { "docid": "9df367669369a7a20109b3874a0fdb24", "score": "0.7514685", "text": "function displayOverview(){\n\t\tvar overviewText = '<h1>Bracketball Overview</h1><br>This is the early version of the bracketball site. The UI is very basic. To the left is the nav bar, the only current working links are bracket and the links for the league pages. On the leauge page it will show a bracket with highlighting based on team ownership. Also there is a table to view who owns which teams, click on the various users to see. And finally is a score table tabulating current results.';\n\t \t$(\"div#maincontent-wrapper\").html(overviewText);\n\t \t$(\"div#draftStatusWrapper\").hide();\n\t \t//createDraftedTeamsTable(2,10);\n\t}", "title": "" }, { "docid": "6fb4077f3c9a8070df47e18ac0353811", "score": "0.67256564", "text": "function displayOverview(){\n toggleFocus(document.getElementById('menu-overview'));\n\n var trophies = User[0].trophies; \n\n var header = '<p class=\"overview-title\">' + User.name + '</p>'\n + '<div id=\"overview-stats\"><p class=\"overview-stats-title\">Quick Stats:</p>'\n + '<table><tr class=\"overview-details\"><td>Comment Karma: </td><td>' + User.commentKarma + ' points</td></tr>'\n + '<tr class=\"overview-details\"><td>Link Karma: </td><td>' + User.linkKarma + ' points</td></tr>' \n + '<tr class=\"overview-details\"><td>Member since: </td><td>' + User.memberSince.substr(0, 10) + '</td></tr>'\n + '<tr class=\"overview-details\"><td>Post count: </td><td>' + User.postCount + '</td></tr></table></div>';\n \n var trophyText = '';\n if(trophies !== null){\n trophyText += '<div id=\"trophies\"><p class=\"trophy-title\">Trophies:</p>';\n \n for(var i = 0; i < trophies.length; i++){\n trophyText += '<p class=\"trophy\">' + trophies[i] + '</p>';\n }\n\n trophyText += '</div>';\n }\n\n var worstTitle = '<div style=\"clear:both\"></div><p class=\"overview-heading\">Posts with least karma</p>';\n\n var worstPosts = '';\n var i = 0;\n while(User.worstPosts[i] !== undefined){\n var temp = loadPost(User.worstPosts[i].postType, User.worstPosts[i]);\n worstPosts += formatSinglePost(temp);\n\n i++;\n }\n\n var bestTitle = '<p class=\"overview-heading\">Posts with most karma</p>';\n\n var bestPosts = '';\n var i = 0;\n while(User.bestPosts[i] !== undefined){\n var temp = loadPost(User.bestPosts[i].postType, User.bestPosts[i]);\n bestPosts += formatSinglePost(temp);\n\n i++;\n }\n\n document.getElementById('overview-page').innerHTML = header + trophyText + worstTitle + worstPosts + bestTitle + bestPosts;\n}", "title": "" }, { "docid": "4df8a678ea9102fc33b84654fb8ad8a9", "score": "0.62623954", "text": "function showOverview() {\n var controllerElements = document.getElementsByClassName('controller');\n for (let i = 0; i < controllerElements.length; i++) {\n controllerElements[i].style.display = 'none';\n }\n document.getElementById('infotitle').innerHTML = '';\n document.getElementById('infobody').innerHTML = '';\n document.getElementById('viewportbody').style.display = 'block';\n document.getElementById('viewporthead').style.display = 'block';\n document.getElementById('rightbox').style.display = 'block';\n}", "title": "" }, { "docid": "ff3ae0577ea56a5421ef0e587e4bf7ba", "score": "0.6203818", "text": "set_table_display() {\n T.table_chart_handler(\"table\")\n }", "title": "" }, { "docid": "0791f7a9864718abfbd6fc9cd9183c2a", "score": "0.6102003", "text": "function showStatisticsGrid() {\n\tView.panels.get('abSpHlRmByAttribute_rmSummary1').show(false);\n\tView.panels.get('abSpHlRmByAttribute_rmSummary2').show(false);\n\tView.panels.get('abSpHlRmByAttribute_rmSummary3').show(false);\n\tView.panels.get('abSpHlRmByAttribute_rmSummary4').show(false);\n\tView.panels.get('abSpHlRmByAttribute_rmSummary5').show(false);\n\tView.panels.get('abSpHlRmByAttribute_rmSummary6').show(false);\n\tView.panels.get('abSpHlRmByAttribute_rmSummary7').show(false);\n\tView.panels.get('abSpHlRmByAttribute_rmSummary8').show(false);\n\tvar grid = getGridFromDrawingHighlight(View.panels.get('abSpHlRmByAttribute_floorPlan').currentHighlightDS);\n\tif(grid){\n\t\tgrid.show(true);\n\t\tgrid.addParameter('blId', controller.blId);\n\t\tgrid.addParameter('flId', controller.flId);\n\t\tgrid.refresh();\n\t}\n}", "title": "" }, { "docid": "bc6dd1678645dc5944b1e4db6bba371b", "score": "0.6085325", "text": "function showStatistics() {\r\n initTab();\r\n document.getElementById(\"statistics-button\").style.color = \"#999999\";\r\n document.title = \"Sundial Control Panel | Statistics\";\r\n document.getElementById(\"pagename\").innerHTML = \"Statistics\";\r\n\r\n var content =\r\n \"<table width='100%'>\\\r\n <tr>\\\r\n <td id='online-title'>Online Teams\\\r\n <table id='online-teams-title'>\\\r\n <tr>\\\r\n <td class='statistics-event-title'>Event</td>\\\r\n <td class='statistics-team-title'>Team #</td>\\\r\n <td class='statistics-time-online-title'>Time Online</td>\\\r\n </tr>\\\r\n </table>\\\r\n <div id='online-teams-scroll'></div>\\\r\n </div>\\\r\n <table id='total-table-left' width='100%'>\\\r\n <tr>\\\r\n <td width='50%'>Total Online Teams:</td>\\\r\n <td id='total-online-teams' width='50%'></td>\\\r\n </tr>\\\r\n <tr>\\\r\n <td width='50%'>Total Teams:</td>\\\r\n <td id='total-teams' width='50%'></td>\\\r\n </tr>\\\r\n </table>\\\r\n </td>\\\r\n <td id='offline-title'>Offline Teams\\\r\n <table id='offline-teams-title'>\\\r\n <tr>\\\r\n <td class='statistics-event-title'>Event</td>\\\r\n <td class='statistics-team-title'>Team #</td>\\\r\n <td class='statistics-time-online-title'>Time Online</td>\\\r\n </tr>\\\r\n </table>\\\r\n <div id='offline-teams-scroll'></div>\\\r\n </div>\\\r\n <table id='total-table-right' width='100%'>\\\r\n <tr>\\\r\n <td width='50%'>Total Offline Teams:</td>\\\r\n <td id='total-offline-teams' width='50%'></td>\\\r\n </tr>\\\r\n <tr>\\\r\n <td width='50%'>Total Accesses:</td>\\\r\n <td id='total-accesses' width='50%'></td>\\\r\n </tr>\\\r\n </table>\\\r\n </td>\\\r\n </tr>\\\r\n </table>\\\r\n <div align='center' style='width: 100%;'>\\\r\n <input id='clear-statistics-button' type='button' value='Clear Statistics'\\\r\n onClick='clearStatistics()' />\\\r\n </div>\";\r\n document.getElementById(\"content\").innerHTML = content;\r\n\r\n\r\n registerServerUpdate(getStatistics);\r\n\r\n function getStatistics() {\r\n var statisticsCallback = function(response) {\r\n var onlineTeams = response.onlineTeams;\r\n var onlineTeamsScroll = \"<table id='online-teams-table' cellspacing='0'>\";\r\n for (var i = 0; i < onlineTeams.length; i++) {\r\n onlineTeamsScroll +=\r\n \"<tr>\\\r\n <td class='statistics-event'>\" + onlineTeams[i].event + \"</td>\\\r\n <td class='statistics-team'>\" + onlineTeams[i].team + \"</td>\\\r\n <td class='statistics-time-online'>\" + onlineTeams[i].timeOnline + \"</td>\\\r\n </tr>\";\r\n }\r\n onlineTeamsScroll += \"</table>\";\r\n document.getElementById(\"online-teams-scroll\").innerHTML = onlineTeamsScroll;\r\n\r\n var offlineTeams = response.offlineTeams;\r\n var offlineTeamsScroll = \"<table id='offline-teams-table' cellspacing='0'>\";\r\n for (var i = 0; i < offlineTeams.length; i++) {\r\n offlineTeamsScroll +=\r\n \"<tr>\\\r\n <td class='statistics-event'>\" + offlineTeams[i].event + \"</td>\\\r\n <td class='statistics-team'>\" + offlineTeams[i].team + \"</td>\\\r\n <td class='statistics-time-online'>\" + offlineTeams[i].timeOnline + \"</td>\\\r\n </tr>\";\r\n }\r\n offlineTeamsScroll += \"</table>\";\r\n document.getElementById(\"offline-teams-scroll\").innerHTML = offlineTeamsScroll;\r\n\r\n document.getElementById(\"total-online-teams\").innerHTML = response.totalOnlineTeams;\r\n document.getElementById(\"total-offline-teams\").innerHTML = response.totalOfflineTeams;\r\n document.getElementById(\"total-teams\").innerHTML = response.totalTeams;\r\n document.getElementById(\"total-accesses\").innerHTML = response.totalAccesses;\r\n\r\n globals.currentTab = 3;\r\n resizeStatistics();\r\n }\r\n doXmlHttp(\"action.php?action=admin_statistics\", statisticsCallback);\r\n }\r\n}", "title": "" }, { "docid": "1324e7964b52e0074b59692cbd97a889", "score": "0.60562557", "text": "function mySoftwareShow() {\r\n displayTableSegment(\"softwarems\", this.m_head);\r\n}", "title": "" }, { "docid": "c35d55dadadaa842338eefb2eb1dbb43", "score": "0.6039303", "text": "function showAlfrescoNormalView(){\n alfrescoTabelle.settings().init().iconView = false;\n viewMenuNormal.children('li:first').superfish('hide');\n alfrescoTabelle.column(0).visible(true);\n alfrescoTabelle.column(1).visible(true);\n alfrescoTabelle.column(2).visible(false);\n //alfrescoLayout.children.center.alfrescoCenterInnerLayout.children.center.alfrescoCenterCenterInnerLayout.show(\"north\");\n resizeTable(\"alfrescoCenterCenterCenter\", \"dtable2\", \"alfrescoTabelle\", \"alfrescoTabelleHeader\", \"alfrescoTableFooter\");\n}", "title": "" }, { "docid": "5bf306ddd2c0a688f85f07c9b94e0fb1", "score": "0.60361534", "text": "function buildOverview(teamNo) {\n\tlet section = \"<div class=\\\"overview-header\\\">Show Data For:</div>\";\n\t\tsection += \"<div class=\\\"overview-options\\\">\";\n\t\t\n\t\t//Our options for display. first indice is name, second indice is value.\n\t\tlet types = [\n\t\t\t[\"All Matches\", \"all\"],\n\t\t\t[\"Past Three Matches\", \"past-three\"],\n\t\t\t[\"Gainesville\", \"gainesville\"],\n\t\t\t[\"Tippecanoe\", \"tippecanoe\"]\n\t\t]\n\t\t\n\t\tfor (let i = 0; i < types.length; i++) {\n\t\t\tsection += \"<div class=\\\"display-option\\\">\";\n\t\t\t\tsection += \"<div class=\\\"display-header\\\">\"+types[i][0]+\"</div>\";\n\t\t\t\tsection += \"<input type=\\\"radio\\\" class=\\\"display\\\" name=\\\"\"+teamNo+\"-display\\\" value=\\\"\"+types[i][1]+\"\\\"\";\n\t\t\t\t//first element always checked\n\t\t\t\tsection += (i == 0) ? \" checked>\" : \">\";\n\t\t\tsection += \"</div>\";\n\t\t}\n\t\tsection += \"</div>\";\n\treturn section;\n}", "title": "" }, { "docid": "4730ff824c6a02df8dadf0b77b864b42", "score": "0.59938306", "text": "function showAllData(working_set, typ, index){\n console.log(\"Showing data for \" + typ + \",\" + index);\n var aData = null;\n var ws = working_set;//easier\n if(typ == \"analysis\"){\n //show the entry data alongside collection data\n if(index !== null){\n //show only one\n aData = new Array(ws[\"analysis\"][index]);\n }\n else{\n aData = ws[\"analysis\"];\n }\n }\n\n var cData = ws[\"data\"];\n //build the top row\n var thead = $(\"<tr><th>Index</th></tr>\");\n for(var f in ws[\"meta\"]){\n if(ws[\"meta\"].hasOwnProperty(f)){\n thead.append(\"<th>\" + f + \"</th>\");\n }\n }\n\n //add heading for every analysis\n if(aData){\n console.log(aData);\n for(var i = 0; i < aData.length; i++){\n for(var f in aData[i][\"entry_meta\"]){\n if(aData[i][\"entry_meta\"].hasOwnProperty(f)){\n thead.append(\"<th class='a'>\" + f + \"</th>\");\n }\n }\n }\n }\n\n var tbody = $(\"<tbody></tbody>\");\n for(var i = 0; i < cData.length; i++){\n var row = $(\"<tr><td> \" + i + \"</td></tr>\");\n for(var f in ws[\"meta\"]){\n if(ws[\"meta\"].hasOwnProperty(f)){\n row.append(\"<td>\" + cData[i][f] + \"</td>\");\n }\n }\n if(aData){\n for(var j = 0; j < aData.length; j++){\n for(var f in aData[j][\"entry_meta\"]){\n if(aData[j][\"entry_meta\"].hasOwnProperty(f)){\n row.append(\"<td class='a'>\" + aData[j][\"entry_analysis\"][f][i] + \"</td>\");\n }\n }\n }\n }\n tbody.append(row);\n }\n\n //now add rows\n var html = $(\"<table></table>\").empty().append(thead).append(tbody);\n UI.overlay(html, \"data\", \"Your Data\");\n }", "title": "" }, { "docid": "bd8d7d041243578748da189376839d85", "score": "0.59643817", "text": "function viewIssues()\n\t{\n\t\tdocument.getElementById(\"issuesTable\").style.display = \"table\";\n\t}", "title": "" }, { "docid": "52fcdd472345282372002eeb7371a89a", "score": "0.5953486", "text": "function details() {\n content();\n //E.elements.content.fullDetailSite.show();\n E.display.content.menu.resultSettings.hideResultSettings();\n E.elements.content.list.empty();\n E.display.content.menu.showBack();\n E.refresher.unbind();\n }", "title": "" }, { "docid": "861c1814365adf3f1efa07eac748e9b4", "score": "0.59223425", "text": "function initialDisplay() {\n fileToString(displayTable);\n}", "title": "" }, { "docid": "b3f6b6035a04ffdc5ce38a333f008828", "score": "0.59209317", "text": "function displaySubDetails(data, index, img, headerList, columnList) {\n var json = JSON.parse(data.d);\n //var col = headerList;\n var col = columnList;\n\n var table = document.createElement(\"table\");\n\n var tr = table.insertRow(-1); // TABLE ROW.\n\n for (var i = 0; i < headerList.length; i++) {\n var th = document.createElement(\"td\"); // TABLE HEADER.\n th.innerHTML = headerList[i];\n th.style.borderBottom = \"1px solid #ccc\";\n th.style.backgroundColor = \"#3B6AA0\";\n th.style.color = \"#fff \";\n tr.appendChild(th);\n }\n\n // ADD JSON DATA TO THE TABLE AS ROWS.\n //console.log(\"json: \" + JSON.stringify(json));\n for (var i = 0; i < json.length; i++) {\n tr = table.insertRow(-1);\n\n for (var j = 0; j < col.length; j++) {\n var tabCell = tr.insertCell(-1);\n tabCell.style.borderBottom = \"1px solid #ccc\";\n //console.log(\"json[i][col[j]]: \" + json[i][col[j]]);\n tabCell.innerHTML = json[i][col[j]];\n }\n }\n table.className = \"dummy\" + index;\n $(table).insertAfter(img);\n img.src = \"../images/uparrow.jpg\";\n img.onerror = function () {\n img.src = \"images/uparrow.jpg\";\n }\n}", "title": "" }, { "docid": "d527b917fed41aed01f5758750027217", "score": "0.58950967", "text": "function redraw_overview()\n{\n if (mapview_slide['active']) return;\n\n bmp_lib.render('overview_map', \n generate_overview_grid(map['xsize'], map['ysize']), \n palette);\n}", "title": "" }, { "docid": "e5bd05e26398d7266f1f17b819348e63", "score": "0.5894215", "text": "function displayTableHeader() {\n var rowElement = row(column('Locations','th'));\n //render the hours\n for(var i = 0; i < hours.length; i++){\n rowElement.appendChild(column(hours[i],'th'));\n }\n //render the column daily location total\n rowElement.appendChild(column('Location total','th'));\n selectCookies.appendChild(rowElement);\n}", "title": "" }, { "docid": "32851bbacc6452be9d60ab8a0c6553bf", "score": "0.58938324", "text": "function displayTable(element){\n\n\t\tif(andiCheck.wereComponentsFound(elementData)){\n\t\t\t//add table rows for components found\n\t\t\tandiBar.appendRow(\"legend\",\t\t\t\telementData.legend);\n\t\t\tandiBar.appendRow(\"figcaption\",\t\t\telementData.figcaption);\n\t\t\tandiBar.appendRow(\"caption\",\t\t\telementData.caption);\n\t\t\t\n\t\t\tandiBar.appendRow(\"aria-labelledby\",\telementData.ariaLabelledby,false,true);\n\t\t\tandiBar.appendRow(\"aria-label\",\t\t\telementData.ariaLabel);\n\t\t\t\n\t\t\tandiBar.appendRow(\"label\",\t\t\t\telementData.label,false,true);\n\t\t\tandiBar.appendRow(\"alt\",\t\t\t\telementData.alt);\n\t\t\tandiBar.appendRow(\"value\",\t\t\t\telementData.value);\n\t\t\tandiBar.appendRow(\"innerText\",\t\t\telementData.innerText);\n\t\t\tandiBar.appendRow(\"child&nbsp;element\",\telementData.subtree);\n\t\t\tandiBar.appendRow(\"imageSrc\",\t\t\telementData.imageSrc);\n\t\t\tandiBar.appendRow(\"placeholder\",\t\telementData.placeholder);\n\n\t\t\tandiBar.appendRow(\"aria-describedby\",\telementData.ariaDescribedby,false,true);\n\t\t\tandiBar.appendRow(\"title\",\t\t\t\telementData.title);\n\t\t\t\n\t\t\t//add table rows for add-on properties found\n\t\t\tif(elementData.addOnPropertiesTotal != 0){\n\t\t\t\tandiBar.appendRow(\"role\",\t\t\telementData.addOnProperties.role, true);\n\t\t\t\tandiBar.appendRow(\"accesskey\",\t\telementData.addOnProperties.accesskey, true);\n\t\t\t\tandiBar.appendRow(\"tabindex\",\t\telementData.addOnProperties.tabindex, true);\n\t\t\t\tandiBar.appendRow(\"aria-controls\",\telementData.addOnProperties.ariaControls, true);\n\t\t\t\tandiBar.appendRow(\"aria-disabled\",\telementData.addOnProperties.ariaDisabled, true);\n\t\t\t\tandiBar.appendRow(\"aria-expanded\",\telementData.addOnProperties.ariaExpanded, true);\n\t\t\t\tandiBar.appendRow(\"aria-haspopup\",\telementData.addOnProperties.ariaHaspopup, true);\n\t\t\t\tandiBar.appendRow(\"aria-invalid\",\telementData.addOnProperties.ariaInvalid, true);\n\t\t\t\tandiBar.appendRow(\"readonly\",\t\telementData.addOnProperties.readonly, true);\n\t\t\t\tandiBar.appendRow(\"aria-readonly\",\telementData.addOnProperties.ariaReadonly, true);\n\t\t\t\tandiBar.appendRow(\"required\",\t\telementData.addOnProperties.required, true);\n\t\t\t\tandiBar.appendRow(\"aria-required\",\telementData.addOnProperties.ariaRequired, true);\n\t\t\t\tandiBar.appendRow(\"aria-sort\",\t\telementData.addOnProperties.ariaSort, true);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "90fc7def79c6bcfa2f6a45cd6ad9e325", "score": "0.5893812", "text": "function _displayTable(url, clzName, tableHeader, btns, searchItems) {\n $(clzName).flexigrid({\n url : url,\n dataType : 'xml',\n colModel : tableHeader,\n buttons : btns,\n searchitems : searchItems,\n sortname : \"iso\",\n sortorder : \"asc\",\n usepager : true,\n title : 'Countries',\n useRp : true,\n rp : 15,\n showTableToggleBtn : true,\n width : '100%',\n height : 300\n });\n\n \n}", "title": "" }, { "docid": "ea0507c964da3ee0d5eac457b9359be8", "score": "0.58619463", "text": "function viewTable(whichTable) {\n\n connection.query(\"SELECT * FROM our_workplace.\" + whichTable, function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "title": "" }, { "docid": "508f93f387fc5cac5e09e8020c7a3086", "score": "0.5852648", "text": "function showTableView(breakDownType,dataAll){\n\t\tvar view = this;\n\t\tvar $e = view.$el;\n\t\tvar reportType = view.reportType;\n\t\tvar $sectionDisEngagement = $e.find(\".sectionDisEngagementTable\")\n\t\t\n\t\tif(typeof dataAll == \"undefined\" || typeof dataAll.data == \"undefined\" || typeof dataAll.summary == \"undefined\" ){\n\t\t\t$sectionDisEngagement.html(\"\");\n\t\t\t$sectionDisEngagement.append(\"<div class='noData'>No Data!</div>\");\n\t\t}else{\n\t\t\t$sectionDisEngagement.html(\"<span class=\\\"report-rendering-gif\\\">&nbsp;</span><span style='margin-left:5px;'>Rendering chart...</span>\");\n\t\t\tvar data = dataAll.data;\n\t\t\tvar dataSummary = dataAll.summary;\n\t\t\t\n\t\t\tshowSummary.call(view,breakDownType,\"table\",dataSummary);\n\t\t\t\n\t\t\tif(reportType == smr.REPORT_TYPE.TRANSACTIONAL){\n\t\t\t\tvar tableDataInfo ={\n\t\t\t\t\t\ttableColumns: [\n\t\t\t {name:\"complaints\",label:\"Complaints\"},\n\t\t\t {name:\"complaints\",label:\"Complaint Rate\",isRate:true}\n\t\t ],\n\t\t\t\t\t\ttableData:[],\n\t\t\t\t\t\treportType:reportType,\n\t\t\t\t\t\tmaxSize:100\n\t\t\t\t\t};\n\t\t\t}else{\n\t\t\t\tvar tableDataInfo ={\n\t\t\t\t\t\ttableColumns: [\n\t\t\t {name:\"unsub\",label:\"Unsubs\"},\n\t\t\t {name:\"complaints\",label:\"Complaints\"},\n\t\t\t {name:\"unsub\",label:\"Unsub Rate\",isRate:true},\n\t\t\t {name:\"complaints\",label:\"Complaint Rate\",isRate:true}\n\t\t ],\n\t\t\t\t\t\ttableData:[],\n\t\t\t\t\t\treportType:reportType,\n\t\t\t\t\t\tmaxSize:40\n\t\t\t\t\t};\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//change the column when different breakDownType\n\t\t\ttableDataInfo = smr.addTableColumn(tableDataInfo,breakDownType);\n\t\t\t\n\t\t\tvar countStr = \"unique\";\n\t\t\tvar rateStr = \"uniqueRate\";\n\t\t\tif(breakDownType==\"target\" || breakDownType==\"domain\"){\n\t\t\t\tcountStr = \"count\";\n\t\t\t\trateStr = \"rate\";\n\t\t\t}\n\t\t\t\n\t\t\tfor(var i = 0; i < data.length; i++){\n\t\t\t\tvar rowData = data[i];\n\t\t\t\tif(rowData){\n\t\t\t\t\tvar resultData = {};\n\t\t\t\t\tif(reportType == smr.REPORT_TYPE.BATCH){\n\t\t\t\t\t\tresultData = {\n\t\t\t\t\t\t\t\"Unsubs\": smr.checkNumber(rowData.unsub[countStr]),\n\t\t\t\t\t \t\t\"Complaints\": smr.checkNumber(rowData.complaints[countStr]), \n\t\t\t \t\t\t\t\"Unsub Rate\": smr.checkNumber(rowData.unsub[rateStr]),\n\t\t\t \t\t\t\t\"Complaint Rate\": smr.checkNumber(rowData.complaints[rateStr])\n\t\t\t\t\t\t};\n\t\t\t\t\t}else if(reportType == smr.REPORT_TYPE.TRANSACTIONAL){\n\t\t\t\t\t\tif(breakDownType==\"target\" || breakDownType==\"domain\"){\n\t\t\t\t\t\t\tresultData = {\n\t\t\t\t\t\t\t\t\t\"Complaints\": smr.checkNumber(rowData.complaints.count),\n\t\t\t\t\t\t\t\t\t\"Complaint Rate\": smr.checkNumber(rowData.complaints.rate)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tresultData = {\n\t\t\t\t\t\t\t\t\t\"Complaints\": smr.checkNumber(rowData.uniqueComplaints.count),\n\t\t\t\t\t\t\t\t\t\"Complaint Rate\": smr.checkNumber(rowData.uniqueComplaints.rate)\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\tif(breakDownType==\"target\" || breakDownType==\"domain\"){\n\t\t\t\t\t\t\tresultData = {\n\t\t\t\t\t\t\t\t\"Unsubs\": smr.checkNumber(rowData.unsubs.count),\n\t\t\t\t\t\t\t\t\"Complaints\": smr.checkNumber(rowData.complaints.count),\n\t\t\t\t \t\t\t\t\"Unsub Rate\": smr.checkNumber(rowData.unsubs.rate),\n\t\t\t\t \t\t\t\t\"Complaint Rate\": smr.checkNumber(rowData.complaints.rate)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tresultData = {\n\t\t\t\t\t\t\t\t\"Unsubs\": smr.checkNumber(rowData.uniqueUnsubs.count),\n\t\t\t\t\t\t\t\t\"Complaints\": smr.checkNumber(rowData.uniqueComplaints.count),\n\t\t\t\t \t\t\t\t\"Unsub Rate\": smr.checkNumber(rowData.uniqueUnsubs.rate),\n\t\t\t\t \t\t\t\t\"Complaint Rate\": smr.checkNumber(rowData.uniqueComplaints.rate)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//add the column data\n\t\t\t\t\tresultData = smr.addTableColumnData(resultData,rowData,breakDownType,reportType);\n\t\t\t\t\t\n\t\t\t\t\ttableDataInfo.tableData.push(resultData);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar title = smr.buildTitleValue(breakDownType);\n\t\t\ttableDataInfo.title=\"Dis-Engagement by \"+title;\n\t\t\ttableDataInfo.smaclass=\"SMA-REPORT-DISENGAGEMENTDATATABLE\";\n\t\t\tbrite.display(\"dataTable\",$e.find(\".sectionDisEngagementTable\"),tableDataInfo);\t\n\t\t}\n\t}", "title": "" }, { "docid": "5a200abe3cdb82936369d2b8459e7701", "score": "0.58401334", "text": "function viewTitles() {\n let sql = \"Select * from tblRole;\";\n connection.query(sql, (err, res) => {\n if (err) throw err;\n //line break to keep things spaced out\n console.log(\"\\n\");\n console.table(asTable(res));\n //line break to keep things spaced out\n console.log(\"\\n\");\n programStart();\n });\n}", "title": "" }, { "docid": "e71addd9558f39e94e62e7181548dc56", "score": "0.5831198", "text": "function TableTop() {\n}", "title": "" }, { "docid": "1717ea68e33e7cb16ee89b9622da3744", "score": "0.5830333", "text": "function show(parent) {\n\tvar plus = document.getElementById(parent + \"_plus\");\n\tvar minus = document.getElementById(parent + \"_minus\");\n\tvar desc = document.getElementById(parent + \"_desc\");\n\t\n\tif(minus == null) {\n\t updateTableList(parent, false);\t\n\t return;\n\t}\n\t\t\t\t\n\tplus.style.display=\"none\";\n\tminus.style.display = \"inline\";\n\tdesc.style.display = \"block\";\n\tupdateTableList(parent, true);\n }", "title": "" }, { "docid": "7df03a3defa4373a2294efd832364e87", "score": "0.5828734", "text": "function onClickOverview(element){\n\t// Hides alerts\n\t$(\"#singleCollaboratorPlot\").hide();\n\t$(\"#collaboratorAlert\").hide();\n\t$(\"#noResultAlert\").hide();\n\tif(noMoodAndProdResult == true){\n\t\t// There are no rilevant overlapping betweet Activity Bubbles and Tweet ones for all collaborators\n\t\t$(\"#overviewPlot\").hide();\n\t\t$(\"#noMoodOverviewAlert\").show();\n\t} else {\n\t\t// There is at least a data set to draw plot\n\t\t$(\"#noMoodOverviewAlert\").hide();\n\t\t$(\"#overviewPlot\").show();\n\t}\n\t// Sets overview as selected\n\t$(element.parentNode).siblings().removeClass(\"active\");\n\t$(element.parentNode).addClass(\"active\");\n}", "title": "" }, { "docid": "efa0ad0b3ccd0bed285787e6ba9545f8", "score": "0.58021873", "text": "function overview(){\n \n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();//.getActiveSpreadsheet();\n var sheet = spreadsheet.getSheetByName('Overview');\n sheet.activate();\n spreadsheet.moveActiveSheet(1);\n}", "title": "" }, { "docid": "ac5a0f9d609233fc80786d8c3209c219", "score": "0.5794263", "text": "function myStartupGrItemsShow() {\r\n displayTableSegment(\"startupGr\", this.m_head);\r\n}", "title": "" }, { "docid": "355aed3ff645c8d8d7dae5356fc336de", "score": "0.57759", "text": "function displayItemDetails() {\n\n var displayTable = $(\"<table>\");\n\n var mailbox = Office.context.mailbox;\n displayTable.append(createRow(\"Mailbox Owner:\", mailbox.userProfile.displayName));\n displayTable.append(createRow(\"Mailbox Timezone:\", mailbox.userProfile.timeZone));\n displayTable.append(createRow(\"EWS Url:\", mailbox.ewsUrl));\n\n var item = Office.cast.item.toItemRead(Office.context.mailbox.item);\n displayTable.append(createRow(\"Item Type:\", item.itemType));\n\n if (item.itemType === Office.MailboxEnums.ItemType.Message) {\n displayTable.append(createRow(\"Subject:\", item.subject));\n displayTable.append(createRow(\"To:\", item.to[0].displayName));\n displayTable.append(createRow(\"From:\", item.from.displayName));\n }\n\n if (item.itemType === Office.MailboxEnums.ItemType.Appointment) {\n\n displayTable.append(createRow(\"Organizer:\", item.organizer.displayName));\n displayTable.append(createRow(\"Start time:\", item.start));\n }\n\n $(\"#results\").empty();\n $(\"#results\").append(displayTable);\n }", "title": "" }, { "docid": "61e9726573b2572be2ac802a0024e013", "score": "0.57607543", "text": "function showList() {\n\tFoodList = getList(\"/food\");\n\tshowTable(FoodList, 'food');\n}", "title": "" }, { "docid": "ab6c8da0c18a0606c94518964f3aa325", "score": "0.5760363", "text": "function showBucketlistOverview(req, res) {\n\n\tres.render('pages/bucketlist/bucketlistOverview', {\n\t\ttitle: 'bucketlist',\n\t});\n}", "title": "" }, { "docid": "4072775fe543dbb07ce4f4b1b443ea15", "score": "0.5758864", "text": "function show(row, description)\n{\n\t// Now the details have been stored, we can hide it from view\n\trow.children(\"td\").first().next().children(\"a\").text(description);\n\trow.children(\"td\").first().next().children(\"a\").(\"color\", \"rgb(9, 127, 201)\");\n\trow.children(\"td\").first().children(\"a\").text(\"Hide\");\n\trow.data(\"visible\", \"true\");\n}", "title": "" }, { "docid": "0c928cf008779d49c687a4f214e8ab61", "score": "0.5758043", "text": "function show(){\n\n\tAlloy.Globals.ActualContainer = $.viewContainer;\n\tAlloy.Globals.Header.children[0].children[1].text = L('text_17');\n\t\n\tloadHotelDetail();\n\n}", "title": "" }, { "docid": "80c0a240b9a0babc334ce7f33fbd8b17", "score": "0.5751616", "text": "function showTable(myTable) {\n\n\t\t selection = d3.select(\"#ufo-table\").select(\"tbody\").selectAll(\"tr\").data(myTable);\n\n\t\t selection.enter() // creates placeholder for new data\n\t\t .append(\"tr\") // appends a tr to placeholder\n\t\t .merge(selection)\n\t\t .html(function(d) {\n\t\t return `<td>${d.datetime}</td> <td>${d.city}</td> <td>${d.state}</td> <td>${d.country}</td> \n\t\t \t\t <td>${d.shape}</td> <td>${d.durationMinutes}</td> <td>${d.comments}</td>`\n\t\t\t});\n\n\t\t selection.exit().remove();\t\n\n\n\n\t}", "title": "" }, { "docid": "fa0b214b07499bf512980d7197dca36f", "score": "0.57356364", "text": "function showTipTable(tableIndex, reportObjId)\n{\n var rows = tables[tableIndex].rows;\n var a = reportObjId - 1;\n\n if(rows.length != arrayMetadata[a].length)\n\tthrow new Error(\"rows.length=\" + rows.length+\" != arrayMetadata[array].length=\" + arrayMetadata[a].length);\n\n for(i=0; i<rows.length; i++) \n \trows[i].cells[1].innerHTML = arrayMetadata[a][i];\n}", "title": "" }, { "docid": "fa0b214b07499bf512980d7197dca36f", "score": "0.57356364", "text": "function showTipTable(tableIndex, reportObjId)\n{\n var rows = tables[tableIndex].rows;\n var a = reportObjId - 1;\n\n if(rows.length != arrayMetadata[a].length)\n\tthrow new Error(\"rows.length=\" + rows.length+\" != arrayMetadata[array].length=\" + arrayMetadata[a].length);\n\n for(i=0; i<rows.length; i++) \n \trows[i].cells[1].innerHTML = arrayMetadata[a][i];\n}", "title": "" }, { "docid": "5d4b8f623072c3505446a9e375828a7a", "score": "0.5718757", "text": "function showDetails(e){\n displayFullTableData(gData);\n e.target.style.display = 'none';\n document.getElementById('c2').style.display = 'block';\n}", "title": "" }, { "docid": "503ae567b37bc39a38de87d66854f5c2", "score": "0.5718101", "text": "function goToOverview() {\n setNextProgressElementActive($(\"#progressPhotos\"), $(\"#progressOverview\"));\n hideUserInformation();\n getOverViewData();\n}", "title": "" }, { "docid": "1e5faf6d8db03ed800b9eafae73e7c11", "score": "0.5706151", "text": "function createOverview() {\n var service = OpenLayers.Util.urlAppend(lizUrls.wms\n ,OpenLayers.Util.getParameterString(lizUrls.params)\n );\n var ovLayer = new OpenLayers.Layer.WMS('overview'\n ,service\n ,{\n layers:'Overview'\n ,version:'1.3.0'\n ,exceptions:'application/vnd.ogc.se_inimage'\n ,format:'image/png'\n ,transparent:true\n ,dpi:96\n },{\n isBaseLayer:true\n ,gutter:5\n ,buffer:0\n });\n\n if (config.options.hasOverview) {\n // get and define the max extent\n var bbox = config.options.bbox;\n var extent = new OpenLayers.Bounds(Number(bbox[0]),Number(bbox[1]),Number(bbox[2]),Number(bbox[3]));\n var res = extent.getHeight()/90;\n var resW = extent.getWidth()/180;\n if (res <= resW)\n res = resW;\n\n map.addControl(new OpenLayers.Control.OverviewMap(\n {div: document.getElementById(\"overview-map\"),\n size : new OpenLayers.Size(220, 110),\n mapOptions:{maxExtent:map.maxExtent\n ,maxResolution:\"auto\"\n ,minResolution:\"auto\"\n //mieux calculé le coef 64 pour units == \"m\" et 8 sinon ???\n //,scales: map.scales == null ? [map.minScale*64] : [Math.max.apply(Math,map.scales)*8]\n ,scales: [OpenLayers.Util.getScaleFromResolution(res, map.projection.proj.units)]\n ,projection:map.projection\n ,units:map.projection.proj.units\n ,layers:[ovLayer]\n ,singleTile:true\n ,ratio:1\n }\n }\n ));\n } else {\n $('#overview-map').hide();\n $('#overview-toggle').hide().removeClass('active');\n }\n\n /*\n $('#overview-map .ui-dialog-titlebar-close').button({\n text:false,\n icons:{primary: \"ui-icon-closethick\"}\n }).click(function(){\n $('#overview-map').toggle();\n return false;\n });\n */\n $('#overview-toggle')/*.button({\n text:false,\n icons:{primary: \"ui-icon-triangle-1-n\"}\n })\n .removeClass( \"ui-corner-all\" )*/\n .click(function(){\n var self = $(this);\n if ( self.hasClass('active') )\n self.removeClass('active');\n else\n self.addClass('active');\n /*\n var self = $(this);\n var icons = self.button('option','icons');\n if (icons.primary == 'ui-icon-triangle-1-n')\n self.button('option','icons',{primary:'ui-icon-triangle-1-s'});\n else\n self.button('option','icons',{primary:'ui-icon-triangle-1-n'});\n * */\n $('#overview-map').toggle();\n return false;\n });\n\n map.addControl(new OpenLayers.Control.Scale(document.getElementById('scaletext')));\n map.addControl(new OpenLayers.Control.ScaleLine({div:document.getElementById('scaleline')}));\n\n var mpUnitSelect = $('#mouseposition-bar > select');\n var mapUnits = map.projection.getUnits();\n if ( mapUnits == 'degrees' ) {\n mpUnitSelect.find('option[value=\"m\"]').remove();\n mpUnitSelect.find('option[value=\"f\"]').remove();\n } else if ( mapUnits == 'm' ) {\n mpUnitSelect.find('option[value=\"f\"]').remove();\n } else {\n mpUnitSelect.find('option[value=\"m\"]').remove();\n }\n var mousePosition = new OpenLayers.Control.lizmapMousePosition({\n displayUnit:mpUnitSelect.val(),\n numDigits: 0,\n prefix: '',\n emptyString:$('#mouseposition').attr('title'),\n div:document.getElementById('mouseposition')\n });\n map.addControl( mousePosition );\n mpUnitSelect.change(function() {\n var mpSelectVal = $(this).val();\n if (mpSelectVal == 'm')\n mousePosition.numDigits = 0;\n else\n mousePosition.numDigits = 5;\n mousePosition.displayUnit = mpSelectVal;\n });\n\n if (config.options.hasOverview)\n if(!mCheckMobile()) {\n $('#overview-map').show();\n $('#overview-toggle').show().addClass('active');\n }\n }", "title": "" }, { "docid": "c15c853328e749fbb5be8757a9b84903", "score": "0.5703763", "text": "function viewTable(table) {\n if (table === 'Employee'){\n query=`select e.id,e.first_name,e.last_name,r.title, m.first_name 'manager first name', m.last_name 'manager last name' from employee e left join employee m on e.manager_id = m.id join roles r on e.roles_id = r.id`;\n } else if (table === 'Roles'){\n query=`select r.id, r.title, r.salary, d.name 'Department name' from roles r left join department d on r.department_id = d.id`;\n } else {\n query=`SELECT * FROM ${table}`;\n };\n connection.query(query, (err, res) => {\n if (err) throw err;\n // console.log('Table Employee:');\n console.table(res);\n AskQuestions();\n });\n }", "title": "" }, { "docid": "cc16541d981bd7e5df7ca9fbf86d1d54", "score": "0.5700944", "text": "function display_stats(chart_enabled) {\n // setup html tags for showing results\n var project_table = document.getElementsByTagName('table')[0];\n project_table.id = 'marmostats-overview-table';\n\n var overview_tag = document.createElement('div');\n overview_tag.id = 'marmostats-overview';\n project_table.parentElement.prepend(overview_tag);\n if (chart_enabled) {\n overview_tag.setHTML('<div id=\"marmostats-test-summary\"> \\\n <p>Total Students: <b id=\"marmostats-total-students\"></b></p> \\\n </div> \\\n <div id=\"marmostats-selector-container\"> \\\n <table id=\"marmostats-selector-table\"></table> \\\n <div id=\"marmostats-setting-container\"></div> \\\n </div> \\\n <div id=\"marmostats-progress\"> \\\n <p id=\"marmostats-progress-text\">Loading project results...</p>\\\n <div id=\"marmostats-progress-bar-background\"><div id=\"marmostats-progress-bar\"></div></div> \\\n <p id=\"marmostats-progress-perc\"></p> \\\n </div> \\\n <div id=\"marmostats-chart\"></div>');\n\n display_overview();\n }\n\n update_table_style(project_table);\n}", "title": "" }, { "docid": "133f8d1744acef11f9f0a99066a7f759", "score": "0.5700222", "text": "function displayResults() {\n\t\tvar paging = 50;\n\t\tvar bookmark = page.results_table_tbody.find('tr').length;\n\t\t\n\t\t// Display the Expression Regulation Profile stacked bar graph\n\t\tgraphExpressionRegulationProfile();\n\t\t\n\t\t// Load a few results at a time based on 'paging' variable\n\t\tfor(var i = bookmark; i < bookmark+paging && i < results.length; i++) { \n\t\t\t// Text manipulations to fit data into table\n\t\t\tvar pvalue = parseFloat(results[i]['p_value']) < 0.01 ? parseFloat(parseFloat(results[i]['p_value']).toPrecision(2)).toExponential() : parseFloat(results[i]['p_value']).toPrecision(3);\n\t\t\tvar foldchange = isNaN(results[i]['log2FoldChange']) == true ? (results[i]['log2FoldChange'].toLowerCase() == '-inf' ? '- &#8734;' : '&#8734;') : parseFloat(results[i]['log2FoldChange']).toFixed(2);\n\t\t\tvar significant = results[i]['Significant'].toLowerCase() == 'yes' ? 'Y' : 'N';\n\t\t\tvar regulated = regulatedConvert(results[i]['regulated'], false);\n\t\t\tvar sourceType = truncate(results[i]['Data_Source'],8,true);\n\t\t\t// print out table row\n\t\t\tpage.results_table_tbody.append('<tr> \\\n\t\t\t\t<td style=\"text-align: right !important;\"><a href=\"' + page.id + '-detail\" >' + pvalue + '</a></td> \\\n\t\t\t\t<td>' + significant + '</td> \\\n\t\t\t\t<td>' + foldchange + '</td> \\\n\t\t\t\t<td>' + regulated + '</td> \\\n\t\t\t\t<td>' + results[i]['PMID'] + '</td> \\\n\t\t\t\t<td>' + parseFloat(results[i]['Freq_up_per']).toFixed(1) + '</td> \\\n\t\t\t\t<td>' + parseFloat(results[i]['Freq_Down_per']).toFixed(1) + '</td> \\\n\t\t\t\t<td>' + results[i]['Cancer_type'] + '</td> \\\n\t\t\t\t</tr>');\n\t\t}\n\t\t\n\t\tif(bookmark+paging <= results.length ) { page.loadmore_btn.show(); }\n\t\telse { page.loadmore_btn.hide(); }\n\t\tpage.results_table.show();\n\t\tpage.results_area.show();\n\t\t$.mobile.loading(\"hide\");\t\n\t}", "title": "" }, { "docid": "2ef38b3e323f6605a04465a14e590178", "score": "0.56929374", "text": "function showTipTable(tableIndex, reportObjId)\r\n{\r\n var rows = tables[tableIndex].rows;\r\n var a = reportObjId - 1;\r\n\r\n if(rows.length != arrayMetadata[a].length)\r\n\tthrow new Error(\"rows.length=\" + rows.length+\" != arrayMetadata[array].length=\" + arrayMetadata[a].length);\r\n\r\n for(i=0; i<rows.length; i++) \r\n \trows[i].cells[1].innerHTML = arrayMetadata[a][i];\r\n}", "title": "" }, { "docid": "2ef38b3e323f6605a04465a14e590178", "score": "0.56929374", "text": "function showTipTable(tableIndex, reportObjId)\r\n{\r\n var rows = tables[tableIndex].rows;\r\n var a = reportObjId - 1;\r\n\r\n if(rows.length != arrayMetadata[a].length)\r\n\tthrow new Error(\"rows.length=\" + rows.length+\" != arrayMetadata[array].length=\" + arrayMetadata[a].length);\r\n\r\n for(i=0; i<rows.length; i++) \r\n \trows[i].cells[1].innerHTML = arrayMetadata[a][i];\r\n}", "title": "" }, { "docid": "89770c1d59a4a09088b7db8d83990d0c", "score": "0.56873196", "text": "displayStatistics(records = this.records, general = true) {\r\n if (general) {\r\n console.log(\"\\nCurrent Statistics:\");\r\n }\r\n HangmanUtils.displayRecordsAsStatisticsTable(records);\r\n console.log(\" * - among the best scores (highest percentage scores)\");\r\n }", "title": "" }, { "docid": "476b5606a3adc2c1a012fe07d1d38b28", "score": "0.5683748", "text": "function show_stats(){\n\tif(currentTiling){\n\t\tvar population = currentTiling.get_stats();\n\t\tvar disp = document.getElementById(\"statsInfo\");\n\t\t\n\t\tvar mean = 0;\n\t\tvar std = 0;\n\t\tfor(var i=0; i<population.length; i++){\n\t\t\tmean += population[i] * i\n\t\t}\n\t\t\n\t\t\n\t\tvar text_stats = \"Number of tiles : \" + currentTiling.tiles.length + \"<br>Mean : \" + mean + \"<br> Standard deviation : \" + std + \"<br> Population : <br>\";\n\t\tvar jump_line = false;\n\t\tObject.keys(population).forEach(function(key) {\n\t\t\t\ttext_stats += \" \" + key + \" : \" + population[key];\n\t\t\tif(jump_line)\n\t\t\t\ttext_stats += \"<br>\";\n\t\t\telse\n\t\t\t\ttext_stats += \" - \";\n\t\t\tjump_line = !jump_line;\n\t\t});\n\t\tdisp.innerHTML = text_stats ;\n\t}\n}", "title": "" }, { "docid": "146d7f64a5f793b2ecb24a562a897cdd", "score": "0.5664861", "text": "function showProjectionsOverview(obj)\r\n{\r\n navigateToProjections(obj, \"\");\r\n}", "title": "" }, { "docid": "c0c109bbd6840693354e66dc431e0065", "score": "0.5664072", "text": "function displayTable(pagaData) {\r\n displayTableHead(pageData);\r\n displayTableBody(pageData);\r\n if (isMobile()) {\r\n main.insertBefore(mobileNotif, document.getElementById(\"info-table\"));\r\n } else {\r\n if (document.querySelector(\"#mobile-notif\")) {\r\n main.removeChild(mobileNotif);\r\n }\r\n if (document.querySelector(\"#blur-background\")) {\r\n unexpand();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "2ac069652dab4b08979296e16162a796", "score": "0.5662931", "text": "function initViz() {\n var containerDiv = document.getElementById(\"vizContainer\")\n var url = \"https://public.tableau.com/views/PregnancyNutritionFinder/TopTenDash\";\n var options = {\n hideTabs: true,\n hideToolbar: true,\n // width: \"1200px\",\n // height: \"900px\",\n //\"Long Desc\": \"Catsup\",\n onFirstInteractive: function () {\n workbook = viz.getWorkbook();\n activeSheet = workbook.getActiveSheet();\n }\n };\n viz = new tableau.Viz(containerDiv, url, options);\n}", "title": "" }, { "docid": "7e52c15df4fa620797766bc537458f59", "score": "0.5656547", "text": "function displayItems() {\n\tbuildTable();\n\t//Calls back to the selection menu\n\tmainDisplay();\n}", "title": "" }, { "docid": "226b70052fb7122b056b0d127d657b3e", "score": "0.56492007", "text": "function displayMain() {\n addSeasonOptions();\n displayDepartments();\n displayProducts();\n}", "title": "" }, { "docid": "b83870bc2c119759a1de59c928a70f49", "score": "0.5646375", "text": "function runListShow() {\n $(\"table.js-dataTooltip.tableList > tbody > tr\").each(function(){\n var tr = $(this);\n var title = getListShowTitle(tr);\n var author = getListShowAuthor(tr);\n\n var onSearchSuccess = function(url, linkHtml) {\n // show it below the overdrive section\n $(linkHtml + \"<br/>\").insertBefore(tr.find(\"td\").eq(2).find(\"span.greyText.smallText.uitext\"));\n };\n\n search(title, author, onSearchSuccess);\n });\n}", "title": "" }, { "docid": "88ae322daa6a72519398abd7d61159db", "score": "0.5644078", "text": "function display(heading, table, count) {\n print(\"==============================================================\");\n print(\" \" + heading + \" Report\");\n print(\"==============================================================\");\n count ? print(\"Total number of \" + count) : false;\n print(table.toString());\n print();\n}", "title": "" }, { "docid": "b4629bea78710f4615876c8263a26a3f", "score": "0.5638587", "text": "function displayData(data) {\n\tleftTitle.innerText = data[0].title\n leftContent.innerText = data[0].summary\n rightTitle.innerText = data[1].title\n rightContent.innerText = data[1].summary\n}", "title": "" }, { "docid": "566f238ca416adf90862130b80120962", "score": "0.56348747", "text": "function show(data) { \r\n \r\n let tab = ''; \r\n \r\n for (var i=0;i<data.articles.length;i++) {\r\n\r\n tab += `<tr> <th>Author : </th><td> ${data.articles[i].author} </td> \r\n </tr>`; \r\n tab += `<tr> <th>Title : </th><td> ${data.articles[i].title} </td> \r\n </tr>`; \r\n tab += `<tr> <th>Description : </th><td> ${data.articles[i].description} </td> \r\n </tr>`; \r\n tab += `<tr> <th>Url : </th><td> <a href=${data.articles[i].url}>${data.articles[i].url} </a></td> \r\n </tr>`; \r\n\r\n tab += `<tr> <th>Url Image : </th><td> <img src=${data.articles[i].urlToImage} width='150' height='100'></img></td> \r\n </tr>`; \r\n tab += `<tr><td> <hr width=\"100%\"> </td> </tr>`; \r\n \r\n }\r\n \r\n\r\n\r\n // Setting innerHTML as tab variable \r\n document.getElementById(\"employees\").innerHTML = tab; \r\n }", "title": "" }, { "docid": "42c03673c6a29ae7d00f4e630e82fb65", "score": "0.5628055", "text": "display(){\n //this.enableNormalViz();\n super.display();\n\t}", "title": "" }, { "docid": "4a608b553049f549e18a3cd2c458d0f5", "score": "0.56211174", "text": "function render_table_view(){\n\tif(current_tab == \"donate\"){\n\t\trender_donate_list();\n\t}else{\n\t\trender_adopt_list();\n\t}\n}", "title": "" }, { "docid": "cbd07a393461abdd0a54b1b285d2922e", "score": "0.5612667", "text": "function showSummaryHeader(){\n\tdocument.getElementById(\"hSummary\").style.visibility = \"visible\";\n}", "title": "" }, { "docid": "0b8c563589f6082092643a0a7582d9b6", "score": "0.56113577", "text": "displayTable() {\n const table = document.querySelector(\"#table\");\n const headingRow = document.createElement(\"tr\");\n table.appendChild(headingRow);\n for (let j = 0; j <= ui.DEFAULT_COLUMNS; j++) {\n let cell;\n if (j) cell = ui._createColumnHeader(j);\n else {\n cell = document.createElement(\"td\");\n cell.classList.add(\"row-header\");\n }\n headingRow.appendChild(cell);\n }\n for (let i = 1; i <= ui.DEFAULT_ROWS; i++) table.appendChild(ui._createRow(i, ui.DEFAULT_COLUMNS));\n }", "title": "" }, { "docid": "1fe023d94f9b4c8af796e93e33bdff3e", "score": "0.56100756", "text": "display() {\n this._hashTable.forEach(item => {\n if (item) {\n console.log(item.value) // shows a nice list view\n // console.log(item) // shows a more indepth view\n while (item.next) {\n console.log(item.next)\n item = item.next\n }\n }\n })\n }", "title": "" }, { "docid": "55a0923ec567f8986306591fe97b7cd6", "score": "0.5594264", "text": "function showTable( table )\r\n{\r\n\tfeedsTable.style.display = 'none';\r\n\taboutTable.style.display = 'none';\r\n\toptionsTable.style.display = 'none';\r\n\ttable.style.display = 'block';\r\n}", "title": "" }, { "docid": "a16d3be7889d1f11bf7b27a480fb0761", "score": "0.55913323", "text": "function showDeptTable() {\n connection.query('SELECT * FROM departments', function(err, results) { //connect to db and select all inside departments table\n if (err) throw err;\n var table = new Table({ //set up display table using code from the cli-table documentation\n head: [colors.magenta('id'), colors.magenta('department name'), //set column headers\n colors.magenta('over-head costs'), colors.magenta('total sales'), colors.magenta('total profit')],\n colWidths: [5, 23, 23, 23, 23] //set column widths\n });\n for (var i = 0; i < results.length; i++){ //loop through the results of the connection.query\n table.push( //push each record to the display table for each loop through\n [(JSON.parse(JSON.stringify(results))[i][\"department_id\"]), (JSON.parse(JSON.stringify(results))[i][\"department_name\"]),\n (\"$ \"+JSON.parse(JSON.stringify(results))[i][\"over_head_costs\"].toFixed(2)), (\"$ \"+JSON.parse(JSON.stringify(results))[i][\"total_sales\"].toFixed(2)),\n (\"$ \"+parseFloat(results[i].total_sales - results[i].over_head_costs).toFixed(2))]);\n \t\t\t}\n console.log(colors.magenta('_______________________________________________________________________________________________________'));\n console.log(\"\\n\" + table.toString()); //prints the constructed cli-table to screen\n console.log(colors.magenta('_______________________________________________________________________________________________________'));\n console.log(\"\");\n });\n}", "title": "" }, { "docid": "a9567d6e29227f0fb9bcf21b56db574c", "score": "0.5589459", "text": "function display()\n{\n\tposition=1;\n\tdivList();\n\tdisplayAudit();\n\tdisplayResult();\n\tsetPosition();\n\tmaskElement();\n}", "title": "" }, { "docid": "d3d787d0a98d54d4bf7904318b761ff9", "score": "0.5588659", "text": "function showAddTable(objectPollPnt) {\n\t\t\tconsole.log(objectPollPnt);\n\t\t\t$(\"#rightPane\").append('<div id=\"pollPntTable\">');\n\t\t\t$(\"#pollPntTable\").html(createPollPntTable(objectPollPnt));\n\t\t\tremovePollPnrTbl();\n\t\t\t$(\"#tblPollPnt\").on(\"mouseenter\", \".PollPnts\", objectPollPnt, selectPollObject);\n\t\t\t$(\"#tblPollPnt\").on(\"mouseleave\", \".PollPnts\", objectPollPnt, clearPollObject);\n\t\t}", "title": "" }, { "docid": "ea45bbb135478a729ca040708e1bafcc", "score": "0.55794364", "text": "function showInfo(data, tabletop) {\n // Call hideLoading\n hideLoading();\n\n for (var i = 0; i < data.length; i++) {\n $('.post').append(\n \"<div class='article'>\" +\n \"<div class='text'>\" +\n \"<h1>\" + data[i].title + \"</h1>\" +\n \"<h4> by \" + data[i].author + \"</h4>\" +\n \"<p>\" + data[i].body + \"</p>\" +\n \"<p class='date'> Published: \" + data[i].date + \"</p>\" +\n \"</div>\" +\n \"</div>\"\n );\n }\n}", "title": "" }, { "docid": "069f38f81ed42f6a87d88d2732d1b465", "score": "0.55744946", "text": "function showCapacityProjectionOverview(obj)\r\n{\r\n navigateToCapacityProjections(obj, \"\");\r\n}", "title": "" }, { "docid": "7333f81ec32eae4c8e9b1a08d51bf37e", "score": "0.55625755", "text": "function getOverviewHTML(slide){\n\n let overview = $('<div/>');\n overview.addClass('hxslide-overview-bigbox hxslide-overview-master');\n if(!options.overviewIsOpen){\n overview.css('display','none');\n }\n\n // Add a column for each category (color) in the spreadsheet.\n let allCategories = slideData.map(x => x.category);\n let cats = [... new Set(allCategories)];\n cats.forEach(function(cat, i){\n\n // Create a column\n let column = $('<div/>');\n column.addClass('hxslide-overview-container');\n\n // Insert the category indicator\n // Unless there's only one category.\n if(cats.length > 1){\n let indicator = $('<div/>');\n indicator.addClass('hxslide-column-indicator' + ' indicator-bar-' + cat);\n indicator.css('background-color',colorLookup[cat]);\n indicator.text(options.categoryTitles[cat]);\n column.append(indicator);\n }\n\n // Indicate the active category\n // Unless there's only one category. Then just put in the spacer.\n if(slide.category === cat && cats.length > 1){\n let svgIndicator = $('<svg viewBox=\"0 0 100 30\" width=\"100%\" height=\"30px\" preserveAspectRatio=\"none\"></svg>');\n svgIndicator.append('<polygon points=\"0,0 50,30 100,0\" style=\"fill: ' + colorLookup[cat] + ';\" />');\n let activeIndicator = $('<div/>');\n activeIndicator.append(svgIndicator);\n activeIndicator.addClass('hx-indicator-spacer hx-indicator-active');\n column.append(activeIndicator);\n }else{\n column.append('<div class=\"hx-indicator-spacer\"></div>');\n }\n\n\n // Insert icons of the right category, whether they're\n // the current one, its predecessors, or its successors.\n let rightIcons = [];\n rightIcons = rightIcons.concat(slide.id);\n rightIcons = rightIcons.concat(slide.previous.split(','));\n rightIcons = rightIcons.concat(slide.next.split(','));\n rightIcons = rightIcons.filter(x => x !== '');\n rightIcons = rightIcons.map(x => x.trim());\n\n rightIcons.forEach(function(e){\n s = lookupSlide(e);\n if(s.category === cat){\n let iconHTML = $('<div/>');\n iconHTML.addClass('hxslide-overview-item');\n\n // If there's only one category, shrink the icons to\n // allow more on the same line.\n if(cats.length === 1){\n iconHTML.css('max-width','100px');\n iconHTML.css('min-width','50px');\n iconHTML.css('padding','5px');\n }\n\n // If icons are in-scope, link them up.\n let iconLink;\n if(s.inScope){\n iconLink = $('<a/>');\n iconLink.attr('href','#');\n iconLink.attr('data-target', s.id);\n }else{\n iconLink = $('<span/>');\n }\n iconHTML.append(iconLink);\n\n let iconImage = $('<img/>');\n iconImage.attr('src', staticFolder + s.ownicon);\n if(!s.inScope){ iconImage.addClass('out-of-scope'); }\n iconLink.append(iconImage);\n if(s.id === slide.id){\n iconLink.append('<strong style=\"color:black;\">' + s.breadcrumb + '</strong>');\n iconHTML.addClass('hxslide-active-item');\n iconImage.css('filter','drop-shadow(0px 0px 10px rgb(0,0,0))');\n }else{\n iconLink.append(s.breadcrumb);\n }\n\n column.append(iconHTML);\n }\n });\n\n overview.append(column);\n });\n\n // Insert a separator if this isn't the last column\n\n return overview;\n\n }", "title": "" }, { "docid": "e1337b5159e46449b0ed13b1f0effb23", "score": "0.5553102", "text": "function showStatInfo()\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"stat-info\").style.top='-23px';\n\t\t\t}", "title": "" }, { "docid": "cca7a35df167ad258a53ed50e3957cc4", "score": "0.5547139", "text": "function tableDisplay(ufoSightings) {\n tbody.html(\"\");\n ufoSightings.forEach((ufoRecords) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoRecords).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "3f2dca141f7420f2b02f69f478226d9d", "score": "0.5540868", "text": "function topResultOver90() {\r\n \r\n upper90 = true;\r\n //top label\r\n var currentLabel = res1;\r\n \r\n var wikipediaLink = \"https://en.wikipedia.org/wiki/\" + currentLabel;\r\n // changes only the color of the active object\r\n //this.active[0]._chart.config.data.datasets[0].backgroundColor = \"red\";\r\n \r\n freeze();\r\n Swal.fire({\r\n title: currentLabel, \r\n html: \"<a href='\" + wikipediaLink + \"' target='_blank' title='Wikipedia article for \" + currentLabel +\"'><img class='wikiLink' height='30px' src='WikipediaLogo.svg'/></a>\", \r\n confirmButtonText: \"Back\",\r\n preConfirm: () => {unfreeze()}\r\n});\r\n}", "title": "" }, { "docid": "fd4567244383f7bc91ac3d57ecb86796", "score": "0.55351144", "text": "function goToInformationOverview() {\n setNextProgressElementActive($(\"#progressPhotos\"), $(\"#progressInformation\"));\n $(userdataScreen).css('display', 'block');\n $(photosScreen).css('display', 'none');\n $(schemeScreen).css('display', 'none');\n}", "title": "" }, { "docid": "c374c2145ef0f0d0de3929b2b0bfc7a8", "score": "0.5533239", "text": "function displayTable(obj) {\n let table = document.createElement(\"table\");\n table.className = \"table table-stripped\";\n\n let data = [\n \"Name\",\n \"Date-Of-Entry\",\n \"Medical-History\",\n \"Physician\",\n \"Last-Visit\"\n ];\n\n let tr = document.createElement(\"tr\");\n\n for (header of data) {\n let td = document.createElement(\"td\");\n td.textContent = header;\n tr.appendChild(td);\n }\n\n table.appendChild(tr);\n\n obj.forEach(patient => {\n let tr = document.createElement(\"tr\");\n\n for (cell of data) {\n let td = document.createElement(\"td\");\n td.textContent = patient[cell];\n tr.appendChild(td);\n }\n table.appendChild(tr);\n });\n\n let parent = document.querySelector(\"#table-result\");\n parent.appendChild(table);\n}", "title": "" }, { "docid": "3ee9a0dea2619dcb93afa276e4473ebb", "score": "0.5531888", "text": "function displayTasks () {\n deleteTable()\n var duplicateArray = []\n for (var index = 0; index < taskDetailsArray.length; index++) {\n duplicateArray[index] = index\n }\n addRowsToTable(duplicateArray)\n}", "title": "" }, { "docid": "cbedb730971f3e0e6dfba28898145aa7", "score": "0.5530346", "text": "function drawVisualization() {\n\t// Create new data table.\n\tAT_tableData = new google.visualization.DataTable();\n\n\t// Create columns to contain the date, time and tooltip.\n\tAT_tableData.addColumn('date', 'Date');\n\tAT_tableData.addColumn('timeofday', 'Time 2014');\n\tAT_tableData.addColumn({type:'string', role:'tooltip', 'p': {'html': true}});\n\t\t \n\tif(AT_RESULTS.length == 0) {\n\t\tconsole.log(\"No results found.\");\n\t\tdrawVisual();\n\t}\n\t\n\tfor(i = 0; i < AT_RESULTS.length; i++) {\n\t\t// The following may have been made redundant by doing this check above.\n\t\tvar reg = /\\-/g;\n\t\tif(reg.test(AT_RESULTS[i].date)) {\n\t\t\tvar string = AT_RESULTS[i].date;\n\t\t\tAT_RESULTS[i].date = string.substring(string.indexOf('-')+1,string.length);\n\t\t} \n\t\t// End comment.\n\t\tAT_tableData.addRows([\n\t\t\t[new Date(AT_RESULTS[i].date), \n\t\t\t[parseInt(hours(AT_RESULTS[i].time)),\n\t\t\tparseInt(minutes(AT_RESULTS[i].time)),\n\t\t\tparseInt(seconds(AT_RESULTS[i].time)),\n\t\t\tparseInt(milliseconds(AT_RESULTS[i].time))],\n\t\t\tcreateCustomHTMLContent(AT_RESULTS[i].date, AT_RESULTS[i].time, AT_RESULTS[i].location)]\n\t\t]);\n\t\tif (i == AT_RESULTS.length-1) {\n\t\t\tAT_tableData.sort([{column: 0, desc:true}]);\n\t\t\tdrawVisual();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b5801e7db37a49aac5c01ad014a145c6", "score": "0.5519534", "text": "function setTableHeader() {\n if (queryResult.truncatedByLimit && queryParams.global.limit === undefined) {\n document.getElementById('warning').classList.remove('hide');\n }\n document.getElementById('table_title').innerText = query.name;\n if (pluginConfiguration.entityType === undefined || pluginConfiguration.entityType === 'node') {\n document.getElementById('warning_text').innerText = `The query returned too many results. The ${\n queryResult.result.length} first results are displayed below.`;\n document.getElementById('item_type').innerText = `Node type : ${pluginConfiguration.itemType}`;\n document.getElementById('item_count').innerText = `Number of nodes : ${queryResult.result.length}`;\n } else if (pluginConfiguration.entityType === 'edge') {\n document.getElementById('warning_text').innerText = `The query returned too many results. The ${\n queryResult.result.length} first results are displayed below.`;\n document.getElementById('item_type').innerText = `Edge type : ${pluginConfiguration.itemType}`;\n document.getElementById('item_count').innerText = `Number of edges : ${queryResult.result.length}`;\n }\n}", "title": "" }, { "docid": "3a2a6dff2b60868bc6ec93d110f98c08", "score": "0.5517963", "text": "function showToppings() {\n if(orderReady['meats'].length > 0 || orderReady['vegis'].length > 0) $('.top-title').css('display','inline-block');\n else $('.top-title').hide();\n }", "title": "" }, { "docid": "3c046af16e09ef6186b6da6767b51d5e", "score": "0.5514348", "text": "function show(data) {\n\tlet tab =\n\t\t`<tr>\n\t\t<th>Roll Number</th>\n\t\t<th>Attendance</th>\n\t\t<th>Name</th>\n\t\t</tr>`;\n\n\n for (var i = 0; i < data.length; i++){\n var obj = data[i];\n for (var key in obj){\n var attrName = key;\n var attrValue = obj[key];\n tab += `<td><center>${attrValue}</center></td>`;\n }\n tab += `<tr></tr>`;\n}\n\n\t// Setting innerHTML as tab variable\n\tdocument.getElementById(\"details\").innerHTML = tab;\n}", "title": "" }, { "docid": "a8b68e3b36c0fbe569773371692bc203", "score": "0.55118304", "text": "function displayTicketInfo(clarification, atm) {\n\n\tconst HEADERS = ['TICKET KEY', 'INICIO', 'FIN', 'VENTANA', 'HORARIO', 'DÍA EN VENTANA' , \n\t\t\t\t\t\t'HORAS NETAS', 'ATM', 'SITE', 'ESTADO', 'SLA', 'MAQUINA', 'MODELO', 'TAS']\n\t\n\t// Merge clarification and atm dicts in only one.\n\tconsole.log(\"mira....\", clarification, atm)\n\tlet union = extend(Object.create(clarification), atm);\n\tticket = union;\n\tlet start_date = new Date(ticket.fecha_inicio).getDay();\n\tlet is_day_window = isDayInWindow(start_date, createWindow(ticket.dias_idc, ticket.hrs_idc));\n\tunion['dia_ventana'] = is_day_window ? 'SI':'NO';\n\n\t// Save the ticket for handle it without repetitive DB calls.\n\n\t/* Display Table */\n\tnew TicketInfoTable('TicketInfoTable', HEADERS, [union]);\n\n}", "title": "" }, { "docid": "701d59b5925a5e6eb1da9e94976b0ce0", "score": "0.55063283", "text": "function displayEducation () {\n\tfor (Online in education.online){\n\t\titemText = \"<i>\" + education.online[Online].company + \"</i>\" + \"<p>\" + education.online[Online].detail + \"</p>\"\n\t\taddListItem(\"#onlineList\", itemText)\n\t};\n\n\tfor (Other in education.other) {\n\t\titemText = \"<i>\" + education.other[Other].company + \"</i>\" + \"<p>\" + education.other[Other].detail + \"</p>\"\n\t\taddListItem(\"#otherList\", itemText)\n\t};\n\t}", "title": "" }, { "docid": "5464c953b8e2812ef43f7aa227e046a4", "score": "0.5503546", "text": "function displayCourseSummary(data, textStatus)\n{\n\tvar i = 0;\t\n\tvar htmlReference = \"<div id='module'>\";\n\thtmlReference += \"<h2>Course Summary</h2>\";\n\thtmlReference += \"<table id='courseT'>\";\n\thtmlReference += \"<thead>\";\n\thtmlReference += \"<tr><th>Number</th><th>Name</th><th>Attendees</th></tr>\";\n\thtmlReference += \"</thead><tbody>\";\n\t// loop through results\t\n\t$.each(data.references, function(i, reference) {\n\t\t// apply row banding\n\t\tif (i % 2 == 0) {\n\t\t\tvar even = \" class='even'\";\n\t\t} else {\n\t\t\tvar even = \"\";\n\t\t}\n\t\t// replace null values with tick marks\n\t\tif (reference.total == null) reference.total = \"-\";\n\t\t// compose HTML code that displays the content\n\t\thtmlReference += \"<tr\" + even + \"><td><a id='\" + reference.id + \"'>\" + reference.id + \"</a></td><td>\" + reference.title + \"</td><td>\" + reference.total + \"</td></tr>\";\t\t\t\n\t\t// increment counter\n\t\t++i;\n\t});\n\thtmlReference += \"</tbody>\";\n\thtmlReference += \"</table>\";\n\thtmlReference += \"</div>\";\n\t// insert the new HTML into the document\n\t$('#main')[0].innerHTML += htmlReference;\n}", "title": "" }, { "docid": "10d06e9536dfaaa88748d1c295de3daf", "score": "0.5503344", "text": "function createOverivewTable() {\n var table = document.createElement(\"table\");\n\tvar thead = document.createElement(\"thead\");\n\tvar tr = document.createElement(\"tr\");\n\n\taddMultipleTableRowElement(table, tr, tableHeadList, \"th\");\n\n\tthead.appendChild(tr);\n\ttable.appendChild(thead);\n\n var names = populationInterface.getNames();\n\tvar ids = populationInterface.getIDs();\n\t\n for (var i = 0; i < names.length; i++) {\n var tr = document.createElement(\"tr\"); //Create new table row\n \n //Total population figure (both gender) \n var pop2018 = populationInterface.getPopulationBothGenderFromNameAllYears(names[i])[2018];\n\n //Population figure in percent\n var pop2017 = populationInterface.getPopulationBothGenderFromNameAllYears(names[i])[2017];\n var percent = ((pop2018 - pop2017) / pop2017) * 100;\n var roundPercent = Math.round(percent * 100) / 100;\n\t\n\t\tcreateTableRowElement(table, tr, names[i], \"td\", tableHeadList[0]);\n\t\tcreateTableRowElement(table, tr, ids[i], \"td\", tableHeadList[1]);\n\t\tcreateTableRowElement(table, tr, pop2018, \"td\", tableHeadList[2]);\n\t\tcreateTableRowElement(table, tr, roundPercent, \"td\", tableHeadList[3]);\n\t}\n\t\n\toverviewDiv.appendChild(table);\n}", "title": "" }, { "docid": "73dff63dcaa62a5490f43895d2f05909", "score": "0.5498074", "text": "function showUserMetaTable() {\n\t\tvar table = document.getElementById( 'frm_user_meta_table' );\n\t\ttable.style.display = 'table';\n\t}", "title": "" }, { "docid": "dc1fe8bf7029cef4ef803be15824535b", "score": "0.54966295", "text": "function writetitle(){\n var text;\n text='<table style=\"width:60%\">';\n text+='<tr><td align=\"center\">Tropes del jugador <b>'+Battle.attacker.name+' = '+Battle.attackerctr.tropes+'</b></td>';\n text+='<td align=\"center\">Tropes del jugador <b>'+Battle.defender.name+' = '+Battle.defenderctr.tropes+'</b></td></tr>\\n';\n text+='</table>';\n document.getElementById(\"Introduction\").innerHTML=text;\n}", "title": "" }, { "docid": "afd35514360670ae97ec6e33c6304dbe", "score": "0.549602", "text": "function personDisplayFacts(facts) {\n // Create an entry per each fact\n for(var i = 0; i < facts.length; i++) {\n var fact = facts[i];\n var header = '<code>' + fact.getType() + '</code>';\n if(fact.isCustomNonEvent()) header += '<span class=\"label label-info\">Event</span>';\n else header += '<span class=\"label label-info\">Fact</span>';\n\n var x = createPanelTable(header, [\n [\n ['th', 'Place - Original'],\n ['th', 'Place - Normalized'],\n ['th', 'Place - Normalized ID']\n ],\n [\n ['td', fact.getOriginalPlace()],\n ['td', fact.getNormalizedPlace()],\n ['td', fact.getNormalizedPlaceId()]\n ],\n [\n ['th', 'Date - Original'],\n ['th', 'Date - Formal'],\n ['th', 'Place - Normalized']\n ],\n [\n ['td', fact.getOriginalDate()],\n ['td', fact.getFormalDate()],\n ['td', fact.getNormalizedDate()]\n ],\n [\n ['th', 'Description'],\n ['th', ''],\n ['th', '']\n ],\n [\n ['td', fact.getValue()],\n ['td', ''],\n ['td', '']\n ]\n\n ]).appendTo($('#table-facts'));\n }\n\n // Hide error message\n if(facts.length > 0) {\n $('#disclaimer-facts').hide();\n }\n}", "title": "" }, { "docid": "ae0799dd9b1380d1e0b7571aaeb4a45d", "score": "0.54883134", "text": "function showAlfrescoSearchNormalView(){\n alfrescoSearchTabelle.settings().init().iconView = false;\n viewMenuSearch.children('li:first').superfish('hide');\n alfrescoSearchTabelle.column(0).visible(true);\n alfrescoSearchTabelle.column(1).visible(true);\n alfrescoSearchTabelle.column(2).visible(false);\n resizeTable(\"searchCenter\", \"dtable4\", \"alfrescoSearchTabelle\", \"alfrescoSearchTabelleHeader\", \"alfrescoSearchTableFooter\");\n}", "title": "" }, { "docid": "a81efbdd6ec5731cbd96b9ccf79a156f", "score": "0.54873496", "text": "function showDashboard(userObject){\n showProfile(userObject['Name'], userObject['Catchphrase'], userObject['Location'])\n showInterests(userObject['Interests'])\n showFavorites(userObject['Favorites'])\n showAcctActivity(userObject['startingBalance'],userObject['Transactions'])\n}", "title": "" }, { "docid": "2dc7ab4a9de8c3c37955d4efd52be866", "score": "0.5484969", "text": "function AddTableDetailLinks(oResultTable, oPrintedTable){ \n\n //Detail list columns\n var idColumnIndex_Id = GetTableColumnIndex(oResultTable, \"counter\", false /*count only visible columns*/);\n var idColumnIndex_Cases = GetTableColumnIndex(oResultTable, \"cases\", true /*count only visible columns*/);\n \n\n \n $(\"tr\", oPrintedTable).each(function(index, oRow) {\n if(index > 0 /* no link in column headers */){\n \n //Current stopwatch\n var idCounter = parseInt(oResultTable.rows[index-1][idColumnIndex_Id].value);\n \n //Create links\n var oImgInstances = $(\"<div class='iconDetail'></div>\");\n \n //Bind detail list function to the links \n oImgInstances.click(function(){ShowInstancesDetailList(idCounter);});\n \n $(oRow.cells[idColumnIndex_Cases]).append(oImgInstances);\n\n //Drill down link\n $(oRow.cells[idColumnIndex_Id]).click(function(){ DrillDown(idCounter); });\n $(oRow.cells[idColumnIndex_Id]).addClass(\"linkText\");\n } \n });\n }", "title": "" }, { "docid": "579a2cf60b330a2d9b5876d3c81fc3b4", "score": "0.5483952", "text": "function constructSummaryHtml(quake)\n{\n var result = \n table({id: \"summary\"},\n tRow({},\n tCell({id: \"magnitudeText\"}, quake.Magnitude.toFixed(1)) +\n tCell({},\n table({id: \"timeTable\"}, \n tRow({},\n tCell({id: \"date\"}, DATE_FORMAT(quake.date))) + \n tRow({}, \n tCell({id: \"time\"}, \n TIME_FORMAT(quake.date) + span({id: \"zone\", class: \"label\"}, ZONE_FORMAT(quake.date))\n )))\n )\n ) +\n tRow({},\n tCell({id: \"region\", colspan: 2}, capitaliseFirstLetter(quake.Region))) +\n tRow({}, \n tCell({colspan: 2},\n table({id: \"summarySubtable\"},\n tRow({},\n tCell({class: \"label\"}, \"id\") +\n tCell({class: \"value\"}, quake.Eqid) +\n tCell({class: \"label\"}, \"source\") +\n tCell({class: \"value\"}, quake.Src.toUpperCase())) +\n tRow({},\n tCell({class: \"label\"}, \"lat\") +\n tCell({class: \"value\"}, quake.Lat) +\n tCell({class: \"label\"}, \"lon\") +\n tCell({class: \"value\"}, quake.Lon)))))\n );\n\n return result;\n}", "title": "" }, { "docid": "a1cf7ee50dedf8197fc52d80e8a33f1e", "score": "0.5481714", "text": "function tableDisplay(sightings) {\n var tbody = d3.select(\"tbody\");\n sightings.forEach((ufoRecord) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoRecord).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.html(value);\n });\n });\n }", "title": "" }, { "docid": "52a8576113f4dbbd90b079ae5d3a28c2", "score": "0.54815304", "text": "function controllTable() {\n $(\"allMunici\").innerHTML = \"\";\n var x = createElement(\"table\");\n x.setAttribute(\"id\", \"table-overview\");\n $(\"allMunici\").appendChild(x);\n\n makeRow(\"table-overview\", \"cities\", \"Kommuner\");\n makeRow(\"table-overview\", \"K_num\", \"Kommunenr.\");\n makeRow(\"table-overview\", \"last_Pop\", \"Sist målt befolkning\");\n\n for (var i in befolkning.data) {\n addInfoRow(\"cities\", i);\n addInfoRow(\"K_num\", befolkning.data[i].kommunenummer);\n var list = [];\n for (var ind in befolkning.data[i].Menn) {\n list.push(ind);\n }\n var place = list.length - 1;\n var menn = befolkning.data[i].Menn[list[place]];\n var kvinner = befolkning.data[i].Kvinner[list[place]];\n addInfoRow(\"last_Pop\", menn + kvinner);\n }\n}", "title": "" }, { "docid": "8cffd3149f2d365bcaa5e5475bb44079", "score": "0.5476082", "text": "function show_header() {\n // overview not loaded correctly, so show error\n if (overview === null) {\n show_error('Failed to load or parse the election overview. See console for more info.');\n } else {\n var header = '<h4>' + escapeHtml(overview.title) + ' (<a target=\"_blank\" href=\"' + escapeHtml(overview.info) + '\">info</a>) am ' + escapeHtml(overview.date.slice(0,10)) + ' (<a target=\"_blank\" href=\"' + escapeHtml(overview.data_source) + '\">quelle</a>)</h4>';\n document.getElementById('header_election').innerHTML = header;\n };\n \n // enable election loading button only when answer and statement finished loading as well\n if (party_loaded\n && opinion_loaded) {\n document.getElementById('button_load_election').disabled = false;\n };\n}", "title": "" }, { "docid": "f1202cc9532264c88a40ff7f9573a82a", "score": "0.5474557", "text": "function displayGeneralOrderInfo() {\n let ordersToday = ordersRepo.getOrdersByDate(dateToday);\n domUpdates.hideElement('.div--customer-order-info');\n domUpdates.showElement('.div--general-order-info');\n updateOrdersTable(ordersToday, '.table--orders-today');\n}", "title": "" }, { "docid": "351fca8f52e2cffa50dfcf3c6ea64899", "score": "0.54702353", "text": "function displayTableHead(objectArray) {\r\n let displayedResults = \"<tr>\";\r\n let properties = Object.keys(objectArray[0])\r\n for (let i = 0; i < properties.length; i++) {\r\n displayedResults += `<td>${properties[i]}</td>`;\r\n }\r\n displayedResults += \"</tr>\";\r\n tableHeadTarget.innerHTML = displayedResults;\r\n}", "title": "" }, { "docid": "96c61b26188cdb40211a5fd2ec65c2d8", "score": "0.5469163", "text": "function display()\r\n { \r\n var h = document.createElement('hr');\r\n var tr = document.createElement('tr');\r\n var td1 = document.createElement('td');\r\n var td2 = document.createElement('td'); \r\n var td3 = document.createElement('td'); \r\n\r\n tr.id = \"last\";\r\n td1.innerText = \"Total\"\r\n td2.innerText = total_items;\r\n td2.id = \"total_items\";\r\n td3.innerText = \"$\" + sum;\r\n td3.id = \"sum\";\r\n \r\n table.appendChild(h);\r\n table.appendChild(tr);\r\n tr.appendChild(td1);\r\n tr.appendChild(td2);\r\n tr.appendChild(td3);\r\n\r\n event();\r\n\r\n }", "title": "" }, { "docid": "b4c32ee4b051a7b743ba122fd48aeb6e", "score": "0.5465368", "text": "function table() {\n\tvar tableLayout = \"<tr><th>Position</th><th>Team</th><th>Matches</th><th>GD</th><th>Points</th></tr>\";\n\tdocument.getElementById('table').innerHTML += tableLayout\n\tfor (i = 0; i < objectTeams.length; i++) {\n\t\tvar position = i+1;\n\t\tvar gd = objectTeams[i].goals - objectTeams[i].conceded;\n\t\tvar matches = objectTeams[i].matches;\n\t\tvar teamInfo = \"<tbody><tr><td>\"+position+\"</td><td>\"+objectTeams[i].team+\"</td><td>\"+matches+\"</td></td>\"+\"</td><td>\"+gd+\"</td><td>\"+objectTeams[i].points+\"</td></tr></tbody>\";\n\t\tdocument.getElementById('table').innerHTML += teamInfo;\n\t}\n}", "title": "" }, { "docid": "ef1b38f3576da5197cefee08b51b1877", "score": "0.5463226", "text": "function showEdition(d){\n\n\t// select container elements\n\tvar $detailsContainer = $(\"#detail-area\");\n\n\t// build header elements\n\tvar header = `<h3>${d.EDITION}</h3>`\n\n\t// build a table to hold detailed info\n\tvar $table = $('<table class=\"mx-auto\">');\n\tvar $tbody = $table.append('<tbody />').children('tbody');\n\t$tbody.append('<tr />').children('tr:last')\n\t\t.append(\"<td>Winner</td>\")\n\t\t.append(`<td>${d.WINNER}</td>`);\n\n\t$tbody.append('<tr />').children('tr:last')\n\t\t.append(\"<td>Goals</td>\")\n\t\t.append(`<td>${d.GOALS}</td>`);\n\n\t$tbody.append('<tr />').children('tr:last')\n\t\t.append(\"<td>Average Goals</td>\")\n\t\t.append(`<td>${d.AVERAGE_GOALS}</td>`);\n\n\t$tbody.append('<tr />').children('tr:last')\n\t\t.append(\"<td>Matches</td>\")\n\t\t.append(`<td>${d.MATCHES}</td>`);\n\n\t$tbody.append('<tr />').children('tr:last')\n\t\t.append(\"<td>Teams</td>\")\n\t\t.append(`<td>${d.TEAMS}</td>`);\n\n\t$tbody.append('<tr />').children('tr:last')\n\t\t.append(\"<td>Average Attendance</td>\")\n\t\t.append(`<td>${d.AVERAGE_ATTENDANCE}</td>`);\n\n\t// udpate the DOM\n\t$detailsContainer.html(header)\n\t\t.append($table)\n\n}", "title": "" }, { "docid": "a9853ec92fc9fa2d914b40eb3ad4905b", "score": "0.5462029", "text": "function display() {\n \n connection.query('SELECT * FROM products', function(error, response) {\n if (error) throw err;\n \n var theDisplayTable = new Table({\n head: ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity'],\n colWidths: [10, 30, 18, 10, 14]\n });\n for (i = 0; i < response.length; i++) {\n theDisplayTable.push(\n [response[i].item_id, response[i].product_name, response[i].department_name, response[i].price, response[i].stock_quantity]\n );\n }\n console.log(theDisplayTable.toString());\n start();\n });\n}", "title": "" }, { "docid": "61201ad93a10925dd6c6b278a068a0a2", "score": "0.5461213", "text": "function runAuthorShow() {\n var author = getAuthorShowAuthor();\n $(\"table.stacked.tableList > tbody > tr\").each(function(){\n var tr = $(this);\n var title = getAuthorShowTitle(tr);\n\n var onSearchSuccess = function(url, linkHtml) {\n // show it below the overdrive section\n $(linkHtml + \"<br/>\").insertBefore(tr.find(\"td\").eq(1).find(\"span.greyText.smallText.uitext\"));\n };\n\n search(title, author, onSearchSuccess);\n });\n}", "title": "" }, { "docid": "8f34211d2cb362061be4a73f4ba0bdf6", "score": "0.5460654", "text": "function getOverview(description) {\n\n var overview = \"\";\n if (description) {\n overview = description;\n } else {\n overview = \"n/d\";\n }\n\n return overview;\n }", "title": "" }, { "docid": "18d044ed8f77ccab2ab2f28ee99c9620", "score": "0.5452944", "text": "function showTable(columns, values) {\n record.rows = columns;\n record.getBranchRecord = getBranchRecord;\n record.getBranchSum = getBranchSum;\n $rootScope.$broadcast(\"displayTable\", record);\n }", "title": "" }, { "docid": "18d044ed8f77ccab2ab2f28ee99c9620", "score": "0.5452944", "text": "function showTable(columns, values) {\n record.rows = columns;\n record.getBranchRecord = getBranchRecord;\n record.getBranchSum = getBranchSum;\n $rootScope.$broadcast(\"displayTable\", record);\n }", "title": "" }, { "docid": "18d044ed8f77ccab2ab2f28ee99c9620", "score": "0.5452944", "text": "function showTable(columns, values) {\n record.rows = columns;\n record.getBranchRecord = getBranchRecord;\n record.getBranchSum = getBranchSum;\n $rootScope.$broadcast(\"displayTable\", record);\n }", "title": "" }, { "docid": "9fd88c2bc67dc9d53446d0514498dc19", "score": "0.54511666", "text": "function showTable() {\n tableData.forEach((ufoData) => {\n let row = tbody.append(\"tr\");\n Object.values(ufoData).forEach((value) => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" } ]
a2014e3a873bd234460707ba95b3263d
Draws/Updates x and y axes
[ { "docid": "a87b20a2c45a390210f697602ba173cd", "score": "0.62777555", "text": "function updateAxes() {\n\n // TIME AXIS\n timeAxis.scale(hour2X);\n\n var timeAxisContainer = svg\n .selectAll('g.x-axis')\n .data([1]);\n\n timeAxisContainer\n .enter()\n .append('g')\n .classed('x-axis axis', true)\n .attr('transform', `translate(${padding.left}, ${padding.top})`);\n\n timeAxis\n .tickPadding(20)\n .tickSize(-chartSize[1])\n .ticks([24]);;\n\n timeAxisContainer.call(timeAxis);\n\n // DISTANCE AXIS\n distanceAxis.scale(distance2Y);\n\n var distanceAxisContainer = svg\n .selectAll('g.y-axis')\n .data([1]);\n\n distanceAxisContainer\n .enter()\n .append('g')\n .classed('y-axis axis', true)\n .attr('transform', `translate(0, ${padding.top})`);\n\n distanceAxis\n .tickSize(-size[0])\n .ticks([5]);\n\n distanceAxisContainer\n .transition()\n .duration(500)\n .call(distanceAxis)\n .selectAll('text')\n .attr('x', 40)\n .attr('dy', -5);\n }", "title": "" } ]
[ { "docid": "e84873588a4a5a02b1fb4dd06484a7d2", "score": "0.69482064", "text": "draw() {\n\t\tthis.context.clearRect(0, 0, this.width, this.height);\n\t\tif (this.baselineY !== undefined) {\n\t\t\tthis.drawBaselineY();\n\t\t}\n\t\tif (this.values.length > 0) {\n\t\t\tthis.plotValues();\n\t\t}\n\t\tthis.drawAxisX();\n\t\tthis.drawAxisY();\n\t\tif (this.drawLabels) {\n\t\t\tthis.drawAllLabels();\n\t\t}\n\t}", "title": "" }, { "docid": "d7a44abc7f3dff66395992312f425b49", "score": "0.69194865", "text": "function drawAxes() {\n}", "title": "" }, { "docid": "2d1d66ecb6c5c2b4b023337511a42ad2", "score": "0.6764587", "text": "_drawAxes() {\n const cw = this.totalWidth / this.width;\n const ch = this.totalHeight / this.height;\n this._ctx.fillStyle = \"black\";\n /* Draw vertical axes */\n for (let i = 0; i <= this.width; ++i) {\n this._ctx.beginPath();\n this._ctx.moveTo(i * cw, 0);\n this._ctx.lineTo(i * cw, this.totalHeight);\n this._ctx.stroke();\n }\n /* Draw horizontal axes */\n for (let i = 0; i <= this.height; ++i) {\n this._ctx.beginPath();\n this._ctx.moveTo(0, i * ch);\n this._ctx.lineTo(this.totalWidth, i * ch);\n this._ctx.stroke();\n }\n }", "title": "" }, { "docid": "ee95b7773b1d8cdd91cb51a2dd1ccec0", "score": "0.6731489", "text": "function drawAxis(){\n svg.select('.x-axis-group.axis')\n .attr('transform', 'translate(0,' + chartHeight + ')')\n .call(xAxis);\n\n svg.select('.y-axis-group.axis')\n .call(yAxis);\n }", "title": "" }, { "docid": "7123f5536b4477b8f4fc4ed8115d75e9", "score": "0.67217374", "text": "function redraw() {\n\t\t\t\n\t\t\t// hide tooltip and hover states\n\t\t\tif (tracker.resetTracker) {\n\t\t\t\ttracker.resetTracker();\n\t\t\t}\n\t\t\n\t\t\t// render the axis\n\t\t\trender();\t\t\t\n\t\t\t\n\t\t\t// move plot lines and bands\n\t\t\teach(plotLinesAndBands, function(plotLine) {\n\t\t\t\tplotLine.render();\n\t\t\t});\n\t\t\t\n\t\t\t// mark associated series as dirty and ready for redraw\n\t\t\teach(associatedSeries, function(series) {\n\t\t\t\tseries.isDirty = true;\n\t\t\t});\n\t\t\t\t\t\t\n\t\t}", "title": "" }, { "docid": "e6f8a6226792edbc0302182c864c8460", "score": "0.66949415", "text": "function drawAxes(){\n\n // draw the x-axis\n svg.append(\"g\")\n .attr(\"transform\", \"translate(0,\" + height + \")\") \n .attr(\"class\", \"x axis\")\n .call(xAxis);\n\n\n // draw the y-axis\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n}", "title": "" }, { "docid": "52a08ef75dcf9615df8600104fb0c8b6", "score": "0.6678588", "text": "function drawAxes(xAxis, xAxisSel, yAxis, yAxisSel) {\n xAxisSel.call(xAxis);\n yAxisSel.call(yAxis);\n\n}", "title": "" }, { "docid": "615c400090d5b9eb02f003d5c863c353", "score": "0.6649063", "text": "drawaxes (xlabel,ylabel){\t\t\n\t\tif(typeof(xlabel)==='undefined') xlabel = 'x';\n\t\tif(typeof(ylabel)==='undefined') ylabel = 'y';\t\t\n\t\tthis.ctx.strokeStyle = '#000000';\n\t\tthis.ctx.lineWidth = 2;\n\t\tthis.ctx.beginPath() ;\n\t\tthis.ctx.moveTo(this.x_min,this.y_orig);\n\t\tthis.ctx.lineTo(this.x_max,this.y_orig);\n\t\tthis.ctx.moveTo(this.x_orig,this.y_min);\n\t\tthis.ctx.lineTo(this.x_orig,this.y_max);\n\t\tthis.ctx.stroke();\n\t\t//axis labels\n\t\tthis.ctx.font = \"12pt Arial\";\n\t\tthis.ctx.fillStyle = '#000000';\n\t\tthis.ctx.textAlign = \"left\";\n\t\tthis.ctx.textBaseline = \"top\";\n\t\tthis.ctx.fillText(xlabel,this.x_max + 0.75 * this.tw,this.typos - this.th / 2);\n\t\tthis.ctx.fillText(ylabel,this.txpos + this.tw / 2 +5,this.y_max - 1.5 * this.th);\n\t}", "title": "" }, { "docid": "9e9970a5ba03a214eff893081819ee9c", "score": "0.66347885", "text": "function redraw() {\n\n // hide tooltip and hover states\n if (tracker.resetTracker) {\n tracker.resetTracker();\n }\n\n // render the axis\n render();\n\n // move plot lines and bands\n each(plotLinesAndBands, function(plotLine) {\n plotLine.render();\n });\n\n // mark associated series as dirty and ready for redraw\n each(associatedSeries, function(series) {\n series.isDirty = true;\n });\n\n }", "title": "" }, { "docid": "919ba127bfcc32631c207cf8b4275e87", "score": "0.6571402", "text": "function drawAxes() {\n ctx.beginPath();\n ctx.moveTo(40,23.6);\n ctx.lineTo(40,260);\n ctx.lineTo(640,260);\n ctx.strokeStyle=\"black\";\n ctx.stroke();\n }", "title": "" }, { "docid": "e86b0331ffa0d70016aaf6020190305f", "score": "0.65486455", "text": "function drawAxis(params) {\n\t\tif (params.init) {\n\t//-------------- Draw the gridlines and axes ------------------\n\t\t\t// Draw the gridlines\n\t\t\tthis.append('g') // this refers to chart var; adds group\n\t\t\t\t.call(params.gridlines) // resets yGridlines var\n\t\t\t\t.classed('gridline', true) // gives group class of gridline\n\t\t\t\t.attr(\"transform\", \"translate(0,0)\"); //transform is set to 0,0\n\t\t\t// Add correct attributes of x axis\n\t\t\taxisOptions.call(this, axisLabels, params);\n\t\t\t// Draw the y axis\n\t\t\tthis.append(\"g\")\n\t\t\t\t.classed(\"y axis\", true)\n\t\t\t\t.attr(\"transform\", \"translate(\" + 0 + \",\" + 0 + \")\")\n\t\t\t\t.call(params.axis.y);\n\t\t\t// Draw y label\n\t\t\tthis.select('.y.axis')\n\t\t\t\t.append(\"text\")\n\t\t\t\t.attr(\"x\", 0)\n\t\t\t\t.attr(\"y\", 0)\n\t\t\t\t.style(\"text-anchor\", \"middle\")\n\t\t\t\t.attr(\"transform\", \"translate(-50,\" + height/2 + \") rotate(-90)\");\n\t\t\t\t//.text(axisLabels.y);\n\t\t\t// Draw x label\n\t\t\tthis.select(\".x.axis\")\n\t\t\t\t.append(\"text\")\n\t\t\t\t.attr(\"x\", 0)\n\t\t\t\t.attr(\"y\", 0)\n\t\t\t\t.style(\"text-anchor\", \"middle\")\n\t\t\t\t.attr(\"transform\", \"translate(\" + width/2 + \",80)\");\n\t\t\t\t//.text(axisLabels.x);\n\t\t} else if (!params.init) {\n\t\t//-----------------Update info--------------------\n\t\t\tthis.selectAll(\"g.x.axis\")\n\t\t\t\t.transition()\n\t\t\t\t.duration(500)\n\t\t\t\t.ease(\"bounce\")\n\t\t\t\t.delay(500)\n\t\t\t\t.call(params.axis.x);\n\t\t\tthis.selectAll(\".x-axis-label\")\n\t\t\t\t.style('text-anchor', 'end')\n\t\t\t\t.attr(\"dx\", -9)\n\t\t\t\t.attr(\"dy\", 8)\n\t\t\t\t.attr('transform', 'translate(0,0) rotate(-45)');\n\t\t\tthis.selectAll(\"g.y.axis\")\n\t\t\t\t.transition()\n\t\t\t\t.duration(500)\n\t\t\t\t.ease(\"bounce\")\n\t\t\t\t.delay(500)\n\t\t\t\t.call(params.axis.y);\n\t\t}\n\t}", "title": "" }, { "docid": "9b9bc2c9a10958ad2bb06217e494da2e", "score": "0.65281874", "text": "function updateChart() {\n\n // What are the selected boundaries?\n extent = d3.event.selection\n\n // If no selection, back to initial coordinate. Otherwise, update X axis domain\n if (!extent) {\n if (!idleTimeout) return idleTimeout = setTimeout(idled, 350); // This allows to wait a little bit\n x.domain(d3.extent(data, function (d) { return d.date; }))\n } else {\n x.domain([x.invert(extent[0]), x.invert(extent[1])])\n line.select(\".brush\").call(brush.move, null) // This remove the grey brush area as soon as the selection has been done\n }\n\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n line\n .selectAll('.line')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function (d) { return x(d.date) })\n .y(function (d) { return y(d.value) })\n )\n }", "title": "" }, { "docid": "0d6a6178e0dec713be9c9e0aee1001b7", "score": "0.6490111", "text": "update(){\n this.draw(this.x,this.y,this.w,this.h,this.fillColour);\n }", "title": "" }, { "docid": "521b9c1fc280ff49f30b33489399ce07", "score": "0.6463179", "text": "renderAxes() {\n // x axis\n this.drawLine(0+this.axesPadding+this.axesLineWidth/2, 0+this.axesPadding, 0+this.axesPadding+this.axesLineWidth/2, 0+this.height-this.axesPadding, this.axesColor, this.axesLineWidth);\n this.drawText('Time', 0+this.width/2-(this.axesPadding/2), 0+this.height-(this.axesPadding/2), 0, this.axesFont, this.fontColor);\n this.drawText(this.xMin, 0+(this.axesPadding), 0+this.height-(this.axesPadding/2), 0, this.graphFont, this.fontColor);\n this.drawText(this.xMax, 0+this.width-(this.axesPadding), 0+this.height-(this.axesPadding/2), 0, this.graphFont, this.fontColor);\n // y axis\n this.drawLine(0+this.axesPadding, 0+this.height-this.axesPadding-this.axesLineWidth/2, 0+this.width-this.axesPadding, 0+this.height-this.axesPadding-this.axesLineWidth/2, this.axesColor, this.axesLineWidth);\n this.drawText('Value', 0+(this.axesPadding/2), 0+this.height/2-(this.axesPadding/2), 90, this.axesFont, this.fontColor);\n this.drawText(this.yMin, 0+(this.axesPadding/2), 0+this.height-(this.axesPadding)-(20), 90, this.graphFont, this.fontColor);\n this.drawText(this.yMax, 0+(this.axesPadding/2), 0+(this.axesPadding)+(20), 90, this.graphFont, this.fontColor);\n }", "title": "" }, { "docid": "3ef61f42a900abfb52b7e21a4a45db8c", "score": "0.64305836", "text": "function updateChart() {\n \n // What are the selected boundaries?\n extent = d3.event.selection\n \n // If no selection, back to initial coordinate. Otherwise, update X axis domain\n if(!extent){\n if (!idleTimeout) return idleTimeout = setTimeout(idled, 350); // This allows to wait a little bit\n x.domain([ 4,8])\n }else{\n x.domain([ x.invert(extent[0]), x.invert(extent[1]) ])\n line.select(\".brush\").call(brush.move, null)\n //line2.select(\".brush\").call(brush.move, null) // This remove the grey brush area as soon as the selection has been done\n }\n \n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x).tickFormat(d3.timeFormat(\"%d/%HZ\")))\n line\n .select('.line')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d) { return x(new Date(d.time)) })\n .y(function(d) { return y(d.dewpt) })\n )\n line2\n .select('.line2')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d) { return x(new Date(d.time)) })\n .y(function(d) { return y(d.temp) })\n )\n\n }", "title": "" }, { "docid": "0b91fdfefb3d1637e67f327c3893d55f", "score": "0.63645554", "text": "function draw() {\r\n ctx.beginPath();\r\n ctx.moveTo(prevX, prevY);\r\n ctx.lineTo(currX, currY);\r\n ctx.strokeStyle = x;\r\n ctx.lineWidth = y;\r\n ctx.stroke();\r\n ctx.closePath();\r\n}", "title": "" }, { "docid": "f795d3667017a6a20761cbacca9a820a", "score": "0.6363919", "text": "function redraw() {\n context.strokeStyle = 'blue';\n context.lineWidth = '5';\n context.strokeRect(0, 0, window.innerWidth, window.innerHeight);\n }", "title": "" }, { "docid": "2085539c8b2eed4833a5b36cbd0982ed", "score": "0.6355169", "text": "function drawAxes() {\n\n graphContext.save();\n\n graphContext.strokeStyle = 'darkblue';\n graphContext.fillStyle = 'darkblue';\n graphContext.lineWidth = 2;\n\n // Draw the horizontal x axis.\n graphContext.beginPath();\n graphContext.moveTo(0, H/2);\n graphContext.lineTo(W, H/2);\n graphContext.stroke();\n\n // Draw the vertical y axis.\n graphContext.beginPath();\n graphContext.moveTo(W/2, 0);\n graphContext.lineTo(W/2, H);\n graphContext.stroke();\n\n // Draw a small triangular arrowhead at the end of the x axis.\n graphContext.beginPath();\n graphContext.moveTo(W - 10, H/2 - 10);\n graphContext.lineTo(W - 10, H/2 + 10);\n graphContext.lineTo(W, H/2);\n graphContext.fill();\n\n // Draw a small triangular arrowhead at the end of the y axis.\n graphContext.beginPath();\n graphContext.moveTo(W/2 - 10, 10);\n graphContext.lineTo(W/2 + 10, 10);\n graphContext.lineTo(W/2, 0);\n graphContext.fill();\n\n graphContext.restore();\n}", "title": "" }, { "docid": "26ba7aa06efba7a79f028945c6e97c0b", "score": "0.63322777", "text": "function updateChart() {\n\n console.log(\"here\");\n // What are the selected boundaries?\n extent = d3.event.selection\n\n // If no selection, back to initial coordinate. Otherwise, update X axis domain\n if(!extent){\n if (!idleTimeout) return idleTimeout = setTimeout(idled, 350); // This allows to wait a little bit\n x.domain([ 4,8])\n }else{\n x.domain([ x.invert(extent[0]), x.invert(extent[1]) ])\n line.select(\".brush\").call(brush.move, null) // This remove the grey brush area as soon as the selection has been done\n }\n\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n\n dataReady.forEach(dt => {\n line\n .select(\".\" + dt.name)\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .defined(function(d) { return d.value != 0; })\n .x(function(d) { return x(d.Date) })\n .y(function(d) { return y(d.value) })\n )\n });\n }", "title": "" }, { "docid": "2d8602fb1e89a7ee383a083aa15a67a2", "score": "0.62878376", "text": "drawPlot(){\n // set the x and y scales from the data\n this._setScales();\n\n //set color scale\n this._setColorScale();\n\n // draw the data points\n this._drawPoints();\n \n // add the axises\n this._drawAxises();\n\n // add the title and legend\n this._drawTitleLegend();\n }", "title": "" }, { "docid": "b2f0529826253c91b86d14caa1bfe064", "score": "0.6256302", "text": "function updateChart() {\n\n extent = d3.event.selection\n\n // If no selection, back to initial coordinate. Otherwise, update X axis domain\n if (!extent) {\n if (!idleTimeout) return idleTimeout = setTimeout(idled, 500); // This allows to wait a little bit\n x.domain([4, 8])\n } else {\n x.domain([x.invert(extent[0]), x.invert(extent[1])])\n svg.select(\".brush\").call(brush.move, null) // This remove the grey brush area as soon as the selection has been done\n }\n\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x));\n\n svg\n .select('.originalStock')\n .transition()\n .duration(1000)\n .attr(\"d\", valueLine);\n\n svg\n .select('.predictedStock')\n .transition()\n .duration(1000)\n .attr(\"d\", valueLine);\n}", "title": "" }, { "docid": "4196e2c7b513b34d2a69a7b55522c429", "score": "0.624593", "text": "function drawAxes (graphConfig) {\n graphConfig.rootElem\n .append('g')\n .attr('class', 'x axis')\n .attr('transform', translateCmd(0, graphConfig.scales.height))\n .call(graphConfig.axes.x)\n graphConfig.rootElem\n .append('g')\n .attr('class', 'y axis')\n .call(graphConfig.axes.y)\n\n if (_.isNaN(graphConfig.scales.y(0))) {\n return\n }\n\n if (graphConfig.symmetricalYAxis) {\n graphConfig.rootElem\n .append('line')\n .attr('class', 'y axis supplemental')\n .attr('x1', 0)\n .attr('x2', graphConfig.scales.width)\n .attr('y1', graphConfig.scales.y(0))\n .attr('y2', graphConfig.scales.y(0))\n .attr('stroke', '#666')\n .style('stroke-width', 0.6)\n }\n\n // add a clickable region for changing the dates\n graphConfig.rootElem\n .append('rect')\n .attr('height', 20)\n .attr('width', graphConfig.scales.width + GRAPH_PADDING.right)\n .attr('transform', translateCmd(0, graphConfig.scales.height))\n .attr('class', 'o-x-axis-click-target')\n .on('click', () => bus.$emit('change-dates'))\n\n // add a symbol suggesting zoom\n if (!graphConfig.zoom) {\n graphConfig.rootElem\n .append('text')\n .attr('font-family', 'FontAwesome')\n .attr('font-size', 18)\n .attr('fill', '#666')\n .attr('transform', `translate(${GRAPH_PADDING.left * -0.95},0)`)\n .on('click', (() =>\n () => {\n if (!graphConfig.zoom) {\n onGraphZoom({ graphConfig })\n }\n }\n )())\n .style('cursor', 'pointer')\n .text(() => '\\uf00e')\n }\n}", "title": "" }, { "docid": "d1fc02858ed9d94e925c0b7ef6a61024", "score": "0.62420195", "text": "function eventOnXAxis(){\n\tmodifyDataX(); \n updateDomains(); \n updateAxes(); \n updateDrawing();\n}", "title": "" }, { "docid": "c54454c03c3be96fd8cdea0873d5979c", "score": "0.6235019", "text": "function updatePlot()\r\n { \r\n x = d3.scaleLinear()\r\n .domain([0, d3.max(plotDataSet, function(d) { return d[xLabel]; })])\r\n .range([0, bar_width]);\r\n y = d3.scaleLinear()\r\n .domain([0, d3.max(plotDataSet, function(d) { return d[yLabel]; })])\r\n .range([bar_width, 0]);\r\n\r\n svg.select(\".x-axis\")\r\n .call(d3.axisBottom(x).ticks(tickNumber));\r\n\r\n // Add X axis label\r\n svg.select(\".x-label\")\r\n .text(toUpper(nutritions[xLabel]));\r\n \r\n // Add Y axis\r\n svg.select(\".y-axis\")\r\n .call(d3.axisLeft(y).ticks(tickNumber));\r\n\r\n // Add Y axis label;\r\n svg.select(\".y-label\")\r\n .text(toUpper(nutritions[yLabel]));\r\n \r\n // Add dots for scatter plots\r\n var i;\r\n for(i = 0; i < root.children.length; i++)\r\n {\r\n var node = root.children[i];\r\n d3.select(node.dot)\r\n .attr(\"cy\", function (node) { \r\n return y(fixYaxis(node.data[nutritions[yLabel]])); }) // y -axis value\r\n .attr(\"cx\", function (node) { \r\n return x(fixXaxis(node.data[nutritions[xLabel]]));}) // x-axis value\r\n .attr(\"r\", dotSize)\r\n .style(\"opacity\", .7)\r\n .style(\"fill\", colornone);\r\n }\r\n }", "title": "" }, { "docid": "e77e13017d19d63fe88254e79e714d1e", "score": "0.6232543", "text": "function resetAxes() {\n clear();\n \n drawLine(u(0), v(-canvas.height / 2), u(0), v(canvas.height / 2)); // y-axis\n drawLine(u(-canvas.width / 2), v(0), u(canvas.width / 2), v(0)); // x-axis\n\n // x-axis scale\n for (var i = 0; i < canvas.width; i++) {\n drawLine(u(i ), v(-0.1), u(i ), v(0.1));\n drawLine(u(-i), v(-0.1), u(-i), v(0.1));\n }\n \n // y-axis scale\n for (var i = 0; i < canvas.height; i++) { \n drawLine(u(-0.1), v(i ), u(0.1), v(i ));\n drawLine(u(-0.1), v(-i), u(0.1), v(-i));\n }\n }", "title": "" }, { "docid": "2014bdb2732bf207dbf20923c8d8850d", "score": "0.62319297", "text": "function redrawMainXAxis() {\n\n xScale.range([0, width]);\n\n mouse_tracker.transition().attr('width', width);\n mainClip.transition().attr('width', width);\n x_axis_elem.transition().call(xAxis);\n yAxis.tickSizeInner(-width);\n\n }", "title": "" }, { "docid": "8cc78025cddab70551a8445806155b6b", "score": "0.62120986", "text": "function drawAxes(Tx) {\r\n // Draw X axis\r\n context.beginPath();\r\n moveToTx(0, 0, 0, Tx);\r\n lineToTx(200, 0, 0, Tx);\r\n context.strokeStyle = 'red';\r\n context.stroke();\r\n context.closePath();\r\n // Draw Y axis\r\n context.beginPath();\r\n moveToTx(0, 0, 0, Tx);\r\n lineToTx(0, 200, 0, Tx);\r\n context.strokeStyle = 'yellow';\r\n context.stroke();\r\n context.closePath();\r\n // Draw Z axis\r\n context.beginPath();\r\n moveToTx(0, 0, 0, Tx);\r\n lineToTx(0, 0, 200, Tx);\r\n context.strokeStyle = 'blue';\r\n context.stroke();\r\n context.closePath();\r\n }", "title": "" }, { "docid": "724d1c6ea50e119e3ec19d9572412b34", "score": "0.61949855", "text": "draw() {\n this._ctx.fillStyle = \"white\";\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n this.map((c) => this._drawCell(c));\n if (this._showGrid) {\n this._drawAxes();\n }\n }", "title": "" }, { "docid": "0a7b4092b7d4865524794eabc8e127e2", "score": "0.61744046", "text": "function drawAxes() {\n return Plotly.Axes.doTicks(gd, 'redraw');\n }", "title": "" }, { "docid": "9ec5d1bff2e628957c7e7d48b17ba2bd", "score": "0.6140031", "text": "function updateAxis() {\n // functions here found above csv import\n // updates x scale for new data\n xLinearScale = xScale(data, chosenXAxis);\n yLinearScale = yScale(data, chosenYAxis);\n\n // updates x axis with transition\n xAxis = renderXAxes(xLinearScale, xAxis);\n yAxis = renderYAxes(yLinearScale, yAxis);\n\n // updates circles with new x,y values\n circlesGroup = renderCircles(circlesGroup, xLinearScale, yLinearScale, chosenXAxis, chosenYAxis);\n textcirclesGroup = renderTextCircles(textcirclesGroup, xLinearScale, yLinearScale, chosenXAxis, chosenYAxis);\n \n // updates tooltips with new info\n circlesGroup = updateToolTip(chosenXAxis, chosenYAxis, circlesGroup);\n textcirclesGroup = updateToolTip(chosenXAxis, chosenYAxis, textcirclesGroup);\n\n // changes classes to change bold text\n // x - axis\n if (chosenXAxis === \"poverty\") {\n povertyLabel\n .classed(\"active\", true)\n .classed(\"inactive\", false);\n ageLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n incomeLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n } else if (chosenXAxis === \"age\") {\n ageLabel\n .classed(\"active\", true)\n .classed(\"inactive\", false);\n povertyLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n incomeLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n } else if (chosenXAxis === \"income\") {\n incomeLabel\n .classed(\"active\", true)\n .classed(\"inactive\", false);\n povertyLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n ageLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n };\n\n // y - axis\n if (chosenYAxis === \"healthcare\") {\n healthcareLabel\n .classed(\"active\", true)\n .classed(\"inactive\", false);\n smokesLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n obesityLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n } else if (chosenYAxis === \"smokes\") {\n smokesLabel\n .classed(\"active\", true)\n .classed(\"inactive\", false);\n healthcareLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n obesityLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n } else if (chosenYAxis === \"obesity\") {\n obesityLabel\n .classed(\"active\", true)\n .classed(\"inactive\", false);\n smokesLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n healthcareLabel\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n };\n }", "title": "" }, { "docid": "635e5507c1b9142f00d2249f256e3ee4", "score": "0.6129223", "text": "function drawAxis() {\n svg.select('.x-axis-group.axis').attr('transform', 'translate(0, ' + chartHeight + ')').call(xAxis);\n\n svg.select('.y-axis-group.axis').call(yAxis);\n\n svg.selectAll('.y-axis-group .tick text').call(wrapText, margin.left - yAxisPaddingBetweenChart);\n }", "title": "" }, { "docid": "7e7c17956f546a5dfd91fc6558db7821", "score": "0.6128636", "text": "updateAxes(xMin = null, xMax = null, yMin = null, yMax = null) {\n this.commitSelections(this.elements.selector.value);\n // render with no axis arguments to get defaults\n this.render(this.elements.selector.value, xMin, xMax, yMin, yMax);\n }", "title": "" }, { "docid": "0d690a5f6cfe3ecf8685868180859ba2", "score": "0.61259997", "text": "function draw() {\n ctx.beginPath();\n ctx.moveTo( prevX, prevY );\n ctx.lineTo( currX, currY );\n ctx.strokeStyle = 'black';\n ctx.lineWidth = 2;\n ctx.stroke();\n ctx.closePath();\n }", "title": "" }, { "docid": "a58f615db49eb82e85c0274859cb7802", "score": "0.6124077", "text": "function draw() {\n console.log('draw');\n clearCanvas();\n drawBorders();\n colorBoxes();\n drawAdditionalLines();\n }", "title": "" }, { "docid": "136f10c7e1a19c889448aaa15f86ebd3", "score": "0.610031", "text": "drawAxis(height, width){\n\n const svgCosinePlot = d3.select(\"#svgCosinePlot\")\n\n // If axis exists but we are redrawing\n if(document.getElementById(\"x_axis_cosinePlot\") || document.getElementById(\"y_axis_cosinePlot\")){\n\n // remove current axis\n d3.select(\"#x_axis_cosinePlot\").remove();\n d3.select(\"#y_axis_cosinePlot\").remove();\n }\n\n // Drawing new axis\n\n // Creating axis domain based on pixel range for the plot\n let xscale = d3.scaleLinear()\n .domain([0, 2]) \n .range([ (1/10)*width, (9/10)*width ]);\n\n let yscale = d3.scaleLinear()\n .domain([4,-4]) \n .range([ (1/10)*height, (9/10)*height ]);\n\n // Configuring axis ticks\n let x_axis = d3.axisBottom()\n .scale(xscale);\n\n let y_axis = d3.axisLeft()\n .scale(yscale);\n\n // Adding the axis to the plot\n svgCosinePlot.append('g')\n .attr(\"id\",\"x_axis_cosinePlot\")\n .attr(\"transform\", \"translate(0,\" + height/2 + \")\")\n .attr(\"pointer-events\", \"none\")\n .call(x_axis);\n\n svgCosinePlot.append('g')\n .attr(\"id\",\"y_axis_cosinePlot\")\n .attr(\"transform\",\"translate(\" + (1/10)*width + \",0)\")\n .attr(\"pointer-events\", \"none\")\n .call(y_axis)\n \n }", "title": "" }, { "docid": "9c496c02f640afa698c68d5f2f7128b2", "score": "0.60911095", "text": "redraw() {\n ctx.beginPath();\n ctx.moveTo(prevX, prevY);\n ctx.lineTo(currX, currY);\n ctx.strokeStyle = x; //sets the color, gradient and pattern of stroke\n ctx.lineWidth = y; \n ctx.closePath(); //create a path from current point to starting point\n ctx.stroke(); //draws the path\n }", "title": "" }, { "docid": "f4ed92639961445f9ca29655e9a4fcfd", "score": "0.6090301", "text": "draw(x1, y1, x2, y2) {\r\n // get the vector (x1,y1)->(x2,y2)\r\n var ux = x2 - x1;\r\n var uy = y2 - y1;\r\n\r\n // get the unit vector\r\n ux /= this.board.tileSize;\r\n uy /= this.board.tileSize;\r\n\r\n // scale factor\r\n var a = 10;\r\n\r\n // adjust the end points of this line\r\n // do not want it cover the node svg element (for node click event)\r\n $(\"#board\").append(`<line x1=${x1 + a * ux} y1=${y1 + a * uy} x2=${x2 - a * ux} y2=${y2 - a * uy} stroke-width=\"10\" stroke=${this.players.currentPlayer.color}/>`);\r\n // refresh the svg\r\n $('#board').html($('#board').html() + \"\");\r\n }", "title": "" }, { "docid": "6202ff07dc09884836878b681b84ce20", "score": "0.60802954", "text": "function draw() {\n svg.selectAll(\"path.area\").attr(\"d\", function(d) { return area(d.values); });\n svg.selectAll(\"path.line\").attr(\"d\", function(d) { return line(d.values); });\n svg.select(\"g.x.axis\").call(xAxis);\n svg.select(\"g.y.axis\").call(yAxis);\n }", "title": "" }, { "docid": "547d6ffbb085b8fd40f13d14a735d5a8", "score": "0.6080133", "text": "function redraw(){\n\t\t\tcontext.clearRect(0, 0, width, height);\n\t\t\tredrawLinks();\n\t\t\t//redrawNodes();\n\t\t\tnode\n\t\t\t\t.classed(\"selected\", function(d){ return d.selected; })\n\t\t\t\t.attr('transform', function(d) {\n\t \t\treturn 'translate(' + x(d.x) + ',' + y(d.y) + ')';\n\t \t\t})\n\t\t}", "title": "" }, { "docid": "5805322d1dcbae774ef375ef319ada5b", "score": "0.60634613", "text": "function updateGraphics() {\n \t// $log.log(preDebugMsg + \"updateGraphics()\");\n\n\t\tif(myCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tmyCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t$log.log(preDebugMsg + \"no canvas to draw on!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(ctx === null) {\n\t\t\tctx = myCanvas.getContext(\"2d\");\n\t\t}\n\n \tW = myCanvas.width;\n \tif(typeof W === 'string') {\n \t\tW = parseFloat(W);\n \t}\n \tif(W < 1) {\n \t W = 1;\n \t}\n\n \tH = myCanvas.height;\n \tif(typeof H === 'string') {\n \t H = parseFloat(H);\n \t}\n \tif(H < 1) {\n \t H = 1;\n \t}\n\n\t\t// $log.log(preDebugMsg + \"Clear the canvas\");\n\t\tctx.clearRect(0,0, W,H);\n \tdrawW = W - leftMarg - rightMarg;\n \tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n \tdrawBackground(W, H);\n \tdrawSchematic();\n \tdrawSensors();\n\t}", "title": "" }, { "docid": "7cb7d8d5e438b54cd75017ae65b6864e", "score": "0.6060978", "text": "draw(x, y) {\n this.pencil.draw(x, y, this.size, this.color);\n }", "title": "" }, { "docid": "55f06d1ab6aaa2d86928d4702eb6a4f6", "score": "0.6051989", "text": "function redraw() {\n var i,\n l = _me.displayList().length,\n d,\n values;\n if (!_ctx) {\n console.log(this.name());\n }\n _ctx.clearRect(0, 0, _width, _height);\n for (i = 0; i < l; i += 1) {\n d = _me.displayList()[i];\n _ctx.save();\n /// Apply alpha\n _ctx.globalAlpha = d.alpha() / 100;\n /// Apply translation to rotate properly\n _ctx.translate(d.handleX(), d.handleY());\n /// Apply rotation\n _ctx.rotate(Danimate.utils.deg2rad(d.rotation()));\n /// Do the drawing\n values = d.drawingValues();\n// console.log(values);\n _ctx.drawImage.apply(_ctx, values);\n /// Reset context\n _ctx.restore();\n }\n }", "title": "" }, { "docid": "8432567fe865854ae2b49a6a45ff77db", "score": "0.60452616", "text": "function drawX(x, y) {\n\tcontext.beginPath();\n\tcontext.strokeStyle=\"#c52033\";\n\tcontext.lineWidth = 3.;\n\n\tcontext.moveTo(x-s_size/2, y-s_size/2);\n\tcontext.lineTo(x+s_size/2, y+s_size/2);\n\n\tcontext.moveTo(x-s_size/2, y+s_size/2);\n\tcontext.lineTo(x+s_size/2, y-s_size/2);\n\n\tcontext.stroke();\n\n\tcontext.closePath();\n}", "title": "" }, { "docid": "b266974f06a43363b69188228bb40656", "score": "0.60427576", "text": "function updateNewEdge(x, y) {\t\t\n\t\tnewEdge.set({ x2: x, y2: y });\t\t\n\t\tcanvas.renderAll();\t\t\n\t}", "title": "" }, { "docid": "d0d1ea2b09b9d20c08c932f8eedb5166", "score": "0.6032519", "text": "draw() {\n super.draw((ctx, x, y) => {\n Line.draw(ctx, x, y, this.lineWidth + x, y);\n });\n }", "title": "" }, { "docid": "7751e7d5a10d3f8067f9095b86e141d9", "score": "0.6031285", "text": "function drawX(x, y) {\n ctx.beginPath();\n ctx.strokeStyle = \"red\";\n ctx.lineWidth = \"4\"\n ctx.moveTo(x * size + 10, y * size + 10);\n ctx.lineTo(x * size + 30, y * size + 30);\n ctx.moveTo(x * size + 30, y * size + 10);\n ctx.lineTo(x * size + 10, y * size + 30);\n ctx.stroke()\n }", "title": "" }, { "docid": "ae8bb577c362a881e2bd411707d75fe6", "score": "0.60230666", "text": "function redraw() {\n for (let i = 0; i < points.length; i++) {\n let point = points[i];\n ctx.lineWidth = point.width;\n ctx.strokeStyle = point.color;\n if (point.id == \"md\") {\n ctx.beginPath();\n ctx.moveTo(point.x, point.y);\n } else {\n ctx.lineTo(point.x, point.y);\n ctx.stroke();\n }\n }\n ctx.strokeStyle = currStrokeStyle;\n ctx.lineWidth = currLineWidth;\n\n console.log(\"calling redraw\");\n socket.emit(\"redraw\", points);\n}", "title": "" }, { "docid": "38b3eac6e0ceb262da325fe6f3d693fb", "score": "0.6015249", "text": "function draw(e){\n if(!drawing) return;\n \n // Style the default tool - black & circular\n ctx.lineWidth = 10;\n ctx.lineCap = \"round\";\n updateColor(current_color);\n \n // Start moving the position\n ctx.lineTo(e.clientX,e.clientY);\n \n // Record starting coordinates\n start.x = e.clientX;\n start.y = e.clientY;\n storeCoordinate(start.x, start.y, plots);\n\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(e.clientX,e.clientY);\n storeCoordinate(e.clientX,e.clientY, plots);\n\n // Record end coordinates\n end.x = e.clientX;\n end.y = e.clientY;\n storeCoordinate(end.x, end.y, plots);\n }", "title": "" }, { "docid": "ed5dcb112634135e8f421d7cb2d72617", "score": "0.600651", "text": "function draw() {\n\n // To plot from edge to edge obtain the position of the axis and convert it to real units\n var xMin = -w.axis.position.x * w.scaleX.toUnits;\n var xMax = xMin + w.width * w.scaleX.toUnits;\n\n // Evaluate function in range.\n plot.clear();\n originalPlot.clear();\n for (var x = xMin; x <= xMax; x += 0.1 ) {\n originalPlot.addPoint(x, Math.pow(x, 2));\n plot.addPoint(x, controls.a.value * Math.pow(controls.b.value * (x + controls.c.value), 2) + controls.d.value);\n }\n\n}", "title": "" }, { "docid": "a90ef823460e8c15a69c7e24e756c5cc", "score": "0.6005453", "text": "function draw() {\n acceleration += accelerationRate;\n x += objSpeed + acceleration;\n ctx.strokeStyle = \"#000\";\n // ctx.fillStyle = 'red';\n ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n drawGrid();\n ctx.strokeStyle = \"red\";\n ctx.moveTo(startingPos, canvasHeight/2);\n ctx.lineTo(x, canvasHeight/2);\n ctx.setLineDash([]);\n ctx.stroke();\n ctx.beginPath();\n circles.forEach(circle => {\n ctx.beginPath();\n ctx.strokeStyle = circle.color;\n ctx.lineWidth = strokeLineWidth;\n circle.setRadius(circle.radius + speedOfSound);\n ctx.arc(circle.x, circle.y, circle.radius, 0, 2 * pi);\n ctx.stroke();\n });\n drawObject();\n xCoordDisplay.innerHTML = !zoomedIn ? ((x - scaleFactor/2) * 10).toFixed(2) : ((((x - scaleFactor/2) * 10).toFixed(2) - 900) / 10).toFixed(2);\n}", "title": "" }, { "docid": "5afed8837ba861bfd148165bf4955625", "score": "0.6003073", "text": "function draw () {\r\n // delivers the data\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n var y = 10;\r\n var x = 10;\r\n var graphWidth = canvas.width - 20;\r\n\r\n // update stackedGraphs\r\n for(var i = 0; i < stackedGraphs.length; i++) {\r\n var res = stackedGraphs[i].draw(updateData, ctx, x, y, graphWidth, 180);\r\n x = res[0];\r\n y = res[1] + 10;\r\n }\r\n\r\n // update simpleGraphs\r\n for(var i = 0; i < simpleGraphs.length; i++) {\r\n var res = simpleGraphs[i].draw(updateData, ctx, x, y, graphWidth, 60);\r\n x = res[0];\r\n y = res[1] + 10;\r\n }\r\n\r\n updateData.length = 0;\r\n setTimeout(drawHelper, 250);\r\n }", "title": "" }, { "docid": "1ec1a61056e0396b8b15e6235eb3a36e", "score": "0.60021186", "text": "function showAxes() {\n //Reveal everything\n notice.style.display = \"inline-block\";\n axes.style.display = \"inline-block\";\n console.log(\"Final user score -> Cultural: \" + cVal + \", Economic: \" + eVal + \", Authoritarian: \" + aVal); //Display score for testing\n\n /*==================== 2D AXES ====================== */\n\n //X axis\n var xCtx = xCanvas.getContext(\"2d\");\n\n //Constants for size of axes (all uniform height/width)\n var axisWidth = xCtx.canvas.width;\n var axisHeight = xCtx.canvas.height;\n var midWidth = axisWidth / 2;\n var midHeight = axisHeight / 2;\n\n //Create gradient\n var xGrd = xCtx.createLinearGradient(0, 0, axisWidth, 0);\n xGrd.addColorStop(0, \"#ffdf00\");\n xGrd.addColorStop(1, \"blue\");\n\n // Fill with gradient\n xCtx.fillStyle = xGrd;\n xCtx.fillRect(-.5, -.5, axisWidth, axisHeight);\n\n //Main line\n xCtx.moveTo(0, midHeight);\n xCtx.lineTo(axisWidth, midHeight);\n xCtx.stroke();\n\n //Left, middle, right bars\n xCtx.moveTo(0, midHeight + 12);\n xCtx.lineTo(0, midHeight - 12);\n xCtx.stroke();\n\n xCtx.moveTo(midWidth, midHeight + 12);\n xCtx.lineTo(midWidth, midHeight - 12);\n xCtx.stroke();\n\n xCtx.moveTo(axisWidth - 1, midHeight + 12);\n xCtx.lineTo(axisWidth - 1, midHeight - 12);\n xCtx.stroke();\n\n //User score point\n xCtx.beginPath();\n xCtx.arc(midWidth + (cVal * midWidth), midHeight, 10, 0, 2 * Math.PI);\n xCtx.stroke();\n xCtx.fillStyle = \"black\";\n xCtx.fill();\n\n //Y axis\n var yCtx = yCanvas.getContext(\"2d\");\n\n //Create gradient\n var yGrd = yCtx.createLinearGradient(0, 0, axisWidth, 0);\n yGrd.addColorStop(0, \"lime\");\n yGrd.addColorStop(1, \"magenta\");\n\n //Fill with gradient\n yCtx.fillStyle = yGrd;\n yCtx.fillRect(-.5, -.5, axisWidth, axisHeight);\n\n //Main line\n yCtx.moveTo(0, midHeight);\n yCtx.lineTo(axisWidth, midHeight);\n yCtx.stroke();\n\n //Left, middle, right bars\n yCtx.moveTo(0, midHeight + 12);\n yCtx.lineTo(0, midHeight - 12);\n yCtx.stroke();\n\n yCtx.moveTo(midWidth, midHeight + 12);\n yCtx.lineTo(midWidth, midHeight - 12);\n yCtx.stroke();\n\n yCtx.moveTo(axisWidth - 1, midHeight + 12);\n yCtx.lineTo(axisWidth - 1, midHeight - 12);\n yCtx.stroke();\n\n //User score point\n yCtx.beginPath();\n yCtx.arc(midWidth + (eVal * midWidth), midHeight, 10, 0, 2 * Math.PI);\n yCtx.stroke();\n yCtx.fillStyle = \"black\";\n yCtx.fill();\n\n //Z axis\n var zCtx = zCanvas.getContext(\"2d\");\n\n //Create gradient\n var zGrd = zCtx.createLinearGradient(0, 0, axisWidth, 0);\n zGrd.addColorStop(0, \"cyan\");\n zGrd.addColorStop(1, \"red\");\n\n // Fill with gradient\n zCtx.fillStyle = zGrd;\n zCtx.fillRect(-.5, -.5, axisWidth, axisHeight);\n\n //Main line\n zCtx.moveTo(0, midHeight);\n zCtx.lineTo(axisWidth, midHeight);\n zCtx.stroke();\n\n //Left, middle, right bars\n zCtx.moveTo(0, midHeight + 12);\n zCtx.lineTo(0, midHeight - 12);\n zCtx.stroke();\n\n zCtx.moveTo(midWidth, midHeight + 12);\n zCtx.lineTo(midWidth, midHeight - 12);\n zCtx.stroke();\n\n zCtx.moveTo(axisWidth - 1, midHeight + 12);\n zCtx.lineTo(axisWidth - 1, midHeight - 12);\n zCtx.stroke();\n\n //User score point\n zCtx.beginPath();\n zCtx.arc(midWidth + (aVal * midWidth), midHeight, 10, 0, 2 * Math.PI);\n zCtx.stroke();\n zCtx.fillStyle = \"black\";\n zCtx.fill();\n}", "title": "" }, { "docid": "47c25cbef0252b757c96c8c815c0d59c", "score": "0.5999654", "text": "draw() {\n fill(0);\n ellipse(this.xOff + this.x, this.yOff + this.y, 12, 12);\n fill(59,100,100);\n ellipse(this.xDir + this.x, this.yDir + this.y, 20, 20);\n }", "title": "" }, { "docid": "788f4828a69ba30a5a759fa666636884", "score": "0.5992443", "text": "draw() {\n this._context.beginPath();\n this._context.rect(this._x, this._y, this._width, this._height);\n this._context.stroke();\n this._context.closePath();\n }", "title": "" }, { "docid": "e314311f3b1d60b3afcd9e4a16d70ca5", "score": "0.5991753", "text": "draw() {\n this.ctx.fillRect(this.x, this.y, this.size, this.size);\n }", "title": "" }, { "docid": "753d83d4600c47bee186d846874371cf", "score": "0.59839255", "text": "function update_canvas_offsets(){\n // Set initial svg canvas offset\n var container = getById('svg_container');\n var top = 0;\n var left = 0;\n do{\n top += container.offsetTop;\n left += container.offsetLeft;\n container = container.offsetParent;\n }\n while(container != null);\n g['x_offset'] = left;\n g['y_offset'] = top;\n}", "title": "" }, { "docid": "590a718ec95f57bec0a0c06c0b17dc07", "score": "0.5983374", "text": "function updateGrid(x, y) {\n // update border coordinates\n if (activePointId === \"circle0\") {\n borderCoordinates.x1 = x;\n borderCoordinates.y1 = y;\n } else if (activePointId === \"circle1\") {\n borderCoordinates.x2 = x;\n borderCoordinates.y1 = y;\n } else if (activePointId === \"circle2\") {\n borderCoordinates.x2 = x;\n borderCoordinates.y2 = y;\n } else if (activePointId === \"circle3\") {\n borderCoordinates.x1 = x;\n borderCoordinates.y2 = y;\n } else {\n console.log(\"Error: point not selected\");\n }\n updateControlPoints();\n redrawGrid();\n}", "title": "" }, { "docid": "488e38b35878b24dc61ab679a5e64493", "score": "0.5981415", "text": "function update(){\n // Collect the new client width set new value for the point\n for(let i = 0; i < pointX.length; i++){ \n pointX[i] = pointX[i]*container.clientWidth/canvasWidth;\n pointY[i] = pointY[i]*(container.clientWidth*.5)/canvasHeight;\n }\n padding.left = padding.right = padding.left*container.clientWidth/canvasWidth;\n canvasWidth = container.clientWidth;\n canvasHeight = canvasWidth*.5;\n\n canvas.width = canvasWidth - padding.left - padding.right;\n canvas.height = canvasHeight;\n // Points updated now redraw\n draw();\n}", "title": "" }, { "docid": "655a180e848cde4ca2e777863914f5fc", "score": "0.5976654", "text": "drawHelper(graphics, x, y) {\n let bNeedSave = (x !== 0 || y !== 0);\n let gState = null;\n // Translate co-ordinates.\n if (bNeedSave) {\n // Save state.\n gState = graphics.save();\n graphics.translateTransform(x, y);\n }\n this.drawInternal(graphics);\n if (bNeedSave) {\n // Restore state.\n graphics.restore(gState);\n }\n }", "title": "" }, { "docid": "0e1aec99e3287c7202c5222e6feb39cb", "score": "0.59731823", "text": "draw() {\n rect(this.x, this.y, this.w, this.h);\n }", "title": "" }, { "docid": "0a6c92c959a2d2d165969d7f595c172c", "score": "0.59728724", "text": "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .attr('transform', 'translate(0,' + availableHeight + ')')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "title": "" }, { "docid": "0a6c92c959a2d2d165969d7f595c172c", "score": "0.59728724", "text": "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .attr('transform', 'translate(0,' + availableHeight + ')')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "title": "" }, { "docid": "8401f7d9d61d8eb5e4fb4b85fc63397a", "score": "0.5970295", "text": "function repaint() {\r\n context.beginPath();\r\n context.clearRect(0, 0, canvas.width, canvas.height);\r\n drawChart();\r\n}", "title": "" }, { "docid": "5cc2b2292a7ba0e767d6562055a4fa5a", "score": "0.5960424", "text": "draw() {\n\t\tif(this.isActive) {\n\t\t\tthis.domElement.style.left = `${Math.round(this.posX)}px`;\n\t\t\tthis.domElement.style.top = `${Math.round(this.posY)}px`;\n\t\t\tthis.domElement.style.width = `${Math.round(this.width)}px`;\n\t\t\tthis.domElement.style.height = `${Math.round(this.height)}px`;\n\t\t}\n\t}", "title": "" }, { "docid": "646b6657f66b6e3e2333828066779d4f", "score": "0.59547", "text": "function update() {\n // Canvas update\n width = visWidth - margin.left - margin.right;\n height = visHeight - margin.top - margin.bottom;\n\n visContainer.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n /**\n * Computation.\n */\n // Updates that depend only on data change\n if (dataChanged) {\n sortTopics(data);\n colorScale.domain(computeTopWords(data));\n computeLineData(data);\n }\n\n // Updates that depend on both data and display change\n computeLayout(data);\n\n /**\n * Draw.\n */\n const rows = rowContainer.selectAll('.row').data(data, id);\n rows.enter().append('g').attr('class', 'row').call(enterRows)\n .merge(rows).call(updateRows);\n rows.exit().transition().attr('opacity', 0).remove();\n }", "title": "" }, { "docid": "9e9ec7d69eacc68460155cfed7cfab5c", "score": "0.5946774", "text": "draw() {\n ctx.fillStyle = this.color;\n ctx.fillRect(this._x * SIZE, this._y * SIZE, SIZE, SIZE);\n }", "title": "" }, { "docid": "e4bbf22d298faaec2c7c18e76920dba5", "score": "0.5945059", "text": "draw()\n {\n ctx.fillRect(this.x, this.y, this.width, this.height); //fill in a rectangle at (this.x, this.y) with dimensions this.width x this.height\n }", "title": "" }, { "docid": "15c9a923273dd778b776ec9736374d2c", "score": "0.59369963", "text": "function draw() {\n\n let x, y = null, id, plot = null;\n\n if(arguments.length >= 3) {\n x = arguments[0];\n y = arguments[1];\n id = arguments[2];\n assert(Array.isArray(arguments[0]) &&\n Array.isArray(arguments[1]));\n } else if(arguments.length === 2) {\n x = arguments[0];\n if(Array.isArray(arguments[1])) {\n y = arguments[1];\n id = 0;\n } else {\n // must be a function plot\n id = arguments[1];\n }\n } else if(arguments.length === 1) {\n assert(Array.isArray(arguments[0]));\n x = arguments[1];\n id = 0;\n }\n\n\n if(arguments.length > 0) {\n if(plots[id] !== undefined)\n plot = plots[id];\n else {\n plot = new Plot(id);\n plots[id] = plot;\n ++numPlots;\n }\n }\n\n // (at the time of this writing 2019, Mar 14) Because there is no\n // \"redraw\" or \"resize\" event in browser javaScript sometimes when\n // this function is called this function will do nothing. We\n // don't draw unless we need to draw. The mozilla tutorials do\n // not seem to care about minimising the use of system resources,\n // and so they draw even when is no pixel color change. For many\n // apps, like a simple static image, pixels do not change until\n // there is a canvas resize.\n\n\n // TODO: Add different draw() modes like function plots.\n\n if(plot) {\n plot.updateData(x, y);\n needReplot = true;\n }\n\n assert(xMin !== null);\n\n if(render.offsetWidth === 0 || render.offsetHeight === 0)\n // It must be iconified, or hidden or like thing so we can't\n // draw anything.\n return;\n\n if(numPlots === 1 || plot === null) {\n if(integrateScalingDynamics())\n needNewBackground = true;\n }\n\n\n if(render.offsetWidth !== render.width ||\n render.offsetHeight !== render.height || needNewBackground) {\n // We do not draw (resize()) if there is no need to draw\n recreateBackgroundCanvas();\n needReplot = true;\n }\n\n if(needReplot) {\n drawBackground();\n Object.keys(plots).forEach(function(id) {\n plots[id].draw();\n });\n needReplot = false;\n }\n }", "title": "" }, { "docid": "073727db83334f88de3b9df12df2197a", "score": "0.59281015", "text": "updatePos(x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "9e7933f3de0aaeef1080cb631478fdf3", "score": "0.5927695", "text": "drawAxis(height, width){\n\n const svgSumPlot = d3.select(\"#svgSumPlot\")\n\n // If axis exists but we are redrawing\n if(document.getElementById(\"x_axis_sumPlot\") || document.getElementById(\"y_axis_sumPlot\")){\n\n // remove current axis\n d3.select(\"#x_axis_sumPlot\").remove();\n d3.select(\"#y_axis_sumPlot\").remove();\n }\n \n // Drawing new axis\n\n // Creating axis domain based on pixel range for the plot\n let xscale = d3.scaleLinear()\n .domain([0, 2]) \n .range([ (1/10)*this.width, (9/10)*this.width ]);\n\n let yscale = d3.scaleLinear()\n .domain([4,-4]) \n .range([(1/10)*this.height, (9/10)*this.height ]);\n\n // Configuring axis ticks\n let x_axis = d3.axisBottom()\n .scale(xscale);\n\n let y_axis = d3.axisLeft()\n .scale(yscale);\n\n // Adding the axis to the plot\n svgSumPlot.append('g')\n .attr(\"id\",\"x_axis_sumPlot\")\n .attr(\"transform\", \"translate(0,\" + this.height/2 + \")\")\n .attr(\"pointer-events\", \"none\")\n .call(x_axis);\n\n svgSumPlot.append('g')\n .attr(\"id\",\"y_axis_sumPlot\")\n .attr(\"transform\",\"translate(\" + (1/10)*this.width + \",0)\")\n .attr(\"pointer-events\", \"none\")\n .call(y_axis)\n\n }", "title": "" }, { "docid": "8a8e1e0f3568ca60b9972175ba282713", "score": "0.5925031", "text": "function drawAxes(){\n\n // disegna l'asse x\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n // label per l'asse x\n svg.append(\"text\")\n .attr(\"class\", \"xlabel\")\n .attr(\"transform\", \"translate(\" + (width) + \" ,\" + (height-10) + \")\")\n .attr(\"font-size\",\"15px\")\n .style(\"font-family\", \"verdana\")\n .style(\"text-anchor\", \"end\")\n .text(varName[0]+\" var.\"); // visualizza la prima variabile dell'array sull'asse x\n\n // disegna l'asse y\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\n // label per l'asse y\n svg.append(\"text\")\n .attr(\"class\", \"ylabel\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 20)\n .attr(\"font-size\",\"15px\")\n .style(\"font-family\", \"verdana\")\n .style(\"text-anchor\", \"end\")\n .text(varName[1]+\" var.\"); // visualizza la seconda variabile dell'array sull'asse y\n\n // intestazione del grafo\n svg.append(\"text\")\n .attr(\"y\", 0)\n .attr(\"x\", (width/2))\n .attr(\"font-size\",\"25px\")\n .style(\"font-family\", \"verdana\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Farfalle\");\n\n // label per le dimensioni\n svg.append(\"text\")\n .attr(\"class\", \"dimensionLabel\")\n .attr(\"y\", height+50)\n .attr(\"x\", (width/2))\n .attr(\"font-size\",\"12px\")\n .style(\"font-family\", \"verdana\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Dimensions: wings = \"+varName[2]+\" variable, head = \"+varName[3]+\" variable, body = \"+varName[4]+\" variable\");\n}", "title": "" }, { "docid": "51003cf3bb08c724532a64b34f89debc", "score": "0.5921967", "text": "function redrawMainYAxis() {\n\n yScale.range([height, 0]);\n x_axis_elem.transition().attr(\"transform\", \"translate(0,\" + height + \")\");\n context.transition().attr(\"transform\", \"translate(0,\" + (margin2.top + 10) + \")\");\n event_group.transition().attr('transform', 'translate(0, ' + (height - event_group_height - 1) + ')');\n\n mouse_tracker.transition().attr('height', height);\n mainClip.transition().attr('height', height);\n hoverLine.transition().attr(\"y2\", height);\n }", "title": "" }, { "docid": "d6ba8aefabf209ed7585512abd689b7b", "score": "0.5903336", "text": "drawAxisRectangles() {\n this.ctx.fillStyle = 'rgba(255, 255, 255, .6)';\n this.ctx.fillRect(0, 0, 80, this.canvas.height);\n this.ctx.fillRect(0, this.canvas.height - 30, this.canvas.width, 30);\n this.ctx.fillStyle = '#000000';\n }", "title": "" }, { "docid": "9a9ba4edb02ba78e7616e5a6ee9c298c", "score": "0.58988166", "text": "function setXandYvalues(ax, ay) {\n xVal = ax;\n yVal = ay;\n}", "title": "" }, { "docid": "1d55ec794c451727d2d77323b8942262", "score": "0.58915013", "text": "redraw() {\n draw(this._global);\n }", "title": "" }, { "docid": "17c03f7179389bb41aaaee89a658be7f", "score": "0.58843064", "text": "function update(data){ \n // update scales & axes\n \n // ~ call ~ axes\n\n // updata data\n\n // exit data\n \n\t}", "title": "" }, { "docid": "f20918c29ed355dc2f41f50bae39bc8e", "score": "0.5873333", "text": "function eventOnYAxis(){\n\tmodifyDataY(); \n updateDomains(); \n updateAxes(); \n updateDrawing();\n}", "title": "" }, { "docid": "e7fdf33a9186e629a29c6438c1002d21", "score": "0.5869301", "text": "update() {\n this.move();\n this.draw();\n }", "title": "" }, { "docid": "a236a9b9de86e974ae25f0151b84fed1", "score": "0.58606654", "text": "update() {\n this.update_pos();\n this.update_visuals();\n }", "title": "" }, { "docid": "4f723e386c1a5ffa3fd3ae6cabeb3474", "score": "0.5860617", "text": "function updateChart(event) {\n extent = event.selection;\n \n // If no selection, back to initial coordinate. Otherwise, update X axis domain\n if(!extent){\n if (!idleTimeout) return idleTimeout = setTimeout(idled, 350); // This allows to wait a little bit\n x.domain([0, 5000])\n x.range([ 0, width ])\n }else{\n x.domain([ x.invert(extent[0]), x.invert(extent[1]) ])\n bubble.select(\".brush\").call(brush.move, null) // This remove the grey brush area as soon as the selection has been done\n }\n \n // Update axis and circle position\n xAxis.transition().duration(1000).call(d3.axisBottom(x).ticks(4))\n bubble\n .selectAll(\"circle\")\n .transition().duration(1000)\n .attr(\"cx\", function (d) { return x(d.weight); } )\n .attr(\"cy\", function (d) { return y(d.length); } )\n \n }", "title": "" }, { "docid": "bd22dc5a3f93df4e983350bc9175fa40", "score": "0.5859716", "text": "function redraw() {\n canvas.width = root.getAttribute(\"width\");\n canvas.height = root.getAttribute(\"height\");\n for (var child = root.firstChild; child; child = child.nextSibling) draw(child);\n }", "title": "" }, { "docid": "f692d90276f2f8e02805a694b47006ec", "score": "0.58597034", "text": "update() {\n this.x = COL_WIDTH * this.col;\n this.y = ROW_HEIGHT * this.row - ROW_OFFSET;\n }", "title": "" }, { "docid": "9e214e1b92e362cc5c258988eabeb9e4", "score": "0.58594793", "text": "function updateGraphics() {\n\t\t// $log.log(preDebugMsg + \"updateGraphics()\");\n\n\t\tif(myCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tmyCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$log.log(preDebugMsg + \"no canvas to draw on!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(ctx === null) {\n\t\t\tctx = myCanvas.getContext(\"2d\");\n\t\t}\n\n\t\tvar W = myCanvas.width;\n\t\tif(typeof W === 'string') {\n\t\t\tW = parseFloat(W);\n\t\t}\n\t\tif(W < 1) {\n\t\t\tW = 1;\n\t\t}\n\n\t\tvar H = myCanvas.height;\n\t\tif(typeof H === 'string') {\n\t\t\tH = parseFloat(H);\n\t\t}\n\t\tif(H < 1) {\n\t\t\tH = 1;\n\t\t}\n\n\t\t// $log.log(preDebugMsg + \"Clear the canvas\");\n\t\tctx.clearRect(0,0, W,H);\n\n\t\tvar colors = $scope.gimme(\"ColorScheme\");\n\t\tif(typeof colors === 'string') {\n\t\t\tcolors = JSON.parse(colors);\n\t\t}\n\n\t\tif(colors.hasOwnProperty(\"skin\") && colors.skin.hasOwnProperty(\"text\")) {\n\t\t\ttextColor = colors.skin.text;\n\t\t}\n\t\telse {\n\t\t\ttextColor = \"#000000\";\n\t\t}\n\n\t\tdrawBackground(W, H);\n\t\tdrawPlot(W, H);\n\t\tdrawAxes(W, H);\n\n\t\tupdateSelectionRectangles();\n\t\tupdateDropZones(textColor, 0.3, false);\n\t}", "title": "" }, { "docid": "125c3d367edc555ab8f3c05cdf62563a", "score": "0.5846286", "text": "draw() {\n this.layout(this.width, this.height);\n }", "title": "" }, { "docid": "ff7eeabdc7189ede83c3b015ef11c74d", "score": "0.5845195", "text": "function redraw() {\n\t svg.attr(\"transform\",\"translate(\"+d3.event.translate+\" scale(\"+d3.event.scale+\")\");\n\t}", "title": "" }, { "docid": "649aff460ac138e442530ea7a2be0fd9", "score": "0.5839932", "text": "function clearCanvas(){\n \n // Clear the canvas\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n \n // Draw the x and y axes\n ctx.strokeStyle = \"Gainsboro\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(0, canvas.height/2);\n ctx.lineTo(canvas.width, canvas.height/2);\n ctx.moveTo(canvas.width/2, 0);\n ctx.lineTo(canvas.width/2, canvas.height);\n ctx.stroke();\n ctx.closePath();\n \n // Add the numbers to the axes\n if(showCoords){\n ctx.font = \"14px Arial\";\n ctx.fillStyle = \"LightSlateGray\";\n ctx.fillText(\"100\", 487, 317);\n ctx.fillText(\"200\", 587, 317);\n ctx.fillText(\"300\", 687, 317);\n ctx.fillText(\"-100\", 283, 317);\n ctx.fillText(\"-200\", 183, 317);\n ctx.fillText(\"-300\", 83, 317);\n ctx.fillText(\"100\", 370, 205);\n ctx.fillText(\"200\", 370, 105);\n ctx.fillText(\"-100\", 366, 405);\n ctx.fillText(\"-200\", 366, 505);\n ctx.fillText(\"X\", 787, 317);\n ctx.fillText(\"Y\", 385, 15);\n }\n\n // Reset the style for drawing\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = 2;\n}", "title": "" }, { "docid": "114a657f0635c42aaf14b4b826a44964", "score": "0.5836812", "text": "redraw() {\n this.clear();\n this.draw();\n }", "title": "" }, { "docid": "bfc0e3bc8a161c7ab924d3bba198c270", "score": "0.58360714", "text": "updatePosition (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "f802395de556151100fc15904b75a161", "score": "0.58347994", "text": "function draw(){\n _draw();\n }", "title": "" }, { "docid": "720c2f3bfbd40f9952c7075cbc0a73bb", "score": "0.5833892", "text": "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "title": "" }, { "docid": "015cd42d9c2a7d8eb83bff12089b9417", "score": "0.58333385", "text": "draw() {\n ctx.fillStyle = this.color;\n ctx.fillRect(this._x * BIG_SIZE, this._y * BIG_SIZE, BIG_SIZE, BIG_SIZE);\n }", "title": "" }, { "docid": "8e58211f6c48854e8d18c320b03ff60d", "score": "0.58262706", "text": "draw () {\r\n // Stop updating data from interrupting the transition\r\n this.currentlyAnimating = true\r\n\r\n // Move all elements to already determined scales\r\n this.xAxisG\r\n .transition()\r\n .duration(this.config.scaleChangeAnimationDuration)\r\n .ease(d3.easeElastic)\r\n .call(this.xAxis)\r\n\r\n this.dataAreaG.selectAll('path')\r\n .transition()\r\n .duration(this.config.scaleChangeAnimationDuration)\r\n .ease(d3.easeElastic)\r\n .attr('d', d => this.myLine(d.value))\r\n .on('end', _ => this.tick(this))\r\n }", "title": "" }, { "docid": "a5db57c7e7a5e0a4148c3d33b74a3011", "score": "0.582074", "text": "function updateXAxis() {\n\t if(showXAxis) {\n\t g.select('.nv-focus .nv-x.nv-axis')\n\t .transition()\n\t .duration(duration)\n\t .call(xAxis)\n\t ;\n\t }\n\t }", "title": "" }, { "docid": "40594f617e82b02adb91d2c1e80595c5", "score": "0.5810342", "text": "function updateCanvas(){\n\tclearAll();\n\tfor(var m = 0; m < 120; m++){\n\t\tfor(var n = 0; n < 120; n++){\n\t\t\tif(lineInd[m][n] == -1 && rectsInd[m][n] == -1){\n\t\t\t\t// drawRect(n, m, clearStyle);\n\t\t\t}else if(lineInd[m][n] != -1){\n\t\t\t\tdrawRect(n, m, lineStyle[lineInd[m][n]]);\n\t\t\t}else if(rectsInd[m][n] != -1){\n\t\t\t\tdrawRect(n, m, fillStyle[rectsInd[m][n]]);\n\t\t\t}else{\n\t\t\t\tconsole.log(\"what heck!\");\n\t\t\t}\n\t\t}\n\t}\n\tfor (var m = 0; m < positions.length; m++) {\n\t\tdrawRect(positions[m][0], positions[m][1], agentStyle[m]);\n\t}\n}", "title": "" }, { "docid": "2b2e829763205bd0436216e64fc14a76", "score": "0.58052087", "text": "update() {\n this.edge()\n this.x += this.dx\n this.y += this.dy\n this.draw()\n }", "title": "" }, { "docid": "eb344a49769f2224aada300d989e56ea", "score": "0.57980806", "text": "function drawAxes(limits, x, y) {\n // return x value from a row of data\n let xValue = function(d) { return +d[x]; }\n\n // function to scale x value\n let xScale = d3.scaleLinear()\n .domain([limits.xMin - 0.5, limits.xMax + 0.5]) // give domain buffer room\n .range([100, 1000]);\n\n // xMap returns a scaled x value from a row of data\n let xMap = function(d) { return xScale(xValue(d)); };\n\n // plot x-axis at bottom of SVG\n let xAxis = d3.axisBottom().scale(xScale);\n svgContainer.append(\"g\")\n .attr('transform', 'translate(0, 600)')\n .style(\"color\", \"#858585\")\n .style(\"font-size\", 15)\n .call(xAxis);\n\n // return y value from a row of data\n let yValue = function(d) { return +d[y]}\n\n // function to scale y\n let yScale = d3.scaleLinear()\n .domain([limits.yMax + 5, limits.yMin - 5]) // give domain buffer\n .range([100, 600]);\n\n // yMap returns a scaled y value from a row of data\n let yMap = function (d) { return yScale(yValue(d)); };\n\n // plot y-axis at the left of SVG\n let yAxis = d3.axisLeft().scale(yScale);\n svgContainer.append('g')\n .attr('transform', 'translate(100, 0)')\n .style(\"color\", \"#858585\")\n .style(\"font-size\", 14)\n .call(yAxis);\n\n // return mapping and scaling functions\n return {\n x: xMap,\n y: yMap,\n xScale: xScale,\n yScale: yScale\n };\n }", "title": "" }, { "docid": "4479d6f15c748533579426f34fbd124e", "score": "0.5795524", "text": "drawSelf() {\n this.$element.css('--x', this.position.x + 'px');\n this.$element.css('--y', this.position.y + 'px');\n }", "title": "" }, { "docid": "bfc7786415b8928abb4140c00b2bf9d2", "score": "0.57935", "text": "function draw() {\n // Make sure the mouse position is set everytime\n // draw() is called.\n var x = mouse.x,\n y = mouse.y;\n\n // This loop is where all the 90s magic happens\n dots.forEach(function (dot, index, dots) {\n var nextDot = dots[index + 1] || dots[0];\n\n dot.x = x;\n dot.y = y;\n dot.draw();\n x += (nextDot.x - dot.x) * .6;\n y += (nextDot.y - dot.y) * .6;\n\n });\n}", "title": "" }, { "docid": "7c20ed4b19503627b748a89c8e9c6673", "score": "0.5783985", "text": "paint()\n {\n this.context.save();\n this.context.translate(this.x, this.y);\n this.onPaint(this.context);\n this.context.restore();\n }", "title": "" }, { "docid": "64a9d71a00bdae388af5b30c89c921c6", "score": "0.5781444", "text": "function drawAxis(svg, axisGroup, axis, side, scaleFn_x, scaleFn_y, axisMargin = 0, tickSize = 5){\r\n\r\n\r\n\r\n\taxisGroup.find(\".axis_\" + side).remove();\r\n\t\r\n\t\r\n\tif (axis == null) return;\r\n\r\n\tvar stroke = \"black\";\r\n\t\r\n\t\r\n\t// Draw the ticks\r\n\tvar tx1, tx2, ty1, ty2;\r\n\r\n\tfor (var i = 0; i < axis.vals.length; i++){\r\n\t\tvar val = axis.vals[i];\r\n\r\n\t\tif (side == 1 || side == 3){\r\n\t\t\tty2 = side == 1 ? svg.height() - axisMargin : axisMargin;\r\n\t\t\tty1 = side == 3 ? svg.height() - axisMargin : axisMargin;\r\n\t\t\ttx1 = scaleFn_x(val);\r\n\t\t\ttx2 = tx1;\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttx1 = side == 4 ? axisMargin : svg.width() - axisMargin;\r\n\t\t\ttx2 = side == 2 ? axisMargin : svg.width() - axisMargin;\r\n\t\t\tty1 = scaleFn_y(val);\r\n\t\t\tty2 = ty1;\r\n\r\n\t\t} \r\n\r\n\t\t\r\n\t\tdrawSVGobj(axisGroup, \"line\", {class: \"axis axis_\" + side ,id: \"axis_\" + side + \"_\" + i, \r\n\t\t\t\tx1: tx1, \r\n\t\t\t\ty1: ty1, \r\n\t\t\t\tx2: tx2,\r\n\t\t\t\ty2: ty2, \r\n\t\t\t\taxis_val: val,\r\n\t\t\t\tstyle: \"stroke:\" + stroke + \"; stroke-width:0.3px;stroke-linecap:round\" });\r\n\r\n\r\n\t\tdrawSVGobj(axisGroup, \"text\", {class: \"axis axis_\" + side ,id: \"axisText_\" + side + \"_\" + i, \r\n\t\t\t\tx: tx1, \r\n\t\t\t\ty: ty1, \r\n\t\t\t\taxis_val: val,\r\n\t\t\t\tstyle: \"\"}, val);\r\n\r\n\r\n\r\n\t\t\r\n\r\n\r\n\t}\r\n\r\n\r\n}", "title": "" } ]
5fa3d79304c97a9b01818aa0f2953332
try to get stringify string of data
[ { "docid": "ec220145694c6a733dad87ab04c6d62c", "score": "0.7237147", "text": "function tryStringify(data) {\n try {\n return JSON.stringify(data);\n } catch (err) {\n return data;\n }\n}", "title": "" } ]
[ { "docid": "1c9993bdf047db9b31a8efa65f1a09cf", "score": "0.78109163", "text": "static getStrigifiedData(data) {\n return JSON.stringify(data);\n }", "title": "" }, { "docid": "4bf95f039af4d85040835d943070c0bd", "score": "0.74732906", "text": "function dataToString(data) {\r\n\t\t// data.toString() might throw or return null if data is the return\r\n\t\t// value of Console.log in some versions of Firefox (behavior depends on\r\n\t\t// version)\r\n\t\ttry {\r\n\t\t\tif (data != null && data.toString() != null) return data\r\n\t\t} catch (e) {\r\n\t\t\t// silently ignore errors\r\n\t\t}\r\n\t\treturn \"\"\r\n\t}", "title": "" }, { "docid": "4bf95f039af4d85040835d943070c0bd", "score": "0.74732906", "text": "function dataToString(data) {\r\n\t\t// data.toString() might throw or return null if data is the return\r\n\t\t// value of Console.log in some versions of Firefox (behavior depends on\r\n\t\t// version)\r\n\t\ttry {\r\n\t\t\tif (data != null && data.toString() != null) return data\r\n\t\t} catch (e) {\r\n\t\t\t// silently ignore errors\r\n\t\t}\r\n\t\treturn \"\"\r\n\t}", "title": "" }, { "docid": "c49f2910ee99d179d4953cec0985f6e6", "score": "0.74303573", "text": "function str(data) {\n if (!data) return null;\n if (data.value) return data.value;\n if (data.desc) return data.desc;\n if (typeof data === \"string\") return data;\n return \"\";\n}", "title": "" }, { "docid": "dd1ccfe1cb08c498b2829bc13e441658", "score": "0.7426271", "text": "function dataToString(data) {\n\t\t\t// data.toString() might throw or return null if data is the return\n\t\t\t// value of Console.log in some versions of Firefox (behavior depends on\n\t\t\t// version)\n\t\t\ttry {\n\t\t\t\tif (data != null && data.toString() != null) return data\n\t\t\t} catch (e) {\n\t\t\t\t// silently ignore errors\n\t\t\t}\n\t\t\treturn \"\"\n\t\t}", "title": "" }, { "docid": "573794b35a57bc58dfa0c02498638aca", "score": "0.6817137", "text": "stringifyData() {\n this.stringData = JSON.stringify(this.datastore[this.dataIndex]);\n }", "title": "" }, { "docid": "b835c09176039cec47eca282dc109119", "score": "0.6761586", "text": "function serializeData(data) {\n // If this is not an object, defer to native stringification.\n if (!angular.isObject(data)) {\n return ((data == null) ? \"\" : data.toString());\n }\n\n var buffer = [];\n\n // Serialize each key in the object.\n for (var name in data) {\n if (!data.hasOwnProperty(name)) {\n continue;\n }\n var value = data[name];\n buffer.push(encodeURIComponent(name) + \"=\" + encodeURIComponent((value == null) ? \"\" : value));\n }\n\n // Serialize the buffer and clean it up for transportation.\n var source = buffer.join(\"&\").replace(/%20/g, \"+\");\n return (source);\n }", "title": "" }, { "docid": "7331dac93bf8635e254ed40a513e4d10", "score": "0.6757844", "text": "static optionalData(data) {\n if (Helper.isPresent(data) === false) {\n return '';\n } else if (typeof data === 'object') {\n // runs Helper.optionalData again to reduce to string in case something else was returned\n return Helper.optionalData(JSON.stringify(data));\n } else if (typeof data === 'function') {\n // runs the function and calls Helper.optionalData again to reduce further if it isn't a string\n return Helper.optionalData(data());\n } else {\n return String(data);\n }\n }", "title": "" }, { "docid": "dc87481715d3bddb8feffa8e417148ec", "score": "0.6743634", "text": "function toString(data) {\n return Object.prototype.toString.call(data);\n}", "title": "" }, { "docid": "c8b2668c99592a09ff7ac70ace2954dd", "score": "0.66905904", "text": "function getAsString(data) {\n \"use strict\"; //enable javascript strict mode\n var ndx, a, firstTime;\n \n if(!data) { return ''; } //nothing\n if(data instanceof Object) { //if get an array or object, show the contents as comma separated\n a='';\n firstTime=true; //for leading comma suppression\n for(ndx in data) {\n if(data.hasOwnProperty(ndx)) {\n if(!firstTime) { a+= ', '; }\n firstTime=false;\n if(data[ndx].text) { a+=data[ndx].text; } //riString\n else { a+=data[ndx]; }\n }\n }\n return a;\n }\n if(data.text) { return data.text; } //riString\n return data; //everything else\n}", "title": "" }, { "docid": "6e5322b0714b5c589ecd2ee42d3a930e", "score": "0.66491973", "text": "function safeSerialize(data) {\n\treturn data ? JSON.stringify(data).replace(/\\//g, '\\\\/') : 'undefined'\n}", "title": "" }, { "docid": "b601ded96b0b455813e629ed2853c7ca", "score": "0.66466576", "text": "function serializeData( data ) {\n\n // If this is not an object, defer to native stringification.\n if ( ! angular.isObject( data ) ) {\n\n return( ( data == null ) ? \"\" : data.toString() );\n\n }\n\n var buffer = [];\n\n // Serialize each key in the object.\n for ( var name in data ) {\n\n if ( ! data.hasOwnProperty( name ) ) {\n\n continue;\n\n }\n\n var value = data[ name ];\n\n buffer.push(\n encodeURIComponent( name ) +\n \"=\" +\n encodeURIComponent( ( value == null ) ? \"\" : value )\n );\n\n }\n\n // Serialize the buffer and clean it up for transportation.\n var source = buffer\n .join( \"&\" )\n .replace( /%20/g, \"+\" )\n ;\n\n return( source );\n\n }", "title": "" }, { "docid": "d3cab016acd31b45fa649fa4f0fe07aa", "score": "0.66282535", "text": "function e(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "d3cab016acd31b45fa649fa4f0fe07aa", "score": "0.66282535", "text": "function e(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "de9925c5d9e9641b5c93c4ea090191f1", "score": "0.6595053", "text": "function serializeData( data ) {\n // If this is not an object, defer to native stringification.\n if ( ! angular.isObject( data ) ) {\n return( ( data == null ) ? \"\" : data.toString() );\n }\n var buffer = [];\n // Serialize each key in the object.\n for ( var name in data ) {\n if ( ! data.hasOwnProperty( name ) ) {\n continue;\n }\n var value = data[ name ];\n buffer.push(\n encodeURIComponent( name ) +\n \"=\" +\n encodeURIComponent( ( value == null ) ? \"\" : value )\n );\n }\n // Serialize the buffer and clean it up for transportation.\n var source = buffer\n .join( \"&\" )\n .replace( /%20/g, \"+\" )\n ;\n return( source );\n }", "title": "" }, { "docid": "bbdfa68aed4a27d9d64cee13362f28f5", "score": "0.654404", "text": "function string (data) {\n\t return typeof data === 'string';\n\t }", "title": "" }, { "docid": "67deefc5d05e91f3791fbf7916f9a879", "score": "0.6502859", "text": "function toJSONString(data){\n if (data === undefined) return;\n if (data === null) return \"null\";\n var type = typeof data;\n if (type == 'number' || type == 'boolean') {\n return data.toString();\n } else if (type == 'function' || type == 'unknown') {\n return;\n } else if (type == 'string' || data.constructor == String) {\n return '\"' + data.replace(/\\\"|\\n|\\\\/g, function(c){ return c == \"\\n\" ? \"\\\\n\" : '\\\\' + c ;}) + '\"';\n } else if (data.constructor == Date) {\n return 'new Date(\"' + data.toString() + '\")';\n } else if (data.constructor == Array) {\n var items = [];\n for (var i = 0,dlen = data.length; i < dlen; i++) {\n var val = toJSONString(data[i]);\n if (val != undefined)\n items.push(val);\n }\n return \"[\" + items.join(\",\") + \"]\";\n } else if (data.constructor == Object) {\n var props = [];\n for (var k in data) {\n var val = toJSONString(data[k]);\n if (val != undefined)\n props.push(toJSONString(k) + \":\" + val);\n }\n return \"{\" + props.join(\",\") + \"}\";\n }\n}", "title": "" }, { "docid": "384b5e317173cba8c2661781b997d76d", "score": "0.64967597", "text": "function formDataStringStub(data) { return ''; }", "title": "" }, { "docid": "39e7100c4f9dcf37c6e34edb16672ec7", "score": "0.64806384", "text": "function stringifyJson(data) {\n\treturn JSON.stringify(data);\n}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6401098", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "b7dd95fa15aab04dae5221658eb5181c", "score": "0.638348", "text": "prepareData(data) {\n return JSON.stringify(data);\n }", "title": "" }, { "docid": "c1df4366ec00e72fc4fc8940786dd056", "score": "0.63824993", "text": "_stringData() {\n const buffer = new Buffer(this.record.data, 'base64')\n return buffer.toString();\n }", "title": "" }, { "docid": "4c6a460a0322ad07231347c29231517f", "score": "0.6377935", "text": "function string (data) {\n return typeof data === 'string';\n }", "title": "" }, { "docid": "4c6a460a0322ad07231347c29231517f", "score": "0.6377935", "text": "function string (data) {\n return typeof data === 'string';\n }", "title": "" }, { "docid": "4c6a460a0322ad07231347c29231517f", "score": "0.6377935", "text": "function string (data) {\n return typeof data === 'string';\n }", "title": "" }, { "docid": "71196059c8f7230cc0e822bf460851cb", "score": "0.6368373", "text": "function string (data) {\n return typeof data === 'string';\n }", "title": "" }, { "docid": "6d46eebc50244835dc06539aa00ab4ec", "score": "0.6352029", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data, this.replacer);\n }\n return str;\n }", "title": "" }, { "docid": "9dc54b38f89d4220711fb6b30a660dca", "score": "0.629302", "text": "toString() {\r\n return this.data.toString();\r\n }", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.62408626", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "38a161345137e14fc48734e758755843", "score": "0.61569506", "text": "toString() {\r\n return this._data.toString();\r\n }", "title": "" }, { "docid": "8b642d5f3ee069863e21588acf3b5e1f", "score": "0.6151612", "text": "function getdata(data) { return getdatastr(data); }", "title": "" }, { "docid": "8a1c2917b68daa7a3b86bddaa63e137e", "score": "0.6126938", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "title": "" }, { "docid": "8a1c2917b68daa7a3b86bddaa63e137e", "score": "0.6126938", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "title": "" }, { "docid": "8a1c2917b68daa7a3b86bddaa63e137e", "score": "0.6126938", "text": "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "title": "" }, { "docid": "b784d722b589f194b89f6b3bda83767b", "score": "0.61116815", "text": "stringify(data){\n\t\tvar value, key, tmp = [];\n\t\tconst encodeFunc = data=>encodeURIComponent(''+data).replace(/!/g, '%21')\n\t\t\t.replace(/'/g, '%27').replace(/\\(/g, '%28').replace(/\\)/g, '%29')\n\t\t\t.replace(/\\*/g, '%2A').replace(/%20/g, '+');\n\t\tconst _hbqHelper = (key, val)=>{\n\t\t\tvar k, tmp = [];\n\t\t\tif (val === true) val = '1';\n\t\t\telse if (val === false) val = '0';\n\t\t\tif (val !== null) {\n\t\t\t\tif (typeof val === 'object') {\n\t\t\t\t\tfor (k in val)\n\t\t\t\t\t\tif (val[k] !== null) \n\t\t\t\t\t\t\ttmp.push(_hbqHelper(key+'['+k+']', val[k], '&'));\n\t\t\t\t\treturn tmp.join('&');\n\t\t\t\t} else if (typeof val !== 'function') return encodeFunc(key)+'='+encodeFunc(val);\n\t\t\t\telse return false;\n\t\t\t} else return '';\n\t\t};\n\t\tfor (key in data) {\n\t\t\tvalue = data[key];\n\t\t\tvar query = _hbqHelper(key, value, '&');\n\t\t\tif(query === false) continue;\n\t\t\tif (query !== '') tmp.push(query)\n\t\t}\n\t\treturn tmp.join('&');\n\t}", "title": "" }, { "docid": "a9107fc0a1d8d0dbbd1b05eb31e39e5f", "score": "0.60658735", "text": "function n(t) {\n return null == t ? \"\" : \"object\" == typeof t ? JSON.stringify(t, null, 2) : String(t)\n }", "title": "" }, { "docid": "73d1ff0d85f099c4ee72c582b340430d", "score": "0.6038062", "text": "toSTRING() {\n switch (this._type) {\n case \"NODE\":\n return this._value.nodeType === 1 ? this._value.outerHTML : this._value.nodeValue;\n case \"STRING\":\n return this._value;\n case \"YNGWIE\":\n console.log(this._value);\n let node = this._value.render();\n console.log(node)\n return node.nodeType === 1 ? node.outerHTML : node.nodeValue;\n default:\n throw new _Transform_main_js__WEBPACK_IMPORTED_MODULE_3__.default(\"Cannot transform to STRING from unsuppoted type\", this._value);\n }\n }", "title": "" } ]
1af74567949636d40e615cf6afb2ab2f
Visit children in `parent`.
[ { "docid": "59655e473fe775324aa57af96798ae31", "score": "0.57666224", "text": "function all(children, parent) {\n var length = children.length\n var index = -1\n var child\n\n stack.push(parent)\n\n while (++index < length) {\n child = children[index]\n\n if (child && one(child) === false) {\n return false\n }\n }\n\n stack.pop()\n\n return true\n }", "title": "" } ]
[ { "docid": "d0854a926aa398fb2edc183d95509d47", "score": "0.7961384", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "title": "" }, { "docid": "f6d7596676a9ec5b0b1de4d5736d9ae9", "score": "0.79312205", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }", "title": "" }, { "docid": "15a7d3a4a1237043a4021b54191ce94b", "score": "0.7884723", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "title": "" }, { "docid": "dbb49ac2f16380505e96d01e3843c95c", "score": "0.78684103", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "title": "" }, { "docid": "dbb49ac2f16380505e96d01e3843c95c", "score": "0.78684103", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "title": "" }, { "docid": "dbb49ac2f16380505e96d01e3843c95c", "score": "0.78684103", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "title": "" }, { "docid": "de5ad6f25739de7b05e72df249384673", "score": "0.77845716", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n\t visit(children[i], visitFn, childrenFn);\n }\n }\n}", "title": "" }, { "docid": "13daa770c9b35291bcc913ef5f23aa2c", "score": "0.7271602", "text": "function all(parent) {\n var self = this;\n var children = parent.children;\n var length = children.length;\n var results = [];\n var index = -1;\n\n while (++index < length) {\n results[index] = self.visit(children[index], parent);\n }\n\n return results;\n}", "title": "" }, { "docid": "9f6ae170873ab320b582173695059087", "score": "0.676529", "text": "allWithChildren(parent) {\n\t\treturn this.all(parent, true);\n\t}", "title": "" }, { "docid": "d12317e630a79605554d3e9fde242449", "score": "0.6586661", "text": "visitChildren(node, excludeArr = []) {\n var _a;\n if (node == null || node.type == null) {\n return;\n }\n const exclude = new Set(excludeArr.concat(['parent']));\n const children = (_a = __classPrivateFieldGet(this, _VisitorBase_childVisitorKeys, \"f\")[node.type]) !== null && _a !== void 0 ? _a : Object.keys(node);\n for (const key of children) {\n if (exclude.has(key)) {\n continue;\n }\n const child = node[key];\n if (!child) {\n continue;\n }\n if (Array.isArray(child)) {\n for (const subChild of child) {\n if (isNode(subChild)) {\n this.visit(subChild);\n }\n }\n }\n else if (isNode(child)) {\n this.visit(child);\n }\n }\n }", "title": "" }, { "docid": "97856d67a7e7e2d56f8af33dc02c768e", "score": "0.65283436", "text": "function traverse(node, parent, visitor) {\n visitor.enterNode(node, parent);\n const keys = getKeys(node, visitor.visitorKeys);\n for (const key of keys) {\n for (const child of getNodes(node, key)) {\n traverse(child, node, visitor);\n }\n }\n visitor.leaveNode(node, parent);\n}", "title": "" }, { "docid": "2dfaf488e4914d53cb0460572a1482f1", "score": "0.6210523", "text": "visitChildren(ctx) {\n if (!ctx) {\n return;\n }\n if (ctx.children) {\n return ctx.children.map((child) => {\n if (child.children && child.children.length !== 0) {\n return child.accept(this);\n }\n return child.getText();\n });\n }\n }", "title": "" }, { "docid": "104737c0d7e0f44e41184194bfea09d5", "score": "0.6132636", "text": "function forgetChildren(parent) {\r\n var children = reusableEmptyArray;\r\n if (parent.childValues.size > 0) {\r\n children = [];\r\n parent.childValues.forEach(function (_value, child) {\r\n forgetChild(parent, child);\r\n children.push(child);\r\n });\r\n }\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n return children;\r\n}", "title": "" }, { "docid": "104737c0d7e0f44e41184194bfea09d5", "score": "0.6132636", "text": "function forgetChildren(parent) {\r\n var children = reusableEmptyArray;\r\n if (parent.childValues.size > 0) {\r\n children = [];\r\n parent.childValues.forEach(function (_value, child) {\r\n forgetChild(parent, child);\r\n children.push(child);\r\n });\r\n }\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n return children;\r\n}", "title": "" }, { "docid": "c8b71020582d99d6f5fb59b944721b83", "score": "0.6119895", "text": "function forgetChildren(parent) {\n var children = reusableEmptyArray;\n if (parent.childValues.size > 0) {\n children = [];\n parent.childValues.forEach(function (_value, child) {\n forgetChild(parent, child);\n children.push(child);\n });\n }\n // After we forget all our children, this.dirtyChildren must be empty\n // and therefore must have been reset to null.\n assert(parent.dirtyChildren === null);\n return children;\n}", "title": "" }, { "docid": "3cacd17ca3d2994eccb66a202936142d", "score": "0.60864514", "text": "function forgetChildren(parent) {\r\n var children = reusableEmptyArray;\r\n if (parent.childValues.size > 0) {\r\n children = [];\r\n parent.childValues.forEach(function (value, child) {\r\n forgetChild(parent, child);\r\n children.push(child);\r\n });\r\n }\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n return children;\r\n}", "title": "" }, { "docid": "3cacd17ca3d2994eccb66a202936142d", "score": "0.60864514", "text": "function forgetChildren(parent) {\r\n var children = reusableEmptyArray;\r\n if (parent.childValues.size > 0) {\r\n children = [];\r\n parent.childValues.forEach(function (value, child) {\r\n forgetChild(parent, child);\r\n children.push(child);\r\n });\r\n }\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n return children;\r\n}", "title": "" }, { "docid": "911b37db9ffe56ce6d13f74f4b59dcbd", "score": "0.60303557", "text": "function all(h, parent) {\n const nodes = parent.children || []\n const { length } = nodes\n const values = []\n let index = -1\n\n while (++index < length) {\n const result = one(h, nodes[index], parent)\n values.push(result)\n }\n\n return values.filter(node => node)\n}", "title": "" }, { "docid": "7e2ba2c28a511180753fd173d37eb2e4", "score": "0.60248023", "text": "update_children(){\n let children = this.get_children_objects()\n for (var i = 0; i < children.length; i++) {\n children[i].set_parent_node(this);\n }\n this.notify_fragment_dirty();\n }", "title": "" }, { "docid": "a2468f524340fa259e028b69a9e9e9b1", "score": "0.601196", "text": "function forgetChildren(parent) {\r\n if (parent.childValues.size > 0) {\r\n parent.childValues.forEach(function (_value, child) {\r\n forgetChild(parent, child);\r\n });\r\n }\r\n // Remove this parent Entry from any sets to which it was added by the\r\n // addToSet method.\r\n parent.forgetDeps();\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n}", "title": "" }, { "docid": "a2468f524340fa259e028b69a9e9e9b1", "score": "0.601196", "text": "function forgetChildren(parent) {\r\n if (parent.childValues.size > 0) {\r\n parent.childValues.forEach(function (_value, child) {\r\n forgetChild(parent, child);\r\n });\r\n }\r\n // Remove this parent Entry from any sets to which it was added by the\r\n // addToSet method.\r\n parent.forgetDeps();\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n}", "title": "" }, { "docid": "640aebde53955cb501d6cd565f540dc1", "score": "0.6010023", "text": "forEach(callback) {\n callback(this);\n for (const child of this.children) {\n child.forEach(callback);\n }\n }", "title": "" }, { "docid": "9250b3a779f13404ec5adfaaf16ad3ba", "score": "0.58863765", "text": "function all(children, parent) {\n var step = reverse ? -1 : 1;\n var max = children.length;\n var min = -1;\n var index = (reverse ? max : min) + step;\n var child;\n\n while (index > min && index < max) {\n child = children[index];\n\n if (child && one(child, index, parent) === false) {\n return false;\n }\n\n index += step;\n }\n\n return true;\n }", "title": "" }, { "docid": "30bc1dbf4bfcfc9e6eacfea7a6efb1ff", "score": "0.58705705", "text": "traverse(fn) {\n fn(this)\n\n const children = this._children\n for (let i = 0, l = children.length; i < l; i++) {\n children[i].traverse(fn)\n }\n }", "title": "" }, { "docid": "97f6a9917f84f0b22944f770e43bdcb2", "score": "0.5852325", "text": "function processNode(node){\n processChild(node);\n for( i in node.children )\n processNode(node.children[i]);\n }", "title": "" }, { "docid": "355776bb702c637dee2aad715584fe68", "score": "0.57435596", "text": "function findChildren(node, test, emit) {\n if (!node)\n return;\n if (test(node)) {\n emit(node);\n }\n node.forEachChild(function (child) { return findChildren(child, test, emit); });\n}", "title": "" }, { "docid": "b8c13f139d82eeb0d39fe19bbabe00a9", "score": "0.5742612", "text": "function processChildren(node, delimeter) {\n if (typeof delimeter === 'function') {\n let prev = null;\n\n node.children.forEach(node => {\n if (prev !== null) {\n delimeter.call(this, prev);\n }\n\n this.node(node);\n prev = node;\n });\n\n return;\n }\n\n node.children.forEach(this.node, this);\n}", "title": "" }, { "docid": "c6003c63c4b40cfd5a7d5d42a9816c4d", "score": "0.57117593", "text": "function children(parent){\n var n = parent.firstChild,\n\t nodeIndex = -1,\n\t nextNode;\n\twhile(n){\n\t nextNode = n.nextSibling;\n\t // clean worthless empty nodes.\n\t if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){\n\t\tparent.removeChild(n);\n\t }else{\n\t\t// add an expando nodeIndex\n\t\tn.nodeIndex = ++nodeIndex;\n\t }\n\t n = nextNode;\n\t}\n\treturn this;\n }", "title": "" }, { "docid": "639242526c33ab3af9a0317deac14529", "score": "0.5698025", "text": "function all (ctx, parent) {\n const children = parent && parent.children\n\n if (!children) return ''\n\n return children\n .map((child, index) => one(ctx, child, index, parent))\n .join('')\n}", "title": "" }, { "docid": "46b5c09fa9264f0ab62c9915280541fb", "score": "0.5690271", "text": "children() {\n return new ChildrenIterator(this, this.keys);\n }", "title": "" }, { "docid": "fa109f4bca8edf86e56c2528311ece45", "score": "0.5644861", "text": "eachChild(func) {\r\n\t\t\t\t\tvar attr, child, j, k, len1, len2, ref1, ref2;\r\n\t\t\t\t\tif (!this.children) {\r\n\t\t\t\t\t\treturn this;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tref1 = this.children;\r\n\t\t\t\t\tfor (j = 0, len1 = ref1.length; j < len1; j++) {\r\n\t\t\t\t\t\tattr = ref1[j];\r\n\t\t\t\t\t\tif (this[attr]) {\r\n\t\t\t\t\t\t\tref2 = flatten([this[attr]]);\r\n\t\t\t\t\t\t\tfor (k = 0, len2 = ref2.length; k < len2; k++) {\r\n\t\t\t\t\t\t\t\tchild = ref2[k];\r\n\t\t\t\t\t\t\t\tif (func(child) === false) {\r\n\t\t\t\t\t\t\t\t\treturn this;\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}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn this;\r\n\t\t\t\t}", "title": "" }, { "docid": "86d655f34960d1634dc77650825440bd", "score": "0.5616105", "text": "*children(root, path) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var {\n reverse = false\n } = options;\n var ancestor = Node.ancestor(root, path);\n var {\n children\n } = ancestor;\n var index = reverse ? children.length - 1 : 0;\n\n while (reverse ? index >= 0 : index < children.length) {\n var child = Node.child(ancestor, index);\n var childPath = path.concat(index);\n yield [child, childPath];\n index = reverse ? index - 1 : index + 1;\n }\n }", "title": "" }, { "docid": "86d655f34960d1634dc77650825440bd", "score": "0.5616105", "text": "*children(root, path) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var {\n reverse = false\n } = options;\n var ancestor = Node.ancestor(root, path);\n var {\n children\n } = ancestor;\n var index = reverse ? children.length - 1 : 0;\n\n while (reverse ? index >= 0 : index < children.length) {\n var child = Node.child(ancestor, index);\n var childPath = path.concat(index);\n yield [child, childPath];\n index = reverse ? index - 1 : index + 1;\n }\n }", "title": "" }, { "docid": "6fb46c7811ff9a53ba975a1243c931e7", "score": "0.5613851", "text": "function visit(node, visitFunction, parentsList) {\n\t\tvar parents = (typeof parentsList === 'undefined') ? [] : parentsList;\n\t\n\t\tvisitFunction = visitFunction || false;\n\t\tif (visitFunction && visitFunction(node,parentsList) == false) {\n\t\t\treturn;\n\t\t}\n\t\tfor (key in node) {\n\t\t\tif (node.hasOwnProperty(key)) {\n\t\t\t\tchild = node[key];\n\t\t\t\tpath = [ node ];\n\t\t\t\tpath.push(parents);\n\t\t\t\tif (typeof child === 'object' && child !== null) {\n\t\t\t\t\tvisit(child, visitFunction, path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "4125b201dfab7d8e4053f6dd953566c5", "score": "0.5605674", "text": "function traverse(node, callbacks, parent) {\n if (callbacks[node.type]) {\n callbacks[node.type](node, parent);\n }\n if (typeof node.children !== 'undefined') {\n const parent = node;\n for (const child of parent.children) {\n traverse(child, callbacks, parent);\n }\n }\n}", "title": "" }, { "docid": "a3290ae7a4162526f239b0fbebebdad0", "score": "0.56021166", "text": "initChildren() {\n this.nodes.forEach(node => {\n node.parent = this\n })\n }", "title": "" }, { "docid": "53d20f73efb456d9d90cbcddd37d7339", "score": "0.56012946", "text": "childrenIteration(_processFunc) {\n return this.children.map(_processFunc);\n }", "title": "" }, { "docid": "208d7d430369c8de73be0efaa9b07e37", "score": "0.5537434", "text": "children() {\n return new types_List(map(this.node.children, function (node) {\n return adopt(node);\n }));\n }", "title": "" }, { "docid": "478ed601da79fe76e603555f9733f171", "score": "0.5522527", "text": "function appendChildren(parent, ...children) {\r\n children.forEach(child => parent.appendChild(child));\r\n}", "title": "" }, { "docid": "9bc219a39782478c10e72d856adc4442", "score": "0.5513041", "text": "function treeForEachChild(tree, action) {\n each(tree.node.children, function (child, childTree) {\n action(new Tree(child, tree, childTree));\n });\n}", "title": "" }, { "docid": "6002039cf74501a6486db2b5744f4360", "score": "0.5512822", "text": "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n\n return allMatches;\n } // Attributes", "title": "" }, { "docid": "968e7a8aecd7cc9bf6ebe54dc6653f37", "score": "0.5505256", "text": "function traverseChildren(elem){\n\t var children = [];\n\t var q = [];\n\t q.push(elem);\n\t while (q.length > 0) {\n\t var elem = q.pop();\n\t children.push(elem);\n\t pushAll(elem.children);\n\t }\n\t function pushAll(elemArray){\n\t for(var i=0; i < elemArray.length; i++) {\n\t q.push(elemArray[i]);\n\t }\n\t }\n\t return children;\n\t}", "title": "" }, { "docid": "d9a995698b928e15f6505bed75ec085c", "score": "0.5497512", "text": "function walkSiblings(parent, beforeAfterChild, before, at, after, arg) {\n\t\tvar fn = before;\n\t\tDom.walk(parent.firstChild, function (child) {\n\t\t\tif (child !== beforeAfterChild) {\n\t\t\t\tfn(child, arg);\n\t\t\t} else {\n\t\t\t\tfn = after;\n\t\t\t\tat(child, arg);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "73131748679bd03013008edcebe702de", "score": "0.5490835", "text": "function getChildren(parent, allowVirtualChildren) {\n if (allowVirtualChildren === void 0) { allowVirtualChildren = true; }\n var children = [];\n if (parent) {\n for (var i = 0; i < parent.children.length; i++) {\n children.push(parent.children.item(i));\n }\n if (allowVirtualChildren && Object(_isVirtualElement__WEBPACK_IMPORTED_MODULE_0__[\"isVirtualElement\"])(parent)) {\n children.push.apply(children, parent._virtual.children);\n }\n }\n return children;\n}", "title": "" }, { "docid": "1fa25d0c6df8fc1b62c8ec5b4fb1bece", "score": "0.54895127", "text": "function manageChildren(parentElem, children$Arr) {\n\t// hook into every child stream for changes\n\t// children can be arrays and are always treated like such\n\t// changes are then performed on the parent\n\tchildren$Arr.map(function (child$, index) {\n\t\tchild$.reduce(function (oldChildArr, childArr) {\n\t\t\t// the default childArr will be [null]\n\t\t\tvar changes = calcChanges(childArr, oldChildArr);\n\n\t\t\tif (changes.length === 0) {\n\t\t\t\treturn childArr;\n\t\t\t}\n\n\t\t\tvar elementsBefore = getElementsBefore(children$Arr, index);\n\t\t\t// apply the changes\n\t\t\tPromise.all(changes.map(function (_ref) {\n\t\t\t\tvar subIndexes = _ref.indexes,\n\t\t\t\t type = _ref.type,\n\t\t\t\t num = _ref.num,\n\t\t\t\t elems = _ref.elems;\n\n\t\t\t\treturn updateDOMforChild(elems, elementsBefore, subIndexes, type, num, parentElem);\n\t\t\t}))\n\t\t\t// after changes are done notify listeners\n\t\t\t.then(function () {\n\t\t\t\tnotifyParent(parentElem, UPDATE_DONE);\n\t\t\t});\n\n\t\t\treturn childArr;\n\t\t}, []);\n\t});\n}", "title": "" }, { "docid": "689faf56fbb0567093c3c05c89296694", "score": "0.5469121", "text": "getAllChildren() {\n const children = this.jq.wrapper.find(this.jq.child)\n return children\n }", "title": "" }, { "docid": "684f028d13eb183a5d6d1f7380b181fd", "score": "0.5468199", "text": "function visitNodes(node, action, context)\r\n {\r\n for (var fieldname in node)\r\n {\r\n var childNode = node[fieldname];\r\n if (childNode == undefined)\r\n continue;\r\n\r\n action(node, fieldname, context);\r\n if (typeof(childNode) != 'object')\r\n continue;\r\n\r\n if (childNode instanceof Array)\r\n {\r\n for (var i = 0; i < childNode.length; i++)\r\n {\r\n if (typeof(childNode[i]) == 'object')\r\n visitNodes(childNode[i], action, context);\r\n }\r\n }\r\n else\r\n {\r\n visitNodes(childNode, action, context);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "713c122e8abf5d98153d9c37f05922e5", "score": "0.54608536", "text": "function visit (node, tag, callback) {\n if (node.tag === tag) {\n callback(node)\n }\n\n if (node.children) {\n return node.children.map((child) => visit(child, tag, callback))\n }\n}", "title": "" }, { "docid": "942f8eb23ac50b11aa69d726afcda334", "score": "0.5458654", "text": "function all(ctx, parent) {\n var children = parent && parent.children;\n if (!children) return '';\n return children.map(function (child, index) {\n return one(ctx, child, index, parent);\n }).join('');\n}", "title": "" }, { "docid": "857cf8384670adf2a2d6ae86a3c0b43b", "score": "0.5443697", "text": "function traverseChildren(elem) {\n var children = [];\n var q = [];\n q.push(elem);\n while (q.length > 0) {\n var elem = q.pop();\n children.push(elem);\n pushAll(elem.children);\n }\n\n function pushAll(elemArray) {\n for (var i = 0; i < elemArray.length; i++) {\n q.push(elemArray[i]);\n }\n }\n return children;\n}", "title": "" }, { "docid": "9ed34a561fa6e6a3e07be99e6d94c1de", "score": "0.5437013", "text": "traverse() {\n this.root.visit(this.root);\n }", "title": "" }, { "docid": "2c50584a914a3c57c52b671c20dcc9c3", "score": "0.5433483", "text": "function deleteAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "a395c9125231e81f3433d06247ee3570", "score": "0.5433343", "text": "function appendChildren(parent, children) {\n children.forEach(function(child) {\n parent.appendChild(child);\n })\n}", "title": "" }, { "docid": "6103d28802b3c08d47bdc093943c2b69", "score": "0.54307514", "text": "function getChildren(parent, allowVirtualChildren) {\n if (allowVirtualChildren === void 0) { allowVirtualChildren = true; }\n var children = [];\n if (parent) {\n for (var i = 0; i < parent.children.length; i++) {\n children.push(parent.children.item(i));\n }\n if (allowVirtualChildren && (0,_isVirtualElement__WEBPACK_IMPORTED_MODULE_0__.isVirtualElement)(parent)) {\n children.push.apply(children, parent._virtual.children);\n }\n }\n return children;\n}", "title": "" }, { "docid": "89a7046a189aa52c5c5f10cf263a23ae", "score": "0.542833", "text": "function getChildren(parent, allowVirtualChildren) {\r\n if (allowVirtualChildren === void 0) { allowVirtualChildren = true; }\r\n var children = [];\r\n if (parent) {\r\n for (var i = 0; i < parent.children.length; i++) {\r\n children.push(parent.children.item(i));\r\n }\r\n if (allowVirtualChildren && isVirtualElement(parent)) {\r\n children.push.apply(children, parent._virtual.children);\r\n }\r\n }\r\n return children;\r\n}", "title": "" }, { "docid": "89a7046a189aa52c5c5f10cf263a23ae", "score": "0.542833", "text": "function getChildren(parent, allowVirtualChildren) {\r\n if (allowVirtualChildren === void 0) { allowVirtualChildren = true; }\r\n var children = [];\r\n if (parent) {\r\n for (var i = 0; i < parent.children.length; i++) {\r\n children.push(parent.children.item(i));\r\n }\r\n if (allowVirtualChildren && isVirtualElement(parent)) {\r\n children.push.apply(children, parent._virtual.children);\r\n }\r\n }\r\n return children;\r\n}", "title": "" }, { "docid": "0c6031a732b3470e2c5e6b5cab93e02c", "score": "0.5421437", "text": "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "title": "" }, { "docid": "0c6031a732b3470e2c5e6b5cab93e02c", "score": "0.5421437", "text": "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "title": "" }, { "docid": "4c893fd3afabc5e303a7251bdd321a52", "score": "0.5419637", "text": "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n\n return allMatches;\n }", "title": "" }, { "docid": "7235448628fc7ef72e754aa2633a9911", "score": "0.5418512", "text": "function addSiblings(parent) {\n while (parent != null) {\n parent.siblings++;\n parent = parent.parent;\n }\n}", "title": "" }, { "docid": "9bc9ab9422fe8aaf2b8615e353a12032", "score": "0.54123586", "text": "function getChildren(parent, allowVirtualChildren) {\n if (allowVirtualChildren === void 0) { allowVirtualChildren = true; }\n var children = [];\n if (parent) {\n for (var i = 0; i < parent.children.length; i++) {\n children.push(parent.children.item(i));\n }\n if (allowVirtualChildren && isVirtualElement(parent)) {\n children.push.apply(children, parent._virtual.children);\n }\n }\n return children;\n}", "title": "" }, { "docid": "a0bf6e03049cc7f61a3b11967cb38c86", "score": "0.5411534", "text": "function appendChildren(parent, children) {\n for (let ele of children) {\n parent.appendChild(ele);\n }\n return parent;\n}", "title": "" }, { "docid": "a0bf6e03049cc7f61a3b11967cb38c86", "score": "0.5411534", "text": "function appendChildren(parent, children) {\n for (let ele of children) {\n parent.appendChild(ele);\n }\n return parent;\n}", "title": "" }, { "docid": "9bd2ea4bea2c7a10008eb70cb49f3fb4", "score": "0.54101104", "text": "function handle_children( parent, children ) {\n\n var mat, dst, pos, rot, scl, quat;\n\n for ( var objID in children ) {\n\n // check by id if child has already been handled,\n // if not, create new object\n\n var object = result.objects[ objID ];\n var objJSON = children[ objID ];\n\n if ( object === undefined ) {\n\n // meshes\n\n if ( objJSON.type && ( objJSON.type in scope.hierarchyHandlers ) ) {\n\n if ( objJSON.loading === undefined ) {\n\n var reservedTypes = {\n \"type\": 1, \"url\": 1, \"material\": 1,\n \"position\": 1, \"rotation\": 1, \"scale\" : 1,\n \"visible\": 1, \"children\": 1, \"userData\": 1,\n \"skin\": 1, \"morph\": 1, \"mirroredLoop\": 1, \"duration\": 1\n };\n\n var loaderParameters = {};\n\n for ( var parType in objJSON ) {\n\n if ( ! ( parType in reservedTypes ) ) {\n\n loaderParameters[ parType ] = objJSON[ parType ];\n\n }\n\n }\n\n material = result.materials[ objJSON.material ];\n\n objJSON.loading = true;\n\n var loader = scope.hierarchyHandlers[ objJSON.type ][ \"loaderObject\" ];\n\n // ColladaLoader\n\n if ( loader.options ) {\n\n loader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ) );\n\n // UTF8Loader\n // OBJLoader\n\n } else {\n\n loader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ), loaderParameters );\n\n }\n\n }\n\n } else if ( objJSON.geometry !== undefined ) {\n\n geometry = result.geometries[ objJSON.geometry ];\n\n // geometry already loaded\n\n if ( geometry ) {\n\n var needsTangents = false;\n\n material = result.materials[ objJSON.material ];\n needsTangents = material instanceof THREE.ShaderMaterial;\n\n pos = objJSON.position;\n rot = objJSON.rotation;\n scl = objJSON.scale;\n mat = objJSON.matrix;\n quat = objJSON.quaternion;\n\n // use materials from the model file\n // if there is no material specified in the object\n\n if ( ! objJSON.material ) {\n\n material = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\n\n }\n\n // use materials from the model file\n // if there is just empty face material\n // (must create new material as each model has its own face material)\n\n if ( ( material instanceof THREE.MeshFaceMaterial ) && material.materials.length === 0 ) {\n\n material = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\n\n }\n\n if ( material instanceof THREE.MeshFaceMaterial ) {\n\n for ( var i = 0; i < material.materials.length; i ++ ) {\n\n needsTangents = needsTangents || ( material.materials[ i ] instanceof THREE.ShaderMaterial );\n\n }\n\n }\n\n if ( needsTangents ) {\n\n geometry.computeTangents();\n\n }\n\n if ( objJSON.skin ) {\n\n object = new THREE.SkinnedMesh( geometry, material );\n\n } else if ( objJSON.morph ) {\n\n object = new THREE.MorphAnimMesh( geometry, material );\n\n if ( objJSON.duration !== undefined ) {\n\n object.duration = objJSON.duration;\n\n }\n\n if ( objJSON.time !== undefined ) {\n\n object.time = objJSON.time;\n\n }\n\n if ( objJSON.mirroredLoop !== undefined ) {\n\n object.mirroredLoop = objJSON.mirroredLoop;\n\n }\n\n if ( material.morphNormals ) {\n\n geometry.computeMorphNormals();\n\n }\n\n } else {\n\n object = new THREE.Mesh( geometry, material );\n\n }\n\n object.name = objID;\n\n if ( mat ) {\n\n object.matrixAutoUpdate = false;\n object.matrix.set(\n mat[0], mat[1], mat[2], mat[3],\n mat[4], mat[5], mat[6], mat[7],\n mat[8], mat[9], mat[10], mat[11],\n mat[12], mat[13], mat[14], mat[15]\n );\n\n } else {\n\n object.position.fromArray( pos );\n\n if ( quat ) {\n\n object.quaternion.fromArray( quat );\n\n } else {\n\n object.rotation.fromArray( rot );\n\n }\n\n object.scale.fromArray( scl );\n\n }\n\n object.visible = objJSON.visible;\n object.castShadow = objJSON.castShadow;\n object.receiveShadow = objJSON.receiveShadow;\n\n parent.add( object );\n\n result.objects[ objID ] = object;\n\n }\n\n // lights\n\n } else if ( objJSON.type === \"DirectionalLight\" || objJSON.type === \"PointLight\" || objJSON.type === \"AmbientLight\" ) {\n\n hex = ( objJSON.color !== undefined ) ? objJSON.color : 0xffffff;\n intensity = ( objJSON.intensity !== undefined ) ? objJSON.intensity : 1;\n\n if ( objJSON.type === \"DirectionalLight\" ) {\n\n pos = objJSON.direction;\n\n light = new THREE.DirectionalLight( hex, intensity );\n light.position.fromArray( pos );\n\n if ( objJSON.target ) {\n\n target_array.push( { \"object\": light, \"targetName\" : objJSON.target } );\n\n // kill existing default target\n // otherwise it gets added to scene when parent gets added\n\n light.target = null;\n\n }\n\n } else if ( objJSON.type === \"PointLight\" ) {\n\n pos = objJSON.position;\n dst = objJSON.distance;\n\n light = new THREE.PointLight( hex, intensity, dst );\n light.position.fromArray( pos );\n\n } else if ( objJSON.type === \"AmbientLight\" ) {\n\n light = new THREE.AmbientLight( hex );\n\n }\n\n parent.add( light );\n\n light.name = objID;\n result.lights[ objID ] = light;\n result.objects[ objID ] = light;\n\n // cameras\n\n } else if ( objJSON.type === \"PerspectiveCamera\" || objJSON.type === \"OrthographicCamera\" ) {\n\n pos = objJSON.position;\n rot = objJSON.rotation;\n quat = objJSON.quaternion;\n\n if ( objJSON.type === \"PerspectiveCamera\" ) {\n\n camera = new THREE.PerspectiveCamera( objJSON.fov, objJSON.aspect, objJSON.near, objJSON.far );\n\n } else if ( objJSON.type === \"OrthographicCamera\" ) {\n\n camera = new THREE.OrthographicCamera( objJSON.left, objJSON.right, objJSON.top, objJSON.bottom, objJSON.near, objJSON.far );\n\n }\n\n camera.name = objID;\n camera.position.fromArray( pos );\n\n if ( quat !== undefined ) {\n\n camera.quaternion.fromArray( quat );\n\n } else if ( rot !== undefined ) {\n\n camera.rotation.fromArray( rot );\n\n }\n\n parent.add( camera );\n\n result.cameras[ objID ] = camera;\n result.objects[ objID ] = camera;\n\n // pure Object3D\n\n } else {\n\n pos = objJSON.position;\n rot = objJSON.rotation;\n scl = objJSON.scale;\n quat = objJSON.quaternion;\n\n object = new THREE.Object3D();\n object.name = objID;\n object.position.fromArray( pos );\n\n if ( quat ) {\n\n object.quaternion.fromArray( quat );\n\n } else {\n\n object.rotation.fromArray( rot );\n\n }\n\n object.scale.fromArray( scl );\n object.visible = ( objJSON.visible !== undefined ) ? objJSON.visible : false;\n\n parent.add( object );\n\n result.objects[ objID ] = object;\n result.empties[ objID ] = object;\n\n }\n\n if ( object ) {\n\n if ( objJSON.userData !== undefined ) {\n\n for ( var key in objJSON.userData ) {\n\n var value = objJSON.userData[ key ];\n object.userData[ key ] = value;\n\n }\n\n }\n\n if ( objJSON.groups !== undefined ) {\n\n for ( var i = 0; i < objJSON.groups.length; i ++ ) {\n\n var groupID = objJSON.groups[ i ];\n\n if ( result.groups[ groupID ] === undefined ) {\n\n result.groups[ groupID ] = [];\n\n }\n\n result.groups[ groupID ].push( objID );\n\n }\n\n }\n\n }\n\n }\n\n if ( object !== undefined && objJSON.children !== undefined ) {\n\n handle_children( object, objJSON.children );\n\n }\n\n }\n\n }", "title": "" }, { "docid": "f7d5b06bdfcb48e3e4ee8b4e5fa35345", "score": "0.5406912", "text": "function getChildren(el) {\n\n }", "title": "" }, { "docid": "02d1ac9608cddbf3a5deb806e59225f5", "score": "0.5393204", "text": "function _build(_lst, _parent) {\n for (var i = 0; i < _lst.length; i++) {\n var node = _lst[i];\n node._parent = _parent; // public assign of parent; ugly \n if (node.children) {\n _build(node.children, node);\n }\n }\n }", "title": "" }, { "docid": "0553d8cde77fab299873ca8d20dfdddf", "score": "0.53892803", "text": "function all(children, parents) {\n var min = -1\n var step = reverse ? -1 : 1\n var index = (reverse ? children.length : min) + step\n var child\n var result\n\n while (index > min && index < children.length) {\n child = children[index]\n result = child && one(child, index, parents)\n\n if (result === EXIT) {\n return result\n }\n\n index = typeof result === 'number' ? result : index + step\n }\n }", "title": "" }, { "docid": "0553d8cde77fab299873ca8d20dfdddf", "score": "0.53892803", "text": "function all(children, parents) {\n var min = -1\n var step = reverse ? -1 : 1\n var index = (reverse ? children.length : min) + step\n var child\n var result\n\n while (index > min && index < children.length) {\n child = children[index]\n result = child && one(child, index, parents)\n\n if (result === EXIT) {\n return result\n }\n\n index = typeof result === 'number' ? result : index + step\n }\n }", "title": "" }, { "docid": "bcf5402287334c93e79c93400f3dfbfc", "score": "0.5373767", "text": "everyChildren(callback) {\n return this.childElements.every(visit);\n function visit(node) {\n if (!callback(node)) {\n return false;\n }\n return node.childElements.every(visit);\n }\n }", "title": "" }, { "docid": "f76fb4a830ecdbdb5927ac7daee453e0", "score": "0.5369435", "text": "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n return allMatches;\n }", "title": "" }, { "docid": "f76fb4a830ecdbdb5927ac7daee453e0", "score": "0.5369435", "text": "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n return allMatches;\n }", "title": "" }, { "docid": "6766e4872761902cfafdc263673550f6", "score": "0.5369117", "text": "function _onNodeAction (node, parent) {\n var par = parent;\n\n node.setParent = function (newParent) {\n par = newParent;\n };\n\n /**\n * Method getParent\n *\n * Method return parent of the node\n *\n * @returns {*}\n */\n node.getParent = function () {\n return par;\n };\n\n /**\n * Method getNext\n *\n * Method returns next node in subnodes array or null if current node is last in array\n *\n * @returns {*}\n */\n node.getNext = function () {\n var index,\n nextNode;\n\n if (parent !== null) {\n index = parent.subnodes.indexOf(node);\n nextNode = parent.subnodes[index+1];\n\n return (typeof nextNode !== 'undefined') ? nextNode : null;\n } else {\n return null;\n }\n };\n\n /**\n * Method getPrev\n *\n * Method returns previous node in subnodes array or null if current node is first in array\n *\n * @returns {*}\n */\n node.getPrev = function () {\n var index,\n prevNode;\n\n if (parent !== null) {\n index = parent.subnodes.indexOf(node);\n prevNode = parent.subnodes[index-1];\n\n return (typeof prevNode !== 'undefined') ? prevNode : null;\n } else {\n return null;\n }\n };\n\n /*\n Add levels indicators to nested subtrees.\n */\n node.level = (parent === null) ? 1 : parent.level + 1;\n\n\n if (angular.isArray(node.subnodes)) {\n for (var i = 0, len = node.subnodes.length; i < len; i++) {\n _onNodeAction(node.subnodes[i], node);\n }\n }\n }", "title": "" }, { "docid": "c73c06074de1ae87d0808b2f24e77bd9", "score": "0.5361712", "text": "function one(node, index, parent) {\n var result;\n\n index = index || (parent ? 0 : null);\n\n if (!type || node.type === type) {\n result = visitor(node, index, parent || null);\n }\n\n if (node.children && result !== false) {\n return all(node.children, node);\n }\n\n return result;\n }", "title": "" }, { "docid": "571fbb084084e80921523fc6fdf53146", "score": "0.535109", "text": "function handle_children( parent, children ) {\r\n\r\n\t\tvar mat, dst, pos, rot, scl, quat;\r\n\r\n\t\tfor ( var objID in children ) {\r\n\r\n\t\t\t// check by id if child has already been handled,\r\n\t\t\t// if not, create new object\r\n\r\n\t\t\tif ( result.objects[ objID ] === undefined ) {\r\n\r\n\t\t\t\tvar objJSON = children[ objID ];\r\n\r\n\t\t\t\tvar object = null;\r\n\r\n\t\t\t\t// meshes\r\n\r\n\t\t\t\tif ( objJSON.type && ( objJSON.type in scope.hierarchyHandlerMap ) ) {\r\n\r\n\t\t\t\t\tif ( objJSON.loading === undefined ) {\r\n\r\n\t\t\t\t\t\tvar reservedTypes = { \"type\": 1, \"url\": 1, \"material\": 1,\r\n\t\t\t\t\t\t\t\t\t\t\t \"position\": 1, \"rotation\": 1, \"scale\" : 1,\r\n\t\t\t\t\t\t\t\t\t\t\t \"visible\": 1, \"children\": 1, \"properties\": 1,\r\n\t\t\t\t\t\t\t\t\t\t\t \"skin\": 1, \"morph\": 1, \"mirroredLoop\": 1, \"duration\": 1 };\r\n\r\n\t\t\t\t\t\tvar loaderParameters = {};\r\n\r\n\t\t\t\t\t\tfor ( var parType in objJSON ) {\r\n\r\n\t\t\t\t\t\t\tif ( ! ( parType in reservedTypes ) ) {\r\n\r\n\t\t\t\t\t\t\t\tloaderParameters[ parType ] = objJSON[ parType ];\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmaterial = result.materials[ objJSON.material ];\r\n\r\n\t\t\t\t\t\tobjJSON.loading = true;\r\n\r\n\t\t\t\t\t\tvar loader = scope.hierarchyHandlerMap[ objJSON.type ][ \"loaderObject\" ];\r\n\r\n\t\t\t\t\t\t// ColladaLoader\r\n\r\n\t\t\t\t\t\tif ( loader.options ) {\r\n\r\n\t\t\t\t\t\t\tloader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ) );\r\n\r\n\t\t\t\t\t\t// UTF8Loader\r\n\t\t\t\t\t\t// OBJLoader\r\n\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\tloader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ), loaderParameters );\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else if ( objJSON.geometry !== undefined ) {\r\n\r\n\t\t\t\t\tgeometry = result.geometries[ objJSON.geometry ];\r\n\r\n\t\t\t\t\t// geometry already loaded\r\n\r\n\t\t\t\t\tif ( geometry ) {\r\n\r\n\t\t\t\t\t\tvar needsTangents = false;\r\n\r\n\t\t\t\t\t\tmaterial = result.materials[ objJSON.material ];\r\n\t\t\t\t\t\tneedsTangents = material instanceof THREE.ShaderMaterial;\r\n\r\n\t\t\t\t\t\tpos = objJSON.position;\r\n\t\t\t\t\t\trot = objJSON.rotation;\r\n\t\t\t\t\t\tscl = objJSON.scale;\r\n\t\t\t\t\t\tmat = objJSON.matrix;\r\n\t\t\t\t\t\tquat = objJSON.quaternion;\r\n\r\n\t\t\t\t\t\t// use materials from the model file\r\n\t\t\t\t\t\t// if there is no material specified in the object\r\n\r\n\t\t\t\t\t\tif ( ! objJSON.material ) {\r\n\r\n\t\t\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// use materials from the model file\r\n\t\t\t\t\t\t// if there is just empty face material\r\n\t\t\t\t\t\t// (must create new material as each model has its own face material)\r\n\r\n\t\t\t\t\t\tif ( ( material instanceof THREE.MeshFaceMaterial ) && material.materials.length === 0 ) {\r\n\r\n\t\t\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ( material instanceof THREE.MeshFaceMaterial ) {\r\n\r\n\t\t\t\t\t\t\tfor ( var i = 0; i < material.materials.length; i ++ ) {\r\n\r\n\t\t\t\t\t\t\t\tneedsTangents = needsTangents || ( material.materials[ i ] instanceof THREE.ShaderMaterial );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ( needsTangents ) {\r\n\r\n\t\t\t\t\t\t\tgeometry.computeTangents();\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ( objJSON.skin ) {\r\n\r\n\t\t\t\t\t\t\tobject = new THREE.SkinnedMesh( geometry, material );\r\n\r\n\t\t\t\t\t\t} else if ( objJSON.morph ) {\r\n\r\n\t\t\t\t\t\t\tobject = new THREE.MorphAnimMesh( geometry, material );\r\n\r\n\t\t\t\t\t\t\tif ( objJSON.duration !== undefined ) {\r\n\r\n\t\t\t\t\t\t\t\tobject.duration = objJSON.duration;\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ( objJSON.time !== undefined ) {\r\n\r\n\t\t\t\t\t\t\t\tobject.time = objJSON.time;\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ( objJSON.mirroredLoop !== undefined ) {\r\n\r\n\t\t\t\t\t\t\t\tobject.mirroredLoop = objJSON.mirroredLoop;\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ( material.morphNormals ) {\r\n\r\n\t\t\t\t\t\t\t\tgeometry.computeMorphNormals();\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\tobject = new THREE.Mesh( geometry, material );\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tobject.name = objID;\r\n\r\n\t\t\t\t\t\tif ( mat ) {\r\n\r\n\t\t\t\t\t\t\tobject.matrixAutoUpdate = false;\r\n\t\t\t\t\t\t\tobject.matrix.set(\r\n\t\t\t\t\t\t\t\tmat[0], mat[1], mat[2], mat[3],\r\n\t\t\t\t\t\t\t\tmat[4], mat[5], mat[6], mat[7],\r\n\t\t\t\t\t\t\t\tmat[8], mat[9], mat[10], mat[11],\r\n\t\t\t\t\t\t\t\tmat[12], mat[13], mat[14], mat[15]\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\tobject.position.set( pos[0], pos[1], pos[2] );\r\n\r\n\t\t\t\t\t\t\tif ( quat ) {\r\n\r\n\t\t\t\t\t\t\t\tobject.quaternion.set( quat[0], quat[1], quat[2], quat[3] );\r\n\t\t\t\t\t\t\t\tobject.useQuaternion = true;\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\tobject.rotation.set( rot[0], rot[1], rot[2] );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tobject.scale.set( scl[0], scl[1], scl[2] );\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tobject.visible = objJSON.visible;\r\n\t\t\t\t\t\tobject.castShadow = objJSON.castShadow;\r\n\t\t\t\t\t\tobject.receiveShadow = objJSON.receiveShadow;\r\n\r\n\t\t\t\t\t\tparent.add( object );\r\n\r\n\t\t\t\t\t\tresult.objects[ objID ] = object;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t// lights\r\n\r\n\t\t\t\t} else if ( objJSON.type === \"DirectionalLight\" || objJSON.type === \"PointLight\" || objJSON.type === \"AmbientLight\" ) {\r\n\r\n\t\t\t\t\thex = ( objJSON.color !== undefined ) ? objJSON.color : 0xffffff;\r\n\t\t\t\t\tintensity = ( objJSON.intensity !== undefined ) ? objJSON.intensity : 1;\r\n\r\n\t\t\t\t\tif ( objJSON.type === \"DirectionalLight\" ) {\r\n\r\n\t\t\t\t\t\tpos = objJSON.direction;\r\n\r\n\t\t\t\t\t\tlight = new THREE.DirectionalLight( hex, intensity );\r\n\t\t\t\t\t\tlight.position.set( pos[0], pos[1], pos[2] );\r\n\r\n\t\t\t\t\t\tif ( objJSON.target ) {\r\n\r\n\t\t\t\t\t\t\ttarget_array.push( { \"object\": light, \"targetName\" : objJSON.target } );\r\n\r\n\t\t\t\t\t\t\t// kill existing default target\r\n\t\t\t\t\t\t\t// otherwise it gets added to scene when parent gets added\r\n\r\n\t\t\t\t\t\t\tlight.target = null;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else if ( objJSON.type === \"PointLight\" ) {\r\n\r\n\t\t\t\t\t\tpos = objJSON.position;\r\n\t\t\t\t\t\tdst = objJSON.distance;\r\n\r\n\t\t\t\t\t\tlight = new THREE.PointLight( hex, intensity, dst );\r\n\t\t\t\t\t\tlight.position.set( pos[0], pos[1], pos[2] );\r\n\r\n\t\t\t\t\t} else if ( objJSON.type === \"AmbientLight\" ) {\r\n\r\n\t\t\t\t\t\tlight = new THREE.AmbientLight( hex );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tparent.add( light );\r\n\r\n\t\t\t\t\tlight.name = objID;\r\n\t\t\t\t\tresult.lights[ objID ] = light;\r\n\t\t\t\t\tresult.objects[ objID ] = light;\r\n\r\n\t\t\t\t// cameras\r\n\r\n\t\t\t\t} else if ( objJSON.type === \"PerspectiveCamera\" || objJSON.type === \"OrthographicCamera\" ) {\r\n\r\n\t\t\t\t\tif ( objJSON.type === \"PerspectiveCamera\" ) {\r\n\r\n\t\t\t\t\t\tcamera = new THREE.PerspectiveCamera( objJSON.fov, objJSON.aspect, objJSON.near, objJSON.far );\r\n\r\n\t\t\t\t\t} else if ( objJSON.type === \"OrthographicCamera\" ) {\r\n\r\n\t\t\t\t\t\tcamera = new THREE.OrthographicCamera( objJSON.left, objJSON.right, objJSON.top, objJSON.bottom, objJSON.near, objJSON.far );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tpos = objJSON.position;\r\n\t\t\t\t\tcamera.position.set( pos[0], pos[1], pos[2] );\r\n\t\t\t\t\tparent.add( camera );\r\n\r\n\t\t\t\t\tcamera.name = objID;\r\n\t\t\t\t\tresult.cameras[ objID ] = camera;\r\n\t\t\t\t\tresult.objects[ objID ] = camera;\r\n\r\n\t\t\t\t// pure Object3D\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tpos = objJSON.position;\r\n\t\t\t\t\trot = objJSON.rotation;\r\n\t\t\t\t\tscl = objJSON.scale;\r\n\t\t\t\t\tquat = objJSON.quaternion;\r\n\r\n\t\t\t\t\tobject = new THREE.Object3D();\r\n\t\t\t\t\tobject.name = objID;\r\n\t\t\t\t\tobject.position.set( pos[0], pos[1], pos[2] );\r\n\r\n\t\t\t\t\tif ( quat ) {\r\n\r\n\t\t\t\t\t\tobject.quaternion.set( quat[0], quat[1], quat[2], quat[3] );\r\n\t\t\t\t\t\tobject.useQuaternion = true;\r\n\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tobject.rotation.set( rot[0], rot[1], rot[2] );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tobject.scale.set( scl[0], scl[1], scl[2] );\r\n\t\t\t\t\tobject.visible = ( objJSON.visible !== undefined ) ? objJSON.visible : false;\r\n\r\n\t\t\t\t\tparent.add( object );\r\n\r\n\t\t\t\t\tresult.objects[ objID ] = object;\r\n\t\t\t\t\tresult.empties[ objID ] = object;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( object ) {\r\n\r\n\t\t\t\t\tif ( objJSON.properties !== undefined ) {\r\n\r\n\t\t\t\t\t\tfor ( var key in objJSON.properties ) {\r\n\r\n\t\t\t\t\t\t\tvar value = objJSON.properties[ key ];\r\n\t\t\t\t\t\t\tobject.properties[ key ] = value;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( objJSON.groups !== undefined ) {\r\n\r\n\t\t\t\t\t\tfor ( var i = 0; i < objJSON.groups.length; i ++ ) {\r\n\r\n\t\t\t\t\t\t\tvar groupID = objJSON.groups[ i ];\r\n\r\n\t\t\t\t\t\t\tif ( result.groups[ groupID ] === undefined ) {\r\n\r\n\t\t\t\t\t\t\t\tresult.groups[ groupID ] = [];\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tresult.groups[ groupID ].push( objID );\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( objJSON.children !== undefined ) {\r\n\r\n\t\t\t\t\t\thandle_children( object, objJSON.children );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "7aee4876db3b6e1b3e065aefce93b733", "score": "0.53483415", "text": "function findChildren( parent, nodeNames ) {\n\t\treturn Array.prototype.filter.call( parent.childNodes, function ( element ) {\n\t\t\treturn nodeNames.indexOf( element.nodeName.toLowerCase() ) !== -1;\n\t\t} );\n\t}", "title": "" }, { "docid": "7aee4876db3b6e1b3e065aefce93b733", "score": "0.53483415", "text": "function findChildren( parent, nodeNames ) {\n\t\treturn Array.prototype.filter.call( parent.childNodes, function ( element ) {\n\t\t\treturn nodeNames.indexOf( element.nodeName.toLowerCase() ) !== -1;\n\t\t} );\n\t}", "title": "" }, { "docid": "e7462afb79e28668781c39d1f349374d", "score": "0.5342473", "text": "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n if (!selector || elementMatches$1(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n return allMatches;\n }", "title": "" }, { "docid": "73dce47891c051db21575e69b564acc1", "score": "0.53371054", "text": "addChildren(value) {}", "title": "" }, { "docid": "072503121f11552af6ef8521dd78776f", "score": "0.5328011", "text": "get children() {\n return this._children;\n }", "title": "" }, { "docid": "5d4f8caf5b6ae78000b35f23a066a6e1", "score": "0.5320331", "text": "function all(h, parent) {\n var nodes = parent.children || [];\n var length = nodes.length;\n var values = [];\n var index = -1;\n var result;\n var head;\n\n while (++index < length) {\n result = one(h, nodes[index], parent);\n\n if (result) {\n if (index && nodes[index - 1].type === 'break') {\n if (result.value) {\n result.value = trim.left(result.value);\n }\n\n head = result.children && result.children[0];\n\n if (head && head.value) {\n head.value = trim.left(head.value);\n }\n }\n\n values = values.concat(result);\n }\n }\n\n return values;\n}", "title": "" }, { "docid": "48b3c3e5c6ddfbe54ca8c0378af60a68", "score": "0.53093857", "text": "get childNodes () {\n return childNodes(this._data).map(data => createNode(data));\n }", "title": "" }, { "docid": "ad3903a9302f635c18519fa32389766f", "score": "0.5307402", "text": "function all(children, parents) {\n var min = -1\n var step = reverse ? -1 : 1\n var index = (reverse ? children.length : min) + step\n var result\n\n while (index > min && index < children.length) {\n result = one(children[index], index, parents)\n\n if (result[0] === EXIT) {\n return result\n }\n\n index = typeof result[1] === 'number' ? result[1] : index + step\n }\n }", "title": "" }, { "docid": "ad3903a9302f635c18519fa32389766f", "score": "0.5307402", "text": "function all(children, parents) {\n var min = -1\n var step = reverse ? -1 : 1\n var index = (reverse ? children.length : min) + step\n var result\n\n while (index > min && index < children.length) {\n result = one(children[index], index, parents)\n\n if (result[0] === EXIT) {\n return result\n }\n\n index = typeof result[1] === 'number' ? result[1] : index + step\n }\n }", "title": "" }, { "docid": "ad3903a9302f635c18519fa32389766f", "score": "0.5307402", "text": "function all(children, parents) {\n var min = -1\n var step = reverse ? -1 : 1\n var index = (reverse ? children.length : min) + step\n var result\n\n while (index > min && index < children.length) {\n result = one(children[index], index, parents)\n\n if (result[0] === EXIT) {\n return result\n }\n\n index = typeof result[1] === 'number' ? result[1] : index + step\n }\n }", "title": "" }, { "docid": "c73a7260cbb7b1127afd84c1b67070bc", "score": "0.53016275", "text": "function walkArray(array, visitor, options, parent, filter) {\n for (let i = 0; i < array.length; i++) {\n if (!filter || filter(array[i])) {\n const startLength = array.length;\n walk(array, i, visitor, options, parent);\n //compensate for deleted or added items.\n i += array.length - startLength;\n }\n }\n}", "title": "" }, { "docid": "d1f866ce98b9a6a599b6844602573ff3", "score": "0.52938277", "text": "async readChildren () {\n return this._children\n }", "title": "" }, { "docid": "d1f866ce98b9a6a599b6844602573ff3", "score": "0.52938277", "text": "async readChildren () {\n return this._children\n }", "title": "" }, { "docid": "563cf020ab508a0ecdc92e073cda8954", "score": "0.52927756", "text": "traverse(fn, skipSelf = false) {\n const {\n children\n } = this;\n\n if (!skipSelf) {\n fn.call(this, this);\n } // Simply testing whether there is non-zero children length\n // is 10x faster than using this.isLoaded\n\n for (let i = 0, l = children && children.length; i < l; i++) {\n children[i].traverse(fn);\n }\n }", "title": "" }, { "docid": "62e7dd77fddcad934d06de1d26d46f7e", "score": "0.52898425", "text": "traverseChildren(crossScope, func) {\r\n\t\t\t\t\tif (crossScope) {\r\n\t\t\t\t\t\treturn super.traverseChildren(crossScope, func);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "title": "" }, { "docid": "8dca51d23a23cfab73811e4e44b14745", "score": "0.5283351", "text": "getChildren() {\n const child = this.oneChild();\n if (child) {\n return child.getChildren();\n }\n const array = [];\n for (let child of this._children.values()) {\n array.push(child);\n }\n return array.sort((a, b) => this.compare(a, b));\n }", "title": "" }, { "docid": "b56b743ba43daae4686e3b438bdbe554", "score": "0.52713186", "text": "traverse(node, callback) {\n if (this.#shouldStop) return;\n\n if (Array.isArray(node)) {\n for (const key of node) {\n if (isObject(key)) {\n // Mark that the node has been visited\n key.parent = node;\n this.traverse(key, callback);\n }\n }\n } else if (isObject(node)) {\n callback(node);\n\n for (const [key, value] of Object.entries(node)) {\n // Avoid visited nodes\n if (key === 'parent' || !value) continue;\n\n if (isObject(value)) {\n value.parent = node;\n }\n\n this.traverse(value, callback);\n }\n }\n }", "title": "" }, { "docid": "e440b7675b8d5d4486b1ced2b04b3aa1", "score": "0.52615047", "text": "children() {\n const cached = this.#children.get(this);\n if (cached) {\n return cached;\n }\n const children = Object.assign([], { provisional: 0 });\n this.#children.set(this, children);\n this.#type &= ~READDIR_CALLED;\n return children;\n }", "title": "" }, { "docid": "55ef837f0a7930811781e2e6003a8939", "score": "0.5255921", "text": "forEach(visitor) {\n this.tree_walk(this.root, (node) => visitor(node.item.key, node.item.value));\n }", "title": "" }, { "docid": "9601323cd6744c76c50814f1809515fb", "score": "0.5250091", "text": "*getObjectsInChildren(type = undefined)\n {\n // Iterate over the game objects\n for (let gameObject of this.gameObjects)\n {\n // Yield the game object if the type matches\n if (typeof type === 'undefined' || gameObject instanceof type)\n yield gameObject;\n\n // Yield from the children\n yield* gameObject.getObjectsInChildren(type);\n }\n }", "title": "" }, { "docid": "b1c3276048f86cf255d87210f313ba35", "score": "0.5246505", "text": "function handle_children( parent, children ) {\n\n\t\t\tvar mat, dst, pos, rot, scl, quat;\n\n\t\t\tfor ( var objID in children ) {\n\n\t\t\t\t// check by id if child has already been handled,\n\t\t\t\t// if not, create new object\n\n\t\t\t\tvar object = result.objects[ objID ];\n\t\t\t\tvar objJSON = children[ objID ];\n\n\t\t\t\tif ( object === undefined ) {\n\n\t\t\t\t\t// meshes\n\n\t\t\t\t\tif ( objJSON.type && ( objJSON.type in scope.hierarchyHandlers ) ) {\n\n\t\t\t\t\t\tif ( objJSON.loading === undefined ) {\n\n\t\t\t\t\t\t\tvar reservedTypes = {\n\t\t\t\t\t\t\t\t\"type\": 1, \"url\": 1, \"material\": 1,\n\t\t\t\t\t\t\t\t\"position\": 1, \"rotation\": 1, \"scale\" : 1,\n\t\t\t\t\t\t\t\t\"visible\": 1, \"children\": 1, \"userData\": 1,\n\t\t\t\t\t\t\t\t\"skin\": 1, \"morph\": 1, \"mirroredLoop\": 1, \"duration\": 1\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tvar loaderParameters = {};\n\n\t\t\t\t\t\t\tfor ( var parType in objJSON ) {\n\n\t\t\t\t\t\t\t\tif ( ! ( parType in reservedTypes ) ) {\n\n\t\t\t\t\t\t\t\t\tloaderParameters[ parType ] = objJSON[ parType ];\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmaterial = result.materials[ objJSON.material ];\n\n\t\t\t\t\t\t\tobjJSON.loading = true;\n\n\t\t\t\t\t\t\tvar loader = scope.hierarchyHandlers[ objJSON.type ][ \"loaderObject\" ];\n\n\t\t\t\t\t\t\t// ColladaLoader\n\n\t\t\t\t\t\t\tif ( loader.options ) {\n\n\t\t\t\t\t\t\t\tloader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ) );\n\n\t\t\t\t\t\t\t// UTF8Loader\n\t\t\t\t\t\t\t// OBJLoader\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tloader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ), loaderParameters );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( objJSON.geometry !== undefined ) {\n\n\t\t\t\t\t\tgeometry = result.geometries[ objJSON.geometry ];\n\n\t\t\t\t\t\t// geometry already loaded\n\n\t\t\t\t\t\tif ( geometry ) {\n\n\t\t\t\t\t\t\tvar needsTangents = false;\n\n\t\t\t\t\t\t\tmaterial = result.materials[ objJSON.material ];\n\t\t\t\t\t\t\tneedsTangents = material instanceof THREE.ShaderMaterial;\n\n\t\t\t\t\t\t\tpos = objJSON.position;\n\t\t\t\t\t\t\trot = objJSON.rotation;\n\t\t\t\t\t\t\tscl = objJSON.scale;\n\t\t\t\t\t\t\tmat = objJSON.matrix;\n\t\t\t\t\t\t\tquat = objJSON.quaternion;\n\n\t\t\t\t\t\t\t// use materials from the model file\n\t\t\t\t\t\t\t// if there is no material specified in the object\n\n\t\t\t\t\t\t\tif ( ! objJSON.material ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// use materials from the model file\n\t\t\t\t\t\t\t// if there is just empty face material\n\t\t\t\t\t\t\t// (must create new material as each model has its own face material)\n\n\t\t\t\t\t\t\tif ( ( material instanceof THREE.MeshFaceMaterial ) && material.materials.length === 0 ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( material instanceof THREE.MeshFaceMaterial ) {\n\n\t\t\t\t\t\t\t\tfor ( var i = 0; i < material.materials.length; i ++ ) {\n\n\t\t\t\t\t\t\t\t\tneedsTangents = needsTangents || ( material.materials[ i ] instanceof THREE.ShaderMaterial );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( needsTangents ) {\n\n\t\t\t\t\t\t\t\tgeometry.computeTangents();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( objJSON.skin ) {\n\n\t\t\t\t\t\t\t\tobject = new THREE.SkinnedMesh( geometry, material );\n\n\t\t\t\t\t\t\t} else if ( objJSON.morph ) {\n\n\t\t\t\t\t\t\t\tobject = new THREE.MorphAnimMesh( geometry, material );\n\n\t\t\t\t\t\t\t\tif ( objJSON.duration !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tobject.duration = objJSON.duration;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( objJSON.time !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tobject.time = objJSON.time;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( objJSON.mirroredLoop !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tobject.mirroredLoop = objJSON.mirroredLoop;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( material.morphNormals ) {\n\n\t\t\t\t\t\t\t\t\tgeometry.computeMorphNormals();\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tobject = new THREE.Mesh( geometry, material );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tobject.name = objID;\n\n\t\t\t\t\t\t\tif ( mat ) {\n\n\t\t\t\t\t\t\t\tobject.matrixAutoUpdate = false;\n\t\t\t\t\t\t\t\tobject.matrix.set(\n\t\t\t\t\t\t\t\t\tmat[0], mat[1], mat[2], mat[3],\n\t\t\t\t\t\t\t\t\tmat[4], mat[5], mat[6], mat[7],\n\t\t\t\t\t\t\t\t\tmat[8], mat[9], mat[10], mat[11],\n\t\t\t\t\t\t\t\t\tmat[12], mat[13], mat[14], mat[15]\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tobject.position.fromArray( pos );\n\n\t\t\t\t\t\t\t\tif ( quat ) {\n\n\t\t\t\t\t\t\t\t\tobject.quaternion.fromArray( quat );\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tobject.rotation.fromArray( rot );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tobject.scale.fromArray( scl );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tobject.visible = objJSON.visible;\n\t\t\t\t\t\t\tobject.castShadow = objJSON.castShadow;\n\t\t\t\t\t\t\tobject.receiveShadow = objJSON.receiveShadow;\n\n\t\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t\t\tresult.objects[ objID ] = object;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// lights\n\n\t\t\t\t\t} else if ( objJSON.type === \"AmbientLight\" || objJSON.type === \"PointLight\" ||\n\t\t\t\t\t\tobjJSON.type === \"DirectionalLight\" || objJSON.type === \"SpotLight\" ||\n\t\t\t\t\t\tobjJSON.type === \"HemisphereLight\" || objJSON.type === \"AreaLight\" ) {\n\n\t\t\t\t\t\tvar color = objJSON.color;\n\t\t\t\t\t\tvar intensity = objJSON.intensity;\n\t\t\t\t\t\tvar distance = objJSON.distance;\n\t\t\t\t\t\tvar position = objJSON.position;\n\t\t\t\t\t\tvar rotation = objJSON.rotation;\n\n\t\t\t\t\t\tswitch ( objJSON.type ) {\n\n\t\t\t\t\t\t\tcase 'AmbientLight':\n\t\t\t\t\t\t\t\tlight = new THREE.AmbientLight( color );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'PointLight':\n\t\t\t\t\t\t\t\tlight = new THREE.PointLight( color, intensity, distance );\n\t\t\t\t\t\t\t\tlight.position.fromArray( position );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\t\t\t\tlight = new THREE.DirectionalLight( color, intensity );\n\t\t\t\t\t\t\t\tlight.position.fromArray( objJSON.direction );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'SpotLight':\n\t\t\t\t\t\t\t\tlight = new THREE.SpotLight( color, intensity, distance, 1 );\n\t\t\t\t\t\t\t\tlight.angle = objJSON.angle;\n\t\t\t\t\t\t\t\tlight.position.fromArray( position );\n\t\t\t\t\t\t\t\tlight.target.set( position[ 0 ], position[ 1 ] - distance, position[ 2 ] );\n\t\t\t\t\t\t\t\tlight.target.applyEuler( new THREE.Euler( rotation[ 0 ], rotation[ 1 ], rotation[ 2 ], 'XYZ' ) );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\t\t\t\tlight = new THREE.DirectionalLight( color, intensity, distance );\n\t\t\t\t\t\t\t\tlight.target.set( position[ 0 ], position[ 1 ] - distance, position[ 2 ] );\n\t\t\t\t\t\t\t\tlight.target.applyEuler( new THREE.Euler( rotation[ 0 ], rotation[ 1 ], rotation[ 2 ], 'XYZ' ) );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'AreaLight':\n\t\t\t\t\t\t\t\tlight = new THREE.AreaLight(color, intensity);\n\t\t\t\t\t\t\t\tlight.position.fromArray( position );\n\t\t\t\t\t\t\t\tlight.width = objJSON.size;\n\t\t\t\t\t\t\t\tlight.height = objJSON.size_y;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tparent.add( light );\n\n\t\t\t\t\t\tlight.name = objID;\n\t\t\t\t\t\tresult.lights[ objID ] = light;\n\t\t\t\t\t\tresult.objects[ objID ] = light;\n\n\t\t\t\t\t// cameras\n\n\t\t\t\t\t} else if ( objJSON.type === \"PerspectiveCamera\" || objJSON.type === \"OrthographicCamera\" ) {\n\n\t\t\t\t\t\tpos = objJSON.position;\n\t\t\t\t\t\trot = objJSON.rotation;\n\t\t\t\t\t\tquat = objJSON.quaternion;\n\n\t\t\t\t\t\tif ( objJSON.type === \"PerspectiveCamera\" ) {\n\n\t\t\t\t\t\t\tcamera = new THREE.PerspectiveCamera( objJSON.fov, objJSON.aspect, objJSON.near, objJSON.far );\n\n\t\t\t\t\t\t} else if ( objJSON.type === \"OrthographicCamera\" ) {\n\n\t\t\t\t\t\t\tcamera = new THREE.OrthographicCamera( objJSON.left, objJSON.right, objJSON.top, objJSON.bottom, objJSON.near, objJSON.far );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcamera.name = objID;\n\t\t\t\t\t\tcamera.position.fromArray( pos );\n\n\t\t\t\t\t\tif ( quat !== undefined ) {\n\n\t\t\t\t\t\t\tcamera.quaternion.fromArray( quat );\n\n\t\t\t\t\t\t} else if ( rot !== undefined ) {\n\n\t\t\t\t\t\t\tcamera.rotation.fromArray( rot );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tparent.add( camera );\n\n\t\t\t\t\t\tresult.cameras[ objID ] = camera;\n\t\t\t\t\t\tresult.objects[ objID ] = camera;\n\n\t\t\t\t\t// pure Object3D\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpos = objJSON.position;\n\t\t\t\t\t\trot = objJSON.rotation;\n\t\t\t\t\t\tscl = objJSON.scale;\n\t\t\t\t\t\tquat = objJSON.quaternion;\n\n\t\t\t\t\t\tobject = new THREE.Object3D();\n\t\t\t\t\t\tobject.name = objID;\n\t\t\t\t\t\tobject.position.fromArray( pos );\n\n\t\t\t\t\t\tif ( quat ) {\n\n\t\t\t\t\t\t\tobject.quaternion.fromArray( quat );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tobject.rotation.fromArray( rot );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tobject.scale.fromArray( scl );\n\t\t\t\t\t\tobject.visible = ( objJSON.visible !== undefined ) ? objJSON.visible : false;\n\n\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t\tresult.objects[ objID ] = object;\n\t\t\t\t\t\tresult.empties[ objID ] = object;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( object ) {\n\n\t\t\t\t\t\tif ( objJSON.userData !== undefined ) {\n\n\t\t\t\t\t\t\tfor ( var key in objJSON.userData ) {\n\n\t\t\t\t\t\t\t\tvar value = objJSON.userData[ key ];\n\t\t\t\t\t\t\t\tobject.userData[ key ] = value;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( objJSON.groups !== undefined ) {\n\n\t\t\t\t\t\t\tfor ( var i = 0; i < objJSON.groups.length; i ++ ) {\n\n\t\t\t\t\t\t\t\tvar groupID = objJSON.groups[ i ];\n\n\t\t\t\t\t\t\t\tif ( result.groups[ groupID ] === undefined ) {\n\n\t\t\t\t\t\t\t\t\tresult.groups[ groupID ] = [];\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tresult.groups[ groupID ].push( objID );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( object !== undefined && objJSON.children !== undefined ) {\n\n\t\t\t\t\thandle_children( object, objJSON.children );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "title": "" } ]
03ad08fa02c7a24dc81698559a1fd6f0
simple hyphenation of a string, replaces nonalphanumerical characters with hyphens
[ { "docid": "e283dac0a898e20a3735818b66fbd4da", "score": "0.8442191", "text": "function hyphenate(string) {\n return string.replace(/[\\W]/g, '-');\n }", "title": "" } ]
[ { "docid": "2de17f4600e00a45af2e540242d48fa5", "score": "0.8436168", "text": "function hyphenate(str) { return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); }", "title": "" }, { "docid": "acc9080cc31990965d4c85b3e78b54d8", "score": "0.8306818", "text": "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "title": "" }, { "docid": "acc9080cc31990965d4c85b3e78b54d8", "score": "0.8306818", "text": "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "title": "" }, { "docid": "acc9080cc31990965d4c85b3e78b54d8", "score": "0.8306818", "text": "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "title": "" }, { "docid": "acc9080cc31990965d4c85b3e78b54d8", "score": "0.8306818", "text": "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "title": "" }, { "docid": "acc9080cc31990965d4c85b3e78b54d8", "score": "0.8306818", "text": "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "title": "" }, { "docid": "acc9080cc31990965d4c85b3e78b54d8", "score": "0.8306818", "text": "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "title": "" }, { "docid": "6f2c08660d24785995cde0b1d3452f75", "score": "0.82930136", "text": "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "title": "" }, { "docid": "a309bec2b3ba4132b56fb3914b8954d3", "score": "0.8270889", "text": "function unhyphenate(str){\n return str.replace(/(\\w)(-)(\\w)/g, '$1 $3');\n}", "title": "" }, { "docid": "4c93ca1375120092d5c4f63497a63329", "score": "0.8209353", "text": "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "title": "" }, { "docid": "40d417226fbc96f70749cd050f65ad54", "score": "0.81934655", "text": "function hyphenator(word){\n function hyphen(match) {\n return \"-\" + match.toLowerCase();\n }\n return word.replace(/\\B[A-Z]/g, hyphen);\n }", "title": "" }, { "docid": "fde699ece219cba29eea385acfbbef7c", "score": "0.8122479", "text": "function hyphenate(str){\n str = unCamelCase(str);\n return slugify(str, \"-\");\n}", "title": "" }, { "docid": "604c0ca5c1d4c502e818b6a50f55836b", "score": "0.80693406", "text": "function unhyphenate (str) {\n return stringify(str).replace(/(\\w)(-)(\\w)/g, '$1 $3')\n}", "title": "" }, { "docid": "e890c343be0d2ee8f9bf3cd5e99a5670", "score": "0.7548721", "text": "function hyphenToDash(str) {\n return str\n .replace(/ - /g, ' – ')\n .replace(/ -- /g, ' – ')\n .replace(/\"- /g, '\" – ')\n .replace(/\\n-/g, ' – ');\n}", "title": "" }, { "docid": "ec4cf998d24e99a65cbdbcbe450054de", "score": "0.7527564", "text": "function consistentHyphens(description) {\n const re = /[—–-]/g\n return String(description).replace(re, '-')\n}", "title": "" }, { "docid": "ed0f2e23c6d447a94c144fb5bab73a2b", "score": "0.75117564", "text": "function dasherize(str) {\n\treturn str.replace(rgxDasherizables, '-$&').toLowerCase();\n}", "title": "" }, { "docid": "bca9a2045247682ba32c05ff5bea6f5e", "score": "0.72175115", "text": "function deHyphenate(name) {\n return name.split('-').join(' ');\n }", "title": "" }, { "docid": "3a6048bb05e97509099aed9d939d2aba", "score": "0.71915334", "text": "function dashCase() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Word,\n pat: /\\b(\\w+)\\b/g,\n repl: function (_match, p1) { return p1\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase()\n .replace(/_/g, '-'); },\n });\n }", "title": "" }, { "docid": "30e47654f2bb5cd8a15b4e3fb182abe7", "score": "0.7181773", "text": "function dashify(text) {\n var pattern = /(^|[^!-])(---?)([^->]|$)/g;\n return text.replace(pattern, function(match, p1, p2, p3) {\n return p1 + '&' + (p2.length === 2 ? 'n' : 'm') + 'dash;' + p3;\n });\n }", "title": "" }, { "docid": "2a59cd2a5f0d73082fafa0219a6ec52e", "score": "0.71742266", "text": "function dasherizeFlag(str) {\n return str.replace(/^\\-+/, '').replace(/_/g, '-');\n}", "title": "" }, { "docid": "68e903809c82e5faae2a9033830b940e", "score": "0.71475065", "text": "function hyphenateWord (str, pos, hyphen)\n{\n if (str.length <= pos)\n return str;\n if (typeof hyphen == \"undefined\")\n hyphen = \" \";\n\n /* search for a nice place to break the word, fuzzfactor of +/-5, centered\n * around |pos| */\n var splitPos =\n str.substring(pos - 5, pos + 5).search(/[^A-Za-z0-9]/);\n\n splitPos = (splitPos != -1) ? pos - 4 + splitPos : pos;\n var left = str.substr (0, splitPos);\n var right = hyphenateWord(str.substr (splitPos), pos, hyphen);\n\n return left + hyphen + right;\n}", "title": "" }, { "docid": "05948bdf5f09abe23cff1355875353cc", "score": "0.7115866", "text": "function replaceDashes( cadena ) {\n cadena = cadena.replace(/-/gi,\" \");\n cadena = cadena.replace(/_/gi,\" \");\n return cadena;\n}", "title": "" }, { "docid": "531a00195146dcdc592ea6c49abb651f", "score": "0.7107579", "text": "function replaceSpecialCharacters(string){\n\tvar pattern = /[^\\w\\s]/gi;\n string = string.replace(/\\-/g, \" \");\n\treturn string.replace(pattern, '');\n}", "title": "" }, { "docid": "d7e8bf2ea2f26b8c487b13885f92b245", "score": "0.7095034", "text": "function hyphenate(name) {\n return name.replace(REGEX.SNAKE_CASE, function (letter, pos) {\n return (pos ? '-' : '') + letter.toLowerCase();\n });\n }", "title": "" }, { "docid": "0a7235cc54bc0db5de88f3b6ae1e56f7", "score": "0.7081846", "text": "function removeHyphens(ingredient) {\n if (ingredient.includes(\"-\")) {\n ingredient = ingredient.replace(/-/g, \" \");\n }\n return ingredient;\n}", "title": "" }, { "docid": "781a3d9c200391564ca2631b70c5443c", "score": "0.70755446", "text": "function removeDashes(string) {\n string = string.replace(/-/g, ' ');\n string = string.replace(/_/g, ' ');\n return string;\n }", "title": "" }, { "docid": "c1e7f9cea4925c68890ffc150eeaabf9", "score": "0.702739", "text": "function slugify(str) {\n return str.replace(/\\s+/g, '-');\n}", "title": "" }, { "docid": "8f3ed47baaba81de6fba0fdbfd1d69a5", "score": "0.7015046", "text": "function toDashes(text){\n\treturn text.replace(' ','-');\n}", "title": "" }, { "docid": "8e3152cbca75aabd981b02d204310fce", "score": "0.699915", "text": "function replaceDashes( cadena ) {\n cadena = cadena.replace(/-/gi,\" \");\n cadena = cadena.replace(/_/gi,\" \");\n return cadena;\n }", "title": "" }, { "docid": "8c55ea7005189275a6d5b4c4575cf629", "score": "0.69753087", "text": "function addHyphens(ingredient) {\n if (ingredient.includes(\" \")) {\n //replace any multiple spaces with just one space\n ingredient = ingredient.replace(/\\s+/g, \" \");\n //replace any spaces with a -\n ingredient = ingredient.replace(/ /g, \"-\");\n }\n //if the last character is a -, remove it\n if (ingredient[ingredient.length - 1] == \"-\") {\n ingredient = ingredient.slice(0, ingredient.length - 1);\n }\n return ingredient;\n}", "title": "" }, { "docid": "7e19c81cc72190c432c951006ed6048a", "score": "0.69656473", "text": "function camelToDash(str) {\n if (!str) return '';\n\n return str.replace(/\\W+/g, '-')\n .replace(/([a-z\\d])([A-Z])/g, '$1-$2');\n }", "title": "" }, { "docid": "2a3491e897146ce46fe9e6bf17930035", "score": "0.69351286", "text": "function dasherize() {\n return this.replace(/_/g, '-');\n }", "title": "" }, { "docid": "5f32774c3e30c11f37eebf165daa06df", "score": "0.6853363", "text": "function replaceSpaces( cadena ) {\n cadena = cadena.replace(/ /gi,\"-\");\n return cadena;\n}", "title": "" }, { "docid": "32c3a781e423e616082a8117df253a76", "score": "0.6842436", "text": "function transformStr(str) {\n let new_str = str.split(/-|_/).map(function (value, index) { //Разбиваем строку где сепаратора может быть два по условию\n if (index != 0) {\n value = value[0].toUpperCase() + value.slice(1); //Поднимаем регистр для первых символов \n }\n return value;\n }).join(''); //Объединием строку\n\n return new_str;\n}", "title": "" }, { "docid": "a06a4eba15d41172a77ca23f008a3651", "score": "0.68336844", "text": "function stringParameterize(str) {\n return str.replace(/ /gi, \"-\");\n}", "title": "" }, { "docid": "578daac40fb3c2d6fa768503723ada2b", "score": "0.6831679", "text": "function Handleize( string ) {\n\treturn string.replace(/\\W+/g, '-').toLowerCase();\n}", "title": "" }, { "docid": "810899c65b64a241f82a954b8f7eca6b", "score": "0.6787848", "text": "function toDashCase() {\n const upperChars = this.match(/([A-Z])/g);\n if (!upperChars) {\n return this;\n }\n\n let str = this.toString();\n for (let i = 0, n = upperChars.length; i < n; i++) {\n str = str.replace(new RegExp(upperChars[i]), '-' + upperChars[i].toLowerCase());\n }\n\n if (str.slice(0, 1) === '-') {\n str = str.slice(1);\n }\n\n return str;\n}", "title": "" }, { "docid": "cadd49dd8d98965c68c5d74110f31e08", "score": "0.67790025", "text": "function toDashedString(str) {\n return str.replace(/[A-Z]/g, function (capitalLetter) {\n return \"-\".concat(capitalLetter).toLowerCase();\n });\n}", "title": "" }, { "docid": "70bba64ebc9fd2fc779fae1d60106350", "score": "0.677081", "text": "function camelCaseToDash(str) {\n return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();\n}", "title": "" }, { "docid": "6b90fe1602e80985113956958e357d37", "score": "0.67701995", "text": "function toHyphenString(string) {\r\n\tlet lowerCased = new Array();\r\n\tstring.split(' ').forEach(function(word) {\r\n\t\tlowerCased.push(word.toLowerCase());\r\n\t});\r\n\tconsole.log(lowerCased);\r\n\treturn lowerCased.join('-');\r\n}", "title": "" }, { "docid": "acc44aca20227b8f9a5080c8577db395", "score": "0.67563266", "text": "function slugify(text) {\n return text.toLowerCase().replace(\" \", \"-\");\n}", "title": "" }, { "docid": "de0a865d50ed7f953367d190bd09319e", "score": "0.67544883", "text": "function slugify(string) {\n var a = \"àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;\";\n var b = \"aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------\";\n var p = new RegExp(a.split(\"\").join(\"|\"), \"g\");\n return string\n .toString()\n .toLowerCase()\n .replace(/\\s+/g, \"-\") // Replace spaces with -\n .replace(p, function (c) {\n return b.charAt(a.indexOf(c));\n }) // Replace special characters\n .replace(/&/g, \"-and-\") // Replace & with 'and'\n .replace(/[^\\w\\-]+/g, \"\") // Remove all non-word characters\n .replace(/\\-\\-+/g, \"-\") // Replace multiple - with single -\n .replace(/^-+/, \"\") // Trim - from start of text\n .replace(/-+$/, \"\"); // Trim - from end of text\n }", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "386f2ab01f4ff3dfc278193087096853", "score": "0.6723981", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "0f8d409a9273269375a10d88d33196d2", "score": "0.6696373", "text": "function d(a){var b=/[A-Z]/g;var c=\"-\";return a.replace(b,function(a,b){return(b?c:\"\")+a.toLowerCase()})}", "title": "" }, { "docid": "449611884fc7059097759f6c383548f1", "score": "0.6671389", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = '';\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0';\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0';\n } else {\n from = '>=' + from;\n }\n\n if (isX(tM)) {\n to = '';\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0';\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n } else {\n to = '<=' + to;\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "449611884fc7059097759f6c383548f1", "score": "0.6671389", "text": "function hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = '';\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0';\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0';\n } else {\n from = '>=' + from;\n }\n\n if (isX(tM)) {\n to = '';\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0';\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n } else {\n to = '<=' + to;\n }\n\n return (from + ' ' + to).trim()\n}", "title": "" }, { "docid": "0c8859b99cef9de00ee19ff876c39f50", "score": "0.6659532", "text": "function escape(str) {\n return str.replace(escapeRegex, \"-\").replace(dashesAtEnds, \"\");\n }", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" }, { "docid": "4650248d0bd6f83b800bacbbeac06129", "score": "0.6656073", "text": "function hyphenReplace($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n\n if (isX(fM))\n from = '';\n else if (isX(fm))\n from = '>=' + fM + '.0.0';\n else if (isX(fp))\n from = '>=' + fM + '.' + fm + '.0';\n else\n from = '>=' + from;\n\n if (isX(tM))\n to = '';\n else if (isX(tm))\n to = '<' + (+tM + 1) + '.0.0';\n else if (isX(tp))\n to = '<' + tM + '.' + (+tm + 1) + '.0';\n else if (tpr)\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n else\n to = '<=' + to;\n\n return (from + ' ' + to).trim();\n}", "title": "" } ]
185d587631be496ab96e83e434832df7
Draw the given airports and lines onto the map
[ { "docid": "94b18bfec634a3a33b6c332385298199", "score": "0.7021345", "text": "function drawVis(airports, lines) {\n\n\tvar lines = svg.selectAll(\"line\")\n\t\t.data(lines);\n\n\tvar circles = svg.selectAll(\"circle\")\n\t\t.data(d3.values(airports));\n\n\t// Clear any old lines or airports\n\tlines.exit().remove();\n\tcircles.exit().remove();\n\n\t// Add all the new lines\n\tlines.enter()\n\t\t.append(\"line\")\n\t\t.attr(\"x1\", function(d) { return projection([airports[d[\"Origin\"]][\"long\"], airports[d[\"Origin\"]][\"lat\"]])[0]; })\n\t\t.attr(\"y1\", function(d) { return projection([airports[d[\"Origin\"]][\"long\"], airports[d[\"Origin\"]][\"lat\"]])[1]; })\n\t\t.attr(\"x2\", function(d) { return projection([airports[d[\"Destination\"]][\"long\"], airports[d[\"Destination\"]][\"lat\"]])[0]; })\n\t\t.attr(\"y2\", function(d) { return projection([airports[d[\"Destination\"]][\"long\"], airports[d[\"Destination\"]][\"lat\"]])[1]; })\n\t\t.attr(\"stroke\", \"black\")\n\t\t.attr(\"stroke-width\", function(d) { return tripsScale(d[\"Flights\"]); })\n\t\t.style(\"opacity\", .02)\n\n\t\n\t// Add all the new circles\n\tcircles.enter()\n\t\t.append(\"circle\")\n\t\t.attr(\"cx\", function (d) { return projection([d[\"long\"], d[\"lat\"]])[0]; })\n\t\t.attr(\"cy\", function (d) { return projection([d[\"long\"], d[\"lat\"]])[1]; })\n\t\t.attr(\"r\", function (d) { return sizeScale(d[\"count\"]); })\n\t\t.attr(\"fill\", \"red\")\n\t\t// Mouseover events for tooltip\n\t\t.on(\"mouseover\", function(d) {\n\t\t\ttooltip.transition()\n\t\t\t\t.duration(200)\n\t\t\t\t.style(\"opacity\", .9);\n\t\t\ttooltip.html(d[\"name\"] + \"<br/>\" + d[\"city\"] + \", \" + d[\"state\"] + \"<br/>Flights: \" + d[\"count\"])\n\t\t\t\t.style(\"left\", (d3.event.pageX + 5) + \"px\")\n\t\t\t\t.style(\"top\", (d3.event.pageY + 5) + \"px\")\n\t\t\t\t.style(\"opacity\", .9);\n\t\t})\n\t\t.on(\"mouseout\", function(d) {\n\t\t\ttooltip.transition()\n\t\t\t\t.duration(200)\n\t\t\t\t.style(\"opacity\", 0);\n\t\t})\n}", "title": "" } ]
[ { "docid": "1da589c038c9ff2ba7d817b5dfdc5f63", "score": "0.6840223", "text": "function drawMap() {\r\n for (var x = 20; x < 1501; x += 20) {\r\n context.moveTo(x, 0);\r\n context.lineTo(x, 700);\r\n }\r\n\r\n for (var y = 20; y < 700; y += 20) {\r\n context.moveTo(0, y);\r\n context.lineTo(1501, y);\r\n }\r\n\r\n // context.moveTo(0, 0);\r\n // context.lineTo(380, 380);\r\n\r\n context.strokeStyle = \"#ddd\";\r\n context.setLineDash([5, 3]);\r\n context.stroke();\r\n}", "title": "" }, { "docid": "9f7d9ee0148aa3a9f52462f8e4e7070e", "score": "0.6653152", "text": "function addLine() {\n\t flightPath.setMap(map);\n\t}", "title": "" }, { "docid": "d4e2c7fff3caa3bac83835b5b097d693", "score": "0.657668", "text": "function drawPolylines(map)\n{\n var trainPath = [alewife, davisSquare, porterSquare, harvardSquare, centralSquare,\n kendallMIT, charlesMGH, parkStreet, downtownCrossing, southStation,\n broadway, andrew, jfkUmass, northQuincy, wollaston, quincyCenter,\n quincyAdams, braintree];\t\n var trainPathLines = new google.maps.Polyline({\n path: trainPath,\n strokeColor: '#ff0000',\n strokeOpacity: 1.0,\n strokeWeight: 2\n });\n\n\n var ashmontBound = [jfkUmass, savinHill, fieldsCorner, shawmut, ashmont];\n var ashmontPathLines = new google.maps.Polyline({\n path: ashmontBound,\n strokeColor: '#ff0000',\n strokeOpacity: 1.0,\n strokeWeight: 2\n });\n\n trainPathLines.setMap(map);\n ashmontPathLines.setMap(map);\n}", "title": "" }, { "docid": "52e0395ca6ab4699680d5721453e940f", "score": "0.63421947", "text": "function draw_polyline(i){\n\t\tflightPlanCoordinates = [\n\t\t\tnew google.maps.LatLng(tab_tempPos[i].getLatActuel(), tab_tempPos[i].getLongActuel()),\n\t\t\tnew google.maps.LatLng(tab_tempPos[i].getLatPrec(), tab_tempPos[i].getLongPrec())\n\t\t];\n\t\tflightPath = new google.maps.Polyline({\n\t\t\tpath: flightPlanCoordinates,\n\t\t\tstrokeColor: '#FF0000',\n\t\t\tstrokeOpacity: 1.0,\n\t\t\tstrokeWeight: 2\n\t\t});\n\t}", "title": "" }, { "docid": "e2b0eaa64a397b4fd5750709365aa295", "score": "0.6297465", "text": "function drawPathAndStart(x1,y1,x2,y2,nxtVal,vai)\n {\n createElement({tag:\"line\",placingTag:'mapArea',x1:x1,y1:y1,\"x2\":x2,\"y2\":y2,\"stroke-width\":\"0.4\",stroke:\"#3a3a3a\",\"stroke-dasharray\":\"5,5\",\"class\":\"showline\",\"id\":selectedCar+\"line\"});\n startDrive({x1:x1,y1:y1,x2:x2,y2:y2},vai,nxtVal);\n }", "title": "" }, { "docid": "6efeac0e4b97b2ea8e3bd81e3d781428", "score": "0.61930746", "text": "function drawLines() {\n for (var i = 0; i < drawnPositions.length; i++) {\n var currentPositionToAnalyse = drawnPositions[i].split(\",\");\n for (var j = 0; j < currentPositionToAnalyse.length; j++) {\n currentPositionToAnalyse[j] = parseInt(currentPositionToAnalyse[j]);\n }\n // Vertical Line\n var squareBelow = drawnPositions[i].split(\",\");\n squareBelow[1] = parseInt(squareBelow[1]) - 1;\n var squareBelow_string = squareBelow[0] + \",\" + squareBelow[1] + \",\" + squareBelow[2];\n if (drawnPositions.indexOf(squareBelow_string) !== -1 && drawnLines.indexOf(drawnPositions[i] + \",vertical\") === -1 && allowedLines.indexOf(drawnPositions[i] + \",vertical\") !== -1) {\n var line = document.createElement(\"DIV\");\n line.classList.add(\"verticalLine\");\n line.style.left = (Math.floor(0.5 * mapWidth) - (0.5 * roomSize) + (currentPositionToAnalyse[0] * roomSize * 2)) + \"px\";\n line.style.top = (Math.floor(0.5 * mapWidth) - (0.5 * roomSize) - (currentPositionToAnalyse[1] * roomSize * 2) + (roomSize)) + \"px\";\n dom_map.appendChild(line);\n drawnLines.push(drawnPositions[i] + \",vertical\");\n }\n // Horizontal Line\n var squareRight = drawnPositions[i].split(\",\");\n squareRight[0] = parseInt(squareRight[0]) + 1;\n var squareRight_string = squareRight[0] + \",\" + squareRight[1] + \",\" + squareRight[2];\n if (drawnPositions.indexOf(squareRight_string) !== -1 && drawnLines.indexOf(drawnPositions[i] + \",horizontal\") === -1 && allowedLines.indexOf(drawnPositions[i] + \",horizontal\") !== -1) {\n var line = document.createElement(\"DIV\");\n line.classList.add(\"horizontalLine\");\n line.style.left = (Math.floor(0.5 * mapWidth) - (0.5 * roomSize) + (currentPositionToAnalyse[0] * roomSize * 2) + (roomSize)) + \"px\";\n line.style.top = (Math.floor(0.5 * mapWidth) - (0.5 * roomSize) - (currentPositionToAnalyse[1] * roomSize * 2)) + \"px\";\n dom_map.appendChild(line);\n drawnLines.push(drawnPositions[i] + \",horizontal\");\n }\n // Uphill Line\n var squareNE = drawnPositions[i].split(\",\");\n squareNE[0] = parseInt(squareNE[0]) + 1;\n squareNE[1] = parseInt(squareNE[1]) + 1;\n var squareNE_string = squareNE[0] + \",\" + squareNE[1] + \",\" + squareNE[2];\n if (drawnPositions.indexOf(squareNE_string) !== -1 && drawnLines.indexOf(drawnPositions[i] + \",uphill\") === -1 && allowedLines.indexOf(drawnPositions[i] + \",uphill\") !== -1) {\n var lineContainer = document.createElement(\"DIV\");\n lineContainer.classList.add(\"uphillLineContainer\");\n lineContainer.style.left = (Math.floor(0.5 * mapWidth) - (0.5 * roomSize) + (currentPositionToAnalyse[0] * roomSize * 2) + (roomSize)) + \"px\";\n lineContainer.style.top = (Math.floor(0.5 * mapWidth) - (0.5 * roomSize) - (currentPositionToAnalyse[1] * roomSize * 2) - (roomSize)) + \"px\";\n dom_map.appendChild(lineContainer);\n var line = document.createElement(\"DIV\");\n line.classList.add(\"diagonalLine\");\n line.classList.add(\"uphillLine\");\n lineContainer.appendChild(line);\n drawnLines.push(drawnPositions[i] + \",uphill\");\n }\n // Downhill Line\n var squareNW = drawnPositions[i].split(\",\");\n squareNW[0] = parseInt(squareNW[0]) - 1;\n squareNW[1] = parseInt(squareNW[1]) + 1;\n var squareNW_string = squareNW[0] + \",\" + squareNW[1] + \",\" + squareNW[2];\n if (drawnPositions.indexOf(squareNW_string) !== -1 && drawnLines.indexOf(drawnPositions[i] + \",downhill\") === -1 && allowedLines.indexOf(drawnPositions[i] + \",downhill\") !== -1) {\n var lineContainer = document.createElement(\"DIV\");\n lineContainer.classList.add(\"uphillLineContainer\");\n lineContainer.style.left = (Math.floor(0.5 * mapWidth) - (0.5 * roomSize) + (currentPositionToAnalyse[0] * roomSize * 2) - (roomSize)) + \"px\";\n lineContainer.style.top = (Math.floor(0.5 * mapWidth) - (0.5 * roomSize) - (currentPositionToAnalyse[1] * roomSize * 2) - (roomSize)) + \"px\";\n dom_map.appendChild(lineContainer);\n var line = document.createElement(\"DIV\");\n line.classList.add(\"diagonalLine\");\n line.classList.add(\"downhillLine\");\n lineContainer.appendChild(line);\n drawnLines.push(drawnPositions[i] + \",downhill\");\n }\n }\n}", "title": "" }, { "docid": "83a3e40546ec61bda792e6afc76a302f", "score": "0.61856127", "text": "function draw() {\n\n // ---- Column of Polygons ----\n lines.forEach(poly => {\n\n // ---- Polygon Border\n const polygon_edges = poly[0];\n context.beginPath();\n polygon_edges.forEach(p => context.lineTo(p[0], p[1]));\n context.lineTo(polygon_edges[0][0], polygon_edges[0][1]);\n context.stroke();\n\n // ---- Polygon Spokes\n const polygon_spokes = poly[1];\n polygon_spokes.forEach(poly => {\n context.beginPath();\n poly.forEach(p => context.lineTo(p[0], p[1]));\n context.stroke();\n });\n\n });\n }", "title": "" }, { "docid": "17a3ede71d5ec064ea3d971fc392f2ae", "score": "0.616048", "text": "function drawData(airports, flights) {\n // setup and start edge bundling\n var bundle = generateSegments(airports, flights);\n // https://github.com/d3/d3-shape#curveBundle\n var line = d3.line()\n .curve(d3.curveBundle)\n .x(function(d) { return d.x; })\n .y(function(d) { return d.y; });\n var links = plot.append(\"g\").attr(\"id\", \"flights\")\n .selectAll(\"path.flight\")\n .data(bundle.paths)\n .enter()\n .append(\"path\")\n .attr(\"d\", line)\n .style(\"fill\", \"none\")\n .style(\"stroke\", \"#252525\")\n .style(\"stroke-width\", 1)\n .style(\"stroke-opacity\", 1);\n // https://github.com/d3/d3-force\n var layout = d3.forceSimulation()\n // settle at a layout faster\n .alphaDecay(0.1)\n // nearby nodes attract each other\n .force(\"charge\", d3.forceManyBody()\n .strength(10)\n .distanceMax(radius.max * 2)\n )\n // edges want to be as short as possible\n // prevents too much stretching\n .force(\"link\", d3.forceLink()\n .strength(0.8)\n .distance(0)\n )\n .on(\"tick\", function(d) {\n links.attr(\"d\", line);\n })\n .on(\"end\", function(d) {\n console.log(\"Layout complete!\");\n });\n layout.nodes(bundle.nodes).force(\"link\").links(bundle.links);\n // draw airports\n var scale = d3.scaleSqrt()\n .domain(d3.extent(airports, function(d) { return d.degree; }))\n .range([radius.min, radius.max]);\n plot.append(\"g\").attr(\"id\", \"airports\")\n .selectAll(\"circle.airport\")\n .data(airports)\n .enter()\n .append(\"circle\")\n .attr(\"r\", function(d) { return scale(d.degree); })\n .attr(\"cx\", function(d) { return d.x; })\n .attr(\"cy\", function(d) { return d.y; })\n .style(\"fill\", \"white\")\n .style(\"opacity\", 0.6)\n .style(\"stroke\", \"#252525\")\n .on(\"mouseover\", onMouseOver)\n .on(\"mousemove\", onMouseMove)\n .on(\"mouseout\", onMouseOut);\n}", "title": "" }, { "docid": "59b72c5183895e20d983679ad8926a42", "score": "0.60769665", "text": "function gameOver(locations){\n var myLatlng = new google.maps.LatLng(-25.363882,131.044922);\n\n var mapOptions = {\n zoom: 1,\n center: myLatlng\n };\n\n gameMap = new google.maps.Map(document.getElementById('map-game'), mapOptions);\n\n locations.forEach(l=>{\n gameMarker = new google.maps.Marker({\n position: l.coords[0],\n map: gameMap\n });\n drawLine(l.coords, gameMap);\n });\n\n }", "title": "" }, { "docid": "dbe55e4afe0ac6a47b7fb2e71d9f8770", "score": "0.6047049", "text": "drawSolutionLines()\n {\n let coords = []\n if (this.state.currentIdx == 11)\n coords.push([4, 10])\n if (this.state.currentIdx >= 5)\n coords.push([2, 6])\n\n let lines = []\n for(let i = 0; i < coords.length; i++)\n lines.push(<MapView.Polyline \n key={`${i}${Date.now()}`}\n coordinates={ [PORTE[coords[i][0]], PORTE[coords[i][1]]] }/>)\n\n return lines\n }", "title": "" }, { "docid": "ffc56cddf82e3ec71a487f542de079bc", "score": "0.6033818", "text": "function drawPolyline() {\r\n\r\n var markersPositionArray = [];\r\n //Obtaining latLng of all markers on map\r\n markersArray.forEach(function(event) {\r\n markersPositionArray.push(event.getPosition());\r\n });\r\n //Used for route planned elevation chart\r\n posArray = markersPositionArray;\r\n \r\n //Checks if there is already a polyline drawn on map\r\n //Removing the polyline from map before we draw new one\r\n if (polyline !== null) {\r\n polyline.setMap(null);\r\n }\r\n \r\n //Draw a new polyline at markers' position\r\n polyline = new google.maps.Polyline({\r\n map: map,\r\n path: markersPositionArray,\r\n strokeColor: '#FF0000',\r\n strokeOpacity: 0.4\r\n });\r\n }", "title": "" }, { "docid": "41de300db9084dd0bb02ee9c85c2bb34", "score": "0.6019061", "text": "function latrobeMapDraw() {\n var latrobeBounds = latrobePath.bounds(accidents),\n latrobeTopLeft = latrobeBounds[0],\n latrobeBottomRight = latrobeBounds[1];\n\n latrobeSvg .attr(\"width\", latrobeBottomRight[0] - latrobeTopLeft[0])\n .attr(\"height\", latrobeBottomRight[1] - latrobeTopLeft[1])\n .style(\"left\", latrobeTopLeft[0] + \"px\")\n .style(\"top\", latrobeTopLeft[1] + \"px\");\n\n latrobeG .attr(\"transform\", \"translate(\" + -latrobeTopLeft[0] + \",\" + -latrobeTopLeft[1] + \")\");\n\n latrobeFeature.attr(\"d\", latrobePath);\n latrobeFeature.attr(\"date\", function (d) { return parseTimeDayMonthYear(d.properties.ACCIDENTDATE) });\n latrobeFeature.attr(\"time\", function (d) { return d.properties.ACCIDENTTIME });\n latrobeFeature.attr(\"street\", function (d) { return d.properties.ROAD_NAME });\n latrobeFeature.attr(\"type_desc\", function (d) { return d.properties.ACCIDENT_TYPE_DESC });\n latrobeFeature.attr(\"day_of_week\", function (d) { return d.properties.DAY_WEEK_DESC });\n latrobeFeature.attr(\"no_of_vehicles\", function (d) { return d.properties.NO_OF_VEHICLES });\n latrobeFeature.attr(\"severity\", function (d) { return d.properties.SEVERITY });\n latrobeFeature.attr(\"road_geometry\", function (d) { return d.properties.ROAD_GEOMETRY_DESC });\n latrobeFeature.attr(\"road_geometry\", function (d) { return d.properties.ROAD_GEOMETRY_DESC });\n latrobeFeature.attr(\"traffic_control\", function (d) { return d.properties.TRAFFIC_CONTROL_DESC });\n \n }", "title": "" }, { "docid": "927aa1ef11e50fe513c12f3c0e4abdc2", "score": "0.6012701", "text": "function display_team_route(latitudes,longitudes,color,width,opacity,id_equipe){\n\t//on recupere le nombre de lignes qu'il faudra afficher\n\tvar length = latitudes.length;\n\t\n\t//on charge le module pour les formes\n\tMQA.withModule('shapes', function() {\n\t\tfor(k=0;k<length;k++){\n\t\t\t//on trace un trait entre chaque marqueur\n\t\t lines[nblines] = new MQA.LineOverlay();\n\t\t //pour le premier trait, il est dessiné entre le depart (saint naz) et le premier marqueur\n\t\t if(k==0){\n\t\t\t lines[nblines].setShapePoints([latitudes[k], longitudes[k], 47.276667,-2.212372]);\n\t\t }\n\t\t //tous les autres sont relies entre eux\n\t\t else{\n\t\t\t lines[nblines].setShapePoints([latitudes[k], longitudes[k], latitudes[k-1], longitudes[k-1]]);\n\t\t }\n\t\t //definition des paramtres de la ligne (recus en arguments)\n\t\t lines[nblines].color=color;\n\t\t lines[nblines].borderWidth=width;\n\t\t lines[nblines].colorAlpha=opacity;\n\t\t //la definition du className est utile pour la mise en valeur des parcours\n\t\t lines[nblines].className=id_equipe;\n\t\t //on ajoute la forme a la carte\n\t\t map.addShape(lines[nblines]);\n\t\t //on incremente l'indice du nombre de lignes sur la carte\n\t\t\tnblines++;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8cf7e094105f24dcdfd8b6e01e523444", "score": "0.5980563", "text": "function getAdjAirports(result)\r\n{\r\n // Determine the valid adjacent airports\r\n adjAirports = [];\r\n for(let i = 0; i < result.length; i++)\r\n {\r\n let source = getAirportById(result[i].sourceAirportId, airportsData);\r\n let destination = getAirportById(result[i].destinationAirportId, airportsData);\r\n\r\n // Valid Route?\r\n if (source == null || destination == null || adjAirports.includes(destination.airportId) || tripArray.includes(destination.airportId))\r\n {\r\n //console.log(\"Airport doesn't exist\");\r\n continue;\r\n }\r\n else\r\n {\r\n adjAirports.push(destination.airportId);\r\n //console.log(`Found route between ${source.name} (${source.airportId}) and ${destination.name} (${destination.airportId})`);\r\n }\r\n }\r\n\r\n // Draw all available routes\r\n let lineList = [];\r\n let source = getAirportById(result[0].sourceAirportId, airportsData);\r\n for(let i = 0; i < adjAirports.length; i++)\r\n {\r\n let destination = getAirportById(adjAirports[i], airportsData);\r\n\r\n let lat1 = source.latitude;\r\n let lat2 = destination.latitude;\r\n let lng1 = source.longitude;\r\n let lng2 = destination.longitude;\r\n\r\n // Swap the longitudes if the route crosses 180th prime meridian\r\n if (Math.abs(lng1 - lng2) > 270)\r\n {\r\n if (lng1 < 0)\r\n {\r\n lng1 = String(Number(lng1) + 360);\r\n }\r\n else if (lng2 < 0)\r\n {\r\n lng2 = String(Number(lng2) + 360);\r\n }\r\n }\r\n\r\n lineList.push({\r\n type: \"Feature\",\r\n geometry: {\r\n type: \"LineString\",\r\n coordinates: [[lng1, lat1], [lng2, lat2]]\r\n }\r\n })\r\n }\r\n\r\n // Remove all current adjacent route lines, trip lines, and origin circle\r\n clearMap();\r\n\r\n // Show adjacent routes\r\n map.addSource('adjRoutes', {\r\n 'type': 'geojson',\r\n 'data': {\r\n 'type': 'FeatureCollection',\r\n 'features': lineList\r\n }\r\n });\r\n map.addLayer({\r\n id: 'routes',\r\n type: \"line\",\r\n source: 'adjRoutes',\r\n layout: { \"line-join\": \"round\", \"line-cap\": \"round\"},\r\n paint: { \"line-color\": \"#444\", \"line-width\": 3, \"line-opacity\": 0.65, \"line-dasharray\": [2,2] }\r\n });\r\n\r\n // Show current trip on map\r\n let tripArrayCoords = [];\r\n for(let i = 0; i < tripArray.length; i++)\r\n {\r\n let airport = getAirportById(tripArray[i], airportsData);\r\n\r\n // console.log(\"tripArrayCoords\");\r\n // console.log(tripArrayCoords);\r\n\r\n let lng = airport.longitude;\r\n\r\n if (i != 0)\r\n {\r\n let lngPrev = tripArrayCoords[i-1][0];\r\n\r\n console.log(\"current, prev = \"+lng+\", \"+lngPrev)\r\n\r\n if (lng - lngPrev > 300)\r\n {\r\n lng = String( Number(lng) - 360) ;\r\n }\r\n if (lngPrev - lng > 300)\r\n {\r\n lng = String( Number(lng) + 360) ;\r\n }\r\n\r\n console.log(\"current, prev = \"+lng+\", \"+lngPrev)\r\n }\r\n\r\n tripArrayCoords.push([lng, airport.latitude]);\r\n }\r\n\r\n console.log(\"tripArrayCoords\");\r\n console.log(tripArrayCoords);\r\n\r\n map.addSource('tripSource', {\r\n type: \"geojson\",\r\n data: {\r\n type: \"Feature\",\r\n properties: {},\r\n geometry: {\r\n type: \"LineString\",\r\n coordinates: tripArrayCoords\r\n }\r\n }\r\n });\r\n map.addLayer({\r\n id: 'trip',\r\n type: \"line\",\r\n source: 'tripSource',\r\n layout: { \"line-join\": \"round\", \"line-cap\": \"round\"},\r\n paint: { \"line-color\": tripColour, \"line-width\": 7 }\r\n });\r\n\r\n // Draw circle for origin\r\n if (tripArray.length > 0)\r\n {\r\n let airport = getAirportById(tripArray[0], airportsData);\r\n\r\n map.addSource(\"originSource\", {\r\n \"type\": \"geojson\",\r\n \"data\": {\r\n \"type\": \"FeatureCollection\",\r\n \"features\": [{\r\n \"type\": \"Feature\",\r\n \"geometry\": {\r\n \"type\": \"Point\",\r\n \"coordinates\": [airport.longitude, airport.latitude]\r\n }\r\n }]\r\n }\r\n });\r\n map.addLayer({\r\n id: 'origin',\r\n type: 'circle',\r\n source: 'originSource',\r\n paint: {\r\n \"circle-radius\": 15,\r\n \"circle-color\": tripColour,\r\n }\r\n });\r\n }\r\n \r\n console.log(\"adjAirports\");\r\n console.log(adjAirports);\r\n console.log(\"tripArray\");\r\n console.log(tripArray);\r\n\r\n updateSidePanel();\r\n}", "title": "" }, { "docid": "480be68883ba88cc092f17f36ca8f38a", "score": "0.5980319", "text": "function drawCircuit(map, circuit){\n\n\tvar polyOptions = {\n\t\tstrokeColor: '#ff7800',\n\t\tstrokeOpacity: 0.7,\n\t\tstrokeWeight: 5\n\t};\n\n\tpoly = new google.maps.Polyline(polyOptions);\n\tpoly.setMap(map);\n\n\tvar path = poly.getPath();\n\tvar myLatlng = new google.maps.LatLng(circuit[0].lat, circuit[0].lng);\n\tpath.push(myLatlng);\n\n\t_.forEach(circuit, function(ip){\n\t\n\t\tvar myLatlngi = new google.maps.LatLng(ip.lat, ip.lng);\n\t\tpath.push(myLatlngi);\n\n\t});\n\n\tpath.push(myLatlng);\n}", "title": "" }, { "docid": "59fedcc2c2101c13aab14c8f2fc91624", "score": "0.59739166", "text": "function drawLineOnMap(lat1, lon1, lat2, lon2, clr) {\n //set coordinates for drawing\n var lineCoordinates = [\n \tnew google.maps.LatLng(lat1, lon1),\n \tnew google.maps.LatLng(lat2, lon2)\n \t];\n\n //draw the line for point1\n var linePath = new google.maps.Polyline({\n \tpath: lineCoordinates,\n \tgeodesic: true,\n \tstrokeColor: clr,\n \tstrokeOpacity: 1.0,\n \tstrokeWeight: 2\n \t});\t\t\t\n polylines.push(linePath);\n linePath.setMap(map);\n}", "title": "" }, { "docid": "fd4cfc8a739d36caa1f7fee6d364166f", "score": "0.5951553", "text": "function ready(routes, airports) {\n /* Draw airports */\n /* ------------- */\n // Set airports' geo coordinates\n var airportLocation = [];\n airports.forEach(function (el) {\n var obj = {};\n obj.type = 'Feature';\n obj.id = el.iata;\n obj.geometry = {\n type: 'Point',\n coordinates: [+el.long, +el.lat]\n };\n obj.properties = {};\n airportLocation.push(obj);\n });\n // Create airport map for lookup\n airportMap = d3.map(airportLocation, function (d) {\n return d.id;\n });\n // Redraw airports (world map is drawn only once on initialization)\n drawAirports(airportLocation);\n /* Animate planes along routes */\n /* --------------------------- */\n // Recode route data\n var routeFromTo = [];\n routes.forEach(function (el) {\n var arr = [el.source_airport, el.destination_airport];\n routeFromTo.push(arr);\n });\n // Make planes\n planeModule.makePlane(routes);\n // Make the planes fly\n planeModule.planes.forEach(function (el) {\n transitionPath(el.plane, el.routeLength, el.wayPoints);\n });\n }", "title": "" }, { "docid": "0e5372d18a59da416eb3a9b409348fd3", "score": "0.59002024", "text": "function drawMap() {\n // warehouse info\n var warehouseAddr = '3350 Donald Lee Hollowell Pkwy NW Atlanta, GA 30331';\n var warehouseCoords = '33.7899380,-84.4993746';\n \n // tower\n var towerCoords = '33.78526463288818,-84.43051099777222';\n \n // waypoints/destinations\n var wpAddress = [\n\t'Philips Arena, Philips Dr NW, Atlanta, GA 30303-2723',\n\t'Georgia Dome, 1 Georgia Dome Dr NW, Atlanta, GA 30313-1504',\n\t'World of Coca-Cola, 121 Baker St NW, Atlanta, GA 30313-1807',\n\t'Turner Field, 755 Hank Aaron Dr SW, Atlanta, GA 30315-1120',\n\t'High Museum of Art, 1280 Peachtree St NE, Atlanta, GA 30309-3549',\n \n\t'Fulton County Airport-Brown Field, 3952 Aviation Cir NW, Atlanta, GA 30336',\n 'Six Flags Over Georgia, 275 Riverside Parkway Southwest, Austell, GA 30168',\n 'Atlanta Metropolitan State College, 1630 Metropolitan Pkwy SW, Atlanta, GA 30310',\n 'Lakewood Stadium, Lakewood Ave SE, Atlanta, GA 30315',\n 'United States Penitentiary Atlanta, 601 McDonough Blvd SE, Atlanta, GA 30315',\n\t\n 'Georgia Institute of Technology, North Ave NW, Atlanta, GA 30332',\n\t'Jimmy Carter Presidential Library and Museum, 441 Freedom Pkwy NE, Atlanta, GA 30307',\n\t'Zoo Atlanta, 800 Cherokee Ave SE, Atlanta, GA 30315',\n\t'Clark Atlanta University, 223 James P Brawley Dr SW, Atlanta, GA 30314',\n\t'CSX-Tilford Yard, 1442 Marietta Rd NW, Atlanta, GA 30318'\n ];\n \n var wpCoords = [\n\t'33.7570100,-84.3973393', // Philips Arena\n\t'33.7563217,-84.4022164', // Georgia Dome\n\t'33.7627423,-84.3926638', // World of Coke\n\t'33.7365,-84.3898', // Turner Field\n\t'33.7892,-84.3849', // High Museum of Art\n\t\n\t'33.7771,-84.5217', // Fulton County Airport\n '33.7699,-84.5476', // Six Flags Over Georgia\n '33.7119,-84.4057', // Atlanta Metropolitan State College\n '33.7119,-84.3803', // Lakewood Stadium\n '33.7116,-84.3711', // United States Penitentiary Atlanta\n\t\n\t'33.7713,-84.3912', // Georgia Institute of Technology\n '33.7665,-84.3562', // Jimmy Carter Presidential Library and Museum\n '33.7341,-84.3723', // Zoo Atlanta\n\t'33.7540,-84.4120', // Clark Atlanta University\n\t'33.7888,-84.4363' // CSX-Tilford Yard\n ];\n \n var wpName = [];\n for(var i = 0; i < wpAddress.length; i++) {\n\t var name = wpAddress[i].split(\",\", 1);\n\t wpName.push(name[0]);\n\t // console.log(name[0]);\n }\n\n var Waypt = [];\n for(var i = 0; i < wpAddress.length; i++) {\n\t Waypt.push({ location: wpAddress[i] });\n }\n \n // define map\n var mapOptions = {\n mapType: 'normal',\n fullscreenControl: true,\n showTooltip: true,\n showInfoWindow: true,\n mapTypeControl: true,\n scaleControl: true,\n scrollWheel: true,\n streetViewControl: true,\n zoomControl: true,\n \n // User will only be able to view/select custom styled maps.\n mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID, \n google.maps.MapTypeId.TERRAIN],\n }; // end mapOptions\n \n // draw map\n map = new google.maps.Map(document.getElementById('map_div'), mapOptions);\n \n bounds = new google.maps.LatLngBounds;\n info = new google.maps.InfoWindow();\n\n /*\n var trafficLayer = new google.maps.TrafficLayer();\n trafficLayer.setMap(map);\n */\n \n // display warehouse icon\n latlng = warehouseCoords.split(\",\");\n warehousePos = new google.maps.LatLng(parseFloat(latlng[0]), parseFloat(latlng[1]));\n bounds.extend(warehousePos);\n\n var warehouseMarker = new google.maps.Marker({\n\t position: warehousePos,\n\t icon: warehouseIcon,\n\t map: map,\n\t title: 'Warehouse',\n\t html: '<h4>Warehouse:</h4>' + warehouseAddr,\n\t zIndex: 1\n });\n\n google.maps.event.addListener(warehouseMarker, 'click', function() { \n info.setContent(this.html);\n info.open(map, this); \n map.setCenter(this.getPosition()); // center on waypoint\n map.setZoom(15); // zoom to street level\n });\n google.maps.event.addListener(warehouseMarker, 'rightclick', function() { \n\t info.close(map, this); \n\t map.setCenter(bounds.getCenter()); // center map\n\t map.fitBounds(bounds); // zoom to include everything\n }); // end addListener\t\t \n\n // display tower icon\n var latlng = towerCoords.split(\",\");\n var towerPos = new google.maps.LatLng(parseFloat(latlng[0]), parseFloat(latlng[1]));\n bounds.extend(towerPos);\n\n /*\n var towerMarker = new google.maps.Marker({\n\t position: towerPos,\n\t icon: towerIcon,\n\t map: map,\n\t title: 'Cell Tower',\n\t html: 'Cell tower with CAT-M service',\n\t zIndex: 1\n });\n\n towerMarker.addListener('click', function() { \n info.setContent(this.html);\n info.open(map, this); \n });\n */\n \n // display all waypoint location icons\n for(var i = 0; i < wpAddress.length; i++) {\n\t latlng = wpCoords[i].split(\",\");\n\t var pos = new google.maps.LatLng(parseFloat(latlng[0]), parseFloat(latlng[1]));\n\t bounds.extend(pos);\n\n\t // If waypoint/destination markers are not to be displayed, comment out from here\n\t // to the end of the for-loop (i.e. just after addListener call).\n\t /*\n\t var marker = new google.maps.Marker({\n\t\t position: pos,\n\t\t icon: waypointIcon,\n\t\t map: map,\n\t\t title: wpName[i],\n\t\t html: wpAddress[i],\n\t\t zIndex: 1\n\t});\n\t\n google.maps.event.addListener(marker, 'click', function() { \n info.setContent(this.html);\n info.open(map, this); \n map.setCenter(this.getPosition()); // center on waypoint\n map.setZoom(15); // zoom to street level\n });\n google.maps.event.addListener(marker, 'rightclick', function() { \n info.close(map, this); \n map.setCenter(bounds.getCenter()); // center map\n map.fitBounds(bounds); // zoom to include everything\n }); // end addListener\t\n\t*/\t\n } // end for each Addresses\n \n map.fitBounds(bounds);\n map.setCenter(bounds.getCenter());\n\n // initialize truck markers\n for(var truck = 0; truck < maxTrucks; truck++) {\n\t // console.log(\"Initializing truck \" + truck);\n\t var icon = truckIcon;\n var zlayer = truckZoomLayer;\n \n\t if(truck > 0) {\n icon = greyTruckIcon;\n\t zlayer = truckNormalLayer;\n }\n\t\t \n\t tMarker[truck]= new google.maps.Marker({\n\t\t map: map,\n\t\t position: warehousePos,\n\t\t icon: icon,\n\t\t title: 'Truck '+ truck + ': OK.',\n\t\t html: '<h4>Truck '+truck+':</h4><b>Location:</b> ' + warehouseCoords,\n // visible: 1,\n\t\t zIndex: zlayer\n\t }); // end marker;\n\t \n\t tListener[truck] = tMarker[truck].addListener('click', function() { \n\t info.setContent(this.html);\n\t info.open(map, this); \n\t });\n\n dStatus[truck] = ONTIME; \n } // end for truck\n \n ingarage = maxTrucks;\n stalled = 0;\n intransit = 0;\n initFleetStatusChart(ingarage, stalled, intransit);\n\n early = 0;\n ontime = maxTrucks;\n late = 0;\n initDeliveryStatusChart(early, ontime, late);\n \n // Schedule the updateMap function to run every 5 seconds (5000ms)\n updateMap();\n var interval = self.setInterval(updateMap, 5000);\n}", "title": "" }, { "docid": "7d885e614bfd4976ac08baa48d2cefab", "score": "0.5887475", "text": "function draw_terrain(){\n\n for(var i = 0; i < canvas.width; i++)\n {\n ctx.beginPath();\n ctx.moveTo(points[i].x, HEIGHT_MAX);\n ctx.lineTo(points[i].x, points[i].y);\n ctx.lineWidth = 10;\n ctx.lineCap = 'round';\n ctx.strokeStyle = 'green';\n ctx.stroke();\n\n //we draw the line second time for the light green terrain effect\n ctx.beginPath();\n ctx.moveTo(points[i].x, HEIGHT_MAX);\n ctx.lineTo(points[i].x, points[i].y + 190);\n ctx.strokeStyle = 'rgba(0,180,0,0.4)';\n ctx.stroke();\n }\n}", "title": "" }, { "docid": "4e62792bce2381d6c9e733e645b77c5f", "score": "0.5879856", "text": "function drawMountains() {\n for (var i = 0; i < mountains.length; i++) {\n fill(205, 133, 63);\n triangle(\n mountains[i].x_pos,\n floorPos_y,\n mountains[i].x_pos + mountains[i].width / 2,\n floorPos_y - mountains[i].height,\n mountains[i].x_pos + mountains[i].width,\n floorPos_y\n );\n fill(222, 184, 135);\n triangle(\n mountains[i].x_pos + 50,\n floorPos_y,\n mountains[i].x_pos + 50 + mountains[i].width / 2,\n floorPos_y - mountains[i].height + 30,\n mountains[i].x_pos + 30 + mountains[i].width,\n floorPos_y\n );\n fill(255);\n }\n}", "title": "" }, { "docid": "249e1e5acbc1d4988acf71cf10889326", "score": "0.5876523", "text": "drawPolygone(){\n\t\tfor(let i = 0; i < this.lines.length; i++ ){\n\n\t\t\tlet x1 = this.lines[i].x;\n\t\t\tlet\ty1 = this.lines[i].y;\n\n\t\t\tif(this.lines[i+1]){\n\t\t\t\tlet\tx2 = this.lines[i+1].x;\n\t\t\t\tlet\ty2 = this.lines[i+1].y;\n\t\t\t\tthis.moveTo(x1, y1);\n\t\t\t\tthis.lineTo(x2, y2);\n\t\t\t}else{\n\t\t\t\tthis.lineTo(this.lines[0].x, this.lines[0].y);\n\t\t\t}\n\t\n\t\t}\n\t}", "title": "" }, { "docid": "d9aef99284dd4eff7aa53aae04246317", "score": "0.58630913", "text": "function polylineMap() {\n var center = new google.maps.LatLng(39.399273, -86.151248);\n var map = new google.maps.Map(document.getElementById(\"polylineMap\"), {\n zoom: 5,\n center: center,\n mapTypeId: \"terrain\"\n });\n\n var flightPlanCoordinates = [\n { lat: 39.08199, lng: -94.568882 },\n { lat: 38.538338, lng: -90.220769 },\n { lat: 39.399273, lng: -86.151248 },\n { lat: 38.830073, lng: -77.098642 }\n ];\n var flightPath = new google.maps.Polyline({\n path: flightPlanCoordinates,\n geodesic: true,\n strokeColor: \"#4c84ff\",\n strokeOpacity: 1.0,\n strokeWeight: 3\n });\n\n flightPath.setMap(map);\n }", "title": "" }, { "docid": "6afc1e41d39675d69163e717edb848c7", "score": "0.58436686", "text": "function drawSnappedPolyline(snappedCoords,ctr) {\n\n\n\n if(ctr =='jeep1'){\n console.log(snappedCoords);\n snappedPolyline1 = new google.maps.Polyline({\n path: snappedCoords,\n strokeColor: 'turquoise',\n strokeWeight: 5,\n icons: [{\n icon: lineSymbol1,\n offset: '100%'\n }]\n });\n\n snappedPolyline1.setMap(map);\n console.log(snappedPolyline1);\n animateCircle(snappedPolyline1);\n\n polylines1.push(snappedPolyline1);\n console.log(polylines1);\n console.log('draw from');\n }\n if(ctr=='jeep2'){\n console.log('draw to');\n console.log(snappedCoords);\n snappedPolyline2 = new google.maps.Polyline({\n path: snappedCoords,\n strokeColor: '#FF69B4',\n strokeWeight: 5,\n icons: [{\n icon: lineSymbol2,\n offset: '100%'\n }]\n });\n\n snappedPolyline2.setMap(map);\n animateCircle(snappedPolyline2);\n\n polylines2.push(snappedPolyline2);\n console.log(polylines2);\n }\n if(ctr=='jeep3'){\n console.log('draw mid');\n console.log(snappedCoords);\n snappedPolyline3 = new google.maps.Polyline({\n path: snappedCoords,\n strokeColor: '#98FB98',\n strokeWeight: 5,\n icons: [{\n icon: lineSymbol3,\n offset: '100%'\n }]\n });\n\n snappedPolyline3.setMap(map);\n animateCircle(snappedPolyline3);\n\n polylines3.push(snappedPolyline3);\n console.log(polylines3);\n }\n if(ctr=='jeep4'){\n console.log('draw 4');\n console.log(snappedCoords);\n snappedPolyline4 = new google.maps.Polyline({\n path: snappedCoords,\n strokeColor: '#FF00FF',\n strokeWeight: 5,\n icons: [{\n icon: lineSymbol4,\n offset: '100%'\n }]\n });\n\n snappedPolyline4.setMap(map);\n animateCircle(snappedPolyline4);\n\n polylines4.push(snappedPolyline4);\n console.log(polylines4);\n }\n\n for (var i = 0; i < snappedCoords.length; i++) {\n var marker = addMarker(snappedCoords[i]);\n }\n\n\n\n\n }", "title": "" }, { "docid": "74c525e94664b6b9191404ce5c57066f", "score": "0.5837211", "text": "function polylineMap() {\n\t var center = new google.maps.LatLng(39.399273, -86.151248);\n\t var map = new google.maps.Map(document.getElementById(\"polylineMap\"), {\n\t zoom: 5,\n\t center: center,\n\t mapTypeId: \"terrain\"\n\t });\n\n\t var flightPlanCoordinates = [\n\t { lat: 39.08199, lng: -94.568882 },\n\t { lat: 38.538338, lng: -90.220769 },\n\t { lat: 39.399273, lng: -86.151248 },\n\t { lat: 38.830073, lng: -77.098642 }\n\t ];\n\t var flightPath = new google.maps.Polyline({\n\t path: flightPlanCoordinates,\n\t geodesic: true,\n\t strokeColor: \"#4c84ff\",\n\t strokeOpacity: 1.0,\n\t strokeWeight: 3\n\t });\n\n\t flightPath.setMap(map);\n\t }", "title": "" }, { "docid": "16faf26adf079f206086895cacb4edf8", "score": "0.5830586", "text": "function drawMountains()\n{\n\t// Draw mountains.\n\t\t\tfor (var i = 0; i < mountain_x.length; i++)\n\t\t\t{\t\n\t\t\tfill(220)\n\t\t\tnoStroke();\n\t\t\ttriangle(mountain_x[i], mountain_y, \n\t\t\t\t\tmountain_x[i]+400,mountain_y, \n\t\t\t\t\tmountain_x[i]+200,mountain_y - 300);\n\t\t\tfill(200)\n\t\t\tnoStroke();\n\t\t\ttriangle(mountain_x[i]+100, mountain_y, \n\t\t\t\t\tmountain_x[i]+486,mountain_y, \n\t\t\t\t\tmountain_x[i]+350,mountain_y - 350);\n\t\t\t}\n}", "title": "" }, { "docid": "88b0564ee011a095bf8872814b22ea85", "score": "0.57971436", "text": "function drawLines(){\n\tfor(i = 0; i < lines.length; i++){\n\t\tcontext.moveTo(lines[i].a.x, lines[i].a.y);\n \tcontext.lineTo(lines[i].b.x, lines[i].b.y);\n \tcontext.stroke();\n \t//window.print(i[0].x);\n\n\t}\n}", "title": "" }, { "docid": "0d12b015b881d334f3ff60e244d7501e", "score": "0.5791432", "text": "function drawWinds() { \n var speeds = w.getWindSpeed('hourly'); // provides 48 hours (49 values)\n var times = w.getTime('hourly');\n var directions= w.getWindBearing('hourly');\n speeds = subset(speeds, 0, 24); // use only the first 24 hours\n times = subset(times, 0, 24);\n directions = subset(directions, 0, 24);\n\n \n // Wind speeds and directions of all day in hours\n fill(255,80)\n stroke(255);\n noFill();\n strokeWeight(1);\n strokeCap(SQUARE);\n \n var minSpeed = min(speeds);\n var maxSpeed = max(speeds);\n\n var lowSpeed = roundDown(minSpeed);\n var highSpeed = roundUp(maxSpeed);\n \n var count = speeds.length;\n for (var i = 0; i < count; i++) {\n push();\n var newang = radians(directions[i]);\n var y = map(speeds[i], lowSpeed, highSpeed, 10, 50);\n if (i<12){\n var x = map(i, 0, 11 , chart.left, chart.right);\n translate(x,chart.bottom-25);\n } else if (i>=12) {\n var x = map(i, 12, 23, chart.left, chart.right);\n translate(x,chart.bottom+25);\n }\n stroke(255)\n rotate(newang);\n line(0, y/2, 0, -y/2);\n fill(255);\n ellipse(0,-y/2, 3, 3);\n pop();\n }\n}", "title": "" }, { "docid": "bc60e0dfac9afef861c4fe09edc7865a", "score": "0.5787926", "text": "function mapview_put_border_line(pcanvas, dir, color, canvas_x, canvas_y) {\n var x = canvas_x + 47;\n var y = canvas_y + 3;\n\n pcanvas.strokeStyle = color;\n pcanvas.lineWidth = 2;\n\n pcanvas.lineCap = 'butt';\n if (dashedSupport) {\n pcanvas.setLineDash([4,4]);\n }\n\n pcanvas.beginPath();\n if (dir == DIR8_NORTH) {\n if (dashedSupport) {\n pcanvas.moveTo(x, y - 2, x + (tileset_tile_width / 2));\n pcanvas.lineTo(x + (tileset_tile_width / 2), y + (tileset_tile_height / 2) - 2);\n }\n } else if (dir == DIR8_EAST) {\n if (dashedSupport) {\n pcanvas.moveTo(x - 3, y + tileset_tile_height - 3);\n pcanvas.lineTo(x + (tileset_tile_width / 2) - 3, y + (tileset_tile_height / 2) - 3);\n }\n } else if (dir == DIR8_SOUTH) {\n if (dashedSupport) {\n pcanvas.moveTo(x - (tileset_tile_width / 2) + 3, y + (tileset_tile_height / 2) - 3);\n pcanvas.lineTo(x + 3, y + tileset_tile_height - 3);\n }\n } else if (dir == DIR8_WEST) {\n if (dashedSupport) {\n pcanvas.moveTo(x - (tileset_tile_width / 2) + 3, y + (tileset_tile_height / 2) - 3);\n pcanvas.lineTo(x + 3, y - 3);\n }\n }\n pcanvas.closePath();\n pcanvas.stroke();\n if (dashedSupport) {\n pcanvas.setLineDash([]);\n }\n \n}", "title": "" }, { "docid": "c76b6b9e45675854b660bfef6cd0a8d2", "score": "0.57782227", "text": "function drawMountains()\n{\n\tfor(var i = 0; i < mountain.length; i++)\n\t\t{\n\t\t\tfill(128,128,128,100);\n\t\t\ttriangle(mountain[i].x_pos - 75,\n\t\t\t\t mountain[i].y_pos +272,\n\t\t\t\t mountain[i].x_pos,\n\t\t\t\t mountain[i].y_pos,\n\t\t\t\t mountain[i].x_pos + 75,\n\t\t\t\t mountain[i].y_pos + 272);\n\t\t}\n}", "title": "" }, { "docid": "435eb81cda3cf4fb89db4ec4b8b20b7a", "score": "0.57760555", "text": "function createMap(airports,al1,al2,al3) {\n\n // Define streetmap and darkmap layers\n var streetmap = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.streets\",\n accessToken: API_KEY\n });\n\n // Define a baseMaps object to hold our base layers\n var baseMaps = {\n \"Street Map\": streetmap,\n };\n\n // Create overlay object to hold our overlay layer\n var overlayMaps = {\n Airports: airports,\n AmericanAirlines:al1,\n Delta:al2,\n Southwest:al3\n };\n\n // Create our map, giving it the streetmap and earthquakes layers to display on load\n var myMap = L.map(\"leaflet\", {\n center: [\n 37.09, -95.71\n ],\n zoom: 5,\n layers: [streetmap, airports]\n });\n\n // Create a layer control\n // Pass in our baseMaps and overlayMaps\n // Add the layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n}", "title": "" }, { "docid": "7833c84c723ca7e0c7fa5f8b419c30ea", "score": "0.57744676", "text": "function initMap() {\r\n var map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 14,\r\n center: {lat: 21.0051226, lng: 105.8464602},\r\n mapTypeId: 'terrain'\r\n });\r\n\r\n var flightPlanCoordinates = [\r\n\t\t\t{lat:21.0051514, lng:105.8456804},\r\n{lat:21.0016724, lng:105.84513},\r\n{lat:20.9995283333333, lng:105.84563},\r\n{lat:20.9963894, lng:105.8464144},\r\n{lat:20.9960366666666, lng:105.850175},\r\n{lat:20.9982982, lng:105.8682506},\r\n{lat:21.0058866666666, lng:105.877688333333},\r\n{lat:21.0057066666666, lng:105.877831666666},\r\n{lat:21.0108479, lng:105.8776556},\r\n{lat:21.0183153, lng:105.8905023},\r\n{lat:21.0263237, lng:105.8962378},\r\n{lat:21.0252022, lng:105.8951824},\r\n{lat:21.0204816666666, lng:105.89243},\r\n{lat:21.0199433333333, lng:105.892171666666},\r\n{lat:21.0130433333333, lng:105.885181666666},\r\n{lat:21.0132433333333, lng:105.88519},\r\n{lat:21.0089766666666, lng:105.880626666666},\r\n{lat:21.0085516666666, lng:105.880533333333},\r\n{lat:21.0086999999999, lng:105.880338333333},\r\n{lat:21.0086083333333, lng:105.880371666666},\r\n{lat:21.0023679, lng:105.8787837},\r\n{lat:21.0017117, lng:105.8747194},\r\n{lat:21.005405, lng:105.8747194},\r\n{lat:20.9978215, lng:105.866599},\r\n{lat:20.9960116, lng:105.8618279},\r\n{lat:20.9956298, lng:105.8515521},\r\n{lat:20.9958632, lng:105.8510016},\r\n{lat:20.996888, lng:105.8502218},\r\n{lat:21.0005245, lng:105.8505429},\r\n{lat:21.0009266666666, lng:105.850058333333},\r\n{lat:21.0017243, lng:105.8493502},\r\n{lat:21.0051923, lng:105.8457263},\r\n{lat:21.0067342, lng:105.8452217},\r\n{lat:21.00661, lng:105.8452217},\r\n{lat:21.0071361, lng:105.8486162},\r\n{lat:21.008255, lng:105.850791666666},\r\n{lat:21.0071589, lng:105.8474236},\r\n{lat:21.0042789, lng:105.8472401},\r\n{lat:21.003187, lng:105.8482493},\r\n{lat:21.0018883, lng:105.844763},\r\n{lat:21.0051105, lng:105.8456346},\r\n{lat:21.0049112, lng:105.844396},\r\n{lat:21.0046657, lng:105.8441208}\r\n ];\r\n var flightPath = new google.maps.Polyline({\r\n path: flightPlanCoordinates,\r\n geodesic: true,\r\n strokeColor: '#FF0000',\r\n strokeOpacity: 1.0,\r\n strokeWeight: 2\r\n });\r\n\r\n flightPath.setMap(map);\r\n }", "title": "" }, { "docid": "db3cbea35c1c617ab377a9f113a3e004", "score": "0.57606655", "text": "function showMap() {\n map = new google.maps.Map(document.getElementById(\"map\"),\n {\n zoom: 2,\n center: {\n lat: 0,\n lng: 0\n },\n mapTypeControl: false,\n zoomControl: false,\n streetViewControl: false\n });\n pathLine = new google.maps.Polyline({\n geodesic: true,\n strokeColor: '#565656',\n strokeOpacity: 0.8,\n strokeWeight: 5\n });\n}", "title": "" }, { "docid": "006d31c71149eae2809452f1b7c5b6b7", "score": "0.57585186", "text": "Draw_Att_Lines()\n {\n let att_line = this.att_lines.pop();\n let size = new Vector2(this.x_size, this.y_size);\n\n //cycle through all of the lines until there are none left\n while(att_line)\n {\n let end = PathNode.CenterLine(att_line.end, size);\n let strt = PathNode.CenterLine(att_line.start, size);\n strt = Vector2.Add(strt, new Vector2(0,Y_OFFSET));\n end = Vector2.Add(end, new Vector2(0,Y_OFFSET));\n\n GAZCanvas.Line(strt,end , att_line.col, LINE_WIDTH );\n att_line = this.att_lines.pop();\n }\n }", "title": "" }, { "docid": "e5d20245581542403f7e4f739be4f6e8", "score": "0.5739852", "text": "function addLine() {\n\tfor (var i = 0; i < Coordinates.length; i++) {\n\t\tvar flightPath = new google.maps.Polyline({\n\t \tpath: Coordinates[i],\n\t strokeColor: colors[i],\n\t strokeOpacity: 0.6,\n\t strokeWeight: 5,\n\t draggable: true\n\t \t });\n\t\tflightPath.setMap(map);\n \t flightPaths.push(flightPath);\n\t}\n\tArray.prototype.forEach.call(flightPaths, function(flightPath, index) {\n\t\tgoogle.maps.event.addListener(flightPath, 'mouseover', function(e) {\n\t\t\tdocument.getElementById('popup').innerHTML = \"No.\" + (index + 1) + \" shortest path \\n length = \" + distances[index].toFixed(4);\n\t\t\tdocument.getElementById('popup').style.display = 'block';\n\t\t\tfor (var i = 0; i < flightPaths.length; i++) {\n\t\t\t\tif (i == index) {\n\t\t\t\t\tflightPaths[i].setVisible(true);\n\t\t\t\t} else {\n\t\t\t\t\tflightPaths[i].setVisible(false);\n\t\t\t\t}\n\t\t\t}\n\t\t });\n\t\tgoogle.maps.event.addListener(flightPath, 'mouseout', function(e) {\n\t\t\tdocument.getElementById('popup').style.display = 'none';\n\t\t\tfor (var i = 0; i < flightPaths.length; i++) {\n\t\t\t\tflightPaths[i].setVisible(true);\n\t\t\t}\n\t\t });\n\t\t});\n}", "title": "" }, { "docid": "a39c04c0b5f0216d6f25094418d9afc1", "score": "0.57385653", "text": "function drawLine(coordinates){\n\n line = new google.maps.Polyline({\n path: coordinates,\n geodesic: true,\n strokeColor: '#6095d5',\n strokeOpacity: 1.0,\n strokeWeight: 3,\n map: map\n });\n\n}", "title": "" }, { "docid": "cf6f8007fc27c49b578d8095bcdb814e", "score": "0.5728224", "text": "airDraw ({ sketch, assets, board }) { }", "title": "" }, { "docid": "28b8643865a8f4db9feaf6584aea4b2c", "score": "0.5728021", "text": "function initialize() {\r\n var mapOptions = {\r\n zoom: 16,\r\n center: new google.maps.LatLng(-27.495417, 153.010395),\r\n mapTypeId: google.maps.MapTypeId.ROADMAP \r\n };\r\n map = new google.maps.Map(document.getElementById('map_canvas'),\r\n mapOptions);\r\n\t\t \r\n//reading location file\r\n var script = document.createElement('script');\r\n script.src = '\\week.json';\r\n document.getElementsByTagName('head')[0].appendChild(script);\r\n\t \r\n //create line using coordinates\t\r\n\tvar polylinecoordinates = [\r\n\tnew google.maps.LatLng(-27.494886, 153.008541),\r\n new google.maps.LatLng(-27.495315, 153.008451),\r\n new google.maps.LatLng(-27.495592, 153.010260),\r\n\tnew google.maps.LatLng(-27.495417, 153.010395)\r\n \r\n ];\r\n //draw line\r\n polyline = new google.maps.Polyline({\r\n path: polylinecoordinates,\r\n strokeColor: '#4CC417',\r\n strokeOpacity: 1.0,\r\n strokeWeight: 2,\r\n\teditable: false,\r\n });\r\n \r\n polyline.setMap(map);\r\n \r\n \tvar polylinecoordinates2 = [\r\n\tnew google.maps.LatLng(-27.494887, 153.008542),\r\n new google.maps.LatLng(-27.495308, 153.008465),\r\n new google.maps.LatLng(-27.495575, 153.010239),\r\n\tnew google.maps.LatLng(-27.495485, 153.010228),\r\n new google.maps.LatLng(-27.495497, 153.010290),\r\n new google.maps.LatLng(-27.495417, 153.010395)\r\n \r\n ];\r\n //draw line\r\n polyline2 = new google.maps.Polyline({\r\n path: polylinecoordinates2,\r\n strokeColor: '#0000A0',\r\n strokeOpacity: 1.0,\r\n strokeWeight: 2,\r\n\teditable: false,\r\n });\r\n \r\n polyline2.setMap(map);\r\n \r\n var polylinecoordinates3 = [\r\n\tnew google.maps.LatLng(-27.495417, 153.010395),\r\n new google.maps.LatLng(-27.497552,153.013018), \r\n ];\r\n //draw line\r\n\tvar polyline3 = new google.maps.Polyline({\r\n path: polylinecoordinates3,\r\n strokeColor: '#4CC417',\r\n strokeOpacity: 1.0,\r\n strokeWeight: 2,\r\n\teditable: false,\r\n });\r\n \r\n polyline3.setMap(map);\r\n \r\n \tvar polylinecoordinates4 = [\r\n new google.maps.LatLng(-27.497552,153.013018), \r\n\tnew google.maps.LatLng(-27.495363,153.015958)\r\n ];\r\n //draw line\r\n\tvar polyline4 = new google.maps.Polyline({\r\n path: polylinecoordinates4,\r\n strokeColor: '#4CC417',\r\n strokeOpacity: 1.0,\r\n strokeWeight: 2,\r\n\teditable: false,\r\n });\r\n \r\n polyline4.setMap(map);\r\n //toggle polyline in how many milisecond\r\n setInterval(togglePolyline, 495); \r\n }", "title": "" }, { "docid": "69f91529ae4bab662b8d80a6002a3caf", "score": "0.5717013", "text": "drawLines() {}", "title": "" }, { "docid": "32463a378263785877d8806d8a4ce16f", "score": "0.5712727", "text": "function drawEbolaMap() {\r\n for (i = 0; i < dataEbola.length; i++) {\r\n xPos = map(dataEbola[i].longitude, 0 - 180, 180, 0, paperWidth);\r\n yPos = map(dataEbola[i].latitude, 0 - 90, 90, 0, paperHeight);\r\n radius = map(areaToRadius(dataEbola[i].cases), 0, areaToRadius(1700), 1, 10);\r\n paper.circle(xPos, paperHeight - yPos, radius).attr({\r\n fill: '#2B2D42',\r\n id: \"ebola\"\r\n\r\n });\r\n }\r\n}", "title": "" }, { "docid": "a16a2846189118e014289235c8ac5201", "score": "0.5710423", "text": "function drawLine(){\n var nextX = currentX + unit * xDist;\n var nextY = currentY + unit * yDist;\n\n con[currentFloor].lineTo(nextX, nextY);\n con[currentFloor].stroke();\n\n ctx.lineTo((nextX - shiftX) * c.width * currentZoom / floors[currentFloor].width, (nextY - shiftY) * c.height * currentZoom /floors[currentFloor].height);\n ctx.stroke();\n\n currentX = nextX;\n currentY = nextY;\n\n len = len-1;\n\n if (len > 0) {\n setTimeout(drawLine, animationSpeed);\n } else {\n requestAnimationFrame(route);\n }\n }", "title": "" }, { "docid": "39e82d3e5e73c7b1361a2643c6df5d70", "score": "0.57045853", "text": "function draw() {\n updateFeatures();\n drawMap();\n drawArcs();\n drawPlots();\n}", "title": "" }, { "docid": "fa7a9b1052936d119ddf523e2803e2eb", "score": "0.57015675", "text": "function render(context) { \n context.strokeStyle = 'white';\n context.fillStyle = 'black';\n context.lineWidth = 6;\n context.beginPath();\n context.moveTo(0, game.gameHeight);\n\n for(let i = 0; i < terrain.map.length; i++) {\n context.lineTo(terrain.map[i].x, terrain.map[i].y);\n }\n context.lineTo(game.gameWidth, game.gameHeight);\n \n\n context.closePath();\n context.stroke();\n context.fill();\n }", "title": "" }, { "docid": "9f1f4baaab06aec9a9aa1399d303b096", "score": "0.56986445", "text": "function detailMapDraw() {\n var detailBounds = detailPath.bounds(accidents),\n detailTopLeft = detailBounds[0],\n detailBottomRight = detailBounds[1];\n\n detailSvg .attr(\"width\", detailBottomRight[0] - detailTopLeft[0])\n .attr(\"height\", detailBottomRight[1] - detailTopLeft[1])\n .style(\"left\", detailTopLeft[0] + \"px\")\n .style(\"top\", detailTopLeft[1] + \"px\");\n\n detailG .attr(\"transform\", \"translate(\" + -detailTopLeft[0] + \",\" + -detailTopLeft[1] + \")\");\n\n detailFeature.attr(\"d\", detailPath);\n detailFeature.attr(\"date\", function (d) { return parseTimeDayMonthYear(d.properties.ACCIDENTDATE) });\n detailFeature.attr(\"time\", function (d) { return d.properties.ACCIDENTTIME });\n detailFeature.attr(\"street\", function (d) { return d.properties.ROAD_NAME });\n detailFeature.attr(\"type_desc\", function (d) { return d.properties.ACCIDENT_TYPE_DESC });\n detailFeature.attr(\"day_of_week\", function (d) { return d.properties.DAY_WEEK_DESC });\n detailFeature.attr(\"no_of_vehicles\", function (d) { return d.properties.NO_OF_VEHICLES });\n detailFeature.attr(\"severity\", function (d) { return d.properties.SEVERITY });\n detailFeature.attr(\"road_geometry\", function (d) { return d.properties.ROAD_GEOMETRY_DESC });\n detailFeature.attr(\"road_geometry\", function (d) { return d.properties.ROAD_GEOMETRY_DESC });\n detailFeature.attr(\"traffic_control\", function (d) { return d.properties.TRAFFIC_CONTROL_DESC });\n detailFeature.attr(\"pointer-events\", \"visible\");\n detailFeature.on(\"mouseover\", function(d) {\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div\t.html('Date: ' + d.properties.ACCIDENTDATE + '<br>' + d.properties.ACCIDENT_TYPE_DESC )\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n });\n }", "title": "" }, { "docid": "106c0cbb71023fe42812049a76b77ae2", "score": "0.56830186", "text": "function draw(pateki, markeri) {\r\n \r\n\r\n for (var i = 0; i < pateki.length; i++) {\r\n\r\n path = new google.maps.Polyline({\r\n path: pateki[i],\r\n geodesic: true,\r\n strokeColor: colors[i],\r\n strokeOpacity: 0.5,\r\n strokeWeight: 11\r\n });\r\n\r\n path.setMap(map);\r\n paths.push(path);\r\n }\r\n\r\n for (var i = 0; i < markeri.length; i++) {\r\n var marker = new google.maps.Marker({\r\n position: markeri[i],\r\n map: map,\r\n icon: new google.maps.MarkerImage(\"/images/markers/medium_marker1.png\", null, null, null, new google.maps.Size(40, 55))\r\n });\r\n\r\n markers.push(marker);\r\n }\r\n}", "title": "" }, { "docid": "c3e626b304e2b03efc9cc08a12e302ea", "score": "0.5679879", "text": "function makePath(){\n flightPath = new google.maps.Polyline({\n path: locationInfo,\n geodesic: true,\n strokeColor: '#FF0000',\n strokeOpacity: 1.0,\n strokeWeight: 2\n });\n flightPath.setMap(map);\n}", "title": "" }, { "docid": "4cc2494bdf02e3f5ecee48412c27312e", "score": "0.56672066", "text": "canvas_draw_airspace_border(cc) {\n const airport = window.airportController.airport_get();\n if (!airport.airspace) {\n this.canvas_draw_ctr(cc);\n }\n\n // style\n cc.strokeStyle = this.theme.AIRSPACE_PERIMETER;\n cc.fillStyle = this.theme.AIRSPACE_FILL;\n\n // draw airspace\n for (let i = 0; i < airport.airspace.length; i++) {\n const poly = $.map(airport.perimeter.poly, (v) => {\n return [v.relativePosition];\n });\n\n this.canvas_draw_poly(cc, poly);\n cc.clip();\n }\n }", "title": "" }, { "docid": "93d7203351eac0b24a29600117d5c4e6", "score": "0.5660741", "text": "function draw() {\n // Fade existing trails\n var prev = g.globalCompositeOperation;\n g.globalCompositeOperation = \"destination-in\";\n g.fillRect(0, 0, view.width, view.height);\n g.globalCompositeOperation = prev;\n\n stations.forEach(function(station)\n {\n \tvar birdNumber = station.birdNumber;\n \tvar lat = station.lat;\n \tvar long = station.long;\n \tvar subParticles = station.subParticles;\n\n \tsubParticles.forEach(function(particle)\n \t{\n \t\tif (particle.age < settings.maxParticleAge) {\n \t\t\tif(particle.x >0 && particle.y > 0 && particle.xt >0 && particle.yt >0){\n \t\t\t //var dist = mvi.dist(particle.x, particle.y, particle.xt, particle.yt)\n \t\t\t\t//if(dist < 100){\n \t\t\t\tg.moveTo(particle.x, particle.y);\n \t\t\t\tg.lineTo(particle.xt, particle.yt);\n \t\t\t\tparticle.x = particle.xt;\n \t\t\t\tparticle.y = particle.yt;\n \t\t\t//}\n \t\t\t}\n \t\t};\n\n \t});\n\n });\n}", "title": "" }, { "docid": "3d32021859aa390e593fadfb56609b54", "score": "0.5652935", "text": "function drawTrafficRegions() {\n\n\n var colors = [\"red\", \"darkorange\", \"yellow\", \"forestgreen\", \"lime\", \"greenyellow\"];\n var colorRegion;\n var vel_flag;\n\n for (var i = 0; i < 29; i++) {\n\n var vel = parseFloat(arrayTraffic[i][6]);\n\n\n if (vel <= 15) {\n colorRegion = colors[0];\n vel_flag = 0.3;\n } else if (vel > 15 && vel <= 20) {\n colorRegion = colors[1];\n vel_flag = 0.5;\n } else if (vel > 20 && vel <= 25) {\n colorRegion = colors[2];\n vel_flag = 0.7;\n } else if (vel > 25 && vel <= 30) {\n colorRegion = colors[3];\n vel_flag = 1.0;\n } else if (vel > 30 && vel <= 35) {\n colorRegion = colors[4];\n vel_flag = 1.4;\n } else if (vel > 35) {\n colorRegion = colors[5];\n vel_flag = 2.0;\n } else {\n alert(\"region not detected.\")\n }\n\n\n var regionCoords = [\n {\n lat: parseFloat(arrayTraffic[i][1]),\n lng: parseFloat(arrayTraffic[i][2])\n },\n {\n lat: parseFloat(arrayTraffic[i][1]),\n lng: parseFloat(arrayTraffic[i][3])\n },\n {\n lat: parseFloat(arrayTraffic[i][0]),\n lng: parseFloat(arrayTraffic[i][3])\n },\n {\n lat: parseFloat(arrayTraffic[i][0]),\n lng: parseFloat(arrayTraffic[i][2])\n }\n ];\n\n // Construct the polygon.\n var region = new google.maps.Polygon({\n paths: regionCoords,\n strokeColor: colorRegion,\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: colorRegion,\n fillOpacity: 0.35,\n\n });\n region.setMap(map);\n\n // Define the symbol\n var lineSymbol = {\n path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,\n scale: 2,\n strokeColor: \"maroon\",\n strokeOpacity: 30\n };\n\n // Create the polyline and add the symbol \n var line = new google.maps.Polyline({\n path: [{\n lat: parseFloat(arrayTraffic[i][1]),\n lng: parseFloat(arrayTraffic[i][2]) + ((parseFloat(arrayTraffic[i][3]) - parseFloat(arrayTraffic[i][2])) / 2)\n }, {\n lat: parseFloat(arrayTraffic[i][0]),\n lng: parseFloat(arrayTraffic[i][2]) + ((parseFloat(arrayTraffic[i][3]) - parseFloat(arrayTraffic[i][2])) / 2)\n }],\n icons: [{\n icon: lineSymbol,\n\n }],\n map: map\n\n\n });\n\n animateCircle(line, vel_flag);\n\n };\n}", "title": "" }, { "docid": "19beffd65c2db3c2eff62f32481a67b0", "score": "0.5649998", "text": "function drawData(){\n // Remove nodes and links in the node-link graph within the map\n d3.selectAll(\"#edges path\").remove();\n d3.selectAll(\"#nodes g\").remove();\n // Call d3 force edge bundling algorithm on the current node_data and edge_data arrays (contain data depending on user's current\n // selection of filters)\n var fbundling = d3.ForceEdgeBundling()\n .step_size(0.1)\n .compatibility_threshold(0.6)\n .nodes(node_data)\n .edges(edge_data);\n results = fbundling();\t\n // Change output from d3 force edge bundling algorithm into an array of objects with specified properties from attr_data, which\n // contains a limited selection of the properties from routes_data.csv \n transform_results(results);\n // d3 line generator using x and y properties of data\n var d3line = d3.svg.line()\n .x(function(d){ return d.x; })\n .y(function(d){ return d.y; })\n .interpolate(\"linear\");\n // Add lines to the map\n edges.selectAll(\"path\")\n .data(results)\n .enter()\n .append(\"path\")\n .attr(\"d\", function(d) {return d3line(d[\"segments\"])})\n // Stroke width depends on the value of the \"percent_change_2018_2019\" field\n .style(\"stroke-width\",function(d){\n return (d[\"percent_change_2018_2019\"]/20);\n })\n // Color of line depends on if the route being represented is a regional or major route\n .style(\"stroke\", function(d){\n if(d[\"label\"]=='Regional'){\n return \"#EA6A47\";\n } else if(d[\"label\"]=='Major'){\n return \"#0091D5\";\n }\n })\n .style(\"fill\", \"none\")\n .style('stroke-opacity',0.5)\n .attr(\"id\",function(d,i){\n return \"edge_\"+airports_dict[d[\"airport_2\"]];\n })\n // Mouseover event handler\n .on(\"mouseover\",function(d){\n var this_temp = this;\n onMouseOver(this_temp,d);}\n )\n // Mouseout event handler\n .on(\"mouseout\",function(d){\n var this_temp = this;\n onMouseOut(this_temp,d);}\n );\n // Add groups to draw the nodes on the map\n var nodes_g = nodes.selectAll('g')\n .data(d3.entries(node_data))\n .enter()\n .append(\"g\")\n .attr(\"id\",function(d){\n return \"nodeg_\"+d.key;\n })\n // Add circles for the nodes on the map\n nodes_g.append('circle')\n // If the node is the current origin airport or destination airport, the radius will be large (node_rad_extra)\n // Otherwise, the node radius will be small (node_rad_normal)\n .attr('r', function(d){\n if((airports_dict[airport_origin]==d.key) || (airports_dict[airport_dest]==d.key)){\n return node_rad_extra;\n } else{\n return node_rad_normal;\n }\n })\n .attr(\"class\",function(d){\n if((airports_dict[airport_origin]==d.key) || (airports_dict[airport_dest]==d.key)){\n return \"graph_over\";\n } \n })\n .attr('fill','#ffc107')\n .attr('cx', function(d){ return d.value.x;})\n .attr('cy', function(d){ return d.value.y;})\n .attr(\"id\",function(d){\n return \"node_\"+d.key;\n })\n // Add a text label for each node\n nodes_g.append(\"text\")\n .attr(\"id\",function(d){\n return \"nodeText_\"+d.key;\n })\n .attr(\"text-anchor\",\"middle\")\n .text(function(d){\n return airports_dict_rev[d.key];\n })\n .attr(\"x\",function(d){return d.value.x;})\n .attr(\"y\",function(d){return d.value.y+5;})\n // The text will be visible if the node is the current origin airport or destination airport\n // Otherwise, the text will be hidden\n .style(\"visibility\",function(d){\n if((airports_dict[airport_origin]==d.key) || (airports_dict[airport_dest]==d.key)){\n return \"visible\";\n } else{\n return \"hidden\";\n }\n });\n \n}", "title": "" }, { "docid": "cc3f3966e9a02d520580b3b63aa1e039", "score": "0.5646261", "text": "function drawMap (map) {\n // Work out side length\n var sideLength = Math.sqrt(map.length);\n\n // Add horizontal borders, top border padded with a leading space,\n // bottom padded with leading and trailing pipe\n var horizLength = (3 * sideLength) + 8;\n // Vertical borders are (2 * sidelength) + 4\n var vertLength = (2 * sideLength) + 4;\n\n // Add array to hold each line of the drawn map\n var drawnMap = [];\n drawnMap.length = vertLength;\n\n // Top border begins with a space\n var topBorder = \" \";\n for (let i = 0; i < horizLength; i++) {\n topBorder += \"_\";\n }\n drawnMap[0] = topBorder;\n\n // Blank lines are always spaces padded with pipes\n var blankLine = \"{\";\n for (let i = 0; i < horizLength; i++) {\n blankLine += \" \";\n }\n blankLine += \"}\";\n\n // Second and third lines are always blank\n drawnMap[1] = blankLine;\n drawnMap[2] = blankLine\n\n // Bottom border is always underscores padded with pipes\n var bottomBorder = \"{\";\n for (let i = 0; i < horizLength; i++) {\n bottomBorder += \"_\";\n }\n bottomBorder += \"}\";\n drawnMap[(vertLength)] = bottomBorder;\n\n // Gets the central map content\n var mapContent = [];\n for (let i = 0; i < sideLength; i++) {\n mapContent[i] = \"\";\n }\n for (var i = 0; i < sideLength; i++) {\n for (let j = (i * sideLength); j < ((i + 1) * sideLength); j++) {\n // // First check for bridgeUpper\n // if (map[j+sideLength].terrain === \"bridgeUpper\") {\n //\n // } else if (map[j+sideLength].terrain === \"bridgeLower\") { // Then check for bridgeLower\n //\n // }\n if (map[j].terrain === \"river\") {\n if ((j + sideLength) < map.length) {\n if (map[(j+sideLength - 1)].terrain === \"river\") {\n mapContent[i] += \"/ /\";\n } else if (map[(j+sideLength)].terrain === \"river\") {\n mapContent[i] += \"| |\";\n } else {\n mapContent[i] += \"\\\\ \\\\\";\n }\n } else {\n if (map[(j-sideLength - 1)].terrain === \"river\") {\n mapContent[i] += \"/ /\";\n } else if (map[(j-sideLength)].terrain === \"river\") {\n mapContent[i] += \"| |\";\n } else {\n mapContent[i] += \"\\\\ \\\\\";\n }\n }\n } else if (map[j].playerIsHere) {\n mapContent[i] += \"[*]\";\n } else if (map[j].creature !== null) {\n mapContent[i] += \" \" + map[j].creature.attributes.healthBar + \" \";\n } else if (map[j].terrain === \"bridge\") {\n mapContent[i] += \"III\";\n } else if (map[j].terrain === \"bridgeUpper\" || map[j].terrain === \"bridgeLower\") {\n mapContent[i] += \"| |\";\n } else {\n mapContent[i] += \" · \";\n }\n }\n }\n\n // Each line should print a pipe, then three spaces, then creatures on\n // each grid space with two spaces inbetween, then three spaces and a final\n // pipe (e.g. | s o x |)\n for (let j = 3; j < vertLength - 1; j+=2) {\n drawnMap[j] = \"{ \" + mapContent[(((j-1)/2)-1)] + \" }\";\n }\n for (let i = 4; i < vertLength; i+=2) {\n drawnMap[i] = blankLine;\n }\n for (let i in drawnMap) {\n console.log(drawnMap[i]);\n }\n\n}", "title": "" }, { "docid": "8fb977c66ca50cddd0c4690cd759300d", "score": "0.56454754", "text": "function showSelectedRoutes(routes, id)\n{\n //Adds polyline for each route in the inputted array\n for (let j = 0; j < routes.length; j++)\n { \n //Creating the line object\n let object = {\n type: \"geojson\",\n data: {\n type: \"Feature\",\n properties: {},\n geometry: {\n type: \"LineString\",\n coordinates: [routes[j].destination.coordinates, routes[j].source.coordinates]\n }\n }\n };\n //Adding it to the layer\n map.addLayer({\n id: `${id}${j}`,\n type: \"line\",\n source: object,\n layout: { \"line-join\": \"round\", \"line-cap\": \"round\" },\n paint: { \"line-color\": \"#555\", \"line-width\": 6 }\n });\n map.moveLayer(`${id}${j}`) //Makes sure all the layers have a unique id\n \n }\n}", "title": "" }, { "docid": "459342c3e1deb35a62e3df41d4f9d1f6", "score": "0.56373", "text": "draw() {\n // canvas.poly(this.absolutePoints, 'black', 'red')\n this.absolutePoints.forEach(point => {\n canvas.line(point.x, point.y, this.centreOfMass.x, this.centreOfMass.y)\n })\n canvas.point(this.centreOfMass)\n }", "title": "" }, { "docid": "d0f2175af107d5775f361fdd85bed31f", "score": "0.56126237", "text": "function drawLine(){\r\n\r\n\tstrokeWeight(2);\r\n\tstroke(0,0,0,60);\r\n\tline(800, 332, 800, 380 );\r\n\tline(680, 332, 680, 380);\r\n\tline(545, 332, 545, 380);\r\n\tline(408, 332, 408 , 380);\r\n\tline(265, 332, 265, 380);\r\n\tline(143, 332, 143, 380);\r\n\tstroke(0);\r\n\r\n\tfor(i=0; i<=1400; ){\r\n\t\tstrokeWeight(1);\r\n\t\tline(10+i, 355, 30+i, 355);\r\n\t\ti+=50;\r\n\t}\r\n\r\n\r\n}", "title": "" }, { "docid": "4715b4e3a4c669611d23437a758200ae", "score": "0.5610965", "text": "function render() {\n\t\t\n\t\tvar lineCount = lines.length;\n\t\t\n\t\t// Go through each line and draw a path between its points\n\t\twhile ( lineCount-- ) {\n\t\t\t\n\t\t\tvar thickness = lines[lineCount].thickness;\n\t\t\tvar perspective = wrapNumber( ( globalPerspective - lines[lineCount].perspective ) * 2, 2 );\n\t\t\tvar dashed = lines[lineCount].dashed;\n\t\t\tvar points = lines[lineCount].points;\n\t\t\t\n\t\t\tvar p1 = points[0];\n\t\t\tvar p2 = points[1];\n\t\t\t\n\t\t\t// Only begind the path if we're drawing on solid line\n\t\t\tif ( !dashed ) {\n\t\t\t\tcontext.beginPath();\n\t\t\t}\n\t\t\t\n\t\t\tfor (var i = 1, len = points.length; i < len; i++) {\n\t\t\t\t\n\t\t\t\t// If we're drawing a dashed line, we need to begin a new\n\t\t\t\t// path on every loop\n\t\t\t\tif ( dashed ) {\n\t\t\t\t\tcontext.beginPath();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If the point's position is within x distance of its normal,\n\t\t\t\t// we give it another impulse based on the current amplitude\n\t\t\t\tif (distanceBetween(p1.position, p1.normal) < 1) {\n\t\t\t\t\tp1.position.x += (Math.random() - 0.5) * amplitude;\n\t\t\t\t\tp1.position.y += (Math.random() - 0.5) * amplitude;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Ease position towards the normal at a speed based on elasticity\n\t\t\t\tp1.position.x += (p1.normal.x - p1.position.x) * elasticity;\n\t\t\t\tp1.position.y += (p1.normal.y - p1.position.y) * elasticity;\n\t\t\t\t\n\t\t\t\tvar p1x = p1.position.x;\n\t\t\t\tvar p2x = p2.position.x;\n\t\t\t\t\n\t\t\t\t// Adjust the position based on depth\n\t\t\t\tp1x += perspective * ( p1.position.x - ( world.width * 0.5 ) ) * ( perspective < 0 ? 1 : -1 );\n\t\t\t\tp2x += perspective * ( p2.position.x - ( world.width * 0.5 ) ) * ( perspective < 0 ? 1 : -1 );\n\t\t\t\t\n\t\t\t\tif( i == 1 || dashed ) {\n\t\t\t\t\tcontext.moveTo(p1x, p1.position.y);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Draw a smooth curve between p1 and p2\n\t\t\t\tcontext.quadraticCurveTo(p1x, p1.position.y, p1x + (p2x - p1x) / 2, p1.position.y + (p2.position.y - p1.position.y) / 2);\n\t\t\t\t\n\t\t\t\tp1 = points[i];\n\t\t\t\tp2 = points[i + 1];\n\t\t\t\t\n\t\t\t\t// If this is a dashed line, it needs to be drawn repeatedly\n\t\t\t\t// in this loop\n\t\t\t\tif( dashed ) {\n\t\t\t\t\tstroke( ( thickness * ( 1 ) ).toFixed(2) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// If we're drawing a solid line, close it now\n\t\t\tif( !dashed ) {\n\t\t\t\tstroke( thickness );\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (var i = 0; i < dust.length; i++) {\n\t\t\t\n\t\t\tvar d1 = dust[i];\n\t\t\t\n\t\t\tvar perspective = wrapNumber( ( globalPerspective - d1.perspective ) * 2, 2 );\n\t\t\t\n\t\t\td1.position.x += d1.velocity.x;\n\t\t\td1.position.y += d1.velocity.y;\n\t\t\t\n\t\t\tvar d1x = d1.position.x;\n\t\t\t\n\t\t\t// Adjust the position based on perspective\n\t\t\td1x += perspective * ( d1.position.x - ( world.width * 0.5 ) ) * ( perspective < 0 ? 1 : -1 );\n\t\t\t\n\t\t\td1.alpha *= 0.94;\n\t\t\t\n\t\t\tcontext.fillStyle = \"rgba(0,0,0,\" + d1.alpha + \")\";\n\t\t\tcontext.fillRect(d1x, d1.position.y, 1, 1);\n\t\t\t\n\t\t\tif (d1.alpha < 0.05) {\n\t\t\t\tdust.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif( compassAlpha > 0 ) {\n\t\t\t\n\t\t\tcontext.save();\n\t\t\tcontext.globalAlpha = Math.max( compassAlpha, 0 );\n\t\t\t\n\t\t\tcontext.beginPath();\n\t\t\tcontext.scale( 1, 0.5 );\n\t\t\t\n\t\t\tvar a = globalPerspective * Math.PI - ( Math.PI / 2 );\n\t\t\t\n\t\t\tfor( var i = 0; i < 2; i++ ) {\n\t\t\t\tvar distance = i == 0 ? COMPASS_DEPTH : 0;\n\t\t\t\t\n\t\t\t\tcontext.moveTo( world.width / 2, ( world.height * 1.7) + 2 );\n\t\t\t\tcontext.arc( world.width / 2, ( world.height * 1.7) + distance, COMPASS_RADIUS, a - 0.2, a + 0.2, true );\n\t\t\t\tcontext.closePath();\n\t\t\t\t\n\t\t\t\tcontext.lineWidth = 4;\n\t\t\t\tcontext.strokeStyle = 'rgb(165,106,70)';\n\t\t\t\tcontext.stroke();\n\t\t\t\t\n\t\t\t\tcontext.fillStyle = 'rgba(240,150,105,0.85)';\n\t\t\t\tcontext.fill();\n\t\t\t\t\n\t\t\t\tcontext.beginPath();\n\t\t\t}\n\t\t\t\n\t\t\tcontext.restore();\n\t\t\t\n\t\t\tcompassAlpha -= 0.05;\n\t\t\t\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "a50222f81d0f75a6d6eb7822d0d829ea", "score": "0.56018907", "text": "function drawMap(){\n setMidPointAndBounds();\n for (var i =0; i<self.venues().length; i++){\n self.venues()[i].marker().setMap(null);\n }\n //drop markers on each venue and bind an event on each click on marker.\n for (var i =0; i<self.filteredVenues().length; i++){\n self.filteredVenues()[i].marker().setMap(map);\n google.maps.event.addListener(self.filteredVenues()[i].marker(), 'click', function(){\n focusOnLocationWithDetail(this);\n });\n }\n }", "title": "" }, { "docid": "ca01d144435143497c70d46680b2f5ff", "score": "0.5582605", "text": "createLines(lines) {\n let ic = this.icn3d,\n me = ic.icn3dui\n if (me.bNode) return\n\n if (lines !== undefined) {\n for (let name in lines) {\n let lineArray = lines[name]\n\n for (let i = 0, il = lineArray.length; i < il; ++i) {\n let line = lineArray[i]\n\n let p1 = line.position1\n let p2 = line.position2\n\n let dashed = line.dashed ? line.dashed : false\n let dashSize = 0.3\n\n let radius = ic.lineRadius\n\n let colorStr = '#' + line.color.replace(/\\#/g, '')\n\n let color = me.parasCls.thr(colorStr)\n\n if (!dashed) {\n if (name == 'stabilizer') {\n ic.brickCls.createBrick(p1, p2, radius, color)\n } else {\n ic.cylinderCls.createCylinder(p1, p2, radius, color)\n }\n } else {\n let distance = p1.distanceTo(p2)\n\n let nsteps = parseInt(distance / dashSize)\n let step = p2\n .clone()\n .sub(p1)\n .multiplyScalar(dashSize / distance)\n\n let start, end\n for (let j = 0; j < nsteps; ++j) {\n if (j % 2 == 1) {\n start = p1.clone().add(step.clone().multiplyScalar(j))\n end = p1.clone().add(step.clone().multiplyScalar(j + 1))\n\n if (name == 'stabilizer') {\n ic.brickCls.createBrick(start, end, radius, color)\n } else {\n ic.cylinderCls.createCylinder(start, end, radius, color)\n }\n }\n }\n }\n }\n }\n }\n\n // do not add the artificial lines to raycasting objects\n }", "title": "" }, { "docid": "57a402ea2089a9ffe82dbf2734abf32e", "score": "0.5577961", "text": "function onMouseOver(this_temp,d){\n // Lines on the map and downward arrow elements in the chart that represent the same route are related by a common id\n // Select the line on the map associated with the current id and increase its stroke width and opacity \n d3.select(\"#edge_\"+d3.select(this_temp).attr(\"id\").split(\"_\")[1])\n .transition()\n .duration(0)\n .style(\"stroke-width\",stroke_extra(d))\n .style(\"stroke-opacity\",1)\n // The visualization depicts all routes from a specified Origin airport to all available destinations. The node associated\n // with the Origin airport on the map is always enlarged with text for the airport's abbreviation. \n // Every line on the map or downward arrow element in the chart is associated with d3 data that contains a field\n // \"airport_2\" which identifies the destination airport for the current route. \n // Select the node associated with the destination airport and increase its size\n d3.select(\"#node_\"+airports_dict[d[\"airport_2\"]])\n .attr(\"class\",\"graph_over\")\n .transition()\n .duration(0)\n .style(\"r\",node_rad_extra);\n // Select the text inside the node associated with the destination airport and make it visible\n d3.select(\"#nodeText_\"+airports_dict[d[\"airport_2\"]])\n .transition()\n .duration(0)\n .style(\"visibility\",\"visible\");\n // Select the downward arrow element in the chart associated with the destination airport and increase its opacity\n d3.select(\"#bargroup_\"+airports_dict[d[\"airport_2\"]])\n .transition()\n .duration(300)\n .attr('opacity', 1)\n // Select the rectangle component, circle component, and polygon component (arrowhead) of the downward element in the chart \n // associated with the destination airport and add the class \"graph_over\" which makes the stroke color white and increases \n // the stroke width\n d3.select(\"#barrect_\"+airports_dict[d[\"airport_2\"]])\n .transition()\n .duration(300)\n .attr(\"class\",\"graph_over\")\n d3.select(\"#barcircle_\"+airports_dict[d[\"airport_2\"]])\n .transition()\n .duration(300)\n .attr(\"class\",\"graph_over\")\n d3.select(\"#barpolygon_\"+airports_dict[d[\"airport_2\"]])\n .transition()\n .duration(300)\n .attr(\"class\",\"graph_over\")\n}", "title": "" }, { "docid": "a2c1a05b34844135db68c3d55f996d57", "score": "0.5564497", "text": "function drawArrow_Wind(loc, bear, mag)\r\n{\r\n var l = 0.10*mag; // arrow length\r\n var w = 0.05*mag/2; // arrow width\r\n var c = 0.10*mag; // arrow center\r\n var tip = loc.destinationPoint(bear , c);\r\n var right = tip.destinationPoint(bear + 135, w);\r\n var left = tip.destinationPoint(bear - 135, w);\r\n var back = tip.destinationPoint(bear + 180, l);\r\n\r\n var arrow = new Array();\r\n arrow.push(new google.maps.LatLng(right.lat(), right.lon()));\r\n arrow.push(new google.maps.LatLng(tip.lat() , tip.lon()) );\r\n arrow.push(new google.maps.LatLng(back.lat() , back.lon()) );\r\n arrow.push(new google.maps.LatLng(tip.lat() , tip.lon()) );\r\n arrow.push(new google.maps.LatLng(left.lat() , left.lon()) );\r\n\r\n var flightPath = new google.maps.Polyline({\r\n path: arrow,\r\n strokeColor: colourArrowWind,\r\n strokeOpacity: 0.8,\r\n strokeWeight: 1\r\n });\r\n flightPath.setMap(map);\r\n markers.push(flightPath);\r\n}", "title": "" }, { "docid": "f5d52d656cbb1c1131ab6b07aef73716", "score": "0.55636877", "text": "function setMapOnAllAirports(map) {\n for (var i = 0; i < airports.length; i++) {\n airports[i].setMap(map);\n }\n}", "title": "" }, { "docid": "b53409068d50d920d7c9fe8b896eaf28", "score": "0.55611557", "text": "drawLines1() {\n anime({\n targets: '#path1',\n strokeDashoffset: [anime.setDashoffset, 0],\n easing: 'cubicBezier(.5, .05, .1, .3)',\n duration: 1800,\n delay: function (el, i) { return i * 250 },\n endDelay: 400,\n loop: true,\n direction: 'alternate',\n\n });\n }", "title": "" }, { "docid": "3e49f1947a246323ab78e99fc3035008", "score": "0.5559533", "text": "function drawMap() {\n var rms = mapdata.rooms;\n var canvas = $('canvas#map')[0];\n var c = canvas.getContext(\"2d\");\n\n // clear background\n c.fillStyle = MAP_BG;\n c.fillRect(0, 0, VIEW_W, VIEW_H);\n\n // draw path / exits\n c.strokeStyle = MAP_COLOR;\n c.lineWidth = 2;\n for(var addr in rms) {\n var r = rms[addr];\n if(drawMarkedOnly && (!r.v)) continue;\n\n var p = mapXYToView(r);\n if(p.x<0 || p.x>VIEW_W || p.y<0 || p.y>VIEW_H) continue;\n\n c.beginPath();\n for(var k in r.exits) {\n var exit = r.exits[k];\n //console.log(exit);\n c.moveTo(p.x, p.y);\n var rm = rms[exit];\n if(rm) {\n var p2 = mapXYToView(rm);\n c.lineTo(p2.x, p2.y);\n\n } else {\n var xy = DIR_XY[k];\n //console.log(exit, xy);\n if(xy) {\n var x2 = p.x + xy[0] * ROOM_RANGE;\n var y2 = p.y - xy[1] * ROOM_RANGE;\n c.lineTo(x2, y2);\n }\n }\n }\n c.stroke();\n }\n\n c.fillStyle = MAP_COLOR;\n for(var addr in rms) {\n var r = rms[addr];\n if(drawMarkedOnly && (!r.v)) continue;\n\n var x = x0 + (r.x - curX) * ROOM_RANGE;\n var y = y0 - (r.y - curY) * ROOM_RANGE;\n if(x<0 || x>VIEW_W || y<0 || y>VIEW_H) continue;\n\n // draw room\n var addr = mapFindAddrByXY(r.x, r.y);\n c.fillRect(x-ROOM_SIZE/2, y-ROOM_SIZE/2, ROOM_SIZE, ROOM_SIZE);\n if(!Array.isArray(addr)) {\n c.save();\n c.fillStyle = MAP_BG;\n c.fillRect(x-(ROOM_SIZE/2-2), y-(ROOM_SIZE/2-2), ROOM_SIZE-4, ROOM_SIZE-4);\n c.restore();\n }\n }\n\n c.textBaseline = 'top';\n c.font = 'normal lighter 16px SimSun';\n c.lineWidth = 0.5;\n c.strokeStyle = DM_COLOR;\n\n // draw domain rect\n if(drawDomain) {\n var domains = mapdata.domains;\n for(var d in domains) {\n var dm = domains[d];\n if(drawMarkedOnly && (!dm.v)) continue;\n\n var p = mapXYToView({x:(dm.left-1), y:(dm.top+1)});\n var p2 = mapXYToView({x:(dm.right+1), y:(dm.bottom-1)});\n\n c.save();\n if(curDomain === d) {\n c.strokeStyle = SEL_COLOR;\n c.lineWidth = 1;\n } else {\n c.strokeStyle = DM_COLOR;\n c.lineWidth = 0.5;\n }\n c.strokeRect(p.x, p.y-10, (p2.x-p.x), (p2.y-p.y)+10);\n c.restore();\n\n c.strokeText(d, p.x +5, p.y-10 +3);\n }\n }\n\n // draw player pos\n if(curAddr) {\n var r = mapGetRoomByAddr(curAddr);\n if(r) {\n var p = mapXYToView(r);\n c.fillStyle = ME_COLOR;\n c.fillRect(p.x-ME_SIZE/2, p.y-ME_SIZE/2, ME_SIZE, ME_SIZE);\n }\n }\n}", "title": "" }, { "docid": "3bd1e92bbbe5d8698b58b16a37c83831", "score": "0.5555823", "text": "function drawAPath()\n{\n\tcontext.beginPath();\n\tcontext.moveTo(ballLeft,0);\n\tfor(var i =0;i<context.canvas.height;i+=lineStepX)\n\t{\n\t\tcontext.lineTo(ballLeft+BallAvelocityX*i,0.5*GRAVITY*i*i);\n\t}\n\tcontext.stroke();\n}", "title": "" }, { "docid": "1dd9383d85ad234f5f88a568308d1b24", "score": "0.55555695", "text": "function Linea(_x1, _y1, _x2, _y2, _x3, _y3, _x4, _y4) {\n this.x1 = _x1;\n this.y1 = _y1;\n this.x2 = _x2;\n this.y2 = _y2;\n this.x3 = _x3;\n this.y3 = _y3;\n this.x4 = _x4;\n this.y4 = _y4;\n this.color = (0,0,0);\n\n this.display = function() {\n noFill();\n strokeWeight(10);\n stroke(this.color);\n bezier(this.x1, this.y1, this.x2, this.y2, this.x3, this.y3, this.x4, this.y4);\n }\n}", "title": "" }, { "docid": "3187df833682a54572b779ea042461d1", "score": "0.55532235", "text": "function displayRoute (aPoint, aHighlight){\n for (var i=0, len = aHighlight.length; i < len; i++){\n if (!aHighlight[i]) {\n aLayers.addLayer(new L.marker([aPoint[i].lat,aPoint[i].lng],{icon: yellowWaypoint}));\n }\n if (i > 0){\n aLayers.addLayer(L.polyline([[aPoint[i].lat,aPoint[i].lng], [aPoint[i-1].lat,aPoint[i-1].lng]],{color: sColor, weight: 3, dashArray: '20,15',smoothFactor: 1}));\n }\n }\n aLayers.addTo(map);\n}", "title": "" }, { "docid": "b3f0a05825c67451d95dbfc7d7ae21a7", "score": "0.5550818", "text": "function _drawLine() {\n // Remove any previous lines\n _clearOverlays();\n\n // Call empty draw function\n plugin.onDraw();\n\n // Draw the line/polygon\n if (points[0] == points[points.length-1] && points.length > 2) {\n // The trace has been completed, so display a polygon\n trace = new google.maps.Polygon({\n path: points,\n strokeColor: plugin.options.strokeColor,\n fillColor: plugin.options.fillColor,\n fillOpacity: plugin.options.fillOpacity,\n strokeWeight: plugin.options.strokeWeight,\n clickable: false // This needs to be false, otherwise the line\n // consumes the 'mouseup' event if the mouse is\n // over the line when the mouse button is released\n });\n\n // Call the complete function\n plugin.onComplete();\n } else {\n // The trace hasn't been completed yet, so display a line\n trace = new google.maps.Polyline({\n path: points,\n strokeColor: plugin.options.strokeColor,\n strokeWeight: plugin.options.strokeWeight,\n clickable: false // This needs to be false, otherwise the line\n // consumes the 'mouseup' event if the mouse is\n // over the line when the mouse button is released\n });\n }\n\n plugin.addMarker(trace);\n trace.setMap(plugin.getMap());\n }", "title": "" }, { "docid": "94a32b21df6f5e9abd94e141b471e425", "score": "0.55500394", "text": "function displayShape (points) {\r\n lineLocations = [];\r\n // Convert all the xy coords into google maps lat,lng coords\r\n for (i = 0; i < (points.length) / 2; i++) {\r\n lineLocations.push({lat: parseFloat(points[i * 2]), lng: parseFloat(points[i * 2 + 1])});\r\n }\r\n // Save it globablly so we can clear it later\r\n routeLine = new google.maps.Polyline({\r\n path: lineLocations,\r\n geodesic: true,\r\n strokeColor: \"#F00\",\r\n strokeOpacity: 1.0,\r\n strokeWeight: 2\r\n });\r\n // Add the line to the map\r\n routeLine.setMap(map);\r\n}", "title": "" }, { "docid": "bf746d333c74ed1f5bb14be23427154d", "score": "0.5545138", "text": "function jump11(map) {\n var lineSymbol = {\n path: 'M 0,-1 0,1',\n strokeOpacity: 0.5,\n scale: 4\n };\n\n var line = new google.maps.Polyline({\n path: [],\n geodesic: true,\n strokeColor: '#f45898',\n strokeOpacity: 0,\n strokeWeight: 5,\n editable: false,\n icons: [{\n icon: lineSymbol,\n offset: '0',\n repeat: '20px'\n }],\n map:map\n });\n\n var locations = [{lat: 41.686263, lng: -73.895526}, // Dorm\n {lat: 40.841621, lng: -73.937237} // Washington Heights\n ];\n\n for (var i = 0; i < locations.length; i++) {\n setTimeout(function(coords) {\n latlng = new google.maps.LatLng(coords.lat, coords.lng);\n// map.panTo(latlng);\n line.getPath().push(latlng);\n }, 100 * i, locations[i]);\n }\n}", "title": "" }, { "docid": "23b93006e7004a23574a13e266d71c7c", "score": "0.55429006", "text": "function drawFieldLines() {\n\n // draw the two goals\n stroke(0);\n fill(169, 169, 169);\n rect(0, (height / 2) - 105 / 4, 20, 105 / 2);\n rect(width - 20, (height / 2) - 105 / 4, 20, 105 / 2)\n\n // all lines are white except goals\n stroke(255, 255, 255);\n // none of the shapes, used to draw lines, need fills\n noFill();\n\n // draw the out-of-bounds line.\n rect(20, 20, 560, 360);\n\n // draw midfield line\n line(300, 20, 300, 380);\n\n // draw a circle at midfield\n ellipse(300, 200, 100, 100);\n\n // draw the kickoff marker, solid circle\n fill(255, 255, 255);\n ellipse(300, 200, 3, 3);\n noFill();\n\n // draw the two penalty boxes\n rect(20, (height / 2) - 220 / 2, 94, 220);\n rect(width - 20 - 94, (height / 2) - 220 / 2, 94, 220);\n\n // draw the two goal areas\n rect(20, (height / 2) - 105 / 2, 32, 105);\n rect(width - 20 - 32, (height / 2) - 105 / 2, 32, 105);\n\n // draw the two penalty spots\n fill(255, 255, 255);\n ellipse(20 + 62, height / 2, 3, 3);\n ellipse(width - 20 - 62, height / 2, 3, 3);\n noFill();\n\n // draw the two penalty arcs\n arc(20 + 62, 200, 100, 100, -.88, .88);\n arc(width - 20 - 62, 200, 100, 100, PI - 0.88, PI + 0.88);\n\n // draw the four corner-kick arcs\n arc(20, 20, 15, 15, 0, PI / 2);\n arc(20, height - 20, 15, 15, 1.5 * PI, 0);\n arc(width - 20, 20, 15, 15, PI / 2, PI);\n arc(width - 20, height - 20, 15, 15, PI, 1.5 * PI);\n}", "title": "" }, { "docid": "50cdf2e6f5b47a3c0ef0b6192948474f", "score": "0.55373895", "text": "function drawAll(){\n lines.forEach((line) => line.draw());\n}", "title": "" }, { "docid": "766d307916d2ce0063167f7ca6a026cf", "score": "0.55239654", "text": "function addPolyligne(listMarkers) {\n var flightPlanCoordinates = []\n for (let marker of listMarkers) {\n flightPlanCoordinates.push(marker.coords)\n }\n // remove old flight path from map\n if (flightPath){\n flightPath.setMap(null);\n }\n // define new flight path\n flightPath = new google.maps.Polyline({\n path: flightPlanCoordinates,\n geodesic: true,\n strokeColor: '#809650',\n strokeOpacity: 1.0,\n strokeWeight: 2\n });\n // add new flight path to map\n flightPath.setMap(map);\n}", "title": "" }, { "docid": "44cd764736c516fb4e1d338a1bb9d2e2", "score": "0.5523943", "text": "function makeThemLinesMove(allTravelInformation, journeyNumber) {\n console.log(\"allTravelInformation\", allTravelInformation);\n console.log(\"journeyNumber\", journeyNumber);\n //hide all coloured line to begin with\n for (var h = 0; h < hiddenPaths.length; h++) {\n hiddenPaths[h].classList.add('hide');\n }\n //Find current information to be passed to first function.\n var currentJourney = allTravelInformation[\"journey\" + journeyNumber];\n\n\n //Retrives results from the set of functions and animates the returned lines.\n var allMatchingLines = findMatchingTrainLines(currentJourney);\n\n for (var i = 0; i < allMatchingLines.length; i++) {\n var animateLine = allMatchingLines[i].path[0];\n animateLine.classList.remove('hide');\n var offset = anime.setDashoffset(animateLine);\n animateLine.setAttribute('stroke-dashoffset', offset);\n anime({\n targets: animateLine,\n strokeDashoffset: [offset, 0],\n duration: anime.random(3000, 5000),\n delay: anime.random(0, 1000),\n loop: false,\n direction: 'alternate',\n easing: 'easeInOutSine',\n autoplay: true\n });\n }\n}", "title": "" }, { "docid": "96ba8d92fbe0cdadcb80b02f29c8ba62", "score": "0.5518695", "text": "function init(){\n map = new google.maps.Map(document.getElementById(\"mbta_map\"), options);\n initZoom(map);\n minSta = compareDistance();\n myLocationMarker(map);\n\n // Markers from MBTA lines other than Red Line were commented out because some were overlapping Red Line markers, making the Red Line marker infowindows non-functional\n //markers(map, orangeStations, orangeStationNames);\n //markers(map, blueStations, blueStationNames);\n //markers(map, purpleStations, purpleStationNames);\n //markers(map, comRailStations, comRailStationNames);\n\n markers(map, redStations, redStationNames);\n redLineSched(map);\n purplePolyline(map);\n comRailPolyline(map);\n orangePolyline(map);\n bluePolyline(map);\n redPolyline(map);\n closestRedPolyline(map);\n}", "title": "" }, { "docid": "ee623c3134710b44296ea10094f9b03a", "score": "0.55118996", "text": "function initMap(loc) {\n var station = stations[closestStation];\n\n //Set the lats and lngs for the markers\n sLat = station[0];\n sLng = station[1];\n aLat = loc.geometry.location.lat();\n aLng = loc.geometry.location.lng();\n\n //Set the path variable for the line between station and dispatch\n var path = [\n {lat: sLat, lng: sLng},\n {lat: aLat, lng: aLng},\n ]\n\n var map = new google.maps.Map(document.getElementById('marker_map'), {\n center: {lat: aLat, lng: aLng},\n zoom: 12\n });\n\n var address_marker = new google.maps.Marker({\n position: {lat: aLat, lng: aLng},\n map: map,\n icon: 'http://maps.google.com/mapfiles/ms/icons/green-dot.png'\n });\n\n var station_marker = new google.maps.Marker({\n position: {lat: sLat, lng: sLng},\n map: map,\n icon: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png'\n });\n \n var line = new google.maps.Polyline({\n path: path,\n geodesic: true,\n strokeColor: '#FF0000',\n strokeOpacity: 1.0,\n strokeWeight: 2\n }).setMap(map);\n\n}", "title": "" }, { "docid": "54c47e3f1b30e915e1c6b56cb4982c6b", "score": "0.55112994", "text": "function addLine(){\n if(currentIndexSeg > -1 && currentIndexSeg < map.Segments.length && map.Segments[currentIndexSeg].Paths[0].Type === 'refLine'){\n var temp = jQuery.extend(true, {} , map.Segments[currentIndexSeg].Paths[0]);\n var len = temp.Points.length;\n var rank = parseInt(document.getElementById('newNum').value);\n var width = parseFloat(document.getElementById('newWidth').value);\n var realWidth = rank * width;\n var len = temp.Points.length;\n if(len > 1){//6\n var pathLane = new TrunkPath('lane');\n var x = temp.Points[0].X * 2 - temp.Points[1].X;\n var y = temp.Points[0].Y * 2 - temp.Points[1].Y;\n var ppp = generatePoint(x,y,temp.Points[1].X,temp.Points[1].Y,realWidth);\n ppp.X += temp.Points[0].X;\n ppp.Y += temp.Points[0].Y;\n pathLane.Points.push(ppp);\n for (var j=1; j< len - 1; j++){//5\n var pp = generatePoint(temp.Points[j-1].X,temp.Points[j-1].Y,temp.Points[j + 1].X,temp.Points[j + 1].Y,realWidth);\n pp.X += temp.Points[j].X;\n pp.Y += temp.Points[j].Y;\n pathLane.Points.push(pp);\n }//5p\n x= temp.Points[len - 1].X * 2 - temp.Points[len - 2].X;\n y = temp.Points[len - 1].Y * 2 - temp.Points[len - 2].Y;\n var pppp = generatePoint(temp.Points[len - 2].X,temp.Points[len - 2].Y,x,y,realWidth);\n pppp.X += temp.Points[len - 1].X;\n pppp.Y += temp.Points[len - 1].Y;\n pathLane.Points.push(pppp);\n map.Segments[currentIndexSeg].Paths.push(pathLane);\n }//6\n }\n}", "title": "" }, { "docid": "ea7303727e05b53851cc10fee0d89f97", "score": "0.5509717", "text": "function drawWalk(start, end) {\r\n\r\n var directionsService = new google.maps.DirectionsService();\r\n\r\n var request = {\r\n origin: start,\r\n destination: end,\r\n travelMode: google.maps.TravelMode.DRIVING\r\n };\r\n\r\n directionsService.route(request, function (result, status) {\r\n if (status == google.maps.DirectionsStatus.OK) {\r\n\r\n var path = [start];\r\n for (var i = 0; i < result.routes[0].overview_path.length; i++) {\r\n path.push(result.routes[0].overview_path[i]);\r\n }\r\n\r\n\r\n var path = new google.maps.Polyline({\r\n path: path,\r\n geodesic: true,\r\n strokeColor: \"#871987\",\r\n strokeOpacity: 0.3,\r\n icons: [{\r\n icon: {\r\n path: 'M 0,-0.5 0, 0.5',\r\n strokeWeight: 5,\r\n strokeOpacity: 1,\r\n scale: 1\r\n },\r\n offset: '100%',\r\n repeat: '20px'\r\n }]\r\n });\r\n path.setMap(map);\r\n paths.push(path);\r\n }\r\n });\r\n\r\n}", "title": "" }, { "docid": "97635e7433dec3608981a001156f9f9f", "score": "0.5506869", "text": "function drawRoute(routeCoordinates) {\n let bounds = new google.maps.LatLngBounds();\n for (i = 0; i < routeCoordinates.length; i++) {\n bounds.extend(routeCoordinates[i]);\n }\n map.fitBounds(bounds);\n let routeLine = new google.maps.Polyline({\n path: routeCoordinates,\n geodesic: true,\n strokeColor: '#FF0000',\n strokeOpacity: 1.0,\n strokeWeight: 2\n });\n routeLine.setMap(map);\n let routeId = document.getElementById(\"bus-line-input\").value;\n route = {\n routeId: routeId,\n routeLine: routeLine\n };\n routeShown = true;\n}", "title": "" }, { "docid": "e5781bbcdc81e2e7298fb929b23617d7", "score": "0.55031174", "text": "function drawMap(map){\n\n for (var i = 0; i<map.length; i++){\n for (var j = 0; j<map[i].length; j++){\n switch(map[i][j]){\n\n /*case 1: \n ctx.fillStyle = \"#000000\" ; \n ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+mapOffset.y, tile_size,tile_size);\n break;\n\n case 2: \n ctx.fillStyle = \"#000000\" ; \n ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+(tile_size/2)+mapOffset.y, tile_size,tile_size/2);\n break;*/\n\n case 3: \n ctx.fillStyle = \"#e6350e\" ; \n ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+mapOffset.y, tile_size,tile_size/2+10);\n ctx.fillStyle = \"#000000\" ; \n //ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+(tile_size/2)+mapOffset.y, tile_size,tile_size/2);\n break;\n\n case 4: \n ctx.fillStyle = \"#22bce3\" ; \n ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+mapOffset.y, tile_size,tile_size/2+10);\n ctx.fillStyle = \"#000000\" ; \n //ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+(tile_size/2)+mapOffset.y, tile_size,tile_size/2);\n break;\n }\n }\n }\n\n\n // SHOWS GRIDLINES ///////////////////////////\n /*\n for (var i = 0; i<map.length; i++){ \n\n ctx.fillStyle = \"#ababab\" ; \n ctx.fillRect(0+mapOffset.x, i*tile_size+mapOffset.y, 1280, 1); \n }\n\n for (var j = 0; j<map[0].length; j++){\n \n ctx.fillRect(j*tile_size+mapOffset.x,0+mapOffset.y,1,720);\n \n }*/\n\n}", "title": "" }, { "docid": "cc53cd7639f478615d2b612e0e1ccb20", "score": "0.5494721", "text": "function aladin_marker_draw(draw_function, source, context, view_params) {\n\n context.strokeStyle = \"#FF3333\";\n context.lineWidth = 3;\n context.fillStyle = \"rgba(255, 204, 255, 0.4)\"\n\n draw_function(context, [source.x, source.y], 10);\n }", "title": "" }, { "docid": "b5ba7e4d884faff05f83cccae39cec58", "score": "0.54934156", "text": "function drawLine(lineMap, pos) {\n switch (lineMap) {\n case 0:\n line(pos.x, pos.y, pos.x + size, pos.y);\n break;\n case 1:\n line(pos.x, pos.y, pos.x, pos.y + size);\n break;\n case 2:\n line(pos.x + size, pos.y, pos.x + size, pos.y + size);\n break;\n case 3:\n line(pos.x, pos.y + size, pos.x + size, pos.y + size);\n break;\n case 4:\n line(pos.x, pos.y + size, pos.x, pos.y + 2 * size);\n break;\n case 5:\n line(pos.x + size, pos.y + size, pos.x + size, pos.y + 2 * size);\n break;\n case 6:\n line(pos.x, pos.y + size * 2, pos.x + size, pos.y + 2 * size);\n break;\n default:\n console.log(\"line map is invalid\");\n break;\n }\n }", "title": "" }, { "docid": "3da1b9334ae5ae2e1ba3c2c1e1f0145d", "score": "0.5491298", "text": "function drawMountains()\n{\n for(var i = 0; i < mountains.length; i++)\n {\n //front mountains\n fill(120,120,120);\n triangle(mountains[i].x_pos + 160, \n floorPos_y, \n mountains[i].x_pos + 450, \n floorPos_y, \n mountains[i].x_pos + 320, \n mountains[i].y_pos + 50);\n \n triangle(mountains[i].x_pos + 60,\n floorPos_y , \n mountains[i].x_pos + 380, \n floorPos_y, mountains[i].x_pos + 235, \n mountains[i].y_pos);\n \n //back mountain\n fill(100,100,100);\n triangle(mountains[i].x_pos + 310, \n floorPos_y, \n mountains[i].x_pos + 380,\n floorPos_y, \n mountains[i].x_pos + 235,\n mountains[i].y_pos);\n } \n}", "title": "" }, { "docid": "d111a956bfff2cfb34160524091e2d1e", "score": "0.54889405", "text": "function drawPolyline() {\n if (polyline) {\n polyline.setMap(null);\n polyline = null;\n }\n\n polyline = new google.maps.Polyline({\n strokeColor: '#FFB000',\n strokeOpacity: 1.0,\n strokeWeight: 5\n });\n polyline.setMap(map);\n\n var path = [];\n\n for (var i = 0; i < scope.markers.length; i++) {\n path.push(scope.markers[i].position);\n }\n polyline.setPath(path);\n }", "title": "" }, { "docid": "718bec9ddba557795c145b91c12ba2a9", "score": "0.5486158", "text": "drawMapResources() {\r\n\t\tfor (const resource of this._resources) {\r\n\t\t\tthis._offScreenCanvas.canvas.beginPath();\r\n\t\t\tthis._offScreenCanvas.canvas.arc(resource.x, resource.y, resource.w, 0, 2 * Math.PI, false);\r\n\t\t\t\r\n\t\t\tswitch (resource.type) {\r\n\t\t\t\tcase RESOURCE_WATER: this._offScreenCanvas.canvas.fillStyle = 'blue'; break;\r\n\t\t\t\tcase RESOURCE_FOOD: this._offScreenCanvas.canvas.fillStyle = 'lime'; break;\r\n\t\t\t}\t\t\t\r\n\t\t\tthis._offScreenCanvas.canvas.fill();\r\n\t\t\tthis._offScreenCanvas.canvas.lineWidth = this.canvasWidth * 0.001;\r\n\t\t\tthis._offScreenCanvas.canvas.strokeStyle = '#404040';\r\n\t\t\tthis._offScreenCanvas.canvas.stroke();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3758c48a418c082f2dc3f860fdd6fcc2", "score": "0.54772395", "text": "function drawLine(lineMap, pos) {\n switch (lineMap) {\n case 0:\n g.line(pos.x, pos.y, pos.x + size, pos.y);\n break;\n case 1:\n g.line(pos.x, pos.y, pos.x, pos.y + size);\n break;\n case 2:\n g.line(pos.x + size, pos.y, pos.x + size, pos.y + size);\n break;\n case 3:\n g.line(pos.x, pos.y + size, pos.x + size, pos.y + size);\n break;\n case 4:\n g.line(pos.x, pos.y + size, pos.x, pos.y + 2 * size);\n break;\n case 5:\n g.line(pos.x + size, pos.y + size, pos.x + size, pos.y + 2 * size);\n break;\n case 6:\n g.line(pos.x, pos.y + size * 2, pos.x + size, pos.y + 2 * size);\n break;\n default:\n console.log(\"line map is invalid\");\n break;\n }\n }", "title": "" }, { "docid": "49deeee1bbbd745fe9f8d2ad89e3d60e", "score": "0.5475931", "text": "function drawLine(a,b,c,d,e,f,g,h){\r\n points.push(a,b);\r\n points.push(b,c);\r\n points.push(c,d);\r\n points.push(d,e);\r\n points.push(e,f);\r\n points.push(f,g);\r\n points.push(g,h);\r\n}", "title": "" }, { "docid": "7743de0fbb94cbf2b63d445687c0816c", "score": "0.5473907", "text": "function initMap() {\n //console.log(\"initMap got called\");\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 37.343111, lng: -122.042324},\n zoom: 11\n });\n infoWindow = new google.maps.InfoWindow();\n infoWindowWaypoints = new google.maps.InfoWindow();\n drawFlightPath(map);\n loadWaypoints();\n } //function initMap", "title": "" }, { "docid": "bb97335c78f182c5de5239e5a79a1575", "score": "0.5466615", "text": "function draw_active(map, lng, lat) {\n var temp_coordinates = [...coordinates];\n temp_coordinates.push([lng, lat]);\n map.getSource('route').setData({\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': temp_coordinates\n }\n });\n}", "title": "" }, { "docid": "5c2da2287d130d46b973ee83e3f7ded7", "score": "0.54658115", "text": "function drawMap() {\n\tvar mapWidth, mapHeight, mapRatio, margin, x, y, mapAreaRatioX, mapAreaRatioY,\n\t\t\tviewWidth, viewHeight, viewOffsetX, viewOffsetY, viewLineLength,\n\t\t\tlocalPlayerX, localPlayerY, remotePlayerX, remotePlayerY, i;\n\t\n\t// The ratio of game area dimensions\n\tmapRatio = area.width / area.height;\n\t\n\t// Set map dimensions depending on canvas dimensions\n\tif (canvas.width > canvas.height) {\n\t\tmapHeight = canvas.height * 0.35;\n\t\tmapWidth = mapHeight * mapRatio;\n\t\tmargin = canvas.height * 0.05;\n\t} else {\n\t\tmapWidth = canvas.width * 0.35;\n\t\tmapHeight = mapWidth / mapRatio;\n\t\tmargin = canvas.width * 0.05;\n\t}\n\t\n\t// Ratio between map and area\n\tmapAreaRatioX = mapWidth / area.width;\n\tmapAreaRatioY = mapHeight / area.height;\t\n\t\n\t// Set dimensions and offsets for the current view\n\tviewWidth = canvas.width * mapAreaRatioX;\n\tviewHeight = canvas.height * mapAreaRatioY;\n\tviewOffsetX = canvas.offset.x * mapAreaRatioX;\n\tviewOffsetY = canvas.offset.y * mapAreaRatioY;\n\tviewLineLength = Math.min(viewWidth, viewHeight)*0.25;\n\t\n\t// Set dimensions for local player position indicator\n\tlocalPlayerX = localPlayer.position.x * mapAreaRatioX;\n\tlocalPlayerY = localPlayer.position.y * mapAreaRatioY;\n\t\n\t// Set the coordinates for where to start drawing the map\n\tx = canvas.width - margin - mapWidth;\n\ty = canvas.height - margin - mapHeight;\n\t\n\t// Draw the map\n\tctx.save();\n\tctx.translate(x, y);\n\t// Map border and fill\n\tctx.fillStyle = \"rgba(0, 0, 0, 0.2)\";\n\tctx.fillRect(0, 0, mapWidth, mapHeight);\n\tctx.strokeStyle = \"rgba(255, 255, 255, 0.8)\";\n\tctx.strokeRect(0, 0, mapWidth, mapHeight);\n\t// Map grid\n\tctx.beginPath();\n\tctx.strokeStyle = \"rgba(255, 255, 255, 0.2)\";\n\tfor (i = 1; i < 8; i++) { // Vertical lines\n\t\tctx.moveTo(i * mapWidth / 8, 0);\n\t\tctx.lineTo(i * mapWidth / 8, mapHeight);\n\t}\n\tfor (i = 1; i < 6; i++) { // Horizontal lines\n\t\tctx.moveTo(0, i * mapHeight / 6);\n\t\tctx.lineTo(mapWidth, i * mapHeight / 6);\n\t}\n\tctx.closePath();\n\tctx.stroke();\n\t// Map view\n\tctx.strokeStyle = \"hsla(90, 100%, 50%, 0.8)\";\n\tctx.beginPath();\n\t// Top left\n\tctx.moveTo(viewOffsetX, viewOffsetY);\n\tctx.lineTo(viewOffsetX + viewLineLength, viewOffsetY);\n\tctx.moveTo(viewOffsetX, viewOffsetY);\n\tctx.lineTo(viewOffsetX, viewOffsetY + viewLineLength);\n\t// Bottom left\n\tctx.moveTo(viewOffsetX, viewOffsetY + viewHeight);\n\tctx.lineTo(viewOffsetX + viewLineLength, viewOffsetY + viewHeight);\n\tctx.moveTo(viewOffsetX, viewOffsetY + viewHeight);\n\tctx.lineTo(viewOffsetX, viewOffsetY + viewHeight - viewLineLength);\n\t// Top right\n\tctx.moveTo(viewOffsetX + viewWidth, viewOffsetY);\n\tctx.lineTo(viewOffsetX + viewWidth - viewLineLength, viewOffsetY);\n\tctx.moveTo(viewOffsetX + viewWidth, viewOffsetY);\n\tctx.lineTo(viewOffsetX + viewWidth, viewOffsetY + viewLineLength);\n\t// Bottom right\n\tctx.moveTo(viewOffsetX + viewWidth, viewOffsetY + viewHeight);\n\tctx.lineTo(viewOffsetX + viewWidth - viewLineLength, viewOffsetY + viewHeight);\n\tctx.moveTo(viewOffsetX + viewWidth, viewOffsetY + viewHeight);\n\tctx.lineTo(viewOffsetX + viewWidth, viewOffsetY + viewHeight - viewLineLength);\n\tctx.closePath();\n\tctx.stroke();\n\t// Local player position indicator\n\tctx.fillStyle = \"hsla(90, 100%, 50%, 0.8)\";\n\tctx.beginPath();\n\tctx.arc(localPlayerX, localPlayerY, 2, 0, Math.PI*2, true);\n\tctx.closePath();\n\tctx.fill();\n\tctx.strokeStyle = \"hsla(90, 100%, 50%, 0.2)\";\n\tctx.beginPath();\n\tctx.arc(localPlayerX, localPlayerY, 8, 0, Math.PI*2, true);\n\tctx.closePath();\n\tctx.stroke();\n\t// Remote player position indicators\n\tctx.fillStyle = \"hsla(0, 100%, 50%, 0.8)\";\n\tfor (i = 0; i < remotePlayers.length; i++) {\n\t\tctx.beginPath();\n\t\tremotePlayerX = remotePlayers[i].position.x * mapAreaRatioX;\n\t\tremotePlayerY = remotePlayers[i].position.y * mapAreaRatioY;\n\t\tctx.arc(remotePlayerX, remotePlayerY, 2, 0, Math.PI*2, true);\n\t\tctx.closePath();\n\t\tctx.fill();\n\t}\n\tctx.restore();\n}", "title": "" }, { "docid": "dda5c71db01dd5b84480b90724f2a582", "score": "0.54581666", "text": "function draw(response, key) {\n\t//random color\n\tvar r = lerp(0, 255, Math.random());\n\tvar b = lerp(0, 255, Math.random());\n\tvar g = lerp(0, 255, Math.random());\n\tvar color = \"#\" + (\"00\" + r.toString(16)).slice(-2) +\n\t\t(\"00\" + g.toString(16)).slice(-2) +\n\t\t(\"00\" + b.toString(16)).slice(-2);\n\tvar lineSymbol = {\n\t\tpath: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,\n\t\tfillColor: 'black',\n\t\tscale: 2,\n\t\tstrokeWeight: 2,\n\t\tstrokeColor: 'black'\n\t};\n\tconsole.log(color);\n\tpath = new google.maps.Polyline({\n\t\tpath: [],\n\t\tstrokeColor: color,\n\t\tstrokeOpacity: 1.0,\n\t\tstrokeWeight: 1,\n\t\ticons: [{\n\t\t\ticon: lineSymbol,\n\t\t\toffset: '100%',\n\t\t}],\n\t\tmap: map\n\t});\n\t//gets route from directions api\n\tfor (var i = 0; i < response['routes'].length; ++i) {\n\t\tvar leg = response['routes'][i]['legs'];\n\t\tfor (var j = 0; j < leg.length; ++j) {\n\t\t\tvar steps = leg[j]['steps'];\n\t\t\tfor (var k = 0; k < steps.length; ++k) {\n\t\t\t\tpoints = steps[k]['path'];\n\t\t\t\tfor (var l = 0; l < points.length; ++l) {\n\t\t\t\t\tpath.getPath().push(new google.maps.LatLng(points[l].lat(), points[l].lng()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tvar ori = response.request.origin.location;\n\tvar dest = response.request.destination.location;\n\tvar start = new google.maps.Marker({\n\t\tposition: new google.maps.LatLng(ori.lat(), ori.lng()),\n\t\tmap: map\n\t});\n\tvar end = new google.maps.Marker({\n\t\tposition: new google.maps.LatLng(dest.lat(), dest.lng()),\n\t});\n\tpaths[key] = { 'polyline': path, 'start': start , 'end': end};\n}", "title": "" }, { "docid": "5dcb6561a88b18ab3623252235f8c13c", "score": "0.5456472", "text": "function showLines(currentPoint, pointNum){\n var i, f;\n var image, image_anchor;//pictures for markers\n var point; //the point1 or point2 value for marker\n var index; //index of currentPoint\n var lineSymbol, linePath;\n\n if (pointNum == 3) return;\n if (pointNum == 1) {\n\t$(\"#point\").val('1');\n\t} else {\n\t$(\"#point\").val('2');\n\t}\n\n //choose color for markers and show them on the map\n for (i=0; i< markers.length; i++){\n\tif (!markers[i].getVisible()) continue;\n\tif (pointNum == 1) {\n\timage = setColor(parseFloat(resultArr[i].rtt1_value), rtt1Intervals, img);\n\t} else {\n\timage = setColor(parseFloat(resultArr[i].rtt2_value), rtt2Intervals, img);\n\t}\n\n\tif (resultArr[i].unicast_value == 0) {\t\t\n\timage = img[3];\n\t}else {\n\t\tif ((pointNum == 1) && ((timestamp-resultArr[i].lastclock1) > 3900)){\n\t\timage = img[4];\n\t\t}\n\t\tif ((pointNum == 2) && ((timestamp-resultArr[i].lastclock2) > 3900)){\n\t\timage = img[4];\n\t\t}\n\t}\n\n\timage_anchor = {\n \t\turl: image,\n \t\tsize: new google.maps.Size(10, 10),\n \t\torigin: new google.maps.Point(0,0),\n \t\tanchor: new google.maps.Point(5, 5)\n \t\t};\n\n\tmarkers[i].icon = image_anchor;\n\tmarkers[i].setVisible(true);\n\tmarkerLabels[i].hide();\n }\t\n\n eraseLines();\n\n //find the node index\n index = findNode(currentPoint); \n\n if(pointNum == 2) {\n\t//hide nodes with zero markers\n \tfor (i = 0; i < points.length ; i++) { \n\t\tnodes[i].flag_rtt = 2;\n\t\tif (pointsNum[i].point2 == 0) \t{\n\t\tnodes[i].setVisible(false);\n\t\tnodeLabels[i].hide();\n\t\t}\n\t}\n } else {\n\tfor (i = 0; i < points.length ; i++) { \n\tnodes[i].icon = \"images/node_marker_grey.png\";\n\tnodes[i].flag_rtt = 1;\n\tnodes[i].setVisible(true);\n\tnodeLabels[i].show();\n \t}\n }\n\n //show markers for currentPoint and draw lines for them\n for (i=0; i< markers.length; i++){\n\tif (!markers[i].getVisible()) continue;\n\tif (pointNum == 1) {\n\tpoint = resultArr[i].point1_value; \n\t}else {\n\tpoint = resultArr[i].point2_value; \n\t}\n\n \tif ((point == currentPoint) && (resultArr[i].unicast_value != 0)) {\n\t\t\tmarkers[i].setVisible(true); \t\t\t\n\t\t\tmarkerLabels[i].show();\n\n\t\t\tif (pointNum == 1) {\n\t\t\t\tif ((timestamp-resultArr[i].lastclock1) > 3900) {\n\t\t\t\tcolor = \"#000000\";\n\t\t\t\t}else \t{\n\t\t\t\tcolor = setColor(parseFloat(resultArr[i].rtt1_value), rtt1Intervals, lineColor);\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tif ((timestamp-resultArr[i].lastclock2) > 3900) {\n\t\t\t\tcolor = \"#000000\";\n\t\t\t\t}else {\n\t\t\t\tcolor = setColor(parseFloat(resultArr[i].rtt2_value), rtt2Intervals, lineColor);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdrawLineOnMap(resultArr[i].lat, resultArr[i].lon, points[index].lat, points[index].lon, color);\t\n\t\t\t}\n\t}\t\n}", "title": "" }, { "docid": "d0da4187ff8ced86f75a5a76be165c8f", "score": "0.54482126", "text": "function drawLine(userCord, tagCord){\n\n var userArray = userCord;\n var tagArray = tagCord;\n console.log(\"Coordinates for draw\", userArray, tagArray);\n var polyLine = L.polyline([\n userArray,\n tagArray,\n ], {color: 'yellow'}\n ).addTo(map);\n}", "title": "" }, { "docid": "7a07b89cb029dde19abcd82403e5e700", "score": "0.54289824", "text": "function renderPolyline(path, map){\n //Create polyline and render it on map\n new google.maps.Polyline({\n path: path,\n map: map,\n geodesic: true,\n strokeColor: '#000000',\n strokeWeight: 5\n });\n }", "title": "" }, { "docid": "aedb2cc150786b69a2b3c9d225947bba", "score": "0.542456", "text": "function drawLinksMap(data, X) {\n\n // Create an array to feed into path selection\n //var arcdata = [\n //{\n //sourceName: Singapore,\n //targetName: Australia,\n //sourceLocation: [-99.5606025, 41.068178502813595],\n //targetLocation: [-106.503961875, 33.051502817366334]\n //}]\n\n var arcData = []\n var country = 'Germany'\n data.map((d,i)=>{\n if((d.properties[X] !== undefined) & (d.properties[X] !== 0) ) {\n var cS = centroids.find(c => c.name == d.properties.name)\n var cT = centroids.find(c => c.name == country)\n arcOne = {\n id: i,\n value: d.properties[X],\n sourceName: d.properties.name,\n targetName: country,\n sourceLocation: [cS.x, cS.y],\n targetLocation: [cT.x, cT.y],\n startColor: colorSource, \n stopColor: colorDestination\n }\n arcData.push(arcOne)\n }\n }) \n //console.log(arcData)\n\n var arcPaths = arcs.selectAll(\"path\").data(arcData, d=>d.id) // Create a path for each source/target pair.\n\n arcPaths.exit().remove()\n\n arcPaths.enter().append(\"path\")\n .merge(arcPaths)\n .attr('class', d=> 'line line-' + d.sourceName)\n .attr('fill', 'none')\n .attr('opacity', d=> opacityScale(d.value))\n .attr('stroke-linecap', 'round')\n .attr('stroke-width', function(d) { return lineScale(d.value) })\n .style('stroke', '#45ADA8')\n //.style(\"stroke\", function(d,i) {\n //var sx = d.targetLocation[0] - d.sourceLocation[0]\n //return (sx > 0) ? 'url(#LinkStroke1)' : 'url(#LinkStroke2)'\n //})\n .attr('d', function(d) { \n var a = Math.atan2(d.targetLocation[1] - d.sourceLocation[1], d.targetLocation[0] - d.sourceLocation[0]) * (180 / Math.PI)\n \n //if(d.sourceName=='Nigeria' | d.sourceName=='Niger' | d.sourceName=='Benin' | d.sourceName=='Togo' | d.sourceName=='Mali'){\n //connector_angles.push({'country': d.sourceName, 'flip': 2})\n //return line(d, 'sourceLocation', 'targetLocation')\n //}\n if(a>=-90 & a<=90){\n var path = arc(d, 'sourceLocation', 'targetLocation', 1)\n path ? connector_angles.push({'country': d.sourceName, 'flip': 1}) : connector_angles.push({'country': d.sourceName, 'flip': 2})\n return path ? path : line(d, 'sourceLocation', 'targetLocation')\n } else {\n connector_angles.push({'country': d.sourceName, 'flip': 2})\n var path = arc(d, 'sourceLocation', 'targetLocation', 2)\n return path ? path : line(d, 'sourceLocation', 'targetLocation')\n } \n })\n\n}", "title": "" }, { "docid": "6a7a4d9686660adee026470ee4a99a26", "score": "0.5420992", "text": "function drawRoutePaths(agency_tag, route_tag) {\n\t\t$.each(routes[agency_tag]['routes'], function(i,route) {\n\t\t\tvar p = svg.selectAll(\"path.route\")\n\t\t .data(routes[agency_tag]['routes'][route.tag]['path'])\n\t\t .enter()\n\t\t .append(\"path\")\n\t\t .attr(\"d\", function(d) {\n\t\t \t\t//console.log(\"route_\" + route.tag, d.point);\n\t\t \t\treturn line(d.point);\n\t\t \t})\n\t\t .attr(\"class\", \"route_path route_path_\" + route.tag)\n\t\t .attr(\"visibility\", \"hidden\")\n\t\t .attr(\"stroke\", \"#\" + routes[agency_tag]['routes'][route.tag]['color'])\n\t\t .attr(\"stroke-width\", 1)\n\t\t .attr(\"fill\", 'none');\n\t\t});\n\t}", "title": "" }, { "docid": "96a47883bc680bdf8d02a7e7bc533c3a", "score": "0.5406363", "text": "function jump7(map) {\n var lineSymbol = {\n path: 'M 0,-1 0,1',\n strokeOpacity: 0.5,\n scale: 4\n };\n\n var line = new google.maps.Polyline({\n path: [],\n geodesic: true,\n strokeColor: '#f45898',\n strokeOpacity: 0,\n strokeWeight: 5,\n editable: false,\n icons: [{\n icon: lineSymbol,\n offset: '0',\n repeat: '20px'\n }],\n map:map\n });\n\n var locations = [{lat: 38.691956, lng: -121.591392}, // SAC\n {lat: 40.629178, lng: -73.782010}, // JFK\n {lat: 40.715224, lng: -73.983655}, // East Village Dance Project\n {lat: 40.714930, lng: -73.989232} // Seward Park\n ];\n\n for (var i = 0; i < locations.length; i++) {\n setTimeout(function(coords) {\n latlng = new google.maps.LatLng(coords.lat, coords.lng);\n// map.panTo(latlng);\n line.getPath().push(latlng);\n }, 100 * i, locations[i]);\n }\n}", "title": "" }, { "docid": "40cc92b825819b51aeaf72cc5a689220", "score": "0.54052496", "text": "function drawRoute() {\n var changeFloorPause = 1000; //time to wait before changing floors during a route\n var startFloorPause = 1500; //time to wait before continuing to draw after floor change\n var currentX; //current x coordinate of draw path\n var currentY; //current y coordinate of draw path\n var currentSet; //index of current floor path in route (if a floor is revisited\n //during a route, it will have multiple indices here, it changes whenever floor changes\n var currentEntry; //current move/lineto/curveto command in the current set of the route\n var xDist; //horizontal distance between start and end of next entry\n var yDist; //vertical distance between start and end of next entry\n var len;\t\t //Used to calculate the distance each frame should extend line, then used to store\n //remaining number of frames for that line\n var xControl; //x coordinate of control point\n var yControl; //y coordinate of control point\n var curvePoint; //control variable to calculate end position of next line in curve\n var curveIteration; //amount to adjust curvePoint each frame\n var unit; //distance each frame should extend the line\n var xMin; //minimum recorded x-value for that set, later adjusted for different floor dimensions\n var xMax; //maximum recorded x-value for that set, later adjusted for different floor dimensions\n var yMin; //minimum recorded y-value for that set, later adjusted for different floor dimensions\n var yMax; //maximum recorded y-value for that set, later adjusted for different floor dimensions\n var xWidth; //distance between xmin and xmax, later adjusted for different floor dimensions and to fit boundaries\n var yHeight; //distance between ymin and ymax, later adjusted for different floor dimensions and to fit boundaries\n var xUnitShift; //Distance to shift viewbox horizontally each frame\n var yUnitShift; //Distance to shift viewbox vertically each frame\n var widthUnitShift; //amount to change magnification level each frame\n var shiftUnitsRemaining; //number of frames left for zoom operation\n var zoomIterations = 35; //number of frames over which to change viewbox\n var routeComplete = false;\n\n beginRoute();\n\n //sets up starting values for each route, changes classes as necessary\n function beginRoute() {\n currentSet = 0\n currentEntry = 0;\n animating = true;\n routeComplete = false;\n $(\".replay\").addClass(\"disabled\");\n $(\"a.btn-floor\").removeClass(\"destination\");\n $(\"#flr-btn\" + drawing[drawing.length - 1][0].floor).addClass(\"destination\");\n //restores internal canvases to default floor images\n for (var i = 0; i < 6; i++){\n con[i].clearRect(0,0,can[i].width,can[i].height);\n con[i].drawImage(floors[i], 0, 0, floors[i].width, floors[i].height, 0, 0, floors[i].width,\n floors[i].height);\n }\n\n //starts at full size on floor change\n if (parseInt(drawing[0][0].floor) != currentFloor){\n shiftX = 0;\n shiftY = 0;\n currentZoom = 1;\n nextFloor = parseInt(drawing[0][0].floor);\n changeSVGFloor(nextFloor);\n currentFloor = nextFloor;\n }\n\n //changes floors if necessary\n //sets up the canvas for line drawing\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = lineColor;\n\n //change active floor icon\n $(\"a.btn-floor\").removeClass(\"active\");\n $(\"#flr-btn\" + currentFloor).addClass(\"active\");\n //clear canvas and draw floor\n ctx.clearRect(0,0,c.width,c.height);\n ctx.drawImage(can[currentFloor], shiftX,shiftY,can[currentFloor].width/currentZoom, can[currentFloor].height/currentZoom, 0, 0, c.width,c.height);\n //calculate and set starting point drawing\n currentX = parseFloat(drawing[0][0].x - views[currentFloor][0])\n *floors[currentFloor].width/views[currentFloor][2] + bases[currentFloor].x;\n currentY = parseFloat(drawing[0][0].y - views[currentFloor][1])\n *floors[currentFloor].height/views[currentFloor][3] + bases[currentFloor].y;\n con[currentFloor].beginPath();\n con[currentFloor].moveTo(currentX, currentY);\n if (drawing[currentSet].length > 2 || drawing.length > 2)\n window.requestAnimationFrame(changeFocus);\n }\n\n //sets up values for panning/zooming to the route\n function changeFocus(){\n var targetZoom;\n var midPoint;\n xMin = floors[currentFloor].width;\n xMax = views[currentFloor][0];\n yMin = floors[currentFloor].height;\n yMax = views[currentFloor][1];\n //finds minimum and maximum x and y values for the current drawing set\n for (var i = 0; i < drawing[currentSet].length; i++){\n drawing[currentSet][i].x = parseFloat(drawing[currentSet][i].x);\n drawing[currentSet][i].y = parseFloat(drawing[currentSet][i].y);\n if (drawing[currentSet][i].x < xMin)\n xMin = drawing[currentSet][i].x;\n if (drawing[currentSet][i].x > xMax)\n xMax = drawing[currentSet][i].x\n if (drawing[currentSet][i].y < yMin)\n yMin = drawing[currentSet][i].y;\n if (drawing[currentSet][i].y > yMax)\n yMax = drawing[currentSet][i].y\n }\n //converts the minimum and maximum values to the floors dimensions\n xMin = (xMin - views[currentFloor][0]) * floors[currentFloor].width / views[currentFloor][2];\n yMin = (yMin - views[currentFloor][1]) * floors[currentFloor].height / views[currentFloor][3];\n xMax = (xMax - views[currentFloor][0]) * floors[currentFloor].width / views[currentFloor][2];\n yMax = (yMax - views[currentFloor][1]) * floors[currentFloor].height / views[currentFloor][3];\n //adds 30% to width and height so route fits cleanly, then adjusts to ensure values remain within canvas\n midPoint = {x: (xMin + xMax)/2, y: (yMin + yMax)/2};\n xWidth = (xMax - xMin) * 1.5;\n yHeight = (yMax - yMin) * 1.5;\n if (yHeight > xWidth * can[currentFloor].height/can[currentFloor].width)\n xWidth = yHeight * can[currentFloor].width/can[currentFloor].height;\n if (xWidth < can[currentFloor].width/maxZoom){\n xWidth = can[currentFloor].width/maxZoom;\n yHeight = xWidth * can[currentFloor].height/can[currentFloor].width;\n } else if (xWidth > can[currentFloor].width){\n xWidth = can[currentFloor].width;\n yHeight = xWidth * can[currentFloor].height/can[currentFloor].width;\n }\n\n if (midPoint.x - xWidth/2 < 0)\n xMin = 0;\n else if (midPoint.x + xWidth/2 > can[currentFloor].width)\n xMin = can[currentFloor].width - xWidth;\n else\n xMin = midPoint.x - xWidth/2;\n\n if (midPoint.y - yHeight/2 < 0)\n yMin = 0;\n else if (midPoint.y + yHeight/2 > can[currentFloor].height)\n yMin = can[currentFloor].height - yHeight;\n else\n yMin = midPoint.y - yHeight/2;\n targetZoom = floors[currentFloor].width / xWidth;\n\n //calculate amount to shift each frame\n xUnitShift = (xMin-shiftX)/zoomIterations;\n yUnitShift = (yMin-shiftY)/zoomIterations;\n widthUnitShift = (targetZoom - currentZoom)/zoomIterations;\n shiftUnitsRemaining = zoomIterations;\n\n window.requestAnimationFrame(routeZoom);\n }\n\n function routeZoom(){\n //adjusts view values as calculates in changeFocus, draws the updated position.\n //Repeats for zoomIterations frames then calls route\n shiftX = shiftX + xUnitShift;\n shiftY = shiftY + yUnitShift;\n currentZoom = currentZoom + widthUnitShift;\n shiftUnitsRemaining = shiftUnitsRemaining - 1;\n if (shiftX < 0)\n shiftX = 0;\n if (shiftY < 0)\n shiftY = 0;\n if (currentZoom < 1)\n currentZoom = 1;\n ctx.clearRect(0,0,c.width,c.height);\n ctx.drawImage(can[currentFloor], shiftX, shiftY, can[currentFloor].width/currentZoom,\n can[currentFloor].height/currentZoom, 0,0,c.width,c.height);\n updateViewBox();\n if (shiftUnitsRemaining > 0)\n window.setTimeout(routeZoom, animationSpeed);\n else if (!routeComplete){\n ctx.beginPath();\n ctx.moveTo((currentX - shiftX) * c.width * currentZoom /floors[currentFloor].width, (currentY - shiftY) * c.height * currentZoom /floors[currentFloor].height);\n window.requestAnimationFrame(route);\n } else {\n $(\".replay\").removeClass(\"disabled\");\n toggleInfoPanel();\n animating = false;\n shiftX = 0;\n shiftY = 0;\n currentZoom = 1;\n shiftXMax = 0;\n shiftYMax = 0;\n return;\n }\n }\n\n //adjusts drawing set/entry, and then makes calulations/calls functions according\n //to what type the current entry in drawing is.\n function route(){\n shiftXMax = Math.floor(can[currentFloor].width * (1 - 1/currentZoom));\n shiftYMax = Math.floor(can[currentFloor].height * (1 - 1/currentZoom));\n\n if (currentEntry < drawing[currentSet].length - 1) {\n currentEntry = currentEntry + 1;\n switchOver();\n } else if (currentSet < drawing.length - 1){\n currentSet++;\n currentEntry = 0;\n nextFloor = drawing[currentSet][currentFloor].floor;\n window.setTimeout(routeFloor, changeFloorPause);\n } else {\n routeComplete = true;\n xUnitShift = (0-shiftX)/zoomIterations;\n yUnitShift = (0-shiftY)/zoomIterations;\n widthUnitShift = (1 - currentZoom)/zoomIterations;\n shiftUnitsRemaining = zoomIterations;\n window.setTimeout(routeZoom, changeFloorPause);\n }\n }\n\n // Determine whether we need to draw a line or a B-curve\n function switchOver() {\n switch (drawing[currentSet][currentEntry].type){\n case \"L\":\n xDist = (parseFloat(drawing[currentSet][currentEntry].x) - views[currentFloor][0])\n * floors[currentFloor].width/views[currentFloor][2] - currentX\n + bases[currentFloor].x;\n yDist = (parseFloat(drawing[currentSet][currentEntry].y) - views[currentFloor][1])\n * floors[currentFloor].height/views[currentFloor][3] - currentY\n + bases[currentFloor].y;\n len = Math.sqrt(xDist*xDist + yDist*yDist);\n unit = drawLength / len;\n len = Math.ceil(len / drawLength);\n\n window.requestAnimationFrame(drawLine);\n\n break;\n case \"Q\":\n xMax = (parseFloat(drawing[currentSet][currentEntry].x) - views[currentFloor][0])\n * floors[currentFloor].width/views[currentFloor][2] + bases[currentFloor].x;\n yMax = (parseFloat(drawing[currentSet][currentEntry].y) - views[currentFloor][1])\n * floors[currentFloor].height/views[currentFloor][3] + bases[currentFloor].y;\n xControl = (parseFloat(drawing[currentSet][currentEntry].cx) - views[currentFloor][0])\n * floors[currentFloor].width/views[currentFloor][2] + bases[currentFloor].x;\n yControl = (parseFloat(drawing[currentSet][currentEntry].cy) - views[currentFloor][1])\n * floors[currentFloor].height/views[currentFloor][3] + bases[currentFloor].y;\n minX = currentX;\n minY = currentY;\n xDist = xMax - minX;\n yDist = yMax - minY;\n len = Math.sqrt(xDist * xDist + yDist * yDist);\n curvePoint = 0;\n curveIteration = drawLength / Math.ceil(len);\n\n window.requestAnimationFrame(drawQuad);\n\n break;\n default:\n return;\n }\n }\n\n //changes floor displayed by canvas and svg\n function routeFloor() {\n $(\"#flr-btn\" + currentFloor).removeClass(\"active\");\n changeSVGFloor(nextFloor);\n currentFloor = nextFloor;\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = lineColor;\n $(\"#flr-btn\" + currentFloor).addClass(\"active\");\n currentX = (parseFloat(drawing[currentSet][currentEntry].x) - views[currentFloor][0])\n *floors[currentFloor].width/views[currentFloor][2];\n currentY = (parseFloat(drawing[currentSet][currentEntry].y) - views[currentFloor][1])\n *floors[currentFloor].height/views[currentFloor][3];\n ctx.clearRect(0,0,c.width,c.height);\n ctx.drawImage(can[currentFloor], 0,0,can[currentFloor].width,\n can[currentFloor].height,0,0,c.width,c.height);\n shiftX = 0;\n shiftY = 0;\n currentZoom = 1;\n con[currentFloor].beginPath();\n con[currentFloor].moveTo(currentX,currentY);\n ctx.beginPath();\n ctx.moveTo(currentX * c.width/floors[currentFloor].width, currentY * c.height / floors[currentFloor].height);\n window.setTimeout(changeFocus, startFloorPause);\n }\n\n //draws the line segment to the internal canvas and myCanvas\n function drawLine(){\n var nextX = currentX + unit * xDist;\n var nextY = currentY + unit * yDist;\n\n con[currentFloor].lineTo(nextX, nextY);\n con[currentFloor].stroke();\n\n ctx.lineTo((nextX - shiftX) * c.width * currentZoom / floors[currentFloor].width, (nextY - shiftY) * c.height * currentZoom /floors[currentFloor].height);\n ctx.stroke();\n\n currentX = nextX;\n currentY = nextY;\n\n len = len-1;\n\n if (len > 0) {\n setTimeout(drawLine, animationSpeed);\n } else {\n requestAnimationFrame(route);\n }\n }\n\n //draws curve to internal canvas and myCanvas\n function drawQuad(){\n var nextX = (1-curvePoint)*(1-curvePoint)*(minX) + 2 * curvePoint * (1-curvePoint) * xControl + curvePoint * curvePoint * xMax;\n var nextY = (1-curvePoint)*(1-curvePoint)*(minY) + 2 * curvePoint * (1-curvePoint) * yControl + curvePoint * curvePoint * yMax;\n con[currentFloor].lineTo(nextX, nextY);\n con[currentFloor].stroke();\n ctx.lineTo((nextX - shiftX) * c.width * currentZoom /floors[currentFloor].width, (nextY - shiftY) * c.height * currentZoom /floors[currentFloor].height);\n ctx.stroke();\n currentX = nextX;\n currentY = nextY;\n if (curvePoint < 1){\n if (curvePoint + curveIteration < 1)\n curvePoint = curvePoint + curveIteration;\n else\n curvePoint = 1;\n setTimeout(drawQuad, animationSpeed);\n }\n else\n requestAnimationFrame(route);\n }\n}", "title": "" }, { "docid": "f790d747c943b354b61cd000c2e3f0aa", "score": "0.5404964", "text": "function droneVideoPathAnimation(droneFlightPathJSON, strokeColor, strokeOpacity, strokeWeight) {\n\n var droneFlightPath = new google.maps.Polyline({\n path: droneFlightPathJSON.Coordinates,\n geodesic: true,\n strokeColor: strokeColor,\n strokeOpacity: strokeOpacity,\n strokeWeight: strokeWeight,\n });\n\n droneFlightPath.setMap(map);\n\n var droneAnimationMarker = new google.maps.Marker({\n position: new google.maps.LatLng(droneFlightPathJSON.Coordinates[0].lat, droneFlightPathJSON.Coordinates[0].lng),\n map: map,\n icon: \"img/side-bar-icon/drone_marker_icon.png\",\n });\n\n animateMarker(droneAnimationMarker, droneFlightPathJSON.Coordinates, droneFlightPathJSON.Animation_speed, droneFlightPathJSON.Delay);\n\n}", "title": "" }, { "docid": "e61d8a693e4afdf6501f16b9d2753e60", "score": "0.53925943", "text": "function drawMap(error, map) {\n // determines which ids belong to the continental united states\n // https://gist.github.com/mbostock/4090846#file-us-state-names-tsv\n var isContinental = function(d) {\n var id = +d.id;\n return id < 60 && id !== 2 && id !== 15;\n };\n // filter out non-continental united states\n var old = map.objects.states.geometries.length;\n map.objects.states.geometries = map.objects.states.geometries.filter(isContinental);\n console.log(\"Filtered out \" + (old - map.objects.states.geometries.length) + \" states from base map.\");\n // size projection to fit continental united states\n // https://github.com/topojson/topojson-client/blob/master/README.md#feature\n states = topojson.feature(map, map.objects.states);\n projection.fitSize([width, height], states);\n // draw base map with state borders\n var base = plot.append(\"g\").attr(\"id\", \"basemap\");\n var path = d3.geoPath(projection);\n base.append(\"path\")\n .datum(states)\n .attr(\"class\", \"land\")\n .attr(\"d\", path);\n // draw interior and exterior borders differently\n // https://github.com/topojson/topojson-client/blob/master/README.md#mesh\n // used to filter only interior borders\n var isInterior = function(a, b) { return a !== b; };\n // used to filter only exterior borders\n var isExterior = function(a, b) { return a === b; };\n base.append(\"path\")\n .datum(topojson.mesh(map, map.objects.states, isInterior))\n .attr(\"class\", \"border interior\")\n .attr(\"d\", path);\n base.append(\"path\")\n .datum(topojson.mesh(map, map.objects.states, isExterior))\n .attr(\"class\", \"border exterior\")\n .attr(\"d\", path);\n // trigger data drawing\n d3.queue()\n .defer(d3.csv, urls.air, typeAirport)\n .defer(d3.csv, urls.fly, typeFlight)\n .await(filterData);\n}", "title": "" }, { "docid": "f6e8323c1f6503db53e2ce67c4250ddc", "score": "0.539006", "text": "function drawPolyline(pts) {\n ctx.beginPath();\n ctx.moveTo(pts[0].x, pts[0].y);\n for (var i = 1; i < pts.length; i++) {\n ctx.lineTo(pts[i].x, pts[i].y);\n }\n ctx.stroke();\n}", "title": "" }, { "docid": "bbf4d22cc70570782c6a715424d64350", "score": "0.5381964", "text": "function drawDP(dpPath) {\r\n//function drawPath(dpPath) {\r\n //alert(\"drawing\");\r\n destroyDP();\r\n polyline = new google.maps.Polyline ({\r\n path: dpPath,\r\n strokeColor: \"#FF0000\",\r\n strokeOpacity: 1.0,\r\n strokeWeight: 5\r\n });\r\n \r\n polyline.setMap(map);\r\n \r\n //google.maps.event.addListener(polyline, 'click', function(event) {set_route(polyline);});\r\n\r\n google.maps.event.addListener(polyline,'mouseover', function (event) {\r\n //alert(\"mouseover\");\r\n if (polylineMarkers.length == 0) {\r\n for (i in dpPath) {\r\n //alert(dpPath[i]);\r\n polylineMarkers.push(placeMarker(dpPath[i], true)); \r\n }\r\n }\r\n }); \r\n}", "title": "" }, { "docid": "d7347d8c404fd85ead4c54ae7c71a788", "score": "0.5378779", "text": "function draw_line(x1, y1, x2, y2)\n{\n surfaceTarget.beginPath();\n surfaceTarget.moveTo(x1 - view_xview, y1 - view_yview);\n surfaceTarget.lineTo(x2 - view_xview, y2 - view_yview);\n surfaceTarget.stroke();\n surfaceTarget.closePath();\n}", "title": "" } ]
5117e5888a0895ac729a3b26facf572b
this script is to check whether both password and confirm password are matching and give appropriate error message
[ { "docid": "6872d88d78515959d200e9fc8b6a3692", "score": "0.7188551", "text": "function checkConfirmPassword()\r\n{\r\n\tif(document.getElementById(\"password\").value != document.getElementById(\"confirm\").value)\r\n\t{\r\n\t\tdocument.getElementById(\"confirm\").setCustomValidity(\"password does not match\"); \r\n\t\tdocument.getElementById(\"wrongPassword\").style.visibility = \"visible\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tdocument.getElementById(\"confirm\").setCustomValidity(\"\");\r\n\t\tdocument.getElementById(\"wrongPassword\").style.visibility = \"hidden\";\r\n\t}\r\n\t\r\n}", "title": "" } ]
[ { "docid": "7a8253d3193c91db45bfe203eb4a24e1", "score": "0.7915368", "text": "checkPassword() {\n if (this.passwordConfirm !== this.password) {\n throw new Error('password and password confrim are different');\n }\n }", "title": "" }, { "docid": "820657e3e338f7dd9abe2d99f0dbff29", "score": "0.7845872", "text": "function validateRConfirmPassword() {\r\n if (elrConfirmPassword.value == \"\") {\r\n elErrorRConfirmPassword.innerHTML = \"<p class=\\\"alert alert-danger\\\">You must enter a confirm password.</p>\";\r\n return false;\r\n } else if (elrPassword.value !== elrConfirmPassword.value) {\r\n elErrorRConfirmPassword.innerHTML = \"<p class=\\\"alert alert-danger\\\">Confirm password must match password.</p>\";\r\n return false;\r\n } else {\r\n elErrorRConfirmPassword.innerHTML = \"\";\r\n }\r\n }", "title": "" }, { "docid": "2cf8c567bcf0ed5088a4a8b7c054dc2f", "score": "0.77564764", "text": "function checkPasswordsMatch(pw1, pw2) {\r\n if (pw1.value !== pw2.value) {\r\n showError(pw2, \"Passwords do not match\");\r\n }\r\n}", "title": "" }, { "docid": "d29bfe208e59dfd9020514d2f3474549", "score": "0.7753403", "text": "function checkPasswordsMatch(pass1, pass2) {\n if (pass1.value !== pass2.value) showError(pass2, 'Passwords do not match');\n}", "title": "" }, { "docid": "e455a8f0be40a5190392c7296d8bde15", "score": "0.7706645", "text": "function validateConfirmPassword()\n\t{\n\t\tvar pass=document.getElementById(\"pass\");\n\t\tvar confirmPass=document.getElementById(\"confirmPass\");\n\t\tvar message=document.getElementById(\"spanConfirmPass\");\n\t\tif((pass.value)==(confirmPass.value))\n\t\t{\n\t\t\tconfirmPass.style.border=\"2px solid green\";\n\t\t\tmessage.innerHTML=\"Password matched\";\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\tconfirmPass.style.border=\"2px solid red\";\n\t\t\tmessage.innerHTML=\"Password did not match\";\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "941f42b4bdd61677e47ac4b437e24732", "score": "0.7704301", "text": "function checkPasswordMatch(){\n var password = $('#reg-pass').val();\n var confirmPassword = $('#confirm-pass').val();\n\n if(password != confirmPassword){\n $('.alert').attr('class', 'alert alert-yellow alert-dismissable')\n $('.alert').css('display','block').html(\"Password Fields Do Not Match\");\n\n }\n else{\n $('.alert').css('display','none').html(\"\");\n }\n }//password check end function", "title": "" }, { "docid": "1d6cedbf19bd1ad26f3a18e46a8fa5b7", "score": "0.7667205", "text": "function validatePassword() {\n var x = document.querySelector(\"#password\").value;\n var y = document.querySelector(\"#confirmPassword\").value;\n if (x !== y) {\n alert(\"password do not match\");\n return false;\n }\n}", "title": "" }, { "docid": "c0c66fa2fc58edb8d58dfa57365719ef", "score": "0.7648429", "text": "function checkpw() {\n\t\n\tvar errors=\"\";\n\tvar errors2=\"\";\n\t if(firstPasswordInput.value != secondPasswordInput.value)\n\t{\n\terrors2=\"Passwords do not match!\";\n\t\n\t\t}\n\telse{\n\t if(firstPasswordInput.value.length < 8)\n\t{\n\terrors=errors+\" \"+\"Password should be at-least 8 characters!\";\n\t\t}\n\t\n\t if(firstPasswordInput.value.length > 50)\n\t{\n\terrors=errors+\" \"+\"Password should be less than 50 characters!\";\n\t\t}\n\t\n\t if(!(/[\\!\\@\\#\\$\\%\\^\\&\\*]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one symbol!\";\n\t\t}\n\t\n\t if(!(/[0-9]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one number!\";\n\t\t}\n\t\n\t\n\t if(!(/[a-z]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one lowercase!\";\n\t\t}\n\t\n\t if(!(/[A-Z]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one uppercase!\";\n\t\t}\n\t\t\n\t if((/[^A-z0-9\\!\\@\\#\\$\\%\\^\\&\\*]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Illegal character!\";\n\t\t}\n\t}\t\t\n\tfirstPasswordInput.setCustomValidity(errors);\n\tsecondPasswordInput.setCustomValidity(errors2);\n\t\n}", "title": "" }, { "docid": "c0c66fa2fc58edb8d58dfa57365719ef", "score": "0.7648429", "text": "function checkpw() {\n\t\n\tvar errors=\"\";\n\tvar errors2=\"\";\n\t if(firstPasswordInput.value != secondPasswordInput.value)\n\t{\n\terrors2=\"Passwords do not match!\";\n\t\n\t\t}\n\telse{\n\t if(firstPasswordInput.value.length < 8)\n\t{\n\terrors=errors+\" \"+\"Password should be at-least 8 characters!\";\n\t\t}\n\t\n\t if(firstPasswordInput.value.length > 50)\n\t{\n\terrors=errors+\" \"+\"Password should be less than 50 characters!\";\n\t\t}\n\t\n\t if(!(/[\\!\\@\\#\\$\\%\\^\\&\\*]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one symbol!\";\n\t\t}\n\t\n\t if(!(/[0-9]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one number!\";\n\t\t}\n\t\n\t\n\t if(!(/[a-z]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one lowercase!\";\n\t\t}\n\t\n\t if(!(/[A-Z]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one uppercase!\";\n\t\t}\n\t\t\n\t if((/[^A-z0-9\\!\\@\\#\\$\\%\\^\\&\\*]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Illegal character!\";\n\t\t}\n\t}\t\t\n\tfirstPasswordInput.setCustomValidity(errors);\n\tsecondPasswordInput.setCustomValidity(errors2);\n\t\n}", "title": "" }, { "docid": "c0c66fa2fc58edb8d58dfa57365719ef", "score": "0.7648429", "text": "function checkpw() {\n\t\n\tvar errors=\"\";\n\tvar errors2=\"\";\n\t if(firstPasswordInput.value != secondPasswordInput.value)\n\t{\n\terrors2=\"Passwords do not match!\";\n\t\n\t\t}\n\telse{\n\t if(firstPasswordInput.value.length < 8)\n\t{\n\terrors=errors+\" \"+\"Password should be at-least 8 characters!\";\n\t\t}\n\t\n\t if(firstPasswordInput.value.length > 50)\n\t{\n\terrors=errors+\" \"+\"Password should be less than 50 characters!\";\n\t\t}\n\t\n\t if(!(/[\\!\\@\\#\\$\\%\\^\\&\\*]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one symbol!\";\n\t\t}\n\t\n\t if(!(/[0-9]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one number!\";\n\t\t}\n\t\n\t\n\t if(!(/[a-z]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one lowercase!\";\n\t\t}\n\t\n\t if(!(/[A-Z]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Requires at least one uppercase!\";\n\t\t}\n\t\t\n\t if((/[^A-z0-9\\!\\@\\#\\$\\%\\^\\&\\*]/g).test(firstPasswordInput.value))\n\t{\n\terrors=errors+\" \"+\"Illegal character!\";\n\t\t}\n\t}\t\t\n\tfirstPasswordInput.setCustomValidity(errors);\n\tsecondPasswordInput.setCustomValidity(errors2);\n\t\n}", "title": "" }, { "docid": "667fbb22b8cc65554f4a1fa72558196a", "score": "0.7618433", "text": "function checkCnfPassword(){\n\t\tif(errorPassword){\n\t\t\tidCnfPasswordError.html(\"First submit the password correctly\");\n\t\t\tidCnfPasswordError.show();\n\t\t\terrorCnfPassword = true;\n\t\t}\n\t\telse if( idCnfPassword.val() != idPassword.val() ){\n\t\t\tidCnfPasswordError.html(\"It should be same as Password\");\n\t\t\tidCnfPasswordError.show();\n\t\t\terrorCnfPassword = true;\n\t\t}\n\t\telse{\n\t\t\tidCnfPasswordError.hide();\n\t\t\terrorCnfPassword = false;\n\t\t}\n\t}", "title": "" }, { "docid": "6a558d009205b999c9e0b3004cc8d552", "score": "0.7610925", "text": "function confirmPass() {\n if (pInput.value !== cpInput.value) {\n cpField.classList.add(\"error\");\n cpField.classList.remove(\"valid\");\n let passError = cpField.querySelector(\".error-txt\");\n pInput.value !== cpInput.value\n ? (passError.innerText =\n \"Confirm password should be same as above password\")\n : (passError.innerText = \"Password can't be blank\");\n } else {\n cpField.classList.remove(\"error\");\n cpField.classList.add(\"valid\");\n }\n }", "title": "" }, { "docid": "d9ea80a1456e993321822378a47834ca", "score": "0.75828236", "text": "function checkPasswords() {\n const password = document.getElementById('password').value;\n const confirm_password = document.getElementById('confirm_password').value;\n let result = true;\n if (password != confirm_password) {\n const errorsTranslate = i18next.t('validateForm.emailPasswordMatch');\n const errors = [errorsTranslate, errorsTranslate];\n const elementsWithErrors = ['password', 'confirm_password'];\n setErrors(errors, elementsWithErrors);\n showHideButtonLoader('registerButton', 'hideLoader');\n result = false;\n }\n\n return result;\n}", "title": "" }, { "docid": "2796e2ffad1bd19879e5022b2672e78a", "score": "0.7575015", "text": "function matchPasswords(){\n\tvar password = $(\"#password\").val();\n\tvar confirmPassword = $(\"#confirm-password\").val();\n\t\n\tif(password === confirmPassword){\n\t\t$(\"#error_confirm-password\").text('');\n\t\t$(\"#confirm-password\").css(\"border\", \"1px solid #b8bdc1\");\n\t\treturn true;\n\t}\n\telse{\n\t\t$(\"#error_confirm-password\").text(\"Password and confirm password doesn't match\");\n\t\t$(\"#confirm-password\").css(\"border\", \"1px solid red\");\n\t\treturn false;\n\t}\n\t\t\n}", "title": "" }, { "docid": "157040e46589fecc2cf67edea81eac58", "score": "0.75440127", "text": "function ensurePasswordsMatch(form) {\n\n if (form.password.value != form.password_confirm.value) {\n window.alert(\"Paswords do not match\");\n return false;\n }\n\n return true;\n\n}", "title": "" }, { "docid": "ca3ed21c3aafcf1c0723e34e14bdcd45", "score": "0.75341654", "text": "function checkPassword2() {\n\tvar y = document.forms[\"register\"][\"password1\"].value; //assigns variable y to the value of password\n\tvar z = document.forms[\"register\"][\"password2\"].value; //assigns variable z to the value of confirm password\n\n\tif ( z == null || z == \"\") {\t//checks confirm password is not left blank\n\t\tvar errorText = document.getElementById(\"passWord2\");\n\t\terrorText.innerHTML = \" Confirm Password is Required\"; //if the user corrects the error, the in-line message disappears\n return false;\n\t} else if (y != z) { //checks whether password and confirm password match\n\t\tvar errorText = document.getElementById(\"passWord2\");\n\t\terrorText.innerHTML = \" Passwords do not match\"; //informs user of the error in line\n\t\treturn false;\n\t} else if (y == z) {\n\t\tvar errorText = document.getElementById(\"passWord2\");\n\t\terrorText.innerHTML = \"\"; //if the user corrects the error, the in-line message disappears\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "c2cac84d3bb1109ef7a361d0cb6fe40f", "score": "0.75300795", "text": "function validateConfirmPassword() {\n\tvar x = document.getElementById(\"confirm-password\").value;\n\tif (x.length < 6) {\n\t\tdocument.getElementById(\"confirm-password-msg\").style.color = \"red\";\n\t\tdocument.getElementById(\"confirm-password-msg\").innerHTML = \"Confirm Password must be atleast 6 characters long\";\n\t\treturn false;\n\t} else {\n\t\tvar pass1 = document.getElementById(\"password\").value;\n\t\tvar pass2 = document.getElementById(\"confirm-password\").value;\n\t\tif (pass1 != pass2) {\n\t\t\tdocument.getElementById(\"confirm-password-msg\").style.color = \"red\";\n\t\t\tdocument.getElementById(\"confirm-password-msg\").innerHTML = \"Confirm Password must be same as password\";\n\t\t\treturn false;\n\t\t} else {\n\t\t\tdocument.getElementById(\"confirm-password-msg\").innerHTML = \"\";\n\t\t\treturn true;\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "94b4df1c89e0f43fbdffeb90607fb4df", "score": "0.75215507", "text": "checkPasswordsMatch() {\n if (this.formData.password !== this.formData.confirmPassword) {\n this._Alert.passwordsNotMatching();\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "94b4df1c89e0f43fbdffeb90607fb4df", "score": "0.75215507", "text": "checkPasswordsMatch() {\n if (this.formData.password !== this.formData.confirmPassword) {\n this._Alert.passwordsNotMatching();\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "483e7adcaf2ad1ea30095d221d352f7c", "score": "0.7519586", "text": "function checkPasswordsMatch(input1, input2) {\n if (input1.value != input2.value) {\n showError(input2, \"Please enter same password\");\n showError(input1, \"Please enter same password\");\n } else {\n showSuccess(input1);\n showSuccess(input2);\n }\n}", "title": "" }, { "docid": "f9d0331a88884a8fb9021dc5481c2f08", "score": "0.7513167", "text": "validatePasswordFields() {\n if (this.state.oldPassword === this.props.currentCustomer.password) {\n if (this.state.newPassword === this.state.confirmPassword) {\n console.log(\"VALIDATED\")\n return \"ok\";\n } else {\n return \"Passwords do not match\";\n }\n } else {\n return \"Old password is incorrect\";\n }\n }", "title": "" }, { "docid": "daca95717143bce7bfcd0a9434011791", "score": "0.7494709", "text": "function checkPasswordMatch(input1, input2) {\n if (input1.value != input2.value) {\n showError(input2, \"Passwords donot match\");\n }\n}", "title": "" }, { "docid": "ead86f8dc07cf6b4ce8b6f224e321b25", "score": "0.74904096", "text": "function checkPasswordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, 'Passwords do not match');\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "504b9dfa84361d1e81be26952b310f3b", "score": "0.7480657", "text": "function validatePassword () {\n if (password.value !== confirmPassword.value) {\n confirmPassword.setCustomValidity('Password Don\\'t Match')\n } else {\n confirmPassword.setCustomValidity('')\n }\n }", "title": "" }, { "docid": "1a896dc1644efa6cb766f3f738741da9", "score": "0.74756885", "text": "function validateBothPassword() {\n\tconsole.log(\"----------\")\n\tif (validateConfirmPassword() && validatePassword()) {\n\t\tconsole.log(\"true---\");\n\t\treturn true;\n\t} else {\n\t\tconsole.log(\"false---\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "b9426c5ece78453c29424d9beb0b70ad", "score": "0.7465489", "text": "function comparePasswords() {\r\n\t// Both fields have to be filled out\r\n\tif ($(\"#password\").val() !== \"\" && $(\"#password_confirm\").val() !== \"\") {\r\n\r\n\t\t// Repeated new password and password have to be the same\r\n\t\tif ($(\"#password\").val() === $(\"#password_confirm\").val()) {\r\n\t\t\treturn true;\r\n\r\n\t\t} else { // If repeated new password and password are not the\r\n\t\t\t// same\r\n\t\t\tbuildAndShowMessageBar(\"ERR_INPUT_PASSWORD_COMP\",\r\n\t\t\t\t\t\"messagebar_extend\")\r\n\t\t\t$(\"#page_content_extend\").addClass(\"page_content_move_down\")\r\n\t\t}\r\n\r\n\t} else { // If one field is empty\r\n\t\tbuildAndShowMessageBar(\"WRN_EMPTY_CERT_PWD\", \"messagebar_extend\")\r\n\t\t$(\"#page_content_extend\").addClass(\"page_content_move_down\")\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "1795f785a6d19e75a86d6459ee12c48f", "score": "0.7462919", "text": "function checkPasswordMatch(input1, input2) {\n if (input1.value != input2.value) {\n showError(input2, 'Password do not match');\n }\n}", "title": "" }, { "docid": "cda79a68f92c0a59bd10a6248a4cc37d", "score": "0.74488527", "text": "function passwordMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Password do not match\");\n } else {\n showSuccess(input2);\n }\n}", "title": "" }, { "docid": "9492bed1ee86aa655c41f05548ff0a2a", "score": "0.743786", "text": "function checkPasswordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Passwords do not match. Please try again.\");\n }\n}", "title": "" }, { "docid": "e601fcfe7f2ccb63de06c5c8e3a7d6a4", "score": "0.7436572", "text": "function passMatch()\n{\n\tvar confpassword = document.getElementById(\"confpassword\").value; \n\tvar password = document.getElementById(\"password\").value;\n\n\n\tif(password.length<8){\n document.getElementById(\"pass_error\").innerHTML = \"Your Password Must more than 8 characters.\";\n return false;\n }else{\n if(password!=confpassword){\n\t\t document.getElementById(\"pass_error\").innerHTML = \"passwords does not match.\";\n\t }else{\n\t\t document.getElementById(\"pass_error\").innerHTML = \"Now they match.\";\t\t\n\t}\t\n}\n}", "title": "" }, { "docid": "39a89ff40e7a907ed2ca2ca6a8c03b21", "score": "0.7421293", "text": "function handlePasswordError(){\n if(comfirmPassword!==password){\n setPasswordSame(false);\n }else{\n setPasswordSame(true);\n }\n }", "title": "" }, { "docid": "f93562f9bc885c64c95e531dbea7d9cb", "score": "0.7419903", "text": "function getPass(form) { \n\tlet pw1 = document.getElementById(\"pass1\").value\n\tlet pw2 = document.getElementById(\"pass2\").value\n\tif (pw1.length !== 8 && pw2.length !== 8) {\n\t\t\talert (\"Password do not match. Please enter your password EXACTLY 8 characters!\") \n\t} \n\telse if (pw1.length === pw2.length) { \n\t\talert (\"Password confirmed!\")\n\t}\n\t\n\t\n\t//////////////////////////////////////////////////////\n\t\n\t\n\t//else { \n\t//\talert(\"Password confirmed!\")\n\t//\treturn true\t\t\n\t//}\n\t\n\t/*if (pw1 == '') {\n\t\talert (\"Please enter a password. Exactly 8 characters only.\");\n\t}\n\telse if (pw2 == '') {\n\t\talert (\"Please enter confirm password\"); \n\t}\t \n\telse if (pw1 !== pw2) { \n\t\talert (\"Password do not match\") \n\t\t\n\t} \n\telse{ \n\t\talert(\"Password confirmed!\") \n\t\t\n\t}\n\t\n\tlet pw0 = /^(?=.*[0-8])(?=.*[!@#$%^&*])[a-zA-Z0-8!@#$%^&*]{0,8}$/*/\n}", "title": "" }, { "docid": "aff47d0fdc0b291ec36c83dfe8177915", "score": "0.7408888", "text": "function checkPasswordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Passwords do not match\");\n }\n}", "title": "" }, { "docid": "354d65f13dfad6aef5189f260879fc7b", "score": "0.73848695", "text": "function passwordMatch(input, input2, msg) {\n if (input2.value === \"\") {\n error(input2, msg, \"This feild is required\");\n } else if (input.value !== input2.value) {\n error(input2, msg, \"Passwords don't match\");\n } else {\n success(input2, msg);\n }\n}", "title": "" }, { "docid": "5d8bc7fe136f1b54942c7c672e501822", "score": "0.7384347", "text": "function validatePassword() {\n const password = document.getElementById(\"password\");\n const confirm_password = document.getElementById(\"passwordr\");\n if (password.value != confirm_password.value) {\n confirm_password.setCustomValidity(\"Passwords Don't Match\");\n } \n else {\n confirm_password.setCustomValidity(\"You're good!\");\n }\n }", "title": "" }, { "docid": "e683db1bd534137311b841a00fb35664", "score": "0.73809963", "text": "function passwordValidate(){\r\n\t\r\n\tvar pass = document.getElementById(\"password\").value;\r\n\tvar passconfirm = document.getElementById(\"password_confirm\").value;\r\n\t\r\n\t/*if the passwords don't match, display a message, otherwise clear the message*/\r\n\tif (pass != passconfirm){\r\n\t\tdocument.getElementById(\"confirmmessage\").innerHTML=\"Passwords don't match\";\r\n\t\tdocument.getElementById(\"confirmmessage\").style.color=\"red\";\r\n\t}else{\r\n\t\tdocument.getElementById(\"confirmmessage\").innerHTML=\"\";\r\n\t}\r\n}", "title": "" }, { "docid": "8118a05a0918dfb89861d911be5b1b8a", "score": "0.7375425", "text": "function checkPassword(form) {\n\n var passOne = document.getElementById(\"pass-one\").value;\n var passTwo = document.getElementById(\"pass-two\").value;\n\n // If password not entered\n if (passOne===''){\n alert (\"Please enter Password\");\n}\n // If confirm password not entered\n else if (passTwo===''){\n alert (\"Please enter confirm password\");\n}\n // If Not same return False.\n else if (passOne!==passTwo){\n alert (\"\\nPassword did not match: Please try again...\");\n document.getElementById(\"pass-one\").style.borderColor=\"red\";\n\n return false;\n\n }\n\n // If same return True.\n else{\n alert(\"Password Match: Welcome to Becode!\");\n return true;\n }\n\n\n // your code here\n\n}", "title": "" }, { "docid": "1d047381e180263b1bd282fd9a1db45e", "score": "0.7374316", "text": "function checkPasswordsMatch(input0, input1) {\n if (input0.value !== input1.value) {\n showError(input1, \"Passwords do not match\");\n }\n}", "title": "" }, { "docid": "7ccc90aa1793e4f6200ec3f4bd39176b", "score": "0.7371564", "text": "function check_retype_password() {\r\n \r\n var password = $(\"#password\").val();\r\n var retype_password = $(\"#retype_password_input\").val();\r\n \r\n if(password != retype_password) {\r\n $(\"#retype_password_error\").html(\"Passwords don't match\");\r\n $(\"#retype_password_error\").show();\r\n error_retype_password = true;\r\n } else {\r\n $(\"#retype_password_error\").hide();\r\n }\r\n \r\n }", "title": "" }, { "docid": "dbe15b3ec1097ba6e1c322a5bb1d501e", "score": "0.73657185", "text": "function regPasswordMatch(input1, input2){\n if(input1.value !== input2.value){\n\tregShowError(input2, \"Passowrds do not match\");\n }\n}", "title": "" }, { "docid": "a5f1b6c22b784d681be0defc2ccbf1f1", "score": "0.7364576", "text": "function checkPasswordsMatch(input1, input2) {\r\n if(input1.value !== input2.value) {\r\n showError(input2, 'Passwords do not match!')\r\n }\r\n}", "title": "" }, { "docid": "4cc51caacc38e6bdd3a6276b8753921e", "score": "0.73594207", "text": "function checkMatchingPasswords(pw1, pw2) {\n if (pw1.value !== pw2.value || pw1.value === \"\") {\n showError(pw2, `${pw2.id} does not match`);\n showError(pw1, `${pw1.id} does not match`);\n return false;\n } else if (checkValidLength(pw1, 3, 20) && checkValidLength(pw2, 3, 20)) {\n successCount += 1;\n return true;\n }\n}", "title": "" }, { "docid": "d3cb5f6cb6ce2c9ab091e78a42510d2f", "score": "0.7356416", "text": "function match(pass1, pass2){\n var errors=document.querySelector(\".sidepanel\");\n errors.innerHTML=\"\"\n var result;\n if(pass1.value==pass2.value){\n result=true;\n }else{\n errors.innerHTML+=\"<p>Confirmation password does not match with password\";\n result=false;\n pass1.focus();\n pass2.focus();\n }\n return result;\n}", "title": "" }, { "docid": "fd762c6eb6e0257f5da3046d40c902ea", "score": "0.7345876", "text": "function validatePasswords(p1, p2){\n\n // blank p1\n if (UTILS.validate_text(p1)){\n return -1;\n }\n\n //blank p2\n if (UTILS.validate_text(p1)){\n return -2;\n }\n\n // check passwords length\n if(p1.length < 6){\n return 0;\n }\n\n // check if passwords match\n if(p1.length === p2.length && p1 === p2){\n return 2;\n }\n else{\n return 1;\n }\n }", "title": "" }, { "docid": "159a8d6c7d1402d42bd9a83b13dab69b", "score": "0.7345763", "text": "function validatePassword() {\n if (password.value != confirm_password.value) {\n confirm_password.setCustomValidity(\"Passwords Don't Match\");\n } else {\n confirm_password.setCustomValidity('');\n }\n}", "title": "" }, { "docid": "ee50c1afedec2bbb91602f6edf941e39", "score": "0.7321232", "text": "function checkConfirm(id) {\r\n\r\n // //\r\n //To hide error message\r\n $('.error_' + id + '').hide();\r\n var hasError = false;\r\n\r\n //password input value\r\n var passwordVal = $('#password_' + id + '').val();\r\n\r\n\r\n //confirm password input value\r\n var checkVal = $('#confirmpassword_' + id + '').val();\r\n\r\n //check values\r\n if (passwordVal == '') {\r\n //$('#password_' + id + '').parent().after('<div class=\"text-danger error_' + id + '\">' + settings.language.fillpassword + '</div>');\r\n $('.error_' + id + '').css(\"display\", \"block\");\r\n hasError = true;\r\n\r\n }\r\n if (checkVal == '') {\r\n $('.confirmpassword_error_' + id + '').css(\"display\", \"block\");\r\n hasError = true;\r\n }\r\n\r\n //if (checkVal == '') {\r\n // $('#confirmpassword_' + id + '').parent().after('<span class=\"text-danger confirmpassword_error_' + id + '\">' + settings.language.fillconfirm + '</span>');\r\n // hasError = true;\r\n //}\r\n if (!passwordVal.match(RegEx)) {\r\n var res = passwordVal.match(RegEx);\r\n $('.validpassword_error_' + id + '').css(\"display\", \"block\");\r\n // $('#password_' + id + '').parent().after('<span class=\"text-danger error_' + id + '\">' + settings.language.validation + '</span>');\r\n $('#demo').html(\"dddd \" + res);\r\n hasError = true;\r\n }\r\n\r\n //else if ((checkVal == '')) {\r\n\r\n // $('#confirmpassword_' + id + '').parent().after('<span class=\"text-danger confirmpassword_error_' + id + '\">' + settings.language.fillconfirm + '</span>');\r\n // hasError = true;\r\n\r\n //}\r\n if (passwordVal != checkVal) {\r\n $('.confirmpassword_error_' + id + '').css(\"display\", \"none\");\r\n $('.inCorrectpassword_error_' + id + '').css(\"display\", \"block\");\r\n // $('#confirmpassword_' + id + '').parent().after('<span class=\"text-danger confirmpassword_error_' + id + '\">' + settings.language.inCorrectPassword + '</span>');\r\n hasError = true;\r\n }\r\n\r\n else if (passwordVal == checkVal) {\r\n hasError = false;\r\n }\r\n\r\n if (hasError == true) { return false; }\r\n else if (hasError == false) { return true; }\r\n }", "title": "" }, { "docid": "ded4c0a16f6fe5e6f7c4dd1fa2eb1d56", "score": "0.7315995", "text": "function check_password() {\n\t\tif (((newPassword.value.length) > 0 ) || ((rePassword.value.length) > 0)){\n\t\t\t// if password is not the same \n\t\t\tif(newPassword.value != rePassword.value){\n\t\t\t\t// singUp button stop word\n\t\t\t\tbtnPassword.style.visibility = \"hidden\";\n\t\t\t\tlabelNewPasswprd.innerHTML = \"The password you entered does NOT match!\";\n\t\t\t\tlabelRePassword.innerHTML = \"The password you entered does NOT match!\";\n\t\t\t\t\n\t\t\t\tnewPassword.style.borderColor = \"red\";\n\t\t\t\trePassword.style.borderColor = \"red\";\t\t\n\t\t\t}else {\n\t\t\t\t// passwords is same \n\t\t\t\t\tif ((newPassword.value.length) < 8 && (rePassword.value.length) < 8){\n\t\t\t\t\t\tlabelNewPasswprd.innerHTML = \"You must enter at last 8 characters for your password!\";\n\t\t\t\t\t\tlabelRePassword.innerHTML = \"You must enter at last 8 characters for your password!\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewPassword.style.borderColor = \"red\";\n\t\t\t\t\t\trePassword.style.borderColor = \"red\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tbtnPassword.btnPassword.style.visibility = \"hidden\";\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlabelNewPasswprd.innerHTML = \"Password\";\n\t\t\t\t\t\tlabelRePassword.innerHTML = \"Re-type Password\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewPassword.style.borderColor = \"#e0e1e2\";\n\t\t\t\t\t\trePassword.style.borderColor = \"#e0e1e2\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tbtnPassword.style.visibility = \"visible\";\n\t\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tlabelNewPasswprd.innerHTML = \"Password\";\n\t\t\tlabelRePassword.innerHTML = \"Re-type Password\";\n\t\t\t\n\t\t\tnewPassword.style.borderColor = \"#e0e1e2\";\n\t\t\trePassword.style.borderColor = \"#e0e1e2\";\n\t\t\t\n\t\t\tbtnPassword.style.visibility = \"visible\";\n\t\t}\n\t}", "title": "" }, { "docid": "d31c5baa8a2209fc4ea901f0709108d9", "score": "0.7307699", "text": "function validatePasswordSubmission()\n{\n //get all form fields\n var password = document.getElementById(\"newPass\").value;\n var confirm = document.getElementById(\"newPassC\").value;\n \n //flag to ensure all data accurate\n var isValid = true;\n \n //ensure initial password is submitted\n if(password == \"\")\n {\n //show error message and mark input invalid\n document.getElementById(\"pass_error\").style.display = \"block\";\n isValid = false;\n }//end if\n else\n {\n //hide error message\n document.getElementById(\"pass_error\").style.display = \"none\";\n \n //if password submitted, make sure second one matches\n if(password != confirm)\n {\n //show error message and mark input invalid\n document.getElementById(\"confirm_error\").style.display = \"block\";\n isValid = false;\n }//end if\n else\n {\n //hide error message\n document.getElementById(\"confirm_error\").style.display = \"none\";\n }//end else\n }//end else\n\n return isValid;\n}//close validatePasswordSubmission", "title": "" }, { "docid": "9dfc499c5e90a037c253b163ccdfd55e", "score": "0.7302671", "text": "function validatePasswords(create, confirm) {\n if (create == confirm) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "92f0ab2e66ae07282e3d607d30017a05", "score": "0.7293751", "text": "function validatePassword() {\n var msg = '';\n //if ($(\"#txtOldPassword\").val() == '')\n // msg += \"O campo 'Senha actual' é obrigatório.\"\n // if ($(\"#txtNewPassword\").val() == '') {\n // if (msg.length > 0) msg += \"<br>\";\n // msg += \"O campo 'Nova senha' é obrigatório.\"\n // }\n // if ($(\"#txtConfirmPassword\").val() == '') {\n // if (msg.length > 0) msg += \"<br>\";\n // msg += \"O campo 'Confirmar senha' é obrigatório.\"\n // }\n if ($(\"#txtNewPassword\").val() !== $(\"#txtConfirmPassword\").val()) {\n msg += \"A nova senha não é igual à senha de confirmação.\";\n }\n if (msg.length > 0) {\n MessageBox.info(msg);\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "4d69c1ef106f1602ba330580aaf8de45", "score": "0.72936577", "text": "function validate_password_confirmation() {\n var password_input = query('input[name=\"password\"]');\n if(this.value != password_input.value)\n\tthis.setCustomValidity(_('Two fields are inconsistent.'));\n else\n\tthis.setCustomValidity('');\n show_validation_message.call(this);\n}", "title": "" }, { "docid": "de22d1b139928b54d3ce5bb731719508", "score": "0.7291801", "text": "matchPasswordPIN(pwd, confrmPwd, message) {\n if (pwd != confrmPwd) {\n Alert.alert(globals.appName, message)\n return false\n }\n return true\n }", "title": "" }, { "docid": "c48779f7f71d03fc0bd6c54e4abd2df1", "score": "0.72828734", "text": "checkPW(){\n let pw1 = document.querySelector('#password1').value;\n let pw2 = document.querySelector('#password2').value;\n if(pw1 !== undefined && pw1 !== null && pw1 !== \"\" && pw2 !== undefined && pw2 !== null && pw2 !== \"\"){\n if(pw1 === pw2){\n this.password_error = false;\n } else {\n this.password_error = true;\n }\n } else {\n this.password_error = false;\n }\n }", "title": "" }, { "docid": "d59502d912141f0e57e024d75a4d2b1b", "score": "0.7282842", "text": "function checkPasswordMatching() {\n $('#txtConfirmPassword').on('change', function () {\n var password = $('#userPassword').val();\n var confirmPassword = $('#txtConfirmPassword').val();\n if (password != confirmPassword) {\n swal({\n title: \"Your password doesn't match, Please type again\",\n text: \"Click OK to exit\",\n type: \"warning\"\n });\n $('#txtConfirmPassword').val('');\n }\n });\n }", "title": "" }, { "docid": "e2ba12176669c240024980e7c738234e", "score": "0.7269833", "text": "function pwdMatch(pwd,confirm_pwd) {\n var valid = true;\n var msg = \"Ensure the passwords match\";\n if (pwd !== confirm_pwd) {\n $(\"#password-feedback\").text(msg);\n $(\"#pwd\").addClass(\"is-invalid\");\n $(\"#confirm_pwd\").addClass(\"is-invalid\");\n valid = false;\n } else {\n $(\"#pwd\").removeClass(\"is-invalid\");\n $(\"#confirm_pwd\").removeClass(\"is-invalid\");\n }\n return valid;\n }", "title": "" }, { "docid": "e83f7da662cc8a120d7effec3750a7a7", "score": "0.7262265", "text": "function checkInputs() {\n const usernameValue = username.value.trim();\n const emailValue = email.value.trim();\n const passwordValue = password.value.trim();\n const conform_passwordValue = conform_password.value.trim();\n var reg = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n\n if (usernameValue === \"\") {\n flag = true;\n SetErrorFor(username, \" Username is required\");\n } else {\n flag = false;\n setSuccessfor(username);\n }\n\n if (emailValue === \"\") {\n flag = true;\n SetErrorFor(email, \" Email is required\");\n } else if (!reg.test(emailValue)) {\n flag = true;\n SetErrorFor(email, \" Email is wrong \");\n } else {\n flag = false;\n setSuccessfor(email);\n }\n\n if (passwordValue === \"\") {\n flag = true;\n SetErrorFor(password, \" password required\");\n } else if (passwordValue.length < 6 || passwordValue.length > 15) {\n flag = true;\n console.log(passwordValue.length);\n SetErrorFor(password, \" password is less than 6 charcater\");\n } else {\n flag = false;\n setSuccessfor(password);\n }\n\n if (conform_passwordValue === \"\") {\n flag = true;\n SetErrorFor(conform_password, \" confirm password required\");\n } else if (passwordValue != conform_passwordValue) {\n console.log(\"meow\");\n flag = true;\n SetErrorFor(conform_password, \" conform-password is not matching\");\n } else if (\n conform_passwordValue.length < 6 ||\n conform_passwordValue.length > 15\n ) {\n flag = true;\n SetErrorFor(conform_password, \" password is less than 6 charcater\");\n } else {\n flag = false;\n setSuccessfor(conform_password);\n }\n}", "title": "" }, { "docid": "a79f33b0812bf8494797ef1a542c8429", "score": "0.7260378", "text": "function validatePasswordconfirm () {\n var element = document.getElementById(\"password\");\n var element2 = document.getElementById(\"passwordconfirm\");\n\tvar ok = element.value == element2.value;\n\tif (!ok) {\n element.style.color = \"red\";\n return false;\n\t} else { \n element.style.color = \"black\";\n return true;\n\t}\n}", "title": "" }, { "docid": "f9cdcc5c5f253e7e25efc7f2e1ce674b", "score": "0.72594917", "text": "function passwordCheck(password) {\n\t\t\t// check to see if password = \"HelloWorld\"\n\t\t\tif (password === \"HelloWorld\") {\n\t\t\t\treturn alert(\"Your password is correct.\")\n\t\t\t}\n\t\t\t// otherwise, print 'incorrect' statement\n\t\t\telse {\n\t\t\t\treturn alert(\"Your password is incorrect. Please try again.\")\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2244fa9b957d5afddd2f019843b6ebfb", "score": "0.7251777", "text": "pwConfirmError() {\n return (this.pwNew !== this.pwConfirm);\n }", "title": "" }, { "docid": "d7135e332dd9a9bdca7fc6171ddf3e31", "score": "0.7244522", "text": "function matchpass() {\n var firstpass = document.f1.password1.value;\n var secondpass = document.f1.password2.value;\n \n if(firstpass == secondpass && firstpass.length>6) {\n return true;\n }if(firstpass.length<6 && secondpass.length<6){\n alert(\"password must be at least 6 chars\");\n return false;\n \n }else{\n alert(\"Be sure to check your passwords. They do not match.\");\n return false;\n }\n\n}", "title": "" }, { "docid": "40f5fd19acebd64b2a221382b05e558b", "score": "0.72383773", "text": "function confirmPassword() {\r\n if(password.value !== confirm_password.value) {\r\n confirm_password.setCustomValidity(\"Les mots de passe ne sont pas identiques...\");\r\n\treturn false;\r\n } else {\r\n confirm_password.setCustomValidity('');\r\n\treturn true;\r\n }\r\n}", "title": "" }, { "docid": "c20d27578079959ce1dfa60e344eaf40", "score": "0.723277", "text": "function checkPasswordMatch() {\n //valore del campo che permette di inserire la nuova password\n var password = $(\"#txtNewPassword\").val();\n //valore del campo che permette di confermare password\n var confirmPassword = $(\"#txtConfirmPassword\").val();\n\n //se le due password non corrispondono\n if (password != confirmPassword)\n //viene modificato l'elemento html che ha come id CheckPasswordMatch\n //Viene modificato il valore testuale e il colore del testo\n $(\"#CheckPasswordMatch\").html(\"Le password non corrispondono!\").css('color', 'red');\n else\n $(\"#CheckPasswordMatch\").html(\"Le password corrispondono\").css('color', 'green');\n }", "title": "" }, { "docid": "0b28e8bef3e84fe2567fa44ce9b363a1", "score": "0.7231636", "text": "function test_confirm_pass(pass1, pass2){if(pass1 == pass2){return true;}return false;}", "title": "" }, { "docid": "709278d4f4fd3461030db2f02755b57f", "score": "0.7226702", "text": "function arePasswordsEqual(newPassword,confirmPassword)\n{\n if (newPassword.value == confirmPassword.value)\n {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "709278d4f4fd3461030db2f02755b57f", "score": "0.7226702", "text": "function arePasswordsEqual(newPassword,confirmPassword)\n{\n if (newPassword.value == confirmPassword.value)\n {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "3ae714b5f1ca60e2b74ef7aa911d4e72", "score": "0.72201025", "text": "function verifyPassword() {\n if (passwordIsValid()) {\n getUserKeychain()\n .catch(function() {\n $scope.passwordError = true;\n });\n } else {\n $scope.passwordError = true;\n }\n }", "title": "" }, { "docid": "ccf9f378979a0cac06442248ed9cb043", "score": "0.7216928", "text": "function checkChangePassword()\n{\n\tif(goThroughRequiredInputs(\"changepasswords\"))\n\t\treturn confirmPasswords();\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "94f87cefb7d73e0fd0a40de5813eac25", "score": "0.7214003", "text": "function passwordConfirm_validation(passwordConfirm) {\n if (passwordConfirm == password) {\n return true;\n }\n else {\n alert('Password must be the same for both inputs!');\n passwordConfirm.focus();\n return false;\n }\n}", "title": "" }, { "docid": "0ac2a92619c24e37578044545f2f0122", "score": "0.72061723", "text": "function validate(){\n \n var newPswrdVal = $('#newPassword').val();\n var confirmPswrdVal = $('#confirmPassword').val();\n\n if( validatePassword(newPswrdVal) && validatePassword(confirmPswrdVal) ) {\n return true;\n\n } else return false;\n}", "title": "" }, { "docid": "d2b226b13907413cfb17fe898b53c5a4", "score": "0.72040915", "text": "function compPass(){\n \n\t var frm = document.forms[\"emppasschange\"];\n\t \n\t if(frm.txtNewPwd.value != frm.txtNewPwdConf.value){\n\t sfm_show_error_msg('The Confirm Password and New password does not match!',frm.txtNewPwdConf);\n\t return false;\n\t }else{\n\t return true;\n\t }\n\t}", "title": "" }, { "docid": "be138e2b6a1838b312b47be6087f4063", "score": "0.71933824", "text": "function validateConfirmPassword(){\n debugger;\n var password = document.getElementById('password').value;\n var confirmPassword = document.getElementById('confirmpassword').value;\n if(password==confirmPassword){\n return true;\n }else{\n alert(\"Password is not matching\");\n return false;\n }\n}", "title": "" }, { "docid": "578c580c4d550efe8a68ec902af23d48", "score": "0.7174235", "text": "function checkPasswords() {\n\t\t\t\t\tif (self.masterUser.fPassword.length < 8) {\n\t\t\t\t\t\tfirstPasswordInputIssuesTracker.addIssues(\"fewer than 8 characters\");\n\t\t\t\t\t} else if (self.masterUser.fPassword.length > 50) {\n\t\t\t\t\t\tfirstPasswordInputIssuesTracker.addIssues(\"greater than 50 characters\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!self.masterUser.fPassword.match(/[\\!\\@\\#\\$\\%\\^\\&\\*]/g)) {\n\t\t\t\t\t\tfirstPasswordInputIssuesTracker.addIssues(\"missing a symbol (!, @, #, $, %, ^, &, *)\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!self.masterUser.fPassword.match(/\\d/g)) {\n\t\t\t\t\t\tfirstPasswordInputIssuesTracker.addIssues(\"missing a number\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!self.masterUser.fPassword.match(/[a-z]/g)) {\n\t\t\t\t\t\tfirstPasswordInputIssuesTracker.addIssues(\"missing a lowercase letter\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!self.masterUser.fPassword.match(/[A-Z]/g)) {\n\t\t\t\t\t\tfirstPasswordInputIssuesTracker.addIssues(\"missing an uppercase letter\");\n\t\t\t\t\t}\n\n\t\t\t\t\tvar badCharacterGroup = self.masterUser.fPassword.match(/[^A-z0-9\\!\\@\\#\\$\\%\\^\\&\\*]/g);\n\t\t\t\t\tif (badCharacterGroup) {\n\t\t\t\t\t\tbadCharacterGroup.forEach(function(badChar) {\n\t\t\t\t\t\t\tfirstPasswordInputIssuesTracker.addIssues(\"includes bad character: \" + badChar);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "12f5a28a6132cdcf54603ee1459088b4", "score": "0.7168371", "text": "function checkEqualPasswords(inputOne, inputTwo) {\n if(inputOne.value !== inputTwo.value){\n showError(inputTwo, `${getFieldName(inputTwo)} passwords do not match!`)\n } else{\n showSuccess(inputTwo);\n }\n\n}", "title": "" }, { "docid": "87381b791ee199b17f707b1fe60305df", "score": "0.7160919", "text": "function comparePasswords()\n{\n var ps1 = document.getElementById(\"password\").value;\n var ps2 = document.getElementById(\"confirm\").value;\n var psMsg = document.getElementById(\"psMsg\");\n if(ps1 != ps2)\n {\n psMsg.innerHTML = \"Passwords do not match\";\n psMsg.className = \"text-danger\";\n return false;\n }\n else\n {\n psMsg.innerHTML = \"\";\n psMsg.className = \"\";\n return true;\n }\n}", "title": "" }, { "docid": "f3f156bd7a92ea9838ace85e978be883", "score": "0.71569735", "text": "function validatePassword(){\n if(password.value !== verifyPassword.value) {\n verifyPassword.setCustomValidity(\"Passwords Don't Match\");\n } else {\n verifyPassword.setCustomValidity('');\n }\n }", "title": "" }, { "docid": "8592898ca02fe802461cc798a3c2886b", "score": "0.71425754", "text": "function passwordMatch() {\n if ($('#register-password').val() != $('#register-confirm-password').val()) {\n $('#register-password-hint').stop(true, true).fadeIn(500);\n } else {\n $('#register-password-hint').stop(true, true).fadeOut(500);\n }\n }", "title": "" }, { "docid": "8fedad6a46744b8352b0dbba09ad13b5", "score": "0.713379", "text": "function password(psw, confirm_psw) {\n console.log(\"INTO method password\");\n\tif(psw.value.length <4) {\n\t\t//show_errmessage(\"Password must have at least 4 characters\");\n\t\t//dity(\"Password must have at least 4 characters\");\n\t\t//confirm_psw.setCustomValidity(\"Password must have at least 4 characters\");\n\t\treturn {\"success\": false, \"err\": 1};\n\t} else {\n\t\n\t\tif (psw.value != confirm_psw.value){\n\t\t\t//show_errmessage(\"Passwords Don't Match\");\n\t\t\t//confirm_psw.setCustomValidity(\"Passwords Don't Match\");\n\t\t\treturn {\"success\": false, \"err\": 2};\n\t\t\t\n\t\t} else {\n\t\t\t//confirm_psw.setCustomValidity(\"\");\n\t\t\t//show_errmessage();\n\t\t\treturn {\"success\": true};;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b8a8b2efafd4b6ed66aa5f7f586a2a78", "score": "0.7128974", "text": "function passwordValidation() {\n var p1 = document.getElementById(\"password1\").value;\n var p2 = document.getElementById(\"password2\").value;\n if(p1!=p2)\n {\n alert(\"The passwords entered don't match\");\n }\n else if(p1.length<8)\n {\n alert(\"The passwords are not at least 8 characters long\");\n }\n else if(p1==p2)\n {\n alert(\"The password is valid!\");\n }\n}", "title": "" }, { "docid": "d97d1be3b6d6fea36abcef8df458b64c", "score": "0.7116658", "text": "function comparePasswords() {\n if ($('input[name=password]').val() != '' && $('input[name=confirmpassword]').val() != '' ) {\n if ($('input[name=password]').val() == $('input[name=confirmpassword]').val()) {\n $(\".password_error\").html(\" \");\n $(\".password_error\").css({\"display\": \"none\"});\n $('input[type=password]').css({\"border-color\": \"green\"});\n return true;\n } else {\n $(\".password_error\").html(\"Passwords do not match \");\n $(\".password_error\").css({\"display\": \"block\"});\n $('input[type=password]').css({\"border-color\": \"red\"});\n return false;\n }\n }\n return false;\n}", "title": "" }, { "docid": "4df7520b5694dbfa8dca426e507476f5", "score": "0.71157116", "text": "function validate() {\r\n checkConnection();\r\n chkStatusAndPwd(); \r\n var password1 = $(\"#password\").val();\r\n var password2 = $(\"#confirm_password\").val();\r\n //console.log(password1+\"--\"+password2)\r\n if(password1 == password2) {\r\n //console.log(\"if\");\r\n $(\".create_btn\").removeClass(\"disabled\");\r\n $(\"#success-badge\").removeClass(\"display-none\");\r\n $(\".unmatch-text\").css(\"display\",'none');\r\n $(\".match-text\").css(\"display\",'block');\r\n $(\".match-text\").text(\"Passwords match.\"); \r\n }else{\r\n //console.log(\"else\");\r\n $(\".create_btn\").addClass(\"disabled\"); \r\n $(\"#warning-badge\").removeClass(\"display-none\");\r\n $(\".match-text\").css(\"display\",'none');\r\n $(\".unmatch-text\").css(\"display\",'block');\r\n $(\".unmatch-text\").text(\"Passwords do not match!\"); \r\n } \r\n}", "title": "" }, { "docid": "13e40c3b60bf27596f67ba5ff5e6df42", "score": "0.71118706", "text": "function checkPasswordsMatch() {\n if (password.value == confirmPass.value) {\n document.getElementById('confErr').innerHTML = `The password is OK!`;\n document.getElementById('confErr').style.color = 'green';\n document.getElementById('confErr').style.fontSize = '12px';\n //return true;\n } else {\n document.getElementById(\n 'confErr'\n ).innerHTML = `The passwords don't match!`;\n document.getElementById('confErr').style.color = 'red';\n document.getElementById('confErr').style.fontSize = '12px';\n //return false;\n }\n if (confirmPass.value == '') {\n document.getElementById(\n 'confErr'\n ).innerHTML = `Please fill in this field`;\n document.getElementById('confErr').style.color = 'red';\n document.getElementById('confErr').style.fontSize = '12px';\n }\n}", "title": "" }, { "docid": "c09d1a0497e613d83b5dcac2dd7a139c", "score": "0.7106758", "text": "function check_password(passwordOne, passwordTwo) {\n if(passwordOne != passwordTwo) {\n return \"Passwords do not match\"\n }\n return null;\n}", "title": "" }, { "docid": "0aa79e27af34cb3d6968bfed8aaf111a", "score": "0.71004206", "text": "function rp_pass_validate(){\n span_teacher_password_rp.hidden=true;\n rp_password=pass_rp_teacher.value;\n password=pass_teacher.value;\n if(password!=rp_password){\n span_teacher_password_rp.hidden=false;\n }\n }", "title": "" }, { "docid": "7665f1a639f164686a67aa87190a5b9d", "score": "0.70941484", "text": "function passwordMatch() {\r\n\tvar currpswd = $(\"#currpwd\").val();\r\n\tvar password = $(\"#newpwd\").val();\r\n\tvar confirmPassword = $(\"#cnfmpwd\").val();\r\n\r\n\tif (password != confirmPassword)\r\n\t\t$(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\r\n\telse {\r\n\t\t$(\"#divCheckPasswordMatch\").html(\"\");\r\n\t\t$(\"#pswdUpdateBtn\").removeAttr(\"disabled\");\r\n\t}\r\n}", "title": "" }, { "docid": "41d07be40ee0b3f196ddbe5c9a5d5bf6", "score": "0.708235", "text": "function checkPw(){\n \n var p2 = document.getElementById('pass2');\n var msgErr = document.getElementById('msgErrPass');\n \n if(p1.value != p2.value){\n p2.classList.add(\"is-invalid\");\n msgErr.innerHTML = \"Password Not Match\";\n button.disabled = true;\n }else{\n p2.classList.remove(\"is-invalid\");\n msgErr.innerHTML = \"\";\n button.disabled = false;\n }\n}", "title": "" }, { "docid": "d8628a43e2144b078aa483d9e984300c", "score": "0.7080759", "text": "function validatePassword() {\n\t//validate password, return false if password is empty\n\tvar password=document.forms[\"passwordUpdate\"][\"password\"].value;\n\tif(isEmpty(password)) {\n\t\talert(\"You forgot to enter Password.\");\n\t\treturn false;\n\t}\n\n\t// New password can't be empty\n\tvar newPassword=document.forms[\"passwordUpdate\"][\"newPassword\"].value;\n\tif(isEmpty(newPassword)) {\n\t\talert(\"You forgot to enter a new Password.\");\n\t\treturn false;\n\t}\n\n\t// Confirm password can't be empty\n\tvar newPasswordCheck=document.forms[\"passwordUpdate\"][\"newPasswordCheck\"].value;\n\tif(isEmpty(newPasswordCheck)) {\n\t\talert(\"You forgot to confirm the new Password.\");\n\t\treturn false;\n\t}\n\n\t// Must confirm the new password\n\tif(newPassword != newPasswordCheck) {\n\t\talert(\"Confirm new password failed! You entered your new Password differently.\")\n\t\treturn false;\n\t}\n\n}", "title": "" }, { "docid": "a34d308e7f515aea6bb06ebb9e2796ee", "score": "0.70703423", "text": "function is_password_correct(){\n console.log(\"function: is_password_correct\");\n\n let correctPass = passwords_enum[currentAccount];\n for(let i = 0; i < 6; i++){\n\n // Checks all password attempt values\n if(password[i] !== correctPass[i]){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "b9925ef1daaa7eb03c82501ea3f56cca", "score": "0.70591927", "text": "function validatePassword(one, two) {\n if (typeof one === \"undefined\" || one === null) { return \"Password cannot be null or empty\"; }\n if (one !== two) { return \"Passwords do not match\"; }\n if (one.length < 6) { return \"Password should be at least 6 characters long\"; }\n}", "title": "" }, { "docid": "5d7fa415087216bc9bad46c03c7d79f7", "score": "0.7058449", "text": "function validatePass(password1,password2){\n if (password1===password2){\n $('#reg_messages').text(\"\");\n return true;\n }else{\n $('#reg_messages').text(\"Password Mismatch!\");\n return false;\n }\n }", "title": "" }, { "docid": "2b80e65c72fca561e7cc696e701d9b1d", "score": "0.7057588", "text": "function checkPasswords(fPassword, sPassword) {\n if (fPassword === sPassword) {\n if (fPassword.length >= 8) {\n return true;\n } else {\n swal('Passwords must be a minimum of 8 characters');\n return false;\n }\n } else {\n swal('Passwords do not match');\n return false;\n }\n }", "title": "" }, { "docid": "b7f67653a4ad33f109058769eb9e29df", "score": "0.70572037", "text": "checkInput() {\n // Checks if psws are equal\n if (this.state.password != this.state.repassword){\n alert(\"Passwords don't match!\");\n return 0;\n }\n return 1;\n }", "title": "" }, { "docid": "11325937d8f40cc7ec1b9fb45ea6624a", "score": "0.703822", "text": "function confirmPasswords ()\n{\n\tvar password = document.getElementById(\"newpassword\").value;\n\tvar confirmPassword = document.getElementById(\"confirmnewpassword\").value;\n\n\tif(password==confirmPassword)\n\t\treturn true;\n\treturn false;\n}", "title": "" }, { "docid": "af513c8a14e88b34b2c65e1b6a34e92f", "score": "0.70361644", "text": "function validatePasswordsSplash(p1, p2){\n\n // blank checks\n if (UTILS.checkBlank(p1) || UTILS.checkBlank(p2)){\n return false;\n }\n\n // check passwords length\n if(p1.length < 6 || p2.length < 6){\n return false;\n }\n\n // check if passwords match\n if(p1.length === p2.length && p1 === p2){\n return true;\n }\n else{\n return false;\n }\n }", "title": "" }, { "docid": "c16bfcf87543e17a7732104e2ca27036", "score": "0.70358", "text": "function Verify(username,pass,pass1)\n {\n var Good = true;\n if(username==\"\" || username.length==0)\n {\n alert(\"Username cannot be empty\");\n return !Good;\n }\n if(pass.length ==0 || pass.length==\"\" || pass1.length==0 || pass1 ==\"\")\n {\n alert(\"Password cannot be left empty\");\n return !Good;\n }\n if (pass != pass1)\n {\n alert(\"Passwords dont match!\");\n return !Good;\n }\n if(pass.length <8 && pass1.length <8)\n {\n alert(\"Password length cannot be less than 8\");\n return !Good;\n }\n return Good;//All Good;\n }", "title": "" }, { "docid": "9949dd3417965c240644a45a7ce38db8", "score": "0.70335287", "text": "function checkPw2(){\n \n var pw2 = document.getElementById('renew_password');\n var msgErr = document.getElementById('msgErrPass');\n \n if(pw1.value != pw2.value){\n pw2.classList.add(\"is-invalid\");\n msgErr.innerHTML = \"Password Not Match\";\n button.disabled = true;\n }else{\n pw2.classList.remove(\"is-invalid\");\n msgErr.innerHTML = \"\";\n button.disabled = false;\n }\n}", "title": "" }, { "docid": "bf634f93b6d1069bbef5103d4ad2e2d5", "score": "0.70263636", "text": "function checkPassword() {\n\t \n\t var pass = document.getElementById('password-one').value;\n\t var pass2 = document.getElementById('password-two').value;\n\t var errmessage = document.getElementById('password-message');\n\t var btn = document.getElementById('submitbutton');\n\t\n\t \n\t if (pass != pass2) {\n\t\t errmessage.innerHTML = \"Passwords Do Not Match\";\n\t\t btn.setAttribute('disabled', true);\n\t\t \n\t } else \t\t{\n\t\t errmessage.innerHTML = \"Passwords Match\"; \n\t\t btn.removeAttribute('disabled');\n\n\t }\n\t \t\t\t\t\n\t \t\t\t\t}", "title": "" }, { "docid": "a59b068e11dec3deb16cf307dce27ad7", "score": "0.70263594", "text": "function validateChangeForm()\r\n{\r\n var cForm = window.document.ChangePinForm ;\r\n var oP = cForm.oldPwd.value;\r\n var nP = cForm.newPwd.value;\r\n var rP = cForm.retypePwd.value;\r\n \r\n if(isEmpty(oP))\r\n {\r\n //alert(\"Please enter your current password!\");\r\n reportStatus(912);\r\n return false; \r\n }\r\n else\r\n {\r\n\t if(oP.length < 6 || oP.length > 16)\r\n\t {\r\n\t\t\t//alert (\"Password's length should be between 6-16 characters\");\r\n\t\t\treportStatus(905);\r\n\t\t\treturn false; \r\n\t }\r\n\t if(!isLegalCharacters(oP))\r\n\t {\r\n\t\t\t//alert (\"Password is illegal\");\r\n\t\t\treportStatus(906);\r\n\t\t\treturn false; \r\n\t }\r\n }\r\n if(isEmpty(nP))\r\n {\r\n //alert(\"Please enter your new password!\");\r\n reportStatus(914);\r\n return false; \r\n }\r\n else\r\n {\r\n\t if(nP.length < 6 || nP.length > 16)\r\n\t\t{\r\n\t\t\t//alert (\"Password's length should be between 6-16 characters\");\r\n\t\t\treportStatus(905);\r\n\t\t\treturn false; \r\n\t }\r\n\t if(!isLegalCharacters(nP))\r\n\t {\r\n\t\t\t//alert (\"Password is illegal\");\r\n\t\t\treportStatus(906);\r\n\t\t\treturn false; \r\n\t }\r\n }\r\n if(isEmpty(rP))\r\n {\r\n //alert(\"Please enter your new password!\");\r\n reportStatus(914);\r\n return false; \r\n }\r\n else\r\n {\r\n\t if(rP.length < 6 || rP.length > 16)\r\n\t\t{\r\n\t\t\t//alert (\"Password's length should be between 6-16 characters\");\r\n\t\t\treportStatus(905);\r\n\t\t\treturn false; \r\n\t }\r\n\t if(!isLegalCharacters(rP))\r\n\t {\r\n\t\t\t//alert (\"Password is illegal\");\r\n\t\t\treportStatus(906);\r\n\t\t\treturn false; \r\n\t }\r\n }\r\n if(nP != rP)\r\n {\r\n //alert(\"Passwords do not match.\");\r\n reportStatus(911);\r\n\t\tcForm.newPwd.value = \"\";\r\n\t\tcForm.retypePwd.value = \"\";\r\n\t\tcForm.newPwd.focus();\r\n return false; \r\n }\r\n \r\n return true;\r\n}", "title": "" }, { "docid": "0cccb51ccd1f208c0d2b72374bb1e36a", "score": "0.70243376", "text": "function checkPassword() {\n\tvar passwordCheck = $('#password-check')\n\treinitErrors('#password-error', passwordCheck);\n\n\tif ($('#password').isBlank())\n\t\tdisplayRightMsg(passwordCheck, i18n['err.pwd'], false);\n\telse\n\t\tdisplayRightMsg(passwordCheck, i18n['ok.pwd'], true);\n\tif ($('#password-confirm-check').is(':visible'))\n\t\tcheckPasswordConfirmation();\n}", "title": "" }, { "docid": "96782d5a796bd427d198f63cd28a73c8", "score": "0.70229787", "text": "function verifyPassword(password) {\r\n let length = password.length; //used to check length\r\n let upperCase = /[A-Z]/; //used to look for capital letters\r\n let lowerCase = /[a-z]/; //used to look for lowercase letters\r\n let numbers = /[0-9]/; //used to look for numbers\r\n let specialChar = /[^a-zA-Z0-9]/; //used to look for special characters including spaces\r\n\r\n let errors = []; //stores errors if found\r\n\r\n if (length < 10) {\r\n errors.push(\"Password length must be 10 characters\");\r\n }\r\n if (upperCase.test(password) == false) {\r\n errors.push(\"Password must contain capital letters\");\r\n }\r\n if (lowerCase.test(password) == false) {\r\n errors.push(\"Password must contain lowercase letters\");\r\n }\r\n if (numbers.test(password) == false) {\r\n errors.push(\"Password must contain numbers\");\r\n }\r\n if (specialChar.test(password) == false) {\r\n errors.push(\"Password must contain special characters\");\r\n }\r\n\r\n if (errors.length > 0) {\r\n //return the errors found to the user\r\n for (var i = 0; i < errors.length; i++) {\r\n return errors[i];\r\n }\r\n\r\n } else {\r\n //inform user the password meets all requirements\r\n return (\"Password is ok\");\r\n }\r\n}", "title": "" }, { "docid": "c945d9f46a669d3eef74285fafaaa35d", "score": "0.70118105", "text": "_checkPasswords() {\n if (this.state.password1 !== this.state.password2) {\n Alert.alert('Passwords are different.');\n return false;\n }\n if (this.state.password1 === null || this.state.password2 === null) {\n Alert.alert('Error: No Passwords found.');\n return false;\n }\n if (this.state.password1 === '' || this.state.password2 === '') {\n Alert.alert('No Password Input.')\n return false;\n }\n return true;\n }", "title": "" } ]
4cae8cab66eb7ddc6ba4b6641e168fff
Upload function: upload galleryPic1 pic to storage
[ { "docid": "4a36f62a16a83274eedc9fb26a7c9455", "score": "0.6586122", "text": "function uploadPortraitToStorage(file, location, userId) {\n // Create the file metadata\n var metadata = {\n contentType: 'image/jpeg'\n };\n // Upload file and metadata to the object 'images/mountains.jpg'\n var uploadTask = location.put(file, metadata);\n // Listen for state changes, errors, and completion of the upload.\n uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'\n function(snapshot) {\n // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n switch (snapshot.state) {\n case firebase.storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case firebase.storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n }, function(error) {\n console.log('照片上傳失敗:', error.message);\n // A full list of error codes is available at\n // https://firebase.google.com/docs/storage/web/handle-errors\n switch (error.code) {\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n break;\n\n case 'storage/canceled':\n // User canceled the upload\n break;\n\n case 'storage/unknown':\n // Unknown error occurred, inspect error.serverResponse\n break;\n }\n }, function() {\n console.log('照片成功上傳');\n // Upload completed successfully, now we can get the download URL\n var downloadURL = uploadTask.snapshot.downloadURL;\n // add galleryPic1 url to database\n firebase.database().ref('spPublic/' + userId + '/gallery').update({\n galleryPic1: downloadURL\n })\n .then (function() {\n console.log(\"galleryPic1 added to database: \", downloadURL);\n })\n .catch(function(error) {\n console.log(\"Error adding galleryPic1 to database: \", error);\n });\n });\n}", "title": "" } ]
[ { "docid": "ab1dd7d463c7f9f2bbc7c1e92f64d290", "score": "0.6807681", "text": "async uploadFile(file, createdId){ \n \n let fileName = file.name\n let ext = fileName.slice( fileName.lastIndexOf('.') ) \n \n // -- Add Original file in firebase storage -- //\n let storageRef = firebase.storage().ref()\n let imagesRef = storageRef.child('gallery/'+createdId+ext) \n\n let uploadState = await imagesRef.put(file).then( function(snapshot) { \n console.log('Uploaded !'); \n return true \n }).catch( (error) => {\n console.log(error)\n return false\n });\n \n return uploadState;\n\n // -- //\n \n }", "title": "" }, { "docid": "a298704733e2ef5834b79b5a659efa60", "score": "0.6745538", "text": "function insertImage(){\n var form_data = new FormData(); \n form_data.append(\"gallery_file\", document.getElementById('gallery_file').files[0]);\n \n $.ajax({\n url:\"scripts/save_gallery.php\",\n method:\"POST\",\n data: form_data,\n contentType: false,\n cache: false,\n processData: false, \n success:function(data)\n {\n $('#modal_gallery').modal('hide');\n toastr[data['status']](data['message']);\n clearGalleryFields();\n setTimeout( function () {\n window.location.reload();\n }, 3000 );\n }\n });\n }", "title": "" }, { "docid": "63385c891496e119518d809d8f7f1bb2", "score": "0.67290896", "text": "function AdminPhotoUploadImage(id,file,photoid,large,useHttp)\n{\n return api(AdminPhotoUploadImageUrl,{id:id,file:file,photoid:photoid,large:large},useHttp).sync();\n}", "title": "" }, { "docid": "e15e74daf3668df0eea5e5d65751cf02", "score": "0.66222566", "text": "function uploadToStorage(file, storageLocation, databaseLocation) {\n // Create the file metadata\n var metadata = {\n contentType: 'image/jpeg'\n };\n // Upload file and metadata to the object 'images/mountains.jpg'\n var uploadTask = storageLocation.put(file, metadata);\n // Listen for state changes, errors, and completion of the upload.\n uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'\n function (snapshot) {\n // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n switch (snapshot.state) {\n case firebase.storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case firebase.storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n },\n function (error) {\n console.log('照片上傳失敗:', error.message);\n // A full list of error codes is available at\n // https://firebase.google.com/docs/storage/web/handle-errors\n switch (error.code) {\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n break;\n\n case 'storage/canceled':\n // User canceled the upload\n break;\n\n case 'storage/unknown':\n // Unknown error occurred, inspect error.serverResponse\n break;\n }\n },\n function () {\n console.log('照片成功上傳');\n // Upload completed successfully, now we can get the download URL\n var downloadURL = uploadTask.snapshot.downloadURL;\n // add gallery URL to database\n databaseLocation.set(downloadURL)\n .then(function () {\n console.log(\"Picture added to database: \", downloadURL);\n })\n .catch(function (error) {\n console.log(\"Error adding picture to database: \", error);\n });\n });\n}", "title": "" }, { "docid": "ffb584e78f8087273970d3b12fe08c26", "score": "0.65985805", "text": "function upload() {\n fileCount = 0;\n for (var i in fileList) fileCount++;\n\n if (fileList != null) {\n //uploader.setSimUploadLimit(((fileCount > simultaneousUploads) ? simultaneousUploads : fileCount));\n uploader.uploadAll(\"/entry/uploadimage\", \"POST\", { }, \"upload\");\n }\n}", "title": "" }, { "docid": "7fac599695434f57cbb0fd735566f713", "score": "0.6591915", "text": "uploadPic(e){e.preventDefault();this.disableUploadUi(true);var imageCaption=this.imageCaptionInput.val();this.generateImages().then(pics=>{// Upload the File upload to Firebase Storage and create new post.\nfriendlyPix.firebase.uploadNewPic(pics.full,pics.thumb,this.currentFile.name,imageCaption).then(postId=>{page(`/user/${this.auth.currentUser.uid}`);var data={message:'New pic has been posted!',actionHandler:()=>page(`/post/${postId}`),actionText:'View',timeout:10000};this.toast[0].MaterialSnackbar.showSnackbar(data);this.disableUploadUi(false)},error=>{console.error(error);var data={message:`There was an error while posting your pic. Sorry!`,timeout:5000};this.toast[0].MaterialSnackbar.showSnackbar(data);this.disableUploadUi(false)})})}", "title": "" }, { "docid": "2d21552f55b69867ad9be68edb2cfef2", "score": "0.6591226", "text": "storeImage () {\n // get input element user used to select local image\n var input = document.getElementById('files');\n // have all fields in the form been completed\n if (this.newImageTitle && input.files.length > 0) {\n var file = input.files[0];\n // get reference to a storage location and\n storageRef.child('images/' + file.name)\n .put(file)\n .then(snapshot => this.addImage(this.newImageTitle, snapshot.downloadURL));\n // reset input values so user knows to input new data\n input.value = '';\n }\n }", "title": "" }, { "docid": "a999ee5f1bc705810ac3c50d873c4ef1", "score": "0.6565035", "text": "function uploadPic() {\n\n // Gets the id of the specific upload button\n imgPreview = $(this).attr(\"id\");\n\n var id = imgPreview.replace(\"edit-image\", \"\");\n\n //Changes it to the to the image screen to store the image\n imgPreview = \"imgAdd\" + id;\n\n //Gets the whole tag based on the id\n imgPreview = document.getElementById(imgPreview);\n\n //\n fileUpload = \"file-upload-addMedications\" + id;\n\n //\n fileUpload = document.getElementById(fileUpload);\n\n //Waits until there is a chnage in the image and uploads it to the cloudinary\n $(document).on(\"change\", fileUpload, uploadMedsCloudinary);\n}", "title": "" }, { "docid": "336b2917aea456c4b519841fedab338a", "score": "0.6424627", "text": "function add_img() {\n var i, URL, imageUrl, id, file,\n files = gId('type_file').files; // all files in input\n if (files.length > 0) {\n for (i = 0; i < files.length; i++) {\n file = files[i];\n if (!file.type.match('image.*')) { //Select from files only pictures\n continue;\n }\n // Create array Images to be able to choose what pictures will be uploaded.\n // You cannot change the value of an <input type=\"file\"> using JavaScript.\n Images.push(file);\n URL = window.URL;\n if (URL) {\n var imageUrl = URL.createObjectURL(files[i]); // create object URL for image \n var img_block = document.createElement(\"div\");\n img_block.className = \"img_block\";\n gId('photo_cont').appendChild(img_block)\n var img_story = document.createElement(\"img\")\n img_story.className = \"img_story\";\n img_story.src = imageUrl;\n img_block.appendChild(img_story);\n var button_delete = document.createElement(\"button\"); // create button to delete picture\n button_delete.className = \"button_3\";\n var x = document.createTextNode(\"x\");\n button_delete.appendChild(x)\n img_block.appendChild(button_delete);\n }\n }\n gId('photo_cont').style.display = 'inline-block';\n }\n}", "title": "" }, { "docid": "b34be114f51218668d0a5e95aeb9a4cf", "score": "0.6337212", "text": "function readImageUploadedit(input) {\n if (input.files && input.files[0]) {\n if (formDataedit.get(\"picture\") != null) {\n formDataedit.delete(\"picture\");\n }\n formDataedit.append(\"picture\", input.files[0]);\n }\n //$(\"#txtpicture-edit\").val(\"\");\n}", "title": "" }, { "docid": "ae07e37eb12f688c8e967a3d930a0502", "score": "0.63360727", "text": "function upload(e) {\n if (e.target.files[0].size > 1024 * 1024 * 2) {\n alert('Please upload image 2MB or below')\n return\n }\n ReactSaveImg\n .uploadFile(e.target.files[0], newFileName)\n .then((data) => {\n setImage(\"\")\n setImage(data.location)\n })\n .catch(err => console.error(err))\n }", "title": "" }, { "docid": "d789f0c5cbe67d6093c286380d59602d", "score": "0.6334839", "text": "function uploadPhoto(photoURI, photoType, databaseID){\n // !! Assumes variable fileURL contains a valid URL to a text file on the device,\n // for example, cdvfile://localhost/persistent/path/to/file.txt\n\n var leafSuccess = function (r) {\n //navigator.notification.alert(\"leaf photo uploaded\");\n console.log(\"Code = \" + r.responseCode);\n console.log(\"Response = \" + r.response);\n console.log(\"Sent = \" + r.bytesSent);\n cosole.log(\"survey.timeStart = \" + survey.timeStart);\n // deleteSurvey(survey.timeStart);\n };\n\n var fail = function (error) {\n navigator.notification.alert(\"An error has occurred: Code = \" + error.code);\n alert(\"upload error source: \" + error.source);\n alert(\"upload error target: \" + error.target);\n console.log(\"upload error source \" + error.source);\n console.log(\"upload error target \" + error.target);\n };\n\n var arthropodSuccess = function(r){\n //navigator.notification.alert(\"order photo uploaded\");\n\n //Increment number of arthropods submitted\n //here when there is a photo to upload\n //to prevent duplicate success alerts\n console.log(\"Code = \" + r.responseCode);\n console.log(\"Response = \" + r.response);\n console.log(\"Sent = \" + r.bytesSent);\n\n //If this was the last order photo to submit, clear form, submission succeeded\n // if(numberOfArthropodsSubmitted == numberOfArthropodsToSubmit) {\n // navigator.notification.alert(\"Successfully submitted survey data!\");\n // clearFields();\n\n // }\n };\n\n var options = new FileUploadOptions();\n options.fileKey = \"file\";\n options.mimeType=\"image/jpeg\";\n options.chunkedMode = false;\n options.headers = {\n Connection: \"close\"\n };\n\n // var params = {};\n // params.fullpath = imageURI;\n // params.name = options.fileName;\n \n // options.params = params;\n\n var ft = new FileTransfer();\n //If uploading leaf photo\n if(photoType.localeCompare(\"leaf-photo\") === 0) {\n options.fileName = \"survey_\" + databaseID + \"_leaf_photo.jpg\";\n ft.upload(photoURI, encodeURI(DOMAIN + \"/api/uploads.php?surveyID=\" + databaseID), leafSuccess, fail, options);\n }\n //Uploading arthropod photo\n else if(photoType.localeCompare(\"arthropod-photo\") === 0){\n options.fileName = \"order_\" + databaseID + \"_arthropod_photo.jpg\";\n ft.upload(photoURI, encodeURI(DOMAIN + \"/api/uploads.php?orderID=\" + databaseID), arthropodSuccess, fail, options);\n }\n}", "title": "" }, { "docid": "0ea442b4c821dbb88efec880373a1455", "score": "0.6332393", "text": "function uploadImage() {\n console.log(\"name\" + image_name);\n var praveen = {\n // image: fs.readFileSync(`../../FinalProject-master/public/img/${image_name}`),\n image: fs.readFileSync(`./public/uploads/${image_name}`),\n name: image_name,\n };\n connection.query(\"INSERT INTO images SET ? \", praveen, function (\n err,\n result\n ) {\n console.log(result);\n });\n }", "title": "" }, { "docid": "926bf870737aeb7bfb0d6c3edd0d71a3", "score": "0.6330086", "text": "function handleFileUploadSubmit4(e) {\n const uploadTask = storageRef.child(`${idPlace}/4`).put(selectedFile); //create a child directory called images, and place the file inside this directory\n document.querySelector('#file-submit_4').disabled = true\n document.querySelector('#file-submit_4').innerHTML = 'subiendo'\n uploadTask.on('state_changed', (snapshot) => {\n // Observe state change events such as progress, pause, and resume\n }, (error) => {\n // Handle unsuccessful uploads\n console.log(error);\n }, () => {\n // Do something once upload is complete\n uploadTask.then(snapshot => snapshot.ref.getDownloadURL())\n .then((url) => {\n database.ref('/'+idPlace+'/feed_4').set({\n 'url': url,\n\t\t\t\t\t\t'placeName': placeName\n });\n fileObject.target.value = ''\n document.querySelector('#file-submit_4').innerHTML = 'listo'\n document.querySelector('#file-submit_4').removeAttribute('disabled');\n })\n .catch(console.error);\n });\n }//end handleFileUploadSubmit2", "title": "" }, { "docid": "e04629ac3fb8d89c585be62eb3b3a0f9", "score": "0.6320594", "text": "function uploadImage(image) {\n if (!checkImage(image)) return false;\n //add to image list\n showLoader()\n .then(() => Menkule.post(\"/adverts/photo\", image))\n .then((data) => {\n appendFile(data);\n renderImages();\n $(\"#uploader\").val('');\n })\n .catch((err) => {\n $(\"#uploader\").val('');\n hideLoader()\n .then(() => App.parseJSON(err.responseText))\n .then(o => App.notifyDanger(o.result || o.Message, 'Üzgünüz'))\n .catch(o => App.notifyDanger(o, 'Beklenmeyen bir hata'));\n })\n }", "title": "" }, { "docid": "ec5bc734d06c6199f65567576ee1eca7", "score": "0.6318005", "text": "function onPhotoURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.jpg';\n }\n options.fileName = newfname;\n //alert(newfname);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n //options.headers = \"Content-Type: multipart/form-data; boundary=38516d25820c4a9aad05f1e42cb442f4\";\n options.chunkedMode = true;\n var ft = new FileTransfer();\n // alert(imageURI);\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=imageupload\"), win, fail, options);\n\n function win(r) {\n var resp = JSON.parse(r.response);\n window.location.reload();\n \n }\n\n function fail(error) {\n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "title": "" }, { "docid": "b6dfa4301d0809515eb664b164fadee9", "score": "0.62883294", "text": "function uploadToStorage(file, location, userId) {\n // Create the file metadata\n var metadata = {\n contentType: 'image/jpeg'\n };\n // Upload file and metadata to the object 'images/mountains.jpg'\n var uploadTask = location.put(file, metadata);\n // Listen for state changes, errors, and completion of the upload.\n uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'\n function(snapshot) {\n // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n switch (snapshot.state) {\n case firebase.storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case firebase.storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n }, function(error) {\n console.log('照片上傳失敗:', error.message);\n // A full list of error codes is available at\n // https://firebase.google.com/docs/storage/web/handle-errors\n switch (error.code) {\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n break;\n\n case 'storage/canceled':\n // User canceled the upload\n break;\n\n case 'storage/unknown':\n // Unknown error occurred, inspect error.serverResponse\n break;\n }\n }, function() {\n console.log('照片成功上傳');\n // Upload completed successfully, now we can get the download URL\n var downloadURL = uploadTask.snapshot.downloadURL;\n // add icURL to database\n firebase.database().ref('spPrivate/' + userId).update({\n icURL: downloadURL\n })\n .then (function() {\n console.log(\"icURL added to database: \", downloadURL);\n })\n .catch(function(error) {\n console.log(\"Error adding icURL to database: \", error);\n });\n });\n}", "title": "" }, { "docid": "d1f73c2112d0ee718212fe16f19476ad", "score": "0.6280742", "text": "handleUpload (event) {\n const file = event.target.files[0];\n const storageRef = firebase.storage().ref(`photos/${file.name}`);\n const task = storageRef.put(file);\n\n task.on('state_changed', snapshot => {\n let percentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n this.setState({\n uploadValue: percentage\n })\n }, error => {\n console.error(error.message);\n }, () => {\n // Upload complete\n const record = {\n photoURL: this.state.user.photoURL,\n displayName: this.state.user.displayName,\n image: task.snapshot.downloadURL\n }\n const dbRef = firebase.database().ref('pictures');\n const newPicture = dbRef.push();\n newPicture.set(record);\n });\n }", "title": "" }, { "docid": "12453b9dfeefb16b8d38489b96b65522", "score": "0.62802726", "text": "function onMzgPhotoURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.png';\n }\n options.fileName = newfname;\n options.mimeType = \"png\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n options.chunkedMode = true;\n var ft = new FileTransfer();\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=mzgimageupload\"), win, fail, options);\n\n function win(r) {\n localStorage.setItem('sendimage', JSON.stringify(r.response));\n // var resp = JSON.parse(r.response);\n window.location.reload();\n \n }\n\n function fail(error) { \n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "title": "" }, { "docid": "f1a1d42e21b7a0fd42443aad4f004372", "score": "0.62538624", "text": "function uploadGifo() {\n showUploadingUI()\n document.querySelector(\".create-gifos__wrapper-title\").innerHTML = \"\";\n const uploadGifoData = uploadGifosRequest(uploadGifoURL, gifoData);\n\n uploadGifoData\n .then((response) => {\n const gifoInfo = response.data;\n const gifoID = gifoInfo.id;\n let myGifosIDs = JSON.parse(localStorage.getItem(LOCAL_STORAGE_MYGIFS)) || [];\n myGifosIDs.push(gifoInfo);\n localStorage.setItem(LOCAL_STORAGE_MYGIFS, JSON.stringify(myGifosIDs));\n confirmUploadUI();\n\n const requestGifoInfoURL = `${constant.BASE_URL}gifs/${gifoID}${constant.API_KEY}`;\n return apiRequest(requestGifoInfoURL);\n }).then(response => {\n gifoURL = response.data.images.original.url;\n })\n .catch((error) => { console.log(error) });\n}", "title": "" }, { "docid": "7da6c120acc84b3811231bca12b1f117", "score": "0.624269", "text": "function handleFileUploadSubmit3(e) {\n const uploadTask = storageRef.child(`${idPlace}/3`).put(selectedFile); //create a child directory called images, and place the file inside this directory\n document.querySelector('#file-submit_3').disabled = true;\n document.querySelector('#file-submit_3').innerHTML = 'subiendo';\n uploadTask.on('state_changed', (snapshot) => {\n // Observe state change events such as progress, pause, and resume\n }, (error) => {\n // Handle unsuccessful uploads\n console.log(error);\n }, () => {\n // Do something once upload is complete\n uploadTask.then(snapshot => snapshot.ref.getDownloadURL())\n .then((url) => {\n database.ref('/'+idPlace+'/feed_3').set({\n 'url': url,\n\t\t\t\t\t\t'placeName': placeName\n });\n fileObject.target.value = ''\n document.querySelector('#file-submit_3').innerHTML = 'listo';\n document.querySelector('#file-submit_3').removeAttribute('disabled');\n })\n .catch(console.error);\n });\n }", "title": "" }, { "docid": "970fbfe24989771b1790fa2cf394d1be", "score": "0.62311804", "text": "uploadImage(e) {\n const { onUpload } = this.props;\n let file = e.target.files[0]\n this.orientImage(file, (src) => {\n onUpload({\n file,\n name: file.name,\n src\n })\n });\n }", "title": "" }, { "docid": "a27dfd8de431799086eebc432ce1909d", "score": "0.6227266", "text": "function storeImage(imageData,a,b){\n var max = 4;\n var name = a.toString().replace(/\\./g,'x')+\"and\"+ b.toString().replace(/\\./g,'y');\n console.log(\"in store image:\"+imageData)\n var storageRef = __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage().ref(name+\"/\");\n // Create a root reference\n\n var imageName = Date.now()+\".image\";\n var uploadTask = storageRef.child(imageName).putString(imageData, 'data_url');\n uploadTask.on('state_changed', function(snapshot){\n // Observe state change events such as progress, pause, and resume\n // code snippet from firebase documentation adapted\n switch (snapshot.state) {\n case __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n}, function(error) {\n // Handle unsuccessful uploads\n}, function() {\n console.log(\"sucess!\")\n var hash = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__backend_js__[\"c\" /* getHash */])(a,b);\n var firebaseRef = __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].database().ref(\"info\"); //top level <info>\n var infoRef = firebaseRef.child(hash);\n var src = infoRef.child(\"url\");\n src.set(uploadTask.snapshot.downloadURL);\n\n});\n}", "title": "" }, { "docid": "f6604be714c9c04e6a070aa70dc02fed", "score": "0.62164265", "text": "uploadPictureAndDescription(){\n const rootRef = firebase.database().ref().child(\"users\");\n const infoRef = rootRef.child('info');\n const userRef = infoRef.child(this.currentUser.uid);\n const picRef = userRef.child('picFolder');\n\n let folderNum = this.numPicFolders + 1; //increases the number of folders\n this.numPicFolders = this.numPicFolders + 1;\n\n //console.log(folderNum);\n let folderName = 'picFolder'+folderNum; //creates the name of the folder\n //console.log(folderName);\n picRef.update({\n folderName: null\n })\n //create the path to the next picture.\n const picPath = picRef.child(folderName);\n //console.log(picPath);\n if (this.state.tempUrl){\n \n picPath.set({\n picUrl: this.state.tempUrl,\n \n text: this.state.tempDescription\n \n })\n .then((user) => {\n this.setState({ status: 'Status: Uploaded picture!', descriptionModalVisible: true });\n\n })\n .catch((error) => {\n this.setState({ status: error.message });\n })\n this.setState({ modalVisible: false ,picFolders: \n [...this.state.picFolders,{ picture: this.state.tempUrl, description: this.state.tempDescription} ]}, () => {\n this.setState({ tempUrl : '' , tempDescription: ''});\n });\n Alert.alert(\n 'Notification',\n 'Upload successful!',\n [\n {text: 'OK', onPress: () => {}}\n ]\n )\n }\n \n }", "title": "" }, { "docid": "26d8688068e822a9bd187fa56de8cac8", "score": "0.6216268", "text": "function handleFileUploadSubmit2(e) {\n const uploadTask = storageRef.child(`${idPlace}/2`).put(selectedFile); //create a child directory called images, and place the file inside this directory\n document.querySelector('#file-submit_2').disabled = true;\n document.querySelector('#file-submit_2').innerHTML = 'subiendo';\n uploadTask.on('state_changed', (snapshot) => {\n // Observe state change events such as progress, pause, and resume\n }, (error) => {\n // Handle unsuccessful uploads\n console.log(error);\n }, () => {\n // Do something once upload is complete\n uploadTask.then(snapshot => snapshot.ref.getDownloadURL())\n .then((url) => {\n database.ref('/'+idPlace+'/feed_2').set({\n 'url': url,\n\t\t\t\t\t\t'placeName': placeName\n });\n fileObject.target.value = ''\n document.querySelector('#file-submit_2').innerHTML = 'listo';\n document.querySelector('#file-submit_2').removeAttribute('disabled');\n })\n .catch(console.error);\n });\n }", "title": "" }, { "docid": "6f463c1ad3546bf8d1935fbe68f89337", "score": "0.6214827", "text": "function onPhotoURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.jpg';\n }\n options.fileName = newfname;\n //alert(newfname);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n //options.headers = \"Content-Type: multipart/form-data; boundary=38516d25820c4a9aad05f1e42cb442f4\";\n options.chunkedMode = false;\n var ft = new FileTransfer();\n // alert(imageURI);\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=imageupload\"), win, fail, options);\n\n function win(r) {\n var resp = JSON.parse(r.response);\n window.location.reload(); \n }\n\n function fail(error) {\n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "title": "" }, { "docid": "19b38e2fbe715a21f45386cd56feb137", "score": "0.6190294", "text": "function uploadPic() {\n document.getElementById(\"submit_btn\").disabled = true;\n pic = this.files[0];\n console.log(\"success\");\n var uploadTask = storage.ref().child(\"magary/\" + new Date()+'.jpg').put(pic);\n\n uploadTask.on('state_changed', function (snapshot) {\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n document.getElementById(\"bar\").style.width = progress + '%';\n }, function (error) {\n console.log(error.message);\n }, function () {\n uploadTask.snapshot.ref.getDownloadURL().then(function (downloadURL) {\n console.log('File available at', downloadURL);\n document.getElementById('url').value = downloadURL;\n\n var myimg = document.getElementById(\"myimg\");\n myimg.src = downloadURL;\n\n document.getElementById(\"submit_btn\").disabled = false;\n\n\n });\n });\n\n}", "title": "" }, { "docid": "1ff88917c5d9682b00972c1afd8818e4", "score": "0.61901665", "text": "upload(file) {\n const cls = this.constructor\n const behaviourMap = this._gallery.constructor.behaviours\n const behaviours = this.parentBehaviours\n\n // Clear the current state component\n this._destroyStateComponent()\n\n // Build the form data\n const formData = behaviourMap.formData[behaviours.formData](\n this,\n file\n )\n\n // Set up the uploader\n this._uploader = behaviourMap.uploader[behaviours.uploader](\n this,\n this.parentOptions.uploadUrl,\n formData\n )\n this._uploader.init()\n\n // Set up event handlers for the uploader\n $.dispatch(this._gallery.input, 'uploading')\n\n $.listen(\n this._uploader.uploader,\n {\n 'cancelled aborted error': () => {\n $.dispatch(this._gallery.input, 'uploadfailed')\n\n // Remove the item\n this.destroy()\n\n // Dispatch the removed event\n $.dispatch(this.item, 'removed', {'item': this})\n },\n\n 'uploaded': (event) => {\n $.dispatch(this._gallery.input, 'uploaded')\n\n try {\n // Extract the asset from the response\n const asset = behaviourMap.asset[behaviours.asset](\n this,\n event.response\n )\n\n // Populate the field\n this.populate(asset)\n\n } catch (error) {\n if (error instanceof ResponseError) {\n\n // Display the upload error\n this.postError(error.message)\n\n } else {\n\n // Re-through any JS error\n throw error\n }\n }\n }\n }\n )\n\n // Set the new state\n this._state = 'uploading'\n }", "title": "" }, { "docid": "2bc291e17612ccbdee23fb8c85b6be95", "score": "0.6181373", "text": "function uploadImage(fileName){\n\t // Create a root reference\n\t var ref = firebase.storage().ref();\n\n\t const file = fileName.get(0).files[0]\n\t const name = (+new Date()) + '-' + file.name\n\t const metadata = {\n\t \tcontentType: file.type\n\t }\n\t const task = ref.child(name).put(file, metadata)\n\n\t var image_url = '';\n\t task\n\t .then(snapshot => snapshot.ref.getDownloadURL())\n\t .then(url => {\n\n\t \timage_url = url ;\n\t \tconsole.log('image name : ' + name)\n\t \tconsole.log('image url : ' + image_url );\n\t \t$('#showimg').attr('src',image_url)\n\t })\n\n\n\t }", "title": "" }, { "docid": "c7548c41698acd411b8942f1fd26cd12", "score": "0.6178497", "text": "function changeProfilePic(file) {\r\n if (file.target.files[0].type == 'image/jpeg' || file.target.files[0].type == 'image/png') {\r\n const currentUserEmail = authentication.currentUser.email;\r\n const targetFile = file.target.files[0];\r\n const storageRef = storage.ref(USER_PROFILE_PICTURE_FOLDER + currentUserEmail + '.jpeg');\r\n const task = storageRef.put(targetFile);\r\n\r\n const profilePicUploadProgressContainer = document.getElementById('profile-pic-upload-progress-container');\r\n const profilePicUploadProgressBar = document.getElementById('profile-pic-upload-progress-bar');\r\n profilePicUploadProgressContainer.setAttribute('style', 'display: block');\r\n\r\n task.on('state_changed', function progress(snapshot) {\r\n const uploadPercentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\r\n profilePicUploadProgressBar.style.width = uploadPercentage + '%';\r\n }, function error(error) {\r\n displayErrorAlert(error.message);\r\n }, function complete() {\r\n savePicUrl();\r\n });\r\n } else {\r\n displayErrorAlert('Select Image File First');\r\n }\r\n}", "title": "" }, { "docid": "5a42515546463411ccf1ad23005797c9", "score": "0.6175286", "text": "function handleUploads() {\n \n}", "title": "" }, { "docid": "c73f9dcf2e0c1f32afdb5d94c8781f1d", "score": "0.6173673", "text": "function uploadFile() {\n ImagePicker.openPicker({\n width: 300,\n height: 400,\n cropping: true,\n }).then(image => {\n let formData = new FormData();\n let file = {\n uri: image.path,\n type: \"multipart/form-data\",\n name: \"image.png\",\n };\n formData.append(\"files\", file);\n if (profileInfo?.id) {\n formData.append(\"id\", profileInfo.id);\n }\n formData.append(\"userId\", global.userInfo.uId);\n updateProfile(formData)\n .then(res => {\n dispatch({\n type: PROFILE_INFO,\n profileInfo: res.profileInfo,\n });\n })\n .catch(res => {\n Toast.showToast(\"update theme failed!\" + res.msg);\n });\n });\n }", "title": "" }, { "docid": "72b5bc642fa26c8bc0f068ddb1bb2756", "score": "0.61728865", "text": "function uploadFile({...files}) {\n const types = /jpg|jpeg|png|gif|pdf/;\n errorContainer.innerHTML = '';\n document.getElementById(\"preview-container\").innerHTML = '';\n for (let prop in files) {\n if (types.test(files[prop].type)) {\n let reader = new FileReader();\n let newPreviewImg = new Image();\n reader.onloadend = function () {\n newPreviewImg.src = reader.result;\n document.getElementById('preview-container').appendChild(newPreviewImg);\n }\n if (files) reader.readAsDataURL(files[prop]);\n dataImgs.set(files[prop].name, files[prop])\n } else {\n errorMessege(files[prop].name)\n }\n }\n}", "title": "" }, { "docid": "3aef34b74418d4f0fba001fcd5b447f2", "score": "0.61566246", "text": "uploadProfileImage(callback=()=>{}) {\n const state = Store.getState().profile;\n if (!state.selectedImage) { callback(); return; }\n const imageFile = Backend.auth.user().email+\"-\"+Date.now()+\".jpg\";\n let previousImageFile = decodeURIComponent(state.image).split(\"/\").pop().split(\"?\").shift();\n Backend.storage.deleteFile(previousImageFile, () => {\n Store.changeProperty(\"profile.image\",Backend.storage.getFileUrl(imageFile));\n Backend.storage.putFile(imageFile,state.selectedImage,() => {\n callback();\n })\n })\n }", "title": "" }, { "docid": "8433feca7d563e59daafb808b399006e", "score": "0.6150554", "text": "async function addImage() {\n const file = document.querySelector(\"#fileInput\").files[0]\n const title = $('#albumTitel').val()\n const desc = $('#albumDisc').val()\n const image = await toBase64(file)\n const hash = urlParams.get('hash');\n const id = urlParams.get('id');\n uploadImage(image, hash, id, title, desc)\n}", "title": "" }, { "docid": "2e9d352260627f582dd26c0a3f279943", "score": "0.61345094", "text": "function saveImages(callback){\n\tif($('.slider-wrap .slider-content-wrap .slide-image-wrap').length > 0){\n\t\tvar uploadCount = $('.slider-wrap .slider-content-wrap .slide-image-wrap img[data-type=upload]').length;\n\t\tvar i = 0;\n\t\tif(uploadCount > 0){\n\t\t\t$('.slider-wrap .slider-content-wrap .slide-image-wrap').each(function(){\n\t\t\t\tvar _this = $(this);\n\t\t\t\tif($(this).find('img').attr('data-type') == 'upload'){\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl:\t'/admin/settings/gallery/create',\n\t\t\t\t\t\ttype:\t'POST',\n\t\t\t\t\t\theaders:{'X-CSRF-TOKEN': $('meta[name=csrf-token]').attr('content')},\n\t\t\t\t\t\tdata:\t{\n\t\t\t\t\t\t\tupload:\t$(this).find('img').attr('src'),\n\t\t\t\t\t\t\tajax:\t1\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror:\tfunction(jqXHR){\n\t\t\t\t\t\t\tshowError(jqXHR.responseText, 'POST::/admin/settings/gallery/create');\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\tdata = JSON.parse(data);\n\t\t\t\t\t\t\t\tswitch(data.message){\n\t\t\t\t\t\t\t\t\tcase 'success':\n\t\t\t\t\t\t\t\t\t\tstatusBarAddMessage(true, data.text);\n\t\t\t\t\t\t\t\t\t\tshowStatus(false);\n\t\t\t\t\t\t\t\t\t\t_this.find('img').attr('src',data.image.src).attr('data-type','file');\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'error':\n\t\t\t\t\t\t\t\t\t\tstatusBarAddMessage(false, data.text);\n\t\t\t\t\t\t\t\t\t\tshowStatus(false);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}catch(e){\n\t\t\t\t\t\t\t\tshowError(e + data, 'POST::/admin/settings/gallery/create');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}).done(function(){\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif(uploadCount == i){\n\t\t\t\t\t\t\tcallback();\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}else{\n\t\t\tcallback();\n\t\t}\n\t}else{\n\t\tcallback();\n\t}\n}", "title": "" }, { "docid": "39d5b1d9735c7a6f3170a4263111b98d", "score": "0.6132792", "text": "function uploadImage(file){\n setShowAlert(false);\n setImgFile(URL.createObjectURL(file));\n setFormImg(file);\n }", "title": "" }, { "docid": "6bfc6303be96650d0cf3bbb60cde85f8", "score": "0.6125845", "text": "function sendImage() {\n console.log(\"attempting upload\");\n console.log($('#imgInp'));\n\n if ($('#imgInp')[0].files[0]) {\n var file = $('#imgInp')[0].files[0];\n targetFileRef.put(file).then(function (snapshot) {\n console.log('Uploaded.');\n });\n } else {\n console.log(\"No new image to upload.\");\n }\n\n}", "title": "" }, { "docid": "b7a06955fc59fee1544e5244b204cb1f", "score": "0.61135226", "text": "function uploadProfilePicture() {\n // Clear messages\n console.log(vm.uploader);\n vm.success = vm.error = null;\n vm.uploader.uploadAll();\n }", "title": "" }, { "docid": "94d7a484fb9d7eb11d0ac027fae4e005", "score": "0.60987693", "text": "function onAvatarURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.jpg';\n }\n options.fileName = newfname;\n //alert(newfname);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n //options.headers = \"Content-Type: multipart/form-data; boundary=38516d25820c4a9aad05f1e42cb442f4\";\n options.chunkedMode = false;\n var ft = new FileTransfer();\n // alert(imageURI);\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=avatarupload\"), win, fail, options);\n\n function win(r) {\n var resp = JSON.parse(r.response);\n window.location.assign(\"edit-profile.html\"); \n }\n\n function fail(error) {\n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "title": "" }, { "docid": "011fb82f784c8a7b2332bddea2e23190", "score": "0.60949117", "text": "async uploadImage(currentBook) {\n const { imageFile } = this.state\n debugger\n const storageRef = storage.ref();\n const fileRef = storageRef.child(imageFile.name);\n await fileRef.put(imageFile);\n currentBook.image = await fileRef.getDownloadURL();\n // const fileUrl = await fileRef.getDownloadURL();\n // this.setState(currentBook);\n }", "title": "" }, { "docid": "353a317cc3748311d99420343669d6fc", "score": "0.6088888", "text": "ImageUpload(e) {\n let file = e.target.files[0];\n let fileSize = file.size / 1024 / 1024;\n let fileType = file.type;\n this.setState({ fileType: file.type, fileName: file.name, fileSize: fileSize });\n this.getCentralLibrary();\n if (this.state.totalLibrarySize < 50) {\n let fileExists = this.checkIfFileAlreadyExists(file.name, \"image\");\n let typeShouldBe = _.compact(fileType.split('/'));\n if (file && typeShouldBe && typeShouldBe[0] == \"image\") {\n if (!fileExists) {\n let data = { moduleName: \"PROFILE\", actionName: \"UPDATE\" }\n let response = multipartASyncFormHandler(data, file, 'registration', this.onFileUploadCallBack.bind(this, \"image\"));\n } else {\n toastr.error(\"Image with the same file name already exists in your library\");\n this.setState({\n uploadingAvatar: false,\n uploadingAvatar1: false,\n uploadingImage2: false,\n });\n }\n } else {\n toastr.error(\"Please select a Image Format\");\n }\n } else {\n toastr.error(\"Allotted library limit exceeded\");\n }\n }", "title": "" }, { "docid": "86deac31293ee9a7a5f7237914e26e38", "score": "0.608776", "text": "function _doImageUpload(){\n var dataUrl = _getDataUrl($img),\n metaTransferId = (function(){\n if(metaTransfer && metaTransfer.getServerSideId())\n return metaTransfer.getServerSideId();\n else if(_locInfo.argumenta.metadata)\n return _locInfo.argumenta.metadata;\n else\n return 'null';\n })()\n transfer = basiin.tell(dataUrl);\n\n transfer.event.add({\n 'onAfterFinalize':function(event){\n frameProgressBar.setProgress(0);\n window.location = srv.location\n +'/'+ srv.basiin\n +'/image/uploaded/'+ basiin.transaction().id\n +'/'+ transfer.getServerSideId()\n +'/'+ metaTransferId\n },\n 'onAfterPacketLoad':function(event){\n frameProgressBar.setProgress(\n event.object.getProgress());\n }\n });\n }", "title": "" }, { "docid": "5cd75fad485700d2130f3263941149ce", "score": "0.6079962", "text": "function upload(){\n\t\t\t\tvar b64content = fs.readFileSync('image-store/photo.jpg', { encoding: 'base64' })\n\n\t\t\t\tT.post('media/upload', { media_data: b64content }, function (err, data, response) {\n\t\t\t\t // now we can assign alt text to the media, for use by screen readers and\n\t\t\t\t // other text-based presentations and interpreters\n\t\t\t\t var mediaIdStr = data.media_id_string\n\t\t\t\t // var altText = \"Small flowers in a planter on a sunny balcony, blossoming.\"\n\t\t\t\t var meta_params = { media_id: mediaIdStr }\n\n\t\t\t\t T.post('media/metadata/create', meta_params, function (err, data, response) {\n\t\t\t\t if (!err) {\n\t\t\t\t // now we can reference the media and post a tweet (media will attach to the tweet)\n\t\t\t\t var params = { status: txt.text, media_ids: [mediaIdStr] }\n\n\t\t\t\t T.post('statuses/update', params, function (err, data, response) {\n\t\t\t\t console.log(\"tweet with picture\");\n\t\t\t\t })\n\t\t\t\t }\n\t\t\t\t })\n\t\t\t\t});\n\n\t\t\t\t// clear directory\n\n\t\t\t\tvar path = 'image-store/*';\n\n\t\t\t\texec('rm -r ' + path, function (err, stdout, stderr) {\n\t\t\t\t // your callback goes here\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "23d4191b4779b50cb59d8758e647c2f8", "score": "0.6069627", "text": "async uploadImageAsync(uri, spot_id) {\n console.log(\"URI\", uri);\n const response = await fetch(uri);\n const blob = await response.blob();\n const ref = firebase\n .storage()\n .ref()\n .child(`lot_images/${current_spot.owner}/${current_spot.key}/lot.jpg`);\n await ref.put(blob).then(() => {\n console.log(\"in the async action\");\n self.props.navigation.navigate(\"MySpots\");\n });\n }", "title": "" }, { "docid": "026bd87994cf0e7bc43aaa817b973a07", "score": "0.6067093", "text": "function insertImageInDB(productID, index, fileData, callback) {\n // console.log(\"insertImageInDB\");\n let storageRef = firebase\n .storage()\n .ref()\n .child(`${generateID(30)}.jpg`);\n storageRef.put(fileData).then((snapshot) => {\n // console.log(snapshot);\n snapshot.ref.getDownloadURL().then((url) => callback(url));\n // callback(snapshot.errorCode.);\n });\n // let storageRef = firebase.storage().ref().child(`asd.jpg`);\n // storageRef.put(fileData).then((snapshot) => {\n // // console.log(snapshot);\n // snapshot.ref.getDownloadURL().then((url) => callback(url));\n // // callback(snapshot.errorCode.);\n // });\n}", "title": "" }, { "docid": "f0b1ece7b8d8de707acd043748dc4715", "score": "0.6040318", "text": "function upload(files, callback){\n let allowedFormats= [\"jpg\", \"jpeg\", \"png\"];\n let maxSize = (1024 * 1024) * 2; //2MB\n for(let i=0; i<files.length; i++){\n let format = files[i][\"name\"].split(\".\").pop();\n if(allowedFormats.indexOf(format) > -1 ){\n let name = files[i][\"name\"];\n let size = files[i][\"size\"];\n\n //img too big\n if(size >= maxSize){\n new Notification(\"Image must be smaller than 2MB\", 8, \"error\").render();\n }\n else{\n new Notification(\"Uploading...\", 15).render();\n var formImage = new FormData();\n formImage.append('image', files[i]);\n var session = getCookie(\"session\");\n if(session !== \"\"){\n formImage.append('sid', session);\n Quas.ajax({\n url: \"/php/upload.php\",\n type: \"POST\",\n data: formImage,\n //contentType:false,\n //cache: false,\n //processData: false,\n success: function(data){\n clearNotifications(\"default\");\n\n if(data.substr(0,3) === \"/i/\"){\n new Notification(\"Uploaded: \" + name, 4, \"success\").render();\n callback(data);\n }\n else{\n new Notification(\"Upload Error\", 8, \"error\").render();\n console.log(\"Upload Error:\"+data);\n }\n }});\n }\n }\n }\n //invalid format\n else{\n new Notification(\"File format must be png or jpeg\", 8, \"error\").render();\n }\n }\n}", "title": "" }, { "docid": "9dc7985f4ed41d271e79aa95a066f150", "score": "0.6035789", "text": "onImageUpload(type, e) {\n\t\tconst { header, consider, plans, questions } = this.state;\n\t\tconst ref = this;\n\t\t// Upload header images\n\t\tvar Headerfiles = document.getElementsByClassName('header-file');\n\t\tObject.keys(Headerfiles).map((key, index) => {\n\t\t\tif (Headerfiles[index].files && Headerfiles[index].files[0]) {\n\t\t\t\tvar reader = new FileReader();\n\t\t\t\treader.onload = function (e) {\n\t\t\t\t\tconst arr = type.split(\"_\");\n\t\t\t\t\tif (type.includes('back')) {\n\t\t\t\t\t\theader.back_url = e.target.result;\n\t\t\t\t\t\tref.setState({ header });\n\t\t\t\t\t} else if (type.includes('check')) {\n\t\t\t\t\t\tvar index = arr[1].split('check')[1];\n\t\t\t\t\t\theader.items[index].path = e.target.result;\n\t\t\t\t\t\tref.setState({ header });\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar index = arr[1].split('list')[1];\n\t\t\t\t\t\theader.list.items[index].path = e.target.result;\n\t\t\t\t\t\tref.setState({ header });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treader.readAsDataURL(Headerfiles[index].files[0]);\n\t\t\t}\n\t\t});\n\t\t// Upload consider image\n\t\tvar Considerfiles = document.getElementsByClassName('consider-file');\n\t\tObject.keys(Considerfiles).map((key, index) => {\n\t\t\tif (Considerfiles[index].files && Considerfiles[index].files[0]) {\n\t\t\t\tvar reader = new FileReader();\n\t\t\t\treader.onload = function (e) {\n\t\t\t\t\tconst arr = type.split(\"_\");\n\t\t\t\t\tvar index = arr[1].split('item')[1];\n\t\t\t\t\tconsider.items[index].url = e.target.result;\n\t\t\t\t\tref.setState({ consider });\n\t\t\t\t}\n\t\t\t\treader.readAsDataURL(Considerfiles[index].files[0]);\n\t\t\t}\n\t\t});\n\t\t// Upload plans image\n\t\tvar Plansfiles = document.getElementsByClassName('plans-file');\n\t\tObject.keys(Plansfiles).map((key, index) => {\n\t\t\tif (Plansfiles[index].files && Plansfiles[index].files[0]) {\n\t\t\t\tvar reader = new FileReader();\n\t\t\t\treader.onload = function (e) {\n\t\t\t\t\tconst arr = type.split(\"_\");\n\t\t\t\t\tvar index = arr[1].split('item')[1];\n\t\t\t\t\tplans.items[index].url = e.target.result;\n\t\t\t\t\tref.setState({ plans });\n\t\t\t\t}\n\t\t\t\treader.readAsDataURL(Plansfiles[index].files[0]);\n\t\t\t}\n\t\t});\n\t\t// Upload question image\n\t\tvar Questionsfiles = document.getElementsByClassName('questions-file');\n\t\tObject.keys(Questionsfiles).map((key, index) => {\n\t\t\tif (Questionsfiles[index].files && Questionsfiles[index].files[0]) {\n\t\t\t\tvar reader = new FileReader();\n\t\t\t\treader.onload = function (e) {\n\t\t\t\t\tconst arr = type.split(\"_\");\n\t\t\t\t\tvar index = arr[1].split('item')[1];\n\t\t\t\t\tquestions.items[index].url = e.target.result;\n\t\t\t\t\tref.setState({ questions });\n\t\t\t\t}\n\t\t\t\treader.readAsDataURL(Questionsfiles[index].files[0]);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "a163b229bea4e3bf08ba12ed11fce150", "score": "0.6032945", "text": "function handleFile(files_arr, node) {\n var file = files_arr[0];\n var imagified = node.id.split('F')[0] + 'Image';\n if (!files_arr[0].type.match('image/.*')) {\n alert('You can only add images at the moment.');\n return;\n }\n var filePath = auth.currentUser.uid + '/' + imagified + '/' + file.name;\n return storage\n .ref(filePath)\n .put(file)\n .then(function(snapshot, node) {\n var fullPath = snapshot.metadata.fullPath; //TIP: snapshot.metadata.downloadURLs[0] <-- Gets the viewable image link\n document.getElementById(fullPath.split('/')[1]).innerHTML = fullPath;\n });\n}", "title": "" }, { "docid": "c10dccdc5a3b58163666c338ab80beef", "score": "0.6027087", "text": "function uploadImage(){\n var d = new Date();\n var n = d.getTime();\n ImgName = n\n var uploadTask = firebase.storage().ref('Images/' +ImgName+\".jpg\").put(files[0]);\n uploadTask.on('state_changed',function(snapshot){\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes)*100;\n }, \n function(error){\n alert('error in saving the image');\n }, \n function(){\n uploadTask.snapshot.ref.getDownloadURL().then(function(url){\n ImgUrl = url;\n photoLink = ImgUrl;\n console.log(photoLink);\n\n });\n \n });\n}", "title": "" }, { "docid": "d303ffe9aaa58d129242dff5b28f96ae", "score": "0.60220295", "text": "async uploadImage(e) {\n const { files } = e.target;\n const data = new FormData();\n data.append('file', files[0]);\n // Append websiteImages preset\n data.append('upload_preset', 'websiteImages');\n\n // Delete Auth header to prevent cors error\n delete axios.defaults.headers.common['Authorization'];\n\n // Send and wait for the post request\n const file = await axios({\n method: 'POST',\n url: 'https://api.cloudinary.com/v1_1/jwalkercreations-com/image/upload',\n data\n });\n\n // Grab the image id for react components\n const imageId = file.data.public_id;\n\n // Update profile's state with new id\n this.props.updateImageId(this.props.imageIndex, imageId);\n }", "title": "" }, { "docid": "d4519bc931f6b8d628c6ebb9871a5c0a", "score": "0.6016205", "text": "function onemedia(onefileob, final) {\n var fileid = crypto.randomBytes(16).toString('hex'); /*generated img name for save*/\n var uplpath = onefileob.path; /*path to uploaded file*/\n var filename = onefileob.originalFilename || '__empty__'; /*Original media filename to db*/\n var filetype = path.extname(filename);\n var imgpath = path.join(path.dirname(uplpath), fileid) + filetype;\n var thumbname = 'thumb_' + fileid + '.jpg';\n var thumbpath = path.join(path.dirname(uplpath), thumbname);\n\n /*Delete path and thumb when tasks returning any error*/\n var clean = function clean(files) {\n files.forEach(function(media) {\n fs.unlink(media, function(err) {\n if(!err) {\n console.log('Soubor ' + media + ' byl vymazán!');\n } else {\n console.log(err);\n }\n });\n });\n };\n\n /*tasks runs serial on one image file*/\n var tasks = [\n function renaming(cb) { /*rename image to orig name*/\n fs.rename(uplpath, imgpath, function(err) {\n if (err) {\n cb(' Uložení ' + filename + ' selhalo chyba: ' + err);\n } else {\n cb(null, ' Uložení ' + filename + ' OK ');\n }\n });\n },\n function mkThumb(cb) { /*create Thumb icon*/\n im.convert(imgpath, ['-resize', 'x100', '-auto-orient', \n '-quality', 50, '-strip'], thumbpath, function(err, result){\n if (err) {\n cb(' Vytvoření náhledu ' + filename + ' selhalo chyba: ' + err);\n clean([imgpath]);\n } else {\n cb(null, ' Vytvoření náhledu ' + filename + ' OK ');\n }\n });\n },\n function save(cb) { /*save data to db*/\n var values = [null, filename, filetype, fileid];\n Model.query(\"INSERT INTO \" + sqltable + \" VALUES(?, ?, ?, ?)\", values, false, function(err, result) {\n if (err) {\n cb(' Uložení záznamu o médiu ' + filename + ' selhalo chyba: ');\n clean([imgpath, thumbpath]);\n } else {\n cb(null, ' Údaje k souboru ' + filename + ' uloženy OK ');\n }\n });\n }\n ];\n\n var flow = new Flow();\n flow.cf(tasks, { errorbreak: true, limit: 1, debugmode: false }, function (err, results) {\n return (err) ? final(err, results) : final(null, results);\n });\n}", "title": "" }, { "docid": "f93d40b94260a47056ccc8a08cee3e75", "score": "0.60101175", "text": "function onPhotoURISuccess(imageURI) {\n\n //alert('ok 1: ' + imageURI);\n\n try {\n //FileIO.updateCameraImages(imageURI);\n //alert('ok 2: ' + imageURI);\n upload_file (imageURI); \n \n }\n catch (e) {\n navigator.notification.alert('Error code: ' + e, null, 'Capture Loading Error');\n } \n\n}", "title": "" }, { "docid": "87572aeac61617d15fbb238693ca49a3", "score": "0.59892154", "text": "function uploadFile(){\n\t\nvar filename = selectedFile.name;\n\nvar storageRef = firebase.storage().ref('/images/' + filename);\n\nvar uploadTask = storageRef.put(selectedFile);\n\nuploadTask.on('state_changed',function(snapshot){\n\n},function(error){\n\n},function() {\n // Handle successful uploads on complete\n // For instance, get the download URL: https://firebasestorage.googleapis.com/...\n uploadTask.snapshot.ref.getDownloadURL().then(function(downloadURL) {\n console.log('File available at', downloadURL);\n \n });\n});\n}", "title": "" }, { "docid": "736325efb5df1edd441757f2e0838634", "score": "0.5987829", "text": "function upload(){\n const {Storage} = require('@google-cloud/storage');\n\n // Your Google Cloud Platform project ID\n const projectId = 'check-221407';\n\n // Creates a client\n const storage = new Storage({\n projectId: projectId,\n });\n\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n const bucketName = 'cal_ballots';\n const filename = 'hint10.JPG';\n\n // Uploads a local file to the bucket\n await storage.bucket(bucketName).upload(filename, {\n // Support for HTTP requests made with `Accept-Encoding: gzip`\n gzip: true,\n metadata: {\n // Enable long-lived HTTP caching headers\n // Use only if the contents of the file will never change\n // (If the contents will change, use cacheControl: 'no-cache')\n cacheControl: 'public, max-age=31536000',\n },\n });\n\n console.log(`${filename} uploaded to ${bucketName}.`);\n}", "title": "" }, { "docid": "9ebff8d76e209f2b3e1393bdebec0d60", "score": "0.59844196", "text": "function upload(form) {\n \n}", "title": "" }, { "docid": "2465414be70187f52bc6ccc526404b52", "score": "0.59795064", "text": "function uploadEventImage() {\n // Clear messages\n vm.success = vm.error = null;\n\n // Start upload\n vm.uploader.uploadAll();\n }", "title": "" }, { "docid": "3f85b32723e6f52f6bc4551e18d90e2e", "score": "0.5973135", "text": "function InputUpload(e){\n var files = e.target.files;\n var file = files[0];\n if (isValid(file)){\n loadPreview(file);\n uploadImage(file);\n }\n}", "title": "" }, { "docid": "ed8e273da46b30c56c67483c91845bd0", "score": "0.5971429", "text": "onSubmit() {\r\n console.log('picture: ' + this.state.Picture)\r\n let imageRef = storageRef.child('images/' + this.state.Picture)\r\n var metadata = {\r\n contentType : 'image/jpeg'\r\n }\r\n imageRef.put(this.state.imageFile[0], metadata).then((snapshot) => {\r\n fetch('/addProduct', {\r\n method : 'post',\r\n headers : {\r\n Accept : 'application/json',\r\n 'Content-type' : 'application/json'\r\n },\r\n body : JSON.stringify({\r\n Name : this.state.Name,\r\n Price : this.state.Price,\r\n Stock : this.state.Stock,\r\n Picture : this.state.Picture,\r\n Description : this.state.Description,\r\n Discount : this.state.Discount,\r\n Category : this.state.Category\r\n })\r\n }).then((res) => {\r\n if (res.status === 200) {\r\n alert('Tuote Lisätty')\r\n }\r\n })\r\n })\r\n }", "title": "" }, { "docid": "ad32af5ca7f1cfba00a499a3342abe34", "score": "0.596008", "text": "function toupload(){\n const uploader = document.getElementById('uploadfile');\n uploader.addEventListener('change', (event) => {\n const [ file ] = event.target.files;\n const validFileTypes = [ 'image/jpeg', 'image/png', 'image/jpg' ]\n const valid = validFileTypes.find(type => type === file.type);\n if (! valid){\n window.alert(\"You must upload an image file (jpg/jpeg/png) !\");\n return false;\n }\n const upload_2 = document.getElementById('upload_button_2');\n upload_2.onclick = function () {\n const description = document.getElementById('filedes').value;\n if (! description){\n window.alert(\"The description must not left empty!\");\n return false;\n }\n const reader = new FileReader();\n reader.readAsDataURL(file);\n\n reader.onload = (e) => {\n const payload = {\n \"description_text\": description,\n \"src\" : (e.target.result.split(','))[1]\n }\n const path = 'post';\n const headers = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization' : 'Token ' + checkStore('token')\n };\n const method = 'POST';\n api.makeAPIRequest(path, {\n method, headers,\n body: JSON.stringify(payload)\n }).then(function () {\n window.alert('You have successfully uploaded!');\n location.reload();\n });\n };\n }\n });\n}", "title": "" }, { "docid": "2499b445bc49de0ac53caaa3284657ee", "score": "0.5945336", "text": "_initSingleImageUpload() {\n if (typeof SingleImageUpload !== 'undefined' && document.getElementById('singleImageUploadExample')) {\n const singleImageUpload = new SingleImageUpload(document.getElementById('singleImageUploadExample'), {\n fileSelectCallback: (image) => {\n console.log(image);\n // Upload the file with fetch method\n // let formData = new FormData();\n // formData.append(\"file\", image.file);\n // fetch('/upload/image', { method: \"POST\", body: formData });\n },\n });\n }\n }", "title": "" }, { "docid": "1b35f818c1673ccbb01a4db6c1639f40", "score": "0.5942785", "text": "async uploadImage(context, { file, name }) {\n const storage = firebase.storage().ref();\n const doc = storage.child(`uploads/${name}`);\n\n await doc.put(file);\n const downloadURL = await doc.getDownloadURL();\n return downloadURL;\n }", "title": "" }, { "docid": "02b0d1a4eb00a53046a63a26c32865d5", "score": "0.5934053", "text": "function uploadImage() {\n \n //Creando una cadena con la informacion que necesitamos del formulario para agruparla dentro del objero BLOB\n var title =$(\"#title\").val();\n var author =$(\"#author\").val();\n var license =$(\"#license\").val();\n var string1 = {name: title, author: author, license: license}\n\n //Creating a Blob object(contiene una cadena con todos los campos que necesitamos del formulario(menos la imagen))\n\n var blob = new Blob([JSON.stringify(string1)], {type : 'application/json'});\n\n //Cogiendo la imagen del formulario\n var myForm = document.getElementById(\"file\");\n\n //Creating a FormData object y metiendo en el blob object y la imagen\n var myFormData = new FormData();\n myFormData.append(\"metadata\", blob);\n myFormData.append(\"rawdata\", myForm.files[0]);\n\n\n fetch(buildUrl(''), {method: 'POST', body: myFormData})\n ///in myFormData we appended a BLOB objetc (metadata) and the picture(file-rawdata)\n .then(function (response) {\n if (response.status !== 200) {\n throw new Error('Request return status code !== 200: ' + response.status + ' - ')\n }\n return response.json();\n })\n .then(function (json) {\n console.log('Request to upload images succeeded: ');\n console.log(json);\n\n })\n .catch(function (err) {\n console.error('Request to upload failed: ', err);\n });\n \n}", "title": "" }, { "docid": "0249414195f96547ee1747165f83b923", "score": "0.59290904", "text": "function upload(data) {\n var file = document.getElementById(\"file1\");\n imagekit.upload({\n file : file.files[0],\n fileName : \"abc1.jpg\",\n tags : [\"tag1\"]\n }, function(err, result) {\n console.log(arguments);\n console.log(imagekit.url({\n src: result.url,\n transformation : [{ height: 300, width: 400}]\n }));\n })\n}", "title": "" }, { "docid": "1c036342572e7c625f391c39ee9121a8", "score": "0.5925145", "text": "async function uploadImage() {\n const payload = new FormData();\n const desc = document.querySelector('#imageDescInput').value;\n\n payload.append('desc', desc);\n const imageUpload = document.querySelector('#fileUpload');\n console.log(imageUpload.files.length);\n\n if (imageUpload.files.length) payload.append('photo', imageUpload.files[0]);\n\n const response = await util.uploadImageToServer(util.currentProfile, payload);\n console.log('reponse: ', response);\n\n const imgObj = await util.getImagesById(util.currentProfile);\n\n for (const img of imgObj.rows) {\n if (document.querySelector(`#img-${img.img_id}`) === null) createImageElement(img);\n }\n addEventListeners();\n}", "title": "" }, { "docid": "9b0ca7e84106240b0414314d0336b782", "score": "0.59181285", "text": "function save() {\r\n bannerImage = document.getElementById('uploadedImage');\r\n imgData = getBase64Image(bannerImage);\r\n localStorage.setItem(\"imgData\", imgData); \r\n}", "title": "" }, { "docid": "743caa04c3cc606d12b63bb1bc7a04ac", "score": "0.59127396", "text": "async takePicture() {\n var photoLoc = `${FileSystem.documentDirectory}photos/Photo_${\n this.state.photoId\n }_Base64`;\n if (this.camera) {\n let photo = await this.camera.takePictureAsync({ base64: true });\n FileSystem.moveAsync({\n from: photo.uri,\n to: photoLoc\n }).then(() => {\n this.setState({\n photoId: this.state.photoId + 1\n });\n this.sendToImgur(photoLoc);\n });\n }\n }", "title": "" }, { "docid": "b5dc25360db31583c52696aa393eecf7", "score": "0.59074277", "text": "uploadImage(e, method) {\n let imageObj = {};\n\n\n if (method === \"firebase\") {\n\n // // ===========FIREBASE=================\n let currentImageName = \"firebase-image-\" + Date.now();\n\n let uploadImage = storage.ref(`images/${currentImageName}`).put(e.target.files[0]);\n\n uploadImage.on('state_changed',\n (snapshot) => { },\n (error) => {\n alert(error);\n },\n () => {\n storage.ref('images').child(currentImageName).getDownloadURL().then(url => {\n\n this.setState({\n firebaseImage: url\n });\n\n //store image object in the database\n imageObj = {\n imageName: currentImageName,\n imageData: url\n };\n console.log(\"TCL: MarketplaceModal -> uploadImage -> imageObj\", imageObj);\n\n\n // axios.post(`${API_URL}/image/uploadbase`, imageObj)\n // .then((data) => {\n // if (data.data.success) {\n // alert(\"Image has been successfully uploaded using firebase storage\");\n // this.setDefaultImage(\"firebase\");\n // }\n // })\n // .catch((err) => {\n // alert(\"Error while uploading image using firebase storage\")\n // this.setDefaultImage(\"firebase\");\n // });\n })\n })\n }\n\n\n\n //==========this works================\n let file = e.target.files[0];\n\n let storageRef = storage.ref('photos/' + file.name);\n this.setState({ imgUrl: storageRef.location.path }, () => {\n console.log(this.state.imgUrl);\n\n });\n\n\n let task = storageRef.put(file);\n\n // file.on('state_changed',\n // (snapshot) => { },\n // (error) => {\n // alert(error);\n // },\n // () => {\n // storage.ref('photos/').child(file.name).getDownloadURL().then(url => {\n // this.setState({\n // firebaseImage: url\n\n // });\n // })\n // }\n // )\n\n\n\n\n\n }", "title": "" }, { "docid": "c8b922bd1b65a243a0a3dd2d608c4a6a", "score": "0.5895728", "text": "function submit() {\n var imageCount = $$(\"input.uploadBtn\")[0].files.length;\n if ((imageCount != null) && (imageCount > 0)) {\n console.log(\"saveImagesAndPost\");\n saveImagesAndPost(data);\n } else {\n // now user must post things with a photo!\n // console.log(\"saveOnlyPost\");\n // savePost(data);\n myApp.hideIndicator();\n myApp.alert('You need to pick a photo for this post. :(', 'Error');\n }\n }", "title": "" }, { "docid": "5391e47ef9a358500d70a0b269cc3a9f", "score": "0.58946604", "text": "function uploadIMG(){\r\n image = new SimpleImage(fileinput);\r\n image1 = new SimpleImage(fileinput);\r\n image2 = new SimpleImage(fileinput);\r\n image3 = new SimpleImage(fileinput);\r\n image.drawTo(imgcanvas);\r\n clearAnon();\r\n}", "title": "" }, { "docid": "9f477d482ae050c4d4553fd234c11715", "score": "0.5893177", "text": "async submitImage(uploadData, albumID){\n const mediaItems = this.processUploadImages(uploadData)\n const token = await GoogleSignin.getTokens();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n method: 'POST',\n body: JSON.stringify({\n \"albumId\": albumID,\n \"newMediaItems\": mediaItems\n })\n }\n response = await this.APIHandler.sendRequest(data);\n return response\n }", "title": "" }, { "docid": "1b35cf95d2d7d0b0c64e73dc9260f509", "score": "0.5890464", "text": "function saveImage() {\n let options = {\n method: 'POST',\n headers: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin': '*'\n },\n body: JSON.stringify(currentImg)\n }\n\n api('/gallery/meta-data', options, (err, userImgs) => {\n if (err) {\n alert('Ooops please retry again')\n console.log(err);\n } else {\n userImgs.data = currentImg.data;\n userImgs.filter = filter;\n renderThumbmail(userImgs);\n image = undefined;\n state.value == 0;\n // saveImg.disabled = true; //remove comment later;\n }\n });\n\n /* TODO lock the save button when the image is save */\n}", "title": "" }, { "docid": "685fb9d2794ed223a3d05d140a59c2d5", "score": "0.5889524", "text": "function upload_category(){\n\t//=============HairCare\n\tvar HairCare_image_name1=$(\"#HairCare_image_name_hidden1\").val();\n\tvar HairCare_image_path1=$(\"#HairCare_image_div_hidden1\").val();\n\t\n\tvar HairCare_image_name2=$(\"#HairCare_image_name_hidden2\").val();\n\tvar HairCare_image_path2=$(\"#HairCare_image_div_hidden2\").val();\n\t\n\tvar HairCare_image_name3=$(\"#HairCare_image_name_hidden3\").val();\n\tvar HairCare_image_path3=$(\"#HairCare_image_div_hidden3\").val();\n\t\n\tvar HairCare_image_name4=$(\"#HairCare_image_name_hidden4\").val();\n\tvar HairCare_image_path4=$(\"#HairCare_image_div_hidden4\").val();\n\tif ((HairCare_image_name1.length < 10) && (HairCare_image_name2.length < 10) && (HairCare_image_name3.length < 10) && (HairCare_image_name4.length < 10) ){\n\t\talert (\"Haircare image not available\");\n\t}\n\t\n\tif (HairCare_image_name1.length >10){\n\t\t\t\tuploadPhoto(HairCare_image_path1, HairCare_image_name1);\n\t} \n\tif (HairCare_image_name2.length >10){\n\t\t\t\tuploadPhoto(HairCare_image_path2, HairCare_image_name2);\n\t} \n\tif (HairCare_image_name3.length >10){\n\t\t\t\tuploadPhoto(HairCare_image_path3, HairCare_image_name3);\n\t} \n\tif (HairCare_image_name4.length >10){\n\t\t\t\tuploadPhoto(HairCare_image_path4, HairCare_image_name4);\n\t} \n\t//==============SkinCare\n\tvar SkinCare_image_name1=$(\"#SkinCare_image_name_hidden1\").val();\n\tvar SkinCare_image_path1=$(\"#SkinCare_image_div_hidden1\").val();\n\t\n\tvar SkinCare_image_name2=$(\"#SkinCare_image_name_hidden2\").val();\n\tvar SkinCare_image_path2=$(\"#SkinCare_image_div_hidden2\").val();\n\t\n\tvar SkinCare_image_name3=$(\"#SkinCare_image_name_hidden3\").val();\n\tvar SkinCare_image_path3=$(\"#SkinCare_image_div_hidden3\").val();\n\n\tif ((SkinCare_image_name1.length < 10) && (SkinCare_image_name2.length < 10) && (SkinCare_image_name3 .length < 10) ){\n\t\talert (\"SkinCare image not available\");\n\t}\n\t\n\tif (SkinCare_image_name1.length >10){\n\t\t\t\tuploadPhoto(SkinCare_image_path1, SkinCare_image_name1);\n\t} \n\tif (SkinCare_image_name2.length >10){\n\t\t\t\tuploadPhoto(SkinCare_image_path2, SkinCare_image_name2);\n\t} \n\tif (SkinCare_image_name3.length >10){\n\t\t\t\tuploadPhoto(SkinCare_image_path3, SkinCare_image_name3);\n\t} \n\t\n\t//==============Oral\n\tvar Oral_image_name1=$(\"#Oral_image_name_hidden1\").val();\n\tvar Oral_image_path1=$(\"#Oral_image_div_hidden1\").val();\n\t\n\tvar Oral_image_name2=$(\"#Oral_image_name_hidden2\").val();\n\tvar Oral_image_path2=$(\"#Oral_image_div_hidden2\").val();\n\n\tif ((Oral_image_name1.length < 10) && (Oral_image_name2.length < 10)){\n\t\talert (\"Oral image not available\");\n\t}\n\t\n\tif (Oral_image_name1.length >10){\n\t\t\t\tuploadPhoto(Oral_image_path1, Oral_image_name1);\n\t} \n\tif (Oral_image_name2.length >10){\n\t\t\t\tuploadPhoto(Oral_image_path2, Oral_image_name2);\n\t} \n\t\n\t//==============Skin Cleansing\n\tvar SkinCleansing_image_name1=$(\"#SkinCleansing_image_name_hidden1\").val();\n\tvar SkinCleansing_image_path1=$(\"#SkinCleansing_image_div_hidden1\").val();\n\t\n\tvar SkinCleansing_image_name2=$(\"#SkinCleansing_image_name_hidden2\").val();\n\tvar SkinCleansing_image_path2=$(\"#SkinCleansing_image_div_hidden2\").val();\n\n\tif ((SkinCleansing_image_name1.length < 10) && (SkinCleansing_image_name2.length < 10)){\n\t\talert (\"SkinCleansing image not available\");\n\t}\n\t\n\tif (SkinCleansing_image_name1.length >10){\n\t\t\t\tuploadPhoto(SkinCleansing_image_path1, SkinCleansing_image_name1);\n\t} \n\tif (SkinCleansing_image_name2.length >10){\n\t\t\t\tuploadPhoto(SkinCleansing_image_path2, SkinCleansing_image_name2);\n\t} \n\t\n\t//==============Laundry\n\tvar Laundry_image_name1=$(\"#Laundry_image_name_hidden1\").val();\n\tvar Laundry_image_path1=$(\"#Laundry_image_div_hidden1\").val();\n\t\n\tvar Laundry_image_name2=$(\"#Laundry_image_name_hidden2\").val();\n\tvar Laundry_image_path2=$(\"#Laundry_image_div_hidden2\").val();\n\n\tif ((Laundry_image_name1.length < 10) && (Laundry_image_name2.length < 10)){\n\t\talert (\"Laundry image not available\");\n\t}\n\t\n\tif (Laundry_image_name1.length >10){\n\t\t\t\tuploadPhoto(Laundry_image_path1, Laundry_image_name1);\n\t} \n\tif (Laundry_image_name2.length >10){\n\t\t\t\tuploadPhoto(Laundry_image_path2, Laundry_image_name2);\n\t} \n\t\n\t//==============HouseHold cleansing\n\tvar HHcleansing_image_name1=$(\"#HHcleansing_image_name_hidden1\").val();\n\tvar HHcleansing_image_path1=$(\"#HHcleansing_image_div_hidden1\").val();\n\t\n\tvar HHcleansing_image_name2=$(\"#HHcleansing_image_name_hidden2\").val();\n\tvar HHcleansing_image_path2=$(\"#HHcleansing_image_div_hidden2\").val();\n\n\tif ((HHcleansing_image_name1.length < 10) && (HHcleansing_image_name2.length < 10)){\n\t\talert (\"HouseHold cleansing image not available\");\n\t}\n\t\n\tif (HHcleansing_image_name1.length >10){\n\t\t\t\tuploadPhoto(HHcleansing_image_path1, HHcleansing_image_name1);\n\t} \n\tif (HHcleansing_image_name2.length >10){\n\t\t\t\tuploadPhoto(HHcleansing_image_path2, HHcleansing_image_name2);\n\t} \n\t\n\t//==============Foods\n\tvar Foods_image_name1=$(\"#Foods_image_name_hidden1\").val();\n\tvar Foods_image_path1=$(\"#Foods_image_div_hidden1\").val();\n\t\n\tvar Foods_image_name2=$(\"#Foods_image_name_hidden2\").val();\n\tvar Foods_image_path2=$(\"#Foods_image_div_hidden2\").val();\n\n\tif ((Foods_image_name1.length < 10) && (Foods_image_name2.length < 10)){\n\t\talert (\"Foods image not available\");\n\t}\n\t\n\tif (Foods_image_name1.length >10){\n\t\t\t\tuploadPhoto(Foods_image_path1, Foods_image_name1);\n\t} \n\tif (Foods_image_name2.length >10){\n\t\t\t\tuploadPhoto(Foods_image_path2, Foods_image_name2);\n\t} \n\t\n\t\n\t//upload_fd()\n\t\n}", "title": "" }, { "docid": "c39d3519ebb8cf1678acddb37a852a67", "score": "0.5882697", "text": "function upload(files) {\r\n var roomId = getParam(\"id\");\r\n var formData = new FormData(),\r\n xhr = new XMLHttpRequest(),\r\n x;\r\n // Begränsar till att endast kunna ladda upp en bild\r\n for (x = 0; x < 1; x++) {\r\n formData.append('file[]', files[x]);\r\n }\r\n // Tar emot svar och skickar vidare till funktionen displayUploads() som visar den uppladdade bilden\r\n xhr.onload = function() {\r\n var data = JSON.parse(this.responseText);\r\n displayUploads(data, roomId);\r\n }\r\n xhr.open('post', 'ajax/uploadImage.php?id=' + roomId);\r\n xhr.send(formData);\r\n }", "title": "" }, { "docid": "d2458c7b1a3e7bbff86823311b3bbfcd", "score": "0.5881673", "text": "function onSuccess(imageURI) {\r\n\r\n // Set image source\r\n var image = document.getElementById('img');\r\n image.src = imageURI + '?' + Math.random();\r\n \r\n var options = new FileUploadOptions();\r\n options.fileKey = \"file\";\r\n options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);\r\n options.mimeType = \"image/jpeg\";\r\n \r\n var params = {};\r\n params.value1 = \"test\";\r\n params.value2 = \"param\";\r\n\r\n options.params = params;\r\n options.chunkedMode = false;\r\n\r\n var ft = new FileTransfer();\r\n ft.upload(imageURI, \"http://demo.makitweb.com/phonegap_camera/upload.php\", function(result){\r\n alert('successfully uploaded ' + result.response);\r\n }, function(error){\r\n //alert('error : ' + JSON.stringify(error));\r\n }, options);\r\n \r\n }", "title": "" }, { "docid": "4e2bf73170af18479af4300f180ca075", "score": "0.58794004", "text": "async function handleUploadImage(e){\n if(e.target.files[0]){\n setImage(e.target.files[0])\n }\n }", "title": "" }, { "docid": "a21ddd41c07af1c52dba0a1a9f9219a9", "score": "0.58759534", "text": "function storeFile(fileRequest, username, callback) {\n db = app.get(\"db_conn\");\n grid = app.get(\"grid_conn\");\n\n // source - Inbox/Outbox/Upload\n // details - Some details about the file (doctor name (sender )for Inbox, user comments for Upload, doctor name (to whom it was sent) for Outbox)\n var source = '';\n var details = '';\n\n if (fileRequest.source) {\n source = fileRequest.source;\n }\n if (fileRequest.details) {\n details = fileRequest.details;\n }\n\n console.log(\"Storage PUT call\");\n //console.log(fileRequest);\n\n if (fileRequest.filename === undefined || fileRequest.filename.length < 1 || fileRequest.filename === null) {\n callback('Error, filname bad.');\n }\n\n if (fileRequest.file === undefined || fileRequest.file.length < 1 || fileRequest.file === null) {\n callback('Error, file bad.');\n }\n\n var fileType = 'binary/octet-stream';\n if (fileRequest.filename && fileRequest.filename.length > 3) {\n var extension = fileRequest.filename.substring(fileRequest.filename.lastIndexOf(\".\") + 1, fileRequest.filename.length);\n if (extension.toLowerCase() === 'xml') {\n fileType = 'text/xml';\n }\n }\n\n //console.log(\"---\");\n //console.log(fileRequest.file);\n //console.log(\"---\");\n\n try {\n var bb = blueButton(fileRequest.file);\n\n var bbMeta = bb.document();\n\n if (bbMeta.type === 'ccda') {\n fileType = \"CCDA\";\n }\n } catch (e) {\n //do nothing, keep original fileType\n console.log(e);\n }\n\n //TODO: Fix once auth is implemented.\n var buffer = new Buffer(fileRequest.file);\n grid.put(buffer, {\n metadata: {\n source: source,\n details: details,\n owner: username,\n parsedFlag: false\n },\n 'filename': fileRequest.filename,\n 'content_type': fileType\n }, function(err, fileInfo) {\n if (err) {\n throw err;\n }\n var recordId = fileInfo._id;\n //console.log(\"Record Stored in Gridfs: \" + recordId);\n callback(err, fileInfo);\n });\n\n}", "title": "" }, { "docid": "a1f16335d6bec9613242812138e5b70a", "score": "0.5874122", "text": "function uploadPhotoUser(image,targetElm) {\n if (!checkImage(image)) return false;\n //add to image list\n App.showPreloader(0.8)\n .then(() => Menkule.post(\"/users/photo\", image))\n .then((data) => {\n $(\"#uploader\").val('');\n //create events and fire\n var _e = new $.Event('change.photo');\n _e['photo'] = data;\n $(targetElm).trigger(_e);\n if (_e.isDefaultPrevented()) return;\n\n\n })\n .then(() => App.hidePreloader())\n .catch((err) => {\n $(\"#uploader\").val('');\n App.hidePreloader()\n .then(() => App.parseJSON(err.responseText))\n .then(o => App.notifyDanger(o.result || o.message, 'Üzgünüz'))\n .catch(o => App.notifyDanger(o, 'Beklenmeyen bir hata'));\n })\n }", "title": "" }, { "docid": "c2a2ad6b9c1a08d3954136cd8f380b9f", "score": "0.58641195", "text": "function updateGallery(){\n var form_data = new FormData(); \n form_data.append(\"image_id\", $('#image_id').val()); \n if(document.getElementById('ugallery_file').files[0]){\n form_data.append(\"ugallery_file\", document.getElementById('ugallery_file').files[0]);\n } \n \n $.ajax({\n url:\"scripts/update_gallery.php\",\n method:\"POST\",\n data: form_data,\n contentType: false,\n cache: false,\n processData: false, \n success:function(data)\n {\n $('#modal_gallery_update_confirm').modal('hide');\n toastr[data['status']](data['message']);\n clearUpdateGalleryFields();\n setTimeout( function () {\n window.location.reload();\n }, 3000 );\n }\n });\n }", "title": "" }, { "docid": "53df3102863261207619e7a258d0c9d2", "score": "0.58600324", "text": "function updatePic() {\n $.ajax({\n url: '/uploadimage', //Server script to process data\n type: 'POST',\n data: formData,\n cache: false,\n contentType: false,\n processData: false,\n //$('form').serialize(),\n success: function(response) {\n $.ajax({\n url: '/uploadmainlistingimage/'+listingview, //Server script to process data\n type: 'POST',\n data: {\n name : response.filename+\"\",\n token : currenttoken\n },\n //$('form').serialize(),\n success: function(resp) {\n $('#editmainlistingpicture, #mainlistingpic').attr('src', \"uploads/\"+resp.mainPicture);\n // Set it to the name of this picture in the profile gallery\n\n $.ajax({\n type: \"GET\",\n url: \"/listingbyname/\" + resp.mainPicture,\n success: function(data){\n if (data) {\n $('#mainlistinglink').attr('name', data._id);\n setCurrentUser();\n }\n }\n });\n }\n });\n\n }\n });\n }", "title": "" }, { "docid": "3fbc3ad57f32d8d0d5bdaecb976c488b", "score": "0.58588237", "text": "function uploadDraggedImage(event) {\n\t\t\tvar fileUrl = event.dataTransfer.getData(\"text/uri-list\");\n\n\t\t\tsch.dump(fileUrl);\n\n\t\t\tif (fileUrl.match(/^(.+)\\.(jpg|jpeg|gif|png)$/i)<1) {\n\t\t\t\talert(\"File must be one of the following:\\n .jpg, .jpeg, .gif, .png\");\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tSpaz.UI.uploadImage(fileUrl);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "04135bcfcfbdb0f6bf841359e8335c88", "score": "0.585455", "text": "static async postUpload(request, response) {\n const { userId } = await userUtils.getUserIdAndKey(request);\n\n if (!basicUtils.isValidId(userId)) {\n return response.status(401).send({ error: 'Unauthorized' });\n }\n if (!userId && request.body.type === 'image') {\n await fileQueue.add({});\n }\n\n const user = await userUtils.getUser({\n _id: ObjectId(userId),\n });\n\n if (!user) return response.status(401).send({ error: 'Unauthorized' });\n\n const { error: validationError, fileParams } = await fileUtils.validateBody(\n request\n );\n\n if (validationError)\n return response.status(400).send({ error: validationError });\n\n if (fileParams.parentId !== 0 && !basicUtils.isValidId(fileParams.parentId))\n return response.status(400).send({ error: 'Parent not found' });\n\n const { error, code, newFile } = await fileUtils.saveFile(\n userId,\n fileParams,\n FOLDER_PATH\n );\n\n if (error) {\n if (response.body.type === 'image') await fileQueue.add({ userId });\n return response.status(code).send(error);\n }\n\n if (fileParams.type === 'image') {\n await fileQueue.add({\n fileId: newFile.id.toString(),\n userId: newFile.userId.toString(),\n });\n }\n\n return response.status(201).send(newFile);\n }", "title": "" }, { "docid": "329fd5e389550f7c51f21f76360a618e", "score": "0.5854474", "text": "function imageUpload(e) {\n var reader = new FileReader();\n reader.onload = async function (event) {\n var imgObj = await new Image();\n imgObj.src = await event.target.result;\n setImage([...getImage, imgObj.src]);\n };\n let p = e.target.files[0];\n\n reader.readAsDataURL(p);\n }", "title": "" }, { "docid": "0773575568a69ad4042081c03409da71", "score": "0.5849417", "text": "function uploadToFirebase(image, name){\n var storageRef = firebase.storage().ref('images/' + app.blgName + \"/\"+ name);\n storageRef.put(image).then(function(snapshot){\n storageRef.getDownloadURL().then(function(url) {\n var arg = {\n \"url\": url,\n \"filename\": name\n };\n firebaseUrls.push(arg);\n }).catch(function(error) {\n switch (error.code) {\n case 'storage/object-not-found':\n // File doesn't exist\n console.log(\"File doesn't exist\")\n return false;\n break;\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n console.log(\"User doesn't have permission to access the object\")\n return false;\n break;\n case 'storage/canceled':\n // User canceled the upload\n console.log(\"User canceled the upload\")\n return false;\n break;\n case 'storage/unknown':\n // Unknown error occurred, inspect the server response\n console.log(\"Unknown error occurred, inspect the server response\");\n return false;\n break;\n }\n });\n });\n}", "title": "" }, { "docid": "9acda8da3ab197fd10e7bfa8e89f89c1", "score": "0.5848334", "text": "function ajaxFileUpload(pBtnId, pImgDesc, pDocId, pUpdateHolder, pPicIdHolder, pPlateVal, pPref, pResize, pPosition) {\n\n\tvar photoid = $(\"input[name*='\" + pPicIdHolder + \"']\").val();\n\tvar plateid = $(\"input[name*='plate_id']\").val();\n\tvar btnUpload = $('#' + pBtnId);\n\n\tvar AjaxFileUpload = new AjaxUpload(btnUpload, {\n\t\taction: '/lib/UploadPhoto.php',\n\t\tresponseType: 'json',\n\t\tname: 'uploadfile',\n\t\thoverClass: 'UploadHover',\n\t\tdata: {\n\t\t\tdocument_id: pDocId,\n\t\t\t// description: ($('#' + pImgDesc).val() ? $('#' + pImgDesc).val() :\n\t\t\t// ''),\n\t\t\tphoto_id: photoid,\n\t\t\timage_pref: pPref,\n\t\t\tplateval: pPlateVal,\n\t\t\tposition: pPosition,\n\t\t\tplateid: plateid,\n\t\t},\n\t\tonSubmit: function(file, ext){\n\t\t\tshowLoading();\n\t\t\tvar newphotoid = $(\"input[name*='\" + pPicIdHolder + \"']\").val(); // get\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// uploaded\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// pic_id\n\n\t\t\tvar plateid = 0;\n\t\t\tif(pResize) {\n\t\t\t\tplateid = 0;\n\t\t\t} else {\n\t\t\t\tplateid = $(\"input[name*='plate_id']\").val();\n\t\t\t}\n\t\t\tvar desc = $('#' + pImgDesc + '_photo').val();\n\t\t\tif(!desc || typeof(desc) == 'undefined') {\n\t\t\t\tdesc = '';\n\t\t\t}\n\t\t\tAjaxFileUpload.setData({\n\t\t\t\t\tdocument_id: pDocId,\n\t\t\t\t\tdescription: desc,\n\t\t\t\t\tphoto_id: newphotoid,\n\t\t\t\t\timage_pref: pPref,\n\t\t\t\t\tplateval: pPlateVal,\n\t\t\t\t\tposition: pPosition,\n\t\t\t\t\tplateid: plateid,\n\t\t\t});\n\n\t\t\t if (! (ext && /^(jpg|png|jpeg|gif)$/i.test(ext))){\n\t\t\t\thideLoading();\n\t\t\t\t$('#' + pUpdateHolder).text('Only JPG, PNG or GIF files are allowed');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tonComplete: function(file, response){\n\t\t\thideLoading();\n\t\t\tif(response != 0 && !response['err_cnt']){\n\t\t\t\t$(\"input[name*='\" + pPicIdHolder + \"']\").val(response['pic_id']);\n\t\t\t\tif(response['plate_id'] != 0)\n\t\t\t\t\t$(\"input[name*='plate_id']\").val(response['plate_id']);\n\t\t\t\tif(pResize){\n\n\t\t\t\t\tvar dims = jQuery.parseJSON(response['img_dims']); // get\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// picture\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// dimensions\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// resize\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// container\n\t\t\t\t\t$('.P-Plate-Part').width(dims[0] + 20);\n\t\t\t\t\t$('.P-Plate-Part-WithPic').width(dims[0] + 20);\n\t\t\t\t\t$('.P-Plate-Part').height(dims[1] + 20);\n\t\t\t\t\t$('.P-Plate-Part-WithPic').height(dims[1] + 20);\n\t\t\t\t\t$('.P-Add-Plate-Holder').width(dims[0]);\n\t\t\t\t\t$('.P-Add-Plate-Holder').height(dims[1]);\n\t\t\t\t\t$(\"#uploaded_photo\").attr(\"src\", \"/showfigure.php?filename=\" + response['html'] + \".jpg\");\n\t\t\t\t\t$('#' + pUpdateHolder).closest('.P-Plate-Part').removeClass('P-Plate-Part').addClass('P-Plate-Part-WithPic');\n\t\t\t\t\t$('#' + pUpdateHolder).html('<img id=\"uploaded_photo\" src=\"/showfigure.php?filename=' + response['html'] + '.jpg\"></img>');\n\t\t\t\t\t$(\"#uploaded_photo\").attr(\"src\",\"/showfigure.php?filename=\" + response['html'] + \".jpg&\" + Math.random()); // za\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// da\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// se\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// refreshne\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// snimkata\n\t\t\t\t\tif(response['pic_id']) { // update pic holder\n\t\t\t\t\t\t$('#P-Figures-Row-' + response['pic_id'] + ' .P-Picture-Holder').html('<img src=\"/showfigure.php?filename=c90x82y_' + response['pic_id'] + '.jpg&' + Math.random() + '\"></img>');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$('#' + pUpdateHolder).closest('.P-Plate-Part').removeClass('P-Plate-Part').addClass('P-Plate-Part-WithPic');\n\t\t\t\t\t$('#' + pUpdateHolder).html('<img id=\"uploaded_photo_' + response['pic_id'] + '\" src=\"/showfigure.php?filename=' + response['html'] + '.jpg\"></img>');\n\t\t\t\t\t$(\"#uploaded_photo_\" + response['pic_id']).attr(\"src\",\"/showfigure.php?filename=\" + response['html'] + \".jpg&\" + Math.random()); // za\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// da\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// se\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// refreshne\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// snimkata\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\tif(response['err_msg']) {\n\t\t\t\t\t$('#' + pUpdateHolder).html(response['err_msg']);\n\t\t\t\t} else {\n\t\t\t\t\t$('#' + pUpdateHolder).html(LANG['js.error_uploading_file']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3000b3bb44d80f33fd667ac8d2b3f4fd", "score": "0.58426744", "text": "function upload(blob, bucket, callback) {\n \"use strict\";\n //generate form data\n var data = new FormData();\n data.append(\"image\", blob, \"blob.\" + (blob.type === \"image/jpeg\" ? \"jpg\" : \"png\"));\n data.append(\"bucket\", bucket);\n //send\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://kland.smilebasicsource.com/uploadimage\");\n xhr.onload = callback;\n xhr.send(data);\n}", "title": "" }, { "docid": "4edbeba11851753a011d55677c850958", "score": "0.58411205", "text": "async function imageUpload(filename,type, bucketName) {\n\n try{\n\n //create bucket if it isn't present.\n await bucketExists(bucketName);\n\n const bucket = storage.bucket(bucketName);\n \n const gcsname = type +'/'+Date.now() + filename.originalname;\n const file = bucket.file(gcsname);\n \n const stream = file.createWriteStream({\n metadata: {\n contentType: filename.mimetype,\n },\n resumable: false,\n });\n\n \n \n stream.on('error', err => {\n filename.cloudStorageError = err;\n console.log(err);\n });\n \n stream.on('finish', async () => {\n \n filename.cloudStorageObject = gcsname;\n await file.makePublic().then(() => {\n imageUrl = getPublicUrl(gcsname,bucketName);\n console.log(imageUrl);\n });\n \n\n });\n \n stream.end(filename.buffer);\n return getPublicUrl(gcsname,bucketName);\n\n }\n\n catch(error){\n console.log(error);\n \n }\n // [END process]\n\n}", "title": "" }, { "docid": "07a4ca9880cfdea785c59d7fd605c455", "score": "0.58378655", "text": "function saveMultiPart() {\n var _URL;\n console.log(\"With file\");\n // to trigger a reload, make it different\n rayv.currentItem.img = true;\n // if a file is present\n // resize it\n // multipart form with image upload\n var img = new Image();\n //_URL = window.URL || window.webkitURL;\n img.onload = function () {\n canvasResize(file, {\n width: 288,\n height: 0,\n crop: false,\n quality: 80,\n callback: function (data, width, height) {\n // Create a new form-data\n // Add file data\n var f = canvasResize('dataURLtoBlob', data);\n f.name = file.name;\n $.ajax({\n url: '/item',\n data: build_form(f),\n dataType: 'json',\n cache: false,\n contentType: false,\n processData: false,\n type: 'POST',\n success: save_success_handler,\n error: function (a, b, c) {\n BB.hide_waiting();\n console.error(\n 'saveMultiPart /item: ' + b + ', ' + c);\n }\n });\n// var fd = build_form(f);\n// var xhr = new XMLHttpRequest();\n// xhr.open('POST', '/item', true);\n// xhr.setRequestHeader(\"X-Requested-With\",\n// \"XMLHttpRequest\");\n// xhr.setRequestHeader(\"pragma\", \"no-cache\");\n// // File uploaded\n// xhr.addEventListener(\"load\", save_success_handler);\n// // Send data\n// xhr.send(fd);\n }\n\n });\n };\n _URL = window.URL || window.webkitURL;\n img.src = _URL.createObjectURL(file);\n }", "title": "" }, { "docid": "131f2356e8af3ccf49713f57d09b3d46", "score": "0.583606", "text": "function uploadImage() {\n if (state.photoSnapped) {\n var canvas = document.getElementById('canvas');\n var image = getImageAsBlobFromCanvas(canvas);\n\n // TODO!!! Well this is for you ... YES you!!!\n // Good luck!\n\n // Create Form Data. Here you should put all data\n // requested by the face plus plus services and\n // pass it to ajaxRequest\n var data = new FormData();\n data.append('api_key', faceAPI.apiKey);\n data.append('api_secret', faceAPI.apiSecret);\n data.append('image_file', image);\n // add also other query parameters based on the request\n // you have to send\n\n // You have to implement the ajaxRequest. Here you can\n // see an example of how you should call this\n // First argument: the HTTP method\n // Second argument: the URI where we are sending our request\n // Third argument: the data (the parameters of the request)\n // ajaxRequest function should be general and support all your ajax requests...\n // Think also about the handler\n ajaxRequest('POST', faceAPI.detect, data,setUserID);\n\n } else {\n alert('No image has been taken!');\n }\n }", "title": "" }, { "docid": "5de8a063af08c3b3bdf08b60bf73c5de", "score": "0.58346444", "text": "function saveImageToCloud(){\n cloudinary.v2.uploader.upload(path,\n { crop : \"fill\", aspect_ratio: \"1:1\" },\n function(error, result) {\n if(error)\n return next(error);\n\n channel.image = result.url;\n saveChannel();\n });\n }", "title": "" }, { "docid": "7bb15e4b2ef4ec7505a68dab1e4daab1", "score": "0.58283234", "text": "function uploadPhoto(imageURI) {\n var options = new FileUploadOptions();\n options.fileKey=\"file\";\n options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);\n\t\t //options.fileName=\"image.jpg\";\n options.mimeType=\"image/jpg\";\n\t\t\t//options.mimeType = \"text/plain\";\n\t\t\toptions.chunkedMode = true;\n \n var params = new Object();\n params.value1 = \"test\";\n params.value2 = \"param\";\n\t\t\t\n\t\t\t\n \n options.params = params;\n options.chunkedMode = false;\n \n \t\t// alert ( \"test\" );\n \n \n //var mediafile = navigator.camera.DestinationType.FILE_URI; // path to file\n // var method = \"post\";\n\t\t\t//ßßuploadFile(mediafile, method); \n\t\t\t\n\t\t\t \n var ft = new FileTransfer();\n\t\t \tft.upload(imageURI, \"http://www.exotoolz.com/components/services.cfc?method=emilio\", win, fail, options);\n\t\t\t//alert (\"uploaded\" + r.responseCode + r.response+ r.bytesSent + r.response );\n }", "title": "" }, { "docid": "cbbae02a7358fd1b02aaef74233f34a4", "score": "0.58236694", "text": "upload () {\n return this.loader.file.then(async file => {\n try {\n const format = file.name.split('.')[1]\n const filePath = `images/${new Date().getTime()}.${format}`\n const fileSnapshot = await firebase\n .storage()\n .ref(filePath)\n .put(file)\n const url = await fileSnapshot.ref.getDownloadURL()\n console.log('url: ', url)\n return { default: url }\n } catch (error) {\n console.error(error)\n }\n })\n }", "title": "" }, { "docid": "764fc374090fb9e2ccf98b9c2d881b16", "score": "0.58194804", "text": "function addMediaToGallery(data,type){\n // If you need to open the object store in readwrite mode\n let tx=db.transaction(\"gallery\",\"readwrite\");\n //returns the same transaction object\n let gallery=tx.objectStore(\"gallery\")\n //to store the value in the object store\n gallery.add({mId:Date.now(),type,media:data})\n}", "title": "" }, { "docid": "4c406b62d698cbc63ad29ad46b347533", "score": "0.58127934", "text": "uploadImage(file, _id, form) {\n if (file.type.indexOf('image/') !== -1) {\n this.upload.upload({\n url: '/api/upload-images',\n data: {\n file: file,\n email: this.user.email,\n _id: _id\n }\n }).then((resp) => {\n // Include new avatar filename to avoid override\n this.updateUser(form, resp.data.avatar);\n }).catch(() => {\n this.$translate('app.account.settings.uploadError').then(value => {\n this.errors.other = value;\n });\n });\n } else {\n this.$translate('app.account.settings.incorrectImageFormat').then(value => {\n this.errors.other = value;\n });\n }\n }", "title": "" }, { "docid": "e0bc27323d33ada0b1065c63ee591a43", "score": "0.58102876", "text": "function upload (file) {\n Upload.upload({\n url: 'http://localhost/Control/Laravel/public/api/image/upload',\n data: {file: file}\n }).then(function (resp) {\n swal(\"Exito!\", \"Imagen subida correctamente!\", \"success\");\n //console.log('Success ' + resp.config.data.file.name + 'uploaded. Response: ' + resp.data);\n }, function (resp) {\n //console.log('Error status: ' + resp.status);\n }, function (evt) {\n var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\n //console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);\n });\n }", "title": "" }, { "docid": "53811a3af826f835660b0db15204f646", "score": "0.58074766", "text": "upload(event){\n let image = document.getElementById('output');\n url.push(URL.createObjectURL(event.target.files[0]));\n image.src = URL.createObjectURL(event.target.files[0])\n }", "title": "" }, { "docid": "0e7da82d0bfd223071c42d756dc3722e", "score": "0.58026904", "text": "function uploadPhoto()\r\n{\r\n\talert(\"upload start\");\r\n\tvar myImg = document.getElementById('myImg');\r\n\tvar options = new FileUploadOptions();\r\n\toptions.key=\"file.jpg\"; // temporary key for testing\r\n\toptions.AWSAccessKeyId=\"\"; // value removed for privacy reasons\r\n\toptions.acl=\"private\";\r\n\toptions.policy=\"\"; // value removed for privacy reasons\r\n\toptions.signature=\"\"; // value removed for privacy reasons\r\n\t\r\n\tvar ft = new FileTransfer();\r\n\tft.upload(myImg.src, encodeURI(\"https://andrewscm-bucket.s3.amazonaws.com/\"), onUploadSuccess, onUploadFail, options);\r\n}", "title": "" }, { "docid": "35b8311871dec018be86a22e0f843b0e", "score": "0.58013445", "text": "function uploadProgramImage(){\n $(function() {\n $(document).on(\"change\",\".uploadFile\", function()\n {\n $('body').loadingModal({\n position: 'auto',\n text: 'Guardando su imagen, espere ...',\n color: '#fff',\n opacity: '0.7',\n backgroundColor: 'rgb(0,0,0)',\n animation: 'fadingCircle'\n });\n var myInput = $(this).parent().parent().children('.putFile');\n var fileInput = $(this);\n var formData = new FormData();\n formData.append('image', $(this)[0].files[0]);\n $.ajax({\n url: '/reg/program_image',\n type: 'POST',\n data: formData, \n processData: false,\n contentType: false, \n success: function(data){\n myInput.val(data);\n $('body').loadingModal('destroy');\n }\n });\n\n var uploadFile = $(this);\n var files = !!this.files ? this.files : [];\n if (!files.length || !window.FileReader) return; // no file selected, or no FileReader support \n });\n });\n}", "title": "" }, { "docid": "9422824add3f6948c7a4cf3b7339e369", "score": "0.5801287", "text": "async handleImageUpload(file) {\n const fd = new FormData();\n fd.append('upload_preset', CLOUDINARY_UPLOAD_PRESET);\n fd.append('tags', 'browser_upload'); // Optional - add tag for image admin in Cloudinary\n fd.append('file', file);\n\n try {\n const response = await axios.post(\n CLOUDINARY_UPLOAD_URL,\n fd,\n {\n onUploadProgress: (progressEvent) => {\n const progress = Math.round((progressEvent.loaded * 100.0) / progressEvent.total);\n\n this.setState({\n uploadProgressShow: true,\n uploadProgress: progress,\n });\n },\n }\n );\n\n this.setState({\n uploadedFileCloudinaryID: response.data.public_id,\n uploadedFileCloudinaryUrl: response.data.secure_url,\n uploadProgress: 0,\n uploadProgressShow: false,\n deletedCurrentImage: false,\n });\n } catch (error) {\n this.handleUpdateError(error);\n }\n }", "title": "" }, { "docid": "045a4861cad4467a9d900eef4d9629bb", "score": "0.57995176", "text": "function parsemult(){\n // let upload = mul({storage: storage, fileFilter: helpers.imageFilter}).single('passport');\n // upload(req, res, function(err){\n // if (req.fileValidationError) {\n // throw err(req.fileValidationError);\n // }\n // else if (!req.file) {\n // return console.log('Please select an image to upload');\n // }\n // else if (err instanceof multer.MulterError) {\n // return res.send(err);\n // }\n // else if (err) {\n // return res.send(err);\n // }\n \n // })\n res.send('This function is still in progress')\n }", "title": "" } ]
892ef45ce884ee1ff8c4cb3c21ad4e77
EXPERIMENTAL see comment above
[ { "docid": "a28ff2caf8301edc282a8bf15a2637a3", "score": "0.0", "text": "_unwrapDisplayElements (el) {\n let children = el.getChildren();\n let L = children.length;\n for (let i = L - 1; i >= 0; i--) {\n let child = children[i];\n if (child.is('p[specific-use=\"display-element-wrapper\"]')) {\n let children = child.getChildren();\n if (children.length === 1) {\n el.replaceChild(child, children[0]);\n } else {\n console.error('Expecting a single element wrapped in <p>');\n }\n }\n }\n }", "title": "" } ]
[ { "docid": "ac54ce770b0cd27b0ae6243ee1905e7c", "score": "0.58398294", "text": "XXX() {\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "344fef91be254a51983517c7b30520c4", "score": "0.5573479", "text": "function _0x43bb6f(_0x443d96,_0x3852e2){0x0;}", "title": "" }, { "docid": "eb377607ebb19e4a5c680b18f7ac0458", "score": "0.5549223", "text": "apply () {}", "title": "" }, { "docid": "af28c3e414c1d20f34601707f230dca4", "score": "0.54762626", "text": "function _0x539f(_0x503842,_0x106b6d){const _0x1d5ba4=_0x1d5b();return _0x539f=function(_0x539fda,_0x10d002){_0x539fda=_0x539fda-0x115;let _0x931179=_0x1d5ba4[_0x539fda];return _0x931179;},_0x539f(_0x503842,_0x106b6d);}", "title": "" }, { "docid": "d749323761bc83e97f6ae63d6f59472c", "score": "0.5430628", "text": "ix () { return 0 }", "title": "" }, { "docid": "80068fd9c4ecc7909911f4817971b1ff", "score": "0.5414298", "text": "apply() {}", "title": "" }, { "docid": "80068fd9c4ecc7909911f4817971b1ff", "score": "0.5414298", "text": "apply() {}", "title": "" }, { "docid": "937a6dbd73c7b37a5e85badd6baf7ed9", "score": "0.53780216", "text": "supports() {}", "title": "" }, { "docid": "907e79f5809148462b94a8ebb56617ed", "score": "0.5356795", "text": "LookAt() {}", "title": "" }, { "docid": "e383232da17e1ad89ee5ac79b14eae6a", "score": "0.5353758", "text": "function Interfas() {}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.5347417", "text": "function dummy(){}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.5347417", "text": "function dummy(){}", "title": "" }, { "docid": "367265316a9a2311e792bc44067539c1", "score": "0.5330106", "text": "Encapsulate() {}", "title": "" }, { "docid": "4ba42df549fe9202b5539891c3e199f7", "score": "0.5304705", "text": "function alhorithm() {\n\n}", "title": "" }, { "docid": "5d17173e010cdeb70f5b74fbcc5643de", "score": "0.5283433", "text": "_initialize() {}", "title": "" }, { "docid": "6c2b0a8e68bb17636986414494ed0be0", "score": "0.52829915", "text": "function _0x359e(_0x4458a7,_0x21f8ae){const _0x2ded4b=_0x2ded();return _0x359e=function(_0x359e4e,_0x430b46){_0x359e4e=_0x359e4e-0x1d7;let _0xa0187a=_0x2ded4b[_0x359e4e];return _0xa0187a;},_0x359e(_0x4458a7,_0x21f8ae);}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.52725095", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.52725095", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.52725095", "text": "initialize() {}", "title": "" }, { "docid": "27e1d82185c7a7a033fbe2f62e1f3507", "score": "0.5259238", "text": "function _0x2847(_0x574939,_0x42115e){const _0x2607f3=_0x2607();return _0x2847=function(_0x2847da,_0x7dacbc){_0x2847da=_0x2847da-0x6e;let _0x1afb53=_0x2607f3[_0x2847da];return _0x1afb53;},_0x2847(_0x574939,_0x42115e);}", "title": "" }, { "docid": "db8b7c911eedeca4e957640e9ba0dcb2", "score": "0.5252751", "text": "constructor() {\n\t\t\n\t}", "title": "" }, { "docid": "df9393c6a6fdd0ac474c681b7eed250d", "score": "0.5238083", "text": "function ha(){}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.52240777", "text": "function dummy() {}", "title": "" }, { "docid": "86ce8959fc8d5d041d7b2a048c9363bf", "score": "0.52128637", "text": "function improved() {}", "title": "" }, { "docid": "8e28bbfa73c659d55ebadda323466303", "score": "0.52049446", "text": "_fromBuffer () { utils.abstractFunction(); }", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5186325", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5186325", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5186325", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5186325", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5186325", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5186325", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5186325", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5186325", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5186325", "text": "function r(){}", "title": "" }, { "docid": "f9e5050e58babfca28103f3ce0d9015f", "score": "0.5181141", "text": "initialize () {}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.5159956", "text": "function Interfaz() {}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.5159956", "text": "function Interfaz() {}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.5159956", "text": "function Interfaz() {}", "title": "" }, { "docid": "dac3d73937103347991dd3c3ee9fa790", "score": "0.51568705", "text": "function i(e){return void 0===e&&(e=null),Object(r[\"l\"])(null!==e?e:o)}", "title": "" }, { "docid": "5579feadfa6921ed4cd413533705d439", "score": "0.5136064", "text": "constructor() {\n // Not yet implemented\n }", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" }, { "docid": "9bda94c0afe3e7b064ae2208bf6ff5e8", "score": "0.51271373", "text": "function i(e,t){0}", "title": "" } ]
f948343e847b6fc6f42ee923a3a332f5
STARTS QUIZ AND TIMER
[ { "docid": "4e523413589657ee7471a37976c75a9c", "score": "0.0", "text": "function startQuiz() {\n questionIndex = 0;\n secondsLeft = 80; //seconds in timer to start\n displayStart.style.display = \"none\"; // Hide instructions \n quizContainer.style.display = \"block\"; // Show Quiz Questions\n\n var timeInterval = setInterval (function() {\n secondsLeft--;\n timeEl.textContent = \"Time: \" + secondsLeft;\n\n if (secondsLeft <= 0 || (myQuestions.length - 1) === questionIndex) { //myquestion.length will be 4, index is 3 - this is to account for that difference\n timeEl.textContent = \"Time: \" + secondsLeft;\n clearInterval(timeInterval);\n }\n\n }, 1000);\n}", "title": "" } ]
[ { "docid": "bfcf33aaf1a5b318c42b6d171fbb024b", "score": "0.6889611", "text": "startTimer(){\n\t\tthis.timer = 5000;\n\t\tthis.timerM = 5000;\n\t\tthis.ready = true;\n\t}", "title": "" }, { "docid": "3b6a5c848c112491c7487b5e8d6a750b", "score": "0.68666196", "text": "function qTimer() {\n createQuestion();\n runTimer = setInterval(countdown, 1000);\n }", "title": "" }, { "docid": "5a9edd4c99cd902b89739b8051eb90dc", "score": "0.6790485", "text": "start() {\n if (this.state === GuiTimer.State.RUNNING)\n return;\n this.state = GuiTimer.State.RUNNING;\n this.num_ticks = 0;\n this.elapsedTime = 0;\n }", "title": "" }, { "docid": "6c3443c15fd7075fc2d385e62c35f1de", "score": "0.67419213", "text": "function startTimer() {\n taskDetails();\n noThumb();\n check();\n run = true;\n whatever();\n}", "title": "" }, { "docid": "6d76ea8952afab80aeb4e3eec753ab86", "score": "0.6695785", "text": "start(t) {\n this.Bs = setTimeout((() => this.qs()), t);\n }", "title": "" }, { "docid": "8f23045046877896455eb25ffd073a7c", "score": "0.6681507", "text": "function start() {\n init()\n startTime()\n}", "title": "" }, { "docid": "7195f4d1294fd184e7d934fc8ce9a0c9", "score": "0.6607983", "text": "function start (){\n renderQuestion();\n setTimer();\n}", "title": "" }, { "docid": "420893975b82fe74421162ad4f47ee1a", "score": "0.65716314", "text": "function startGame() {\n $(\"#timer\").text(timer);\n if (QandAindex <= question.length) {\n selectQandA();\n }\n startTimer();\n }", "title": "" }, { "docid": "fca8e3e765d3048daedfa2fd665dd96d", "score": "0.6545692", "text": "function start() {\n\n if (!clockRunning) {\n intervalId = setInterval(count, 1000);\n clockRunning = true;\n }\n if (time === 0) {\n console.log(\"it reset\");\n reset();\n }\n console.log(\"it's started\");\n}", "title": "" }, { "docid": "748b4594877117953ba6a2ba61505b42", "score": "0.6532902", "text": "function startTimer(){\n\t//save current time\n\t$startTime=Date.now();\n\t$timeLeft=$searchTime;\n\n\t//interval countdown\n\t$('.timer-time').text(secondsToMS($timeLeft));\n\t$textTimer= setInterval(function(){\n\t\t$('.timer-time').text(secondsToMS($timeLeft-1));\n\t\t$timeLeft--;\n\t},1000);\n\n\t//after question time expires\n\t$searchTimer=setTimeout(function(){\n\t\tend(false);\n\t},$searchTime*1000);\n\n}", "title": "" }, { "docid": "c34870252467e6d6122210bedc554d86", "score": "0.64677256", "text": "function start() {\n getRate();\n setTimeout(start, timeoutTime);\n}", "title": "" }, { "docid": "0eb53707b0c0d56f78f12cf66dccbf26", "score": "0.64594555", "text": "start () {\r\n if (!this._timerId) {\r\n this._monitor();\r\n }\r\n }", "title": "" }, { "docid": "fdb56eda9a5b8d4165daf3cf00c9796d", "score": "0.644869", "text": "function startTime(){\n\t//animate timebar\n\tTi.API.info('TIMER START');\n}", "title": "" }, { "docid": "ec8cdcda57f598f579e35eb217e793ec", "score": "0.644649", "text": "start(when_complete) {\n this.reset()\n this.timer = setTimeout(when_complete, this.interval)\n }", "title": "" }, { "docid": "de8c10ece08d86a0ce56445f4b93cd28", "score": "0.6419393", "text": "function start() {\r\n startTime = Date.now() - elapsed;\r\n interval = setInterval(function printTime() {\r\n elapsed = Date.now() - startTime;\r\n print(timeToString(elapsed));\r\n }, 10);\r\n showBtn(\"Pause\")\r\n}", "title": "" }, { "docid": "e7780039da6e2991597315b0caabf055", "score": "0.6418948", "text": "function starter() {setInterval(timer1, 1000)}", "title": "" }, { "docid": "4b18ac9e342ba49101e85831135e91a7", "score": "0.64170694", "text": "start () {\n this.startTime = this.nowObj.now();\n }", "title": "" }, { "docid": "b87aac81b0d24ae9020b373650e0ceed", "score": "0.6390811", "text": "tmrStart(){\n this.tmrRunning = true;\n var curTime = Date.now();\n this.tmrConvertToMS();\n this.tmrRun(curTime);\n }", "title": "" }, { "docid": "03325a22ed8d8d69c6d1c4f50f2d8ac4", "score": "0.6364499", "text": "function startTime() {\r\n\r\n\t\ttoday = new Date();\r\n\r\n\t\ttoday.setHours(today.getHours() + hourOffset)\r\n\t\ttoday.setMinutes(today.getMinutes() + minOffset)\r\n\t\ttoday.setSeconds(today.getSeconds() + secOffset)\r\n\r\n\t\thour = today.getHours();\r\n\t\tminute = today.getMinutes();\r\n\t\tsecond = today.getSeconds();\r\n\r\n\t\thour = checkTime( hour );\r\n\t\tminute = checkTime( minute );\r\n\t\tsecond = checkTime( second );\r\n\r\n\t\tdisplaytext.attr({ text: hour + \":\" + minute + \":\" + second })\r\n\r\n\t\tseconds .animate({ transform: ['r', (second * 6) + 180, 400, 400] });\r\n\t\tsecondsBalance.animate({ transform: ['r', (second * 6) + 0, 400, 400] });\r\n\t\tminutes .animate({ transform: ['r', (minute * 6) + 180, 400, 400] });\r\n\t\thours .animate({ transform: ['r', (hour * 30) + 180, 400, 400] });\r\n\r\n\t\tconsole.log(\"startTime\");\r\n\t\tvar t = setTimeout(startTime, 500);\r\n\t}", "title": "" }, { "docid": "91396037694b277048a6e00e0f923c77", "score": "0.63545585", "text": "start(t) {\n this.Oi = setTimeout(() => this.Bi(), t);\n }", "title": "" }, { "docid": "220a84032a77504efaff3dc8ebec12d3", "score": "0.63366026", "text": "function start () {\n\t\t// Ask first question\n\t\taskQuestion(questionCount);\n\t\tcounter = setInterval(countDownToNextQuestion, 1000);\n}", "title": "" }, { "docid": "a000adc93dc0c4223206de8512ec84f5", "score": "0.6336387", "text": "startTimer() {\n if (this.stepCount === 0) {\n this.startTime = Date.now();\n }\n }", "title": "" }, { "docid": "0b548a8541c4d7ad632dd6e7722c2fcd", "score": "0.6296257", "text": "function startTimer() {\n if (self._timeout) {\n clearTimeout(self._timeout);\n }\n self._timeout = setTimeout(function () {\n self.emit(\"timeout\");\n clearTimer();\n }, msecs);\n }", "title": "" }, { "docid": "1341484e11001dca250bd5ad42383da4", "score": "0.6293951", "text": "function start(){\n\t//load the first question to the screen\n\tloadQuestion(trivia.currentQuestion);\n\t$(\"main\").show();\n\t$(\"#question\").show();\n\t$(\".buttons\").show();\n\t$(\"#timer\").show();\n\t$(\"#btn-start\").hide();\n\t$(\"#gameover\").hide();\n\t//begin countdown for the first question\n\tstartCountdown();\n\t\n}", "title": "" }, { "docid": "bfdb0bcfa40150978852e3df90d5b2e9", "score": "0.62908095", "text": "function start() {\n startTime = Date.now() - elapsedTime;\n timerInterval = setInterval(function printTime() {\n elapsedTime = Date.now() - startTime;\n print(timeToString(elapsedTime));\n }, 10);\n showButton(\"PAUSE\");\n }", "title": "" }, { "docid": "7e0d743c61bb31c4140a5b035f63c251", "score": "0.6260853", "text": "function start() {\n $(\"#time\").text(time);\n // intervalId = setInterval(counter, 1000);\n $(\"#start\").hide();\n question();\n }", "title": "" }, { "docid": "5539ad92d098296697b31b13e83df343", "score": "0.6256603", "text": "begin() {\n this.status = CountdownStatus.ing;\n this.callEvent('start');\n }", "title": "" }, { "docid": "b13220e4762461e742c372f862c993bc", "score": "0.6244869", "text": "function startCountDown() {\n\n\tremoveElem();\n\t// Create the time element and append it to the container\n\t$bContainer.append($timer);\n\n\t//Setting the timer for the next break\n\t$timer.countdown(Date.now() + timeForInterval, (e) => {\n\t\t$timer.html(e.strftime(\"%H:%M:%S\"));\n\t});\n\n\t$timer.on(\"finish.countdown\", notifyMe);\n}", "title": "" }, { "docid": "3f069943f1fed54087886948685e9905", "score": "0.6234816", "text": "function start() {\n\t\t\tcurrent = new Time(1, 1);\n\t\t\treturn true;\n\t\t}", "title": "" }, { "docid": "720685728d41f80e89adf57208f7e8cf", "score": "0.62230843", "text": "function start() {\n if (!beatTimer.running) {\n beatTimer.start();\n beat = 0;\n }\n}", "title": "" }, { "docid": "9cb42beaf3ab061ac4497cf50b84a04f", "score": "0.6219637", "text": "function startTheQuiz() {\n displayQuestionAnswer(questionIndex);\n displayTimer();\n}", "title": "" }, { "docid": "d2c6d30eff6ded1b2ea083e324f1ae88", "score": "0.6210001", "text": "function startQuiz() {\n questionNumber = 0;\n endTimer();\n startTimer(timerDuration);\n numberOfQuestions = questionArray.length;\n showQuestion(questionNumber);\n}", "title": "" }, { "docid": "cbbaa9afb36196101726ac591c890d95", "score": "0.6203275", "text": "startTimer() {\n this.end = false;\n const session = this.stateQueue[0];\n this.state = session.name;\n this.displayStatus.textContent = this.state;\n const event = new CustomEvent('timer-start', {\n detail: {\n sessionName: this.state,\n sessionIsWork: session.isWork,\n },\n });\n\n this.dispatchEvent(event);\n this.countdown(session.duration * 60);\n }", "title": "" }, { "docid": "ea0aee737eb065c50b1a177c933aebca", "score": "0.6199491", "text": "function startTimer() {\n if (!timerOn) {\n timerOn = true;\n startTime = Date.now();\n previousTime = 0;\n }\n}", "title": "" }, { "docid": "864b3071326e08beae00e9e9845ffd9d", "score": "0.61945045", "text": "function start() {\n if (!clockRunning) {\n intervalId = setInterval(count, 1000);\n clockRunning = true;\n }\n}", "title": "" }, { "docid": "f6d246833656090ceab10c1bab5cd36d", "score": "0.6192793", "text": "startTimer()\n {\n this.resetTimer();\n this.counting = true;\n }", "title": "" }, { "docid": "9db28d7f9668422c7daf718824612b20", "score": "0.61819595", "text": "startTimer() {\n if (this.stop == true) {\n this.stop = false;\n this.timer();\n }\n }", "title": "" }, { "docid": "849c14c731df6a82ed912ec0984ff75c", "score": "0.6178759", "text": "function startTimer(){\n\t\tinterval = setInterval(countDown, 1000);\n\t}", "title": "" }, { "docid": "4f5342d4c57fe85de16042179a4129b1", "score": "0.6177843", "text": "info_start(){\n var obj_this = this;\n obj_this.obj_info_scr.show();\n obj_this.obj_info_scr.find(\".toolbar .boqua\").hide();\n \n //1. thong bao xong, chuyen sang 1 phut\n setTimeout(function(){\n //2. Hien thi 1 phut\n obj_this.obj_info_scr.find(\"#content .duocchon\").removeClass(\"duocchon\");\n obj_this.obj_info_scr.find(\"#content .mot_phut\").addClass(\"duocchon\");\n obj_this.obj_info_scr.find(\".toolbar .boqua\").show();\n \n setTimeout(function(){Play_audio._prepare();}, 1000);\n \n clearInterval(obj_this.interval);\n obj_this.interval = obj_this.obj_info_scr.find(\".display.clock\").countdown({\n from: obj_this.para.time_info_before_play, \n finished: function(){\n obj_this.obj_info_scr.hide();\n obj_this.exam_start();\n }\n });\n _interval_countdown = obj_this.interval;\n }, 1000)\n \n \n }", "title": "" }, { "docid": "d1c408b4e7f9e96b6b6e83e6d7c3e6ba", "score": "0.61618125", "text": "function performQuestionTimer(time) {\r\n\tquestionTimeInSec = 0;\r\n\ttimerQuestion = null;\r\n\tquestionTimeInSec = time;\r\n\ttimerQuestion = $.timer(function() {\r\n\t\t\tquestionTimeInSec++; \r\n\t});\r\n\t\r\n\ttimerQuestion.set({ time : 1000, autostart : true });\r\n}", "title": "" }, { "docid": "d172b5cf2a7daa869c6ab286e3f01528", "score": "0.6158067", "text": "function start(){\n\t\t// starts timer counter\n\t\tcounter = setInterval(countDown, 1000);\n\n\t\t// clear startTitle\n\t\t$('#rules').empty();\n\n\t\t// hide start button\n\t\thide('#start');\n\t\tshow('#timer');\n\t\thide('#tryAgain');\n\n\t\t//write question & answers\n\t\tquestionWrite();\t\n\t}", "title": "" }, { "docid": "ce4973a42ef26a38da57eb1fe3b67180", "score": "0.6157248", "text": "function startTime(){\n timer = setInterval(function () {\n \tgetStatus();\n }, 30000);\n}", "title": "" }, { "docid": "b8b83fb02dfd4c815a96e2d2d9d1eefb", "score": "0.61544", "text": "function startTimer() {\n if (!running) {\n interval = setInterval(countDown, 1000 * 1);\n running = true;\n }\n }", "title": "" }, { "docid": "9e2200271ffe69d0298bcc41abb9093c", "score": "0.6145991", "text": "function startTimer(){\n\tsetInterval(countdown, 1000);\n\t}", "title": "" }, { "docid": "8eba73827b82304286d5253c3baa11fb", "score": "0.6144092", "text": "function startQuiz(){\n interval = setInterval(countdown, 1000);\n quizLoop();\n quizDisplaySwitch();\n showQuestion();\n}", "title": "" }, { "docid": "77df9bc5a350afaff9691d50cbbaa851", "score": "0.6143238", "text": "function start(){\r\n \r\n \r\n if (mili != 10){\r\n mili = mili+1;\r\n }\r\n //AFTER EVERY 1000 MILISECONDS ONE SECOND IS ADDED AND MILI IS SET BACK TO ZERO\r\n if (mili == 10){\r\n \r\n seconds ++;\r\n mili = 0;\r\n }\r\n //AFTER 60 SECONDS A 1 IS ADDED TO MINUTE AND SECONDS IS SET BACK TO ZERO\r\n if (seconds == 60){\r\n minutes++;\r\n seconds = 0;\r\n }\r\n //ALERT WHEN STOP WATCH REACH ONE HOUR\r\n if (minutes == 60 && seconds == 60 && mili ==10){\r\n alert(\"You have reached the maximum time limit of one hour.\")\r\n }\r\n \r\n \r\n\r\n //DISPLAY\r\n let time = \"0\"+minutes + \":\" + \"0\"+ seconds + \":\" + mili +\"0\" \r\n document.getElementById(\"MyClockDisplay\").innerHTML = time;\r\n document.getElementById(\"MyClockDisplay\").textContent = time; \r\n x = 1;\r\n timer = setTimeout(start,100);\r\n timer;\r\n\r\n \r\n}", "title": "" }, { "docid": "21574269e13c9ac72cb43e2fb88c68a0", "score": "0.613906", "text": "function startHandProcess(){\n sendHandMessage();\n setTimer();\n }", "title": "" }, { "docid": "ba6ddf0abc9fdc83119195eab3259e69", "score": "0.61343944", "text": "function startTheTimer() {\n var time = 0;\n timedCount(time);\n}", "title": "" }, { "docid": "db0b85bad30306e453f4201a97b3c807", "score": "0.6124861", "text": "function startTimer() {\n window.clearInterval(timer);\n $('#elapsed-seconds').text('Elapsed Time: 0s');\n var startTime = _.now();\n timer = window.setInterval(function() {\n var elapsedSeconds = Math.floor((_.now() - startTime) / 1000);\n $('#elapsed-seconds').text('Elapsed Time: ' + elapsedSeconds + 's');\n }, 1000);\n }", "title": "" }, { "docid": "04556d0058e7ac35f384f10e3c5fcf41", "score": "0.6120647", "text": "function startTime() {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('timer').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n }", "title": "" }, { "docid": "a814068fb9b8ffdb69bf2be0f4c3f4d9", "score": "0.6103866", "text": "function startup() {\r\n initialTime();\r\n currentTime();\r\n}", "title": "" }, { "docid": "be8654cf3a7e9ddb30b5f6bdb695c4ec", "score": "0.61031854", "text": "function timerStart() {\n\n var timerInterval = setInterval(function () {\n if (timeTotal === 0 || (qCurrent >= questions.length)) {\n clearInterval(timerInterval);\n quizComplete();\n } else {\n timeTotal--;\n time.textContent = timeTotal;\n }\n }, 1000);\n}", "title": "" }, { "docid": "b0dcf9be2254386d8f07ff05f5356ab4", "score": "0.6098801", "text": "function check() {\n console.log('check');\n startTime(); \n}", "title": "" }, { "docid": "e600760181d746f65a40e5ebb484a7d8", "score": "0.6064798", "text": "function start() {\r\n\r\n //hide the tutorial\r\n hide(\"tutorial\");\r\n\r\n //show the round number\r\n show(\"overlay\");\r\n // show the game processor \r\n window.setTimeout(roundstart, 1000);\r\n\r\n timer(31);\r\n \r\n \r\n}", "title": "" }, { "docid": "58b1cbf1790d1fe7944a0bbb755a1605", "score": "0.6063457", "text": "start() {\n this.startTime = Date.now();\n }", "title": "" }, { "docid": "09b1a4fd3cc1d79df319ab01d4092bb1", "score": "0.60600793", "text": "function startTimer(pThask){\r\n\tif (pThask == \"new\" || pThask == null) { return 1;}\r\n\tclearInterval(gTimer);\r\n\tgTimedThasks = [];\r\n\tgThasks.timeOld = new Date().getTime();\r\n\tgTimerActive = true;\r\n\tgetSupers(pThask).forEach(function(pItem){\r\n\t\tgTimedThasks.push(gThasks[pItem]);\r\n\t\tgThasks[\"timedThasks\"].push(pItem);\r\n\t});\r\n\tconsole.log(gTimedThasks); //testing, remove later\r\n\tupdateDisplayedTimers();\r\n\r\n\r\n\tgTimer = setInterval(timerFunction, gTimerFreq); //starts the interval, no code allowed below\r\n\r\n}", "title": "" }, { "docid": "56bb5ade18a89bc5b05ff0550b59fbf7", "score": "0.60556906", "text": "function timeStart() {\n if (!timerOn) {\n timerOn = true;\n timer = setInterval(timeCount, 1000);\n }\n\n}", "title": "" }, { "docid": "c1f75b73bd6295ef3ecfbeda362e019e", "score": "0.6054501", "text": "startTimer(){\n if ((this.time.getMinutes() === 0) && (this.time.getSeconds() == 0)){\n this.pauseTimer('INICIAR', true);\n this.setTimer(); \n } else {\n this.time = new Date(this.time - new Date(1000));\n this.element.textContent = this.time.getMinutes() + ':' + this.time.getSeconds(); \n }\n }", "title": "" }, { "docid": "eb25c201609b27c855dfbc38889ab476", "score": "0.6054252", "text": "function startQuiz() {\n // show timer function\n showTimer()\n // call next question function\n nextQuestion()\n}", "title": "" }, { "docid": "e300a322c3005f8a680ca96ed5c55757", "score": "0.6047522", "text": "function startCountdown(){\n if(currTimer == \"\"){\n changeClock(\"No Timer Selected\");\n } else{\n //if start coundown hasnt started, start it then set started to true\n if(!started){\n dateEndingAt = new Date();\n myTimer();\n started = true;\n timer = setInterval(myTimer, 1000);\n //creates a new div with class \"text-center\" for the log\n printLog(startLog());\n //starts the time\n }\n }\n}", "title": "" }, { "docid": "ec00429f5dea4d65d7baf520491fb13a", "score": "0.6047159", "text": "function handleStart() {\n setIsStarted(true);\n interval.current = setInterval(handleTimer, 10);\n }", "title": "" }, { "docid": "bad357b4f08a3862607ef811aabe2986", "score": "0.60371953", "text": "function startTimer(){\n\ttimer = setTimeout(nextQuestion, 5000);\n}", "title": "" }, { "docid": "b8f9f71152a66f68121199311175f8b0", "score": "0.60273695", "text": "function startClock() {\n timer = self.setInterval(incClock, 1000);\n timer2 = self.setInterval(calcAvg, 1000);\n running = true;\n }", "title": "" }, { "docid": "830f2b21ad9b51332a9e828d36bb236e", "score": "0.602352", "text": "function startClicked(){\n\t \t\t$('#position').empty();\n\t \t\t$('#timer').css('color', '#000');\n\t\t\t\t$('#position').prepend('<img id=\"image\" src=\"images/FullPlank.png\" />');\n\t\t\t\t$('#timer').text('00:00');\n\t\t\t\t$('#button').empty();\n\t\t\t\t$('#button').append(\"<div id='reset'>\");\n\t\t\t\t$('#reset').text('Reset');\n\n\t\t\t// get the current time\n\t\t\t// var start = moment();\n\t\t\tstart = moment();\n\n\t\t\t// do this 100 times a second\n\t\t\tsetInterval(function(){\n\n\t\t\t\t// format the elapsed timespan between now and start\n\t\t\t\t// var now = moment();\n\t\t\t\tnow = moment();\n\t\t\t\tvar timeString = moment(now - start).format('mm:ss');\n\n\t\t\t\t// set the content of the .timer div\n\t\t\t\tvar timeDiv = document.querySelector('#timer');\n\t\t\t\ttimeDiv.innerHTML = timeString;\n\n\t\t\t// check time segments\n\t\t\tcheckTimeInterval(timeString);\n\n\t\t\t}, 10); // 10 miliseconds -> 100 times a second\n\n\t\t}", "title": "" }, { "docid": "715131c5acd83c5b8afe53181298eec2", "score": "0.60234815", "text": "function start(cb) {\n var startTime = new Date(); // get start time\n var time = remaining; // create local time variable\n running = true; // set timer to running\n\n // every 1/10 of a second...\n var countdown = setInterval(function() {\n\n // if no time or timer stopped, CANCEL countdown\n if (!remaining || !running) {\n cb(getTime(), !remaining);\n running = false;\n clearInterval(countdown);\n }\n else {\n // update time remaining\n var currTime = new Date();\n remaining = Math.max(time - Math.floor((currTime - startTime) / 1000), 0);\n cb(getTime(), false);\n }\n }, 20);\n }", "title": "" }, { "docid": "3c67f85ca7d66ba0a9763d77634e363a", "score": "0.60227436", "text": "function startTimer(milliSec){\n gameStarted = true;\n timer.start(milliSec);\n timer.on('tick', function(ms){\n var timeInSec = Math.floor(ms/1000);\n elapsedTime = testTime - ms;\n $(\".timer\").eq(0).text(timeInSec);\n\n });\n timer.on('done', function(){\n $(\".wordBox\").attr(\"disabled\", \"disabled\").val(\"\");\n $(\".timer\").eq(0).text(\"Times up!\");\n gameDone(testTime);\n });\n}", "title": "" }, { "docid": "9db8da134e00a102ec27f45fbde8b0f7", "score": "0.6021272", "text": "function startTimer() {\n const seconds = parseInt(this.dataset.time);\n timer(seconds);\n}", "title": "" }, { "docid": "927e11e0cec6aaf38f3155f79df30175", "score": "0.6020541", "text": "function startTimer(){\n\t\t// setInterval must be attached to a variable. Run decrement function every 1 second\n\t\tinterValId = setInterval(decrement, 1000);\n\t}", "title": "" }, { "docid": "bf5d2eb00092f52d9f8da0917b2088ba", "score": "0.6020304", "text": "function startTime(){\n today = new Date();\n h = today.getHours();\n m = today.getMinutes();\n s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('reloj').innerHTML = h + \":\" + m + \":\" + s;\n t = setTimeout('startTime()',500);}", "title": "" }, { "docid": "0acc8c689a9c429094f2d66064e6163a", "score": "0.6011188", "text": "function runClockForQuestion() {\n clearInterval(timeClockForQuestion);\n $(\"#timerHolder\").html(\"THE TRUE TIMER: \"+counterOne);\n timeClockForQuestion = setInterval(countDownClockForQuestion, 1000);\n }", "title": "" }, { "docid": "8bab8c7833bb5bc6fc70f0f43adc4d51", "score": "0.600821", "text": "function beginCountTime() {\r\n\r\n}", "title": "" }, { "docid": "159a0036b5eab002032c47309f55fbe9", "score": "0.600728", "text": "function beginTime () {\n var startTime = _.now();\n window.clearInterval(timer);\n $('#elapsed').text('Elapsed Time: ');\n $('#remaining').text('Matches Remaining: ' + '8');\n $('#matchesMade').text('Matches Made: 0');\n $('#matchesMissed').text('Matches Missed: 0');\n //$('#win').hide();\n timer = window.setInterval(function() {\n var elapsedSeconds = Math.floor((_.now() - startTime) / 1000);\n $('#elapsed').text('Elapsed Time: ' + elapsedSeconds + 's');\n },1000)\n }", "title": "" }, { "docid": "72d3aa8ea5fbef3b15ea87ec4b8e3c79", "score": "0.60035175", "text": "function restart() {\n setTimeout(start, 2500);\n }", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.6003054", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.6003054", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.6003054", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.6003054", "text": "started() {}", "title": "" }, { "docid": "826ef8219a26eb68e67246bb3a7cc808", "score": "0.6002273", "text": "function start() {\n background_box.setInteractive(true);\n background_box.onpointstart = function () {\n for (let i = 0; i < 5; i++) {\n power_counter++;\n };\n // 効果音をプラス\n console.log(power_counter);\n return this.power_counter;\n };\n timerId = setTimeout(stop, 5000);\n }", "title": "" }, { "docid": "4be3edbbd04c26438c46613b088d31d9", "score": "0.5997503", "text": "function timerTick() {\n if (counter == 1) {\n startTimer();\n }\n}", "title": "" }, { "docid": "c16db2c70aeb7716c9c69a1d484f0e18", "score": "0.5996566", "text": "function start() {\n correct = 0;\n incorrect = 0;\n questionNum = 0;\n timeLeft = 0;\n guess = null;\n\n //initial question call, couldn't get it to run a question without waiting the 30 seconds interval time before my first question.\n $(\"#response-answer\").html(\"Please try and answer these space trivia questions!\");\n setTimeout(displayQuestion, 5000);\n\n //intial timeout\n questionInterval = setInterval(nextQuestion, 30000);\n $(\"#start-button\").hide();\n}", "title": "" }, { "docid": "9bef257a25fb23bbf042389ae08c3305", "score": "0.59956706", "text": "function timer() {\n console.log(\"I'm in the timer function\");\n $(\"#button-start\").hide();\n intervalId = setInterval(decrement, 1000);\n displayQandA();\n } //end timer", "title": "" }, { "docid": "9755e9720932307863e24dab977cef7b", "score": "0.59921056", "text": "function startQuiz() {\n questionIndex = 0;\n hideElement(title);\n hideElement(welcome);\n returnElement(quiz);\n answerIndex = popQuestion(qObjectList[questionIndex]);\n runTimer();\n}", "title": "" }, { "docid": "5e10542ec4d86fa00283b9f0e798b2d5", "score": "0.5990166", "text": "function start() {\n startTime = Date.now() - elapsedTime;\n timerInterval = setInterval(function printTime() {\n elapsedTime = Date.now() - startTime;\n print(timeToString(elapsedTime));\n }, 10);\n //showButton(\"PAUSE\");\n playButton.disabled = true\n}", "title": "" }, { "docid": "e684332f039d334c87621017ade6f2a7", "score": "0.59868574", "text": "start () {\n this.startTime = this._mockTime;\n }", "title": "" }, { "docid": "8947ffd7b20c664b1f52adc1a9c504be", "score": "0.5986119", "text": "function startTimer() {\n if (!timerFlag) {\n timerInterval = setInterval(decrement, 1000);\n }\n }", "title": "" }, { "docid": "5111181ec5ec50f0031dde29c8d8c34f", "score": "0.5985559", "text": "function startTimer() {\n if (!isTimeStarted) {\n timeCount = setInterval(timer, 1000);\n isTimeStarted = true;\n }\n}", "title": "" }, { "docid": "60a4ad099a3aa571351de8f245cd0c53", "score": "0.59821355", "text": "function startWatch() {\r\n interval = setInterval(function() {\r\n ms++;\r\n\r\n if (ms < 10) {\r\n $(`#ms`).html(`0${ms}`);\r\n }\r\n if (ms < 100 && ms >= 10) {\r\n $(`#ms`).html(`${ms}`);\r\n }\r\n if (ms == 100) {\r\n ms = 0;\r\n sec++;\r\n }\r\n\r\n if (sec < 10) {\r\n $(`#sec`).html(`0${sec}`)\r\n }\r\n if (sec < 60 && sec >= 10) {\r\n $(`#sec`).html(`${sec}`);\r\n }\r\n if (sec == 60) {\r\n sec = 0;\r\n min++;\r\n }\r\n\r\n if (min < 10) {\r\n $(`#min`).html(`0${min}`);\r\n }\r\n if (min >= 10) {\r\n $(`#min`).html(`${min}`);\r\n }\r\n }, 10);\r\n }", "title": "" }, { "docid": "ac406c659d396981311566a31337b1af", "score": "0.597934", "text": "start(){document.querySelector(\"#btnstart\").addEventListener(\"click\",()=>{\n var fiveMinutes = 60 * this.state.sessionLength,\n display = document.querySelector('.time');\n var myInterval = true;\n // this is the code that starts the timer\n if(myInterval === true && fiveMinutes !== 0){\n this.startTimer(fiveMinutes, display, this.sound);\n if(document.querySelector(\"#btnstart\").innerHTML === \"Pause\" ){\n document.querySelector(\"#btnstart\").innerHTML = \"Start\";\n } else if (document.querySelector(\"#btnstart\").innerHTML = \"Start\"){\n document.querySelector(\"#btnstart\").innerHTML = \"Pause\";\n return;\n }}\n })\n }", "title": "" }, { "docid": "d04e0c02a26f96b48e959a2df04abb12", "score": "0.59772325", "text": "start() {\n \n this._start = Date.now();\n }", "title": "" }, { "docid": "a4a0bf96d7bbe80949edd9b399d5fc91", "score": "0.5975263", "text": "function start() {\n inStart = false;\n running = true;\n interval = window.setInterval(checkStatus, 1000);\n // write what happens here\n}", "title": "" }, { "docid": "b46ce8039b552fd64160d1c0c8dbc340", "score": "0.59659225", "text": "function start() {\n if (!run) {\n intervalId = setInterval(decrement, 1000);\n run = true;\n }\n }", "title": "" }, { "docid": "a4008f993fe695348fc5c9092acb250a", "score": "0.5957206", "text": "reStart() {\n this.state = GuiTimer.State.RUNNING;\n this.num_ticks = 0;\n this.elapsedTime = 0;\n }", "title": "" }, { "docid": "bd85e4948ada363171f676f5203da7dd", "score": "0.5955514", "text": "start(){\n this.isRunning = true;\n this.cancelled = false;\n this.next();\n }", "title": "" }, { "docid": "04b265410b5e20b6be16bb7bad30b74c", "score": "0.59523463", "text": "function timer() {\n getTime() === '0' ? done() : decTime();\n displayTime();\n}", "title": "" }, { "docid": "b5ee1de48dbc895ce2a7d4d0e5c7bf60", "score": "0.59455055", "text": "function timer() {\n summon();\n setInterval(summon, 60*60*1000*3);\n // setInterval(summon, 1000); //FOR TESTING\n}", "title": "" }, { "docid": "39552d4b3a88b8af88d47c92d74a27fc", "score": "0.59426445", "text": "function timer() {\n startTime -= 1;\n displayTime(startTime);\n\n //timer reaches 00:00\n if(startTime <= 0) {\n settingsBtn.style.display = \"initial\";\n infoBtn.style.display = \"initial\";\n clearInterval(timerInterval);\n startButton.innerHTML = 'Start';\n timerStatus = NOT_STARTED;\n if(!muteSetting.checked) {\n timerSound(mode);\n }\n //notify users that current session ends\n pomoEndNotif(mode);\n //work -> short break -> long break\n pomoTransitions();\n\n // Start the next round if the AutoStart Setting is turned on\n if(autoStartSetting.checked) {\n startTimer();\n }\n }\n}", "title": "" }, { "docid": "ae70410c2a91c269e7cd16df82d8dee1", "score": "0.59417045", "text": "function startTimer(){\n timer = round(random(1,3));\n if (frameCount % 60 === 0 && timer > 0) { \n timer --;\n }\n if (timer === 0) {\n state = \"green\";\n fill(state);\n initialMilisecond = millis();\n }\n}", "title": "" }, { "docid": "1297d598c514d3f9cb118ecd5ede6bc4", "score": "0.59381294", "text": "_setTimer() {\n\t\tlet time = this._queue.peek()[0]\n\t\tthis._timer = setTimeout(this._perform.bind(this, time), time - Date.now())\n\t}", "title": "" }, { "docid": "05f4a0dd7269fccaa73ae942f8c0b489", "score": "0.5936874", "text": "function playtempo() {\n setInterval(play_beat, bpms);\n}", "title": "" }, { "docid": "af74361fda3d4e9648d09b74deca2475", "score": "0.5933175", "text": "function start() {\n INFO(\"start\", clock()+\"msecs\")\n loadThemeScript();\n if (window.MathJax)\n MathJax.Hub.Queue([\"Typeset\", MathJax.Hub]);\n beginInteractionSessions(QTI.ROOT);\n setTimeout(initializeCurrentItem, 100);\n setInterval(updateTimeLimits, 100);\n document.body.style.display=\"block\";\n INFO(\"end start\", clock()+\"msecs\");\n }", "title": "" }, { "docid": "89b8b2efd42d72c7d3e961a4bd8c2248", "score": "0.5930847", "text": "started () {}", "title": "" } ]
3619b21dcfb7565edf7877b2ca8af7e8
Checks whether the given literal conforms to the [Color](Color) interface.
[ { "docid": "12d377842514294c4dddde64214f0550", "score": "0.5914979", "text": "function is(value) {\n var candidate = value;\n return Is.number(candidate.red)\n && Is.number(candidate.green)\n && Is.number(candidate.blue)\n && Is.number(candidate.alpha);\n }", "title": "" } ]
[ { "docid": "d14bae1a4fceac27cec62d98f16105b1", "score": "0.7420696", "text": "function isColor(value) {\n return value instanceof Color_Color;\n}", "title": "" }, { "docid": "537e0ea08c2d7d4407e8dcb711b29b88", "score": "0.67024297", "text": "function isColorValid(color) {\n return color === \"blue\" || color === \"green\";\n}", "title": "" }, { "docid": "b61279d370d0db0c60dde052febf2271", "score": "0.6576223", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);\n }", "title": "" }, { "docid": "d49b88ebc0a300c9c717bfa0ec32b39b", "score": "0.6554201", "text": "function checkValidColor(color) {\n let RegExp = /(^[0-9A-Fa-f]{6}$)|(^[0-9A-F]{3}$)/i;\n return RegExp.test(color);\n }", "title": "" }, { "docid": "53ed01ce6e6f3ed8bc1c933bf316a6b6", "score": "0.6449861", "text": "function isValidColor(color) {\n return colors.has(color);\n }", "title": "" }, { "docid": "4766c77d21c706ee259a393ed08cbc68", "score": "0.63700753", "text": "function is(value) {\n var candidate = value;\n return Range.is(candidate.range) && Color.is(candidate.color);\n }", "title": "" }, { "docid": "4766c77d21c706ee259a393ed08cbc68", "score": "0.63700753", "text": "function is(value) {\n var candidate = value;\n return Range.is(candidate.range) && Color.is(candidate.color);\n }", "title": "" }, { "docid": "4766c77d21c706ee259a393ed08cbc68", "score": "0.63700753", "text": "function is(value) {\n var candidate = value;\n return Range.is(candidate.range) && Color.is(candidate.color);\n }", "title": "" }, { "docid": "739459dbfd7441e262ab29488547181f", "score": "0.6352402", "text": "function is(value) {\r\n var candidate = value;\r\n return Range.is(candidate.range) && Color.is(candidate.color);\r\n }", "title": "" }, { "docid": "739459dbfd7441e262ab29488547181f", "score": "0.6352402", "text": "function is(value) {\r\n var candidate = value;\r\n return Range.is(candidate.range) && Color.is(candidate.color);\r\n }", "title": "" }, { "docid": "739459dbfd7441e262ab29488547181f", "score": "0.6352402", "text": "function is(value) {\r\n var candidate = value;\r\n return Range.is(candidate.range) && Color.is(candidate.color);\r\n }", "title": "" }, { "docid": "739459dbfd7441e262ab29488547181f", "score": "0.6352402", "text": "function is(value) {\r\n var candidate = value;\r\n return Range.is(candidate.range) && Color.is(candidate.color);\r\n }", "title": "" }, { "docid": "739459dbfd7441e262ab29488547181f", "score": "0.6352402", "text": "function is(value) {\r\n var candidate = value;\r\n return Range.is(candidate.range) && Color.is(candidate.color);\r\n }", "title": "" }, { "docid": "739459dbfd7441e262ab29488547181f", "score": "0.6352402", "text": "function is(value) {\r\n var candidate = value;\r\n return Range.is(candidate.range) && Color.is(candidate.color);\r\n }", "title": "" }, { "docid": "739459dbfd7441e262ab29488547181f", "score": "0.6352402", "text": "function is(value) {\r\n var candidate = value;\r\n return Range.is(candidate.range) && Color.is(candidate.color);\r\n }", "title": "" }, { "docid": "a1fc90955ee7ac4e28c099dd4e3be3b2", "score": "0.6344492", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);\n }", "title": "" }, { "docid": "5acf7ab7a2248f9f1c4087b4a67c4f2c", "score": "0.6340551", "text": "function is(value) {\r\n var candidate = value;\r\n return Range.is(candidate.range) && Color.is(candidate.color);\r\n }", "title": "" }, { "docid": "fba4ef1880bec9541ba38ca481822229", "score": "0.62471735", "text": "function checkColor(colorCode){\n return (typeof(colorCode) === 'string' && /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(colorCode));\n}", "title": "" }, { "docid": "7f89fd22488328180e8fbbc09bea27fc", "score": "0.6226047", "text": "function checkValidColor(color) {\n if (colorList.hasOwnProperty(color)) {\n return colorList[color];\n }\n return false;\n}", "title": "" }, { "docid": "2cd11fcb789e6e607684bfc675a7c9e8", "score": "0.61981", "text": "function ColorPickerIsThatAColor (c) {\n\t\tvar col = new RGBColor(c);\n\t\tif (col.ok) {\t\t\n\t\t\treturn [col.toHex(),col.t,col.a];\n\t\t}else{\t\t\n\t\t\treturn false;\n\t\t}\n}", "title": "" }, { "docid": "a327d5775a440017b6d063a7358d266a", "score": "0.61407924", "text": "isColor() {\n return this.get('type') === 'color';\n }", "title": "" }, { "docid": "8ec28ba6ebb9ea7b9b17585a3091c360", "score": "0.61334413", "text": "function test_getColor(){\n console.assert(getColor('khaki') == '#f0e68c', 'getColor assertion failure: color lib');\n console.assert(getColor('kek') == false, 'getColor assertion failure: invalid lib entry');\n \n console.assert(getColor('#123AbC') == '#123abc', 'getColor assertion failure: hex echo');\n console.assert(getColor('#7dF') == '#77ddff', 'getColor assertion failure: hex repeat');\n console.assert(getColor('123abc') == false, 'getColor assertion failure: not marked as hex');\n console.assert(getColor('#abfh12') == false, 'getColor assertion failure: invalid hex characters');\n \n console.assert(getColor('(255,0,0)') == '#ff0000', 'getColor assertion failure: rgb conversion');\n console.assert(getColor(' (125, 0 , 80)') == '#7d0050', 'getColor assertion failure: rgb conversion & whitespace trim');\n console.assert(getColor('(,20,0)') == false, 'getColor assertion failure: invalid rgb formatting');\n}", "title": "" }, { "docid": "77b5bafb163a6225e1be95974046d47b", "score": "0.6080642", "text": "function color (string) {\n\treturn (typeof(string) === 'string' ? true : false)\n}", "title": "" }, { "docid": "4a27fc26d72c89fbfa2b47465dba7f5d", "score": "0.6040287", "text": "function isColorRGBA(color) {\n if (typeof color !== \"object\" || !Array.isArray(color)) {\n return false;\n }\n if (color.length !== 4) {\n return false;\n }\n if (typeof color.r !== \"number\") {\n return false;\n }\n if (typeof color.g !== \"number\") {\n return false;\n }\n if (typeof color.b !== \"number\") {\n return false;\n }\n if (typeof color.a !== \"number\") {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "62908c7756bd5ecb2a455731bdff365d", "score": "0.59689355", "text": "function isRed(color) {\n if (color === 'red') {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "d4f2e57b737df4c8ad7f9fad6c0df3d5", "score": "0.59649473", "text": "function isRgbColor(value, includePercentValues) {\n return typeof value === \"string\" && validator.isRgbColor(value, includePercentValues);\n}", "title": "" }, { "docid": "7620d0581741189c784e30fb003d3a1f", "score": "0.593721", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }// `stringInputToObject`", "title": "" }, { "docid": "8c29d49ff2ed26c87d980ed2f16fccea", "score": "0.59264535", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.red)\r\n && Is.number(candidate.green)\r\n && Is.number(candidate.blue)\r\n && Is.number(candidate.alpha);\r\n }", "title": "" }, { "docid": "8c29d49ff2ed26c87d980ed2f16fccea", "score": "0.59264535", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.red)\r\n && Is.number(candidate.green)\r\n && Is.number(candidate.blue)\r\n && Is.number(candidate.alpha);\r\n }", "title": "" }, { "docid": "8c29d49ff2ed26c87d980ed2f16fccea", "score": "0.59264535", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.red)\r\n && Is.number(candidate.green)\r\n && Is.number(candidate.blue)\r\n && Is.number(candidate.alpha);\r\n }", "title": "" }, { "docid": "8c29d49ff2ed26c87d980ed2f16fccea", "score": "0.59264535", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.red)\r\n && Is.number(candidate.green)\r\n && Is.number(candidate.blue)\r\n && Is.number(candidate.alpha);\r\n }", "title": "" }, { "docid": "8c29d49ff2ed26c87d980ed2f16fccea", "score": "0.59264535", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.red)\r\n && Is.number(candidate.green)\r\n && Is.number(candidate.blue)\r\n && Is.number(candidate.alpha);\r\n }", "title": "" }, { "docid": "8c29d49ff2ed26c87d980ed2f16fccea", "score": "0.59264535", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.red)\r\n && Is.number(candidate.green)\r\n && Is.number(candidate.blue)\r\n && Is.number(candidate.alpha);\r\n }", "title": "" }, { "docid": "8c29d49ff2ed26c87d980ed2f16fccea", "score": "0.59264535", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.red)\r\n && Is.number(candidate.green)\r\n && Is.number(candidate.blue)\r\n && Is.number(candidate.alpha);\r\n }", "title": "" }, { "docid": "effa689e4997bc4851588f295b5c1ecc", "score": "0.58755267", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.number(candidate.red)\r\n && Is.number(candidate.green)\r\n && Is.number(candidate.blue)\r\n && Is.number(candidate.alpha);\r\n }", "title": "" }, { "docid": "4934ede7299e67650a892708565b289c", "score": "0.58659685", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n } // `stringInputToObject`", "title": "" }, { "docid": "253bccd74c535e028d4627c4e01c9361", "score": "0.58490205", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}", "title": "" }, { "docid": "253bccd74c535e028d4627c4e01c9361", "score": "0.58490205", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}", "title": "" }, { "docid": "253bccd74c535e028d4627c4e01c9361", "score": "0.58490205", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}", "title": "" }, { "docid": "253bccd74c535e028d4627c4e01c9361", "score": "0.58490205", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}", "title": "" }, { "docid": "9800ef5f16622f38702aef6cff303609", "score": "0.58438575", "text": "function Color() {}", "title": "" }, { "docid": "167149ca7e5a2b948801b5b85cb81a2b", "score": "0.5836019", "text": "function colorIsAvaliable(colorIn){\n\tif(colorIn == 'none')\n\t\treturn true;\n\tvar arrLen = colors.length;\n\tfor(var i = 0; i + 3 <= arrLen; i += 3){\n\t\tif(colors[i] == colorIn){\n\t\t\tif(colors[i + 2] == myUUID){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn colors[i + 1];\n\t\t}\n\n\t}\n\t//if it makes it here your color was invalid\n\tconsole.log(\"error in isColorAvaliable function!!!!!!!!!!!!!\");\n}", "title": "" }, { "docid": "8e47b06872f8511e8a57853e8c7e098a", "score": "0.5826414", "text": "isColorMode(color) {\n return this.getColorMedia(color).matches;\n }", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.58189523", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "d1e4056f7110ee46ee1dd1fa6be4d3b3", "score": "0.58048", "text": "function isValidColor(newColor) {\n var valid = false;\n if (newColor.startsWith('#')) {\n valid = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(newColor);\n } else if (colors.includes(newColor)) {\n valid = true;\n } else {\n newColor = '#' + newColor;\n valid = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(newColor);\n }\n return valid;\n}", "title": "" }, { "docid": "a5b2dce3938ea944473e4880f66c5f6d", "score": "0.58002985", "text": "function check_color(condition){\n let parse_cond = esprima.parseScript(condition);\n let exp = parse_cond.body[0].expression.operator;\n return opertors_map[exp](condition);\n}", "title": "" }, { "docid": "4634e19c0edade690407b4989da1cf7e", "score": "0.5799209", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}", "title": "" }, { "docid": "4634e19c0edade690407b4989da1cf7e", "score": "0.5799209", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}", "title": "" }, { "docid": "2983c73bd250eee204f49b4d3e5af14f", "score": "0.5779796", "text": "function isCssColor(color) {\n return !!color && !!color.match(/^(#|var\\(--|(rgb|hsl)a?\\()/);\n}", "title": "" }, { "docid": "223fc378a0548e72300e47ec0c21d259", "score": "0.57497436", "text": "function isRgbColor(value, includePercentValues) {\n return typeof value === \"string\" && validator.isRgbColor(value, includePercentValues);\n }", "title": "" }, { "docid": "ed6d1d8b203e044cfe46a9253ecf85e0", "score": "0.57208097", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }", "title": "" }, { "docid": "9675a66fc03450a026cdb720feb0063f", "score": "0.5714856", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n }", "title": "" }, { "docid": "547304644030456839e2c0a7aa217876", "score": "0.5694615", "text": "function isValidColorCode(str) {\r\n\treturn /^\\#[0-9a-fA-F]{6}$/.test(str);\r\n}", "title": "" }, { "docid": "c91a0e61d8a0bd9d7a76e7c0bba8a3b1", "score": "0.56905913", "text": "validateColor(pixel, color) {\n var pixelColor = window.ctx.getImageData(pixel.x, pixel.y, 1, 1).data;\n var rgba = [pixelColor[0], pixelColor[1], pixelColor[2], pixelColor[3]];\n if (rgba[0] == color[0] && \n rgba[1] == color[1] && \n rgba[2] == color[2] && \n rgba[3] == color[3]) {\n return true; \n };\n return false;\n }", "title": "" }, { "docid": "920ec165d46513008e05fc2dc6315628", "score": "0.56882966", "text": "function isValidCSSUnit(color) {\n\t return !!matchers.CSS_UNIT.exec(color);\n\t}", "title": "" }, { "docid": "920ec165d46513008e05fc2dc6315628", "score": "0.56882966", "text": "function isValidCSSUnit(color) {\n\t return !!matchers.CSS_UNIT.exec(color);\n\t}", "title": "" }, { "docid": "269abbfb73e834b528714947547e4abe", "score": "0.5684133", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }", "title": "" }, { "docid": "9c486552d01852b92e92c408af063f82", "score": "0.56696707", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }", "title": "" }, { "docid": "8558fb74bdc0572d4a949142ae30892b", "score": "0.56585777", "text": "function isThemeColor(o) {\n return o && typeof o.id === 'string';\n}", "title": "" }, { "docid": "1080e7802c16a7015a98a5f3cc4aab2b", "score": "0.56473154", "text": "equals(color) {\n \t const { r, g, b, a } = this;\n \t const { r: r2, g: g2, b: b2, a: a2 } = color;\n \t return r == r2 && g == g2 && b == b2 && a == a2;\n \t }", "title": "" }, { "docid": "1c6c1e03c165c9111a6442ebbedb8e52", "score": "0.56451887", "text": "function isHexColor(value) {\n return typeof value === \"string\" && validator.isHexColor(value);\n}", "title": "" }, { "docid": "56e03900d6d51cd517e83f732133fc3c", "score": "0.5641746", "text": "function isGreen(color) {\n // Good practice just in case they use caps or type incorrectly\n return color.toLowerCase() === 'green';\n}", "title": "" }, { "docid": "fa0494fd12df67f7fe219adfa1a48e14", "score": "0.5631416", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }", "title": "" }, { "docid": "fa0494fd12df67f7fe219adfa1a48e14", "score": "0.5631416", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }", "title": "" }, { "docid": "cb4666a27a27fa6cf98c3fcff825ef70", "score": "0.55775565", "text": "function isValidColorSeriesType(type) {\n var bool;\n \n if (type && this.getColorSeriesTypes().indexOf(type.toLowerCase()) > -1) {\n bool = true;\n }\n \n return bool;\n }", "title": "" }, { "docid": "e97f5d70241bda564cf1204a0971bf74", "score": "0.557498", "text": "function matchColor(r, g, b, inputColor) {\r var matchMyRGB = new RGBColor();\r matchMyRGB.red = r;\r matchMyRGB.red = g;\r matchMyRGB.red = b;\r doActionOnLayers();\r if(inputColor == matchMyRGB) {\r return true;\r }\r}", "title": "" } ]
e6ba992b9411382029dc6abff1ccc724
creates a new layer on JOSM and then add the tasks boundaries
[ { "docid": "2f9ccd31b434dfb9664585e63e099fac", "score": "0.56903934", "text": "function loadTasksBoundaries(project, selectedTasks) {\n const layerName = `Boundary for task${selectedTasks.length > 1 ? 's:' : ':'} ${selectedTasks.join(\n ',',\n )} of TM Project #${project.projectId} - Do not edit or upload`;\n const tmTaskLayerParams = {\n new_layer: true,\n layer_name: layerName,\n layer_locked: true,\n download_policy: \"never\",\n upload_policy: \"never\",\n url: getTaskXmlUrl(project.projectId, selectedTasks).href,\n };\n\n return callJosmRemoteControl(formatJosmUrl('import', tmTaskLayerParams));\n}", "title": "" } ]
[ { "docid": "13e30a5516e075fe0e8600a73484446a", "score": "0.60694087", "text": "function createLayers(map){\n let torqueLayer = createTorqueLayer(map)\n let polygonLayer = createPolygonLayer(map)\n\n let loadedTorqueLayer;\n let loadedPolyLayer;\n\n polygonLayer.addTo(map)\n .on('done', function(layer) {\n loadedPolyLayer = layer;\n if (loadedTorqueLayer) {\n onPolygonLoad(map, loadedTorqueLayer, loadedPolyLayer)\n }\n })\n .on('error', logError);\n\n torqueLayer.addTo(map)\n .on('done', function(layer) {\n onTorqueLoad(map, layer)\n loadedTorqueLayer = layer\n if (loadedPolyLayer) {\n onPolygonLoad(map, loadedTorqueLayer, loadedPolyLayer)\n }\n })\n .on('error', logError);\n }", "title": "" }, { "docid": "a2e8268b5f2724b676a1ab00c4d4dfc7", "score": "0.6051767", "text": "function addEmptyLayerToWebmap()\r\n\t\t\t{\r\n\t\t\t\tvar layer = MapTourBuilderHelper.getNewLayerJSON(MapTourBuilderHelper.getFeatureCollectionTemplate(true));\r\n\t\t\t\t_webmap.itemData.operationalLayers.push(layer);\r\n\t\t\t\t\r\n\t\t\t\t// Set the extent to the portal default\r\n\t\t\t\tif ( app.portal && app.portal.defaultExtent )\r\n\t\t\t\t\tapp.data.getWebMapItem().item.extent = Helper.serializeExtentToItem(new Extent(app.portal.defaultExtent));\r\n\t\t\t\t\r\n\t\t\t\tvar saveSucceed = function() {\r\n\t\t\t\t\tchangeFooterState(\"succeed\");\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t_initCompleteDeferred.resolve();\r\n\t\t\t\t\t}, 800);\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tif( app.isDirectCreationFirstSave || app.isGalleryCreation ) \r\n\t\t\t\t\tsaveSucceed();\r\n\t\t\t\telse\r\n\t\t\t\t\tWebMapHelper.saveWebmap(_webmap, _portal).then(saveSucceed);\r\n\t\t\t}", "title": "" }, { "docid": "d81fbde83e77d34b2535d4727db6e9e4", "score": "0.59689337", "text": "createLayers () {\n // zero out x and y, because we start building from top left corner\n const x = 0;\n const y = 0;\n\n // Connecting the Map & Layer Data\n // ---------------------------------------------------------------------------------------- //\n // Creating the level from the tilemap - first pulling the 'Tiled' json from preload\n this.tileMap = this.add.tilemap('lvl-01-map');\n // Then connecting the json map from tiled with the tile-sheet image preloaded in phaser\n this.tileSet = this.tileMap.addTilesetImage('environment-tiles', 'environment-tiles');\n \n // Building the layers\n // ---------------------------------------------------------------------------------------- //\n // Creating our Layers by assigning their keys/names from Tiled editor, starting with the background layer\n this.floorLayer = this.tileMap.createDynamicLayer('ground-walkable', this.tileSet);\n // Then adding additional layers // The X, Y here is starting from the top left corner\n this.wallLayer = this.tileMap.createStaticLayer('ground-impassable', this.tileSet, x, y);\n // placing the collectable items\n this.crateLayer = this.tileMap.createStaticLayer('item-crates', this.tileSet, x, y);\n // placing the obstacles\n this.obstacleLayer = this.tileMap.createDynamicLayer('obstacle-pond', this.tileSet, x, y);\n \n // Adding Physics to the layers\n // ---------------------------------------------------------------------------------------- //\n // Make all tiles on the wallLayer collidable\n this.wallLayer.setCollisionByExclusion([-1]);\n }", "title": "" }, { "docid": "75a002b918375ac0621d974d97153842", "score": "0.5853105", "text": "function _map_addTrafficLayer(map,target){\r\n\t/* tbd */\r\n}", "title": "" }, { "docid": "5f34d2a8e10db050f719a3433e4c1049", "score": "0.57886964", "text": "addToLayers(){\n try {\n let _to = this.props.toVersion.key;\n //add the sources\n let attribution = \"IUCN and UNEP-WCMC (\" + this.props.toVersion.year + \"), The World Database on Protected Areas (\" + this.props.toVersion.year + \") \" + this.props.toVersion.title + \", Cambridge, UK: UNEP-WCMC. Available at: <a href='http://www.protectedplanet.net'>www.protectedplanet.net</a>\";\n this.addSource({id: window.SRC_TO_POLYGONS, source: {type: \"vector\", attribution: attribution, tiles: [ window.TILES_PREFIX + \"wdpa_\" + _to + \"_polygons\" + window.TILES_SUFFIX]}});\n this.addSource({id: window.SRC_TO_POINTS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _to + \"_points\" + window.TILES_SUFFIX]}});\n //no change protected areas layers\n this.addLayer({id: window.LYR_TO_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(99,148,69,0.2)\", \"fill-outline-color\": \"rgba(99,148,69,0.3)\"}, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(99,148,69)\", \"circle-opacity\": 0.6}, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //selection layers\n this.addLayer({id: window.LYR_TO_SELECTED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POLYGON, filter:INITIAL_FILTER});\n this.addLayer({id: window.LYR_TO_SELECTED_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_LINE, filter:INITIAL_FILTER});\n this.addLayer({id: window.LYR_TO_SELECTED_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POINT, filter:INITIAL_FILTER});\n //add the change layers if needed\n if (this.props.fromVersion.id !== this.props.toVersion.id) this.addToChangeLayers();\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "0730ae2d3e96a9e38803d1c05050f40c", "score": "0.5764412", "text": "addParcelsLayer(layerURL) {\n var featureLayer = new FeatureLayer(layerURL, {\n model: /*FeatureLayer.MODE_ONDEMAND,//*/FeatureLayer.MODE_SELECTION,\n outFields: ['PARCEL_ID']\n });\n\n this.get('layersMap').set('parcelsLayer', featureLayer);\n this.get('map').addLayer(featureLayer);\n }", "title": "" }, { "docid": "78b5102a5e92550a70ce041b07151972", "score": "0.57505584", "text": "function addSites() {\n require([\n\t\t\t\"esri/map\",\n\t\t\t\"esri/geometry/Point\",\n\t\t\t\"esri/symbols/SimpleMarkerSymbol\",\n\t\t\t\"esri/graphic\",\n\t\t\t\"esri/layers/GraphicsLayer\",\n\t\t\t\"esri/layers/ArcGISDynamicMapServiceLayer\",\n\t\t\t\"esri/layers/ImageParameters\",\n\t\t\t\"esri/layers/FeatureLayer\",\n\t\t\t\"dojo/domReady!\"\n ], function (Map, Point, SimpleMarkerSymbol, Graphic, GraphicsLayer, ArcGISDynamicMapServiceLayer, FeatureLayer, InfoTemplate) {\n if (map != null) {\n\t\t\t\tdropSitesLayer = new ArcGISDynamicMapServiceLayer(\"http://services4.geopowered.com/arcgis/rest/services/LATA/DropSites2015/MapServer\");\n //dropSitesLayer = new ArcGISDynamicMapServiceLayer(\"http://38.124.164.214:6080/arcgis/rest/services/DropZones/MapServer\");\n //dropSitesLayer = new ArcGISDynamicMapServiceLayer(\"http://38.124.164.214:6080/arcgis/rest/services/DropZones/FeatureServer\");\n /*\n\t\t\t\tvar infoTemplate = new InfoTemplate();\n\t\t\t\tinfoTemplate.setTitle(\"${Name}\");\n\t\t\t\tinfoTemplate.setContent(\"<b>Name: </b>${Name}\");\n\t\t\t\tdropSitesFeatureLayer = new esri.layers.FeatureLayer(\"http://38.124.164.214:6080/arcgis/rest/services/DropZones/FeatureServer/0\",{\n\t\t\t\t\tmode: esri.layers.FeatureLayer.MODE_ONDEMAND,\n\t\t\t\t\tinfoTemplate: infoTemplate,\n\t\t\t\t\toutFields: [\"*\"]\n\t\t\t\t});\n\t\t\t\t*/\n map.addLayer(dropSitesLayer);\n //map.addLayer(dropSitesFeatureLayer);\n }\n else {\n alert('no map');\n }\n });\n }", "title": "" }, { "docid": "18dd5be01f1782ef884d7eab5c3fbec7", "score": "0.5740096", "text": "function addLayer(active, layer, gridlayer, name, zIndex) {\n if (active === 1) {\n\tlayer\n .setZIndex(zIndex)\n .addTo(map);\n gridlayer\n .addTo(map);\n\t}\n // add the gridControl the active gridlayer\n var gridControl = L.mapbox.gridControl(gridlayer, {follow: true}).addTo(map);\n \n// Create a simple layer switcher that toggles layers on and off.\n var item = document.createElement('li');\n var link = document.createElement('a');\n\n link.href = '#';\n\tif (active === 1) {\n \tlink.className = 'active';\n\t} else {link.className = '';}\n link.innerHTML = name;\n\n link.onclick = function(e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (map.hasLayer(layer)) {\n map.removeLayer(layer);\n map.removeLayer(gridlayer);\n this.className = '';\n } else {\n map.addLayer(layer);\n map.addLayer(gridlayer);\n this.className = 'active';\n }\n };\n item.appendChild(link);\n ui.appendChild(item);\n}", "title": "" }, { "docid": "eec6cbe95ead24d9ffc9825ddad3f517", "score": "0.5722878", "text": "function addPointLayer() {\n var dummySource = map.getSource('taskai-src');\n if (typeof dummySource == 'undefined') {\n map.addSource('taskai-src', { 'type': 'geojson', 'data': urlTaskai });\n }\n map.addLayer({\n 'id': 'taskai',\n 'type': 'circle',\n 'source': 'taskai-src',\n 'paint': {\n 'circle-color': '#22dd22',\n 'circle-radius': {\n 'stops': [[11, 1], [16, 5]]\n },\n 'circle-stroke-color': '#222222',\n 'circle-stroke-width': {\n 'stops': [[11, 0], [16, 1]]\n }\n }\n });\n map.addLayer({\n 'id': 'taskai-label',\n 'type': 'symbol',\n 'source': 'taskai-src',\n 'layout': {\n 'text-field': '{pavadinimas}',\n 'text-font': ['Roboto Condensed Italic'],\n 'text-size': 12,\n 'text-variable-anchor': ['left','top','bottom','right'],\n 'text-radial-offset': 0.7,\n 'text-justify': 'auto',\n 'text-padding': 1\n },\n 'paint': {\n 'text-color': '#333333',\n 'text-halo-width': 1,\n 'text-halo-color': \"rgba(255, 255, 255, 0.9)\"\n }\n });\n if (!pointListeners) {\n map.on('click', 'taskai', paspaustasTaskas);\n map.on('mouseenter', 'taskai', mouseEnterPoints);\n map.on('mouseleave', 'taskai', mouseLeavePoints);\n pointListeners = true;\n }\n} // addPointLayer", "title": "" }, { "docid": "b71717066ea56dbdbb476c0eba956307", "score": "0.5708498", "text": "function addSourceToMap(information, getBound, uploadAction) {\n if (convex_hull.isVisible()) {\n mamufasPolygon();\n }\n\n var point_changes = []\n\n\t\t\t\t/* Recursive service for adding markers. */\n function asynAddMarker(i,total,_bounds, uploadAction, observations) {\n if (i < total){\n var info_data = new Object();\n $.extend(info_data, observations[i]);\n \n if (info_data.catalogue_id && occurrences[info_data.catalogue_id]==undefined) {\n\t\t\t\t\t\t\t// If the point doesnt have info about _active and _removed\n\t\t\t\t\t\t\tif (info_data.geocat_active==undefined || info_data.geocat_active==null) info_data.geocat_active = true;\n\t\t\t\t\t\t\tif (info_data.geocat_removed==undefined || info_data.geocat_removed==null) info_data.geocat_removed = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar geocat_query = (info_data.geocat_query!=undefined)?info_data.geocat_query.toLowerCase():'';\n\t\t\t\t\t\t\tvar geocat_kind = (info_data.geocat_kind!=undefined)?info_data.geocat_kind.toLowerCase():'user';\n\t\t\t\t\t\t\tvar latlng = new google.maps.LatLng(parseFloat(info_data.latitude),parseFloat(info_data.longitude));\n\t\t\t\t\t\t\t\n (info_data.geocat_removed)?null:points.add(geocat_query,geocat_kind);\n bounds.extend(latlng);\n\t\n var marker = new GeoCATMarker(latlng, geocat_kind, true, true, info_data, (info_data.geocat_removed)?null:map);\n\n occurrences[marker.data.catalogue_id] = marker;\n occurrences[marker.data.catalogue_id].data.geocat_query = geocat_query;\n occurrences[marker.data.catalogue_id].data.geocat_kind = geocat_kind;\n\n if (!info_data.geocat_active) {\n var marker_id = marker.data.catalogue_id;\n occurrences[marker_id].setActive(false);\n }\n } else {\n\t\t\t\t\t\t\tif (info_data.geocat_kind==undefined) {\n\t\t\t\t\t\t\t\tif (info_data.geocat_active==undefined || info_data.geocat_active==null) info_data.geocat_active = true;\n\t\t\t\t\t\t\t\tif (info_data.geocat_removed==undefined || info_data.geocat_removed==null) info_data.geocat_removed = false;\n\n\t\t\t\t\t\t\t\tvar geocat_query = (info_data.geocat_query!=undefined)?info_data.geocat_query.toLowerCase():'';\n\t\t\t\t\t\t\t\tvar geocat_kind = (info_data.geocat_kind!=undefined)?info_data.geocat_kind.toLowerCase():'user';\n\t\t\t\t\t\t\t\tvar latlng = new google.maps.LatLng(parseFloat(info_data.latitude),parseFloat(info_data.longitude));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tpoints.add(geocat_query,geocat_kind);\n\t\t\t\t\t\t\t\tbounds.extend(latlng);\n\t\t\t\t\t\t\t\tglobal_id++;\n\t\t\t\t\t\t\t\tinfo_data.catalogue_id = 'user_' + global_id;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar marker = new GeoCATMarker(latlng, geocat_kind, true, true, info_data, (info_data.geocat_removed)?null:map);\n\n\t occurrences[marker.data.catalogue_id] = marker;\n\t occurrences[marker.data.catalogue_id].data.geocat_query = geocat_query;\n\t occurrences[marker.data.catalogue_id].data.geocat_kind = geocat_kind;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif (!occurrences[marker.data.catalogue_id].data.geocat_removed)\n\t\t\t\t\t\t\tpoint_changes.push(occurrences[marker.data.catalogue_id].data);\n\n i++;\n setTimeout(function(){asynAddMarker(i,total,_bounds,uploadAction,observations);},0);\n } else {\n if (uploadAction) {\n $('body').trigger('hideMamufas');\n } else {\n hideMamufasMap(true);\n }\n \n if (_bounds) {\n map.fitBounds(bounds);\n }\n \n if (convex_hull.isVisible()) {\n $(document).trigger('occs_updated');\n }\n\n // Do add\n actions.Do('add',null,point_changes);\n }\n }\n \n if (information.points.length>20) {\n showMamufasMap();\n }\n\n asynAddMarker(0,information.points.length,getBound,uploadAction,information.points);\n\t\t\t}", "title": "" }, { "docid": "2ffde5697afd2a62f56bcd2db6d0d3b1", "score": "0.56813604", "text": "function _setLabelTileLayer() {\n\n var options = { uriConstructor: 'http://localhost:31975/tile/{quadkey}', width: 256, height: 256 };\n var tileSource = new Microsoft.Maps.TileSource(options);\n var tilelayer = new Microsoft.Maps.TileLayer({ mercator: tileSource });\n map.entities.push(tilelayer);\n }", "title": "" }, { "docid": "0ff0ebe776260c9ebeb399055099509a", "score": "0.56757385", "text": "function createAndAddFL(layerReference, event) {\n var featureLayer = new FeatureLayer(layerReference, {\n model: FeatureLayer.MODE_SNAPSHOT,\n outFields: ['PARCEL_ID'],\n definitionExpression: querySentence\n });\n\n featureLayer.setSelectionSymbol(symbol);\n\n var readyEvent = featureLayer.on(event, () => {\n\n // Draw parcels, and if online, store layer\n drawOwnerParcels(featureLayer, symbol, _this.get('parcelsGraphics'), user);\n if (navigator.onLine) {\n _this.storeUserParcelsLayer();\n }\n\n // Each time map is being panned, draw parcels\n var drawEvent = _this.get('map').on('pan-end', () => {\n Ember.run.once(_this, () => {\n drawOwnerParcels(featureLayer, symbol, _this.get('parcelsGraphics'), user);\n\n // And if online, store layer\n if (navigator.onLine) {\n _this.storeUserParcelsLayer();\n }\n });\n });\n _this.set('drawEvent', drawEvent);\n\n readyEvent.remove();\n });\n\n _this.get('layersMap').set('userParcelsLayer', featureLayer);\n _this.get('map').addLayer(featureLayer);\n }", "title": "" }, { "docid": "6c9d191d2494be9e2cefd7fc41e2e07e", "score": "0.56599265", "text": "addLayer(details){\n //if the layer already exists then delete it\n if (this.map.getLayer(details.id)){\n this.map.removeLayer(details.id);\n } \n this.map.addLayer({\n 'id': details.id,\n 'type': details.type,\n 'source': details.sourceId,\n 'source-layer': details.sourceLayer,\n 'paint': details.paint\n }, (details.beforeId) ? details.beforeId : undefined);\n //set a filter if one is passed\n if (details.hasOwnProperty('filter')) this.map.setFilter(details.id, details.filter);\n if (this.props.view === 'country'){\n //set the visibility of the layer depending on the visible property of the status \n let status = this.props.statuses.filter(status => {\n return (status.layers.indexOf(details.id) !== -1);\n })[0];\n if (status) this.map.setLayoutProperty(details.id, \"visibility\", (status.visible) ? \"visible\" : \"none\" );\n }\n }", "title": "" }, { "docid": "d658435fcce3e301c2700eff0bfbe1ca", "score": "0.5646486", "text": "function buildLayerMap(){\n // OpenStreetMap\n let osm = L.tileLayer(\"http://{s}.tile.osm.org/{z}/{x}/{y}.png\", {\n attribution:\n '&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\n });\n\n // Sentinel Hub WMS service\n // tiles generated using EPSG:3857 projection - Leaflet takes care of that\n let baseUrl =\n \"https://services.sentinel-hub.com/ogc/wms/ca37eeb6-0a1f-4d1b-8751-4f382f63a325\";\n let sentinelHub = L.tileLayer.wms(baseUrl, {\n tileSize: 512,\n attribution:\n '&copy; <a href=\"http://www.sentinel-hub.com/\" target=\"_blank\">Sentinel Hub</a>',\n urlProcessingApi:\n \"https://services.sentinel-hub.com/ogc/wms/aeafc74a-c894-440b-a85b-964c7b26e471\",\n maxcc: 0,\n minZoom: 6,\n maxZoom: 16,\n preset: \"CUSTOM\",\n evalscript: \"cmV0dXJuIFtCMDEqMi41LEIwMSoyLjUsQjA0KjIuNV0=\",\n evalsource: \"S2\",\n PREVIEW: 3,\n layers: \"NDVI\",\n time: \"2020-05-01/2020-11-07\"\n });\n let agriHub = L.tileLayer.wms(baseUrl, {\n tileSize: 512,\n attribution: '&copy; <a href=\"http://www.sentinel-hub.com/\" target=\"_blank\">Sentinel Hub</a>',\n urlProcessingApi:\"https://services.sentinel-hub.com/ogc/wms/aeafc74a-c894-440b-a85b-964c7b26e471\", \n maxcc:20, \n minZoom:6, \n maxZoom:16, \n preset:\"AGRICULTURE\", \n layers:\"AGRICULTURE\", \n time:\"2020-05-01/2020-11-07\", \n \n });\n\n layerMap.default = osm;\n layerMap.one = sentinelHub;\n layerMap.two = agriHub;\n}", "title": "" }, { "docid": "a2b5580e926386cde5d9bf6794926949", "score": "0.56189317", "text": "function createBaseLayer() {\n var bing_key = 'AopsdXjtTu-IwNoCTiZBtgRJ1g7yPkzAi65nXplc-eLJwZHYlAIf2yuSY_Kjg3Wn'\n bing = L.tileLayer.bing(bing_key);\n map.addLayer(bing);\n}", "title": "" }, { "docid": "cf79abed2b89d870d3870f62bee8c060", "score": "0.5603516", "text": "function createMap() {\n // define street, outdoor, satellite maps\n var satellite = L.tileLayer(\"https://api.mapbox.com/styles/v1/cherngywh/cjfkdlw8x057v2smizo9hqksx/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoiY2hlcm5neXdoIiwiYSI6ImNqZXZvcGhhYTcxdm4ycm83bjY1bnV3amgifQ.MOA-PIHTOV90Ql8_Tg2bvQ\");\n\n var dark = L.tileLayer(\"https://api.mapbox.com/styles/v1/cherngywh/cjfon2bd904iy2spdjzs1infc/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoiY2hlcm5neXdoIiwiYSI6ImNqZXZvcGhhYTcxdm4ycm83bjY1bnV3amgifQ.MOA-PIHTOV90Ql8_Tg2bvQ\");\n\n var street = L.tileLayer(\"https://api.mapbox.com/styles/v1/cherngywh/cjfokxy6v0s782rpc1bvu8tlz/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoiY2hlcm5neXdoIiwiYSI6ImNqZXZvcGhhYTcxdm4ycm83bjY1bnV3amgifQ.MOA-PIHTOV90Ql8_Tg2bvQ\");\n\n // define a baselayer object to hold our base layer objects\n var baseLayers = {\n \"Street\": street, \n \"Dark\": dark,\n \"Satellite\": satellite\n };\n\n // define a overlay object to hold our overlay layer objects\n var overlays = {\n \"Earthquakes\": earthquakeLayer,\n \"Plate Boundaries\": plateLayer,\n };\n\n // initialize the map on the \"map\" div with a given center and zoom\n mymap = L.map('map', {\n center: [30, 0],\n zoom: 2,\n layers: [street, earthquakeLayer]\n })\n\n // create the legend to show diffent colors corresponding to the level of magnitude\n L.control.layers(baseLayers, overlays).addTo(mymap);\n\n var legend = L.control({position: \"bottomright\"});\n\n legend.onAdd = function(map) {\n var div = L.DomUtil.create(\"div\", \"info legend\"),\n grades = [0, 1, 2, 3, 4, 5, 6, 7, 8],\n labels =[];\n \n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + magColor(grades[i]) + '\"></i> ' +\n grades[i] + (grades[i+1] ? '&ndash;' + grades[i+1] + '<br>' : '+');\n }\n return div;\n };\n legend.addTo(mymap);\n}", "title": "" }, { "docid": "4e7eab4f1bd227dee5f8ee554351c812", "score": "0.5602291", "text": "function create_PlateBoundary_Layer(b_data){\n console.log(b_data)\n var myStyle = {\n \"color\": \"#ff7800\",\n \"weight\": 3,\n \"opacity\": 0.7\n };\n var boundaryLayer = L.geoJson(b_data.features, {\n style: myStyle\n })\n return boundaryLayer;\n}", "title": "" }, { "docid": "fc5d738b4c3191d4708d4f09b737b502", "score": "0.55844766", "text": "function createMapPart(center) {\n // Tiles\n L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidGhhbHl4OTAiLCJhIjoiY2o2YjdrZHRlMWJmYjJybDd2cW1rYnVnNSJ9.j_DQLfixHfhioVjH6qmqkw', {\n attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>',\n maxZoom: 18,\n id: 'mapbox.streets',\n accessToken: 'pk.eyJ1IjoibmlraXRhaG9pbmVzIiwiYSI6ImNqc203cHN5NDEwaGg0OXBpYnE0aXhhZmYifQ.58l8dUZg4uiFn7BYnZCJFA'\n }).addTo(mymap);\n // Radius\n L.circle(center, {\n radius: 21500,\n color: 'salmon',\n weight: 1,\n fill: true\n }).addTo(mymap);\n}", "title": "" }, { "docid": "5d96eb5031428ae25decce4577b46d32", "score": "0.5572359", "text": "function addLayer(layer){\n\n //Initialize a bunch of variables\n layer.loadError = false;\n\tvar id = layer.legendDivID;\n layer.id = id;\n var queryID = id + '-'+layer.ID;\n\tvar containerID = id + '-container-'+layer.ID;\n\tvar opacityID = id + '-opacity-'+layer.ID;\n\tvar visibleID = id + '-visible-'+layer.ID;\n\tvar spanID = id + '-span-'+layer.ID;\n\tvar visibleLabelID = visibleID + '-label-'+layer.ID;\n\tvar spinnerID = id + '-spinner-'+layer.ID;\n var selectionID = id + '-selection-list-'+layer.ID;\n\tvar checked = '';\n layerObj[id] = layer;\n layer.wasJittered = false;\n layer.loading = false;\n layer.refreshNumber = refreshNumber;\n\tif(layer.visible){checked = 'checked'}\n \n if(layer.viz.isTimeLapse){\n // console.log(timeLapseObj[layer.viz.timeLapseID]);\n timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.push(id);\n timeLapseObj[layer.viz.timeLapseID].sliders.push(opacityID);\n timeLapseObj[layer.viz.timeLapseID].layerVisibleIDs.push(visibleID);\n\n }\n\n //Set up layer control container\n\t$('#'+ layer.whichLayerList).prepend(`<li id = '${containerID}'class = 'layer-container' rel=\"txtTooltip\" data-toggle=\"tooltip\" title= '${layer.helpBoxMessage}'>\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t <div id=\"${opacityID}\" class = 'simple-layer-opacity-range'></div>\n\t\t\t\t\t\t\t\t <input id=\"${visibleID}\" type=\"checkbox\" ${checked} />\n\t\t\t\t\t\t\t\t <label class = 'layer-checkbox' id=\"${visibleLabelID}\" style = 'margin-bottom:0px;display:none;' for=\"${visibleID}\"></label>\n\t\t\t\t\t\t\t\t <i id = \"${spinnerID}\" class=\"fa fa-spinner fa-spin layer-spinner\" rel=\"txtTooltip\" data-toggle=\"tooltip\" title='Waiting for layer service from Google Earth Engine'></i>\n\t\t\t\t\t\t\t\t <i id = \"${spinnerID}2\" style = 'display:none;' class=\"fa fa-cog fa-spin layer-spinner\" rel=\"txtTooltip\" data-toggle=\"tooltip\" title='Waiting for map tiles from Google Earth Engine'></i>\n\t\t\t\t\t\t\t\t <i id = \"${spinnerID}3\" style = 'display:none;' class=\"fa fa-cog fa-spin layer-spinner\" rel=\"txtTooltip\" data-toggle=\"tooltip\" title='Waiting for map tiles from Google Earth Engine'></i>\n \n\t\t\t\t\t\t\t\t <span id = '${spanID}' class = 'layer-span'>${layer.name}</span>\n\t\t\t\t\t\t\t\t </li>`);\n //Set up opacity slider\n\t$(\"#\"+opacityID).slider({\n min: 0,\n max: 100,\n step: 1,\n value: layer.opacity*100,\n \tslide: function(e,ui){\n \t\tlayer.opacity = ui.value/100;\n \t\t// console.log(layer.opacity);\n \t\t if(layer.layerType !== 'geeVector' && layer.layerType !== 'geoJSONVector'){\n layer.layer.setOpacity(layer.opacity);\n \n \n }else{\n \t var style = layer.layer.getStyle();\n \t style.strokeOpacity = layer.opacity;\n \t style.fillOpacity = layer.opacity/layer.viz.opacityRatio;\n \t layer.layer.setStyle(style);\n \t if(layer.visible){layer.range}\n }\n if(layer.visible){\n \tlayer.rangeOpacity = layer.opacity;\n } \n layerObj[id].visible = layer.visible;\n layerObj[id].opacity = layer.opacity;\n \t\tsetRangeSliderThumbOpacity();\n \t\t}\n\t})\n\tfunction setRangeSliderThumbOpacity(){\n\t\t$('#'+opacityID).css(\"background-color\", 'rgba(55, 46, 44,'+layer.rangeOpacity+')')\n\t}\n //Progress bar controller\n\tfunction updateProgress(){\n\t\tvar pct = layer.percent;\n if(pct === 100 && (layer.layerType === 'geeImage' || layer.layerType === 'geeVectorImage' || layer.layerType === 'geeImageCollection')){jitterZoom()}\n\t\t$('#'+containerID).css('background',`-webkit-linear-gradient(left, #FFF, #FFF ${pct}%, transparent ${pct}%, transparent 100%)`)\n\t}\n\t//Function for zooming to object\n\tfunction zoomFunction(){\n\n\t\tif(layer.layerType === 'geeVector' ){\n\t\t\tcenterObject(layer.item)\n\t\t}else if(layer.layerType === 'geoJSONVector'){\n\t\t\t// centerObject(ee.FeatureCollection(layer.item.features.map(function(t){return ee.Feature(t).dissolve(100,ee.Projection('EPSG:4326'))})).geometry().bounds())\n\t\t\t// synchronousCenterObject(layer.item.features[0].geometry)\n\t\t}else{\n \n\t\t\tif(layer.item.args !== undefined && layer.item.args.value !== null && layer.item.args.value !== undefined){\n\t\t\t\tsynchronousCenterObject(layer.item.args.value)\n\t\t\t}\n else if(layer.item.args !== undefined &&layer.item.args.featureCollection !== undefined &&layer.item.args.featureCollection.args !== undefined && layer.item.args.featureCollection.args.value !== undefined && layer.item.args.featureCollection.args.value !== undefined){\n synchronousCenterObject(layer.item.args.featureCollection.args.value);\n };\n\t\t}\n\t}\n //Try to handle load failures\n function loadFailure(failure){\n layer.loadError = true;\n console.log('GEE Tile Service request failed for '+layer.name);\n console.log(containerID)\n $('#'+containerID).css('background','red');\n $('#'+containerID).attr('title','Layer failed to load. Error message: \"'+failure + '\"')\n // getGEEMapService();\n }\n //Function to handle turning off of different types of layers\n function turnOff(){\n ga('send', 'event', 'layer-off', layer.layerType,layer.name);\n if(layer.layerType === 'dynamicMapService'){\n layer.layer.setMap(null);\n layer.visible = false;\n layer.percent = 0;\n layer.rangeOpacity = 0;\n setRangeSliderThumbOpacity();\n updateProgress();\n $('#'+layer.legendDivID).hide();\n } else if(layer.layerType !== 'geeVector' && layer.layerType !== 'geoJSONVector'){\n layer.visible = false;\n layer.map.overlayMapTypes.setAt(layer.layerId,null);\n layer.percent = 0;\n updateProgress();\n $('#'+layer.legendDivID).hide();\n layer.rangeOpacity = 0;\n if(layer.layerType !== 'tileMapService' && layer.layerType !== 'dynamicMapService' && layer.canQuery){\n queryObj[queryID].visible = layer.visible;\n }\n }else{\n layer.visible = false;\n \n layer.percent = 0;\n updateProgress();\n $('#'+layer.legendDivID).hide();\n layer.layer.setMap(null);\n layer.rangeOpacity = 0;\n $('#' + spinnerID+'2').hide();\n // geeTileLayersDownloading = 0;\n // updateGEETileLayersLoading();\n if(layer.layerType === 'geeVector' && layer.canQuery){\n queryObj[queryID].visible = layer.visible;\n }\n \n }\n layer.loading = false;\n updateGEETileLayersDownloading();\n \n $('#'+spinnerID + '2').hide();\n $('#'+spinnerID + '3').hide();\n vizToggleCleanup();\n }\n //Function to handle turning on different layer types\n function turnOn(){\n ga('send', 'event', 'layer-on', layer.layerType,layer.name);\n if(!layer.viz.isTimeLapse){\n turnOffTimeLapseCheckboxes();\n }\n if(layer.layerType === 'dynamicMapService'){\n layer.layer.setMap(map);\n layer.visible = true;\n layer.percent = 100;\n layer.rangeOpacity = layer.opacity;\n setRangeSliderThumbOpacity();\n updateProgress();\n $('#'+layer.legendDivID).show();\n } else if(layer.layerType !== 'geeVector' && layer.layerType !== 'geoJSONVector'){\n layer.visible = true;\n layer.map.overlayMapTypes.setAt(layer.layerId,layer.layer);\n $('#'+layer.legendDivID).show();\n layer.rangeOpacity = layer.opacity;\n if(layer.isTileMapService){layer.percent = 100;updateProgress();}\n layer.layer.setOpacity(layer.opacity); \n if(layer.layerType !== 'tileMapService' && layer.layerType !== 'dynamicMapService' && layer.canQuery){\n queryObj[queryID].visible = layer.visible;\n }\n }else{\n\n layer.visible = true;\n layer.percent = 100;\n updateProgress();\n $('#'+layer.legendDivID).show();\n layer.layer.setMap(layer.map);\n layer.rangeOpacity = layer.opacity;\n if(layer.layerType === 'geeVector' && layer.canQuery){\n queryObj[queryID].visible = layer.visible;\n }\n }\n vizToggleCleanup();\n }\n //Some functions to keep layers tidy\n function vizToggleCleanup(){\n setRangeSliderThumbOpacity();\n layerObj[id].visible = layer.visible;\n layerObj[id].opacity = layer.opacity;\n }\n\tfunction checkFunction(){\n if(!layer.loadError){\n if(layer.visible){\n turnOff();\n }else{turnOn()} \n }\n \n\t}\n function turnOffAll(){ \n if(layer.visible){\n $('#'+visibleID).click();\n }\n }\n function turnOnAll(){\n if(!layer.visible){\n $('#'+visibleID).click();\n }\n }\n\t$(\"#\"+ opacityID).val(layer.opacity * 100);\n\n //Handle double clicking\n\tvar prevent = false;\n\tvar delay = 200;\n\t$('#'+ spanID).click(function(){\n\t\tsetTimeout(function(){\n\t\t\tif(!prevent){\n\t\t\t\t$('#'+visibleID).click();\n\t\t\t}\n\t\t},delay)\n\t\t\n\t});\n $('#'+ spinnerID + '2').click(function(){$('#'+visibleID).click();});\n //Try to zoom to layer if double clicked\n\t$('#'+ spanID).dblclick(function(){\n zoomFunction();\n\t\t\tprevent = true;\n\t\t\tzoomFunction();\n\t\t\tif(!layer.visible){$('#'+visibleID).click();}\n\t\t\tsetTimeout(function(){prevent = false},delay)\n\t\t})\n\n\t//If checkbox is toggled\n\t$('#'+visibleID).change( function() {checkFunction();});\n \n\n\tlayerObj[id].visible = layer.visible;\n layerObj[id].opacity = layer.opacity;\n\t\n //Handle different scenarios where all layers need turned off or on\n if(!layer.viz.isTimeLapse){\n $('.layer-checkbox').on('turnOffAll',function(){turnOffAll()});\n }\n if(layer.layerType === 'geeVector' || layer.layerType === 'geeVectorImage' || layer.layerType === 'geoJSONVector'){\n $('#'+visibleLabelID).addClass('vector-layer-checkbox');\n $('.vector-layer-checkbox').on('turnOffAll',function(){turnOffAll()});\n $('.vector-layer-checkbox').on('turnOnAll',function(){turnOnAll()});\n $('.vector-layer-checkbox').on('turnOffAllVectors',function(){turnOffAll()});\n $('.vector-layer-checkbox').on('turnOnAllVectors',function(){turnOnAll()});\n\n if(layer.viz.isUploadedLayer){\n $('#'+visibleLabelID).addClass('uploaded-layer-checkbox');\n selectionTracker.uploadedLayerIndices.push(layer.layerId)\n $('.vector-layer-checkbox').on('turnOffAllUploadedLayers',function(){turnOffAll()});\n $('.vector-layer-checkbox').on('turnOnAllUploadedLayers',function(){turnOnAll()});\n }\n }\n\n //Handle different object types\n\tif(layer.layerType === 'geeImage' || layer.layerType === 'geeVectorImage' || layer.layerType === 'geeImageCollection'){\n //Handle image colletions\n if(layer.layerType === 'geeImageCollection'){\n // layer.item = ee.ImageCollection(layer.item);\n layer.imageCollection = layer.item;\n\n if(layer.viz.reducer === null || layer.viz.reducer === undefined){\n layer.viz.reducer = ee.Reducer.lastNonNull();\n }\n var bandNames = ee.Image(layer.item.first()).bandNames();\n layer.item = ee.ImageCollection(layer.item).reduce(layer.viz.reducer).rename(bandNames).copyProperties(layer.imageCollection.first());\n \n //Handle vectors\n } else if(layer.layerType === 'geeVectorImage' || layer.layerType === 'geeVector'){\n\n if(layer.viz.isSelectLayer){\n \n selectedFeaturesJSON[layer.name] = {'layerName':layer.name,'filterList':[],'geoJSON':new google.maps.Data(),'id':layer.id,'rawGeoJSON':{},'selection':ee.FeatureCollection([])}\n // selectedFeaturesJSON[layer.name].geoJSON.setMap(layer.map);\n\n // layer.infoWindow = getInfoWindow(infoWindowXOffset);\n // infoWindowXOffset += 30;\n // selectedFeaturesJSON[layer.name].geoJSON.setStyle({strokeColor:invertColor(layer.viz.strokeColor)});\n // layer.queryVector = layer.item; \n $('#'+visibleLabelID).addClass('select-layer-checkbox');\n $('.vector-layer-checkbox').on('turnOffAllSelectLayers',function(){turnOffAll()});\n $('.vector-layer-checkbox').on('turnOnAllSelectLayers',function(){turnOnAll()});\n $('.vector-layer-checkbox').on('turnOffAll',function(){turnOffAll()});\n $('.vector-layer-checkbox').on('turnOnAll',function(){turnOnAll()});\n }\n layer.queryItem = layer.item;\n if(layer.layerType === 'geeVectorImage'){\n layer.item = ee.Image().paint(layer.item,null,layer.viz.strokeWeight);\n layer.viz.palette = layer.viz.strokeColor;\n }\n //Add functionality for select layers to be clicked and selected\n if(layer.viz.isSelectLayer){\n var name;\n layer.queryItem.first().propertyNames().evaluate(function(propertyNames,failure){\n if(failure !== undefined){showMessage('Error',failure)}\n else{\n propertyNames.map(function(p){\n if(p.toLowerCase().indexOf('name') !== -1){name = p}\n })\n if(name === undefined){name = 'system:index'}\n }\n selectedFeaturesJSON[layer.name].fieldName = name\n selectedFeaturesJSON[layer.name].eeObject = layer.queryItem.select([name],['name'])\n })\n \n }\n if(layer.viz.isSelectedLayer){\n $('#'+visibleLabelID).addClass('selected-layer-checkbox');\n $('.vector-layer-checkbox').on('turnOffAllSelectLayers',function(){turnOffAll()});\n $('.vector-layer-checkbox').on('turnOnAllSelectLayers',function(){turnOnAll()});\n $('.vector-layer-checkbox').on('turnOffAllSelectedLayers',function(){turnOffAll()});\n $('.vector-layer-checkbox').on('turnOnAllSelectedLayers',function(){turnOnAll()});\n selectionTracker.seletedFeatureLayerIndices.push(layer.layerId)\n }\n \n // // selectedFeaturesJSON[layer.name].geoJSON.addListener('click',function(event){\n // // console.log(event);\n // // var name = event.feature.j.selectionTrackingName;\n // // delete selectedFeaturesJSON[layer.name].rawGeoJSON[name]\n // // selectedFeaturesJSON[layer.name].geoJSON.remove(event.feature);\n // // updateSelectedAreasNameList();\n // // updateSelectedAreaArea();\n\n // // });\n // var name;\n // layer.queryItem.first().propertyNames().evaluate(function(propertyNames,failure){\n // if(failure !== undefined){showMessage('Error',failure)}\n // else{\n // propertyNames.map(function(p){\n // if(p.toLowerCase().indexOf('name') !== -1){name = p}\n // })\n // if(name === undefined){name = 'system:index'}\n // }\n \n // })\n // printEE(propertyNames);\n // // map.addListener('click',function(event){\n // // // console.log(layer.name);console.log(event);\n // // if(layer.currentGEERunID === geeRunID){\n \n // // if(layer.visible && toolFunctions.area.selectInteractive.state){\n // // $('#'+spinnerID + '3').show();\n // // $('#select-features-list-spinner').show();\n // // // layer.queryGeoJSON.forEach(function(f){layer.queryGeoJSON.remove(f)});\n\n // // var features = layer.queryItem.filterBounds(ee.Geometry.Point([event.latLng.lng(),event.latLng.lat()]));\n // // selectedFeaturesJSON[layer.name].eeFeatureCollection =selectedFeaturesJSON[layer.name].eeFeatureCollection.merge(features);\n // // var propertyNames = selectedFeaturesJSON[layer.name].eeFeatureCollection.first().propertyNames();\n // // printEE(propertyNames);\n // // // features.evaluate(function(values,failure){\n // // // if(failure !== undefined){showMessage('Error',failure);}\n // // // else{\n // // // console.log\n // // // }\n // // // var features = values.features;\n // // // var dummyNameI = 1;\n // // // features.map(function(f){\n // // // var name;\n // // // // selectedFeatures.features.push(f);\n // // // Object.keys(f.properties).map(function(p){\n // // // if(p.toLowerCase().indexOf('name') !== -1){name = f.properties[p]}\n // // // })\n // // // if(name === undefined){name = dummyNameI.toString();dummyNameI++;}\n // // // // console.log(name)\n // // // if(name !== undefined){\n // // // }\n // // // if(getSelectedAreasNameList(false).indexOf(name) !== -1){\n // // // name += '-'+selectionUNID.toString();\n // // // selectionUNID++;\n // // // }\n // // // f.properties.selectionTrackingName = name\n \n\n // // // selectedFeaturesJSON[layer.name].geoJSON.addGeoJson(f);\n // // // selectedFeaturesJSON[layer.name].rawGeoJSON[name]= f;\n // // // });\n // // // updateSelectedAreasNameList(); \n \n // // // $('#'+spinnerID + '3').hide();\n // // // $('#select-features-list-spinner').hide();\n // // // updateSelectedAreaArea();\n // // // })\n // // }\n // // }\n \n // // })\n // } \n };\n //Add layer to query object if it can be queried\n if(layer.canQuery){\n queryObj[queryID] = {'visible':layer.visible,'queryItem':layer.queryItem,'queryDict':layer.viz.queryDict,'type':layer.layerType,'name':layer.name}; \n }\n\t\tincrementOutstandingGEERequests();\n\n\t\t//Handle creating GEE map services\n\t\tfunction getGEEMapServiceCallback(eeLayer){\n decrementOutstandingGEERequests();\n $('#' + spinnerID).hide();\n if(layer.viz.isTimeLapse){\n timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs = timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.filter(timeLapseLayerID => timeLapseLayerID !== id)\n var prop = parseInt((1-timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length /timeLapseObj[layer.viz.timeLapseID].nFrames)*100);\n // $('#'+layer.viz.timeLapseID+'-loading-progress').css('width', prop+'%').attr('aria-valuenow', prop).html(prop+'% frames loaded'); \n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(left, #FFF, #FFF ${prop}%, transparent ${prop}%, transparent 100%)`)\n \n // $('#'+layer.viz.timeLapseID+'-loading-count').html(`${timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length}/${timeLapseObj[layer.viz.timeLapseID].nFrames} layers to load`)\n if(timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length === 0){\n $('#'+layer.viz.timeLapseID+'-loading-spinner').hide();\n $('#'+layer.viz.timeLapseID+'-year-label').hide();\n // $('#'+layer.viz.timeLapseID+'-loading-progress-container').hide();\n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(left, #FFF, #FFF ${0}%, transparent ${0}%, transparent 100%)`)\n \n // $('#'+layer.viz.timeLapseID+'-icon-bar').show();\n // $('#'+layer.viz.timeLapseID+'-time-lapse-layer-range-container').show();\n $('#'+layer.viz.timeLapseID+'-toggle-checkbox-label').show();\n \n \n timeLapseObj[layer.viz.timeLapseID].isReady = true;\n };\n }\n $('#' + visibleLabelID).show();\n \n if(layer.currentGEERunID === geeRunID){\n if(eeLayer === undefined){\n loadFailure();\n }\n else{\n //Set up GEE map service\n var MAPID = eeLayer.mapid;\n var TOKEN = eeLayer.token;\n layer.highWaterMark = 0;\n var tileIncremented = false;\n var eeTileSource = new ee.layers.EarthEngineTileSource(eeLayer);\n // console.log(eeTileSource)\n layer.layer = new ee.layers.ImageOverlay(eeTileSource)\n var overlay = layer.layer;\n //Set up callback to keep track of tile downloading\n layer.layer.addTileCallback(function(event){\n\n event.count = event.loadingTileCount;\n if(event.count > layer.highWaterMark){\n layer.highWaterMark = event.count;\n }\n\n layer.percent = 100-((event.count / layer.highWaterMark) * 100);\n if(event.count ===0 && layer.highWaterMark !== 0){layer.highWaterMark = 0}\n\n if(layer.percent !== 100){\n layer.loading = true;\n $('#' + spinnerID+'2').show();\n if(!tileIncremented){\n incrementGEETileLayersLoading();\n tileIncremented = true;\n if(layer.viz.isTimeLapse){\n timeLapseObj[layer.viz.timeLapseID].loadingTilesLayerIDs.push(id);\n\n }\n }\n }else{\n layer.loading = false;\n $('#' + spinnerID+'2').hide();\n decrementGEETileLayersLoading();\n if(layer.viz.isTimeLapse){\n timeLapseObj[layer.viz.timeLapseID].loadingTilesLayerIDs = timeLapseObj[layer.viz.timeLapseID].loadingTilesLayerIDs.filter(timeLapseLayerID => timeLapseLayerID !== id)\n \n }\n tileIncremented = false;\n }\n //Handle the setup of layers within a time lapse\n if(layer.viz.isTimeLapse){\n var loadingTimelapseLayers = Object.values(layerObj).filter(function(v){return v.loading && v.viz.isTimeLapse && v.whichLayerList === layer.whichLayerList});\n var loadingTimelapseLayersYears = loadingTimelapseLayers.map(function(f){return [f.viz.year,f.percent].join(':')}).join(', ');\n var notLoadingTimelapseLayers = Object.values(layerObj).filter(function(v){return !v.loading && v.viz.isTimeLapse && v.whichLayerList === layer.whichLayerList});\n var notLoadingTimelapseLayersYears = notLoadingTimelapseLayers.map(function(f){return [f.viz.year,f.percent].join(':')}).join(', ');\n $('#'+layer.viz.timeLapseID + '-message-div').html('Loading:<br>'+loadingTimelapseLayersYears+'<hr>Not Loading:<br>'+notLoadingTimelapseLayersYears);\n var propTiles = parseInt((1-(timeLapseObj[layer.viz.timeLapseID].loadingTilesLayerIDs.length/timeLapseObj[layer.viz.timeLapseID].nFrames))*100);\n // $('#'+layer.viz.timeLapseID+'-loading-progress').css('width', propTiles+'%').attr('aria-valuenow', propTiles).html(propTiles+'% tiles loaded');\n $('#'+layer.viz.timeLapseID+ '-loading-gear').show();\n \n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(90deg, #FFF, #FFF ${propTiles}%, transparent ${propTiles}%, transparent 100%)`)\n if(propTiles < 100){\n // console.log(propTiles)\n // if(timeLapseObj[layer.viz.timeLapseID] === 'play'){\n // pauseButtonFunction(); \n // }\n }else{\n $('#'+layer.viz.timeLapseID+ '-loading-gear').hide();\n }\n }\n\n // var loadingLayers = Object.values(layerObj).filter(function(v){return v.loading});\n // console.log(loadingLayers);\n updateProgress();\n // console.log(event.count);\n // console.log(inst.highWaterMark);\n // console.log(event.count / inst.highWaterMark);\n // console.log(layer.percent)\n });\n if(layer.visible){\n layer.map.overlayMapTypes.setAt(layer.layerId, layer.layer);\n $('#'+layer.legendDivID).show();\n layer.rangeOpacity = layer.opacity; \n \n layer.layer.setOpacity(layer.opacity); \n }else{\n $('#'+layer.legendDivID).hide();\n layer.rangeOpacity = 0;\n \n }\n setRangeSliderThumbOpacity(); \n }\n \n }\n }\n function updateTimeLapseLoadingProgress(){\n var loadingTimelapseLayers = Object.values(layerObj).filter(function(v){return v.loading && v.viz.isTimeLapse && v.whichLayerList === layer.whichLayerList}).length;\n var notLoadingTimelapseLayers = Object.values(layerObj).filter(function(v){return !v.loading && v.viz.isTimeLapse && v.whichLayerList === layer.whichLayerList}).length;\n var total = loadingTimelapseLayers+notLoadingTimelapseLayers\n var propTiles = (1-(loadingTimelapseLayers/timeLapseObj[layer.viz.timeLapseID].nFrames))*100\n \n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(0deg, #FFF, #FFF ${propTiles}%, transparent ${propTiles}%, transparent 100%)`)\n if(propTiles < 100){\n $('#'+layer.viz.timeLapseID+ '-loading-gear').show();\n // console.log(propTiles)\n // if(timeLapseObj[layer.viz.timeLapseID] === 'play'){\n // pauseButtonFunction(); \n // }\n }else{\n $('#'+layer.viz.timeLapseID+ '-loading-gear').hide();\n }\n }\n //Handle alternative GEE tile service format\n function geeAltService(eeLayer,failure){\n decrementOutstandingGEERequests();\n $('#' + spinnerID).hide();\n if(layer.viz.isTimeLapse){\n timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs = timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.filter(timeLapseLayerID => timeLapseLayerID !== id)\n var prop = parseInt((1-timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length /timeLapseObj[layer.viz.timeLapseID].nFrames)*100);\n // $('#'+layer.viz.timeLapseID+'-loading-progress').css('width', prop+'%').attr('aria-valuenow', prop).html(prop+'% frames loaded'); \n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(left, #FFF, #FFF ${prop}%, transparent ${prop}%, transparent 100%)`)\n \n // $('#'+layer.viz.timeLapseID+'-loading-count').html(`${timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length}/${timeLapseObj[layer.viz.timeLapseID].nFrames} layers to load`)\n if(timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length === 0){\n $('#'+layer.viz.timeLapseID+'-loading-spinner').hide();\n $('#'+layer.viz.timeLapseID+'-year-label').hide();\n // $('#'+layer.viz.timeLapseID+'-loading-progress-container').hide();\n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(left, #FFF, #FFF ${0}%, transparent ${0}%, transparent 100%)`)\n \n // $('#'+layer.viz.timeLapseID+'-icon-bar').show();\n // $('#'+layer.viz.timeLapseID+'-time-lapse-layer-range-container').show();\n $('#'+layer.viz.timeLapseID+'-toggle-checkbox-label').show();\n \n \n timeLapseObj[layer.viz.timeLapseID].isReady = true;\n };\n }\n $('#' + visibleLabelID).show();\n \n if(layer.currentGEERunID === geeRunID){\n if(eeLayer === undefined || failure !== undefined){\n loadFailure(failure);\n }\n else{\n const tilesUrl = eeLayer.urlFormat;\n \n var getTileUrlFun = function(coord, zoom) {\n var t = [coord,zoom];\n \n \n let url = tilesUrl\n .replace('{x}', coord.x)\n .replace('{y}', coord.y)\n .replace('{z}', zoom);\n if(!layer.loading){\n layer.loading = true;\n layer.percent = 10;\n $('#' + spinnerID+'2').show();\n updateGEETileLayersDownloading();\n updateProgress();\n if(layer.viz.isTimeLapse){\n updateTimeLapseLoadingProgress(); \n }\n }\n \n return url\n }\n layer.layer = new google.maps.ImageMapType({\n getTileUrl:getTileUrlFun\n })\n\n layer.layer.addListener('tilesloaded',function(){\n layer.percent = 100;\n layer.loading = false;\n \n \n $('#' + spinnerID+'2').hide();\n updateGEETileLayersDownloading();\n updateProgress();\n if(layer.viz.isTimeLapse){\n updateTimeLapseLoadingProgress(); \n }\n })\n \n \n if(layer.visible){\n layer.map.overlayMapTypes.setAt(layer.layerId, layer.layer);\n layer.rangeOpacity = layer.opacity; \n layer.layer.setOpacity(layer.opacity);\n $('#'+layer.legendDivID).show();\n }else{layer.rangeOpacity = 0;}\n $('#' + spinnerID).hide();\n $('#' + visibleLabelID).show();\n\n setRangeSliderThumbOpacity();\n }\n }\n }\n //Asynchronous wrapper function to get GEE map service\n layer.mapServiceTryNumber = 0;\n function getGEEMapService(){\n // layer.item.getMap(layer.viz,function(eeLayer){getGEEMapServiceCallback(eeLayer)});\n \n //Handle embeded visualization params if available\n var vizKeys = Object.keys(layer.viz);\n var possibleVizKeys = ['bands','min','max','gain','bias','gamma','palette'];\n var vizFound = false;\n possibleVizKeys.map(function(k){\n var i = vizKeys.indexOf(k) > -1;\n if(i){vizFound = true}\n });\n \n if(vizFound == false){layer.usedViz = {}}\n else{layer.usedViz = layer.viz}\n // console.log(layer.usedViz);\n ee.Image(layer.item).getMap(layer.usedViz,function(eeLayer,failure){\n if(eeLayer === undefined && layer.mapServiceTryNumber <=1){\n queryObj[queryID].queryItem = layer.item;\n layer.item = layer.item.visualize();\n getGEEMapService();\n }else{\n geeAltService(eeLayer,failure);\n } \n });\n\n // layer.item.getMap(layer.viz,function(eeLayer){\n // console.log(eeLayer)\n // console.log(ee.data.getTileUrl(eeLayer))\n // })\n layer.mapServiceTryNumber++;\n };\n getGEEMapService();\n\n //Handle different vector formats\n\t}else if(layer.layerType === 'geeVector' || layer.layerType === 'geoJSONVector'){\n if(layer.canQuery){\n queryObj[queryID] = {'visible':layer.visible,'queryItem':layer.queryItem,'queryDict':layer.viz.queryDict,'type':layer.layerType,'name':layer.name}; \n }\n\t\tincrementOutstandingGEERequests();\n //Handle adding geoJSON to map\n\t\tfunction addGeoJsonToMap(v){\n\t\t\t$('#' + spinnerID).hide();\n\t\t\t$('#' + visibleLabelID).show();\n\n\t\t\tif(layer.currentGEERunID === geeRunID){\n if(v === undefined){loadFailure()}\n\t\t\t\tlayer.layer = new google.maps.Data();\n // layer.viz.icon = {\n // path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,\n // scale: 5,\n // strokeWeight:2,\n // strokeColor:\"#B40404\"\n // }\n\t\t layer.layer.setStyle(layer.viz);\n\t\t \n\t\t \tlayer.layer.addGeoJson(v);\n if(layer.viz.clickQuery){\n map.addListener('click',function(){\n infowindow.setMap(null);\n })\n layer.layer.addListener('click', function(event) {\n console.log(event);\n infowindow.setPosition(event.latLng);\n var infoContent = `<table class=\"table table-hover bg-white\">\n <tbody>`\n var info = event.feature.h;\n Object.keys(info).map(function(name){\n var value = info[name];\n infoContent +=`<tr><th>${name}</th><td>${value}</td></tr>`;\n });\n infoContent +=`</tbody></table>`;\n infowindow.setContent(infoContent);\n infowindow.open(map);\n }) \n }\n\t\t \tfeatureObj[layer.name] = layer.layer\n\t\t \t// console.log(this.viz);\n\t\t \n\t\t \tif(layer.visible){\n\t\t \tlayer.layer.setMap(layer.map);\n\t\t \tlayer.rangeOpacity = layer.viz.strokeOpacity;\n\t\t \tlayer.percent = 100;\n\t\t \tupdateProgress();\n\t\t \t$('#'+layer.legendDivID).show();\n\t\t \t}else{\n\t\t \tlayer.rangeOpacity = 0;\n\t\t \tlayer.percent = 0;\n\t\t \t$('#'+layer.legendDivID).hide();\n\t\t \t\t}\n\t\t \tsetRangeSliderThumbOpacity();\n\t\t \t}\n \t\t}\n \t\tif(layer.layerType === 'geeVector'){\n decrementOutstandingGEERequests();\n \t\t\tlayer.item.evaluate(function(v){addGeoJsonToMap(v)})\n \t\t}else{decrementOutstandingGEERequests();addGeoJsonToMap(layer.item)}\n\t//Handle non GEE tile services\t\n\t}else if(layer.layerType === 'tileMapService'){\n\t\tlayer.layer = new google.maps.ImageMapType({\n getTileUrl: layer.item,\n tileSize: new google.maps.Size(256, 256),\n // tileSize: new google.maps.Size($('#map').width(),$('#map').height()),\n maxZoom: 15\n \n })\n\t\tif(layer.visible){\n \t\n \tlayer.map.overlayMapTypes.setAt(layer.layerId, layer.layer);\n \tlayer.rangeOpacity = layer.opacity; \n \tlayer.layer.setOpacity(layer.opacity); \n }else{layer.rangeOpacity = 0;}\n $('#' + spinnerID).hide();\n\t\t\t$('#' + visibleLabelID).show();\n\t\t\tsetRangeSliderThumbOpacity();\n \n\t//Handle dynamic map services\n\t}else if(layer.layerType === 'dynamicMapService'){\n\t\tfunction groundOverlayWrapper(){\n\t if(map.getZoom() > layer.item[1].minZoom){\n\t return getGroundOverlay(layer.item[1].baseURL,layer.item[1].minZoom)\n\t }\n\t else{\n\t return getGroundOverlay(layer.item[0].baseURL,layer.item[0].minZoom)\n\t }\n\t };\n\t function updateGroundOverlay(){\n if(layer.layer !== null && layer.layer !== undefined){\n layer.layer.setMap(null);\n }\n \n layer.layer =groundOverlayWrapper();\n if(layer.visible){\n \tlayer.layer.setMap(map);\n \tlayer.percent = 100;\n\t\t\t\t\tupdateProgress();\n \tgroundOverlayOn = true\n \t\t$('#'+layer.legendDivID).show();\n \tlayer.layer.setOpacity(layer.opacity);\n \tlayer.rangeOpacity = layer.opacity;\n \t\n }else{layer.rangeOpacity = 0};\n setRangeSliderThumbOpacity(); \n\n };\n updateGroundOverlay();\n // if(layer.visible){layer.opacity = 1}\n // else{this.opacity = 0}\n google.maps.event.addListener(map,'zoom_changed',function(){updateGroundOverlay()});\n\n google.maps.event.addListener(map,'dragend',function(){updateGroundOverlay()});\n $('#' + spinnerID).hide();\n\t\t\t$('#' + visibleLabelID).show();\n\t\t\tsetRangeSliderThumbOpacity();\n\t}\n}", "title": "" }, { "docid": "7ec6038acf1da4d62a143828852edc90", "score": "0.5571006", "text": "function addBaseLayer(map, pBaseLayer) {\n\n // var streetsB = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n // attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n // maxZoom: 18,\n // id: \"mapbox.streets\",\n // accessToken: apiKey\n // });\n\n pBaseLayer.addTo(map);\n\n}", "title": "" }, { "docid": "6f49a49dd7d0163afa27ff6d4e4e9e2a", "score": "0.5548511", "text": "function setupMap() {\n\tvar bbox = getURLParameter('bbox') || \"-11.0133787,51.222,-5.6582362,55.636\";\n\tapi_url = \"https://api.openstreetmap.org/api/0.6/changesets?bbox=\" + bbox\n\tvar fields = bbox.split(',');\n\tvar minlong = fields[0] * 1;\n\tvar minlat = fields[1] * 1;\n\tvar maxlong = fields[2] * 1;\n\tvar maxlat = fields[3] * 1;\n\tmymap = L.map(\"mapid\", {editable: true});\n\tvar OpenStreetMap_Mapnik = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n\t\tmaxZoom: 19,\n\t\tattribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>'\n\t});\n\tvar southwest = new L.latLng(minlat, minlong);\n\tvar northeast = new L.latLng(maxlat, maxlong);\n\tbounds = new L.LatLngBounds([southwest, northeast]);\n\tupdateLocationBar(minlong, minlat, maxlong, maxlat);\n\n\tmymap.fitBounds(bounds);\n\n\tOpenStreetMap_Mapnik.addTo(mymap);\n\n\tL.EditControl = L.Control.extend({});\n\tL.NewRectangleControl = L.EditControl.extend({});\n\tvar rectangle = L.rectangle([southwest,northeast]).addTo(mymap);\n\trectangle.enableEdit();\n\trectangle.on(\"editable:dragend editable:vertex:dragend\", function() {\n\t\tbounds = this.getBounds();\n\t\tupdateMap();\n\t});\n}", "title": "" }, { "docid": "476abcc93a4b896405c81dd4a3eea351", "score": "0.5517309", "text": "function addRoute(computed_route, featureGroup) {\n\n clearCurrentLayers(featureGroup);\n addIcons(computed_route);\n\n map.panTo(allMarkers.getBounds().getCenter());\n map.fitBounds(allMarkers.getBounds());\n\n\n $(\"#route_description\").html(\"\");\n\n for(var i=0; i< computed_route.routeLegs.length; i++) {\n\n $(\"#route_description\").append(\"<p id=\\\"leg\"+i+\"\\\"></p>\");\n\n // fetch the geojson for this leg of the route\n $.ajax({\n dataType: \"json\",\n url: computed_route.routeLegs[i][\"url\"],\n layerIndex: i,\n success: function(data) {\n\n var myLayer = L.geoJson(data);\n mapLayers[this.layerIndex] = myLayer;\n console.log(\"added to layer \"+this.layerIndex);\n myLayer.on('click', handleLayerClick);\n showLayer(this.layerIndex, featureGroup);\n\n allFeatures.addLayer(myLayer);\n\n\n if (!myLayer.hasOwnProperty('properties')) {\n myLayer.properties = {\"desc\":computed_route.desc};\n } else {\n myLayer.properties[\"desc\"] = computed_route.desc;\n }\n\n\n var legLength = data[\"features\"][0][\"properties\"][\"length_miles\"];\n var legStart = computed_route.routeLegs[this.layerIndex][\"startName\"];\n var legEnd = computed_route.routeLegs[this.layerIndex][\"endName\"];\n\n \n $(\"#leg\"+this.layerIndex).html(\"Leg \"+(this.layerIndex+1)+\": \"+legLength+\" miles. \"+legStart+\" to \"+legEnd);\n\n },\n error: function (xhr, ajaxOptions, thrownError) {\n console.log(xhr.status);\n console.log(thrownError);\n }\n });\n }\n}", "title": "" }, { "docid": "cab4a2039d983ffb3aeb32f08d303b02", "score": "0.5506475", "text": "function createMap(classificationStatus) {\n\n // Create the tile layer that will be the background of our map\n var lightmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"light-v10\",\n accessToken: API_KEY\n });\n \n // Create a baseMaps object to hold the lightmap layer\n var baseMaps = {\n \"Light Map\": lightmap\n };\n \n // Create an overlayMaps object to hold the classification layer\n var overlayMaps = {\n \"Classification\": classificationStatus\n };\n \n // Initialize the layerGroups\n var layers = {\n Improved: new L.LayerGroup(),\n Eutrophic: new L.LayerGroup(),\n Hypoxic: new L.LayerGroup()\n \n };\n \n \n // Create the map object with layers\n var map = L.map(\"map-id\", {\n center: [40.73, -74.0059],\n zoom: 4,\n layers: [\n layers.Improved,\n layers.Eutrophic,\n layers.Hypoxic\n ]\n });\n\n // Add our 'lightmap' tile layer to the map\n lightmap.addTo(map);\n\n // Create an overlays object to add to the layer control\n var overlays = {\n \"Improved\": layers.Improved,\n \"Eutrophic\": layers.Eutrophic,\n \"Hypoxic\": layers.Hypoxic,\n \n };\n\n\n \n // Create a layer control, pass in the baseMaps and overlayMaps. Add the layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(map);\n\n // Create a legend to display information about our map\n var info = L.control({\n position: \"topright\"\n });\n\n // When the layer control is added, insert a div with the class of \"legend\"\n info.onAdd = function() {\n var div = L.DomUtil.create(\"div\", \"legend\");\n return div;\n };\n // Add the info legend to the map\n info.addTo(map);\n }", "title": "" }, { "docid": "bdd804c1eebb0939683851b7306bccdb", "score": "0.54813534", "text": "addFromLayers(){\n let _from = this.props.fromVersion.key;\n //add the sources\n this.addSource({id: window.SRC_FROM_POLYGONS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _from + \"_polygons\" + window.TILES_SUFFIX]}});\n this.addSource({id: window.SRC_FROM_POINTS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _from + \"_points\" + window.TILES_SUFFIX]}});\n //add the layers\n this.addLayer({id: window.LYR_FROM_DELETED_POLYGON, sourceId: window.SRC_FROM_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(255,0,0, 0.2)\", \"fill-outline-color\": \"rgba(255,0,0,0.5)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_DELETED_POINT, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(255,0,0)\", \"circle-opacity\": 0.6}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_POLYGON});\n //geometry change in protected areas layers - from\n this.addLayer({id: window.LYR_FROM_GEOMETRY_POINT_TO_POLYGON, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(255,0,0)\", \"circle-opacity\": 0.5}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_GEOMETRY_POINT_COUNT_CHANGED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"line-color\": \"rgb(255,0,0)\", \"line-width\": 1, \"line-opacity\": 0.5, \"line-dasharray\": [3,3]}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_GEOMETRY_SHIFTED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"line-color\": \"rgb(255,0,0)\", \"line-width\": 1, \"line-opacity\": 0.5, \"line-dasharray\": [3,3]}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n //selection layers\n this.addLayer({id: window.LYR_FROM_SELECTED_POLYGON, sourceId: window.SRC_FROM_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POLYGON, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_FROM_SELECTED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_LINE, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_FROM_SELECTED_POINT, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POINT, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n }", "title": "" }, { "docid": "dded5fd82c2e6cd73699026b2d012088", "score": "0.54722625", "text": "function initBasemapLayerTiles() {\n // overlayDescription = my.InitOverlay(my.descriptionContainer);\n\n // Init osmTileLayer base map\n osmTileLayer = new TileLayer({\n name: 'osmTileLayer',\n crossOriginKeyword: 'anonymous',\n source: new OSM(),\n });\n osmTileLayerMini = new TileLayer({\n name: 'osmTileLayerMini',\n crossOriginKeyword: 'anonymous',\n source: new OSM(),\n });\n\n // Init esriWSPTileLayer base map\n esriWSPTileLayer = new TileLayer({\n name: 'esriWSPTileLayer',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/0\">ArcGIS World Street Map</a>'],\n // // rendermode: 'image',\n url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n esriWSPTileLayerMini = new TileLayer({\n name: 'esriWSPTileLayerMini',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/0\">ArcGIS World Street Map</a>'],\n // // rendermode: 'image',\n url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n\n // Init esriWITileLayer base map (Satelite Images)\n esriWITileLayer = new TileLayer({\n name: 'esriWITileLayer',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/0\">ArcGIS World Imagery Map</a>'],\n // rendermode: 'image',\n url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n esriWITileLayerMini = new TileLayer({\n name: 'esriWITileLayerMini',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/0\">ArcGIS World Imagery Map</a>'],\n // rendermode: 'image',\n url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n\n blackTileLayer = new TileLayer({\n name: 'blackTileLayer',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> &copy; <a href=\"http://cartodb.com/attributions\">CartoDB</a>'],\n // rendermode: 'image',\n url: 'http://{a-c}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png',\n }),\n });\n blackTileLayerMini = new TileLayer({\n name: 'blackTileLayerMini',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> &copy; <a href=\"http://cartodb.com/attributions\">CartoDB</a>'],\n // rendermode: 'image',\n url: 'http://{a-c}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png',\n }),\n });\n }", "title": "" }, { "docid": "1f3771b097b007b4edd3d6469e61b840", "score": "0.54668367", "text": "function createMap(){\n\t//create the map\n\tmap = L.map('mapid', {\n\t\tcenter: [53, -95],\n\t\tzoom: 4,\n\t\tminZoom: 4,\n\t\tmaxZoom: 5,\n\t\tdragging: false,\n\t\t//maxBounds: L.latLngBounds() //working on this one\n\t});\n\n\t//add OSM base tilelayer\n L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>',\n maxZoom: 18,\n id: 'mapbox/dark-v10',\n accessToken: 'pk.eyJ1Ijoic21pdGh5ODc2IiwiYSI6ImNrNmpyMGNiNTAwaDczbW15ZTA0NXRxY3MifQ.otKyUrLqesRLXLhm-7tZ2A'\n }).addTo(map);\n\n\t//call getData function\n\tgetData(map);\n}", "title": "" }, { "docid": "24b53c8ea456233e7fdec7c9d8d17530", "score": "0.54581046", "text": "function addGeoJsonToMap(v){\n\t\t\t$('#' + spinnerID).hide();\n\t\t\t$('#' + visibleLabelID).show();\n\n\t\t\tif(layer.currentGEERunID === geeRunID){\n if(v === undefined){loadFailure()}\n\t\t\t\tlayer.layer = new google.maps.Data();\n // layer.viz.icon = {\n // path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,\n // scale: 5,\n // strokeWeight:2,\n // strokeColor:\"#B40404\"\n // }\n\t\t layer.layer.setStyle(layer.viz);\n\t\t \n\t\t \tlayer.layer.addGeoJson(v);\n if(layer.viz.clickQuery){\n map.addListener('click',function(){\n infowindow.setMap(null);\n })\n layer.layer.addListener('click', function(event) {\n console.log(event);\n infowindow.setPosition(event.latLng);\n var infoContent = `<table class=\"table table-hover bg-white\">\n <tbody>`\n var info = event.feature.h;\n Object.keys(info).map(function(name){\n var value = info[name];\n infoContent +=`<tr><th>${name}</th><td>${value}</td></tr>`;\n });\n infoContent +=`</tbody></table>`;\n infowindow.setContent(infoContent);\n infowindow.open(map);\n }) \n }\n\t\t \tfeatureObj[layer.name] = layer.layer\n\t\t \t// console.log(this.viz);\n\t\t \n\t\t \tif(layer.visible){\n\t\t \tlayer.layer.setMap(layer.map);\n\t\t \tlayer.rangeOpacity = layer.viz.strokeOpacity;\n\t\t \tlayer.percent = 100;\n\t\t \tupdateProgress();\n\t\t \t$('#'+layer.legendDivID).show();\n\t\t \t}else{\n\t\t \tlayer.rangeOpacity = 0;\n\t\t \tlayer.percent = 0;\n\t\t \t$('#'+layer.legendDivID).hide();\n\t\t \t\t}\n\t\t \tsetRangeSliderThumbOpacity();\n\t\t \t}\n \t\t}", "title": "" }, { "docid": "47526b7e7a5eac47a2f57a99d67bd7db", "score": "0.5457546", "text": "function createMap() {\n\n if( map ) return;\n\n var lat = 42.22;\n var long = 12.986;\n\n // set up the map\n map = new L.Map( 'map' );\n\n // create the tile layer with correct attribution\n var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';\n var osmAttrib='Map data � <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors';\n\n var osm = new L.TileLayer( osmUrl, {\n minZoom: 2, maxZoom: 13,\n attribution: osmAttrib\n } );\n\n // start the map in Italy\n map.setView( new L.LatLng(lat, long), 2 );\n map.addLayer(osm);\n\n layerGroup = L.layerGroup().addTo(map);\n }", "title": "" }, { "docid": "43360ac8afc67ce862fe9255b6159c2f", "score": "0.5455155", "text": "function addSpecificMap(e){\n\tvar taskMapBtn;\n //internet explorer 6-8\n if (e.srcElement){\n \ttaskMapBtn = e.srcElement;\n }\n //celelalte browsere\n else if (e.target){\n \ttaskMapBtn = e.target;\n }\n\n var taskMap = document.createElement(\"div\");\n taskMap.classList.add(\"task-map\");\n\n taskMapBtn.parentNode.parentNode.parentNode.insertBefore(taskMap, taskMapBtn.parentNode.parentNode.nextSibling);\n taskMapBtn.style.display = \"none\";\n\n var btntaksMapCancel = document.createElement(\"div\");\n btntaksMapCancel.textContent = \"X\";\n btntaksMapCancel.addEventListener(\"click\", removeMapTasks);\n\n taskMapBtn.parentNode.parentNode.insertBefore(btntaksMapCancel, taskMapBtn.parentNode.nextSibling);\n\n\n}", "title": "" }, { "docid": "0b1bbd0d5123de68299847e7c965a5ad", "score": "0.54319346", "text": "function addLayer(layer) {\n map.add(layer);\n }", "title": "" }, { "docid": "ab1ea0715315966c8f4a138c9e701dd9", "score": "0.54218644", "text": "function addLayer(mapDefinition) {\n var mapAccessToken;\n $.ajax({\n type: 'GET',\n url: Page.getApplicationPath() + \"api/map/accesstoken\",\n async: false,\n success: function (accessToken) {\n mapAccessToken = accessToken;\n },\n fail: function (jqXHR, data) {\n console.log(jqXHR.responseJSON.ExceptionMessage);\n }\n });\n\n L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, <a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"http://mapbox.com\">Mapbox</a>',\n id: 'mapbox/streets-v11',\n accessToken: mapAccessToken\n }).addTo(mapDefinition._mapInstance);\n }", "title": "" }, { "docid": "fc47620fd2c2bbb64b72b7d70c54fdba", "score": "0.54202914", "text": "function drawMap () {\n const winHill=new Point([ -1.721040,53.362571]).transform( 'EPSG:4326','EPSG:3857');\n const activityLayer = new LayerVector({\n style: function(feature) {\n return styles[feature.get('type')];\n },\n source: new VectorSource({}),\n name: 'activity' \n });\n const animationLayer = new LayerVector({\n updateWhileAnimating: true,\n updateWhileInteracting: true,\n source: new VectorSource({}),\n name: 'animation' \n });\n \n const osmLayer = new LayerTile({\n title: 'Open Steet Map',\n type: 'base',\n source: new OSM()\n });\n\n const osmTopoLayer = new LayerTile({\n title: 'OSM Topo',\n type: 'base',\n visible: false,\n source: new XYZ({\n url: 'https://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png'\n })\n });\n // OSMImpl.CycleMap(name)\n //{\n // \"url\" : \"http://tile2.opencyclemap.org/transport/{z}/{x}/{y}.png\"\n // }\n // https://a.tile.thunderforest.com/cycle/15/16234/10624.png?apikey=a5dd6a2f1c934394bce6b0fb077203eb\n const arcGISEsriTopoLayer=new LayerTile({\n title: 'ArcGIS Esri Topographical',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Topo_Map/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n const arcGISEsriImagaryLayer=new LayerTile({\n title: 'ArcGIS Esri Image',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Imagery/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Imagery/MapServer/tile/{z}/{y}/{x}',\n }),\n }); \n\n\n const map = new Map({\n target: document.getElementById('map'),\n view: new View({\n center: winHill.flatCoordinates,\n zoom: 14,\n minZoom: 2,\n maxZoom: 19\n }),\n layers: [\n arcGISEsriTopoLayer,osmTopoLayer,arcGISEsriImagaryLayer,osmLayer\n ]\n });\n \n var layerSwitcher = new LayerSwitcher();\n map.addControl(layerSwitcher);\n\n return map;\n}", "title": "" }, { "docid": "66322b6f079de7a8761e86ec14b0f59b", "score": "0.54185253", "text": "function createMap() {\n\n //create the map\n var map = L.map('mapid', {\n center: [36, -98],\n zoom: 4\n });\n\n // set map boundaries to restrict panning out of bounds\n var southWest = L.latLng(0, -170),\n northEast = L.latLng(80, -10);\n var bounds = L.latLngBounds(southWest, northEast);\n\n map.setMaxBounds(bounds);\n map.on('drag', function () {\n map.panInsideBounds(bounds, {\n animate: false\n });\n });\n\n curMap = map;\n\n // add basemap tilelayer\n L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {\n minZoom: 3,\n attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'\n }).addTo(curMap);\n\n //call getData function\n getData(curMap);\n createLegend(curMap);\n\n}", "title": "" }, { "docid": "b653a755c401985ca7e9d13b3edd67cb", "score": "0.5411389", "text": "function createMap() {\n\t\t\t\t\n\t\t\t\t//initialize map\n\t\t\t var myOptions = {\n\t\t\t zoom: 2,\n\t\t\t center: new google.maps.LatLng(30,0),\n\t\t\t mapTypeId: google.maps.MapTypeId.TERRAIN,\n\t\t\t\t\tdisableDefaultUI: true,\n\t\t\t\t\tscrollwheel: false,\n\t\t\t\t\tstreetViewControl: false,\n\t\t\t\t\tscaleControl: true\n\t\t\t }\n\n\t\t\t map = new google.maps.Map(document.getElementById(\"map\"), myOptions);\n\t\t\t \t\t\t \n\t\t\t\tbounds = new google.maps.LatLngBounds();\n geocoder = new google.maps.Geocoder();\n\n \n\t\t\t\tgoogle.maps.event.clearListeners(map, 'tilesloaded');\n\t\t\t\tpoints = new PointsOperations(); \t\t // Points Object\n\t\t\t\tconvex_hull = new HullOperations(map);\t\t\t\t\t// Convex Hull Object\n\t\t\t\tactions = new UnredoOperations();\t\t\t\t\t\t\t\t// Un-Re-Do Object\n edit_metadata = new GapsOverlay(new google.maps.LatLng(0,0), null, map);\n\n\n\t\t\t\tselection_polygon = new google.maps.Polygon({\n\t\t strokeColor: \"#000000\",\n\t\t strokeOpacity: 1,\n\t\t strokeWeight: 1,\n\t\t fillColor: \"#FFFFFF\",\n\t\t fillOpacity: 0\n\t\t });\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t/*========================MAP EVENTS==========================*/\n\t\t\t\t\n\t\t\t\t//Click map event\n\t\t\t\tgoogle.maps.event.addListener(map,\"click\",function(event){\n\t\t\t\t\tif (state == 'add') {\n\t\t\t\t\t\taddMarker(event.latLng,null,false);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\t//Change cursor depending on application state\n\t\t\t\tgoogle.maps.event.addListener(map,\"mouseover\",function(event){\n\t\t\t\t\t\tswitch(state) {\n\t\t\t\t\t\t\tcase 'add': \t\t\tmap.setOptions({draggableCursor: \"url(/images/editor/add_cursor.png),default\"});\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'selection': map.setOptions({draggableCursor: \"url(/images/editor/selection_cursor.png),default\"});\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'remove': \t\tmap.setOptions({draggableCursor: \"url(/images/editor/remove_cursor.png),default\"});\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t\t\t\t\tdefault: \t\t\t\t\tmap.setOptions({draggableCursor: \"url(/images/editor/default_cursor.png),default\"});\t\n\t\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\t//Zoom change = Zoom control change\n\t\t\t\tgoogle.maps.event.addListener(map,\"zoom_changed\",function(event){moveZoomControl();});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/*========================DOM EVENTS==========================*/\n\t\t\t\t//choose map type\n\t\t\t\t$('ul.map_type_list li').click(function(ev){\n\t\t\t\t\t$('a.select_map_type span').text($(this).text());\n\t\t\t\t});\n\n\n\t\t\t\t//change zoom level\n\t\t\t\t$('#zoom ul li').click(function(ev){\n\t\t\t\t\tvar li_index = $(this).index();\n\t\t\t\t\tmap.setZoom(15-li_index);\n\t\t\t\t});\n\n\t\t\t\t//change zoom level +\n\t\t\t\t$('a.zoom_in').click(function(ev){\n\t\t\t\t\tif (map.getZoom()<15) {\n\t\t\t\t\t\tmap.setZoom(map.getZoom()+1);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t//change zoom level -\n\t\t\t\t$('a.zoom_out').click(function(ev){\n\t\t\t\t\tif (map.getZoom()>2) {\n\t\t\t\t\t\tmap.setZoom(map.getZoom()-1);\n\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$('div.search_place').hover(function(ev){\n\t\t\t\t\t$(this).stop(ev).fadeTo(0,1);\n\t\t\t\t},function(ev){\n\t\t\t\t\t$(this).stop(ev).fadeTo(0,0.5);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Selection tool\n\t\t\t\t$('div#map').mousedown(function(ev){\n\t\t\t\t if (state==\"selection\" && !say_polygon_tooltip) {\n google.maps.event.clearListeners(selection_polygon, 'mouseover');\n google.maps.event.clearListeners(selection_polygon, 'mouseout');\n if (over_polygon_tooltip!=null) {\n over_polygon_tooltip.hide();\n }\n \n\t\t\t\t var position = {};\n\t\t\t\t position.x = ev.pageX-($('div#map').offset().left);\n\t\t\t\t position.y = ev.pageY-($('div#map').offset().top);\n\t\t\t\t var latlng = edit_metadata.transformCoordinates(new google.maps.Point(position.x,position.y));\n\t\t\t\t \n\t\t\t\t selection_polygon.setOptions({fillOpacity: 0});\n drawing = true;\n selection_polygon.setPath([latlng,latlng,latlng,latlng]);\n\t\t\t\t selection_polygon.setMap(map);\n\t\t\t\t \n\t\t\t\t $('div#map').mousemove(function(ev){\n position.x = ev.pageX-($('div#map').offset().left);\n \t\t\t\t position.y = ev.pageY-($('div#map').offset().top);\n \t\t\t\t var latLng = edit_metadata.transformCoordinates(new google.maps.Point(position.x,position.y));\n \n selection_polygon.setPath([\n selection_polygon.getPath().getAt(0),\n new google.maps.LatLng(selection_polygon.getPath().getAt(0).lat(),latLng.lng()),\n latLng,\n new google.maps.LatLng(latLng.lat(),selection_polygon.getPath().getAt(0).lng()),\n selection_polygon.getPath().getAt(0)]);\n\t\t\t\t });\n\t\t\t\t \n\t\t\t\t $('div#map').mouseup(function(ev){\n\t\t\t\t var position = {};\n\t\t\t\t position.x = ev.pageX-($('div#map').offset().left);\n \t\t\t\t position.y = ev.pageY-($('div#map').offset().top);\n \t\t\t\t var latLng = edit_metadata.transformCoordinates(new google.maps.Point(position.x,position.y));\n\t\t\t\t \n\t\t\t\t $('div#map').unbind('mouseup');\n\t\t\t\t $('div#map').unbind('mousemove');\n drawing = false;\n selection_polygon.setOptions({fillOpacity: 0.40});\n google.maps.event.clearListeners(map, 'mousemove');\n google.maps.event.clearListeners(selection_polygon, 'click');\n\n if (over_polygon_tooltip!=null) {\n over_polygon_tooltip.changeData(markersInPolygon(),latLng);\n } else {\n over_polygon_tooltip = new PolygonOverTooltip(latLng, markersInPolygon(), map);\n }\n\n google.maps.event.addListener(selection_polygon,'mouseover',function(){\n if (over_polygon_tooltip!=null) {\n over_polygon_tooltip.show();\n }\n over_polygon = true;\n });\n\n google.maps.event.addListener(selection_polygon,'mouseout',function(){\n if (over_polygon_tooltip!=null && !say_polygon_tooltip) {\n over_polygon_tooltip.hide();\n }\n over_polygon = false;\n });\n\t\t\t\t });\n\t\t\t\t }\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "4f29ca071c30f25b41c43b4686b268ac", "score": "0.53781295", "text": "constructor() {\n this._locks = new LockMap();\n this._queue = new LayerMap();\n }", "title": "" }, { "docid": "2f8ef6282d68897faf98493cbd1272b3", "score": "0.5373978", "text": "createLayer({ layerObject }) {\n var layers = this.props.layers;\n var layerIndex = layers.findIndex(layer => {\n if (!layer) return false;\n return layer.key == layerObject.key;\n });\n layers[layerIndex] = layerObject;\n this.props.updateLayers({ layers });\n }", "title": "" }, { "docid": "e8714399a9db9822e8da503fe983475d", "score": "0.5365136", "text": "function createLayer() {\r\n \r\n /* FUNCTION createLayer\r\n * Creates an empty layer of map size (WIDTH x HEIGHT)\r\n */\r\n \r\n return new Array(this.CONFIGURATION.WIDTH * this.CONFIGURATION.HEIGHT).fill(0);\r\n \r\n }", "title": "" }, { "docid": "46702d0607ba57937e068bf3b0a59952", "score": "0.53628075", "text": "function createMap(layer, coords = parisCoords, zoom = mapZoomLevel) {\n // base tile layers\n var streetmap = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.streets\",\n accessToken: \"pk.eyJ1IjoiY2hyb21lZCIsImEiOiJjam10c29oaXYwaG5hM3FvMnVyaDd0eWt0In0.2LQ_9tW9cznJFz5imzGY0Q\"\n });\n\n var piratemap = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.pirates\",\n accessToken: \"pk.eyJ1IjoiY2hyb21lZCIsImEiOiJjam10c29oaXYwaG5hM3FvMnVyaDd0eWt0In0.2LQ_9tW9cznJFz5imzGY0Q\"\n });\n\n // Basemap option 3\n var satellitemap = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.satellite\",\n accessToken: \"pk.eyJ1IjoiY2hyb21lZCIsImEiOiJjam10c29oaXYwaG5hM3FvMnVyaDd0eWt0In0.2LQ_9tW9cznJFz5imzGY0Q\"\n });\n\n // Create a baseMaps object to hold the basemaps\n var baseMaps = {\n \"Street Map\": streetmap,\n \"Satellite Map\": satellitemap,\n \"Pirate Map\": piratemap\n };\n\n // Create the map object with options\n var myMap = L.map(\"map-id\", {\n center: coords,\n zoom: zoom,\n layers: [streetmap, piratemap, satellitemap]\n });\n\n // Create an overlayMaps object to hold the wines layer\n var overlayMaps = {\n Wines: layer\n };\n\n // Create a layer control, pass in the baseMaps and overlayMaps. Add the layer control to the map\n L.control.layers(baseMaps, overlayMaps, { collapsed: false }).addTo(myMap);\n\n // default the wine layer active\n layer.addTo(myMap);\n\n // create a legend\n var legend = L.control({ position: 'bottomright' });\n\n legend.onAdd = function (map) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n points = [80, 85, 90, 95, 100],\n labels = [];\n console.log(points);\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < points.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(points[i] + 1) + '\"></i> ' +\n points[i] + (points[i + 1] ? '&ndash;' + points[i + 1] + '<br>' : '+');\n }\n\n return div;\n };\n\n legend.addTo(myMap);\n\n}", "title": "" }, { "docid": "f88dd84b8559aa9e6cbec3586e8ad22e", "score": "0.536168", "text": "function createMap(earthquakePins){\n// Add a tile layer (the background map image) to our map\n// We use the addTo method to add objects to our map\nL.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.streets\",\n accessToken: API_KEY\n}).addTo(map);\n\nvar outdoormap = L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/streets-v10/tiles/256/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: \"Map data &copy; <a href=\\\"http://openstreetmap.org\\\">OpenStreetMap</a> contributors, <a href=\\\"http://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"http://mapbox.com\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.outdoor\",\n accessToken: API_KEY\n });\n\nvar satellitemap = L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: \"Map data &copy; <a href=\\\"http://openstreetmap.org\\\">OpenStreetMap</a> contributors, <a href=\\\"http://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"http://mapbox.com\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.satellite\",\n accessToken: API_KEY\n });\n\nvar baseLayer = {\n\t\"satellite\": satellitemap,\n\t\"Light\": lightmap,\n\t\"Outdoor\": outdoormap\n\n}}", "title": "" }, { "docid": "dce4d249aaa719448a7a58dac1e5ca96", "score": "0.53593993", "text": "function createMap(){\n\t/*// create map object and set view\n\tvar map = L.map('map').setView([43.134429, -90.705404],11);\n\t// add basemap layer\n\tL.tileLayer('https://api.mapbox.com/styles/v1/mapbox/outdoors-v10/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoiYnJvYmluNjY1IiwiYSI6ImNpc2p1MXkzZzAybWgydnB1NWVvY2llOGkifQ.ufsYZx_ojLbkU4JSpgzH5g',\n\t{attribution: '&copy; Mapbox &copy; OpenStreetMap '\n\t}).addTo(map);*/\n\t\n\t\n\tL.mapbox.accessToken ='pk.eyJ1IjoiYnJvYmluNjY1IiwiYSI6ImNpc2p1MXkzZzAybWgydnB1NWVvY2llOGkifQ.ufsYZx_ojLbkU4JSpgzH5g';\n\tvar map =L.mapbox.map('map').setView([43.134429, -90.705404],12).addControl(L.mapbox.geocoderControl('mapbox.places',{\n\t\tautocomplete: true ,\n\t\tposition:'topleft'\n\t}));\n\tL.mapbox.styleLayer('mapbox://styles/brobin665/cj4wewtkb1unv2rqfn89v80k7').addTo(map);\n\tmap.attributionControl.setPosition('bottomleft');\n\tL.control.locate({\n\t\treturnToPrevBounds: true,\n\t\tflyTo: true,\n\t\tstrings: {\n\t\t\ttitle: \"My location\"\n\t\t}\n\t\t}).addTo(map);\n\t\n\t//geocoder.query('Boscobel, WI');\n\n\t\n\t\n\t//create direction objects\n\t\n\tvar directions= L.mapbox.directions(),\n\t\tdirectionsLayer =L.mapbox.directions.layer(directions).addTo(map),\n\t\tdirectionsInputControl = L.mapbox.directions.inputControl('inputs', directions).addTo(map),\n\t\tdirectionsErrorsControl =L.mapbox.directions.errorsControl('errors', directions).addTo(map),\n\t\tdirectionsRoutesControl = L.mapbox.directions.routesControl('routes',directions).addTo(map),\n\t\tdirectionInstructionsControl= L.mapbox.directions.instructionsControl('instructions', directions).addTo(map);\n\n\t\n\t// create layer variables to hold the different types of points\n\tvar lodging =new L.geoJson(),\n\t\tnat_out =new L.geoJson(),\n\t\tcan_kay =new L.geoJson(),\n\t\thunt =new L.geoJson(),\n\t\ttrails =new L.geoJson(),\n\t\tg_a =new L.geoJson(),\n\t\tlq =new L.geoJson(),\n\t\tdin =new L.geoJson(),\n\t\tgroc =new L.geoJson(),\n\t\tcs =new L.geoJson(),\n\t\tm_a =new L.geoJson(),\n\t\tbars = new L.geoJson(),\n\t\tshop = new L.geoJson();\n\t\t\n\t// Get data via function from json files using ajax\n\tgetData(map,lodging,nat_out, can_kay,hunt,trails, g_a, din, lq,groc, cs, m_a, bars,shop);\n\t\n\t// Variables for layer control\n\tvar map_layers = {\n\t\"<img src='img/lodging.png' height=24> Lodging\": lodging,\n\t\"<img src='img/no.png' height=24> Nature & Outdoors\": nat_out,\n\t\"<img src='img/canoe.png' height=24> Canoeing/Kayaking\": can_kay,\n\t\"<img src='img/hunt.png' height=24> Hunting\": hunt,\n\t\"<img src='img/trail.png' height=24> Trails\":trails,\n\t\"<img src='img/bars.png' height=24> Liquor Stores\": lq,\n\t\"<img src='img/bar.png' height=24> Bars\": bars, \n\t\"<img src='img/coffee.png' height=24> Coffee Shops\": cs,\n\t\"<img src='img/dining.png' height=24> Dining\":din,\n\t\"<img src='img/shop.png' height=24> Shopping\":shop,\n\t\"<img src='img/grocery.png' height=24> Groceries\": groc,\n\t\"<img src='img/gifts.png' height=24> Gifts & Antiques\": g_a,\n\t\"<img src='img/ma.png' height=24> Musuems & Attractions\": m_a\n\t};\n\t\n\t// Add layer control to map\n\tL.control.layers(null,map_layers).addTo(map);\n\t\n\t// Code for Search bar on multiple layers. Doesn't work. Have tried multiple solutions. \n\t// Tried all three solutions here, and ran into same issues https://stackoverflow.com/questions/42934369/leaflet-search-on-multiplelayers-wont-work\n\t// Followed example here from plugin source https://github.com/stefanocudini/leaflet-search/blob/master/examples/multiple-layers.html\n\t\n\t// Patch for mutliple layer search DIDNT WORK\n\t/*L.Control.Search.include({\n _recordsFromLayer: function() { //return table: key,value from layer\n var that = this,\n retRecords = {},\n propName = this.options.propertyName,\n loc;\n\n function searchInLayer(layer) {\n if (layer instanceof L.Control.Search.Marker) return;\n\n if (layer instanceof L.Marker || layer instanceof L.CircleMarker) {\n if (this._getPath(layer.options, propName)) {\n loc = layer.getLatLng();\n loc.layer = layer;\n retRecords[that._getPath(layer.options, propName)] = loc;\n\n } else if (that._getPath(layer.feature.properties, propName)) {\n\n loc = layer.getLatLng();\n loc.layer = layer;\n retRecords[that._getPath(layer.feature.properties, propName)] = loc;\n\n } else {\n throw new Error(\"propertyName '\" + propName + \"' not found in marker\");\n }\n } else if (layer.hasOwnProperty('feature')) { //GeoJSON\n\n if (layer.feature.properties.hasOwnProperty(propName)) {\n loc = layer.getBounds().getCenter();\n loc.layer = layer;\n retRecords[layer.feature.properties[propName]] = loc;\n } else {\n throw new Error(\"propertyName '\" + propName + \"' not found in feature\");\n }\n } else if (layer instanceof L.LayerGroup) {\n //TODO: Optimize\n layer.eachLayer(searchInLayer, this);\n }\n }\n\n this._layer.eachLayer(searchInLayer, this);\n\n return retRecords;\n }\n});*/\n\t/*var poi = [lodging,nat_out];\n\tvar poiLayers = new L.layerGroup(poi);\n\t\n\t var search =L.control.search({\n\t\tlayer: lodging,\n\t\tinitial: true,\n\t\tpropertyName: 'name',\n\t\tbuildTip: function(text, val) {\n\t\t\tvar type = val.layer.feature.properties.type;\n\t\t\treturn '<a href=\"#\" class=\"'+type+'\">'+text+'<b>'+type+'</b></a>';\n\t\t }\n\t});\n\t\n\tsearch.addTo(map);*/\n\t\n\n}", "title": "" }, { "docid": "53b7ba5da75a5a0e8db5f7540744f7ce", "score": "0.5355368", "text": "function createMap(){\n\tif ($(\"#map\").length){\n\n\t\t// =========================\n\t\t// | Basic Leaflet setup |\n\t\t// =========================\n\t\tvar path = [];\n\t\tvar marker;\n\t\tvar myLayerGroup;\n\t\tvar baseLayerTiles;\n\n\t\tvar Stamen_Watercolor = L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.{ext}', {\n\t\t\tattribution: 'Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n\t\t\tsubdomains: 'abcd',\n\t\t\tminZoom: 1,\n\t\t\tmaxZoom: 16,\n\t\t\text: 'png'\n\t\t});\n\n\t\tvar tiles = [Stamen_Watercolor];\n\n\n\t\t//Create the leaflet map and restrict zoom/boundaries\n\t\tmap = L.map('map', {\n\t\t\tmaxZoom: 10,\n\t\t\tminZoom: 2,\n\t\t\t//maxBounds:scrollBounds,\n\t\t\tattributionControl: true,\n\t\t\tscrollWheelZoom: false,\n\t\t\tlayers: tiles\n\t\t});\n\n\n\t\t// Add map panes layer for labels (so they're visible above the geojson elements)\n\t\tmap.createPane('labels');\n\t\tmap.getPane('labels').style.zIndex = 650;\n\t\tmap.getPane('labels').style.pointerEvents = 'none';\n\n\t\tvar Stamen_TonerLabels = L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-labels/{z}/{x}/{y}{r}.{ext}', {\n\t\t\tattribution: 'Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> &mdash; Map data &copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors',\n\t\t\tsubdomains: 'abcd',\n\t\t\tminZoom: 0,\n\t\t\tmaxZoom: 20,\n\t\t\text: 'png',\n\t pane: 'labels'\n\t\t}).addTo(map);\n\n\n\t\t//starts map so that the continental US is centered on the screen.\n\t\tlogger(\"checking for initialFocusBounds\")\n\t\tif (typeof initialFocusBounds !== 'undefined'){\n\t\t\tmap.fitBounds(initialFocusBounds);\n\t\t} else {\n\t\t\tmap.fitBounds(defaultBounds);\n\t\t}\n\n\t}\n\n}", "title": "" }, { "docid": "abab75f088eae9a42495d67d4ab71332", "score": "0.5351748", "text": "addFeature(pid, json) {\n let self = this;\n let options = Object.assign({\n \"map\": \"default\",\n \"layer\": \"default\",\n \"values\": {}\n }, json);\n let map = self.maps[options.map].object;\n let layer = self.maps[options.map].layers[options.layer];\n let view = map.getView();\n let source = layer.getSource();\n console.log(layer);\n let projection = \"EPSG:\" + options.geometry.match(/SRID=(.*?);/)[1];\n let wkt = options.geometry.replace(/SRID=(.*?);/, '');\n let format = new ol_format_WKT__WEBPACK_IMPORTED_MODULE_10__[\"default\"]();\n let feature = format.readFeature(wkt);\n options.values.geometry = feature.getGeometry().transform(projection, view.getProjection().getCode());\n source.addFeature(new ol__WEBPACK_IMPORTED_MODULE_1__[\"Feature\"](options.values));\n self.finished(pid, self.queue.DEFINE.FIN_OK);\n }", "title": "" }, { "docid": "844758ec5f9e7f4b7adc17d3562c7b01", "score": "0.5339215", "text": "function init(){\r\n //first define UTM 33N (for Vienna) --> depends on input data!\r\n proj4.defs(\"EPSG:32633\",\"+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs\");\r\n //now register it\r\n ol.proj.proj4.register(proj4);\r\n var utm33n = ol.proj.get('EPSG:32633')\r\n \r\n //define layers\r\n var osmlayer = new ol.layer.Tile({\r\n source: new ol.source.OSM(),\r\n visible: true,\r\n title: \"OSMStandard\"\r\n });\r\n\r\n var osmlayerHumanitarian = new ol.layer.Tile({\r\n source: new ol.source.OSM({\r\n url:'https://{a-c}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png'\r\n }),\r\n visible: false,\r\n title: \"OSMHumanitarian\"\r\n });\r\n\r\n var stamenTerrain = new ol.layer.Tile({\r\n source: new ol.source.XYZ({\r\n url:'http://tile.stamen.com/terrain/{z}/{x}/{y}.jpg',\r\n attributions: 'Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, under <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a>. Data by <a href=\"http://openstreetmap.org\">OpenStreetMap</a>, under <a href=\"http://www.openstreetmap.org/copyright\">ODbL</a>'\r\n }),\r\n visible: false,\r\n title: \"StamenTerrain\"\r\n });\r\n \r\n /*var adress_layer = new ol.layer.Tile({ \r\n id: 'adress', \r\n visible: false,\t\t\r\n source: new ol.source.TileWMS({\r\n url: 'http://localhost:8080/geoserver/PRIVATE_01426009/wms',\r\n projection: utm33n,\r\n params: {'LAYERS': 'PRIVATE_01426009:adressen', 'TILED': true},\r\n serverType: 'geoserver',\r\n // Countries have transparency, so do not fade tiles:\r\n transition: 0\r\n }) \r\n })*/\r\n \r\n var streets_layer = new ol.layer.Tile({\r\n id: 'streets',\r\n visible: false,\t\r\n source: new ol.source.TileWMS({\r\n url: 'http://localhost:8080/geoserver/PRIVATE_01426009/wms',\r\n projection: utm33n,\r\n params: {'LAYERS': 'PRIVATE_01426009:strassen', 'TILED': true},\r\n serverType: 'geoserver',\r\n // Countries have transparency, so do not fade tiles:\r\n transition: 0\r\n })\r\n })\r\n\r\n var shortestpath = new ol.layer.Tile({\r\n id: 'path',\r\n visible: true,\t\r\n source: new ol.source.TileWMS({\r\n url: 'http://localhost:8080/geoserver/PRIVATE_01426009/wms',\r\n projection: utm33n,\r\n params: {'LAYERS': 'PRIVATE_01426009:utm_sp_view2', 'TILED': true, viewparams:\"start_lon:16.3973609;start_lat:48.2549891\"},\r\n serverType: 'geoserver',\r\n // Countries have transparency, so do not fade tiles:\r\n transition: 0\r\n })\r\n })\r\n \r\n //Vector layers\r\n var layers = [\r\n //osmlayer,\r\n //osmlayerHumanitarian,\r\n //stamenTerrain,\r\n streets_layer,\r\n //adress_layer,\r\n shortestpath\r\n ];\r\n\r\n //https://openlayers.org/en/latest/examples/drag-and-drop.html\r\n var dragAndDropInteraction = new ol.interaction.DragAndDrop({\r\n formatConstructors: [\r\n ol.format.GPX,\r\n ol.format.GeoJSON,\r\n ol.format.IGC,\r\n ol.format.KML,\r\n ol.format.TopoJSON\r\n ]\r\n });\r\n\r\n var map = new ol.Map({\r\n interactions: ol.interaction.defaults().extend([dragAndDropInteraction]),\r\n layers: layers,\r\n target: 'js-map',\r\n projection: utm33n,\r\n view: new ol.View({\r\n center: [1821158.989,6140027.952],\r\n zoom: 12\r\n })\r\n });\r\n map.on('click', function(e){\r\n console.log(e.coordinate)\r\n })\r\n\r\n //Layer Group\r\n //Openlayers 6 tutorials\r\n const baseLayerGroup = new ol.layer.Group({\r\n layers:[\r\n osmlayer, osmlayerHumanitarian, stamenTerrain\r\n ]\r\n })\r\n map.addLayer(baseLayerGroup);\r\n\r\n //Layer Switcher Logic for Basemaps\r\n //Openlayers 6 tutorials: https://www.youtube.com/watch?v=k4b3nqDHCIU&list=PLSWT7gmk_6LrvfkAFzfBpNckEsaF7S2GB&index=6\r\n const baseLayerElements = document.querySelectorAll('.sidebar > input[type=radio]') \r\n for(let baseLayerElement of baseLayerElements){\r\n baseLayerElement.addEventListener('change', function(){\r\n let baseLayerElementValue = this.value;\r\n baseLayerGroup.getLayers().forEach(function(element, index, array){\r\n let baseLayerTitle = element.get('title');\r\n element.setVisible(baseLayerTitle === baseLayerElementValue);\r\n })\r\n })\r\n }\r\n\r\n //Compute shortest path\r\n //Marvin McCutchan\r\n document.getElementById('computespbtn').addEventListener('click', computesp, false);\r\n function computesp() {\r\n\r\n var startid = document.getElementById(\"fromnode\").value;\r\n\t\t var endid = document.getElementById(\"endnode\").value;\r\n\r\n if(map.getLayers().getArray().length > 1)\r\n {\r\n map.removeLayer(shortestpath);\r\n }\r\n \r\n // new shortestpath\r\n shortestpath = new ol.layer.Tile({\r\n source: new ol.source.TileWMS({\r\n url: 'http://localhost:8080/geoserver/PRIVATE_01426009/wms',\r\n projection: utm33n,\r\n params: {'LAYERS': 'PRIVATE_01426009:utm_sp_view2', \r\n 'TILED': true, viewparams:\"start_lon:\"+startid+\";start_lat:\"+endid},\r\n serverType: 'geoserver',\r\n \r\n transition: 0\r\n })\r\n })\r\n console.log(shortestpath)\r\n map.addLayer(shortestpath).changed(); //UNDEFINED? ABER ES FUNCT...\t\r\n \r\n }\r\n\r\n //open local drive\r\n /*document.getElementById('drivebtn').addEventListener('click', openDrive, false);\r\n function openDrive() {\r\n\r\n }*/\r\n\r\n //https://openlayers.org/en/latest/examples/drag-and-drop.html\r\n //https://tsauerwein.github.io/ol3/animation-flights/examples/drag-and-drop.html\r\n //only works with data in EPSG:4326 and EPSG:3857 !!\r\n dragAndDropInteraction.on('addfeatures', function(event) {\r\n var vectorSource = new ol.source.Vector({\r\n features: event.features\r\n });\r\n map.addLayer(new ol.layer.Vector({\r\n source: vectorSource\r\n }));\r\n map.getView().fit(vectorSource.getExtent());\r\n });\r\n \r\n var displayFeatureInfo = function(pixel) {\r\n var features = [];\r\n map.forEachFeatureAtPixel(pixel, function(feature) {\r\n features.push(feature);\r\n });\r\n if (features.length > 0) {\r\n var info = [];\r\n var i, ii;\r\n for (i = 0, ii = features.length; i < ii; ++i) {\r\n info.push(features[i].get('name'));\r\n }\r\n document.getElementById('info').innerHTML = info.join(', ') || '&nbsp'; //WAS TUT &nbsp ????\r\n } else {\r\n document.getElementById('info').innerHTML = '&nbsp;';\r\n }\r\n };\r\n \r\n map.on('pointermove', function(evt) {\r\n if (evt.dragging) {\r\n return;\r\n }\r\n var pixel = map.getEventPixel(evt.originalEvent);\r\n displayFeatureInfo(pixel);\r\n });\r\n \r\n map.on('click', function(evt) {\r\n displayFeatureInfo(evt.pixel);\r\n });\r\n\t\t\r\n //Marker showing the position the user clicked\r\n //Marvin McCutchan\r\n var marker = new ol.Overlay({\r\n element: document.getElementById('js-marker'),\r\n });\r\n map.addOverlay(marker);\r\n map.on('click', function(evt) {\r\n\r\n var element = marker.getElement();\r\n var coordinate = evt.coordinate;\r\n //convert to Longitude, Latitude\r\n var lola = ol.proj.toLonLat(coordinate);\r\n console.log(lola);\r\n }); \r\n \r\n //https://github.com/jonataswalker/ol-geocoder/blob/master/examples/control-nominatim.js\r\n //Marvin McCutchan: UE2\r\n /*var popup = new ol.Overlay({\r\n element: document.getElementById('js-popup')\r\n });'*/\r\n\r\n var marker = new ol.Overlay({\r\n element: document.getElementById('js-marker')\r\n });\r\n\r\n var geocoder = new Geocoder('nominatim', {\r\n provider: 'osm',\r\n autoComplete: true,\r\n autoCompleteMinLength: 1,\r\n targetType: 'text-input',\r\n lang: 'en-US',\r\n placeholder: 'Search for ...',\r\n limit: 5,\r\n countrycodes : 'at', //search results are limited to Austria to reduce computational effort\r\n keepOpen: true,\r\n debug: true\r\n });\r\n map.addControl(geocoder);\r\n map.addOverlay(marker);\r\n\r\n //Openlayers: https://openlayers.org/en/latest/examples/icon.html\r\n //Listen when an address is chosen\r\n geocoder.on('addresschosen', function(evt) {\r\n var element = marker.getElement();\r\n //var coordinate = evt.coordinate;\r\n \r\n window.setTimeout(function() {\r\n $(element).popover('destroy');\r\n marker.setPosition(evt.coordinate);\r\n $(element).popover({\r\n placement: 'top',\r\n animation: false,\r\n //html: true,\r\n //content: '<code>' + evt.address.formatted + '</code>' ->löschen????\r\n })\r\n $(element).popover('show');\r\n })\r\n });\r\n\r\n/*mapboxgl.accessToken = 'pk.eyJ1IjoiYWxpbmFyIiwiYSI6ImNqd3ViOTZ1ajB4bGM0MHF2cTBzaGs1YWUifQ.1mn8jUJeijCt5cy-OvR2gw';\r\n// Add geolocate control to the map.\r\nmap.addControl(new mapboxgl.GeolocateControl({\r\n positionOptions: \r\n {enableHighAccuracy: true},\r\n trackUserLocation: true\r\n}));\t\t\r\n\r\n// Add routing functionality\r\nmap.addControl(new MapboxDirections({accessToken: mapboxgl.accessToken}), 'top-left');\r\n*/\r\n/* const orsDirection = new ol.layer.VectorImage({\r\n source: new ol.source.Vector({\r\n url: '.data/vector_data/ors__v2_directions_{profile}_get_1578070792253.geojson',\r\n format: new ol.format.GeoJSON()\r\n //projection: utm33n\r\n }),\r\n visible: true,\r\n title: 'ORSDirection'\r\n })\r\n map.addLayer(orsDirection); */\r\n\r\n //\r\n //Openlayers 6 tutorials: https://www.youtube.com/watch?v=XUCDqzoUh6Y \r\n /* map.on('click', function(e){\t\t\r\n map.forEachFeatureAtPixel(e.pixel_, function(feature, layer){\r\n console.log(feature);\r\n //var fromadress = feature.get('name');\r\n })\r\n }) */\r\n\r\n var points = [],\r\n msg_el = document.getElementById('msg'),\r\n url_osrm_nearest = '//router.project-osrm.org/nearest/v1/driving/',\r\n url_osrm_route = '//router.project-osrm.org/route/v1/driving/',\r\n icon_url = '//cdn.rawgit.com/openlayers/ol3/master/examples/data/icon.png',\r\n vectorSource = new ol.source.Vector(),\r\n vectorLayer = new ol.layer.Vector({\r\n source: vectorSource\r\n }),\r\n styles = {\r\n route: new ol.style.Style({\r\n stroke: new ol.style.Stroke({\r\n width: 6, color: [40, 40, 40, 0.8]\r\n })\r\n }),\r\n icon: new ol.style.Style({\r\n image: new ol.style.Icon({\r\n anchor: [0.5, 1],\r\n src: icon_url\r\n })\r\n })\r\n };\r\n\r\n //console.clear();\r\n\r\n map.on('click', function(evt){\r\n utils.getNearest(evt.coordinate).then(function(coord_street){\r\n var last_point = points[points.length - 1];\r\n var points_length = points.push(coord_street);\r\n\r\n utils.createFeature(coord_street);\r\n\r\n if (points_length < 2) {\r\n msg_el.innerHTML = 'Click to add another point';\r\n return;\r\n }\r\n\r\n //get the route\r\n var point1 = last_point.join();\r\n var point2 = coord_street.join();\r\n \r\n fetch(url_osrm_route + point1 + ';' + point2).then(function(r) { \r\n return r.json();\r\n }).then(function(json) {\r\n if(json.code !== 'Ok') {\r\n msg_el.innerHTML = 'No route found.';\r\n return;\r\n }\r\n msg_el.innerHTML = 'Route added';\r\n //points.length = 0;\r\n utils.createRoute(json.routes[0].geometry);\r\n });\r\n });\r\n });\r\n\r\n var utils = {\r\n getNearest: function(coord){\r\n var coord4326 = utils.to4326(coord); \r\n return new Promise(function(resolve, reject) {\r\n //make sure the coord is on street\r\n fetch(url_osrm_nearest + coord4326.join()).then(function(response) { \r\n // Convert to JSON\r\n return response.json();\r\n }).then(function(json) {\r\n if (json.code === 'Ok') resolve(json.waypoints[0].location);\r\n else reject();\r\n });\r\n });\r\n },\r\n createFeature: function(coord) {\r\n var feature = new ol.Feature({\r\n type: 'place',\r\n geometry: new ol.geom.Point(ol.proj.fromLonLat(coord))\r\n });\r\n feature.setStyle(styles.icon);\r\n vectorSource.addFeature(feature);\r\n },\r\n createRoute: function(polyline) {\r\n // route is ol.geom.LineString\r\n var route = new ol.format.Polyline({\r\n factor: 1e5\r\n }).readGeometry(polyline, {\r\n dataProjection: 'EPSG:4326',\r\n featureProjection: 'EPSG:3857'\r\n });\r\n var feature = new ol.Feature({\r\n type: 'route',\r\n geometry: route\r\n });\r\n feature.setStyle(styles.route);\r\n vectorSource.addFeature(feature);\r\n },\r\n to4326: function(coord) {\r\n return ol.proj.transform([\r\n parseFloat(coord[0]), parseFloat(coord[1])\r\n ], 'EPSG:3857', 'EPSG:4326');\r\n }\r\n };\r\n\r\n}", "title": "" }, { "docid": "3d87e216a2db3e11ed1658f3cf9722cf", "score": "0.5333399", "text": "function addPosition(lon, lat, status, head) {\n if (map == null) {\n //alert('no map');\n } //end if\n else {\n var url = findImage(status);\n //alert(url);\n\n //place the pin\n require([\n\t\t\t\"esri/map\",\n\t\t\t\"esri/geometry/Point\",\n\t\t\t\"esri/symbols/SimpleMarkerSymbol\",\n\t\t\t\"esri/graphic\",\n\t\t\t\"esri/layers/GraphicsLayer\",\n\t\t\t\"esri/layers/ArcGISDynamicMapServiceLayer\",\n\t\t\t\"esri/layers/ImageParameters\",\n\t\t\t\"esri/symbols/TextSymbol\",\n\t\t\t\"dojo/domReady!\"\n ], function (Map, Point, SimpleMarkerSymbol, Graphic, GraphicsLayer, ArcGISDynamicMapServiceLayer, TextSymbol) {\n\n if (map.graphics != null) {\n var layrIDs = map.graphicsLayerIds;\n if (layrIDs.length > 0) {\n map.removeLayer(map.getLayer(map.graphicsLayerIds[0]));\n }\n }\n if (map.layers != null) {\n var lr = map.layerIds;\n //map.removeLayers();\n //map.graphicsLayers.clear();\n //map.layers = null;\n //map.removeAllLayers();\n }\n if (gl == null) {\n gl = new GraphicsLayer({ id: \"truck\" });\n //gl.clear();\n }\n else {\n gl.clear();\n }\n if (p != null) { p = null; }\n p = new Point(lon, lat);\n myLon = lon;\n myLat = lat;\n if (s != null) { s = null; }\n s = new esri.symbol.PictureMarkerSymbol({\n \"angle\": head,\n \"xoffset\": 0,\n \"yoffset\": 0,\n \"type\": \"esriPMS\",\n \"url\": url,\n \"contentType\": \"image/png\",\n \"width\": 24,\n \"height\": 24\n });\n if (_buddyData != \"NA\") {\n var burl = findImage('WAITING'); //load the correct icon\n if (glBuds == null) {\n glBuds = new GraphicsLayer({ id: \"buddies\" });\n }\n else {\n glBuds.clear();\n }\n for (var i = 0; i < _buddyData.length; i++) {\n var stat = _buddyData[i].status;\n burl = findImage(stat);\n var pBud = new Point(_buddyData[i].lon, _buddyData[i].lat);\n //var pBudtext = new Point(_buddyData[i].lon, _buddyData[i].lat); //point holder for text label for bro\n var sBud = new esri.symbol.PictureMarkerSymbol({\n \"angle\": _buddyData[i].heading,\n \"xoffset\": 0,\n \"yoffset\": 0,\n \"type\": \"esriPMS\",\n \"url\": burl,\n \"contentType\": \"image/png\",\n \"width\": 24,\n \"height\": 24\n });\n /*\n\t\t\t\t\t\tvar sBudText = new esri.symbol.TextSymbol({\n\t\t\t\t\t\t\t\"text\":_buddyData[i].truckNumber,\n\t\t\t\t\t\t\t\"xoffset\":12,\n\t\t\t\t\t\t\t\"yoffset\":12\n\t\t\t\t\t\t});\n\t\t\t\t\t\t*/\n var gBud = new Graphic(pBud, sBud);\n\n glBuds.add(gBud);\n var bfont = new esri.symbol.Font();\n bfont.setSize(\"14pt\");\n bfont.setWeight(esri.symbol.Font.WEIGHT_BOLD);\n var tNumB = _buddyData[i].truckNumber;\n var lastTwoB = '';\n if (tNumB != null && tNumB.length > 2) {\n lastTwoB = tNumB.substring(tNumB.length - 2, tNumB.length);\n }\n else {\n lastTwoB = 'UN';\n }\n glBuds.add(new esri.Graphic(pBud, new esri.symbol.TextSymbol(lastTwoB).setOffset(0, 18).setFont(bfont)));\n }\n }\n g = new Graphic(p, s);\n gl.add(g);\n var font = new esri.symbol.Font();\n font.setSize(\"14pt\");\n font.setWeight(esri.symbol.Font.WEIGHT_BOLD);\n var tNum = localStorage[\"trucknumber\"];\n var lastTwo = '';\n if (tNum != null && tNum.length > 2) {\n lastTwo = tNum.substring(tNum.length - 2, tNum.length);\n }\n else {\n lastTwo = 'UN';\n }\n gl.add(new esri.Graphic(p, new esri.symbol.TextSymbol(lastTwo).setOffset(0, 18).setFont(font)));\n if (_buddyData != \"NA\") {\n map.addLayer(glBuds);\n }\n map.resize();\n //map.refresh();\n map.addLayer(gl);\n //map.centerAt(p);\n });\n\n } //end else\n }", "title": "" }, { "docid": "0a6edc106e531989df37463d3495dcb5", "score": "0.5333297", "text": "function startHere(){\n createStartMap();// step 1: Create a map on load with basemap and overlay map (with empty faultlinesLayer & EarhtquakesLayer ).\n addFaultlinesLayer();//step 2: Query data and add them to faultlinesLayer \n addEarthquakesLayer(); //step 3: Query data and add them to EarhtquakesLayer \n}", "title": "" }, { "docid": "bcb1717a2606807ccb8fbfc235eb2368", "score": "0.5326419", "text": "function initializeTilemap(mapName) {\n map = game.add.tilemap(mapName);\n map.addTilesetImage('tileset', 'tileset');\n layer1 = map.createLayer('Tile Layer 1');\n layer1.scale.set(SCALE);\n if (layer2 === undefined) {\n layer2 = map.createLayer('Tile Layer 2');\n layer2.scale.set(SCALE);\n }\n\n // Create obstacles from object layer of tilemap\n obstacleGroup = game.add.group();\n map.createFromObjects('Object Layer 1', SPRINKLER_GID, 'sprinkler', 0, true, false, obstacleGroup);\n map.createFromObjects('Object Layer 1', SINK_GID, 'sink', 0, true, false, obstacleGroup);\n map.createFromObjects('Object Layer 1', TOILET_GID, 'toilet', 0, true, false, obstacleGroup);\n map.createFromObjects('Object Layer 1', SHOWER_GID, 'shower', 0, true, false, obstacleGroup);\n map.createFromObjects('Object Layer 1', WASHING_GID, 'washing_machine', 0, true, false, obstacleGroup);\n obstacleGroup.forEach(function (o) {\n o.scale.set(SCALE);\n o.x *= SCALE;\n o.y *= SCALE;\n let col = parseInt((o.x - GRID_X) / GRID_SIZE);\n let row = parseInt((o.y - GRID_Y) / GRID_SIZE);\n let obstacle;\n switch (o.key) {\n case 'sprinkler':\n obstacle = new Obstacle(o.key, col, row, Math.round(SPRINKLER_DAMAGE + weather / 3), [0,1,2,3,4,5,6,7], 4, 1000);\n break;\n case 'washing_machine':\n obstacle = new Obstacle(o.key, col, row, Math.round(WASHING_DAMAGE + weather), \n [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36], 12.3, 3000);\n break;\n case 'sink':\n obstacle = new Obstacle(o.key, col, row, Math.round(SINK_DAMAGE + weather / 4), [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17], 9, 1000);\n break;\n case 'shower':\n obstacle = new Obstacle(o.key, col, row, Math.round(SHOWER_DAMAGE + weather / 2), [1,2,3,4,5,6,7], 15, 1000);\n break;\n case 'toilet':\n obstacle = new Obstacle(o.key, col, row, Math.round(TOILET_DAMAGE + weather / 4), [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17], 9, 2000);\n break;\n }\n obstacle.sprite = o;\n obstacle.sprite.animations.add('active', obstacle.animationFrames, obstacle.animationSpeed, true);\n addObjectToGrid(obstacle, col, row);\n obstacleArray.push(obstacle);\n });\n}", "title": "" }, { "docid": "69caeaf1a74ffeef42c18fb10ecc9715", "score": "0.5318756", "text": "function createMapTile(mapName) {\n\t\t\tL.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n\t\t\tattribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors',\n\t\t\tmaxZoom: 18,\n\t\t\ttileSize: 512,\n\t\t\tzoomOffset: -1,\n\t\t}).addTo(mapName);\n\t}", "title": "" }, { "docid": "991149f9584d366c1a2bc792e038bc5d", "score": "0.5313117", "text": "add(map, {lng, lat}, layout = this.defaultLayout, paint = this.defaultPaint) {\n const srcId = 'mapbox-superset-src' + uniqId();\n\n map.addSource(srcId, {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: [\n {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [lng, lat]\n },\n properties: {}\n }\n ]\n }\n });\n\n const layerId = 'mapbox-superset-layer' + uniqId();\n\n map.addLayer({\n id: layerId,\n type: 'symbol',\n source: srcId,\n layout: layout,\n paint: paint\n });\n\n return {\n layerId: layerId,\n srcId: srcId\n };\n }", "title": "" }, { "docid": "598619685af92ecea5a33e51ce827d7e", "score": "0.53055876", "text": "function addPlaceMarks() {\n // first init layer\n if (gazetteerLayer == null) {\n gazetteerLayer = new WorldWind.RenderableLayer(\"GazetteerLayer\"); \n\n for (var i = 0; i < availableRegionsCSV.length; i++) { \n // create a marker for each point\n var name = availableRegionsCSV[i].name;\n var latitude = availableRegionsCSV[i].center_lat;\n var longitude = availableRegionsCSV[i].center_lon; \n var diameter = parseFloat(availableRegionsCSV[i].diameter);\n\n var labelAltitudeThreshold = 0; \n\n if (diameter >= 0 && diameter < 10) { \n labelAltitudeThreshold = 1.1e3;\n } else if (diameter > 10 && diameter < 20) {\n labelAltitudeThreshold = 1.7e3;\n } else if (diameter >= 20 && diameter < 40) {\n labelAltitudeThreshold = 1.2e4;\n } else if (diameter >= 40 && diameter < 60) {\n labelAltitudeThreshold = 1.7e4;\n } else if (diameter >= 60 && diameter < 80) {\n labelAltitudeThreshold = 1.2e5;\n } else if (diameter >= 80 && diameter < 100) {\n labelAltitudeThreshold = 1.7e5;\n } else if (diameter >= 100 && diameter < 200) {\n labelAltitudeThreshold = 1.2e6;\n } else if (diameter >= 200 && diameter < 400) {\n labelAltitudeThreshold = 1.7e6;\n } else if (diameter >= 400 && diameter < 600) {\n labelAltitudeThreshold = 1.2e7;\n } else if (diameter >= 600 && diameter < 1000) {\n labelAltitudeThreshold = 1.7e7;\n } else if (diameter >= 1000 && diameter < 1400) {\n labelAltitudeThreshold = 1.2e8;\n } else if (diameter >= 1400 && diameter < 2000) {\n labelAltitudeThreshold = 1.7e8;\n } else {\n labelAltitudeThreshold = 1.2e9;\n }\n\n\n var placemark = new WorldWind.Placemark(new WorldWind.Position(latitude, longitude, 10), true, null);\n placemark.label = name;\n placemark.altitudeMode = WorldWind.RELATIVE_TO_GROUND; \n\n placemark.eyeDistanceScalingThreshold = labelAltitudeThreshold - 1e5;\n placemark.eyeDistanceScalingLabelThreshold = labelAltitudeThreshold;\n\n var placemarkAttributes = new WorldWind.PlacemarkAttributes(); \n placemarkAttributes.labelAttributes.color = new WorldWind.Color(0.43, 0.93, 0.97, 1);\n placemarkAttributes.labelAttributes.depthTest = false;\n placemarkAttributes.labelAttributes.scale = 1.2;\n placemarkAttributes.imageScale = 0.8;\n placemarkAttributes.imageSource = \"html/images/close.png\"; \n\n placemark.attributes = placemarkAttributes;\n\n\n // as they are small and slow\n if (diameter < MIN_DEFAULT_LOAD) {\n placemark.enabled = false;\n }\n\n var obj = {\"diameter\": diameter};\n placemark.userProperties = obj;\n\n\n // add place mark to layer\n gazetteerLayer.addRenderable(placemark); \n } \n\n // Marker layer\n wwd.insertLayer(10, gazetteerLayer);\n\n } else { \n if (isShowGazetteer === false) {\n gazetteerLayer.enabled = false; \n } else { \n gazetteerLayer.enabled = true;\n }\n } \n }", "title": "" }, { "docid": "1e265cad15cfbf9c4451809c996afeb9", "score": "0.5300227", "text": "function addJobTypesToMap(jobTypes, layers, overlaysMaps) {\n var controlRegion = new L.LayerGroup();\n layers.push(controlRegion);\n jobTypes.forEach(function (jobType) {\n switch (jobType.var_name) {\n case \"arch\":\n arch = L.icon({\n iconUrl: jobType.iconUrl,\n shadowUrl: jobType.shadowUrl,\n iconSize: [25, 41],\n iconAnchor: [12, 41],\n popupAnchor: [1, -34],\n shadowSize: [41, 41]\n });\n controlArch = new L.LayerGroup();\n layers.push(controlArch);\n var htmlImageArch = \"<img src='{0}' class='icon_legend'/> <span class='my-layer-item'>{1}</span>\".format(jobType.iconUrl, jobType.name);\n overlaysMaps[htmlImageArch] = controlArch;\n\n break;\n case \"gis\":\n gis = L.icon({\n iconUrl: jobType.iconUrl,\n shadowUrl: jobType.shadowUrl,\n iconSize: [25, 41],\n iconAnchor: [12, 41],\n popupAnchor: [1, -34],\n shadowSize: [41, 41]\n });\n controlGis = new L.LayerGroup();\n layers.push(controlGis);\n var htmlImageGis = \"<img src='{0}' class='icon_legend'/> <span class='my-layer-item'>{1}</span>\".format(jobType.iconUrl, jobType.name);\n overlaysMaps[htmlImageGis] = controlGis;\n break;\n case \"civil\":\n civil = L.icon({\n iconUrl: jobType.iconUrl,\n shadowUrl: jobType.shadowUrl,\n iconSize: [25, 41],\n iconAnchor: [12, 41],\n popupAnchor: [1, -34],\n shadowSize: [41, 41]\n });\n controlCivil = new L.LayerGroup();\n layers.push(controlCivil);\n var htmlImageCivil = \"<img src='{0}' class='icon_legend'/> <span class='my-layer-item'>{1}</span>\".format(jobType.iconUrl, jobType.name);\n overlaysMaps[htmlImageCivil] = controlCivil;\n break;\n case \"geodesy\":\n geodesy = L.icon({\n iconUrl: jobType.iconUrl,\n shadowUrl: jobType.shadowUrl,\n iconSize: [25, 41],\n iconAnchor: [12, 41],\n popupAnchor: [1, -34],\n shadowSize: [41, 41]\n });\n controlGeodesy = new L.LayerGroup();\n layers.push(controlGeodesy);\n var htmlImageGeodesy = \"<img src='{0}' class='icon_legend'/> <span class='my-layer-item'>{1}</span>\".format(jobType.iconUrl, jobType.name);\n overlaysMaps[htmlImageGeodesy] = controlGeodesy;\n break;\n default:\n return\n }\n\n\n });\n}", "title": "" }, { "docid": "1ecd8040c646a9f17d1c86c7bc19baed", "score": "0.529949", "text": "function createMap(){\n //zooms automatically to California\n var map = L.map('map', {\n center: [36.7783, -116.4179],\n zoom: 6\n });\n\n//mapbox basemap\nL.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZW1pbGxpZ2FuIiwiYSI6ImNqczg0NWlxZTBia2U0NG1renZyZDR5YnUifQ.UxV3OqOsN6KuZsclo96yvQ', {\n //map attribution\n attribution: 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, <a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery &copy; <a href=\"http://mapbox.com\">Mapbox</a>',\n maxZoom: 18,\n //uses mapbox streets as opposed to satellite imagery, etc.\n id: 'mapbox.light',\n //my unique access token\n accessToken: 'pk.eyJ1IjoiZW1pbGxpZ2FuIiwiYSI6ImNqczg0NWlxZTBia2U0NG1renZyZDR5YnUifQ.UxV3OqOsN6KuZsclo96yvQ'\n}).addTo(map);\n \n getData(map);\n getNextLayer(map);\n}", "title": "" }, { "docid": "894ab07374f1d2a589cebe93d34d64e0", "score": "0.527396", "text": "function createMap()\n{\n\t mymap = L.map('mapid').setView([-43.48898, 172.54045], 13);\n\n\tL.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', {\n\t\tmaxZoom: 18,\n\t\tattribution: 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, ' +\n\t\t\t'<a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, ' +\n\t\t\t'Imagery © <a href=\"http://mapbox.com\">Mapbox</a>',\n\t\tid: 'mapbox.streets'\n\t}).addTo(mymap);\n\n\tg_layer_searchedMarks = L.layerGroup();\n g_layer_searchedMarks.addTo(mymap);\n \n\tg_layer_exploreMarks = L.layerGroup();\n g_layer_exploreMarks.addTo(mymap);\n \n\tg_layer_recommendedMarks = L.layerGroup();\n g_layer_recommendedMarks.addTo(mymap);\n \n \n\tg_layer_journalMarks = L.layerGroup();\n g_layer_journalMarks.addTo(mymap);\n \n g_layer_journalPath = L.polyline([], {\n \tcolor: 'blue',\n \tweight: 3,\n \topacity: 0.5,\n \tsmoothFactor: 1\n });\n g_layer_journalPath.addTo(mymap);\n}", "title": "" }, { "docid": "bf65ba16d1e43eda5fc1a75dc1a80b03", "score": "0.5272655", "text": "addLayer(state, { parent, index }) {\n let part = Layer('Layer ' + state.lastId)\n let id = ++state.lastId\n remember(state, [addPart(state, parent, index, id, part)])\n }", "title": "" }, { "docid": "18f16f12fe54dc7fd49d677784e07e68", "score": "0.52685547", "text": "onAddMarkersToMap() {\r\n let that = this;\r\n let { tasksList, needMap } = that.state;\r\n if (!needMap) {\r\n return;\r\n }\r\n let bounds = needMap.getBounds();\r\n\r\n const greenUrl = \"http://maps.google.com/mapfiles/ms/icons/green-dot.png\"; // material\r\n const yellowUrl = \"http://maps.google.com/mapfiles/ms/icons/yellow-dot.png\"; //service\r\n\r\n //let infoWindow = new google.maps.InfoWindow();\r\n if (tasksList) {\r\n tasksList.forEach(task => {\r\n let iconUrl = \"\";\r\n let position = {\r\n lat: task.lat,\r\n lng: task.lng\r\n };\r\n\r\n if (task.taskType === \"service\") {\r\n iconUrl = yellowUrl;\r\n } else {\r\n iconUrl = greenUrl;\r\n }\r\n let marker = new google.maps.Marker({\r\n position: position,\r\n title: task.summary,\r\n icon: {\r\n url: iconUrl\r\n }\r\n });\r\n\r\n let contentString =\r\n \"<div className='row'></div> \" +\r\n \"<div >\" +\r\n task.summary +\r\n \"s\" +\r\n \"</div> \" +\r\n \"<div >\" +\r\n task.description +\r\n \"</div> </div>\";\r\n let infoWindow = new google.maps.InfoWindow({\r\n content: contentString //\"Summary: \" + task.summary + \" Description \" + task.description\r\n });\r\n\r\n marker.addListener(\"mouseover\", function() {\r\n infoWindow.open(needMap, marker);\r\n });\r\n marker.addListener(\"mouseout\", function() {\r\n infoWindow.close(needMap, marker);\r\n });\r\n\r\n marker.addListener(\"click\", function() {\r\n that.setState({\r\n selectedTask: task\r\n });\r\n let data = {\r\n params: { id: task.id }\r\n };\r\n\r\n let numResovers = 0;\r\n resolverCount(data)\r\n .then(function(res) {\r\n numResovers = res;\r\n if (numResovers <= 5) {\r\n that.onShowAssist();\r\n } else {\r\n that.growl.show({\r\n life: 15000,\r\n severity: \"error\",\r\n summary: \"Number of resolvers\",\r\n detail:\r\n \"There are already 5 resolvers assisting with this request. Please choose another need.\"\r\n });\r\n }\r\n })\r\n .catch(function(error) {\r\n console.log(error);\r\n });\r\n });\r\n marker.setMap(needMap);\r\n\r\n bounds.extend(marker.position);\r\n needMap.fitBounds(bounds);\r\n });\r\n }\r\n //google.maps.event.trigger(needMap, 'resize');\r\n }", "title": "" }, { "docid": "fba1d648771029a1ffe5f09135b49e26", "score": "0.5266506", "text": "function addCoordsToMap(jobs, sideBar, regions, layers) {\n var controlRegion = layers[0];\n if (regions)\n { layers.forEach(function(layer){\n layer.clearLayers();\n });\n regions.forEach(function(region){\n L.geoJson(region, {\n pointToLayer: function (feature, latlng) {\n return L.marker(latlng)\n }\n }).addTo(controlRegion);\n })\n }\n jobs.forEach(function (job) {\n L.geoJson(job, {\n pointToLayer: function (feature, latlng) {\n return L.marker(latlng, {icon: eval(job.properties.jobType), alt: job.properties.id})\n }\n }).addTo(eval(\"control\" + job.properties.jobType.capitalize())).on('click', function(){\n getJobProperties(job.properties.id, sideBar)\n })\n });\n\n}", "title": "" }, { "docid": "5f7779e4db1b836932fddbca67e9f67f", "score": "0.5266447", "text": "buildMap() {\n let map = this.make.tilemap({ key: this.key + 'map' });\n let tileset = map.addTilesetImage('tileset', this.key + 'tiles');\n this.mapData = {\n map: map,\n tileset: tileset,\n groundLayer: map.createLayer('ground', tileset),\n wallLayer: map.createLayer('walls', tileset),\n objectsLayer: map.createLayer('objetos', tileset),\n }\n\n this.mapData.wallLayer.setCollisionByProperty({ collides: true });\n this.mapData.objectsLayer.setCollisionByProperty({ collides: true });\n }", "title": "" }, { "docid": "18225c7e891689057982a8f8143b60df", "score": "0.5266227", "text": "function create() {\n //now that the map data and tileset are loaded, create a map object (tiles, objects, properties, etc)\n map = game.add.tilemap('testmap');\n \n //the map needs to be informed which asset of ours is the tileset it's expecting\n //the first parameter is the name of the tileset in the map data, the second is an asset key\n map.addTilesetImage('lttp_castlebasement', 'tileset');\n \n //maps aren't drawn upon being added to the game, like Phaser.Sprite, etc\n //instead, individual layers are rendered to TilemapLayers, which behave like sprites\n //the name of the layer passed in here should be the name of a tile layer in the map data\n //once created, the layer is added to the game's display list (like a sprite)\n var layer = map.createLayer('base layer');\n\n //layers are fixed to the camera by default, center this one instead\n layer.fixedToCamera = false;\n layer.x = game.world.centerX - (map.widthInPixels / 2);\n layer.y = game.world.centerY - (map.heightInPixels / 2);\n }", "title": "" }, { "docid": "995bf32849a2f96d62a1b3e22b713fff", "score": "0.52633876", "text": "addLayer() {\n EventBus.$emit(\"try-adding-layer\", \"Layer 1\");\n }", "title": "" }, { "docid": "2175436486daf5b217408e5a804dbc88", "score": "0.5263373", "text": "function addBoundaryLayer(object) {\n\n var points = ['airports-extended', 'healthsites', 'volcano_list', 'glopal_power_plant', 'world_port_index']\n\n\n var k = Object.keys(object); //what layer is being added\n var v = Object.values(object)[0]; //true or false if clicked\n\n var clicked = k[0]\n\n console.log(v)\n console.log(clicked)\n\n\n if(points.includes(clicked)) {\n\n if(map.getLayer(clicked)) {\n map.removeLayer(clicked)\n } else {\n\n\n map.addLayer({\n 'id': clicked,\n 'type': 'circle',\n 'source': 'points-source',\n 'filter': ['==', 'layer', clicked],\n 'layout': {\n 'visibility': 'visible'\n },\n 'paint': {\n 'circle-color': pointColors[clicked],\n 'circle-radius': 7,\n 'circle-opacity': 0.7\n }\n })\n\n }\n console.log(clicked)\n\n map.on('click', clicked, (e) => {\n const coordinates = e.features[0].geometry.coordinates.slice();\n const description = e.features[0].properties[pointDesc[clicked]];\n\n //console.log(coordinates);\n getIso(coordinates)\n\n new mapboxgl.Popup({\n className: 'popupCustom'\n })\n .setLngLat(coordinates)\n .setHTML(description)\n .addTo(map);\n\n })\n\n \n\n //map.setFilter('points', ['==', 'layer', clicked])\n //addPointLayer($(this))\n\n }\n else if (clicked === 'underwater-overlay') {\n addCables()\n\n } else if (!v) {\n \n map.removeLayer(clicked)\n console.log('uncheck: ' + clicked);\n \n } else {\n\n var slayer;\n var color;\n var source;\n\n if (clicked === 'admin1-overlay') {\n source = 'admin1'\n slayer = 'admin1'\n color = 'red'\n } else if (clicked === 'admin2-overlay') {\n source = 'admin2'\n slayer = 'admin2'\n color = '#003399'\n } else if (clicked === 'allsids') {\n //console.log('sids!')\n source = 'allsids'\n slayer = 'allSids'\n color = 'orange'\n } else {\n //source = 'pvaph'\n\n //layer == 'airports=extended', 'healthsites', 'volcano-list', 'glopal_power_plant', ''\n console.log($(this).val());\n //console.log($(this).id())\n console.log($(this))\n }\n\n map.addLayer({\n 'id': clicked,\n 'type': 'line',\n 'source': source,\n 'source-layer': slayer,\n 'layout': {\n 'visibility': 'visible'\n },\n\n 'paint': {\n 'line-color': color,\n 'line-width': 1\n\n }\n }, firstSymbolId);\n\n if (map.getLayer('admin1-overlay')) {\n map.moveLayer(clicked, 'admin1-overlay')\n\n }\n\n map.on('mouseover', function () {\n\n\n\n })\n\n }\n\n\n}", "title": "" }, { "docid": "eb7cb8241a63e55a6f1c5ceb6ac5b410", "score": "0.5263191", "text": "function add_layer() {\n var layer_num = (layer_divs.length + 1).toString();\n var layer_name = \"layer_\" + layer_num;\n var layer_type = $('#layer_type').val();\n layer_divs.push(layer_name);\n var layer_html = [\n '<div id=\"' + layer_name + '\" class=\"single_layer_controls\">',\n '<span style=\"font-style: italic;\">layer ' + \n layer_num + ' (' + layer_type + ')' +\n '</span>&#160;&#160;'\n ];\n var checkbox_name = \"square_switchboard_\" + layer_num;\n layer_html.push('<input type=\"checkbox\" id=\"' + checkbox_name +\n '\" checked=\"checked\" />');\n layer_html.push('<label for=\"' + checkbox_name + '\" id=\"' + checkbox_name\n + '_label\">square</label>&#160;&#160;');\n layer_types.push(layer_type);\n var layer_params = layer_type_params[layer_type];\n var i_param;\n var param_name;\n var param_id;\n var sync_fields = [];\n for (i_param = 0; i_param < layer_params.length; i_param += 1) {\n param_name = layer_params[i_param];\n if (ends_with(param_name, \"_xy\")) {\n param_name = param_name.substr(0, param_name.length - 3);\n param_id = param_name + \"_\" + layer_num;\n layer_html = layer_html.concat([\n '<label for=\"' + param_id + '_x\">' + param_name + ': </label>',\n '<input type=\"text\" id=\"' + param_id + '_x\" value=\"1\"' +\n ' class=\"number\" />',\n '<input type=\"text\" id=\"' + param_id + '_y\" value=\"1\"' +\n ' class=\"number\" />',\n '&#160;&#160;'\n ]);\n sync_fields.push(param_id);\n } else {\n param_id = param_name + \"_\" + layer_num;\n layer_html = layer_html.concat([\n '<label for=\"' + param_id + '\">' + param_name + ': </label>',\n '<input type=\"text\" id=\"' + param_id + '\" value=\"1\"' +\n ' class=\"number\" />',\n '&#160;&#160;'\n ]);\n }\n }\n layer_html = layer_html.concat(['</div>']);\n $(\"#layer_controls\").append(layer_html.join(\"\\n\"));\n $(\"#\" + layer_name).hide().slideDown('normal');\n if (sync_fields.length > 0) {\n $(\"#\" + checkbox_name).change(function(){\n var i;\n for (i in sync_fields) {\n if ($(this).is(':checked')) {\n $(\"#\" + sync_fields[i] + \"_x\").keyup(\n _get_sync_function(sync_fields[i]));\n $(\"#\" + sync_fields[i] + \"_y\").attr('disabled', true);\n }\n else {\n $(\"#\" + sync_fields[i] + \"_x\").unbind();\n $(\"#\" + sync_fields[i] + \"_y\").removeAttr('disabled');\n }\n }\n });\n $(\"#\" + checkbox_name).change();\n } else {\n $(\"#\" + checkbox_name).remove();\n $(\"#\" + checkbox_name + \"_label\").remove();\n }\n}", "title": "" }, { "docid": "a6c5e22b3b1a569085f0aee9496d025f", "score": "0.5258088", "text": "function createMap(){\n\t//create the map and zoom in order to grab the entire US\n\tvar map = L.map('mapid',{\n\t\tmaxZoom: 7,\n\t\tminZoom:4,\n\t\t//maxBounds: bounds\n\t}).setView([38,-102],5);\n\n\tvar CartoDB_Positron = L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', {\n attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors &copy; <a href=\"https://carto.com/attributions\">CARTO</a>',\n subdomains: 'abcd',\n\tminZoom: 0,\n\tmaxZoom: 20,\n}).addTo(map);\n\n\t//unique basemap by stamen, also adding zillow data info \n// \tvar Stamen_Toner = L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.{ext}', {\n// \tattribution: 'Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> &mdash; Map data &copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors',\n// \tsubdomains: 'abcd',\n// \tminZoom: 0,\n// \tmaxZoom: 20,\n// \text: 'png'\n// }).addTo(map);\n\n getData(map);\n}", "title": "" }, { "docid": "efdd7484424389f9af83d5ac1c381133", "score": "0.52554005", "text": "function add_bounding_area_layer(layer,a,b,c,d) {\n if(dirty_layer_uid) {\n remove_a_layer(dirty_layer_uid);\n }\n var uid=getRnd(\"UCVM\");\n var tmp={\"uid\":uid,\"latlngs\":[{\"lat\":a,\"lon\":b},{\"lat\":c,\"lon\":d}]};\n set_area_latlons(uid,a,b,c,d);\n ucvm_area_list.push(tmp);\n var group=L.layerGroup([layer]);\n viewermap.addLayer(group);\n\n load_a_layergroup(uid,AREA_ENUM,group, EYE_NORMAL);\n dirty_layer_uid=uid;\n}", "title": "" }, { "docid": "902bb6ddf149e1a27ddbf2696102ce0d", "score": "0.525268", "text": "addToChangeLayers(){\n let _to = this.props.toVersion.key;\n //attribute change in protected areas layers\n this.addLayer({id: window.LYR_TO_CHANGED_ATTRIBUTE, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(99,148,69,0.4)\", \"fill-outline-color\": \"rgba(99,148,69,0.8)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //geometry change in protected areas layers - to\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_COUNT_CHANGED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_COUNT_CHANGED_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_SHIFTED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_SHIFTED_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //added protected areas layers\n this.addLayer({id: window.LYR_TO_NEW_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(63,127,191,0.2)\", \"fill-outline-color\": \"rgba(63,127,191,0.6)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_NEW_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(63,127,191)\", \"circle-opacity\": 0.6}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n \n }", "title": "" }, { "docid": "cfa974be0daf167a5cc414f344bfa7d3", "score": "0.52512133", "text": "addMapLayers() {\r\n // console.log('method: addMapLayers');\r\n let layers = this.map.getStyle().layers;\r\n // Find the index of the first symbol layer in the map style\r\n let firstSymbolId;\r\n for (let i = 0; i < layers.length; i++) {\r\n if (layers[i].type === 'symbol') {\r\n firstSymbolId = layers[i].id;\r\n break;\r\n }\r\n }\r\n this.options.mapConfig.layers.forEach((layer, index) => {\r\n\r\n // Add map source\r\n this.map.addSource(layer.source.id, {\r\n type: layer.source.type,\r\n data: layer.source.data\r\n });\r\n \r\n\r\n // Add layers to map\r\n this.map.addLayer({\r\n \"id\": layer.id,\r\n \"type\": \"fill\",\r\n \"source\": layer.source.id,\r\n \"paint\": {\r\n \"fill-color\": this.paintFill(layer.properties[0]),\r\n \"fill-opacity\": 0.8,\r\n \"fill-outline-color\": \"#000\"\r\n },\r\n 'layout': {\r\n 'visibility': 'none'\r\n }\r\n }, firstSymbolId);\r\n\r\n\r\n // check if touch device. if it's not a touch device, add mouse events\r\n if (!checkDevice.isTouch()) {\r\n this.initMouseEvents(layer);\r\n } // checkDevice.isTouch()\r\n\r\n\r\n // Store all the custom layers\r\n this.customLayers.push(layer.id);\r\n });\r\n }", "title": "" }, { "docid": "4c68e72bb831288645f92e5804eff97d", "score": "0.52463716", "text": "function addTile(context, z, y, x) {\n var tile = context.findTile(z, y, x);\n if ( tile ) {\n tile.locked = false;\n return;\n }\n //console.log(\"addTile z=\"+z+\" y=\"+y+\" x=\"+x);\n var cood = new Float32Array(256*256*2);\n \n// var extent = ol.proj.get(\"EPSG:3857\").getExtent();\n \n var zz = Math.pow(2,parseInt(z));\n var xx = (parseFloat(x))/zz;\n var yy = (parseFloat(y)+1)/zz;\n \n xx = xx*(extent[2]-extent[0])+extent[0];\n yy = yy*(extent[3]-extent[1])+extent[1];\n var xd = (extent[2]-extent[0])/zz/256;\n var yd = (extent[3]-extent[1])/zz/256;\n \n var c = {x:[256],y:[256]};\n for ( var i = 0 ; i < 256 ; i++ ) {\n var xxx = xx + xd*parseFloat(i);\n var yyy = yy - yd*parseFloat(i);\n var xp = ol.proj.transform([xxx,yy], 'EPSG:3857', 'EPSG:4326');\n c.x[i] = xp[0];\n if ( c.x[i] < -180.0 )\n c.x[i] += 360.0;\n else if ( c.x[i] >= 180.0 )\n c.x[i] -= 360.0;\n var yp = ol.proj.transform([xx,yyy], 'EPSG:3857', 'EPSG:4326');\n c.y[i] = yp[1];\n }\n var i = 0;\n for ( var yi = 0 ; yi < 256 ; yi++ ) {\n for ( var xi = 0 ; xi < 256 ; xi++ ) {\n cood[i++] = c.y[yi];\n cood[i++] = c.x[xi];\n }\n }\n context.addTile(\"M\", z, y, x, cood,\n new WRAP.Geo.Bounds(cood[0]*60.0, cood[2*256*255]*60.0, cood[2*256*256-1]*60.0, cood[1]*60.0));\n }", "title": "" }, { "docid": "cd259fbfff57a92357311530b6a403ca", "score": "0.5241887", "text": "function createMap(){\n //Initialize the map\n var map = L.map('map').setView([20, 0], 2);\n //add OSM base tilelayer\n //L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.{ext}', {\n\t // attribution: 'Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n\t // subdomains: 'abcd',\n L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.{ext}', {\n\t attribution: 'Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n\t subdomains: 'abcd',\n\t minZoom: 0,\n\t maxZoom: 20,\n\t ext: 'png'\n }).addTo(map);\n\n //call the getData function to load MegaCities data\n getData(map);\n}", "title": "" }, { "docid": "bfd65f02b55d067a33578ade00238353", "score": "0.5239774", "text": "function addWMSLayer(name, geoserver_name) {\n wms_layer = new OpenLayers.Layer.WMS(name, geoserver_url, {\n layers: \"cite:\" + geoserver_name,\n format: \"image/png8\",\n tiled: true,\n singleTile: false,\n transparent: true,\n styles: \"cite:Hazard Map\",\n tilesorigin: map.maxExtent.left + \",\" + map.maxExtent.bottom,\n }, {\n displayInLayerSwitcher: !1\n }, {\n isBaseLayer: false\n });\n registerEvents(wms_layer);\n toggleWMSLayer(name);\n}", "title": "" }, { "docid": "96dbb623d3ca18ac0b7e615063e67309", "score": "0.5236365", "text": "function addTo(map, layerStyle) {\n if (map && properties.layer && !status.layerAdded) {\n layerStyle = {\"color\":\"rgb(200,200,200)\", \"fill\": false, \"weight\": 2 } || layerStyle;\n status.layerAdded = true;\n properties.layer.addTo(map);\n properties.layer.setStyle(layerStyle);\n }\n }", "title": "" }, { "docid": "7034d0fd3473c8f7b145946f7da4112b", "score": "0.5236045", "text": "constructor(map, uniqueId, mapBoxSourceId, addBeforeLayer) {\n this.map = map.map || map;\n this.uniqueId = uniqueId;\n this.mapBoxSourceId = mapBoxSourceId;\n\n // Add the colored fill area\n map.addLayer(\n {\n id: this.uniqueId+'fillpoly',\n type: 'fill',\n source: this.mapBoxSourceId,\n paint: {\n 'fill-antialias': true,\n 'fill-outline-color': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n 'rgba(0, 0, 0, 0.9)',\n 'rgba(100, 100, 100, 0.4)'\n ],\n 'fill-opacity': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n 0.6,\n FILL_OPACITY\n ]\n }\n },\n addBeforeLayer\n );\n }", "title": "" }, { "docid": "da543c26f3722f7c55a414f120fd0620", "score": "0.52343297", "text": "function osmMapLayer() {\n var layer = new ol.layer.Tile({\n source: new ol.source.OSM()\n });\n return layer;\n}", "title": "" }, { "docid": "b7dccf3c8a52fbb7c29a34dfc0af9fbf", "score": "0.5233761", "text": "function createMap() {\n \n // Set variables to change the appearance of toggled interface buttons\n var highlightStyle = \"5px solid yellow\";\n var unhighlight = \"none\";\n \n // Connect to Mapbox account\n mapboxgl.accessToken = 'pk.eyJ1IjoidGhvbWFzaGFybmVyIiwiYSI6ImNqMXA2dTY2OTAwZnUycnJ3MzhtYWc5NHAifQ.JYDW8uR0odthCOHngoNqUg';\n \n // Declare map object containing the OSM tileset\n var osmMap = new mapboxgl.Map({\n container: 'osm',\n center: [-78.024408,38.155655],\n zoom: 7.5,\n style: 'mapbox://styles/thomasharner/cj1vmsm5e00002sqj13hcdwtm'\n });\n \n bounds = [[-84.67539,36.54076],[-74.16643,39.46601]];\n \n // Declare map object containing Gov tileset\n var govMap = new mapboxgl.Map({\n container: 'govt',\n center: [-78.024408,38.155655],\n zoom: 7.5,\n style: 'mapbox://styles/thomasharner/cj1vmwd6b00012rp221mlcom4'\n \n });\n \n // Confine the map to roughly the state of Virginia\n osmMap.setMaxBounds(bounds);\n govMap.setMaxBounds(bounds);\n \n // Create the comparison slider for the map divs\n var map = new mapboxgl.Compare(osmMap, govMap);\n \n // Upon clicking on Alexandria, highlight the button and fly to area\n $(\"#flyAlexandria\").click(function(){\n clearHighlight();\n var key = document.getElementById(\"flyAlexandria\");\n key.style.border = highlightStyle\n flyToLocation(govMap,osmMap,this.id);\n });\n \n // Upon clicking on Henrico, highlight the button and fly to area\n $(\"#flyHenrico\").click(function() {\n clearHighlight();\n var key = document.getElementById(\"flyHenrico\");\n key.style.border = highlightStyle;\n flyToLocation(govMap,osmMap,this.id);\n\n });\n \n // Upon clicking on Lynchburg, highlight the button and fly to area\n $(\"#flyLynchburg\").click(function() {\n clearHighlight();\n var key = document.getElementById(\"flyLynchburg\");\n key.style.border = highlightStyle;\n flyToLocation(govMap,osmMap,this.id);\n });\n \n // Toggle the vector and basemap layers\n document.getElementById('changeBasemap').addEventListener('click',function() {\n \n // Set the new styles and change the button label\n if(this.firstChild.nodeValue == 'View Imagery'){\n osmMap.setStyle('mapbox://styles/thomasharner/cj1vn4jr300092rpo7dnyxqm2');\n govMap.setStyle('mapbox://styles/thomasharner/cj1vn5pml00002sp9nx799k71');\n this.firstChild.nodeValue = 'View Vector';\n }\n else {\n osmMap.setStyle('mapbox://styles/thomasharner/cj1vmsm5e00002sqj13hcdwtm');\n govMap.setStyle('mapbox://styles/thomasharner/cj1vmwd6b00012rp221mlcom4');\n this.firstChild.nodeValue = 'View Imagery';\n }\n \n });\n \n // Clears the highlight when another AOI is selected\n function clearHighlight() {\n document.getElementById(\"flyLynchburg\").style.border = unhighlight;\n document.getElementById(\"flyAlexandria\").style.border = unhighlight;\n document.getElementById(\"flyHenrico\").style.border = unhighlight;\n \n }\n \n \n osmMap.on('load',function(){\n // Features and corresponding hex colors to build the legend \n var features = ['Parks', 'Building Footprints','Primary Roads', 'Secondary Roads', 'Trails'];\n var hexColors = ['#00CC00','#9933CD','#000','#E0E0E0', '#663300']\n \n for (i = 0; i < features.length; i++){\n var color = hexColors[i];\n var item = document.createElement('div');\n var key = document.createElement('span');\n key.className = 'legend-key' + color;\n key.style.backgroundColor = color;\n // if roads or trails, set to larger width and smaller height than CSS\n \n if (i == 2 || i == 3 || i == 4){\n \n key.style.display = \"inline-block\";\n key.style.height = \"0.1px\";\n key.style.width = \"25px\";\n \n }\n else {\n item.innerHTML= \"&nbsp&nbsp\";\n }\n \n var value = document.createElement('span');\n if (i == 2 || i == 3 || i == 4){\n value.innerHTML = features[i];\n }\n else {\n value.innerHTML = \"&nbsp&nbsp\" + features[i];\n }\n item.appendChild(key);\n item.appendChild(value);\n legend.appendChild(item);\n \n };\n \n \n \n });\n \n\n}", "title": "" }, { "docid": "df13df88c3569b1a974ed68d30874b7e", "score": "0.5225327", "text": "static makeWallLayer() {}", "title": "" }, { "docid": "a707d28ea436280129101827ecb8b59c", "score": "0.5222953", "text": "function createMap() {\n // Provide your access token\n L.mapbox.accessToken = 'pk.eyJ1IjoiaW1jaGluZ3kiLCJhIjoiY2lsaGF6MTlzMmNobnZubWM1MWUydnpxOCJ9.2yX5ZOI_yyggtJMt86TAQw';\n\n // Create map bounds\n var southWest = L.latLng(41.44703, -87.32461);\n var northEast = L.latLng(42.22253, -88.11764);\n var bounds = L.latLngBounds(southWest, northEast);\n\n // Return the instance of a map in the div #map\n return L.mapbox.map('map', 'mapbox.streets', {\n fadeAnimation: true,\n maxBounds: bounds,\n maxZoom: 19,\n minZoom: 10\n });\n }", "title": "" }, { "docid": "6eae3351ddb34e52efd14d815156db13", "score": "0.52214783", "text": "function addLayersOnMap(){\n\n var layers = map.getStyle().layers;\n // Find the index of the first symbol layer in the map style\n var firstSymbolId;\n for (var i = 0; i < layers.length; i++) {\n if (layers[i].type === 'symbol') {\n firstSymbolId = layers[i].id;\n console.log(firstSymbolId);\n break;\n }\n }\n\n // 3d extruded buildings\n // apartments from json\n map.addLayer({\n 'id': 'extrusion',\n 'type': 'fill-extrusion',\n \"source\": {\n \"type\": \"geojson\",\n \"data\": \"https://denyskononenko.github.io/maprebuild/buildigs_appartments.geojson\"\n },\n 'paint': {\n 'fill-extrusion-color': '#696969',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': 1.0\n }\n }, firstSymbolId);\n\n // all buildings excepts hospitals and apartments\n map.addLayer({\n 'id': '3d-buildings',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['!=', 'type', 'hospital'], ['!=', 'type' ,'apartments']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#dedede',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .4\n }\n }, firstSymbolId);\n\n // hospitals\n map.addLayer({\n 'id': '3d-buildings-hospitals',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'hospital']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#A52A2A',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .2\n }\n }, firstSymbolId);\n\n // universities\n map.addLayer({\n 'id': '3d-buildings-university',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'university']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // schools\n map.addLayer({\n 'id': '3d-buildings-school',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'school']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // kindergarten\n map.addLayer({\n 'id': '3d-buildings-kindergarten',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'kindergarten']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n // use an 'interpolate' expression to add a smooth transition effect to the\n // buildings as the user zooms in\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n}", "title": "" }, { "docid": "4129085717df2fa0569cabcf2ecefa3e", "score": "0.5221377", "text": "function createWFST(layers) {\n GeoApp.wfst = {};\n\n // Filter out the baselayers and hidden layers //\n let originLayers = layers.array_.filter(layer => layer.values_.isBaseLayer !== true && layer.values_.hideInLayerManager !== true);\n let layerArray = [];\n\n let wfstContainer = createNode('.ol-overlaycontainer-stopevent', 'div',['wfst-container','ol-control','ol-collapsed']);\n let dragBar = createNode('.wfst-container','div',['wfst-container-dragbar']);\n\n originLayers.forEach(function(layer) {\n let layerId = layer.ol_uid;\n let parentNode = document.querySelector(`.layer-li-${layerId} .layermanager-item-container`);\n let editButton = document.createElement('div');\n editButton.classList.add(`edit-filler`, `input-edit-${layerId}`);\n parentNode.insertBefore(editButton, parentNode.firstChild);\n\n if (Array.isArray(layer.values_.wfstEdit)){\n let editFields = layer.values_.wfstEdit[0];\n let editButtons = layer.values_.wfstEditTypes;\n editButton.classList.add(`layer-edit-button`);\n editButton.classList.remove(`edit-filler`);\n let layerOptions = {\n title: layer.values_.title + '_wfs',\n url: layer.getSource().getUrl().replace(/wms/g,'wfs'),\n options: {\n format: 'wfs',\n version: \"1.1.0\",\n featureNS: 'http://www.nieuwegein.nl',\n featureTypes: [layer.getSource().params_.LAYERS.split(':')[1]],\n style: {\n stroke: {\n width: 1.5,\n color: 'rgba(132,46,147,0.8)',\n },\n fill: {\n color: '#842e934d',\n },\n image: ({\n radius: 7,\n fill: new Fill({\n color: '#842e934d'\n }),\n stroke: new Stroke ({\n width: 1.5,\n color: 'rgba(132,46,147,0.8)',\n }),\n }),\n },\n url: layer.getSource().getUrl().replace(/wms/g,'wfs'),\n //filter: andFilter (likeFilter('PROJECTCODE','RD%','%'),equalToFilter('JAAR','2018')),\n visible: false,\n zIndex: 5,\n editFields: editFields,\n editButtons: editButtons,\n },\n };\n\n let wfsLayer = createLayer(layerOptions, 'wfs');\n\n wfsLayer.values_.orgLayerID = layerId;\n layer.values_.wfsLayerID = wfsLayer.ol_uid;\n layerArray.push(wfsLayer);\n\n editButton.addEventListener('click', function() {\n editLayer(layer,editButton);\n });\n\n createNode('.wfst-container','div',['layer-wfst', `wfst-${wfsLayer.ol_uid}`, 'ol-collapsed']);\n createNode(`.wfst-${wfsLayer.ol_uid}`,'div',['wfst-button-container', `button-container-${wfsLayer.ol_uid}`]);\n let saveButton = createNode(`.button-container-${wfsLayer.ol_uid}`,'button',['wfst-button','wfst-button-save',`button-save-${wfsLayer.ol_uid}`],`Opslaan`);\n let deleteButton = createNode(`.button-container-${wfsLayer.ol_uid}`,'button',['wfst-button','wfst-button-delete',`button-delete-${wfsLayer.ol_uid}`],`Verwijder`);\n let cancelButton = createNode(`.button-container-${wfsLayer.ol_uid}`,'button',['wfst-button','wfst-button-cancel',`button-cancel-${wfsLayer.ol_uid}`],`Annuleer`);\n let modifyButton = createNode(`.button-container-${wfsLayer.ol_uid}`,'button',['wfst-button','wfst-button-modify',`button-modify-${wfsLayer.ol_uid}`],`Wijzig geometrie`);\n let wfstBody = createNode(`.wfst-${wfsLayer.ol_uid}`,'div',[`wfst-body-${layerId}`,'wfst-body']);\n let wfstContent = `<div class='wfst-title'><p>Wijzigen ${layer.values_.title}</p></div>`;\n\n for (let key in editFields) {\n //console.log(editFields)\n let disabled = editFields[key].DISABLED !== undefined ? 'disabled' : '';\n let val = editFields[key].VALUE !== undefined ? editFields[key].VALUE : '';\n if (editFields[key].TYPE.toLowerCase() === 'id') {\n\n wfstContent += `<br><input class=\"wfst-input-id\" name=\"${key}\" type=\"text\" value=\"${val}\"></label>`;\n } else if (editFields[key].TYPE.toLowerCase() === 'text') {\n wfstContent += `<br><label class=\"wfst-item\"><span class=\"wfst-item-title\">${editFields[key].TITLE}:</span><input class=\"wfst-input-text\" name=\"${key}\" type=\"${editFields[key].TYPE}\" value=\"${val}\" ${disabled}></label>`;\n } else if (editFields[key].TYPE.toLowerCase() === 'textarea') {\n wfstContent += `<br><label class=\"wfst-item\"><span class=\"wfst-item-title\">${editFields[key].TITLE}:</span><textarea class=\"wfst-input-textarea\" name=\"${key}\" ${disabled}>${val}</textarea></label>`;\n } else if (editFields[key].TYPE.toLowerCase() === 'checkbox') {\n wfstContent += `<br><div class=\"wfst-checkbox-container\"><span class=\"wfst-item-title\">${editFields[key].TITLE}: </span>`;\n for (let z=0;z<editFields[key].OPTIONS.length;z++) {\n editFields[key].OPTIONS[z].isnull === true ? editFields[key].OPTIONS[z].value += '__isnull' : false;\n let sel = editFields[key].OPTIONS[z].selected === true ? 'checked' : '';\n wfstContent += `<label class=\"wfst-checkbox-label\">${editFields[key].OPTIONS[z].title}: <input type=\"checkbox\" class=\"wfst-input-checkbox\" name=\"${key}\" value=\"${editFields[key].OPTIONS[z].value}\" ${sel}></label>`;\n }\n wfstContent += `</div>`;\n } else if (editFields[key].TYPE.toLowerCase() === 'select') {\n wfstContent += `\n <br><div class=\"wfst-item\">\n <span class=\"wfst-item-title\">${editFields[key].TITLE}: </span>\n <select class=\"wfst-input-select\" name=\"${key}\">`;\n for (let z=0;z<editFields[key].OPTIONS.length;z++) {\n editFields[key].OPTIONS[z].isnull === true ? editFields[key].OPTIONS[z].value += '__isnull' : false;\n let sel = editFields[key].OPTIONS[z].selected === true ? 'selected' : '';\n wfstContent += `<option value=\"${editFields[key].OPTIONS[z].value}\" ${sel}>${editFields[key].OPTIONS[z].title}</option>`;\n }\n wfstContent += `</select></div>`;\n } else if (editFields[key].TYPE.toLowerCase() === 'element') {\n wfstContent += editFields[key].CONTENT;\n }\n\n }\n\n wfstBody.innerHTML = wfstContent;\n saveButton.addEventListener('click', function () {\n saveEdits(wfsLayer, saveButton);\n });\n deleteButton.addEventListener('click', function () {\n deleteFeature(wfsLayer, deleteButton);\n });\n cancelButton.addEventListener('click', function () {\n cancelEdits(wfsLayer, cancelButton);\n });\n modifyButton.addEventListener('click', function () {\n modifyGeometry(wfsLayer, modifyButton);\n });\n }\n });\n layerArray.forEach(layer => GeoApp.map.addLayer(layer));\n // Add a dragbar to the wfst container\n dragElement(dragBar);\n}", "title": "" }, { "docid": "22ab16a77d6b8dac54fe06d37fe18617", "score": "0.5211425", "text": "function createMap(stationMarkers) {\r\n // Create the tile layer that will be the background of our map\r\n var lightmap = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\r\n attribution: \"Map data &copy; <a href='https://www.openstreetmap.org/'>OpenStreetMap</a> contributors, <a href='https://creativecommons.org/licenses/by-sa/2.0/'>CC-BY-SA</a>, Imagery © <a href='https://www.mapbox.com/'>Mapbox</a>\",\r\n maxZoom: 16,\r\n id: \"mapbox.light\",\r\n accessToken: API_KEY\r\n });\r\n\r\n // Create a baseMaps object to hold the lightmap layer\r\n var baseMaps = { \"Light Map\": lightmap };\r\n\r\n // Create an overlayMaps object to hold the bikeStations layer\r\n var overlayMaps = { \"Gas Stations\": stationMarkers };\r\n\r\n // Create the map object with options\r\n var map = L.map(\"map\", {\r\n center: [Coordenadas[1], Coordenadas[0]],\r\n zoom: 10,\r\n layers: [lightmap, stationMarkers]\r\n });\r\n \r\n // Create a layer control, pass in the baseMaps and overlayMaps. Add the layer control to the map\r\n L.control.layers(baseMaps, overlayMaps, {\r\n collapsed: false\r\n }).addTo(map);\r\n }", "title": "" }, { "docid": "76edf2c9bfb4957a9fe7ba0da92fc92d", "score": "0.5206137", "text": "function createLayer(layer) {\n return function(dispatch) {\n socket.emit('create-layer', layer, function(data) {\n if(data.type == \"error\") {\n dispatch({\n type: ERROR,\n message: data.message\n });\n } else {\n dispatch({\n type: LAYER_CREATED,\n layer: data.data\n });\n }\n });\n }\n}", "title": "" }, { "docid": "933e9e544925dfbecafbf250afeb5a92", "score": "0.51951", "text": "function addToView(layer) {\n view.map.add(layer);\n}", "title": "" }, { "docid": "81e3c2641f6d85ffa8ad64538028c3d4", "score": "0.51881796", "text": "function start(shape) {\n\n // crea mappa e centrala\n var center = [45.46, 9.19];\n var map = L.map('map').setView(center, 11)\n\n // agiungi tiles\n L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {\n attribution: '&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\n }).addTo(map)\n\n // aggiungi poligono\n L.polygon(shape, {\n fill: false\n }).addTo(map)\n\n}", "title": "" }, { "docid": "583ee7667622b116bde23b71fb18b3e4", "score": "0.51761526", "text": "function createMap() \n{ \n\tvar level = 0; \n\tif (g_res != null) { \n\t\tlevel = TGetLevelByResolution(g_res); \n\t} \n\telse { \n\t\tlevel = g_level; \n\t} \n \n\tvar uri = document.URL.split(\"#\")[1]; \n if( uri ) { \n\t var params = readUriParams(uri); \n\t var lat = params.coordinate[0]; \n var long = params.coordinate[1]; \n level = params.lvl; \n } \n \n\tvar main = document.getElementById(\"mainContent\"); \n\tvar width = main.scrollWidth - 240; \n\tvar height = main.scrollHeight; \n \n\tvar mapContainer = document.getElementById(\"centerMap\"); \n\tmapContainer.style.width = width + \"px\"; \n\tmapContainer.style.height = height + \"px\"; \n map0 = new tf.apps.GeoCloud.App({ fullURL: window.location.href, container: mapContainer}); \n\t//map0 = new TMap(mapContainer, lat || g_lat, long || g_lon, level, on_mapLoad, 0, true, g_engine, g_type); \n}", "title": "" }, { "docid": "1ee5310482fdc135c40222ecd2ef5069", "score": "0.5173819", "text": "function add_to_layer(obj) {\r\n var layerList = document.getElementById('left');\r\n var layerType, checked = \"\";\r\n if (!obj.selectable) checked = \"checked\";\r\n if (obj.type == \"image\") layerType = '<i class=\"fa fa-picture-o layerType\" aria-hidden=\"true\"></i>' + obj.src;\r\n else if (obj.type == \"i-text\") layerType = '<i class=\"fa fa-font layerType\" aria-hidden=\"true\"></i>' + obj.text;\r\n var layerDiv = document.createElement(\"div\");\r\n layerDiv.innerHTML = '<div class=\"layerInfo\">' + \"<a>\" + layerType + '</a></div><div class=\"layerOptions\"><label class=\"smallBtn layerLockBtn ' + checked + '\"><i class=\"fas fa-lock\" aria-hidden=\"true\"></i><input type=\"checkbox\" class=\"layer-lock-toggle\" ' + checked + '></label><a class=\"smallBtn delete\"><strong>Delete</strong></a></div>';\r\n // layerDiv.innerHTML = '<div class=\"layerInfo\">' + \"<a>\" + layerType + '</a></div><div class=\"layerOptions\"><i class=\"fas fa-lock\" aria-hidden=\"true\"></i><a class=\"smallBtn delete\"><strong>Delete</strong></a></div>';\r\n layerDiv.setAttribute('class', 'layer flex space-between');\r\n layerList.prepend(layerDiv);\r\n // layerList.innerHTML = \"<div class=\\\"layer\\\">\" + layerName + \"</div>\" + layerList.innerHTML;\r\n}", "title": "" }, { "docid": "8e8ada75512f7e26e6781a495882c85a", "score": "0.51725006", "text": "buildLayers(){\r\n this.layers = []\r\n this.topology.forEach(layer => this.layers.push([]))\r\n \r\n this.topology.forEach((layerSize, iLayer) => {\r\n let layer = this.layers[iLayer],\r\n prevLayer = this.layers[iLayer - 1] || undefined,\r\n nextLayer = this.layers[iLayer + 1] || undefined\r\n \r\n for (let i of Array(layerSize).keys()){\r\n layer.push(new Neuron(prevLayer, nextLayer, layer, \"\"+iLayer+i))\r\n }\r\n \r\n let neuronBias = new Neuron(prevLayer, nextLayer, layer, \"\"+iLayer+(layer.length) )\r\n neuronBias.isBias = true\r\n neuronBias.outputVal = 1\r\n \r\n layer.push(neuronBias)\r\n })\r\n \r\n this.layers\r\n .slice(0,this.layers.length - 1)\r\n .forEach(layer => {\r\n layer.forEach(neuron => neuron.buildConnections())\r\n })\r\n }", "title": "" }, { "docid": "38ed56a03805eb721eb924807137e240", "score": "0.5153066", "text": "function addLayerWMS(name, layer)\n{\n return new OpenLayers.Layer.WMS( name, geoIpAddress+\"/geoserver/wms\",\n {layers: layer,\n transparent: \"true\",\n height: '478',\n width: '512'}, {isBaseLayer: false,singleTile: true, ratio: 1,opacity: 0.60});\n}", "title": "" }, { "docid": "85d8d7524c53b405b23158679a225732", "score": "0.5152039", "text": "addPlace(x, y) {\n const place = { x: x, y: y, empty: true };\n\n this.map.push(place);\n }", "title": "" }, { "docid": "526b20a045c57045bda0f2c0c6eb6023", "score": "0.51502854", "text": "function makeCentralPolygon(){\r\n\r\n\t// Get map info based on current location\r\n\tbounds = map.getExtent();\r\n\r\n\t// Scale the window extent to the central part\t\r\n\tvar size = 0.3;\r\n\tvar lngSpan = (bounds.left - bounds.right) * size;\r\n\tvar latSpan = (bounds.top - bounds.bottom) * size;\r\n\t\r\n\t// Create new bounds\r\n\tvar newBounds = bounds\r\n\tnewBounds.left = bounds.left - lngSpan\r\n\tnewBounds.bottom = bounds.bottom + latSpan\r\n\tnewBounds.right = bounds.right + lngSpan\r\n\tnewBounds.top = bounds.top - latSpan\r\n\r\n\t// Create the polygon\r\n\tvar tagBox = new OpenLayers.Feature.Vector(newBounds.toGeometry());\t\r\n\tcurrentLayer.addFeatures(tagBox);\r\n}", "title": "" }, { "docid": "0ad0e99512928a5e99aa6364a4f3870a", "score": "0.5149109", "text": "function createMap(mapReq, callback){\n\tvar createMapError = undefined;\n\tvar map = new mapnik.Map(mapReq.width, mapReq.height);\n\tmap.loadSync(config.styles)\n\tmap.srs = '+init=' + mapReq.srs;\n\n\tfor(var index in mapReq.layers){\n\t\tvar layerName = mapReq.layers[index];\n\t\tif(WMSlayers.hasOwnProperty(layerName)){\n\t\t\tvar layerToAdd = createMapLayer(layerName, mapReq.styles[index]);\n\t\t\tif(layerToAdd.styles.length > 0){\n\t\t\t\tmap.add_layer(layerToAdd);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcreateMapError = 'StyleNotDefined'\n\t\t\t\tcallback(createMapError);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tcreateMapError = 'LayerNotDefined'\n\t\t\tcallback(createMapError);\n\t\t\treturn;\n\t\t}\n\t}\n\tif(bboxIsValid(mapReq.bbox)){\n\t\tmap.zoomToBox(mapReq.bbox);\n\t}\n\telse{\n\t\tcreateMapError = 'InvalidBBox'\n\t\tcallback(createMapError);\n\t\treturn;\n\t}\n\tcallback(createMapError, map);\n}", "title": "" }, { "docid": "0796c381b019e8badc6665c6664cd84f", "score": "0.51488626", "text": "makeRouteLayer() {\n const newRouteSettings = {\n ...ROUTE_LAYER_CONFIG,\n };\n newRouteSettings.source.geometry.coordinates = [\n ...this.state.routeLayerCoordinates,\n ];\n return newRouteSettings;\n }", "title": "" }, { "docid": "407f112692c90dcf73ad02e4143700f5", "score": "0.51482254", "text": "function addWMSLayer()\n{\n\t//Get Selected Layer\n\tvar selLayer = '';\n\tvar elements = document.getElementsByName('rbGroup');\n\tfor(elemIndex = 0 ; elemIndex < elements.length; elemIndex++)\n\t{\n\t\tvar element = elements[elemIndex];\n\t\tif(element.checked)\n\t\t{\n\t\t\tselLayer = element.value;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t//INitialize the WMS Layer with the default dimension values\n\twmsLayer.initializeDimensionParams(selLayer);\n\tmap.addLayer(wmsLayer);\n\t\n \n //Get Dimension Values from WMS Layer\n var dimensions = wmsLayer.getDimensions();\n \n if(dimensions.length > 2)\n \talert(\"More than two dimensions represented within WMS Service. Only the \\\"time\\\" and one other dimension can be represented\");\n \n timeDim = '';\n nDim = '';\n for(index = 0; index < dimensions.length; index++)\n {\n \tvar dim = dimensions[index];\n \tif(dim.indexOf(\"time\") != -1 || dim.indexOf(\"date\") != -1 )\n \t\ttimeDim = dim;\n \telse\n \t\tnDim = dim;\n }\n \n require([\"dojo/dom-style\"], function(domStyle){\n //Only show the Time/Event Slider when there is a time dimension\n if(timeDim != '')\n {\n \tif(eventSliderOb == null)\n \t{\n \t\teventSliderOb = new EventSlider();\n \t\tdocument.addEventListener(\"EventSliderDateChanged\",updateMapTime,false);\n \t}\n \n \tvar timeValues = wmsLayer.getDimensionValues(timeDim);\n \teventSliderOb.setTimeField(timeDim);\n \teventSliderOb.setTimeSlices(timeValues);\n \teventSliderOb.generateChart();\n \t\n \t//Show the Event Slider.\n \tvar footerElem = document.getElementById('footer');\n \tfooterElem.style.visibility = 'visible';\n }\n \n //Only show the n Dim Slider when there is a dimension other than time\n if(nDim != '')\n {\n \tif(dimSliderOb == null)\n \t{\n \t\tdimSliderOb = new nDimSlider();\n \t\tdocument.addEventListener(\"DimSliderDateChanged\",updateDimension,false);\n \t}\n \tvar dimValues = wmsLayer.getDimensionValues(nDim);\n \t\n \tvar dimParams = wmsLayer.getDimensionProperties(nDim);\n \tdimSliderOb.setDimensionField(nDim);\n \tdimSliderOb.setDimensionUnits(dimParams.units);\n \tdimSliderOb.setDefaultValue(dimParams.defaultValue);\n \t\n \t//We want to check if it's a depth value, because then the dim slider inverses the values'\n \tvar isDepthValue = false;\n \tif(nDim.toLowerCase().indexOf('depth') != -1)\n \t\tisDepthValue = true;\n \t\t\n \tdimSliderOb.setSlices(dimValues,isDepthValue);\n \tdimSliderOb.createDimensionSlider();\n \t\n \t//Show the Dimension Slider.\n \tvar leftChartElem = document.getElementById('leftChart');\n \t\tleftChartElem.style.visibility = 'visible';\n }\n\t\n\t\t//We want to make sure that the current time is shown\n\t updateMapTime();\n \n \t//Now that the application is fully loaded, we can hide the load form.\n \tvar spashConElem = document.getElementById('splashCon');\n \t\tdomStyle.set(spashConElem, 'display', 'none');\n\t});\n}", "title": "" }, { "docid": "3d8687aaa2cfd755995835cbc20d22f1", "score": "0.5148064", "text": "function drawAllBuses(){\n map.on(\"load\", function(){\n console.log(\"adding buses\");\n\n console.log(cta);\n map.addSource(\"Bus Routes\", {\n \"type\":\"geojson\",\n \"data\":cta});\n\n console.log(\"layer\");\n\n map.addLayer({\n \"id\": \"Bus Routes\",\n \"type\": \"line\",\n \"source\": \"Bus Routes\",\n \"layout\": {\n \"line-join\": \"round\",\n \"line-cap\": \"butt\"\n },\n \"paint\": {\n \"line-color\": \"#31a354\",\n \"line-width\": 4,\n \"line-opacity\": 0.4\n }\n });\n });\n}", "title": "" }, { "docid": "f51fd7e78238fe618b160416d991474b", "score": "0.51476824", "text": "function createMap(earthquakes, faultLines) {\n // Define outdoors, satellite, and darkmap layers\n // Outdoors layer\n var outdoors = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/outdoors-v10/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoidGhpc2lzY2MiLCJhIjoiY2poOWd1azk5MGNrZzMwcXA4cGxna3cxMCJ9.KqWFqxzqclQp-3_THGHiUA\");\n // Satellite layer\n var satellite = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoidGhpc2lzY2MiLCJhIjoiY2poOWd1azk5MGNrZzMwcXA4cGxna3cxMCJ9.KqWFqxzqclQp-3_THGHiUA\");\n // Darkmap layer\n var darkmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/dark-v9/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoidGhpc2lzY2MiLCJhIjoiY2poOWd1azk5MGNrZzMwcXA4cGxna3cxMCJ9.KqWFqxzqclQp-3_THGHiUA\");\n\n // Define a baseMaps object to hold base layers\n var baseMaps = {\n \"Outdoors\": outdoors,\n \"Satellite\": satellite,\n \"GrayScale\": darkmap,\n };\n\n // Create overlay object to hold overlay layers\n var overlayMaps = {\n \"Earthquakes\": earthquakes,\n \"Fault Lines\": faultLines\n };\n\n // Create map, default settings: outdoors and faultLines layers display on load\n var map = L.map(\"map\", {\n center: [37.09, -95.71],\n zoom: 4,\n layers: [outdoors, earthquakes],\n scrollWheelZoom: false\n });\n\n // Create a layer control\n // Pass in baseMaps and overlayMaps\n // Add the layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(map);\n\n // Adds Legend\n var legend = L.control({position: 'bottomright'});\n legend.onAdd = function(map) {\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5],\n labels = [\"0-1\", \"1-2\", \"2-3\", \"3-4\", \"4-5\", \"5+\"];\n\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML += '<i style=\"background:' + chooseColor(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n };\n\n return div;\n };\n legend.addTo(map);\n\n }", "title": "" }, { "docid": "1aa8e347d9af5cdb8e5605d965829926", "score": "0.5145145", "text": "function createMap(){\r\n\r\n //create the map\r\n map = L.map('map', {\r\n center: [0, 0],\r\n zoom: 2\r\n });\r\n\r\n //add OSM base tilelayer\r\n L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\r\n attribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap contributors</a>'\r\n }).addTo(map);\r\n\r\n //call getData function\r\n getData(map);\r\n}", "title": "" }, { "docid": "c663eefaa0147bc66af2b68249febf3a", "score": "0.5143647", "text": "function createMap(){\n\n //create the map\n map = L.map('map', {\n center: [0, 0],\n zoom: 2\n });\n\n //add OSM base tilelayer\n L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap contributors</a>'\n }).addTo(map);\n\n //call getData function\n getData(map);\n}", "title": "" }, { "docid": "1902884c4cf3e0554471440d6baca581", "score": "0.5141854", "text": "function createFeatures(earthquakeData) {\n \n function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }\n\n // Read GeoJSON data, create circle markers, and add to earthquake layer group\n L.geoJSON(earthquakeData, {\n pointToLayer: function (feature, latlng) {\n return L.circleMarker(latlng, {\n radius: feature.properties.mag * 5,\n fillColor: chooseColour(feature.properties.mag),\n color: \"black\",\n weight: 0.5,\n opacity: 0.5,\n fillOpacity: 0.8\n });\n },\n onEachFeature: onEachFeature\n }).addTo(earthquakes);\n\n // Define street map layer\n var streetmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox/streets-v11\",\n accessToken: API_KEY\n });\n\n // Define satellite map layer\n var satellitemap = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors,\\\n <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.satellite\",\n accessToken: API_KEY\n });\n\n // Define outdoors map layer\n var outdoorsmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/outdoors-v9/tiles/256/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors,\\\n <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox/outdoors\",\n accessToken: API_KEY\n });\n\n // define greyscale map layer\n var lightmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/light-v9/tiles/256/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors,\\\n <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.light\",\n accessToken: API_KEY\n });\n\n // Define the baseMaps for the map types we created above\n var baseMaps = {\n \"Street Map\": streetmap,\n \"Satellite Map\": satellitemap,\n \"Outdoors Map\": outdoorsmap,\n \"Greyscale Map\": lightmap\n };\n\n // Read the tectonic Plate GeoJSON from the source URL, and add to faultLines layer group\n d3.json(\"https://raw.githubusercontent.com/fraxen/tectonicplates/master/GeoJSON/PB2002_boundaries.json\",\n function(platedata) {\n L.geoJson(platedata, {\n color: \"orange\",\n weight: 2\n }).addTo(faultLines);\n });\n\n // Create a new map\n var myMap = L.map(\"map\", {\n center: [\n 48.10, -100.10\n ],\n zoom: 3,\n layers: [streetmap, earthquakes, faultLines]\n });\n\n // create overlay map with the 2 data layers\n var overlayMaps = {\n \"Earthquakes\": earthquakes,\n \"Fault Lines\": faultLines,\n };\n\n // Add a layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n\n // function to set the earthquake circle size based on value of mag (magnitude)\n function chooseColour(mag) {\n if (mag > 5) {\n return \"red\";\n }\n else if (mag > 4){\n return \"orangered\";\n }\n else if (mag > 3){\n return \"orange\";\n }\n else if (mag > 2){\n return \"gold\";\n }\n else if (mag > 1){\n return \"yellow\"\n }\n else {\n return \"greenyellow\";\n }\n }\n\n // Create the legend control and set its position\n var legend = L.control({\n position: \"bottomright\"\n });\n\n // function to assign values to the legend, as well as color boxes (see style.css file)\n legend.onAdd = function (myMap) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5],\n labels = [];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + chooseColour(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n return div;\n };\n // add the legend to the map\n legend.addTo(myMap);\n\n}", "title": "" }, { "docid": "9dcf1201a50bee0973f488fc1be16f98", "score": "0.5139899", "text": "function createLayer(name) {\n return L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 20,\n id: \"mapbox.\" + name,\n accessToken: API_KEY\n });\n}", "title": "" }, { "docid": "97ac73d3a5c1af246083016cc23b1208", "score": "0.5139587", "text": "function AddMapOverlays() { try { LoadPoliticalBoundaries(); LoadSoilsService(); } catch (e) { HiUser(e, \"AddMapOverlays\"); } }", "title": "" }, { "docid": "14561bc4cdd69d145ffa23ca3fad3532", "score": "0.51361716", "text": "addMap() {\n const {createMap} = this.props;\n\n let bounds = {\n north: this.state.bounds.north === '' ? undefined : parseFloat(this.state.bounds.north),\n south: this.state.bounds.south === '' ? undefined : parseFloat(this.state.bounds.south),\n east: this.state.bounds.east === '' ? undefined : parseFloat(this.state.bounds.east),\n west: this.state.bounds.west === '' ? undefined : parseFloat(this.state.bounds.west),\n centerLat: this.state.bounds.centerLat === '' ? undefined : parseFloat(this.state.bounds.centerLat),\n centerLon: this.state.bounds.centerLon === '' ? undefined : parseFloat(this.state.bounds.centerLon),\n range: this.state.bounds.range === '' ? undefined : parseFloat(this.state.bounds.range),\n scale: this.state.bounds.scale === '' ? undefined : parseFloat(this.state.bounds.scale)\n };\n\n let blankBounds = true;\n for (let prop in bounds) {\n if (typeof bounds[prop] !== 'undefined') {\n blankBounds = false;\n break;\n }\n }\n if (blankBounds) {\n bounds = undefined;\n }\n\n createMap(bounds, this.state.engineId === '' ? undefined : this.state.engineId,\n false, this.state.recorder, parseInt(this.state.brightness), parseInt(this.state.midDistanceThreshold),\n parseInt(this.state.farDistanceThreshold));\n }", "title": "" }, { "docid": "89959ec2f3b5cc3814e6bc91d3cbd37d", "score": "0.51310265", "text": "addUserParcelsLayer(layerURL) {\n var user = this.get('parcels.user');\n var _this = this;\n\n // Symbol for painting parcels\n var symbol = this.get('userParcelSymbol');\n var querySentence = \"\";\n\n // Common online and offline FeatureLayer creator and injector\n function createAndAddFL(layerReference, event) {\n var featureLayer = new FeatureLayer(layerReference, {\n model: FeatureLayer.MODE_SNAPSHOT,\n outFields: ['PARCEL_ID'],\n definitionExpression: querySentence\n });\n\n featureLayer.setSelectionSymbol(symbol);\n\n var readyEvent = featureLayer.on(event, () => {\n\n // Draw parcels, and if online, store layer\n drawOwnerParcels(featureLayer, symbol, _this.get('parcelsGraphics'), user);\n if (navigator.onLine) {\n _this.storeUserParcelsLayer();\n }\n\n // Each time map is being panned, draw parcels\n var drawEvent = _this.get('map').on('pan-end', () => {\n Ember.run.once(_this, () => {\n drawOwnerParcels(featureLayer, symbol, _this.get('parcelsGraphics'), user);\n\n // And if online, store layer\n if (navigator.onLine) {\n _this.storeUserParcelsLayer();\n }\n });\n });\n _this.set('drawEvent', drawEvent);\n\n readyEvent.remove();\n });\n\n _this.get('layersMap').set('userParcelsLayer', featureLayer);\n _this.get('map').addLayer(featureLayer);\n }\n\n // Query, to gather only user parcels from the FeatureLayer service\n this.get('parcels.user.parcels').then((parcels) => {\n var userParcels = parcels.map((parcel) => parcel.get('parcelId').toUpperCase());\n\n for (var i = 0; i < userParcels.length - 1; i++) {\n querySentence += \"PARCEL_ID = '\" + userParcels[i] + \"' or \";\n }\n querySentence += \"PARCEL_ID = '\" + userParcels[userParcels.length - 1] + \"'\";\n\n if (navigator.onLine) {\n createAndAddFL(layerURL, 'update-end');\n } else {\n this.get('editStore').getFeatureLayerJSON(function (success, featureLayer) {\n if (success) {\n Ember.debug('usersParcelLayer loaded successfully from the storage');\n createAndAddFL(featureLayer, 'resume');\n }\n });\n }\n });\n }", "title": "" }, { "docid": "38fd8641847c8f4888a85aa5da721f08", "score": "0.51300085", "text": "function addMap() {\n\n routesFeature = L.featureGroup();\n\n\n L.tileLayer(\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\", {\n maxZoom: 18,\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors\",\n id: \"osm\"\n }).addTo(map); //ad a background Layer to the Map\n\n\n //Show coordinates by Click of the Map\n map.on('click', function (e) {\n var popLocation = e.latlng;\n var popup = L.popup()\n .setLatLng(popLocation)\n .setContent(\"You clicked at \" + popLocation)\n .openOn(map);\n });\n\n $(\"#mapdiv\")[0].style.visibility = \"visible\";\n}", "title": "" }, { "docid": "21f974cde481bedca35a1a658a5b4591", "score": "0.5129018", "text": "function createFeatures(flightData) { \n\n // Create a GeoJSON layer containing the features array on the flightData object\n // Run the onEachFeature function once for each piece of data in the array\n var flights = L.geoJson(flightData, {\n onEachFeature: function (feature, layer){\n layer.bindPopup(\"<h3>\" + feature.properties.callsign +\n \"</h3><hr><p>\" + \"ICAO24: \"+ feature.properties.icao24 + \"</p>\");\n },\n pointToLayer: function (feature, latlng) {\n return new L.circle(latlng,\n {radius: 5000,\n fillColor: '#f03',\n fillOpacity: 0.5,\n stroke: true,\n color: \"red\",\n weight: 1\n })\n }\n });\n \n // Sending our flight layer to the createMap function\n createMap(flights)\n }", "title": "" }, { "docid": "bc4b17bfc1dd7d4cd8c47fb0eea42526", "score": "0.5123854", "text": "function createBuilding( location_in ) {\n createMarker( location_in, buildingIndex );\n}", "title": "" } ]
0bb25ec922ea4f461ef061919ed729e9
/ Angry Kim Jong Il
[ { "docid": "3141ceedafb1da7a304d1fc6bf4ae672", "score": "0.5986268", "text": "function angryKim(){\n\tkimJongIl.leftBrow.stop().animate(kimJongIl.angryLeftBrow[+(browsCounter = !browsCounter)],500,'bounce');\n\tkimJongIl.rightBrow.stop().animate(kimJongIl.angryRightBrow[+(browsCounter = browsCounter)],500,'bounce');\n\tkimJongIl.face.animate(faceAnimate)\n\tkimJongIl.mouth.animate({'stroke-width':'15'},2000,'ease',function(){\n\t\tkimJongIl.loseSpeech.animate({'transform':'t-300 0'},300,'backOut',function(){\n\t\t\tgrenade(kimJongIl);\n\t\t});\n\t\t\n\t});\n\t\n\n\t\n}", "title": "" } ]
[ { "docid": "b0130c1d819c1520452910568a84803e", "score": "0.6476099", "text": "function sadface(){\n var sad = {\n 0:\" ( ;-;)\", 1:\" (╥﹏╥)\", 2:\" ( ༎ຶ ⌑ ༎ຶ )\",\n 3:\" 。゚・(>﹏<)・゚。\", 4:\" ๐·°(৹˃̵﹏˂̵৹)°·๐\", 5:\" (◞‸◟)\",\n 6:\" (◢ д ◣)\", 7:\" (・´з`・)\", 8:\" (o´_`o)\",\n 9:\" ( ≧Д≦)\", 10:\" (✖╭╮✖)\", 11:\" (︶︹︺)\",\n 12:\" ((´д`))\", 13:\" (▰˘︹˘▰)\", 14:\" (Θ︹Θ)ს\",\n 15:\"ヽ(●゚´Д`゚●)ノ゚\", 16:\" (๑´╹‸╹`๑)\", 17:\" (⌯˃̶᷄ ﹏ ˂̶᷄⌯)\",\n 18:\"((●´∧`●))\", 19:\" (◞‸◟;)\",\n }\n return sad[Math.floor(Math.random() * 20)].replace(/ /g,'\\xa0');\n}", "title": "" }, { "docid": "8cc76d222096c73d10c689bf22a37605", "score": "0.62677383", "text": "function hungry(hunger){\n \nreturn hunger <= 5 ? 'Grab a snack': 'Sit down and eat a meal';\n}", "title": "" }, { "docid": "aeb09e2417e643d075524e503f203652", "score": "0.6124496", "text": "function wordBanks(myNoun, myAdjective, myVerb, myAdverb) {\n let result = \"\";\n result += \"The \" + myAdjective+ \" \" + myNoun+ \" \" + myVerb + \" at the Store \" + myAdverb;\n return result; \n}", "title": "" }, { "docid": "f48e4268fdaea794ca5299b494468b09", "score": "0.6102896", "text": "function madLibs(occupation, transportVerb, adverb, adjective, animal, presentTenseVerb, adjective2) {\n\"The \"+occupation+\" \"+transportVerb+\" on his/her way to the church very \"+adverb+\". The surrounding crowd could not believe he/she would do so on such a/an \"+adjective+\" day. Meanwhile, across the street, an \"+animal+\" was \"+presentTenseVerb+\". It was truly a/an \"+ adjective2 +\" sight to see\"\n}", "title": "" }, { "docid": "b348b52f0d2d82ff1a63da2d26dcfd8e", "score": "0.6039128", "text": "function theFirstOrderAttacks() {\n //the First Order captures Poe! move him to the Star Destroyer\n //BB-8 escapes to the Scavenger Camp -- move it there\n //the First Order destroys all the peace-loving web developers in the Small Village -- wipe it off the map\n\n}", "title": "" }, { "docid": "5ef676db25decd70d3ac4a1f2c004727", "score": "0.6025192", "text": "function rinkuBirthdy()\r\n {\r\n \r\n console.log(\"Happy Birthday Rinku\")\r\n }", "title": "" }, { "docid": "5ef676db25decd70d3ac4a1f2c004727", "score": "0.6025192", "text": "function rinkuBirthdy()\r\n {\r\n \r\n console.log(\"Happy Birthday Rinku\")\r\n }", "title": "" }, { "docid": "8aafcd521df522daa8adab9d470567c0", "score": "0.59954965", "text": "function whosACuteKitty (name) {\n return name + ' is a cute kitty.';\n}", "title": "" }, { "docid": "476985d88858c60e32316f9fd0a00f1f", "score": "0.5995384", "text": "function knapp () {\n var ord= [\"admiral\",\"aften\",\"akt\",\"altan\",\"anorakk\",\"aroma\",\"arr\",\"asjett\",\"asparges\",\"asyl\",\"atlas\",\"atom\",\"avl\",\"avløp\",\"balje\",\"balkong\",\"ball\",\"ballett\",\"balsam\"\n ,\"bamse\",\"banan\",\"banjo\",\"bark\",\"barm\",\"barsel\",\"bart\",\"basseng\",\"bast\",\"bataljon\",\"batteri\",\"daddel\",\"dam\",\"dåre\",\"degge\",\"deig\",\"dekken\",\"diadem\",\"dill\",\"dilla\",\"diplom\"\n ,\"diplomat\",\"disippel\",\"divan\",\"dobb\",\"egg\",\"eir\",\"eksem\",\"emalje\",\"emblem\",\"entré\",\"eske\",\"etappe\",\"etui\",\"farse\",\"farsott\",\"faster\",\"fatle\",\"fe\",\"feber\",\"fedme\",\"fele\",\"felg\"\n ,\"ferge\",\"fett\",\"fiken\",\"filipens\",\"fille\",\"filtfinger\",\"finne\",\"fjes\",\"frø\",\"frøken\",\"frue\",\"furu\",\"galle\",\"gamasje\",\"gebiss\",\"gelender\",\"gelé\",\"gemytt\",\"genser\",\"gesims\",\"geskjeft\"\n ,\"gikt\",\"gips\",\"gissel\",\"gjedde\",\"gjørme\",\"glans\",\"glasur\",\"glis\",\"glitter\",\"glor\",\"hake\",\"hale\",\"ham\",\"hanske\",\"harpe\",\"harpiks\",\"hassel\",\"havn\",\"hår\",\"hæl\",\"hekk\",\"hems\",\"herpes\"\n ,\"hette\",\"hinne\",\"hjerne\",\"hjul\",\"hode\",\"hoff\",\"igle\",\"iglo\",\"innside\",\"jakke\",\"jakt\",\"jolle\",\"jord\",\"jorde\",\"jurjus\",\"juv\",\"kabal\",\"kabel\",\"kahytt\",\"kajakk\",\"kakkel\",\"kakkerlakk\"\n ,\"kalas\",\"kalkyle\",\"kalv\",\"kammer\",\"kanal\",\"kanne\",\"kanon\",\"kant\",\"kaos\",\"kapers\",\"kapsel\",\"katt\",\"kaviar\",\"kål\",\"lake\",\"laken\",\"lakk\",\"lam\",\"lampe\",\"lampett\",\"lanse\",\"lekter\",\"list\"\n ,\"lo\",\"lomme\",\"los\",\"løve\",\"lugar\",\"lugg\",\"lukt\",\"lunge\",\"lunte\",\"lupe\",\"majones\",\"manesj\",\"mappe\",\"marg\",\"marinade\",\"marmelade\",\"maske\",\"massasje\",\"melk\",\"membran\",\"monter\",\"morfin\"\n ,\"mor\",\"mos\",\"moster\",\"musli\",\"åk\",\"åker\",\"ånd\",\"ånde\",\"åpningåre\"];\n var tall= Math.floor(Math.random()*ord.length);\n var tord= ord[tall];\n document.getElementById(\"tilfeldigord\").innerHTML=tord;\n}", "title": "" }, { "docid": "d6d5e9df2ea43e7a063583b13d320c4d", "score": "0.5992585", "text": "function lux(){\n world.spell('A tiny wisp of light appears out of thin air and illuminates the surroundings');\n}", "title": "" }, { "docid": "d814fc59c50b10bf73d59503312d25f4", "score": "0.5979038", "text": "function wordBlanks(myNoun, myAdjectitive, myVerb, myAdverb)\r\n{\r\n var result = \"\";\r\n result += \"the \" + myAdjectiev + myNoun + myVerb + \" to the store \" + myAdverb;\r\n \r\n return result;\r\n}", "title": "" }, { "docid": "125aed49d5da0c10ae000f88f56ba370", "score": "0.5977761", "text": "function oldScrabbleScorer(word) {\n\tword = word.toUpperCase();\n\tlet letterPoints = \"\";\n \n\tfor (let i = 0; i < word.length; i++) {\n \n\t for (const pointValue in oldPointStructure) {\n \n\t\t if (oldPointStructure[pointValue].includes(word[i])) {\n\t\t\tletterPoints += `Points for '${word[i]}': ${pointValue}\\n`\n\t\t }\n \n\t }\n\t}\n\treturn letterPoints;\n }", "title": "" }, { "docid": "59b4c31370ec5f9cc9d722c1f02c5a60", "score": "0.5956111", "text": "function stayingClassy(gallons,bags){\n return \"Yea, I drank \" + gallons + \" gallons of box wine and ate \" + bags + \" bags of Cheetos and still feel vibrant yo!\";\n}", "title": "" }, { "docid": "2c4296041e62264e873b5b283aeb51e1", "score": "0.59470814", "text": "function mood(){\n\treturn \"I feel like a smiley face emoji!\";\n}", "title": "" }, { "docid": "f9bea1992e555a701fc5d46db932f848", "score": "0.594049", "text": "function randomHappyWord() {\r\n let positivityArray = ['Rad!', 'Cool!', 'Wowee zowee!', 'Gnarly!', 'Nice job!', 'Alright!', 'Great work!'];\r\n return positivityArray[Math.floor(Math.random() * positivityArray.length)];\r\n }", "title": "" }, { "docid": "6dd032478809b869bb06ec32b1d890ae", "score": "0.5929932", "text": "function nuggetizer(animal){\nreturn `${animal} stix`;\n\n}", "title": "" }, { "docid": "38f530182fce02446755d05675e2f361", "score": "0.58955973", "text": "function whatIDontLike(badFood) {\n console.log(\"i don't like \" + badFood);\n}", "title": "" }, { "docid": "3ef5dc3e3ce625a41621a5552a00fd8c", "score": "0.58689964", "text": "function olympicRing(a){\n let lower =\"abdegopq\", upper = \"ABDOPRQ\", count = 0;\n a.split(\"\").forEach(function(e){\n if(lower.includes(e)||upper.includes(e)){\n if(e===\"B\")\n count+=2;\n else\n count+=1; \n }\n });\n count = Math.floor(count/2);\n return count<= 1 ? \"Not even a medal!\" : count === 2 ? \"Bronze!\" : count === 3 ? \"Silver!\" : \"Gold!\";\n}", "title": "" }, { "docid": "f0472c5ae740aadac5ac529ad7751dda", "score": "0.5864391", "text": "function getFullSentence(){\n return getFunnyString() + \", click Open Zoom Meetings.\";\n }", "title": "" }, { "docid": "ed01ac0d46f3d880ecd32399783e03cd", "score": "0.58620906", "text": "function hydePark() {\n\n var message = \"You can't go wrong with kielbasa, knockwurst, bratwurst and a brew.\";\n updateDisplay(message); \n\n updateScore();\n\n }", "title": "" }, { "docid": "d060caf5da8883d0de9135de1ea4ef7b", "score": "0.5860523", "text": "function kata27() {\n\n}", "title": "" }, { "docid": "f7dfdf59366f16fcaf60eb35c95d0b3e", "score": "0.58486784", "text": "function madPerson(red_dog){\n console.log(\"&#@*#%#R#$%%\")\n console.log(red_dog)\n}", "title": "" }, { "docid": "9b3ae61cd68746af359044dec0700c82", "score": "0.5847166", "text": "function jumbleWord(original, scrambled){\n\n // let original = origina.split('');\n // let scrambled = scrambled.split('');\n\n let good = false;\n let poor = false;\n let fair = false;\n let real = false;\n\n //Convert everything to lowercase\n original = original.toLowerCase();\n scrambled = scrambled.toLowerCase();\n\n\n if(isSameWord(original, scrambled)){ //Check for Not\n //Some sort of logging mechanism to log the type of input.\n return \"not\";\n };\n\n\n const testForGood = isGood(original, scrambled);\n const Real = isReal(original, scrambled);\n\n\n if(testForGood && Real){ //Check for Good\n good = true;\n return \"good\";\n } else if(!real & checkPoor){ //Check for Poor\n poor = true;\n return \"poor\";\n } else {\n fair = true;\n return \"fair\"\n }\n\n}", "title": "" }, { "docid": "a30ad79c4465539e3ba1829b0463c8b8", "score": "0.5834109", "text": "specialAtack() {\n return this.simpleAttack + 30;\n }", "title": "" }, { "docid": "3d1526b2da72b38e9823a286668c7969", "score": "0.5822052", "text": "function nonsenseWord() {\n var word = chance.word({syllables: 3});\n return word;\n}", "title": "" }, { "docid": "bbabe22f813f6cccb3434a40e9b12764", "score": "0.5821223", "text": "jogar() {\n this.embaralhar()\n }", "title": "" }, { "docid": "282660eb417369a09a6b87ba840af847", "score": "0.5818791", "text": "function colemanLiau(letters, words, sentences) {\n    return (0.0588 * (letters * 100 / words))\n        - (0.296 * (sentences * 100 / words))\n        - 15.8;\n}", "title": "" }, { "docid": "dbe0963b546833a7cbf8c008b0ded10f", "score": "0.58186036", "text": "function C101_KinbakuClub_RopeGroup_PlayerWhimperLucy() {\n\tif (C101_KinbakuClub_RopeGroup_LucyIsAnnoyed <= 0) {\n\t\tPlayerUngag();\n\t\tActorChangeAttitude( 1, -1)\n\t} else {\n\t\tif (C101_KinbakuClub_RopeGroup_LucyIsAnnoyed >= 2 || ActorGetValue(ActorLove) >= 1) {\n\t\t\tOverridenIntroText = GetText(\"AnnoyedNoUngag\");\n\t\t\tC101_KinbakuClub_RopeGroup_CurrentStage = 640;\n\t\t} else {\n\t\t\tPlayerUngag();\n\t\t\tOverridenIntroText = GetText(\"AnnoyedUngag\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4268dbd32b37dd2d8a398338b809bc8b", "score": "0.58165354", "text": "function grumpus (){\n console.log('ugh.. you again...');\n console.log('for the last time...');\n console.log('LEAVE ME ALONE!!!');\n}", "title": "" }, { "docid": "b2043fae2cc9f0b6bcd823eee2a16a64", "score": "0.5806559", "text": "function hogwartsHouse(attitude){\n\n if (attitude == \"brave\"){\n return \"You're a Griffindor\"; \n }\n else if(attitude == \"studious\"){\n return \"You're a Ravenclaw\";\n }\n else if(attitude == \"loyal\"){\n return \"You're a Hufflepuff\";\n }\n else if(attitude == \"ambitious\"){\n return \"You're a Slytherin\";\n }\n else{\n return \"You're a Muggle\";\n }\n}", "title": "" }, { "docid": "0f10015bdb7b132a8c310e955ac95129", "score": "0.57891196", "text": "function flower(zinEen, zinTwee) {\r\n var sentenceCombi = zinEen + zinTwee;\r\n return sentenceCombi;\r\n}", "title": "" }, { "docid": "6ac205594a802b4c6f358537eaad714d", "score": "0.5788011", "text": "function madlib (noun, verb, place, adj){\n return ('The ' + noun +' ' + verb +' across the '+ place + ' ' + adj +'!');\n }", "title": "" }, { "docid": "89f1b01a49c0a0893cc62c1c529d259c", "score": "0.57788056", "text": "function greet (a){\nreturn a+',move outcha mommas backyear, and get yo shit togetha. youre buildin rocket-ships. you know how much money is wasted on space travel? we could solve world hunger but youre a child and dont get it. getchyashit togetha, ya wonk ass.'\n}", "title": "" }, { "docid": "f8783fb94cf92b26a7a2508952f71172", "score": "0.57764506", "text": "function hagureMetal(abbr, orig) {\n var len = orig.length;\n if (len < abbr.length) return 0;\n var sum = 0, score = 1, preIndex = -1;\n var {nonWord} = hagureMetal;\n var {pow} = Math;\n for (let c of abbr) {\n let index = orig.indexOf(c, preIndex + 1);\n if (index < 0) return 0;\n if (index !== preIndex + 1) score = pow((len - index) / len, 3);\n sum += (nonWord.test(orig[index - 1])\n ? pow(score, .3) // beginning of a word\n : score);\n preIndex = index;\n }\n return pow(sum / len, .3);\n }", "title": "" }, { "docid": "992d5dd206023ae42cfdf225af45a08d", "score": "0.57490635", "text": "function mHiloh5gQTCBd66HofULNg(){}", "title": "" }, { "docid": "da5dd9a3c5455a5dc57156c017112d62", "score": "0.5740758", "text": "function toughMod(msg)\n{\n if(mad_lib)\n {\n averageMod(msg);\n madLib(msg, '\\\\b(tit)t?(s|ies|ie)?(\\\\b)', nounArray,true,'\\\\b(big|fat|huge)(\\\\b)',adjArray);\n madLib(msg, '\\\\b(ass)(hol)?(e)?(\\\\b)', nounArray);\n }\n else\n {\n averageMod(msg);\n insertWord(msg, '\\\\b(tit)t?(s|ies|ie)?(\\\\b)',true,'\\\\b(big|fat|huge)(\\\\b)');\n insertWord(msg, '\\\\b(ass)(hol)?(e)?(\\\\b)');\n }\n}", "title": "" }, { "docid": "088213f12c47ce5c10718bdb9fd0f59e", "score": "0.57285285", "text": "function whichword(w){\n return \"I like \" + w\n}", "title": "" }, { "docid": "96f9b9e02b8a519d4f8a2b1b56f08d39", "score": "0.5726651", "text": "function wordBlanks(myNoun, myAdjective, myVerb, myAdverb){\n var result = \"\";\n result = \"The \" + myAdjective + myNoun + myAdverb + myVerb ;\n return result;\n}", "title": "" }, { "docid": "cd175eb7cdabf2f2a87edbfa2f85d056", "score": "0.572354", "text": "function Buddy_1(message){\n\tn(message);\n\n\tif($.relationship!=\"study\"){\n\t\t$.lying_about_hanging_out = true;\n\t\tm(\"勉強しないで二人でぶらぶらしてるんじゃないの。\");\n\t\tn(\"ちゃんと勉強してるって!\");\n\t\tm(\". . .\");\n\t\tm(\"わかったわ、嘘じゃないのね。\");\n\t\tn(\"嘘じゃないよ。\");\n\t}else{\n\t\tm(\"そう、やっぱりね。\");\n\t\tn(\"やっぱりって...なにが?\");\n\t}\n\n\tBuddy_1_point_5();\n}", "title": "" }, { "docid": "17d7eb556ffce4e32626b7ede74a9a51", "score": "0.5719683", "text": "function codeLove() { //function that does exactly what it looks like it does.\n return \"I love code\";\n}", "title": "" }, { "docid": "b7c61ff58126725484141c6ee71511dc", "score": "0.5717688", "text": "function kata32() {\n\n}", "title": "" }, { "docid": "e1f786fc48c3e82bb8459851db10c8c3", "score": "0.571064", "text": "function replace_word(word_analyzed){\n\tvar syllables = new_count(word_analyzed);\n\tvar complex = word_complex(syllables);\n\tif (complex) {\n\t\tvar synonym = 'easy';\n\t\treturn synonym;\n\t} else {\n\t\treturn word_analyzed;\n\t}\n}", "title": "" }, { "docid": "728aedfaaeba23bb03969d0ae5b1c688", "score": "0.570558", "text": "function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {\n // Your code below this line\n var result = \"My smart \" + myNoun + \" \" + myVerb + \" \" + myAdverb + \" \" + myAdjective + \".\";\n\n // Your code above this line\n // return result;\n console.log(result);\n}", "title": "" }, { "docid": "539f60ab3eccf0b08aa6b67d69565dd2", "score": "0.5698323", "text": "function wordBlanks(noun, adjective, verb, adVerb) {\n let resultingScentence = \"\";\n resultingScentence +=\n \"The \" + adjective + \" \" + noun + \" \" + verb + \" \" + adVerb + \" To Store\";\n return resultingScentence;\n}", "title": "" }, { "docid": "06e53a2a68efd976e2f9b55a6f544926", "score": "0.5696949", "text": "function C101_KinbakuClub_RopeGroup_PlayerBhnhnhLucy() {\n\tif (C101_KinbakuClub_RopeGroup_LucyIsAnnoyed <= 0) {\n\t\tPlayerUngag();\n\t\tActorChangeAttitude( 0, -1)\n\t} else {\n\t\tif (C101_KinbakuClub_RopeGroup_LucyIsAnnoyed >= 2 || ActorGetValue(ActorLove) >= 1) {\n\t\t\tOverridenIntroText = GetText(\"LucyHadEnough\");\n\t\t\tC101_KinbakuClub_RopeGroup_CurrentStage = 690;\n\t\t} else {\n\t\t\tPlayerUngag();\n\t\t\tOverridenIntroText = GetText(\"AnnoyedUngag\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ea14b0fc1c1e36564a40be784c758833", "score": "0.5694816", "text": "function madlib(animal, verb, descript, object) {\n var fullSen = \"The\" + \" \" + animal + \" \" + verb + \" \" + \"over the\" + \" \" + descript + \" \" + object;\n return fullSen;\n}", "title": "" }, { "docid": "f7ef6a83152823150a9e8b4c38a0698f", "score": "0.5692587", "text": "function C101_KinbakuClub_RopeGroup_SafeWord() {\n\tC101_KinbakuClub_RopeGroup_Guessing = true;\n\tC101_KinbakuClub_RopeGroup_HeatherTugging = false;\n}", "title": "" }, { "docid": "f7ef6a83152823150a9e8b4c38a0698f", "score": "0.5692587", "text": "function C101_KinbakuClub_RopeGroup_SafeWord() {\n\tC101_KinbakuClub_RopeGroup_Guessing = true;\n\tC101_KinbakuClub_RopeGroup_HeatherTugging = false;\n}", "title": "" }, { "docid": "5f94dd3cae04ceb047f9c9e147652b52", "score": "0.569211", "text": "function owofied(sentence) {\n\tconst a = sentence.replace(/i/g, \"wi\");\n\tconst b = a.replace(/e/g, \"we\");\n\treturn b + \" owo\";\n}", "title": "" }, { "docid": "237507846fe3d821b51bdc0e0cd7ce5d", "score": "0.569196", "text": "function goodEveningNeighbor() {\n\treturn 'Good evening, neighbor, thanks for everything!';\n}", "title": "" }, { "docid": "89e253fe01d517de421936a5e156d93e", "score": "0.56917095", "text": "function verbing(word) {\n\n if (word.length < 3) return word;\n if (word.slice(-3) == 'ing') {\n\n return word + 'ly';\n\n } else {\n\n return word + 'ing';\n }\n}", "title": "" }, { "docid": "68cc9b04147a09d3823a5a4c7ca8c5fc", "score": "0.5687088", "text": "function hangman() {\n for (let i = 0; i < trainToGuess.name.length; i++) {\n guessesOutput.push(\"_\");\n };\n // guessesOutput.push(\" line\");\n}", "title": "" }, { "docid": "0ad31c4273234acf69663fa75fd62095", "score": "0.5683462", "text": "function obliterate(target){ \n console.log(`${target} is obliterated into tiny ashes`);\n}", "title": "" }, { "docid": "086aa7d81a47c8d4468d559d691eadb7", "score": "0.5683396", "text": "async function entryIirose(str){\n if(str !=null){GM.setValue(\"entry\",str);}\n str = await GM.getValue(\"entry\", \"我踩着七彩祥云来了~\")\n if(str.length>13){\n console.log(\"智障吗,搞那么长?\");\n str=\"本人专属跑马灯入场\";\n GM.setValue(\"entry\",str);\n }\n var rainbow = [\"C30002\", \"C30040\", \"C3007D\", \"C300BB\", \"8D00C3\", \"4F00C3\", \"1200C3\", \"002AC3\", \"0068C3\", \"00A5C3\", \"00C3A2\", \"00C365\", \"00C327\", \"15C300\", \"52C300\", \"90C300\", \"C3B800\", \"C37A00\", \"C33D00\", \"C30000\", \"C30022\", \"C30060\", \"C3009D\", \"AA00C3\", \"6D00C3\", \"2F00C3\", \"000DC3\", \"004AC3\", \"0088C3\", \"00C3C0\", \"00C382\", \"00C345\", \"00C307\", \"35C300\", \"72C300\", \"B0C300\", \"C39800\", \"C35A00\", \"C31D00\", \"C3001F\"];\n // var rainbow = [\"00ABE5\", \"0063E5\", \"001CE6\", \"2C00E7\", \"7400E8\", \"BE00E9\", \"EA00CC\", \"EA0083\", \"EB003A\", \"EC0F00\", \"ED5900\", \"EEA400\", \"EEEF00\", \"A4EF00\", \"5AF000\", \"0EF100\", \"00F23C\", \"00F389\", \"00F4D5\", \"00C7F5\",\"007DF5\", \"0033F5\", \"1600F5\", \"6000F5\", \"AA00F5\", \"F400F5\", \"F500AB\", \"F50060\", \"F50016\", \"F53300\", \"F57D00\", \"F5C700\", \"D8F500\", \"8DF500\", \"43F500\", \"00F506\", \"00F550\", \"00F59A\", \"00F5E4\", \"00BBF5\"];\n var offset = Math.floor(Math.random() * rainbow.length);\n var text = str.split(\"\");\n\n for (var i=0;i<text.length;i++){\n if(offset+i<rainbow.length){\n console.log('%c '+rainbow[offset+i], 'color: #'+rainbow[offset+i]);\n socket.send('{\"m\": \"'+text[i]+'\", \"mc\": \"'+rainbow[offset+i]+'\"}');\n }\n else {\n console.log('%c '+rainbow[offset+i], 'color: #'+rainbow[offset+i]);\n socket.send('{\"m\": \"'+text[i]+'\", \"mc\": \"'+rainbow[offset+i-rainbow.length]+'\"}');\n }\n\n }\n }", "title": "" }, { "docid": "ba61e0131fff1c0a7e548f6bd5c1fa83", "score": "0.56822985", "text": "function BigRat() {\n\tlet attackQuotesArray= [\"The big rat makes an impossible leap and lunges for your throat!\", \"The big rat tries to bite your ankles!\", \"The big rat sniffs your feet before attempting to take a big bite out of them!\"];\n\tlet bigRatHP= 1;\n\tlet bigRatAttack= 1;\n}", "title": "" }, { "docid": "c0ba60df86eca983fd2f0b0f94544039", "score": "0.56799006", "text": "function madlib(a,b,c,d){\n return a + \"is a\" + b +\"way of saying\" + c +\", which is not true. Mostly because\" + d +\"Jimmy Neutron is a selfish son of a gun. If I was in his class I would bully him into actually helping the world. Any friend of Jimmy Neutron is an enemy of mine.\"\n}", "title": "" }, { "docid": "93fc264162c0b702856cb24da3a6ec4b", "score": "0.56698024", "text": "function suggestPaw(){\n // generate a random number 4 or 5. be number of letters selected\n let k = Math.round(Math.random() + 4);\n // get the nouns\n let str = [];\n for(let n=0; n<k ;n++){\n // generate a random number in list\n let tmp = Math.floor(Math.random()*noun_list.length);\n str.push(noun_list[tmp]);\n }\n return str.join(\"-\");\n}", "title": "" }, { "docid": "7454e99732509f77948f9e752a477324", "score": "0.5665838", "text": "function apology()\r\n{\r\n return sorryMsg[Math.floor(Math.random()*sorryMsg.length)];\r\n}", "title": "" }, { "docid": "0b7e7341778f7438273f6a7a0ed618d3", "score": "0.5648633", "text": "function zt_simpleRudimentaryAi(){\n\tzt_medai(map, 2, false);\n}", "title": "" }, { "docid": "be307b4de6143ae85624b7f703e355c0", "score": "0.5645568", "text": "function colemanLiau(letters, words, sentences) {\n return (0.0588 * (letters * 100 / words))\n - (0.296 * (sentences * 100 / words))\n - 15.8;\n}", "title": "" }, { "docid": "e8d8be35c27404b2be8dd524b52420c2", "score": "0.5644267", "text": "function word() {\n cowboyWord = wordBankArr[wordRandom(5,0)]}", "title": "" }, { "docid": "d4acd46b005765a0ddc8103b57723b2a", "score": "0.56439763", "text": "function C101_KinbakuClub_RopeGroup_RudeToLucy() {\n\tC101_KinbakuClub_RopeGroup_LucyIsAnnoyed++;\n\tC101_KinbakuClub_RopeGroup_PlayerBallGagged()\n}", "title": "" }, { "docid": "386b2fc18eca4d37b2ba3bf5926ebad5", "score": "0.56405544", "text": "function ganjilGenap (angka){\n if(angka % 2==0){\n return angka + ' adalah Genap'\n }else{\n return angka + ' adalah Ganjil'\n }\n}", "title": "" }, { "docid": "76383420dc8293fceb3bdded78db4a1c", "score": "0.5639816", "text": "function whatIDontLike(petNameDog) {\n console.log(\"I don't like \" + petNameDog)\n}", "title": "" }, { "docid": "bb9ddd568c01695c399fa3cfd67621e1", "score": "0.5637056", "text": "function repairKitty(eliaShared, eliaBorrowed, lyannaShared, lyannaBorrowed) {\n let lyannaNet = lyannaShared-lyannaBorrowed, eliaNet = eliaShared-eliaBorrowed, tot = (eliaNet - lyannaNet)/2;\n return (tot === 0) ? \"The kitty is already even\": tot > 0 ? `Lyanna owes Elia ${Math.abs(tot)}` : `Elia owes Lyanna ${Math.abs(tot)}`\n}", "title": "" }, { "docid": "e38e3c074192c338834c4dbfc7fcab28", "score": "0.5630573", "text": "function StrawberrySalad() {\n\n}", "title": "" }, { "docid": "146832dc5ccface04d79fdcdd639aba6", "score": "0.5624587", "text": "function madLib(verb, adj, noun) {\n let v = verb.toUpperCase();\n let a = adj.toUpperCase();\n let n = noun.toUpperCase();\n str = ('We shall ' + v + ' the ' + a + ' ' + n);\n console.log(str);\n}", "title": "" }, { "docid": "bf3011fcc1347c9bfc7551a9ac0ecaed", "score": "0.56204706", "text": "function newWord() {\n // Stores the random word\n answer = randomWord();\n // Stores each letter of \"answer\" to an element of an array\n answerArr = answer.split(\"\");\n // Generates a jumbled \"map\" of the word\n mapArr = jumbleMap(answerArr);\n // Maps the word to their jumbled indices\n jumbledArr = jumbleWord(answerArr, mapArr);\n // Makes a string out of the \"jumbledArr\" to log to screen\n jumbled = jumbledArr.join(\"\");\n}", "title": "" }, { "docid": "b772104f4227eef4d15399b27ec7a8b5", "score": "0.5618411", "text": "function kata25() {\n\n}", "title": "" }, { "docid": "da524cc49c4fac6999e3ce9b06473812", "score": "0.56161034", "text": "function Harold() {}", "title": "" }, { "docid": "3a7e46b9501d10df0ca851e762f1bf42", "score": "0.56152123", "text": "addCorrectLetter(i) {\n\n this.guessedLetter = this.guessedLetter + (this.secretWord[i].toUpperCase());\n //this.checkWinner();\n }", "title": "" }, { "docid": "00875910503bd533ab9f576309386c0e", "score": "0.56138873", "text": "reviewWord(word) {\n // todo\n }", "title": "" }, { "docid": "c7ad972ada363495b9ddcffdda42b44a", "score": "0.56103593", "text": "function kata24() {\n\n}", "title": "" }, { "docid": "be8e5ea638990310968728b048258832", "score": "0.56081617", "text": "function CountAnimals(tur,horse,pigs) {\n //return the calculated legs \n return (tur*2)+(horse*4)+(pigs*4)\n}", "title": "" }, { "docid": "2bf23bfa36ca1075e60cd20d0f67e796", "score": "0.56060064", "text": "yourAttack() {\n console.log(\"You are attacking the alien ship!\");\n let yourHealthBar = this.hull;\n if (this.accu > Math.random()) {\n healthBar = this.hull - this.fire;\n return console.log(`You hit the alien with ${this.fire} firepower and they have ${yourHealthBar} life left!`);\n } else {\n return console.log(`You missed! The alien has ${yourHealthBar} life left!`);\n };\n }", "title": "" }, { "docid": "bd4c8350d9da933d81b85c3b4544d41d", "score": "0.5602716", "text": "function kata26() {\n\n}", "title": "" }, { "docid": "ab30e95668ab9ddb4bdc6eabf9be6ed7", "score": "0.55947727", "text": "function friendlyInter(ad) {\n const prob = Math.random();\n if (ad) { // if tweet is an add, make it more likely it was prompted by a friend's interaction\n return prob > 0.5; // if the interaction belongs to an ad (20% of cases), \n // then make 50% of them friend-inspired interactions\n }\n return prob > 0.8;\n}", "title": "" }, { "docid": "262d896327ef701e170493292b516b97", "score": "0.5591565", "text": "function kata28() {\n\n}", "title": "" }, { "docid": "1ce82d90b18f62184eb3f2abb49c43df", "score": "0.55899954", "text": "function funkychicken() {\n\talert(\"Deflector power at maximum. Energy discharge in six seconds. Warp reactor core primary coolant failure.\" +\n\t\" Fluctuate phaser resonance frequencies. Resistance is futile. Recommend we adjust shield harmonics to the upper\" +\n\t\" EM band when proceeding. These appear to be some kind of power-wave-guide conduits which allow them to work \" +\n\t\"collectively as they perform ship functions. Increase deflector modulation to upper frequency band\");\n}", "title": "" }, { "docid": "4956ba11fcf10f304375e8b3673313ad", "score": "0.5582282", "text": "function masks(){\r\n\r\n var words = input.value();\r\n var sentences = split(words, \" \")\r\n\r\n //Happy \r\n var foundHappy = false;\r\n for (var i1 = 0; i1 < sentences.length && !foundHappy; i1++){ \r\n for (var j1 = 0; j1 < happy.length && !foundHappy; j1++) {\r\n if (happy[j1] == sentences[i1]) {\r\n foundHappy = true;\r\n i = 8;\r\n angle += 0.05 \r\n vTest = 0.25\r\n }\r\n }\r\n }\r\n \r\n //Angry\r\n var foundAngry = false;\r\n for (var i2 = 0; i2 < sentences.length && !foundAngry; i2++){\r\n for (var j2 = 0; j2 < angry.length && !foundAngry; j2++){\r\n if (angry[j2] == sentences[i2]){\r\n foundAngry = true;\r\n i = 5;\r\n angle += 0.5\r\n vTest = 0.8\r\n }\r\n }\r\n }\r\n \r\n //Crazy\r\n var foundCrazy = false;\r\n for (var i3 = 0; i3 < sentences.length && !foundCrazy; i3++){\r\n for (var j3 = 0; j3 < crazy.length && !foundCrazy; j3++){\r\n if (crazy[j3] == sentences[i3]){\r\n foundCrazy = true;\r\n i = 4;\r\n angle += 0.02\r\n vTest = random(0.1, 0.55)\r\n }\r\n }\r\n }\r\n \r\n //Sad\r\n var foundSad = false;\r\n for (var i4 = 0; i4 < sentences.length && !foundSad; i4++){\r\n for (var j4 = 0; j4 < sad.length && !foundSad; j4++){\r\n if (sad[j4] == sentences[i4]){\r\n foundSad = true;\r\n i = 1;\r\n angle += 0.009\r\n vTest = 0.95\r\n }\r\n }\r\n }\r\n \r\n //Scared\r\n var foundScared = false;\r\n for (var i5 = 0; i5 < sentences.length && !foundScared; i5++){\r\n for (var j5 = 0; j5 < scared.length && !foundScared; j5++){\r\n if (scared[j5] == sentences[i5]){\r\n foundScared = true;\r\n i = 2;\r\n angle += 0.3\r\n vTest = 0.01\r\n }\r\n }\r\n }\r\n \r\n //Apple :)\r\n var foundApple = false\r\n for (var i6 = 0; i6 < sentences.length && !foundApple; i6++){\r\n if (\"apple\" == sentences[i6]){\r\n foundApple = true;\r\n i = 9;\r\n angle += 0.05 \r\n vTest = 0.25\r\n }\r\n } \r\n}", "title": "" }, { "docid": "ffe14364575553140a838edc29c8a0d5", "score": "0.55816746", "text": "function pigLatin(word){\n\n //maybe to split the sentance it up into an array so i can target each index??\n\n switch (word)\n case (first character of word !=== a,e,i,o,u)\n take first character and also add characters \"ay\" to the end\n break;\n case (first two characters of word contain qu)\n move u + q and add 'ay'\n break;\n default\n\n\n}", "title": "" }, { "docid": "a5e94281a2b3033e65e244bef83bf298", "score": "0.5578954", "text": "function laugh(){\n return \"hahahahahahahahahaha!\";\n}", "title": "" }, { "docid": "abdd75190ee7a4a2fe41a62f22808bfc", "score": "0.5578054", "text": "function lettersRemain() {\n var i;\n var toGuess = 0;\n for (i in blankAnimal) {\n if (blankAnimal[i] === \"_\") {\n toGuess++;\n };\n };\n return toGuess;\n }", "title": "" }, { "docid": "75f22e4d3245eafad29057e2204f3d6e", "score": "0.5575858", "text": "function alphabetWar(fight) {\n let res = [...fight].reduce((a, b) => a + \"sbpw\".indexOf(b) - \"zdqm\".indexOf(b), 0);\n return (res === 0) ? \"Let's fight again!\" : `${res < 0 ? \"Right\" : \"Left\"} side wins!`\n}", "title": "" }, { "docid": "982ad6c0f9fcbb7e6a1e131a4455cd12", "score": "0.557408", "text": "attack() {\n\n\t}", "title": "" }, { "docid": "5356459b750ff4f6fe97fc42f78cddd6", "score": "0.5571192", "text": "function feed1(animal){\n return `1 - Alimente ${animal.name} com ${animal.meal} kg's de ${animal.diet}` \n}", "title": "" }, { "docid": "09a37b966f24c64564c12898ef53a249", "score": "0.5566885", "text": "function handleWord(word){\n\t\t//consoleOut(word); // don't need to do this.\n\t\tmyGuessWord = word.toUpperCase();\n\t\tconsole.log(myGuessWord); // this is my word\n\t\t\n\t\tlet hiddenStr = \"\";\n\t\tfor(let i = 0; i < myGuessWord.length; i++){\n\t\t\thiddenStr += \"_\";\n\t\t}\n\t\tmyHiddenWord = hiddenStr.toUpperCase();\n\t\thangmanOut(\"Guess this word: \" + myHiddenWord);\n\t}", "title": "" }, { "docid": "b7e5302afb49c15f3d75f051864853eb", "score": "0.55654585", "text": "technique(){\n\t\treturn \"Bubble Tech\";\n\t}", "title": "" }, { "docid": "8c5644c6b30555134f7493e620b662c6", "score": "0.55602", "text": "function rando() {\n return chance.word();\n}", "title": "" }, { "docid": "83e768778f3052784cc439ac3b14d683", "score": "0.55587566", "text": "function C004_ArtClass_Julia_GaggedSpeach() {\n\tif ((C004_ArtClass_ArtRoom_JuliaStage == 6) || (C004_ArtClass_ArtRoom_JuliaStage == 7))\n\t\tOveridenIntroText = \"Eep ah hoze eew wuwii!\";\n}", "title": "" }, { "docid": "de4e3da54b047d762e1c05a3cef14338", "score": "0.55585796", "text": "function randomWord() {\n answer = belgian_beer[Math.floor(Math.random() * belgian_beer.length)];\n}", "title": "" }, { "docid": "2e27f75b1e548270081e953e96e1d6fe", "score": "0.5557951", "text": "function getMeaning(i) {\n var result=-1;\n var j;\n\n for(j=0; j<dic.length; j++) {\n if(dic.word[j]==compound[i] && dic.reading[j]==reading[i]) {\n //result=dic.word[j]+'&nbsp;'+dic.meaning[j];\n result=j;\n break;\n }\n }\n if(result!=-1) return result;\n\n for(j=0; j<dic.length; j++) {\n if((dic.word[j]=='~'+compound[i] && dic.reading[j]=='~'+reading[i]) ||\n (dic.word[j]==compound[i]+'~' && dic.reading[j]==reading[i]+'~')) {\n //result=dic.word[j]+'&nbsp;'+dic.meaning[j];\n result=j;\n break;\n }\n }\n if(result!=-1) return result;\n\n var stem;\n var verbType;\n for(j=0; j<dic.length; j++) {\n\n if(dic.word[j].substr(0,1)==compound[i].substr(0,1) && dic.reading[j].substr(0,1)==reading[i].substr(0,1)) {\n\n verbType=dic.meaning[j].replace(/^[^v]*(v[15][bgkmnrstu]?)?.*$/, \"$1\");\n if(dic.meaning[j].match(/vs-s/)) verbType='vs-s';\n\n if(verbType!='') {\n //alert(\"compound=\"+compound[i]+\" dic1=\"+dic1[j]+\" dic4=\"+dic4[j]+\" verbType=\"+verbType);\n stem=dic.word[j].substr(0,dic.word[j].length-1);\n if(verbType=='vs-s') stem=stem.substr(0,stem.length-1);\n result=examineVerb(j,compound[i],stem,verbType,1);\n\n } else if(dic.meaning[j].match(/adj[^-]/)) {\n stem=dic.word[j].substr(0,dic.word[j].length-1);\n //alert(\"i-Adj: compound=\"+compound[i]+\" dic.word=\"+dic.word[j]+\" dic.meaning=\"+dic.meaning[j]+\" stem=\"+stem);\n result=examineAdj(j,compound[i],stem);\n }\n\n }\n if(result!=-1) break;\n }\n return result;\n}", "title": "" }, { "docid": "6b5b29a8458129003782d7e1dc005e45", "score": "0.5553885", "text": "function kata29() {\n\n}", "title": "" }, { "docid": "e9b3564f9929e2a5ed458fcb4c68e2fb", "score": "0.553917", "text": "function ThinkDinger() {\n\n\tvar basicSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\tvar thinkDingSet =\"♆☢♗☯☠✈♞❂☭✂☏☾♠✿☮❉♕✪♙☸☹✸♬★♖☂\";\n\n\tvar output = \"\";\n\n\t//converts Enigma Code to Think Ding code\n\tthis.toThinkDing = function(input) {\n\t\toutput = \"\";\n\n\t\tfor(var i=0; i<input.length; i++){\n\t\t\toutput = output + thinkDingSet[basicSet.indexOf(input[i])];\n\t\t}\n\t\treturn output;\n\t};\n\n\t//converts Think Ding Code to Enigma Code\n\tthis.toEnigmaCode = function(input) {\n\t\toutput = \"\";\n\n\t\tfor(var i=0; i<input.length; i++){\n\t\t\toutput = output + basicSet[thinkDingSet.indexOf(input[i])];\n\t\t}\n\t\treturn output;\n\t};\n}", "title": "" }, { "docid": "43dd6dc4f6652d3f2720ffc3b17e02d9", "score": "0.55390036", "text": "function C004_ArtClass_Julia_Tighten() {\n\tif (Common_PlayerNotRestrained) {\n\t\tif (C004_ArtClass_Julia_TightenDone == false) {\n\t\t\tif (C004_ArtClass_Julia_IsGagged) OveridenIntroText = \"(You tighten the knots while she struggles.)|MMNRGN NOG! (She seems to endure the pain.)\";\n\t\t\telse OveridenIntroText = \"(You tighten the knots while she struggles.)|Dio mio! This is really tight new pupil.\";\n\t\t\tActorChangeAttitude(0, 1);\n\t\t\tC004_ArtClass_Julia_TightenDone = true;\n\t\t}\n\t} else {\n\t\tOveridenIntroText = \"(You try to tighten Julia's bondage|but fail as the other students giggle.)\";\n\t}\n}", "title": "" }, { "docid": "601372fed06c77fb19570278e8b7ca4d", "score": "0.55332214", "text": "alienAttack() {\n console.log(\"The alien ship is attacking you!\");\n let alienHealthBar = this.hull;\n if (this.accu > Math.random()) {\n healthBar = this.hull - this.fire;\n return console.log(`The alien ship has hit you with ${this.fire} firepower! And you now have ${alienHealthBar} life left!`);\n } else {\n return console.log(`They missed! You still have ${alienHealthBar} life left!`);\n };\n }", "title": "" }, { "docid": "ccb01c6545a0bf70aa54ea4bdee6469d", "score": "0.552998", "text": "function hapusAwalDanAkhir(kata){\n return kata.slice(1,kata.length-1)\n}", "title": "" }, { "docid": "94cd809f073b5376af1c533ce15a4c83", "score": "0.55299395", "text": "function doAnimalsLRomaji() {\r\tif (thisNumber == \"10\") return \"juttoo\";\r\ttempBig = checkBig();\r\tif (tempBig != \"false\") return tempBig + \"too\";\r\tif (thisNumber.length == 1) return setAnimalsLRomaji(placeValue[0]);\r\telse return doBigNumberRomaji()+\" \"+setAnimalsLRomaji(placeValue[0]);\r\t\r}", "title": "" }, { "docid": "34def861e8c385eccf3b106f228d7943", "score": "0.5529119", "text": "function consonant_to_hindi(eng) {\n let aspiration = (eng.length == 2)?(eng[1] == 'h'):false;\n switch(eng) {\n case 'k':\n return 'क';\n case 'kh':\n return 'ख';\n case 'g':\n return 'ग';\n case 'gh':\n return 'घ';\n case 'D':\n return 'ङ';\n case 'c':\n return 'च';\n case 'ch':\n return 'छ';\n case 'j':\n return 'ज';\n case 'jh':\n return 'झ';\n case 'Nh': // Find better representation for 'nya'\n return 'ञ';\n case 'T':\n return 'ट';\n case 'Th':\n return 'ठ';\n case 'D':\n return 'ड';\n case 'Dh':\n return 'ढ';\n case 'N':\n return 'ण';\n case 't':\n return 'त';\n case 'th':\n return 'थ';\n case 'd':\n return 'द';\n case 'dh':\n return 'ध';\n case 'n':\n return 'न';\n case 'p':\n return 'प';\n case 'ph':\n return 'फ';\n case 'b':\n return 'ब';\n case 'bh':\n return 'भ';\n case 'y':\n return 'य';\n case 'r':\n return 'र';\n case 'rh':\n return 'ऱ';\n case 'l':\n return 'ल';\n case 'L':\n return 'ळ';\n case 'Lh':\n return 'ऴ';\n case 'm':\n return 'म'\n case 'v': case 'w':\n return 'व';\n case 'sh':\n return 'श';\n case 'Sh':\n return 'ष';\n case 's':\n return 'स';\n case 'h':\n return 'ह';\n case 'f':\n return 'फ़';\n case 'z':\n return 'ज़';\n }\n return err_sym;\n}", "title": "" }, { "docid": "e9dbc819319c7d4fec2f8840cdf729a9", "score": "0.5528881", "text": "function singsong(){\n console.log(\"twinkle twinkl little star\");\n}", "title": "" } ]
79c23b6beae13e825e5afac610a20260
redirect .eth request to ipfs address from ENS
[ { "docid": "43c610bff995c6e973c4cd084d576613", "score": "0.0", "text": "function listener(details) {\r\n\tens_domain = urlDomain(details.url);\r\n\treturn WEB3ENS.getContenthash(ens_domain).then(getENSContenthash, getENSContent);\r\n}", "title": "" } ]
[ { "docid": "29beab9176e22848f37255bacbf116c8", "score": "0.54177934", "text": "function _v_iptip(e, ip, quiet)\n{\n\tvar ma, x, y, z, oip;\n\tvar a, b;\n\n\toip = ip;\n\n\t// x.x.x.x - y.y.y.y\n\tif (ip.match(/^(.*)-(.*)$/)) {\n\t\ta = fixIP(RegExp.$1);\n\t\tb = fixIP(RegExp.$2);\n\t\tif ((a == null) || (b == null)) {\n\t\t\tferror.set(e, oip + ' - invalid IP address range', quiet);\n\t\t\treturn null;\n\t\t}\n\t\tferror.clear(e);\n\n\t\tif (aton(a) > aton(b)) return b + '-' + a;\n\t\treturn a + '-' + b;\n\t}\n\n\tma = '';\n\n\t// x.x.x.x/nn\n\t// x.x.x.x/y.y.y.y\n\tif (ip.match(/^(.*)\\/(.*)$/)) {\n\t\tip = RegExp.$1;\n\t\tb = RegExp.$2;\n\n\t\tma = b * 1;\n\t\tif (isNaN(ma)) {\n\t\t\tma = fixIP(b);\n\t\t\tif ((ma == null) || (!_v_netmask(ma))) {\n\t\t\t\tferror.set(e, oip + ' - invalid netmask', quiet);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ((ma < 0) || (ma > 32)) {\n\t\t\t\tferror.set(e, oip + ' - invalid netmask', quiet);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n\n\tip = fixIP(ip);\n\tif (!ip) {\n\t\tferror.set(e, oip + ' - invalid IP address', quiet);\n\t\treturn null;\n\t}\n\n\tferror.clear(e);\n\treturn ip + ((ma != '') ? ('/' + ma) : '');\n}", "title": "" }, { "docid": "c453c7e40a1b14c076c5ca58764a6e6e", "score": "0.53913236", "text": "async function sendEth(){\r\n\t// Grab the amount and destination address from the webpage\r\n let address = document.getElementById(\"addressTo\").value\r\n\taddress = resolveAddress(address)\r\n let amount = document.getElementById(\"toAmount\").value\r\n\t// Create a new transaction with the above information\r\n let tx = {\r\n to: address,\r\n // ... or supports ENS names\r\n // to: \"ricmoo.firefly.eth\",\r\n // We must pass in the amount as wei (1 ether = 1e18 wei), so we\r\n // use this convenience function to convert ether to wei.\r\n value: utils.parseEther(amount)\r\n }\r\n\t// Send the transaction\r\n let sendPromise = signer.sendTransaction(tx);\r\n}", "title": "" }, { "docid": "9c02b7d7d2030efd2f9abb0b340de2ad", "score": "0.52610606", "text": "function onlookup(err, ip) {\n if (err) return fn(err);\n options.destination.host = ip;\n SocksClient.createConnection(options, onhostconnect);\n }", "title": "" }, { "docid": "9c02b7d7d2030efd2f9abb0b340de2ad", "score": "0.52610606", "text": "function onlookup(err, ip) {\n if (err) return fn(err);\n options.destination.host = ip;\n SocksClient.createConnection(options, onhostconnect);\n }", "title": "" }, { "docid": "3cc0875425a7c36403a7655916130b43", "score": "0.51985735", "text": "function attachIpToRequest(req, res, next) {\n req.ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;\n next();\n}", "title": "" }, { "docid": "e5254ba6574281df135cfd84b29cf19d", "score": "0.5166746", "text": "function onlookup(err, ip) {\n\t if (err) return fn(err);\n\t options.target.host = ip;\n\t SocksClient.createConnection(options, onhostconnect);\n\t }", "title": "" }, { "docid": "e5254ba6574281df135cfd84b29cf19d", "score": "0.5166746", "text": "function onlookup(err, ip) {\n\t if (err) return fn(err);\n\t options.target.host = ip;\n\t SocksClient.createConnection(options, onhostconnect);\n\t }", "title": "" }, { "docid": "e108f854638ac2eeb2d5180e0ae1e329", "score": "0.50398964", "text": "function ethCall (address, method, cb) {\n return request({\n url: `${ETH_URL}/${method}`,\n json: true\n }, (err, res, body) => {\n if (err || res.statusCode !== 200 || body.error) {\n return cb(err || body.error || Error(res.statusCode), body)\n }\n cb(null, body.result)\n })\n}", "title": "" }, { "docid": "89e0e416954f6bc9d297e9ee5ef0464e", "score": "0.5009088", "text": "function sendGetAddr(encoder){\n // version //\n encoder.write({\n magic: 0xd9b4bef9,\n command: 'version',\n payload: {\n version: 70012,\n services: Buffer.alloc(8).fill(0),\n timestamp: Math.round(Date.now() / 1000),\n receiverAddress: {\n services: Buffer.from('0100000000000000', 'hex'),\n address: '0.0.0.0',\n port: 8333\n },\n senderAddress: {\n services: Buffer.alloc(8).fill(0),\n address: '0.0.0.0',\n port: 8333\n },\n nonce: Buffer.alloc(8).fill(123),\n userAgent: 'foobar',\n startHeight: 0,\n relay: true\n }//payload\n })\n\n // verack //\n encoder.write({\n magic: 0xd9b4bef9,\n command: 'verack',\n payload: ''\n })\n\n // getaddr //\n encoder.write({\n magic: 0xd9b4bef9,\n command: 'getaddr',\n payload: ''\n })\n\n encoder=null\n}", "title": "" }, { "docid": "18ae9f14149b5f39e06cf322b3fc0c5f", "score": "0.49862957", "text": "function set_from_input() {\n bitvote_addr = ge(\"bitvote_addr_input\").value;\n if( bitvote_addr == \"\" ){ bitvote_addr = null; }\n eth.watch({altered:{id:bitvote_addr}}).changed(update);\n update();\n}", "title": "" }, { "docid": "87c45c212277bcafdc74836cff5d44e1", "score": "0.49615225", "text": "function pingContract() {\nxhr.open('GET', \"http://art-blocks-endpoints.whatsthescore.webfactional.com/0x53A3B5121C17C4d6b616072bf55f23356E9f8956\", true);\nxhr.send();\n\nxhr.onreadystatechange = processRequest;}", "title": "" }, { "docid": "2532e271bbd2f5d9b4afd84291b2f000", "score": "0.4939531", "text": "function ip1907892() { return 'ent.'; }", "title": "" }, { "docid": "79defbee66fa0b12333b9b8a1cc01f4c", "score": "0.4895172", "text": "function forward(req, res){\n // set up options for the request to ambiverse\n var options = {\n method: 'POST',\n url: 'https://api.ambiverse.com/v1/entitylinking/analyze',\n headers: {\n authorization: 'Bearer ' + req.app.locals.access_token,\n accept: 'application/json',\n 'content-type': 'application/json'\n },\n body: { \"text\": req.body.text },\n json: true,\n gzip: true\n };\n // send request and respond. any needed preprocessing should go here\n request(options, function (err, response, body){\n if(!err && response.statusCode == 200){\n return res.status(200).send(body);\n }\n else {\n return res.status(500).send({'error': 'Ambiverse did not respond correctly.'});\n }\n });\n}", "title": "" }, { "docid": "c74bdd411fff1e92c2930342481d39ea", "score": "0.48691297", "text": "function ipFinder() {\n\n require('http').request({\n hostname: 'fugal.net',\n path: '/ip.cgi',\n agent: false\n }, function(res) {\n if(res.statusCode != 200) {\n throw new Error('non-OK status: ' + res.statusCode);\n }\n res.setEncoding('utf-8');\n var ipAddress = \"\";\n res.on('data', function(chunk) { ipAddress += chunk; });\n res.on('end', function() {\n global.myIP = ipAddress;\n if(!isNaN(myIP[myIP.length-1])) {\n myIP = myIP.slice(0, myIP.length-1);\n }\n });\n }).on('error', function(err) {\n throw err;\n }).end();\n\n}", "title": "" }, { "docid": "f51781d1418cca99744651f92fe3d760", "score": "0.48690498", "text": "function sendToEdgeNode(payload) {\n const API_KEY = 'VYNULCYYRUT5J6FN';\n var options = {\n host: 'api.thingspeak.com',\n port: 80,\n path: '/update?api_key='+API_KEY+'&field1=' + encodeURIComponent(payload)\n };\n\n http.get(options, function (resp) {\n resp.on('data', function (chunk) {\n console.log('sent to thingspeak');\n });\n }).on('error', function (e) {\n console.log(\"error sending to thingspeak: \" + e.message);\n });\n}", "title": "" }, { "docid": "731d78904c5116eea2ec061ccfb98843", "score": "0.48476228", "text": "function request(reqIp){\n //create a client connection\n var clientSocket = clientIo.connect(\"http://\" + reqIp + \"/\");\n \n //emit the request\n clientSocket.emit('request');\n\n //this is called when a server send data in responce to this current computer's request\n clientSocket.on('transmitting', ( data )=>{\n console.log(\"Got data: \" + data)\n if(data !== undefined){ \n clientSocket.disconnect(true);\n writeFile(data);\n }\n else{\n socket.emit('request');\n }\n });\n}", "title": "" }, { "docid": "285560d49964255cd6e6269b88cfae4d", "score": "0.4840887", "text": "populateRpcNodeInput()\n {\n objBrowser.runtime.sendMessage({func: \"rpc_provider\"}, function(objResponse) {\n document.getElementById(\"ext-etheraddresslookup-rpcnode_modify_url\").value = objResponse.resp;\n });\n }", "title": "" }, { "docid": "f7edfd0ad8f901cfae710f5b449cf95e", "score": "0.4826424", "text": "function primaryInbound(req, res) {\n console.log( Object.keys(req) );\n const caller = req.body.From;\n\n var response = null;\n if ( isClient(caller) ) {\n\t// response = clientResponse( caller );\n\t// while implementing regularResponse.. all callers are routed\n\tresponse = regularResponse();\n } else {\n\tresponse = regularResponse();\n }\n \n if ( typeof(response) == 'undefined' ) {\n\tthrow new Error(\"'null' when 'Response' type expected\");\n }\n \n res.writeHead(200, {'Content-Type': 'text/xml'});\n res.end(response.toString());\n}", "title": "" }, { "docid": "49758c044706e5301e88554bec2aabb1", "score": "0.4820196", "text": "function RequestFunnel() {\n // We use an object here for O(1) lookups (speed).\n this.methods = {\n eth_call: true,\n eth_getStorageAt: true,\n eth_sendTransaction: true,\n eth_sendRawTransaction: true,\n\n // Ensure block filter and filter changes are process one at a time\n // as well so filter requests that come in after a transaction get\n // processed once that transaction has finished processing.\n eth_newBlockFilter: true,\n eth_getFilterChanges: true,\n eth_getFilterLogs: true,\n }\n this.queue = []\n this.isWorking = false\n }", "title": "" }, { "docid": "3078aff94b7bf11e02af88f0defe9f07", "score": "0.48182854", "text": "handler(app, req, res) {\n const address = req.query.p0;\n if (!address) {\n return res.status(400).send({\n api_status : 'fail',\n api_message: 'p0<address> is required'\n });\n }\n try {\n const {\n address : addressBase,\n identifier: addressKeyIdentifier, version: addressVersion\n } = this.addressRepository.getAddressComponent(address);\n res.send({\n is_valid : walletUtils.isValidAddress(addressBase) && walletUtils.isValidAddress(addressKeyIdentifier),\n address_base : addressBase,\n address_version : addressVersion,\n address_key_identifier: addressKeyIdentifier\n });\n }\n catch (e) {\n res.send({\n api_status : 'fail',\n api_message: `unexpected generic api error: (${e})`\n });\n }\n }", "title": "" }, { "docid": "ed08a055e07c5e17f2dcb622e98c4033", "score": "0.47806808", "text": "function getIP(){\n let ip = ip2.toString();\n // (req.headers['x-forwarded-for'] ||\n // req.connection.remoteAddress ||\n // req.socket.remoteAddress ||\n // req.connection.socket.remoteAddress).split(\",\")[0];\n return ip;\n }", "title": "" }, { "docid": "11caa71d24d0e7c1958acc8a733ae7e3", "score": "0.47774884", "text": "getHueIP(callback) {\r\n client.get(\"https://www.meethue.com/api/nupnp\", function (data, response) {\r\n var r = data[0].internalipaddress;\r\n console.log(`Bridge detected at ${r}`);\r\n callback(r);\r\n });\r\n }", "title": "" }, { "docid": "fb37682a61d40621fbbe1d72c3bf6bfc", "score": "0.4754059", "text": "async function resolveAddress(address){\r\n\r\n\t\t// ENS domain is xxxxx.eth\r\n if (address.includes(\".\")){\r\n\t\t\tlet nameHash = utils.namehash(address)\r\n\t\t\taddress = await resolverContract.addr(nameHash)\r\n\t\t}\r\n\t\treturn address\r\n}", "title": "" }, { "docid": "49d564f07532415d55e3f73bee1c9c9a", "score": "0.4737385", "text": "convertWeiToEth(stringValue) {\n if (typeof stringValue != 'string') {\n stringValue = String(stringValue);\n }\n return web3.utils.fromWei(stringValue, \"ether\");\n }", "title": "" }, { "docid": "a41947f2088a73348931e02c73a7570b", "score": "0.47354028", "text": "function getIPAddr(ifname, version) {\n // console.log('network:getIP');\n // console.log('IFname ' + ifname);\n // console.log('Version ' + version);\n\n for (var devName in ifaces) {\n if (ifname !== devName) {\n continue;\n }\n\n var iface = ifaces[devName];\n\n for (var i = 0; i < iface.length; i++) {\n var alias = iface[i];\n if (alias.family === version && alias.addres !== '127.0.0.1' && !alias.internal) {\n console.log(alias.address);\n return alias.address;\n }\n }\n }\n}", "title": "" }, { "docid": "026e446fc286b1625f6e13469eba04f4", "score": "0.4725201", "text": "function wifxProcessServerResponse(editorName)\n{\n rxRedirect(wifxGetResponseHeader(\"WebImageFX-Redirect\"));\n}", "title": "" }, { "docid": "cbb1d3d0453081f398f8e629a745c86b", "score": "0.4704373", "text": "function changeAddrFromMnemonic(mnemonic) {\n // root seed buffer\n const rootSeed = BITBOX.Mnemonic.toSeed(mnemonic)\n\n // master HDNode\n let masterHDNode\n if (NETWORK === `mainnet`) masterHDNode = BITBOX.HDNode.fromSeed(rootSeed)\n else masterHDNode = BITBOX.HDNode.fromSeed(rootSeed, \"testnet\")\n\n // HDNode of BIP44 account\n const account = BITBOX.HDNode.derivePath(masterHDNode, \"m/44'/145'/0'\")\n\n // derive the first external change address HDNode which is going to spend utxo\n const change = BITBOX.HDNode.derivePath(account, \"0/0\")\n\n return change\n}", "title": "" }, { "docid": "2bdb6c99203abc2c82667a5a1f59b7d6", "score": "0.46828502", "text": "handleIP(ip, port) {\n if (ip.type === 'openBracket') {\n if (this.autoOrdering === null) { this.autoOrdering = true; }\n this.bracketCounter[port.name]++;\n }\n if (port.name in this.forwardBrackets &&\n (ip.type === 'openBracket' || ip.type === 'closeBracket')) {\n // Bracket forwarding\n let outputEntry = {\n __resolved: true,\n __forwarded: true,\n __type: ip.type,\n __scope: ip.scope\n };\n for (let i = 0; i < this.forwardBrackets[port.name].length; i++) {\n let outPort = this.forwardBrackets[port.name][i];\n if (!(outPort in outputEntry)) { outputEntry[outPort] = []; }\n outputEntry[outPort].push(ip);\n }\n if (ip.scope != null) {\n port.scopedBuffer[ip.scope].pop();\n } else {\n port.buffer.pop();\n }\n this.outputQ.push(outputEntry);\n this.processOutputQueue();\n return;\n }\n if (!port.options.triggering) { return; }\n let result = {};\n let input = new ProcessInput(this.inPorts, ip, this, port, result);\n let output = new ProcessOutput(this.outPorts, ip, this, result);\n this.load++;\n return this.handle(input, output, () => output.done());\n }", "title": "" }, { "docid": "b8fece33b0103da4e535d7bf7892d1e5", "score": "0.4670856", "text": "function connect_IFTTT (host: string, eventName: string, key: string, n1: number, n2: number, n3: number) {\r\n if (wifi_connected && key != \"\") {\r\n sendAT(\"AT+CIPSTART=\\\"TCP\\\",\\\"\" + host + \"\\\",80\", 0) // connect to website server\r\n basic.pause(100)\r\n last_upload_successful = false\r\n // + \",\" + n2 + \",\" + n3 \r\n let str: string = \"GET /trigger/\" + eventName + \"/with/key/\" + key + \"?value1=\" + n1 + \"&value2=\" + n2 + \"&value3=\" + n3 + \" HTTP/1.1\" + \"\\u000D\\u000A\" + \"Host: maker.ifttt.com\" + \"\\u000D\\u000A\" + \"Connection: close\" + \"\\u000D\\u000A\" + \"\\u000D\\u000A\";\r\n sendAT(\"AT+CIPSEND=\" + (str.length + 2), 100)\r\n sendAT(str, 0) // upload data\r\n basic.pause(100)\r\n }\r\n}", "title": "" }, { "docid": "f48b1d7ca698ace8976d7d54967efacb", "score": "0.46696755", "text": "function eHandler(error, event) {\n const retVals = event.returnValues;\n console.log(\"ETHEREUM \" + retVals.from + \" transferred \" +\n (retVals.value / tokenDecimals) + \" of \" + tokenSymbol + \" tokens to \" +\n retVals.to + \" - \" + retVals.memo);\n if (retVals.to == coldStore) {\n let amount = (retVals.value / tokenDecimals).toString();\n var json = JSON.stringify({\n contractName: \"tokens\",\n contractAction: \"transfer\",\n contractPayload: {\n symbol: tokenSymbol,\n to: retVals.memo,\n quantity: amount,\n memo: \"Transfer from ethereum\"\n }\n });\n steem.broadcast.customJson(activeWif, [steemName], // Required_auths\n [], // Required Posting Auths\n 'ssc-mainnet1', // Id\n json, function (err, result) { console.log(err, result); });\n }\n}", "title": "" }, { "docid": "53238587b0606e280e75bcf7a84c94db", "score": "0.46678782", "text": "function webvpnPage(bodyReq, originalRequest, originalResponse) {\n\n // recupera la url richiesta\n let urlToGet = getUrlToGetFromWebVpnUrl(originalRequest.url);\n if (!validUrl.isWebUri(urlToGet)) {\n //bad request, devo sempre avere una url da dover accedere\n errToUser(originalResponse, `webvpnPage: url da accedere malformata o non esistente (${urlToGet})`, 400);\n return;\n }\n console.log(`valid url to fetch: ${urlToGet}`);\n let parsedUrl = require('url').parse(urlToGet);\n\n //questa e' la porta da contattare nell'host remoto\n let newReqPort = getPortFromUrl(parsedUrl);\n\n //questo e' l'host da recuperare (senza porta)\n let newReqHost = parsedUrl.host.replace(/:[0-9]+/, '');\n let newReqHeaders = JSON.parse(JSON.stringify(originalRequest.headers));\n //devo riutilizzare tutti gli header della originalRequest tranne host che e' da cambiare\n\n //questo qua sotto non funziona per alcuni siti, meglio togliere la porta\n //non so pero' le ripercussioni per quelli che lo chiedono\n //newReqHeaders.host = `${newReqHost}:${newReqPort}`;\n newReqHeaders.host = newReqHost; //`${newReqHost}:${newReqPort}`;\n\n //devo accettare solo dati non compressi\n newReqHeaders[\"accept-encoding\"] = 'identity';\n //ewReqHeaders[\"Referer\"] = ''; //test //perche' sembra passarlo comunque?\n\n const newReqOptions = {\n protocol: parsedUrl.protocol, //sempre presente\n host: newReqHost, //vuole host senza porta\n port: newReqPort,\n method: originalRequest.method, //sempre presente\n path: parsedUrl.path, //sempre presente\n headers: newReqHeaders,\n //auth: originalRequest.headers.authorization, //siamo sicuri che funziona? \n // certe volte chiede credenziali a caso, pensarci successivamente TODO\n //viene cosi': [authorization, Basic Y2lhbzpjYXp6bw==] su test con post: curl --data \"p\" http://ciao:cazzo@localhost:8081/webvpn/http://ciao.it\n // timeout: ?\n }\n\n let proto;\n if (parsedUrl.protocol.includes(\"https\")) {\n proto = https;\n } else if (parsedUrl.protocol.includes(\"http\")) {\n proto = http;\n } else {\n //non succede mai giusto?\n }\n\n const newReq = proto.request(newReqOptions, (response) => {\n //response.setEncoding('utf8'); // ?? //console.log(`HEADERS: ${JSON.stringify(response.headers)}`);\n\n // alter Location header in response in case of 3xx status code (redirect)\n // da testare\n if(response.statusCode >= 300 &&\n response.statusCode <= 300 &&\n response.headers.hasOwnProperty('location')) {\n let newLocation = response.headers['location'].replace(/^location:\\s/i, '');\n response.headers['location'] == replaceUrl(newLocation, urlToGet);\n }\n\n originalResponse.writeHead(response.statusCode, response.headers);\n //console.log(newReqOptions);\n //console.log(response.statusCode);\n\n let contentType = response.headers['content-type']; \n\n if (urlToGet.endsWith('css') || ( contentType != undefined && contentType.includes('text/css')) ) {\n alterResponse(response, originalResponse, REGEX_TO_ALTER_CSS, urlToGet);\n }\n else if ( contentType != undefined && contentType.includes('text/html')) {\n alterResponse(response, originalResponse, REGEX_TO_ALTER_HTML, urlToGet);\n }\n else { \n // per questi non voglio alterare dati\n response.on('data', (chunk) => {\n originalResponse.write(chunk);\n });\n response.on('end', () => {\n originalResponse.end();\n });\n }\n });\n\n // questo serve per scrivere gli eventali dati di POST\n newReq.on('error', (err) => {\n console.log(`problem with request: ${err.message}`);\n });\n newReq.write(bodyReq);\n newReq.end();\n\n}", "title": "" }, { "docid": "57593e16c24e466d2cdfbc4c59442d7d", "score": "0.4664148", "text": "function handleRequest(request, response)\n{\n\t//console.log(request.url);\n\tvar uri = url.parse(request.url);\n\tvar path = uri.path.split(\"/\");\n\tvar ip = path[2] != \"\" ? path[2] : '127.0.0.1';\n\tvar port = path[3] != \"\" ? path[3] : '5555';\n\tswitch(path[1])\n\t{\n\t\tcase 'desc.xml':\n\t\tresponse.writeHead(200, {'Content-Type': 'text/xml'});\n\t\tresponse.write('<root xmlns=\"urn:schemas-upnp-org:device-1-0\">');\n\t\tresponse.write(\"<specVersion><major>1</major><minor>0</minor></specVersion>\");\n\t\tresponse.write(\"<URLBase>http://\" + ipaddr.address() + \":\" + PORT +\"</URLBase>\");\nresponse.write(\"<device>\");\nresponse.write(\"<deviceType>urn:firecontrol-kjs-me-uk:device:control:1</deviceType>\");\nresponse.write(\"<friendlyName>Fire TV Control</friendlyName>\");\nresponse.write(\"<manufacturer>Kev Swindells</manufacturer>\");\nresponse.write(\"<modelName>Fire TV Control</modelName>\");\nresponse.write(\"<UDN>uuid:74d41391-bfdc-038c-c2af-f935e14aef7f</UDN>\");\nresponse.write(\"<serviceList>\");\nresponse.write(\"<service>\");\nresponse.write(\"<serviceType>urn:firecontrol-kjs-me-uk:service:control:1</serviceType>\");\nresponse.write(\"<serviceId>urn:firecontrol-kjs-me-uk:serviceId:control</serviceId>\");\nresponse.write(\"<controlURL>/ssdp/notfound</controlURL>\");\nresponse.write(\"<eventSubURL>/ssdp/notfound</eventSubURL>\");\nresponse.write(\"</service>\");\nresponse.write(\"</serviceList>\");\nresponse.write(\"</device>\");\nresponse.write(\"</root>\");\n\nresponse.end('');\nbreak;\n\t\tcase 'keypress':\n\t\t\tvar key = (typeof(keys[path[4]])!='undefined') ? keys[path[4]] : keys[path[4]];\n\t\t\tclient.shell(ip + \":\" + port,\"input keyevent \" + key);\n\t\t\tresponse.writeHead(200, {'Content-Type': 'text/plain'});\n\t\t\tresponse.write(\"<title>FireTV</title>\");\n\t\t\tresponse.end('OK');\n\t\t\tbreak;\n\t\tcase 'screen':\n\t\t\tclient.shell(ip + \":\" + port,\"screencap -p /sdcard/screen.png\")\n\t\t\t.then(client.pull(ip + \":\" + port , '/sdcard/screen.png'))\n\t\t\t.then(function(transfer)\n\t\t\t\t{\n\t\t\t\t\treturn new Promise(function(resolve, reject) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar fn = 'screen.png';\n\t\t\t\t\t\t\ttransfer.on('progress', function(stats)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log('[%s] Pulled %d bytes so far',\"\",stats.bytesTransferred)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\ttransfer.on('end', function() \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log('[%s] Pull complete', \"\")\n\t\t\t\t\t\t\t\tresolve(ip + \":\" + port)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\ttransfer.on('error', function(err) { console.log(err)})\n\t\t\t\t\t\t\ttransfer.pipe(fs.createWriteStream(fn))\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t.then(function() { console.log(\"done\") })\n\t\t\t.catch(function(err) {\n\t\t\t\tconsole.error('Something went wrong:', err.stack)\n\t\t\t})\n\t\t\tresponse.write(\"<title>FireTV</title>\");\n\t\t\tresponse.end(\"\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresponse.writeHead(404, {'Content-Type': 'text/plain'});\n\t\t\tresponse.end('File Not Found: ' + path);\n\t}\n}", "title": "" }, { "docid": "287d0e669ad9a3c481454f2c054228f8", "score": "0.4662629", "text": "function convertIPAddress(ip) {\n if (ip > 0) {\n return ((ip & 0xff) +\n \".\" +\n ((ip >>> 8) & 0xff) +\n \".\" +\n ((ip >>> 16) & 0xff) +\n \".\" +\n ((ip >>> 24) & 0xff));\n }\n}", "title": "" }, { "docid": "bf207ff1aff530e36f173455fce4c87e", "score": "0.46404496", "text": "function checkCustomAddr() {\n if (!validateInputAddresses(addrInput.value)) {\n addrInfo.innerHTML = '<br><div class=\"alert alert-danger\" role=\"alert\"><strong>Error!</strong> Invalid address!</div>';\n return;\n }\n var isCheck = $('.checkNet').is(':checked');\n window.location.href = 'https://keepnode.app/?address='+addrInput.value+\"&mainnet=\"+isCheck;\n}", "title": "" }, { "docid": "9f3de4377a6cc09361390daa786415a6", "score": "0.46388057", "text": "function ether (n) {\n return web3.utils.toWei(n.toString(), 'ether');\n }", "title": "" }, { "docid": "7e76f0c31ad251d49099cdb4a8a4144a", "score": "0.46376914", "text": "function convert_addr(ipchars){\n var bytes = ipchars.split('.');\n var result = ((bytes[0] & 0xff) << 24) |\n ((bytes[1] & 0xff) << 16) |\n ((bytes[2] & 0xff) << 8) |\n (bytes[3] & 0xff);\n return result;\n}", "title": "" }, { "docid": "58a91751f1eda38cac2b5d58480202ca", "score": "0.46182945", "text": "logOutput(header, request) {\n console.log(header[['x-forwarded-for']]);\n console.log(request);\n }", "title": "" }, { "docid": "68393230386ace8b470c86ab0083de80", "score": "0.46172172", "text": "handler(app, req, res) {\n const address = req.query.p0;\n if (!address) {\n return res.status(400).send({\n api_status : 'fail',\n api_message: 'p0<address> is required'\n });\n }\n try {\n const {\n address : addressBase,\n identifier: addressKeyIdentifier,\n version : addressVersion\n } = this.addressRepository.getAddressComponent(address);\n res.send({\n is_valid : this._isValid(addressBase, addressVersion, addressKeyIdentifier),\n address_base : addressBase,\n address_version : addressVersion,\n address_key_identifier: addressKeyIdentifier\n });\n }\n catch (e) {\n res.send({\n api_status : 'fail',\n api_message: `unexpected generic api error: (${e})`\n });\n }\n }", "title": "" }, { "docid": "8e6f4a89ee296572c6027d61fc1f5cd2", "score": "0.45991296", "text": "function convertIPtoHex(line) {\n //alert(line);\n var match = /(\\d+\\.\\d+\\.\\d+\\.\\d+)/.exec(line);\n if (match) {\n var matchText = match[1];\n var ipParts = matchText.split('.');\n var p3 = parseInt(ipParts[3],10);\n var p3x = p3.toString(16);\n var p2 = parseInt(ipParts[2],10);\n var p2x = p2.toString(16);\n var p1 = parseInt(ipParts[1],10);\n var p1x = p1.toString(16);\n var p0 = parseInt(ipParts[0],10);\n var p0x = p0.toString(16);\n var dec = p3 + p2 * 256 + p1 * 256 * 256 + p0 * 256 * 256 * 256;\n var hex = dec.toString(16);\n function pad2 (hex) {\n while (hex.length < 2) {\n hex = \"0\" + hex;\n }\n return hex;\n }\n function pad8 (hex) {\n while (hex.length < 8) {\n hex = \"0\" + hex;\n }\n return hex;\n }\n hex = \"0x\" + pad8(hex);\n return hex;\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "39d2266f53a00d7f80db41177fe05642", "score": "0.45970005", "text": "function getClientAddress(req) {\r\n return (req.headers['x-forwarded-for'] || '').split(',')[0] \r\n || req.connection.remoteAddress;\r\n}", "title": "" }, { "docid": "1e09126956f4342f7d4868e4b7b923dd", "score": "0.45854938", "text": "function redirectToHome(request, response) {\n\n \tresponse.writeHead(301, {\n \t\tLocation: (request.socket.encrypted ? 'https://' : 'http://') +\n \t\t\t\trequest.headers.host\n \t}\n\t);\n\tresponse.end();\n}", "title": "" }, { "docid": "c22d29a68da17b85662f5e9d05b7b127", "score": "0.4577867", "text": "function getLastContractAddress(req) {\n\n\tvar addr = 'unknown';\n\n\tif (process.env.CONTRACT_ADDR) {\n addr = process.env.CONTRACT_ADDR;\n\t}\n\n\tif (req.query && req.query.addr) {\n if (req.query.addr == \"0x00...00\") {\n addr = 'unknown';\n }\n else {\n addr = req.query.addr;\n }\n\t}\n\t\n\treturn addr;\n}", "title": "" }, { "docid": "9f22ed291651ee6715cc77760a71fc02", "score": "0.45683733", "text": "function sendTracerouteRequest(ipaddress, TTL) { \n\tvar httpRequest = new XMLHttpRequest();\n\t\t\n\thttpRequest.onreadystatechange = function() { // When a response is received\n\t\tif (httpRequest.readyState == 4 && httpRequest.status == 200) {\n\t\t\tserverResponse = JSON.parse(this.responseText);\n\t\t\tconsole.log(serverResponse);\t// printing the response in the console for debugging\n\t\t\tprocessResponse(serverResponse, TTL);\n\t\t}\n\t};\n\t\t\n\t// Selecting database method\n\tvar selectedDB;\n\tif($('#dbGeoLite').prop(\"checked\"))\n\t\tselectedDB = 0;\n\telse\n\t\tselectedDB = 1;\n\n\thttpRequest.open(\"POST\", \"request.php\", true);\n\thttpRequest.setRequestHeader(\"Content-type\", \"application/json\");\n\thttpRequest.send(JSON.stringify({ip:ipaddress, database:selectedDB, TTL:TTL}));\n\n\tconsole.log(\"Sent: \" + JSON.stringify({ip:ipaddress, database:selectedDB, TTL:TTL})); // Just in case for debugging, will remove later \n}", "title": "" }, { "docid": "a69a89679d342d791005ae2040b0da61", "score": "0.4567631", "text": "handleSocks5Request() {\n if (this.inbuf.length < 4) {\n return;\n }\n\n // Find the address:port requested.\n var atype = this.inbuf[3];\n var len, addr;\n if (atype == 0x01) {\n // IPv4 Address\n len = 4;\n addr = this.inbuf.slice(4, 8).join(\".\");\n } else if (atype == 0x03) {\n // Domain name\n len = this.inbuf[4];\n addr = String.fromCharCode.apply(null, this.inbuf.slice(5, 5 + len));\n len = len + 1;\n } else if (atype == 0x04) {\n // IPv6 address\n len = 16;\n addr = this.inbuf\n .slice(4, 20)\n .map(i => i.toString(16))\n .join(\":\");\n }\n var port = (this.inbuf[4 + len] << 8) | this.inbuf[5 + len];\n dump(\"Requesting \" + addr + \":\" + port + \"\\n\");\n\n // Map that data to the port we report.\n var foundPort = gPortMap.get(addr + \":\" + port);\n dump(\"This was mapped to \" + foundPort + \"\\n\");\n\n if (foundPort !== undefined) {\n this.write(\n \"\\x05\\x00\\x00\" + // Header for response\n \"\\x04\" +\n \"\\x00\".repeat(15) +\n \"\\x01\" + // IPv6 address ::1\n String.fromCharCode(foundPort >> 8) +\n String.fromCharCode(foundPort & 0xff) // Port number\n );\n } else {\n this.write(\n \"\\x05\\x05\\x00\" + // Header for failed response\n \"\\x04\" +\n \"\\x00\".repeat(15) +\n \"\\x01\" + // IPv6 address ::1\n \"\\x00\\x00\"\n );\n this.close();\n return;\n }\n\n // At this point, we contact the local server on that port and then we feed\n // the data back and forth. Easiest way to do that is to open the connection\n // and use the async copy to do it in a background thread.\n let sts = Cc[\"@mozilla.org/network/socket-transport-service;1\"].getService(\n Ci.nsISocketTransportService\n );\n let trans = sts.createTransport([], \"localhost\", foundPort, null, null);\n let tunnelInput = trans.openInputStream(0, 1024, 1024);\n let tunnelOutput = trans.openOutputStream(0, 1024, 1024);\n this.sub_transport = trans;\n NetUtil.asyncCopy(tunnelInput, this.client_out);\n NetUtil.asyncCopy(this.client_in, tunnelOutput);\n }", "title": "" }, { "docid": "ff4cba79e30165f73947f679cf211b96", "score": "0.45557475", "text": "static interfaceAddress (iface) {\n // return interface address with IPv6 scope if needed\n return `${iface.address}${([Constants.IPv4, Constants.IPv4_INT].includes(iface.family) ? '' : '%' + iface.name)}`;\n }", "title": "" }, { "docid": "c35c8dea7935b9e0b55e8ca745ba69d4", "score": "0.45259863", "text": "function switchContractForFrom(symbol){\n\n\n switch (symbol){\n case 'R':\n address = '0xff';\n contractFrom(address);\n\n case 'A':\n address = '0xaf';\n contractFrom(address);\n\n }\n}", "title": "" }, { "docid": "d9b0d2aad598ad89a138a8776a175cd5", "score": "0.45255888", "text": "handleAddPeerRequest()\n\t{\n\t\tvar self = this;\n\n\t\tself.server.get('/peers/add/:ip', function(req, res) {\n\t\t\tvar result = self.app.p2pNetwork.addPeer(req.params.ip)\n\t\t\tif (!result)\n\t\t\t\tres.send(Response.give(req.params.ip));\n\t\t\telse\n\t\t\t\tres.send(Response.giveError(result));\n\t\t});\n\t}", "title": "" }, { "docid": "2f560ca2ac1aaffc44a3da9e10a57327", "score": "0.45153904", "text": "function checkIP(ipToCheck, callback) {\n request.get(requestType + ipToCheck + '/solar_api/GetAPIVersion.cgi', function (error, response, body) {\n try {\n const testData = JSON.parse(body);\n if (!error && response.statusCode == 200 && 'BaseURL' in testData) {\n callback({error: 0, message: testData});\n } else {\n adapter.log.error(\"IP invalid\");\n callback({error: 1, message: {}});\n }\n } catch (e) {\n adapter.log.error(\"IP is not a Fronis inverter\");\n callback({error: 1, message: {}});\n }\n });\n}", "title": "" }, { "docid": "58385e4e265b91dbef94873bd87a5dee", "score": "0.45116776", "text": "function createInbound(req, res) {\n\t\t// assert(toAddress == theGatewaysAddress);\n\t\treq.body.issuance = false;\t\n\n req.checkBody('destinationTag', 'Invalid destinationTag')\n .notEmpty().isAlphanumeric();\n req.checkBody('toCurrency', 'Invalid toCurrency')\n .notEmpty().isAlphanumeric();\n req.checkBody('fromCurrency', 'Invalid fromCurrency')\n .notEmpty().isAlphanumeric();\n req.checkBody('toAmount', 'Invalid toAmount')\n .notEmpty().isDecimal();\n req.checkBody('fromAmount', 'Invalid fromAmount')\n .notEmpty().isDecimal();\n req.checkBody('txState', 'Invalid transactionState')\n .notEmpty().is('tesSUCCESS');\n req.checkBody('txHash', 'Invalid transactionHash')\n .notEmpty().isAlphanumeric();\n req.checkBody('toAddress', 'Invalid toAddress')\n .notEmpty().isAlphanumeric();\n req.checkBody('fromAddress', 'Invalid fromAddress')\n .notEmpty().isAlphanumeric();\n \n var errors = req.validationErrors();\n if (errors) {\n\t\t\terrorResponse(res)(util.inspect(errors));\n }\n\n\t\tBalance.findOrCreateByCurrencyAndBankAccountId(\n\t\t\treq.body.destinationTag, req.body.toCurrency, function(err, balance) {\n\t\t\tif (err) {\n\t\t\t\terrorResponse(res)(err);\n\t\t\t} else {\n\t\t\t\tRippleTransaction.createIncomingWithBalance(balance, req.body, function(err, tx){\n\t\t\t\t\tif (err) { errorResponse(res)(err) }\n\t\t\t\t\tres.send(tx);\n\t\t\t\t});\n\t\t\t}\n\t\t})\n }", "title": "" }, { "docid": "0575f2ab4667b9661f5bce22df1873fc", "score": "0.4508031", "text": "function allowExternalIP (req, res, next) {\n\tif(isAllowedIP(req.ip)){\n\t\tnext();\n\t} \n\telse{\n\t\tconsole.log(\"WARN: Rejected\",req.ip, \" To allow access restart with -X flag.\");\n\t\tres.status(403).end('');\n\t}\n}", "title": "" }, { "docid": "b62d757793906b92e20f9030372e022f", "score": "0.44864985", "text": "function hook_Address(){\n Java.perform(function(){\n Java.use(\"java.net.InetSocketAddress\").$init.overload('java.net.InetAddress', 'int').implementation = function(addr,int){\n var result = this.$init(addr,int)\n if(addr.isSiteLocalAddress()){\n console.log(\"Local address => \",addr.toString(),\" port is => \",int)\n }else{\n console.log(\"Server address => \",addr.toString(),\" port is => \",int)\n }\n \n return result;\n }\n \n })\n}", "title": "" }, { "docid": "4cfd0612e8251739a24df6c78bfc9a69", "score": "0.44853377", "text": "function handler(req, res, next) {\n req.federatedUser = { id: '248289761001', provider: 'http://server.example.net' };\n res.resumeState({ beep: 'boop' }, next);\n }", "title": "" }, { "docid": "9bb9d12a9104f067ab7fa21e933162a1", "score": "0.44751814", "text": "function checkip(req, res, next) {\n\n if (config.public_query) {\n\n return next();\n\n } else {\n\n var client_ip = ipaddr.parse(req.headers['x-forwarded-for'] || req.connection.remoteAddress);\n\n if (config.ip_whitelist[0]) {\n config.ip_whitelist.forEach(function(iprange) {\n var ip = ipaddr.parse(iprange.slice(0, iprange.indexOf('/'))),\n range = parseInt(iprange.slice(iprange.indexOf('/') + 1));\n if (client_ip.match(ip, range)) {\n return next();\n }\n });\n return res.send(401);\n }\n\n }\n\n}", "title": "" }, { "docid": "db5b8379710bb34653c0fe8e3b09e72f", "score": "0.4472234", "text": "function handleRequestOne(request, response) {\n\n//send the below string to the client when the user visits the PORT url\nresponse.end(\"Good Job! Keep going!!!: \" + request.url);\n}", "title": "" }, { "docid": "5057d187bf84f5c4ef48393e3810b1c1", "score": "0.44667917", "text": "getAddress(path, boolDisplay, boolChaincode) {\n let paths = splitPath(path);\n let buffer = new Buffer(1 + paths.length * 4);\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n return this.transport\n .send(\n CLA,\n 0x02,\n boolDisplay ? 0x01 : 0x00,\n boolChaincode ? 0x01 : 0x00,\n buffer\n )\n .then(response => {\n let result = {};\n result.publicKey = response.slice(0, 65);\n result.address = response.slice(67, 101).toString();\n return result;\n });\n }", "title": "" }, { "docid": "dd11e7afb14fef862bf272443e16c41c", "score": "0.44635025", "text": "function onRequest(request, response){\r\n\r\n\t\trequest.on('error', function(err) {\r\n\t\t\tconsole.log('problem with request: ' + err.message);\r\n\t\t\tconsole.error(err);\r\n\t\t\tresponse.writeHead(500, {\"Content-Type\": \"text/plain\"});\r\n \t\tresponse.end('500 Error: Internal server error');\r\n\t\t\t});\r\n\r\n\t\t//Decispher incoming request\r\n\t\tvar URL = url.parse(request.url, true);\r\n\t\tconsole.log(\"Request for \" + URL.href + \" recieved.\");\r\n\t\troute(handle, URL, response);\r\n\t}", "title": "" }, { "docid": "53f2c11e3dc29bfc4cd05ac52d08e34a", "score": "0.44480935", "text": "function handleRequestOne(request, response) {\n\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"You're a great person\");\n}", "title": "" }, { "docid": "def4981bf493778ea7824c69aaeff8d8", "score": "0.44472146", "text": "fastForward(context) {\n socket.emit('fast forward');\n }", "title": "" }, { "docid": "04c5d2cb8077e82e50f8630d6b301119", "score": "0.4444602", "text": "function ProxyEngine(options) {\n this.configuration = options;\n console.dir(this.configuration);\n this.router = (function(req, res, next) {\n if (req._parsedUrl.pathname !== this.configuration.hosting.main.proxy) {\n next();\n } else {\n console.warn(\"+++ PROXY REQUEST +++\");\n var body = [];\n var body_len = 0;\n req.on('data', function(data) {\n body.push(data);\n body_len += data.length;\n // 1e6 === 1 * Math.pow(10, 7) === 1 * 10,000,000 ~~~ 10MB\n if (body_len > 1e7) {\n // FLOOD ATTACK OR FAULTY CLIENT, NUKE REQUEST\n req.connection.destroy();\n }\n });\n req.on('end', function() {\n// console.log(body);\n // load the xml send in POST body and extract the redirect URL value\n var doc_str = String(Buffer.concat(body));\n var xml = new dom().parseFromString(doc_str);\n var proxy_to = xpath.select(\"//proxy/redirect_url/text()\", xml)[0].toString();\n\n\n // TODO: is cache-replay enabled?\n\n // remove the password token info from the request before we generate the hash value (so it is consistent between different logins)\n var hashstr = [];\n var temp = xpath.select(\"//security/domain/text()\", xml)[0].toString();\n hashstr.push(temp);\n var temp = xpath.select(\"//security/username/text()\", xml)[0].toString();\n hashstr.push(temp);\n var token = \"<message_body\";\n var pos_start = doc_str.search(token);\n token = \"</message_body>\";\n var pos_end = doc_str.search(token);\n var temp = doc_str.substr(pos_start, pos_end - pos_start + token.length);\n hashstr.push(temp);\n\n // [YES] TODO: analyze the request portion of the i2b2 message and compute a hash value.\n // check our local database for a record that has a matching request cache value\n // if found then serve up the cached result (remember to replace the security token)\n var hash = crypto.createHash('sha256');\n // build hash of body\n hash.update(temp);\n hashstr.push(hash.digest('hex'));\n\n\n // forward the request to the redirect URL\n proxy_to = url.parse(proxy_to);\n var client_ip = req.connection.remoteAddress ||\n req.socket.remoteAddress ||\n req.connection.socket.remoteAddress;\n\n var headers = {};\n _.forEach(req.headers, (value, key) => {\n headers[key] = value;\n });\n headers[\"Content-Type\"] = 'text/xml';\n// headers[\"via\"] = 'i2b2 Overlay Server Proxy';\n// headers[\"forwarded\"] = `for=${client_ip}`;\n// headers[\"x-forwarded-for\"] = client_ip;\n delete headers['cookie'];\n delete headers['host'];\n delete headers['origin'];\n delete headers['referer'];\n delete headers['content-length'];\n\n var opts = {\n protocol: proxy_to.protocol,\n hostname: proxy_to.hostname,\n port: proxy_to.port,\n path: proxy_to.path,\n method: req.method,\n headers: headers\n }\n if (opts['port'] === null) delete opts['port'];\n\n console.warn(\"making proxied request to...\");\n console.dir(opts);\n\n var i2b2_result = [];\n const proxy_reqest_hdlr = function(proxy_res) {\n res.statusCode = proxy_res.statusCode;\n _.forEach(proxy_res.headers, (value, key) => {\n res.setHeader(key, value);\n });\n res.setHeader('i2b2-dev-svr-mode', 'Proxy');\n res.removeHeader('set-cookie');\n res.setHeader('Content-Type', 'text/xml');\n proxy_res.on('data', (chunk) => {\n i2b2_result.push(chunk);\n });\n proxy_res.on('end', () => {\n res.end(Buffer.concat(i2b2_result));\n });\n }\n\n switch (proxy_to.protocol) {\n case \"http:\":\n var proxy_request = http.request(opts, proxy_reqest_hdlr);\n break;\n case \"https:\":\n // TODO: Do not allow this insanely insecure hack to accept self-signed SSL Certificates\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n var proxy_request = https.request(opts, proxy_reqest_hdlr);\n break;\n default:\n console.error(\"proxy engine does not support protocol = \" + proxy_to.protocol);\n return false;\n break;\n }\n\n proxy_request.on('error', (e) => {\n console.error(`problem with request: ${e.message}`);\n res.end(String(Buffer.concat(i2b2_result)));\n });\n\n body = String(Buffer.concat(body));\n res.setHeader('i2b2-dev-svr-mode', 'Proxy');\n proxy_request.setHeader('Content-Type', 'text/xml');\n proxy_request.setHeader('Content-Length', body.length);\n proxy_request.end(body);\n\n })\n }\n }).bind(this);\n\n\n\n}", "title": "" }, { "docid": "0925f1437a494c1b1ebb9a3f1157619b", "score": "0.44400173", "text": "function activateTorProxy(){\n //Sending action to index page\n self.port.emit(\"activateTorProxy\");\n }", "title": "" }, { "docid": "25ac9ec20b8bc242887c08be7ae29e97", "score": "0.4430929", "text": "function tran (req, res) {\n\t\t\tif (!req || !res || !req.body || !req.headers) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (req.url) {\n\t\t\t\treq.url = url.format(req.url);\n\t\t\t}\n\t\t\t// var msg = req.body;\n\t\t\tgun.on('in', req.body);\n\t\t\t// // AUTH for non-replies.\n\t\t\t// if(gun.wsp.msg(msg['#'])){ return }\n\t\t\t// gun.wsp.on('network', Gun.obj.copy(req));\n\t\t\t// if(msg['@']){ return } // no need to process.\n\t\t\t// if(msg['$'] && msg['$']['#']){ return tran.get(req, res) }\n\t\t\t// //if(Gun.is.lex(msg['$'])){ return tran.get(req, res) }\n\t\t\t// else { return tran.put(req, res) }\n\t\t\t// cb({body: {hello: 'world'}});\n\t\t\t// // TODO: BUG! server put should push.\n\t\t}", "title": "" }, { "docid": "1556f93b8bddf9ffd2155b2005d03fd4", "score": "0.44275364", "text": "function makeGatewayURL(ipfsURI) {\n return ipfsURI.replace(/^ipfs:\\/\\//, \"https://dweb.link/ipfs/\");\n}", "title": "" }, { "docid": "c85d4d9f63089ee15afb777abae64fb3", "score": "0.44251204", "text": "function Edit_External_Party_Address(id,res)\n{\n if (res== 0) \n {\n \n General_call(\"Edit_External_Party_Address\", 0);\n \n }\n else\n {\n Bind_Edit_External_Party_Address(res);\n\n }\n}", "title": "" }, { "docid": "2221412fc5c0e1d251afe392971e1c6c", "score": "0.44207197", "text": "async uploadDFSPIngressEndpoints(opts,body) {\n let request;\n if(opts.type === 'IP'){\n request = {\n address: body.address,\n ports: body.ports\n };\n } else {\n request = {\n url: body.address\n };\n }\n request.type = opts.type;\n request.direction = 'INGRESS';\n return this._requests.post(`environments/${this._envId}/dfsp/endpoints`,request);\n }", "title": "" }, { "docid": "74b57b5c8aee6dbcfa03a40e0fb08d25", "score": "0.44086736", "text": "_requestTransportIncidentsLayerUpdate() {\n //console.debug('updating transport incidents layer');\n this._fetchTransportResource('transport-incidents');\n }", "title": "" }, { "docid": "e8a5550e4d7d7a14dbe484b5ef46caa5", "score": "0.439689", "text": "function getClientIPAddress() {\n return getHeader(\"x-forwarded-for\").split(',')[0];\n}", "title": "" }, { "docid": "c0743bd76b9d02e313f085562c25d5e7", "score": "0.43936586", "text": "function sHandler(res, x) {\n if (x.contractPayload.symbol == tokenSymbol) {\n const vars = x.contractPayload;\n console.log(\"STEEM \" + res.required_auths + \" transferred \" +\n vars.quantity + \" \" + vars.symbol +\n \" tokens to \" + vars.to + \" - \" + vars.memo);\n if (vars.to == steemName) {\n const amount = vars.quantity * tokenDecimals;\n token.methods.approve(coldStore, amount)\n .send({ from: coldStore })\n .on('receipt', function (receipt) { console.log(receipt); })\n .on('error', console.error);\n token.methods.ourTransferFrom(coldStore, vars.memo, amount, \"from Steem\")\n .send({ from: coldStore })\n .on('receipt', function (receipt) { console.log(receipt); })\n .on('error', console.error);\n }\n }\n}", "title": "" }, { "docid": "8990aed6c12ecefd0a98941151ee33aa", "score": "0.4390243", "text": "function getTransformerAddress(deployer, nonce) {\n return ethjs.bufferToHex(\n // tslint:disable-next-line: custom-no-magic-numbers\n ethjs.rlphash([deployer, nonce]).slice(12));\n}", "title": "" }, { "docid": "a211550ae34840e8cadd6e2bbc655c45", "score": "0.43885288", "text": "function handleRequestTwo(request, response) {\n\n//send the below string to the client when the user visits the PORT url\nresponse.end(\"Booo BOOOO! GO HOME!!!: \" + request.url);\n}", "title": "" }, { "docid": "1b46f5d68cc908a8ab69da77b694c5b7", "score": "0.43698907", "text": "function ip1148532() { return '= 200'; }", "title": "" }, { "docid": "208da4a6f55eca62f567f92a666bd8ba", "score": "0.43679875", "text": "function getENSContenthash(address) {\r\n\tvar dig = address.slice(14);\r\n\treturn ipfsAddressfromHex(dig);\r\n}", "title": "" }, { "docid": "fae8b085c6397392ab9a0036c5008da6", "score": "0.43600342", "text": "function getIP(req) {\n return (req.headers[\"X-Forwarded-For\"] || req.headers[\"x-forwarded-for\"] || req.client.remoteAddress);\n }", "title": "" }, { "docid": "c5bcd69e9a16b176fe078530b85c5758", "score": "0.4350587", "text": "async function swapDirect() {\n const [owner] = await ethers.getSigners();\n const dai = new ethers.Contract(DAI.tokenAddress, erc20_abi, owner);\n const link = new ethers.Contract(LINK.tokenAddress, erc20_abi, owner);\n const deadline = Math.floor(Number(new Date()) / 1000) + 300;\n const router = new ethers.Contract(UNISWAP_ROUTER_ADDRESS, router_abi, owner);\n const WETH_ADDRESS = await router.WETH();\n console.log(owner);\n // let result = await router.swapExactETHForTokens(\n // 0,\n // [WETH_ADDRESS, DAI.tokenAddress],\n // owner.address,\n // deadline,\n // { value: BigNumber.from(10).pow(17) }\n // );\n\n // let daibalance = await dai.balanceOf(owner.address);\n // console.log(`DAI ${daibalance}`);\n // result = await dai.approve(UNISWAP_ROUTER_ADDRESS, daibalance);\n // console.log(\n // 'allowance',\n // await dai.allowance(owner.address, UNISWAP_ROUTER_ADDRESS)\n // );\n // let gasPrice = BigNumber.from(10).pow(9);\n // let gasLimit = BigNumber.from(10).pow(6);\n // result = await router.swapExactTokensForETH(\n // daibalance,\n // 0,\n // [DAI.tokenAddress, WETH_ADDRESS],\n // owner.address,\n // deadline,\n // { gasPrice, gasLimit }\n // );\n // console.log(result);\n // console.log('-----------');\n // console.log(await result.wait());\n}", "title": "" }, { "docid": "77a7ce984c8924b4ad53fdaef8f5d8f2", "score": "0.4348422", "text": "getAddress(path, boolDisplay, boolChaincode) {\n let paths = (0, _utils.splitPath)(path);\n let buffer = Buffer.alloc(1 + paths.length * 4);\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n return this.transport.send(0xe0, 0x02, boolDisplay ? 0x01 : 0x00, boolChaincode ? 0x01 : 0x00, buffer).then(response => {\n let result = {};\n let publicKeyLength = response[0];\n let addressLength = response[1 + publicKeyLength];\n result.publicKey = response.slice(1, 1 + publicKeyLength).toString(\"hex\");\n result.address = \"0x\" + response.slice(1 + publicKeyLength + 1, 1 + publicKeyLength + 1 + addressLength).toString(\"ascii\");\n\n if (boolChaincode) {\n result.chainCode = response.slice(1 + publicKeyLength + 1 + addressLength, 1 + publicKeyLength + 1 + addressLength + 32).toString(\"hex\");\n }\n\n return result;\n });\n }", "title": "" }, { "docid": "77a7ce984c8924b4ad53fdaef8f5d8f2", "score": "0.4348422", "text": "getAddress(path, boolDisplay, boolChaincode) {\n let paths = (0, _utils.splitPath)(path);\n let buffer = Buffer.alloc(1 + paths.length * 4);\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n return this.transport.send(0xe0, 0x02, boolDisplay ? 0x01 : 0x00, boolChaincode ? 0x01 : 0x00, buffer).then(response => {\n let result = {};\n let publicKeyLength = response[0];\n let addressLength = response[1 + publicKeyLength];\n result.publicKey = response.slice(1, 1 + publicKeyLength).toString(\"hex\");\n result.address = \"0x\" + response.slice(1 + publicKeyLength + 1, 1 + publicKeyLength + 1 + addressLength).toString(\"ascii\");\n\n if (boolChaincode) {\n result.chainCode = response.slice(1 + publicKeyLength + 1 + addressLength, 1 + publicKeyLength + 1 + addressLength + 32).toString(\"hex\");\n }\n\n return result;\n });\n }", "title": "" }, { "docid": "77a7ce984c8924b4ad53fdaef8f5d8f2", "score": "0.4348422", "text": "getAddress(path, boolDisplay, boolChaincode) {\n let paths = (0, _utils.splitPath)(path);\n let buffer = Buffer.alloc(1 + paths.length * 4);\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n return this.transport.send(0xe0, 0x02, boolDisplay ? 0x01 : 0x00, boolChaincode ? 0x01 : 0x00, buffer).then(response => {\n let result = {};\n let publicKeyLength = response[0];\n let addressLength = response[1 + publicKeyLength];\n result.publicKey = response.slice(1, 1 + publicKeyLength).toString(\"hex\");\n result.address = \"0x\" + response.slice(1 + publicKeyLength + 1, 1 + publicKeyLength + 1 + addressLength).toString(\"ascii\");\n\n if (boolChaincode) {\n result.chainCode = response.slice(1 + publicKeyLength + 1 + addressLength, 1 + publicKeyLength + 1 + addressLength + 32).toString(\"hex\");\n }\n\n return result;\n });\n }", "title": "" }, { "docid": "fa2e735a5a03272fe79d86ff721d3ead", "score": "0.4346124", "text": "function handler (req, res) {\n\t\n\t// Get params object\n\t// http://stackoverflow.com/questions/8590042/parsing-query-string-in-node-js\n\tvar params = url.parse(req.url, true).query;\n\t\n\t// Authenticate\n\tif(params.salt) {\n\t\t\n\t\t// Decode params\n\t\tfor(var i in params) {\n\t\t\ti = decodeURI(i);\n\t\t}\n\t\t\n\t\tvar pass = params.salt;\n\t\t\n\t\tif(pass == 'akosha101') {\n\t\t\tbroadcastMessage(params.Channel, params);\n//\t\t\tbroadcastMessage(decodeURI(params.Name),decodeURI(params.Id),decodeURI(params.CompanyName),decodeURI(params.Location),decodeURI(params.Amount),decodeURI(params.CreatedAt),decodeURI(params.CompanyId),decodeURI(params.CompanyUrl));\n\t\t} else {\n\t\t\tconsole.log(\"Authentication Error\");\n\t\t}\n\t\t\n\t\tres.writeHead(200, {'Content-Type': 'text/plain'});\n\t\tres.end(\"\");\n\t\t\n\t} else {\n\t\tfs.readFile(__dirname + '/fayeclient.html', function(err, data) {\n\t\t\tif (err) {\n\t \t\t\tres.writeHead(500);\n\t \t\t\treturn res.end('Error loading html');\n\t\t\t}\n\t\t\tres.writeHead(200);\n\t \tres.end(data);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "2868abd71bbb34a4ae80385479d9042c", "score": "0.43444788", "text": "async function _sendTx({\n web3,\n marketplaceListingId,\n ipfsHashBytes,\n fromAddress,\n proxyAddress,\n marketplaceContractAddress,\n gasPrice\n}) {\n let tx\n const marketplaceContract = new web3.eth.Contract(\n marketplaceAbi,\n marketplaceContractAddress\n )\n const txToSend = marketplaceContract.methods.updateListing(\n marketplaceListingId,\n ipfsHashBytes,\n 0\n )\n\n if (proxyAddress) {\n console.log(`Updating listing via proxy at address ${proxyAddress}.`)\n const proxyContract = new web3.eth.Contract(proxyAbi, proxyAddress)\n\n // Wrap the tx so that we can send it via the proxy contract.\n const txData = await txToSend.encodeABI()\n const wrapTxToSend = proxyContract.methods.execute(\n 0,\n marketplaceContractAddress,\n '0',\n txData\n )\n\n try {\n tx = await wrapTxToSend.send({\n from: fromAddress,\n gas: 500000,\n gasPrice\n })\n } catch (e) {\n console.log('Send tx via proxy error:', e)\n throw new Error('Failed updating the listing on the marketplace')\n }\n } else {\n console.log(`Updating listing directly from address ${fromAddress}`)\n try {\n tx = await txToSend.send({ from: fromAddress, gas: 350000, gasPrice })\n } catch (e) {\n console.log('Send tx error:', e)\n throw new Error('Failed updating the listing on the marketplace')\n }\n }\n console.log('Sent tx to update the listing:', tx)\n return tx\n}", "title": "" }, { "docid": "37c3ce21c3beffd8809e4d63af18a1bd", "score": "0.43430674", "text": "handleRequest (payload, next, end) {\n let txData\n switch (payload.method) {\n case 'generate_transaction':\n if (payload.txData) {\n txData = payload.txData\n } else {\n txData = payload.params[0]\n }\n try {\n var genTxWithInfo = (error, data) => {\n // if(error) throw error\n console.log(\"genTxWithInfo\", data); // todo remove dev item\n var rawTx = {\n nonce: sanitizeHex(data.nonce),\n gasPrice: data.isOffline ? sanitizeHex(data.gasprice) : sanitizeHex(addTinyMoreToGas(data.gasprice)),\n gasLimit: txData.gasLimit ? sanitizeHex(decimalToHex(txData.gasLimit)) : sanitizeHex(decimalToHex(txData.gas)),\n to: sanitizeHex(txData.to),\n value: sanitizeHex(decimalToHex(toWei(txData.value, txData.unit))),\n data: txData.data ? sanitizeHex(txData.data) : ''\n }\n if (this.engine.network.eip155) rawTx.chainId = this.engine.network.chainId\n rawTx.data = rawTx.data === '' ? '0x' : rawTx.data\n // var eTx = new EthTx(rawTx)\n\n this.emitPayload({\n id: payload.id,\n method: 'sign_tx',\n params: [rawTx]\n }, end)\n }\n\n if (txData.nonce || txData.gasPrice) {\n var data = {\n nonce: txData.nonce,\n gasprice: txData.gasPrice\n }\n data.isOffline = txData.isOffline ? txData.isOffline : false\n genTxWithInfo(null, data)\n } else {\n this.emitIntermediate({\n type: \"batch\",\n balance: {\n 'id': getRandomBytes(16).toString('hex'),\n 'jsonrpc': '2.0',\n 'method': 'eth_getBalance',\n 'params': [txData.from, 'pending']\n },\n gasprice: {\n 'id': getRandomBytes(16).toString('hex'),\n 'jsonrpc': '2.0',\n 'method': 'eth_gasPrice',\n 'params': []\n },\n nonce: {\n 'id': getRandomBytes(16).toString('hex'),\n 'jsonrpc': '2.0',\n 'method': 'eth_getTransactionCount',\n 'params': [txData.from, 'pending']\n }\n }, genTxWithInfo)\n // ajaxReq.getTransactionData(txData.from, function(data) {\n // if (data.error && callback !== undefined) {\n // callback({\n // isError: true,\n // error: e\n // });\n // } else {\n // data = data.data;\n // data.isOffline = txData.isOffline ? txData.isOffline : false;\n // genTxWithInfo(data);\n // }\n // });\n }\n } catch (e) {\n if (end !== undefined) {\n end({\n isError: true,\n error: e\n })\n }\n }\n\n return\n default:\n next()\n return\n }\n }", "title": "" }, { "docid": "260fc73e459a46a774ed37705c8c2e94", "score": "0.4338219", "text": "function getIpfsLink(link) {\n if (link.match(/^ipfs:\\/\\/ipfs\\//i)) {\n link = link.substring(12);\n }\n else if (link.match(/^ipfs:\\/\\//i)) {\n link = link.substring(7);\n }\n else {\n logger.throwArgumentError(\"unsupported IPFS format\", \"link\", link);\n }\n return \"https://gateway.ipfs.io/ipfs/\" + link;\n}", "title": "" }, { "docid": "3f0f316b2688e0c0e7130f04ac465908", "score": "0.43223342", "text": "function call_url (route, serverIP) {\n return `http://${serverIP}:9000/${route}`\n}", "title": "" }, { "docid": "337456f0fe03326835b932139f5f4920", "score": "0.4313545", "text": "function handleRequest(req,res) {\n proxy.web(req, res, {\n target: HOST,\n secure: false\n });\n}", "title": "" }, { "docid": "de8068eb451bd3c599b44d148e9b653e", "score": "0.43133986", "text": "function formatEthAdr(adr){\r\n\tvar _smallAdr = adr.substring(0, 10);\r\n\tvar _stringLink = '<a href=\"https://etherscan.io/address/' + adr + '\" target=\"_blank\">' + _smallAdr + '</a>';\r\n\treturn _stringLink;\r\n}", "title": "" }, { "docid": "de8068eb451bd3c599b44d148e9b653e", "score": "0.43133986", "text": "function formatEthAdr(adr){\r\n\tvar _smallAdr = adr.substring(0, 10);\r\n\tvar _stringLink = '<a href=\"https://etherscan.io/address/' + adr + '\" target=\"_blank\">' + _smallAdr + '</a>';\r\n\treturn _stringLink;\r\n}", "title": "" }, { "docid": "de8068eb451bd3c599b44d148e9b653e", "score": "0.43133986", "text": "function formatEthAdr(adr){\r\n\tvar _smallAdr = adr.substring(0, 10);\r\n\tvar _stringLink = '<a href=\"https://etherscan.io/address/' + adr + '\" target=\"_blank\">' + _smallAdr + '</a>';\r\n\treturn _stringLink;\r\n}", "title": "" }, { "docid": "da2e1235f24d9cba4d735f47a89a1e3e", "score": "0.4311264", "text": "getIPAddress() {\r\n var interfaces = require('os').networkInterfaces();\r\n for (var devName in interfaces) {\r\n var iface = interfaces[devName];\r\n \r\n for (var i = 0; i < iface.length; i++) {\r\n var alias = iface[i];\r\n if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal)\r\n return alias.address;\r\n }\r\n }\r\n \r\n return '0.0.0.0';\r\n }", "title": "" }, { "docid": "00b1d2e4fe04400440f4df68658a98c8", "score": "0.43092987", "text": "function getIP(ip){\n\t//required to identify the server's IP\n\tvar interfaces = os.networkInterfaces();\n\tObject.keys(interfaces).forEach(function (interfaceName) {\n\t\tvar alias = 0;\n\n\t\tinterfaces[interfaceName].forEach(function (_interface) {\n\t\t\tif ('IPv4' !== _interface.family || _interface.internal !== false) {\n\t\t\t\t// skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (alias >= 1) {\n\t\t\t\t// this single interface has multiple ipv4 addresses\n\t\t\t\t//console.log(ifname + ':' + alias, iface.address);\n\t\t\t\tip.push(_interface.address);\n\t\t\t} else {\n\t\t\t\t// this interface has only one ipv4 adress\n\t\t\t\t//console.log(ifname, iface.address);\n\t\t\t\tip.push(_interface.address);\n\t\t\t}\n\t\t\t++alias;\n\t\t});\n\t});\n}", "title": "" }, { "docid": "e7ff7c6ded67032d20094c7273d4ec96", "score": "0.4307124", "text": "function sendEther(from,password,to,value,data,gas) {\n web3.personal.unlockAccount(from, password, 3600, function (err, success) {\n if (success) {\n //Value to be send should be in Wei format\n const etherToSend = web3.toWei(value);\n //Sending transaction\n const transactionObject={\n from: from,\n value: etherToSend\n };\n if(to){\n transactionObject[\"to\"]=to;\n }\n if(data){\n transactionObject[\"data\"]=data;\n }\n if(gas){\n transactionObject[\"gas\"]=gas;\n }\n web3.eth.sendTransaction(transactionObject, (err, address) => {\n if (err) {\n throw err;\n }\n console.log(\"Address: \" + address);\n });\n }\n else {\n throw err;\n }\n });\n}", "title": "" }, { "docid": "9547735794ee46fb72fb361407f333b8", "score": "0.4305453", "text": "async updateDFSPIngressEndpointsUrlById(opts,body) {\n let request;\n if(opts.type === 'IP'){\n request = {\n address: body.ip,\n ports: body.ports\n };\n } else if(opts.type === 'URL'){\n request = {\n url: body.address\n };\n }\n return this._requests.put(`environments/${this._envId}/dfsp/endpoints/${opts.epId}`,request);\n }", "title": "" }, { "docid": "6b6d326623adbc7f437ace0bdd2b8603", "score": "0.42984283", "text": "function wordnetRequest(q, mainCallback) {\n var options = {\n host: 'www.cfilt.iitb.ac.in',\n path: '/indowordnet/first?langno=9&queryword=' + encodeURIComponent(q)\n };\n\n callback = function(response) {\n var str = '';\n //another chunk of data has been recieved, so append it to `str`\n response.on('data', function (chunk) {\n str += chunk;\n });\n\n //the whole response has been recieved, so we just print it out here\n response.on('end', function () {\n console.log(str.slice(0,50));\n mainCallback(str);\n });\n }\n http.request(options, callback).end();\n}", "title": "" }, { "docid": "1688d7e080e2807fcc54792d2834c847", "score": "0.42964694", "text": "async function getIP(){\n console.log(\"ifaces -----> \", ifaces)\n return ifaces['wlan0'].filter( k => k.family === 'IPv4')[0].address;\n}", "title": "" }, { "docid": "7b2255367456a060423401d4062b2bba", "score": "0.4295125", "text": "function handleRequest_A(request, response) {\n console.log(response)\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"It Works!! Path Hit: \" + request.url+\" On PortA\");\n \n}", "title": "" }, { "docid": "5eb1a9151fa35a7625fcc245a68ec44c", "score": "0.42938325", "text": "function receiveArtemisServerAddr() {\n\tif (this.responseText != \"\") {\n\t\tmodel.connected = true;\n\t\tserverIpAddr = this.responseText;\n\t} else {\n\t\tmodel.connected = false;\n\t}\n\tcheckConnected();\n}", "title": "" }, { "docid": "ab80d97f4d82eee9aba2fb2417bcfb54", "score": "0.4292439", "text": "async remote_ip(req) {\n var proxy = await this.get_proxies();\n var proxies = proxy.split(',')\n var remoteAddress = req.socket.remoteAddress.replace('::ffff:','').replace('::1, ','');\n //var proxydetected = (Array.isArray(proxies) && proxies.includes(remoteAddress)) ? true : false;\n var proxydetected = cidrcheck(remoteAddress, proxies);\n var ip = ((proxydetected ? req.headers['x-forwarded-for'] : false) || req.socket.remoteAddress).replace('::ffff:','').replace('::1, ','');\n if (await this.is_cluster_local_ip(ip)) {\n var ip = '<cluster>';\n }\n context.set('srcIp', ip);\n var reqId = context.get('reqId')\n if (!proxies.includes(ip))\n this.output.debug('source_ip', [ip, reqId]);\n return ip;\n }", "title": "" }, { "docid": "e9171e613a2020c098cc5c2472d344a5", "score": "0.42909697", "text": "function cleanRemoteAddr(addr) { if (typeof addr != 'string') { return null; } if (addr.indexOf('::ffff:') == 0) { return addr.substring(7); } else { return addr; } }", "title": "" }, { "docid": "ea9dfae487141fc052760d71eef9d6d1", "score": "0.42903763", "text": "function findInternalIP() {\n document.getElementById(\"status\").innerHTML = \"Finding client's internal IP address.\";\n\n var local_address = null;\n var localpc = new RTCPeerConnection();\n localpc.createDataChannel('', {\n reliable: false\n });\n\n // For each new ICE candidate, filter out v6 or mdns addresses, and select *one*\n // local address. Last one wins (note: even with multiple interfaces, I've only seen\n // one local address given anyways).\n localpc.onicecandidate = function(e) {\n if (e.candidate == null) {\n return;\n }\n\n if (e.candidate.address.includes(':') == true ||\n e.candidate.address.includes('.local') == true) {\n // the address is v6 or an mdns .local address. Not much we can do\n // with those. Return and pray for something better.\n return;\n }\n\n local_address = e.candidate.address;\n document.getElementById(\"address\").innerHTML = local_address;\n }\n\n // Once candidate gathering has completed, check to see if we found a local address.\n // If we have, awesome! Move on to LAN scanning. If not, we'll need to move on to\n // brute forcing instead.\n localpc.onicegatheringstatechange = function(e) {\n if (localpc.iceGatheringState == \"complete\") {\n localpc.close();\n\n if (local_address != null) {\n iceScan(local_address);\n } else {\n document.getElementById(\"address\").innerHTML = \"Unable to obtain\";\n bruteForceAddress();\n }\n }\n }\n\n // trigger the gathering of ICE candidates\n localpc.createOffer(function(description) {\n localpc.setLocalDescription(description);\n },\n function(e) {\n console.log(\"Create offer failed callback.\");\n });\n }", "title": "" }, { "docid": "0942a83cfef94be1d4be9add30122878", "score": "0.42900562", "text": "convertAddressToLink()\r\n {\r\n var arrWhitelistedTags = new Array(\"code\", \"span\", \"p\", \"td\", \"li\", \"em\", \"i\", \"b\", \"strong\");\r\n var strRegex = /(^|\\s|:|-)((?:0x)?[0-9a-fA-F]{40})(?:\\s|$)/gi;\r\n\r\n //Get the whitelisted nodes\r\n for(var i=0; i<arrWhitelistedTags.length; i++) {\r\n var objNodes = document.getElementsByTagName(arrWhitelistedTags[i]);\r\n //Loop through the whitelisted content\r\n for(var x=0; x<objNodes.length; x++) {\r\n var strContent = objNodes[x].innerHTML;\r\n if( /((?:0x)?[0-9a-fA-F]{40})/gi.exec(strContent) !== null) {\r\n objNodes[x].innerHTML = strContent.replace(\r\n new RegExp(strRegex, \"gi\"),\r\n '$1<a title=\"See this address on the blockchain explorer\" href=\"'+ this.strBlockchainExplorer +'/$2\" class=\"ext-etheraddresslookup-link\" target=\"_blank\">$2</a>'\r\n );\r\n }\r\n }\r\n }\r\n\r\n if(this.blHighlight) {\r\n this.addHighlightStyle();\r\n }\r\n }", "title": "" }, { "docid": "ef983def603ee24f27c233c52ed09cc8", "score": "0.42900276", "text": "postReqValidation() {\n this.server.route({\n method: 'POST',\n path: '/requestValidation',\n handler: (request, h) => {\n var payload = request.payload \n if(payload == null){ return \"Please include address info\"};\n if(payload.address !== \"\"){\n let newReqValidationObj = new ReqValidationClass.ReqValidation(payload.address);\n\n return this.mempool.addRequestValidation(newReqValidationObj);\n }\n else{\n return 'Please include address info';\n }\n }\n });\n }", "title": "" }, { "docid": "988f774906a8f59a5b77452bf3879d52", "score": "0.42862272", "text": "function readHandler(device, addr, io_len) {\n\t\tvar state = device.state; // \"device\" will be Guest2Host\n\n\t\tutil.info(\"Guest2Host readHandler() :: Read from address: \"\n\t\t\t+ util.format(\"hex\", addr));\n\n\t\tswitch (addr) {\n\t\tcase 0x0402: // INFO_PORT\n\t\t\t// ??\n\t\t\tbreak;\n\t\tcase 0x0403: // DEBUG_PORT\n\t\t\t// ??\n\t\t\tbreak;\n\t\tcase 0x0080: // PORT_DIAG\n\t\t\t// Ignore for now...\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tutil.panic(\"Guest2Host readHandler() :: Unsupported read, address=\"\n\t\t\t\t+ util.format(\"hex\", addr) + \"!\");\n\t\t\treturn 0;\n\t\t}\n\t}", "title": "" }, { "docid": "1a6c82e8ff3642faebcd7fed85765519", "score": "0.4286173", "text": "function ankiRequest(callback, address, action, version, params={}){\n var xhr = new XMLHttpRequest();\n xhr.open('POST',\"http://\" + address.toString() + \":8765\");\n xhr.onreadystatechange = function(){\n if(this.readyState !== 4)return;\n if(this.status !== 200)return;\n var response = JSON.parse(this.responseText);\n response.callback = callback;\n sendAnkiResponse(response);\n }\n xhr.addEventListener(\"error\", function(error){\n console.log(error);\n alert(\"Couldn't connect to Anki. Is your address correct? Is Anki running? Do you have AnkiConnect installed?\");\n });\n xhr.send(JSON.stringify({action, \"version\":version, params}));\n}", "title": "" }, { "docid": "8a4ddb55416c204466b3431b3745434a", "score": "0.4282593", "text": "function visitorRoutecheck(req, res, next){ \n \n var utpInfo = require('./form/utpInfo')(req.headers,req.sessionID,req.ip); \n var utp = require('./form/utpTracking');\n var error = utp.utpTracking(utpInfo);\n //Error info display\n //console.log(colors.red('Utp tracking data function error :',error));\n next();\n}", "title": "" } ]
bbb0b477a05811b8f45c1be56ffa992d
Helper for module. module parameter replaces PUCRio use of passing it on the stack.
[ { "docid": "66ec3b993b9240e579762673b0e1d242", "score": "0.0", "text": "static setfenv(L, module) {\n var ar = L.getStack(1);\n L.getInfo(\"f\", ar);\n L.setFenv(L.value(-1), module);\n L.pop(1);\n }", "title": "" } ]
[ { "docid": "acffe366305a123ddf65c9f97713c0bb", "score": "0.5602046", "text": "function ___PRIVATE___(){}", "title": "" }, { "docid": "0f678922a163b9083205fe15508a16b1", "score": "0.507909", "text": "enterReceiverParameter(ctx) {\n\t}", "title": "" }, { "docid": "b0571c1de32467a28bdf1ebada85bcf4", "score": "0.50621", "text": "_prependPass(fn, ...args) {\n if (typeof fn !== 'function') {\n throw new Error('not available type');\n }\n\n this.prependStack.push(fn);\n this.prependStackArgs.push(args);\n this.prependStackWaitType.push(false);\n return this.sandbox;\n }", "title": "" }, { "docid": "47120cd43da0bd595759701b61935fca", "score": "0.5056968", "text": "function SubProvider() {\n\n}", "title": "" }, { "docid": "47120cd43da0bd595759701b61935fca", "score": "0.5056968", "text": "function SubProvider() {\n\n}", "title": "" }, { "docid": "47120cd43da0bd595759701b61935fca", "score": "0.5056968", "text": "function SubProvider() {\n\n}", "title": "" }, { "docid": "47120cd43da0bd595759701b61935fca", "score": "0.5056968", "text": "function SubProvider() {\n\n}", "title": "" }, { "docid": "a0c7838738c88b2e0a72ffc78575763e", "score": "0.5052416", "text": "function startModule(param)\n{\n\n if (param)\n context = param;\n\n //Do something\n start();\n //iDol.output('module_output_event', outputParam);\n\n}", "title": "" }, { "docid": "97f25759ff2312b34f735a2a774e7cd5", "score": "0.502642", "text": "function util() {\n\n}", "title": "" }, { "docid": "64a94580b9d0ccf99bcac255f6233038", "score": "0.5007914", "text": "function dummyCall() {\n}", "title": "" }, { "docid": "57d4b38eb7b60242aab618c03cfa6326", "score": "0.50059146", "text": "function nameOfUnction(parameter) {\n console.log(parameter)\n }", "title": "" }, { "docid": "450c8528d806f98901e227bf04446728", "score": "0.4992077", "text": "function startModule(param)\n{\n\tif (param) context = param;\n\t//Do something\n\tstartGame(param); //lancement du jeux \n}", "title": "" }, { "docid": "2da0d46ee1926b249a4700694640e58a", "score": "0.4987596", "text": "function localFunc() {\n localVar = 99;\n \n }", "title": "" }, { "docid": "173ba0787eea9a233122072996b5db3a", "score": "0.49794722", "text": "function Parent(myLocalVariable1, myLocalVariable2, myLocalVariable3) {\n\n myLocalVariable1 += 12;\n\n console.log(\"Arguments[0]: \" + arguments[0]);\n\n return myLocalVariable1;\n }", "title": "" }, { "docid": "4cf39806adbeab6ea0536e5519bed94a", "score": "0.49619126", "text": "function context(str)\n{\n todo(\"QUICKLEADER\", \"context()\");\n}", "title": "" }, { "docid": "a26754c3c6d7a360f961bf619902c3d3", "score": "0.4939859", "text": "function suppr_of(){\t\n}", "title": "" }, { "docid": "97d1108919c7c181a96015d54bc0efa3", "score": "0.49398378", "text": "enterFormalParameter(ctx) {\n\t}", "title": "" }, { "docid": "d089b3b9f2a31a34bdc416a79ba774b6", "score": "0.4915368", "text": "_prepend(fn, ...args) {\n if (typeof fn !== 'function') {\n throw new Error('not available type');\n }\n\n this.prependStack.push(fn);\n this.prependStackArgs.push(args);\n this.prependStackWaitType.push(true);\n return this.sandbox;\n }", "title": "" }, { "docid": "1c196a0a928ab7b77e2cc2c5964ae72f", "score": "0.4884156", "text": "stashYourBitsPlugin(...args) { \n return myPrivateContext.define(...args); // so basically an alias\n }", "title": "" }, { "docid": "91fed8ef4eef9c0079025cdaaf938c20", "score": "0.48829666", "text": "function caminar(arg) {\n return arg;\n}", "title": "" }, { "docid": "bde9979f77f596fadf3c783f940d1ad1", "score": "0.48294726", "text": "requireParent() {\n return \"SCServer\";\n }", "title": "" }, { "docid": "06ab42a4e6227560c2c7e9c9315f482a", "score": "0.4817062", "text": "function SRP0(state) {\n state.rp0 = state.stack.pop();\n\n if (exports.DEBUG) { console.log(state.step, 'SRP0[]', state.rp0); }\n }", "title": "" }, { "docid": "211f47f33971371959b33c12b41363a8", "score": "0.4809811", "text": "process() {\n\n\t}", "title": "" }, { "docid": "be79a4919d36e9406e3f22c247446277", "score": "0.48087436", "text": "function _localFunction(msg){\n\tmsg = msg || \"\";\n\t$.error(\"Not implemented: \" + msg);\n}", "title": "" }, { "docid": "b4360693aa5e0d365e79074870cefddd", "score": "0.4802954", "text": "function declaredAndUsed(param) {\n const variable = 'stuck in this frame';\n }", "title": "" }, { "docid": "e0271564977331e926a8761b8ef132b4", "score": "0.47914708", "text": "function SRP1(state) {\n state.rp1 = state.stack.pop();\n\n if (exports.DEBUG) { console.log(state.step, 'SRP1[]', state.rp1); }\n }", "title": "" }, { "docid": "492e37acfb7024ca9ce256b693ff5907", "score": "0.47615364", "text": "_function(parentSource) {\n var source;\n var linedefined;\n var lastlinedefined;\n var nups;\n var numparams;\n var varargByte;\n var vararg;\n var maxstacksize;\n var code; //int[] \n var constant; //Slot[] \n var proto; //Proto[] \n source = this.string();\n if (null == source) {\n source = parentSource;\n }\n linedefined = this.intLoad();\n lastlinedefined = this.intLoad();\n nups = this.byteLoad();\n numparams = this.byteLoad();\n varargByte = this.byteLoad();\n // \"is_vararg\" is a 3-bit field, with the following bit meanings\n // (see \"lobject.h\"):\n // 1 - VARARG_HASARG\n // 2 - VARARG_ISVARARG\n // 4 - VARARG_NEEDSARG\n // Values 1 and 4 (bits 0 and 2) are only used for 5.0\n // compatibility.\n // HASARG indicates that a function was compiled in 5.0\n // compatibility mode and is declared to have ... in its parameter\n // list.\n // NEEDSARG indicates that a function was compiled in 5.0\n // compatibility mode and is declared to have ... in its parameter\n // list and does _not_ use the 5.1 style of vararg access (using ...\n // as an expression). It is assumed to use 5.0 style vararg access\n // (the local 'arg' variable). This is not supported in Jill.\n // ISVARARG indicates that a function has ... in its parameter list\n // (whether compiled in 5.0 compatibility mode or not).\n //\n // At runtime NEEDSARG changes the protocol for calling a vararg\n // function. We don't support this, so we check that it is absent\n // here in the loader.\n //\n // That means that the legal values for this field ar 0,1,2,3.\n if (varargByte < 0 || varargByte > 3) {\n throw new IOException_1.IOException();\n }\n vararg = (0 != varargByte);\n maxstacksize = this.byteLoad();\n code = this.code();\n constant = this.constant();\n proto = this.proto(source);\n var newProto = new Proto_1.Proto();\n newProto.init1(constant, code, proto, nups, numparams, vararg, maxstacksize); //TODO:\n newProto.source = source;\n newProto.linedefined = linedefined;\n newProto.lastlinedefined = lastlinedefined;\n this.debug(newProto);\n // :todo: call code verifier\n return newProto;\n }", "title": "" }, { "docid": "e0b35f903fcabebb70f7461226d13645", "score": "0.47602528", "text": "function foo(..) { .. }", "title": "" }, { "docid": "e0b35f903fcabebb70f7461226d13645", "score": "0.47602528", "text": "function foo(..) { .. }", "title": "" }, { "docid": "8fd3a221fd9cf2c710f7126f75408f5c", "score": "0.47554532", "text": "function SubProvider(){}", "title": "" }, { "docid": "01711e806e0510da90e280107fcaf11d", "score": "0.47522736", "text": "function SubProvider() {}", "title": "" }, { "docid": "bc9ed84af571ff16281ae505aa6be17d", "score": "0.4749611", "text": "function restartModule()\n{\n\n //if (param) context = param;\n\n //Do something\n\n //iDol.output('module_output_event', outputParam);\n $('#shield').remove();\n startModule();\n}", "title": "" }, { "docid": "36eb94381898718aa1f99dc51076dcec", "score": "0.47494504", "text": "function CoolModule2(id) {\n function identify() {\n console.log(id);\n }\n\n return {\n identify: identify\n };\n}", "title": "" }, { "docid": "59add28d01adb6677c55d477ac981251", "score": "0.4735195", "text": "addModule(module){\r\n this.initModule(module);\r\n }", "title": "" }, { "docid": "cd31a971debf3c752781b58e7cd2b149", "score": "0.47294533", "text": "function helper(){\r\n //...\r\n }", "title": "" }, { "docid": "efcff910eb48f9932cb0c57fb1be4972", "score": "0.47182754", "text": "function resolveParam(param) {\n return typeof param === 'function' ? param.call(self, item) : param;\n }", "title": "" }, { "docid": "2fb936c1d313f2161966188c143f0555", "score": "0.47179264", "text": "function CoolModule2(id) {\n function identify() {\n console.log( id );\n }\n\n return {\n identify: identify\n };\n}", "title": "" }, { "docid": "7692823a720ef12ee68d5eb2cca5f240", "score": "0.4715669", "text": "function getRequestParm(){\n \n \n \n }", "title": "" }, { "docid": "d9fc351e51a7dc2a060d55e4da56e8ec", "score": "0.47137275", "text": "rpcRequestWithName(queue) {\n let that = this;\n return function () {\n that.rpcRequest(queue, ...arguments);\n }\n }", "title": "" }, { "docid": "14018d3c107070e4b906d5be4b28dfc5", "score": "0.47066155", "text": "enterLastFormalParameter(ctx) {\n\t}", "title": "" }, { "docid": "142e26ef4ae422c4411d8be032f3ce5b", "score": "0.47037452", "text": "function oputil_push_callstub(context, operand, addr) {\n if (addr === undefined)\n addr = context.cp;\n context.code.push(\"self.frame.valstack.push(\"+operand+\",\"+addr+\",self.frame.framestart);\");\n}", "title": "" }, { "docid": "893982e78665931a1b75280732878aae", "score": "0.46924505", "text": "promiseParams()\n {\n // return {\n // abc: 123\n // };\n }", "title": "" }, { "docid": "be13bfb6da800b34ebef3ceaa47cab2c", "score": "0.46856534", "text": "exitFormalParameter(ctx) {\n\t}", "title": "" }, { "docid": "3db50dd2030b9b274a761b7869d90101", "score": "0.46841785", "text": "function reStartModule(param)\n{\n\tif (param) context = param;\n\t//Do something\n\tstartGame(param);\n\n}", "title": "" }, { "docid": "28ef9104046ce9bf86794b04d33e602b", "score": "0.46807706", "text": "function moduleParameterChanged(param)\n{\n\n\tif(param.isParameter()) \n\t{\n\n\t\tif(param.is(local.parameters.pixelsPerSegment)) \n\t\t{\n\t\t\tsetPixelsPerSegment(param.get());\n\t\t}\n\t\telse if(param.is(local.parameters.segments))\n\t\t{\n\t\t\tsetSegments(param.get());\n\t\t}\n\t\telse if(param.is(local.parameters.chipType))\n\t\t{\n\t\t\tsetChipType(param.get());\n\t\t}\n\t\telse if(param.is(local.parameters.colorOrder))\n\t\t{\n\t\t\tsetColorOrder(param.get());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tscript.log(\"Module parameter changed : \"+param.name+\" > \"+param.get());\n\t\t}\n\t\t\n\t} else \n\t{\n\t\tscript.log(\"Module parameter triggered : \"+param.name);\t\n\t}\n}", "title": "" }, { "docid": "91ac154df3cd6fafc96162c40bfe98cd", "score": "0.4674169", "text": "static addDependencyForCallParameter(container, parameter, parameters, dependencies) {\n }", "title": "" }, { "docid": "63d77e9050b48e195d3df89484c1e994", "score": "0.46704626", "text": "function Module(){}", "title": "" }, { "docid": "63d77e9050b48e195d3df89484c1e994", "score": "0.46704626", "text": "function Module(){}", "title": "" }, { "docid": "021445c3734e5898aaf3d4192aacd51a", "score": "0.46700087", "text": "function f_arg() {\n}", "title": "" }, { "docid": "dfdf990de6974bb8f4de2dc5966b011f", "score": "0.4668568", "text": "function bar(foo) {\n console.log(foo);\n}", "title": "" }, { "docid": "5f733458bc213a9cc447aa6dd2f16ef1", "score": "0.4668534", "text": "func (param) {\n console.log('sample func');\n }", "title": "" }, { "docid": "ce40427c5a90792345391c75c6166191", "score": "0.46684313", "text": "function increase(number) {\n number++;\n console.log(number); // number here is local and is parameter doesnt work outside this fn\n}", "title": "" }, { "docid": "1445eb86a3a724a42c97106ea8b77712", "score": "0.46558526", "text": "function foo(..) {\n\t// ..\n}", "title": "" }, { "docid": "7adeccd9f3716e976f1f6e5d1605aae2", "score": "0.4645283", "text": "function inModule(url) {\n return {\n type: \"NAVIGATE_IN_MODULE\",\n payload: url\n };\n}", "title": "" }, { "docid": "f26226c59b9beb4b25b2711d54105974", "score": "0.46329072", "text": "function coolModule(id) {\n function identify() {\n console.log(id);\n }\n return {\n identify: identify\n };\n}", "title": "" }, { "docid": "8be719f0966761a1487bde05954bf49c", "score": "0.4631125", "text": "function SRP0(state) {\n state.rp0 = state.stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'SRP0[]', state.rp0);\n }\n }", "title": "" }, { "docid": "c04d3ccea913ade1a406f53cef6cd55e", "score": "0.46276444", "text": "enterModuleBody(ctx) {\n\t}", "title": "" }, { "docid": "83f72f56403bdc9448677c9dcddaf6ab", "score": "0.4625778", "text": "foo(c) {\n log(`foo(): c = ${c}`);\n }", "title": "" }, { "docid": "f4fefb9a22c215aac9584d949c2d9659", "score": "0.46249413", "text": "publicMethodWithouParams() {\n\n }", "title": "" }, { "docid": "d4f60c3524f0380431177213e6051ff4", "score": "0.46162403", "text": "function name(params) {}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.46152118", "text": "function dummy(){}", "title": "" }, { "docid": "8af5155c4c6ebe78248f760b0cf0809d", "score": "0.4613473", "text": "getCallsite(stack) {\n const { formatStack } = KC3StrategyTabs.logger.definition;\n\n const top = formatStack(stack).split(/\\r?\\n/)[1];\n if (!top) { return { full: '?', short: '?' }; }\n\n const full = top.indexOf(' (') > -1 ?\n // named func\n top.split(' (')[1].trimRight().slice(0, -1) :\n // anonymous func\n top.split('at ')[1] || '';\n return {\n full,\n short: full.substring(full.lastIndexOf('/') + 1, ((full.lastIndexOf(':') + 1) || (full.length + 1)) - 1),\n };\n }", "title": "" }, { "docid": "0f117e9be30ddc41e52bdba3008a3022", "score": "0.4611693", "text": "localMethod(next, method) {\n\t\t\t\texpect(method).toBeDefined();\n\t\t\t\treturn (...args) => {\n\t\t\t\t\tFLOW.push(`${mwName}-localMethod-${method.name}-${args.join(\"|\")}`);\n\t\t\t\t\treturn next(...args);\n\t\t\t\t};\n\t\t\t}", "title": "" }, { "docid": "24eea0698235a59bd3a11b23df31f77d", "score": "0.46103466", "text": "function regresar(arg) {\n return arg;\n}", "title": "" }, { "docid": "c21f87b35a8b19fe1871d5d88b704b1d", "score": "0.4603752", "text": "adjust_varargs(p, actual) {\n var nfixargs = p.numparams;\n for (; actual < nfixargs; ++actual) {\n this.stackAdd(Lua.NIL);\n }\n // PUC-Rio's LUA_COMPAT_VARARG is not supported here.\n // Move fixed parameters to final position\n var fixed = this._stackSize - actual; // first fixed argument\n var newbase = this._stackSize; // final position of first argument\n for (var i = 0; i < nfixargs; ++i) {\n // :todo: arraycopy?\n this.pushSlot(this._stack[fixed + i]);\n this._stack[fixed + i].r = Lua.NIL;\n }\n return newbase;\n }", "title": "" }, { "docid": "46d69f46b4ee12d8f144565ef13713fb", "score": "0.46020618", "text": "function parameterFunc(num) {\n console.log(num);\n }", "title": "" }, { "docid": "4fce6897062ceae40396e8a74e2d74ab", "score": "0.46018875", "text": "function publishDefaultGlobalUtils__PRE_R3__() { }", "title": "" }, { "docid": "4fce6897062ceae40396e8a74e2d74ab", "score": "0.46018875", "text": "function publishDefaultGlobalUtils__PRE_R3__() { }", "title": "" }, { "docid": "4fce6897062ceae40396e8a74e2d74ab", "score": "0.46018875", "text": "function publishDefaultGlobalUtils__PRE_R3__() { }", "title": "" }, { "docid": "4e34f42219be1d0ea684511f1b439adb", "score": "0.4601232", "text": "function crazyCode(param1){\n console.log(param1);\n}", "title": "" }, { "docid": "bd01152ed2df75a034e1987248d9b5b6", "score": "0.45969304", "text": "get numParam() {\n\n }", "title": "" }, { "docid": "cd5c5649646e20983ce3de3276da5aae", "score": "0.45925897", "text": "function first(foo){\n console.log('i am'+ foo);\n }", "title": "" }, { "docid": "29f4cbb31063c735cdaff1e5e9ff47a7", "score": "0.45872492", "text": "function name(parameter) {\n parameter = parameter; //+ we can do some operation\n}", "title": "" }, { "docid": "d2e35064f6f877f8a9964b6d8b60ff20", "score": "0.45849225", "text": "function SRP1(state) {\n state.rp1 = state.stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'SRP1[]', state.rp1);\n }\n }", "title": "" }, { "docid": "f63e2fae4f379ecc4600c3974942a0fb", "score": "0.4583054", "text": "function globalControl() {return bueno}", "title": "" }, { "docid": "6797cbb1bd9f94adacd1465fc2cb5251", "score": "0.45818374", "text": "function inputParam(incoming){\n\n console.log(incoming);\n}", "title": "" }, { "docid": "1175c12bc6d01f517b93148175fa3b4e", "score": "0.45779678", "text": "function main(_context){\n return '';\n}", "title": "" }, { "docid": "b83ff5d2b4f09fceb7130df7ba1806b6", "score": "0.45648676", "text": "function b(varName){\n console.log(\"hello\", varName());\n \n}", "title": "" }, { "docid": "35984e9ed4ab7640909ea0a57e8a2290", "score": "0.45637503", "text": "foo(c) {\n log(`foo(): c = ${c}`);\n }", "title": "" }, { "docid": "7e19c19f4e6e7eb9f66a65669194b876", "score": "0.45569652", "text": "get $module() {\n return this.hash.module.$module;\n }", "title": "" }, { "docid": "7e19c19f4e6e7eb9f66a65669194b876", "score": "0.45569652", "text": "get $module() {\n return this.hash.module.$module;\n }", "title": "" }, { "docid": "e8a36cbf886a20933ce9eff6096907bd", "score": "0.45549023", "text": "function LeathermanModule() {\n }", "title": "" }, { "docid": "2e0b6ef43e123c06be8904a7d7dee65e", "score": "0.4553342", "text": "requireParent(): string {\n return 'SCServer';\n }", "title": "" }, { "docid": "fb74de74b21adcdce9e9928da2c034ad", "score": "0.4551274", "text": "function PsmDefine() {\n}", "title": "" }, { "docid": "a830b039f6ef1f3206d5550b8c62bb4e", "score": "0.45478237", "text": "userUtil(name,param){\n if(param === ''){\n return this.clearStorage(name);;\n }\n if(param){\n return this.setStorage(name,param);\n }else{\n return this.getStorage(name);\n }\n }", "title": "" }, { "docid": "326c44d279d171163fa5f119c015332e", "score": "0.45476565", "text": "function priv1(){\n ;\n }", "title": "" }, { "docid": "1753f22beaa341453765e0dbf579c493", "score": "0.45441115", "text": "prepare() {\n }", "title": "" }, { "docid": "d63d5ae02d806db14878c7520b013277", "score": "0.45421094", "text": "function scriptTag (e) {\n setTimeout(function() {\n printBegin(\"1.\");\n //asegura que MODULE no exista\n if(context.MODULE) MODULE = undefined;\n jsu.addScript({\n src: \"module.js\",\n before: \"main.js\",\n createTag: true,\n onload: function() {\n console.log(\"1. onload callback > MODULE:\", MODULE);\n }\n });\n console.log(\"1. Main stack > MODULE:\", context.MODULE);\n }, 100);\n }", "title": "" }, { "docid": "a27b80671a6f7e039850f679d8eed653", "score": "0.4538012", "text": "enterTypeParameters(ctx) {\n\t}", "title": "" }, { "docid": "941d8d026726788ab9f04821c82f07df", "score": "0.45338506", "text": "function callerBack(holla, back) {\n return holla(back + \" back\");\n}", "title": "" }, { "docid": "bf4f286fcd3605fb64dd9e4027911f04", "score": "0.4532822", "text": "top() {\n\n }", "title": "" }, { "docid": "1c5aeb7c919c2da956a2514c3a9b226a", "score": "0.45307648", "text": "enterTypeArgument(ctx) {\n\t}", "title": "" }, { "docid": "f411fb6e2797d627e9e91df35c7891a9", "score": "0.45297995", "text": "function action(param) {\n \"use strick\";\n console.log(this);\n return `Create the ${param}`;\n}", "title": "" }, { "docid": "8482ab029a4f824cd7ea874e1e6a14db", "score": "0.45289233", "text": "function processInit(param) {\n}", "title": "" }, { "docid": "344b14eea51ac25183beaa0488250c1d", "score": "0.45241192", "text": "function Module() {}", "title": "" }, { "docid": "344b14eea51ac25183beaa0488250c1d", "score": "0.45241192", "text": "function Module() {}", "title": "" }, { "docid": "344b14eea51ac25183beaa0488250c1d", "score": "0.45241192", "text": "function Module() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.45185798", "text": "prepare() {}", "title": "" }, { "docid": "d9aed75b923c89f2a329fc80ac060991", "score": "0.45166907", "text": "get $module() {\n return this.hash.$module;\n }", "title": "" }, { "docid": "d9aed75b923c89f2a329fc80ac060991", "score": "0.45166907", "text": "get $module() {\n return this.hash.$module;\n }", "title": "" }, { "docid": "a5c2f967fca256fd80b76a860306fef8", "score": "0.45148867", "text": "constructor(module) {\n super();\n this.module = module;\n }", "title": "" } ]
305df3c07b51cd692a8748f0a785819c
Sort By Pricing High To Low:
[ { "docid": "aa6543e19c73799619e633e206caeeaf", "score": "0.0", "text": "function sortByPriceHigh(){\n productsDiv.innerHTML = \"\";\n\n myTshirts.sort((a, b) => {\n return Math.round(b.price - (b.price * b.discount / 100)) - Math.round(a.price - (a.price * a.discount / 100));\n })\n\n myTshirts.forEach(function (product, n) {\n\n let div = document.createElement(\"div\");\n div.addEventListener(\"click\", function(){\n window.location.href = `products/${product.id-1}.html`;\n })\n let p_name = document.createElement(\"p\");\n p_name.innerText = product.name;\n let p_description = document.createElement(\"p\");\n p_description.innerText = product.description;\n let image = document.createElement(\"img\");\n image.src = product.images[0];\n image.addEventListener(\"mouseover\", function(e){\n e.target.src = product.images[2];\n })\n image.addEventListener(\"mouseout\", function(e){\n e.target.src = product.images[0];\n })\n let p_price = document.createElement(\"p\");\n p_price.innerHTML = `<div class=\"price rupee\">₹ ${Math.round(product.price - (product.price * product.discount / 100))} <p class=\"strike\">MRP ${product.price}</p></div> <p class=\"discount\">(${product.discount}% OFF)</p>`\n div.append(image, p_name, p_description, p_price);\n productsDiv.append(div);\n \n })\n \n }", "title": "" } ]
[ { "docid": "4259ad3a25ce2aca51339676d1592455", "score": "0.7766323", "text": "function sortByPricing(){\n return function(a,b){\n if( a.pricingRating < b.pricingRating){\n return -1;\n }\n if(a.pricingRating > b.pricingRating){\n return 1;\n }\n return 0;\n }\n}", "title": "" }, { "docid": "e9a0ac2cf6555aa8b088eefbd578ea82", "score": "0.7314151", "text": "function sortByLow() {\n setProducts(\n [...products].sort((a, b) => {\n return Number(a.product.price) - Number(b.product.price);\n })\n );\n }", "title": "" }, { "docid": "939a81c3d29912885d09e266ec92035e", "score": "0.73065037", "text": "function sortByHigh() {\n setProducts(\n [...products].sort((a, b) => {\n return Number(b.product.price) - Number(a.product.price);\n })\n );\n }", "title": "" }, { "docid": "c4e19d6e0d27a2113eb0bb8d9427a008", "score": "0.7183496", "text": "function sortAllOfTheProductsAscendantlyBasedOnTheNewPrices() {\n\n}", "title": "" }, { "docid": "cd7f8f9ccdc0a1689c1ea1bdf7e9bfb2", "score": "0.71732056", "text": "function sortByPrice(a, b) {\n if (a.price > b.price) {\n return -1;\n } else return 1;\n}", "title": "" }, { "docid": "6ec8f52daae87746bcff8d748c715fe3", "score": "0.71463567", "text": "function sortPriceASC(a, b) {\n if (a[PRICE] < b[PRICE]) return -1;\n if (a[PRICE] > b[PRICE]) return 1;\n return 0;\n }", "title": "" }, { "docid": "5db165d0c6491b81b55b89d542abf437", "score": "0.7133686", "text": "function sortByPrice(a, b) {\n if (byPrices === \"Prices: Low to High\") {\n return a.cost - b.cost;\n } else if (byPrices === \"Prices: High to Low\") {\n return b.cost - a.cost;\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "1ce8277e51f2937f8b14933626a15a8c", "score": "0.71266574", "text": "sortByPriceAsc() {\n this.setState(this.state.sortingData.sort((a, b) => a.score - b.score));\n }", "title": "" }, { "docid": "2bfa96f2659e78f7a058b9b48a570ba3", "score": "0.7004906", "text": "function sortByPrices(value){\r\n \r\n if(value == 'lowToHigh'){\r\n console.log('asd')\r\n sortedPrices.sort(function (a, b) {\r\n return a.price - b.price;\r\n });\r\n console.log(sortedPrices)\r\n }\r\n if(value == 'highToLow'){\r\n console.log('asd')\r\n sortedPrices.sort(function (a, b) {\r\n return b.price - a.price;\r\n });\r\n console.log(sortedPrices)\r\n }\r\n showProducts(sortedPrices)\r\n}", "title": "" }, { "docid": "a3e121d712e8f59aac3c89c2077aa295", "score": "0.7003869", "text": "sortByPriceDesc() {\n this.setState(this.state.sortingData.sort((a, b) => b.score - a.score));\n }", "title": "" }, { "docid": "22e61c9a6471ba170670c20eae10ff3d", "score": "0.70027906", "text": "function sortByPrice(a, b) {\n return a.price - b.price; \n}", "title": "" }, { "docid": "9420e9512b92aabf65977382ea760162", "score": "0.6973957", "text": "static sortByPrice(a, b)\n {\n return (a.price > b.price) ? 1 : ((a.price < b.price) ? -1 : 0);\n }", "title": "" }, { "docid": "0afde3a9c35e7d9031effbd9b21e16b2", "score": "0.6972832", "text": "function sortBookForPrice_Ascending() {\n for (var i = 0; i < obj.length; i++) {\n for (var j = 0; j < obj.length; j++) {\n if (obj[i].gia < obj[j].gia) {\n var tmp = obj[i];\n obj[i] = obj[j];\n obj[j] = tmp;\n }\n }\n }\n}", "title": "" }, { "docid": "be97e1bfcf9551509496ceae5ade37a7", "score": "0.6838322", "text": "function sortHighScore()\n {\n var l = arrHighScore.length;\n if(l > 1)\n {\n for(var n = 0; n < l - 1; n++)\n {\n for(var m = 0; m < l - 1; m++)\n {\n if((arrHighScore[m].nPoints - arrHighScore[m + 1].nPoints) > 0)\n { \n var tmp = arrHighScore[m];\n arrHighScore[m] = arrHighScore[m + 1];\n arrHighScore[m + 1] = tmp;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "ee32def8b2b0b79aa2420439edbb3817", "score": "0.67294645", "text": "function sortedByPriceFunction() {\n\n const tvSortByPrice = inventory.sort((a,b) => {\n return a.price - b.price;\n })\n return tvSortByPrice;\n}", "title": "" }, { "docid": "51ed7c17e2915b204ed8f2f7141883a9", "score": "0.6698486", "text": "function _priceSortOrder(prods, order){\n\t// var displayedProducts = document.getElementById(prodId);\n\t// var list = document.querySelector('#' + prodId);\n\tlet orderVal;\n\n\tfor(i=0; i < order.length; i++){\n\t\tif (order[i].checked){\n\t\t\torderVal = order[i].value;\n\t\t}\n\t}\n\n\tif (orderVal == \"asc\"){\n\t\t prods.sort((item1, item2) => (item1.price > item2.price ? 1 : (item1.price == item2.price) ? ((item1.name > item2.name) ? 1 : -1) : -1 ));\n\t\t// [...list.children]\n\t\t// .sort((a,b)=>a.innerText.substr(a.innerText.indexOf(\"$\")+1) > b.innerText.substr(b.innerText.indexOf(\"$\")+1) ?1:-1)\n\t\t// .forEach(node=>list.appendChild(node));\t\n\t} else if (orderVal ==\"dsc\"){\n\t\t prods.sort((item1, item2) => (item1.price > item2.price ? -1 : (item1.price == item2.price) ? ((item1.name > item2.name) ? -1 : 1) : 1 ));\n\t}\n}", "title": "" }, { "docid": "c0fce0067e9a2dba4049562d0daa2ecb", "score": "0.6695152", "text": "function byPrice(a, b) {\n if (a.price < b.price){\n return -1;\n } \n if (a.price > b.price){\n return 1;\n }\n return 0\n}", "title": "" }, { "docid": "17a15205e6ea6e7591ef5d1423d0a6b0", "score": "0.6550934", "text": "function sortHotelsByPrice()\n\t\t{ \n\t\t\tvar Prices =[\"28981\",\"29419\" ,\"32704\",\"37303\",\"40004\" ,\"40515\"];\n\t\t\tPrices.forEach(function(item, index, array) {\n\t\t\t\tif(Prices.indexOf(cy.contains(item).text)==index)\n\t\t\t\t\tassert.isNotTrue('true', 'Prices are not sorted')\t\t\t\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "34c6c4b8e5d8a813d72dd80408baeaa0", "score": "0.65491515", "text": "function sortBookForPrice_Decrease() {\n for (var i = 0; i < obj.length; i++) {\n for (var j = 0; j < obj.length; j++) {\n if (obj[i].gia > obj[j].gia) {\n var tmp = obj[i];\n obj[i] = obj[j];\n obj[j] = tmp;\n }\n }\n }\n}", "title": "" }, { "docid": "55ef7495ae34d3ffcf10eb11a023be46", "score": "0.6543593", "text": "function highToLow(products){\n let orderedArray = [];\n _.each(pricesArray(products).reverse(), function(val, pos, prices){\n _.each(products, function(item, i, products){\n //console.log(\"prices\", val); \n if(item.price === prices[pos]){\n orderedArray.push(item); \n }\n })\n })\n return orderedArray; \n}", "title": "" }, { "docid": "6c98ea13c77681c5ad27f7a51deeb794", "score": "0.65382946", "text": "GetVehiclesByPriceFromHighestToLowest() {\n return this.vehiculos.sort((a, b) => b.precio - a.precio);\n }", "title": "" }, { "docid": "c4795221c7203a9f430707983e128925", "score": "0.6516229", "text": "function lowTohigh() {\r\n let data = JSON.parse(localStorage.getItem(\"dealTimer\"));\r\n data = data.sort(function (a, b) {\r\n return a.price - b.price;\r\n });\r\n appendpro(data);\r\n}", "title": "" }, { "docid": "dc1aa787644033214144586bd8815d68", "score": "0.6504374", "text": "sortBySuit() {\n\n }", "title": "" }, { "docid": "cca939c0379ebb56b76ea94685a86890", "score": "0.64878297", "text": "function sortPriceDescending() {\n if (!sortPrice) {\n var ref = database.collection(\"orders\").orderBy(\"gamePrice\", \"desc\");\n ref.onSnapshot(querySnapshot => {\n const games = [];\n querySnapshot.forEach(documentSnapshot => {\n games.push({\n ...documentSnapshot.data(),\n key: documentSnapshot.id,\n });\n });\n setsortPrice(true);\n setOrders(games);\n setLoading(false);\n });\n } else {\n sortPriceAscending();\n }\n }", "title": "" }, { "docid": "3896925121fb63fd634f20ab04f9ade2", "score": "0.6486427", "text": "function hit_and_prio_sort(a,b) {\r\n\r\n if (a.prio == b.prio) {\r\n\r\n if(a.hit > b.hit) {\r\n return -1;\r\n } else if(a.hit < b.hit) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n\r\n } else if (a.prio > b.prio) {\r\n return 1;\r\n } else {\r\n return -1;\r\n }\r\n\r\n}", "title": "" }, { "docid": "8876e67dc475cc64a250d524591cd670", "score": "0.6480229", "text": "function sortCardsLowToHigh(a, b) {\n return a[0] - b[0];\n }", "title": "" }, { "docid": "d5f3bb56455d56897b8c5649ae1ffa90", "score": "0.64773905", "text": "sortHighscores(items) {\n let sortedData = (items).sort(function(player1, player2) {\n return player2.points - player1.points;\n });\n return sortedData;\n }", "title": "" }, { "docid": "cda2e3213872953f83801e84bcad79cc", "score": "0.6475466", "text": "function sorter(a, b){\n var aScore = a.score;\n var bScore = b.score;\n if (aScore < bScore) {\n return -1;\n }\n else if (aScore > bScore) {\n return 1;\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "b96ed853106bc971049266982003b991", "score": "0.6468191", "text": "function sortPOIs (pois, score){\n\treturn pois.sort(function(a, b)\n \t{\n \t\tvar x = a[score]; var y = b[score];\n \t\treturn ((x < y) ? 1 : ((x > y) ? -1 : 0));\n \t});\n}", "title": "" }, { "docid": "567c45c972ad7e0502eb6b742bd084ce", "score": "0.6463235", "text": "function sortByRichest() {\r\n data.sort((a, b) => b.money - a.money);\r\n\r\n updateDom();\r\n}", "title": "" }, { "docid": "ca6e2d3830bfa997fd7f08650ccd03ca", "score": "0.6442812", "text": "function sortiereHPToTop()\r\n\t{\r\n\t\tvar Planis = new Array();\r\n\t\tPlanis[0] = ogs.planetliste[0]; //Infos aus dem ersten Element uebernehmen\r\n\t\t\r\n\t\t//HP hinzufuegen\r\n\t\tPlanis[Planis.length] = ogs.planetliste[0]['HP'];\r\n\t\t\r\n\t\t//Rest hintenweg\r\n\t\tfor (var i = 1; i < ogs.planetliste.length; i++)\r\n\t\t{\r\n\t\t\tif (!ogs.planetliste[i]['HP']) Planis[Planis.length] = ogs.planetliste[i];\r\n\t\t}\r\n\t\t\r\n\t\togs.planetliste = Planis;\r\n\t}", "title": "" }, { "docid": "ce21a976c77c1c04f796db1283be1ac5", "score": "0.64348346", "text": "function priceSorter(a, b) {\n a = +a.substring(1); // remove $\n b = +b.substring(1);\n if (a > b) return 1;\n if (a < b) return -1;\n return 0;\n}", "title": "" }, { "docid": "258064358704e720cef5165f7b521c36", "score": "0.64341426", "text": "function sort_scores()\n\t\t{\n\t\t\tfor(var i = 1; i < turn_order.length; ++i)\n\t\t\t{\n\t\t\t\tvar j = i;\n\t\t\t\twhile(j > 0 \n\t\t\t\t\t&& score_list[j-1] > score_list[j])\n\t\t\t\t{\n\t\t\t\t\tvar temp_score = score_list[j];\n\t\t\t\t\tscore_list[j] = score_list[j-1];\n\t\t\t\t\tscore_list[j-1] = temp_score;\n\t\t\t\t\tvar temp_name = turn_order[j];\n\t\t\t\t\tturn_order[j] = turn_order[j-1];\n\t\t\t\t\tturn_order[j-1] = temp_name;\n\t\t\t\t\tj--;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ecc219d41bda360729afc96c928252a8", "score": "0.64304024", "text": "sort() {\n if (this.sortBy === \"PriceInc\") {\n this.filteredArtworks.sort(function (a, b) {\n var keyA = a.price\n var keyB = b.price\n // Compare the 2 dates\n if (keyA < keyB) return -1;\n if (keyA > keyB) return 1;\n return 0;\n });\n } else if (this.sortBy === \"PriceDec\") {\n this.filteredArtworks.sort(function (a, b) {\n var keyA = a.price\n var keyB = b.price\n // Compare the 2 dates\n if (keyA < keyB) return 1;\n if (keyA > keyB) return -1;\n return 0;\n });\n } else if (this.sortBy === \"DateInc\") {\n this.filteredArtworks.sort(function (a, b) {\n var keyA = new Date(a.creationDate)\n var keyB = new Date(b.creationDate)\n // Compare the 2 dates\n if (keyA < keyB) return -1;\n if (keyA > keyB) return 1;\n return 0;\n });\n } else if (this.sortBy === \"DateDec\") {\n this.filteredArtworks.sort(function (a, b) {\n var keyA = new Date(a.creationDate)\n var keyB = new Date(b.creationDate)\n // Compare the 2 dates\n if (keyA < keyB) return 1;\n if (keyA > keyB) return -1;\n return 0;\n });\n }\n }", "title": "" }, { "docid": "8f87217f1f5104479c7479aa9e04a0fc", "score": "0.64113563", "text": "function sortByRichest(){\n data.sort( (a,b)=>b.money-a.money );\n updateDOM();\n}", "title": "" }, { "docid": "8802549042e3a8cf35a698951c981b45", "score": "0.6403203", "text": "function priceRangeSort(hotelsArr) {\n hotelsArr.sort((a, b) => {\n return a.price - b.price;\n });\n console.log(hotelsArr);\n let min = hotelsArr[0].price;\n let max = hotelsArr[hotelsArr.length - 1].price;\n return `${max} - ${min}`;\n}", "title": "" }, { "docid": "5931c5e82860680cbeeca80a576af7a6", "score": "0.64023656", "text": "sortByScore() {\n // A fancy way to sort each element\n this.keys.sort((a, b) => {\n return (this.getScore(b) - this.getScore(a));\n });\n }", "title": "" }, { "docid": "070d187c33760ca8ce854782a0a63aaf", "score": "0.640002", "text": "function sortByRichest() {\n data = data.sort((a, b) => b.money - a.money);\n updateDOM();\n}", "title": "" }, { "docid": "9bc732af7a935bb66f3bee9bee00cd02", "score": "0.63542235", "text": "function sortByRoic ( a , b ) {\n if( a.roicAmount == b.roicAmount ) return 0\n return ( a.roicAmount > b.roicAmount ) ? -1 : 1 \n}", "title": "" }, { "docid": "6f111927262e63c96530597ed5c4dfd2", "score": "0.63350266", "text": "sortRanking(){\n xRank.sort(function(a ,b){\n if(a.total === b.total){\n return 0;\n }\n return a.total < b.total?1:-1;\n });\n }", "title": "" }, { "docid": "161644c3a71d2e352014c4cdf0a95246", "score": "0.6331569", "text": "function sortPopulationByAccending(){\n data.sort((a,b)=>b.population-a.population);\n displayData(data);\n }", "title": "" }, { "docid": "a04dcea9f3dab0f2777742c460c05c41", "score": "0.6311662", "text": "sort () {\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\n }", "title": "" }, { "docid": "a04dcea9f3dab0f2777742c460c05c41", "score": "0.6311662", "text": "sort () {\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\n }", "title": "" }, { "docid": "bee12cc11e9a0877eb5f293ed703c515", "score": "0.63067037", "text": "function sortProducts(criteria, array){ \n let result = [];\n if (criteria === ORDER_ASC_BY_NAME)\n {\n result = array.sort(function(a, b) {\n if ( a.name < b.name ){ return -1; }\n if ( a.name > b.name ){ return 1; }\n return 0;\n });\n }else if (criteria === ORDER_DESC_BY_NAME){\n result = array.sort(function(a, b) {\n if ( a.name > b.name ){ return -1; }\n if ( a.name < b.name ){ return 1; }\n return 0;\n });\n }else if (criteria === ORDER_BY_PROD_COUNT){\n result = array.sort(function(a, b) {\n let aCount = parseInt(a.soldCount);\n let bCount = parseInt(b.soldCount);\n\n if ( aCount > bCount ){ return -1; }\n if ( aCount < bCount ){ return 1; }\n return 0;\n });\n }else if (criteria === ORDER_ASC_BY_PROD_PRICE){\n result = array.sort(function(a, b) {\n let aCount = parseInt(a.cost);\n let bCount = parseInt(b.cost);\n\n if ( aCount > bCount ){ return -1; }\n if ( aCount < bCount ){ return 1; }\n return 0;\n });\n \n }else if (criteria === ORDER_DESC_BY_PROD_PRICE){\n result = array.sort(function(a, b) {\n let aCount = parseInt(a.cost);\n let bCount = parseInt(b.cost);\n\n if ( aCount < bCount ){ return -1; }\n if ( aCount > bCount ){ return 1; }\n return 0;\n });\n \n}\n\n return result;\n}", "title": "" }, { "docid": "95393a65bb8f66148ebff3d508c29bf9", "score": "0.6298213", "text": "function sortNums(numbers,desc=false) {\n \n }", "title": "" }, { "docid": "6e754f9a0e9d7a0c2885ff8ea9649e80", "score": "0.629385", "text": "function sortArray(highScore) {\n highScore.sort(function (firstScore, secondScore) {\n return secondScore.score - firstScore.score;\n });\n}", "title": "" }, { "docid": "70a29074969452543b0facc488462d33", "score": "0.6291733", "text": "function sorter(){\n packageCards = $('.packages .package-card');\n sortBy = $('.filter-bar select').val();\n packageCards.sort(function(a,b){\n if(sortBy == 'reviews-most' || sortBy == 'reviews-least'){\n aVal = parseInt( $(a).attr('data-rating') );\n bVal = parseInt( $(b).attr('data-rating') );\n if(sortBy == 'reviews-most'){\n return bVal - aVal;\n }else{\n return aVal - bVal;\n }\n }\n if(sortBy == 'price-low' || sortBy == 'price-high'){\n aVal = parseFloat( $(a).attr('data-price') );\n bVal = parseFloat( $(b).attr('data-price') );\n if(sortBy == 'price-high'){\n return bVal - aVal;\n }else{\n return aVal - bVal;\n }\n }\n if(sortBy == 'popular' ){\n aPop = $(a).attr('data-popular');\n bPop = $(b).attr('data-popular');\n aPrice = parseFloat( $(a).attr('data-price') );\n bPrice = parseFloat( $(b).attr('data-price') );\n\n //This should be considered black magic it's so cool\n if( aPop == bPop){\n return aPrice - bPrice;\n }else{\n if(aPop == 'y'){\n return -1;\n }else{\n return 1;\n }\n }\n }\n });\n $('.packages').html(packageCards);\n }", "title": "" }, { "docid": "2a037de418a24282e80ba12c7769d838", "score": "0.62826735", "text": "sort() {\n this.values.sort((a, b) => a.priority - b.priority)\n }", "title": "" }, { "docid": "78ad0751db4c76a1d72073321425926c", "score": "0.6271374", "text": "function precioAscendente() {\n productsArray = productsArray.sort(function (a, b) { //funcion que ordena de forma ascendente\n return a.cost - b.cost;\n })\n //showproductsList(productsArray);\n showCards(productsArray);\n\n}", "title": "" }, { "docid": "6bb08da6bc4deae67edbb3b5cba71ab7", "score": "0.6260085", "text": "function sortResultsArray(a,b){\n if (a.popularity > b.popularity)\n return -1;\n if (a.popularity < b.popularity)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "d32af5ce6a734e92ee65b66499a3fdf9", "score": "0.62565815", "text": "function pr_asc(){\n console.log('Sort by Price Asc');\n myLibrary.sortByPriceAsc();\n highlightWords();\n}", "title": "" }, { "docid": "515c7a89416fd2fcb4e34b9aed9c9e8c", "score": "0.6255492", "text": "function sortByScore(state) {\n let items = state.items\n items.sort((a, b) => b.score - a.score)\n return state.items = items\n}", "title": "" }, { "docid": "a1133787ec549bdeacec10aff6b0bceb", "score": "0.6251595", "text": "function sortByRichest() {\n data.sort((a, b) => b.money - a.money);\n\n displayDOM();\n}", "title": "" }, { "docid": "c1be56653331d979a7c71d361a0e2acb", "score": "0.6241294", "text": "sort() {\n this.values.sort((a,b) => a.priority - b.priority)\n }", "title": "" }, { "docid": "5167b4358d3c90da2f809f57c65477d8", "score": "0.624045", "text": "function populateOrderByPercent() {\n orderingTopPerformers = ShopItem.allItems;\n orderingTopPerformers.sort(function(a, b) {\n return (b.percent - a.percent);\n });\n}", "title": "" }, { "docid": "254c7b0301f970cf84076ffbbd3fb444", "score": "0.6229559", "text": "function sortNumber(a, b) {\n return a.votes - b.votes;\n }", "title": "" }, { "docid": "18af80c2ec2f02344daea84561bb6f3b", "score": "0.6210898", "text": "sortPlaces() {\n if (this.props.filter === 'Ratings') {\n this.state.places.sort((a, b) => b.rating - a.rating);\n } else if (this.props.filter === 'Price') {\n this.state.places.sort((a, b) => a.price_level - b.price_level);\n }\n }", "title": "" }, { "docid": "5f6fc59a71a605c11ddd74986323d9b4", "score": "0.6188117", "text": "function sortTracksByPopularity(searchResult) {\n var sortedList = searchResult.sort(function(track1, track2) {\n return track2.popularity - track1.popularity; // weird piece of code but it is apparantly working :S\n });\n return sortedList;\n }", "title": "" }, { "docid": "bbb3a9cd2e32464b8f400d14de29f739", "score": "0.61690277", "text": "function highToLow() {\n let access = localStorage.getItem(\"bluemercuryProducts\");\n let preSort = JSON.parse(access);\n\n let rat = [];\n\n for (let i = 0; i < preSort.length; i++) {\n rat.push(Object.values(preSort[i])[3]);\n }\n\n rat.sort();\n\n let rat1 = []\n\n for (let i = rat.length-1; i >= 0; i--) {\n rat1.push(rat[i]);\n }\n\n let newArr = [];\n\n for (let i = 0; i < rat1.length; i++) {\n for (let j = 0; j < preSort.length; j++) {\n if (rat1[i] === Object.values(preSort[j])[3]) {\n newArr.push(preSort[j]);\n }\n }\n }\n\n document.getElementById(\"right-body\").innerHTML = null;\n\n let mainDiv = document.getElementById(\"right-body\");\n newArr.forEach(function (data) {\n let div = document.createElement(\"div\");\n let img = document.createElement(\"img\");\n img.src = data.image;\n let p1 = document.createElement(\"p\");\n p1.innerText = data.brand;\n let p2 = document.createElement(\"p\");\n p2.innerText = data.name;\n let p3 = document.createElement(\"p\");\n p3.innerText = `$${data.price}`;\n\n div.append(img, p1, p2, p3);\n mainDiv.append(div);\n });\n}", "title": "" }, { "docid": "18b31aaa1eaf88a05d6091fcdd796c9e", "score": "0.6168289", "text": "function sortRankings(rankings){\n return rankings.sort(function(a, b){\n return b.score - a.score;\n });\n}", "title": "" }, { "docid": "5b4a38c462b3af7f90964cb73a50d8c4", "score": "0.6167242", "text": "function sort() {\n sortBy = sortSelect.value;\n reposInfo.sort(function(a, b) {\n return parseFloat(b[sortBy]) - parseFloat(a[sortBy]);\n });\n }", "title": "" }, { "docid": "7dac782f79bd34e7ef637ef78b41188e", "score": "0.6164032", "text": "function _sorter(a, b){\n\t// Use aid property priority.\n\tvar bpri = aid.priority(b.property_id());\n\tvar apri = aid.priority(a.property_id());\n\treturn apri - bpri;\n }", "title": "" }, { "docid": "135fb5e46e0586547ac1577f550b0f23", "score": "0.61569715", "text": "function sortByOverallRating(){\n return function(a,b){\n if( a.overallRating < b.overallRating){\n return 1;\n }\n if(a.overallRating > b.overallRating){\n return -1;\n }\n return 0;\n }\n}", "title": "" }, { "docid": "233705489911878feb0bf2bf1c7f2c78", "score": "0.61550707", "text": "function sortProducts(criteria, array) {\n let result = [];\n\n //Criterios para orden ascendente de ABCdario\n if (criteria === ORDER_ASC_BY_NAME) {\n result = array.sort(function (a, b) {\n if (a.name < b.name) { return -1; }\n if (a.name > b.name) { return 1; }\n return 0;\n });\n\n //Criterios de orden descendente de ABCdario.\n } else if (criteria === ORDER_DESC_BY_NAME) {\n result = array.sort(function (a, b) {\n if (a.name > b.name) { return -1; }\n if (a.name < b.name) { return 1; }\n return 0;\n });\n\n //criterior de orden descendente segun relevancia del producto\n } else if (criteria === ORDER_DESC_BY_PROD_SOLD_COUNT) {\n result = array.sort(function (a, b) {\n let aSoldCount = parseInt(a.soldCount);\n let bSoldCount = parseInt(b.soldCount);\n\n if (aSoldCount > bSoldCount) { return -1; }\n if (aSoldCount < bSoldCount) { return 1; }\n return 0;\n });\n\n //criterior de orden ascendente segun valor del producto\n } else if (criteria === ORDER_ASC_BY_COST) {\n result = array.sort(function (a, b) {\n let aCost = parseInt(a.cost);\n let bCost = parseInt(b.cost);\n\n if (aCost > bCost) { return 1; }\n if (aCost < bCost) { return -1; }\n return 0;\n });\n\n //criterior de orden descendente segun valor del producto\n } else if (criteria === ORDER_DESC_BY_COST) {\n result = array.sort(function (a, b) {\n let aCost = parseInt(a.cost);\n let bCost = parseInt(b.cost);\n\n if (aCost > bCost) { return -1; }\n if (aCost < bCost) { return 1; }\n return 0;\n });\n }\n return result;\n}", "title": "" }, { "docid": "1c24f4da3300fc3c481e54fc132c64db", "score": "0.61489975", "text": "function sortScoreSummaryData(data) {\n\n data.sort(function(a, b) {\n var compA = (a.Test.TestContent.TestLevel || '').toUpperCase() +\n (a.Test.TestContent.TestDomain || '').toUpperCase();\n\n var compB = (b.Test.TestContent.TestLevel || '').toUpperCase() +\n (b.Test.TestContent.TestDomain || '').toUpperCase();\n\n return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;\n });\n\n}", "title": "" }, { "docid": "930a82d25a410c6eaa664a82bfed52b8", "score": "0.613597", "text": "function sort_by_historique(p_s1, p_s2) {\r\n return p_s2.d - p_s1.d || p_s2.s - p_s1.s || p_s1.c.localeCompare(p_s2.c);\r\n}", "title": "" }, { "docid": "9ad3c05a6f5fd7a8334ea90f8f9b3b7a", "score": "0.6120775", "text": "function sortOptionsList(options) {\n return options.sort((a, b) => {\n return -1*(a.price - b.price);\n })\n}", "title": "" }, { "docid": "e2af2d0d577de89bc863e8b0ddd369fa", "score": "0.6117893", "text": "function sortArrayLeastEngagedLoy() {\n // ARRAY BOTTOM 10% MEMBERS\n var membersLeast = Array.from(members);\n var bottomMembers = [];\n membersLeast.sort(function(a, b) {\n return a.votes_with_party_pct - b.votes_with_party_pct;\n });\n // CREATE ARRAY WITH BOTTOM 10% MEMBERS AND KEEP FINAL EQUAL MEMBERS\n for (i = 0; i < membersLeast.length; i++) {\n if (i < membersLeast.length * 0.1) {\n bottomMembers.push(membersLeast[i]);\n } \n else if (i >= membersLeast.length * 0.1 && membersLeast[i].votes_with_party_pct == membersLeast[i-1].votes_with_party_pct) {\n bottomMembers.push(membersLeast[i]);\n }\n else {\n break;\n };\n };\n createRow10PctLoy(bottomMembers, 'loyaltyTableBottom10');\n}", "title": "" }, { "docid": "819d20cbf8bc388b2edc1bd3c58f6985", "score": "0.6103483", "text": "function sortReserves(){\r\n\treserves433.sort().reverse();\r\n\treserves442.sort().reverse();\r\n\treserves343.sort().reverse();\r\n\treserves451.sort().reverse();\r\n\treserves532lib.sort().reverse();\r\n\treserves541.sort().reverse();\r\n\treserves352.sort().reverse();\r\n\treserves532vs.sort().reverse();\r\n}", "title": "" }, { "docid": "5ccd68234b2038a7669d4ef31f04180a", "score": "0.60954374", "text": "function sortScores(scoreObj) {\n // Sort through the Object and return scores highest to lowest\n scoreObj.sort( function(a, b) {\n // Sort by the score values in the array of objects\n return b.score - a.score;\n });\n}", "title": "" }, { "docid": "c1b2048fd7d9a475de3fe703175a06ae", "score": "0.6092491", "text": "function sortWealth() {\n data.sort((a, b) => b.wealth - a.wealth);\n\n updateDOM();\n}", "title": "" }, { "docid": "cb020ca0b3947c88402511b34e54d353", "score": "0.60913616", "text": "sortCourseData() {\n var courseData = this.props.courseData.data;\n\n courseData.sort((a, b) => {\n return a.catalog_number - b.catalog_number;\n });\n\n return courseData;\n }", "title": "" }, { "docid": "eec46848d4433ef1f9104490f196c164", "score": "0.6077645", "text": "function sortResults(){\r\n var sort = document.getElementById(\"bestPartie\"),\r\n sort2 = document.querySelectorAll(\"#bestPartie p\");\r\n var sort2Arr = [].slice.call(sort2).sort(function(a, b){\r\n return b.dataset.number - a.dataset.number;\r\n });\r\n \r\n sort2Arr.forEach(function (p){\r\n sort.appendChild(p);\r\n });\r\n}", "title": "" }, { "docid": "d78877f8da8ef500ace70f94629e4293", "score": "0.6058167", "text": "function sortCoins() {\n for (var i = 0; i < (coins.length - 1); i++) {\n\n var posmax = i;\n\n for (var j = i + 1; j < coins.length; j++) {\n if (coins[j].percent > coins[posmax].percent) {\n posmax = j;\n }\n }\n\n if (posmax !== i) {\n var app = coins[i];\n coins[i] = coins[posmax];\n coins[posmax] = app;\n }\n }\n}", "title": "" }, { "docid": "8435673083ccfa2580529a4e1dc02d3a", "score": "0.60561967", "text": "function sortRanking() {\n rankingArray = [];\n\n for (var number in popularity) {\n rankingArray.push([number, popularity[number]]);\n }\n\n rankingArray.sort(function(a, b) {\n return b[1] - a[1];\n });\n}", "title": "" }, { "docid": "53f1ccde3eb55f5f0637112d15b0b5f1", "score": "0.6048439", "text": "marketCapSort(a, b) {\n\n\n const marketCapA = a.market_cap\n const marketCapB = b.market_cap\n const filter = document.getElementsByClassName('Market Cap')[0]\n\n if (filter.value === 'ascending') {\n return marketCapA - marketCapB\n } else {\n return marketCapB - marketCapA\n }\n\n }", "title": "" }, { "docid": "baeeff918c299ba1f52e6094833ad187", "score": "0.60472864", "text": "function sortArrayMostEngagedLoy() {\n // ARRAYS\n var membersMost = Array.from(members);\n var topMembers = [];\n // SORT ARRAY\n membersMost.sort(function(a, b) {\n return b.votes_with_party_pct - a.votes_with_party_pct;\n });\n // CREATE ARRAY WITH TOP 10% MEMBERS AND KEEP FINAL EQUAL MEMBERS\n for (i = 0; i < membersMost.length; i++) {\n if (i < membersMost.length * 0.1) {\n topMembers.push(membersMost[i]);\n } \n else if (i >= membersMost.length * 0.1 && membersMost[i].votes_with_party_pct == membersMost[i-1].votes_with_party_pct) {\n topMembers.push(membersMost[i]);\n }\n else {\n break;\n }\n }\n //CALL PRINT FUNCTION\n createRow10PctLoy(topMembers, 'loyaltyTableTop10');\n}", "title": "" }, { "docid": "aeea27cff018d5c97ff61cb129a66689", "score": "0.60434496", "text": "function sortPoints() {\n\t\t_keys_sorted = Object.keys(_points).sort(function(x, y) {\n\t\t\treturn _points[x].rating < _points[y].rating ? 1 : -1;\n\t\t});\n\t}", "title": "" }, { "docid": "02ac1bd58a296393628bba43650100ad", "score": "0.6031567", "text": "function sort(){\n\t\t var tempData = $scope.quizzies[$scope.activeQuizIndex].participants;\n\t\t\t $scope.quizzies[$scope.activeQuizIndex].participants=[];\n\t\t\t var min=0;\n\t\t\t while(tempData.length>0){\n\t\t\t\t for(var i=0; i<tempData.length; i++){\n\t\t\t\t\tif(tempData[i].score >= tempData[min].score){\n\t\t\t\t\t min=i;\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t $scope.quizzies[$scope.activeQuizIndex].participants.push(tempData[min]);\n\t\t\t\t tempData.splice(min , 1);\n\t\t\t\t min=0;\n\t\t\t }\n\t\t}", "title": "" }, { "docid": "191292ae4d02b13cae7d15f67887b6ff", "score": "0.6013054", "text": "function sortOnProductOrderRating(newPlans){\n newPlans.sort(function(a,b){\n if(a[\"CalculatedPriceData\"][\"ProductOrder__Rating\"]<b[\"CalculatedPriceData\"][\"ProductOrder__Rating\"]){\n return -1;\n }else if(a[\"CalculatedPriceData\"][\"ProductOrder__Rating\"]>b[\"CalculatedPriceData\"][\"ProductOrder__Rating\"]){\n return 1;\n }else{\n return 0;\n }\n });\n }", "title": "" }, { "docid": "3c4cf301b35b7a0d95809116b01cc47c", "score": "0.5999731", "text": "function sortFunction(a,b){\n if(a.hoursInSpace < b.hoursInSpace)\n return 1;\n else\n return -1;\n }", "title": "" }, { "docid": "d60545c30ecb56aa65b8f747063dd541", "score": "0.5998343", "text": "function sortAccToWeightAge(data){\n var sortedArray = sortByProps(data,'weightage','FinalPremium');\n if(sortedArray[0].weightage>0) {\n return sortedArray[0];\n }\n }", "title": "" }, { "docid": "e04e71cb05b3c8784a155f58bb9eac22", "score": "0.59894884", "text": "sorter(pair1, pair2) {\n return pair1.currencyPair.lastChangeBid - pair2.currencyPair.lastChangeBid\n }", "title": "" }, { "docid": "7c336d8c7d984a213d9ed1470bceed8f", "score": "0.59892905", "text": "function sort_your_search_with_reviewmeta_adjustments() {\n\n}", "title": "" }, { "docid": "3ef52e9494a4c5a9e1cdda6c45a0b14d", "score": "0.59857273", "text": "function sortDriver(d1, d2) {\n return d2.seniority - d1.seniority;\n}", "title": "" }, { "docid": "26af48dca30e2f5a7ce57d5bfd2344cb", "score": "0.59826726", "text": "sortCurrencies(currencies) {\n currencies.sort(function(a, b) {\n return parseFloat(a.lastChangeBid) - parseFloat(b.lastChangeBid);\n });\n \n return currencies;\n }", "title": "" }, { "docid": "d74770bf64264621710fb05f93784d21", "score": "0.59802353", "text": "function sortScores(_highscoreJSON, changeOrder){\r\n var highscoreJSON = _highscoreJSON;\r\n if(highscoreJSON == null){\r\n highscoreJSON = highscores;\r\n }\r\n if(changeOrder == true){\r\n if(sortOrder == 0){\r\n sortOrder = 1;\r\n } else if(sortOrder == 1){\r\n sortOrder = 0;\r\n }\r\n }\r\n\r\n highscoreJSON.sort(function (a, b) {\r\n if(sortOrder == 1){\r\n document.getElementById(\"title1\").innerHTML = \"Wall of Shame\";\r\n document.body.style.background = \"#FF8C00\";\r\n return parseInt(a.score) - parseInt(b.score);\r\n } else if(sortOrder == 0){\r\n document.getElementById(\"title1\").innerHTML = \"Wall of Fame\";\r\n document.body.style.background = \"#333\";\r\n return parseInt(b.score) - parseInt(a.score);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "ebb576d415c52bb3f7354007dffd03d2", "score": "0.597835", "text": "sortByPriority() {\n const { onSortChange } = this.props;\n\n onSortChange(KEY_LOCATION_PRIORITY);\n }", "title": "" }, { "docid": "5a96085e7bfffffcfa6bb041b3c0268b", "score": "0.5973897", "text": "function sortByDiscount(a, b) {\n let discountA = parseInt(a.discount_percentage) || 0;\n let discountB = parseInt(b.discount_percentage) || 0;\n if (discountA < discountB) {\n return -1;\n }\n if (discountA > discountB) {\n return 1;\n }\n return 0;\n}", "title": "" }, { "docid": "5f1595d433e626c3e55a3d14bc07aa29", "score": "0.5972485", "text": "function sortCapitalByAccending(){\n data.sort((a,b)=>{\n if(a.capital < b.capital){\n return -1;\n }\n else if(a.capital > b.capital){\n return 1;\n }\n else{\n return 0;\n }\n });\n displayData(data);\n}", "title": "" }, { "docid": "73aeac9e5c3a7f96f392e797986f496b", "score": "0.59704614", "text": "function sortDescByPriority(a, b) {\r\n\t\t var x = a.priority;\r\n\t\t var y = b.priority;\r\n\t\t return ((x < y) ? 1 : ((x > y) ? -1 : 0));\r\n\t\t}", "title": "" }, { "docid": "9444a588e9f6ce8f19a6914e5645f7cd", "score": "0.5970424", "text": "function SortByQtyFunction(b, a){\n var aQty = a.quantity;\n var bQty = b.quantity;\n return ((aQty < bQty) ? -1 : ((aQty > bQty) ? 1 : 0));\n }", "title": "" }, { "docid": "49ab71f6d6a0a1c680d50cbbf4c498fe", "score": "0.5968857", "text": "function sortHighest(a,b){\n\tvar prev = Number(a.starRating);\n\tvar next = Number(b.starRating);\n\treturn next - prev;\n}", "title": "" }, { "docid": "59befd3b9d26650b7311915e8afda680", "score": "0.5965431", "text": "function sortNumber(a, b) { return b.k - a.k; }", "title": "" }, { "docid": "08e13f32c86b10525aa0064df0535465", "score": "0.5961584", "text": "function tag_sort(a, b)\n\t{\n\t\treturn a.order > b.order ? 1 : a.order < b.order ? -1 : 0;\n\t}", "title": "" }, { "docid": "a3cffe9e7feafe87c511a0ff3ab463ce", "score": "0.5959966", "text": "function sortBy(field, reverse, primer){\n\n var key = function (x) {return primer ? primer(x[field]) : x[field]};\n\n return function (a,b) {\n var A = key(a), B = key(b);\n\n return ((A < B) ? -1 : (A > B) ? + 1 : 0) * [-1,1][+!!reverse]; \n }\n}", "title": "" }, { "docid": "6e908796db9961273d96b483a22fa63d", "score": "0.59507656", "text": "function sort_by(select, reverse, primer) {\n const key = primer ?\n function(x) {\n return primer(x[select])\n } :\n function(x) {\n return x[select]\n };\n\n reverse = !reverse ? 1 : -1;\n\n return function(a, b) {\n return a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n }\n}", "title": "" }, { "docid": "6fe69fcaede9b925179fe0d19c33bf36", "score": "0.594875", "text": "function setResultPriority_by_sortRevealedCoins() {\n sameRevealedCoinsCount.map((value, key) => {\n slotsPriorityResult.push(coins[key]);\n });\n slotsPriorityResult.sort(function(a, b) { return b - a });\n }", "title": "" }, { "docid": "10ef428a859539dc5e470d06a9b8bb14", "score": "0.59439087", "text": "function sortLowest(a,b){\n\tvar prev = Number(a.starRating);\n\tvar next = Number(b.starRating);\n\treturn prev - next;\n}", "title": "" }, { "docid": "5952d91d144d9d9a4047e2780ad91b47", "score": "0.59411573", "text": "function sortonPrice(min, max) {\n try {\n //Looks if there are any errors with the parameters\n if (min > max) throw 'The minimum price cannot be higher than the maximum price!';\n if (typeof min != 'number') throw 'The minimum number is not a number';\n if (typeof max != 'number' && typeof max != 'undefined') throw 'The maximum number is not a number';\n if (typeof max == 'undefined') max = Number.POSITIVE_INFINITY;\n\n $('.product-container .product').each(function(){\n var p = $(this).attr('price');\n\n if (p >= min && p <= max) {\n if (shops.indexOf($(this).attr('shop')) != -1) $(this).show();\n }else{\n $(this).hide();\n }\n })\n\n return true;\n\n } catch(err) {\n return 'An error occurred: ' + err;\n }\n}", "title": "" }, { "docid": "20ab32d8341c304067f604c83384dced", "score": "0.5917905", "text": "static sortByStoreThenPrice(a, b)\n {\n if (a.store > b.store)\n return 1;\n else if (a.store < b.store)\n return -1;\n else\n return Util.sortByPrice(a, b);\n }", "title": "" } ]
372fc594e1aa07cdabea0e6551ce7966
Helper (used in 2 places)
[ { "docid": "f1fed407dee2a957dc6723868bd15654", "score": "0.0", "text": "function buf2binstring(buf, len) {\n\t // use fallback for big arrays to avoid stack overflow\n\t if (len < 65537) {\n\t if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n\t return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n\t }\n\t }\n\t\n\t var result = '';\n\t for(var i=0; i < len; i++) {\n\t result += String.fromCharCode(buf[i]);\n\t }\n\t return result;\n\t}", "title": "" } ]
[ { "docid": "b1afd331f19af517e3d3303d018ab206", "score": "0.65644056", "text": "function _fn(){ /*...*/ }\t\t//Funzioni private", "title": "" }, { "docid": "30b6c3486f0643d1a32bcac38836b101", "score": "0.61386853", "text": "function Helpers(){}", "title": "" }, { "docid": "1ac507c5d6aac7c114c1a979ee26340d", "score": "0.6075101", "text": "function __axO4V4GhxjCIJCmJ0hzrQQ() {}", "title": "" }, { "docid": "2e3582a22a72c64130a4aa13afd3360c", "score": "0.6018936", "text": "function Helpers() {}", "title": "" }, { "docid": "049b8d452993fc2891cdeb0d39276be3", "score": "0.56946385", "text": "function avataxHelper() {}", "title": "" }, { "docid": "1e141ab3582641d14f30dab44d2adb6d", "score": "0.5471496", "text": "getH() { throw new Error('Implement me') }", "title": "" }, { "docid": "cc40508e414cd5b9a616a005574d90ab", "score": "0.5463132", "text": "function _5JLIsfM2BDWu5if6PVH9Mw() {}", "title": "" }, { "docid": "1fce695f68ac3e300fa8c04cfde11991", "score": "0.54628235", "text": "function _6yGdN5U6Pj6hvxUip1p9OQ() {}", "title": "" }, { "docid": "1eac1f5c7f96ad4479f9d04051b14faf", "score": "0.5454042", "text": "getW() { throw new Error('Implement me') }", "title": "" }, { "docid": "09cec39c6b7f564c3507791ba0a0450c", "score": "0.54337007", "text": "_firstRendered() {}", "title": "" }, { "docid": "ac71b6533dc6f9681d04903fc1b9d2a8", "score": "0.54175264", "text": "function TMP() {\n return;\n }", "title": "" }, { "docid": "f7c125dd3c87a8f1e8c5d1ca2ff4e1aa", "score": "0.5358412", "text": "function mSRQAu7ItjugQsBXE87Mrw() {}", "title": "" }, { "docid": "10f4afb80d955af0b4a0f7690ea4c94b", "score": "0.5348321", "text": "function _5Ra3VTLNPzq7ojEKUXMbvA() {}", "title": "" }, { "docid": "250b014811d7113169507b60623f6f76", "score": "0.5309527", "text": "function Util() { }", "title": "" }, { "docid": "06e71c40eea88f7914bf337f6eaaedac", "score": "0.5307435", "text": "function _2YQqj_bQsOz2H9NScp8H3BQ() {}", "title": "" }, { "docid": "e48e4b7a3aa71df35c483ced1e452129", "score": "0.52990955", "text": "function _2XEbHcHe2jmPYfmsOJUDbA(){}", "title": "" }, { "docid": "5412cbec186d84761f7c0bb74ddbad34", "score": "0.5273744", "text": "function __func(){}", "title": "" }, { "docid": "7315b85e2b1e8ca5ca549e896c9c0ec4", "score": "0.5273659", "text": "function $_info() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5261687", "text": "function TMP() {}", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.52603775", "text": "_firstRendered() { }", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.52603775", "text": "_firstRendered() { }", "title": "" }, { "docid": "ad35e0b2fdf40cfa33261b402e1b51eb", "score": "0.5242196", "text": "function KDfpDan_afja0WTIAvRulEg() {}", "title": "" }, { "docid": "253b9e82ad6cddeeef0c65d136b5e6ee", "score": "0.52408856", "text": "function tmp(){}", "title": "" }, { "docid": "7257c44658cd3dbffdd55c06e8dbf7f6", "score": "0.5225675", "text": "summarize /* istanbul ignore next */ () {}", "title": "" }, { "docid": "9d4ed7e9c27dddbd47993fca280a074c", "score": "0.5219217", "text": "adjust() { }", "title": "" }, { "docid": "e818aa9ac720855c88af2c07eb0f26e7", "score": "0.52131754", "text": "static get order() {return 2}", "title": "" }, { "docid": "d588b4437f06c3807eac1bc17c01d016", "score": "0.52034134", "text": "function Utils() {\n\n}", "title": "" }, { "docid": "52554f6d0ed3ed926c96dd6cda5a532d", "score": "0.51944506", "text": "function Utils() {\n }", "title": "" }, { "docid": "b5df59f969b6f5ab619498188fcbfb1c", "score": "0.51695484", "text": "function Utility(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5161283", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5161283", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5161283", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5161283", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5161283", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5161283", "text": "function TMP(){}", "title": "" }, { "docid": "c4527bb72a7c0e7fd29571083515c8d3", "score": "0.5154415", "text": "function wb(a){return a&&a.hd?a.g():a}", "title": "" }, { "docid": "a50302dba602669b846804da04cc8aad", "score": "0.5152094", "text": "function nw6PUrLXLjqiWJDOBAtITA() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5129312", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5129312", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5129312", "text": "prepare() {}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.51255065", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.51255065", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.51255065", "text": "function miFuncion(){}", "title": "" }, { "docid": "efdafa27bdbf28ff4a654a7154be4dd9", "score": "0.5123829", "text": "function __func(){'ground control to major tom'}", "title": "" }, { "docid": "a4d2a9855bf296f7690ca751f55d3fb4", "score": "0.5093566", "text": "function SIDatasHelper() {\n\n}", "title": "" }, { "docid": "30a5b53da77d460560f8564e60231ccf", "score": "0.50824654", "text": "function dummy() {return;}", "title": "" }, { "docid": "30a5b53da77d460560f8564e60231ccf", "score": "0.50824654", "text": "function dummy() {return;}", "title": "" }, { "docid": "f4bb834c5e1b55c51ea7eda44e309b8b", "score": "0.5070616", "text": "function InnerloLite() {}", "title": "" }, { "docid": "36d5e2e5de439336f38b3b12fdf77bde", "score": "0.50520307", "text": "function Utils() {\n}", "title": "" }, { "docid": "c7a496a0a1abd803b1cb17a7af315a0e", "score": "0.50400394", "text": "function _r(){}", "title": "" }, { "docid": "9a11644cac2df92ff995dc05dbe9f4f5", "score": "0.5022944", "text": "function WwLsf9svtT_acggkuTIOTEA() {}", "title": "" }, { "docid": "f16e4eb5233e3cb62a591c18f7c1e2b5", "score": "0.50216806", "text": "function D6FOYfOFpz_aD_a1dpPFWmdw() {}", "title": "" }, { "docid": "0a6f77832d7f956d06ce4e6cc283a6aa", "score": "0.5019092", "text": "__init() {\n\n\t}", "title": "" }, { "docid": "77c308d0c7c9dce3aebc021c277bdc52", "score": "0.49912518", "text": "function _82pwGb6BWzOVYZGortTaJw() {}", "title": "" }, { "docid": "c6d56508496a44303d751bb0677bf789", "score": "0.49867144", "text": "function miFuncion() {}", "title": "" }, { "docid": "c6d56508496a44303d751bb0677bf789", "score": "0.49867144", "text": "function miFuncion() {}", "title": "" }, { "docid": "5f1cf1307c31d47b504d6e704640e37f", "score": "0.4975786", "text": "function SzlSjRxM1DexWk1PpKwx2g() {}", "title": "" }, { "docid": "df9ed89c100ecd442f4a8380c4ab15f6", "score": "0.4973808", "text": "function utils () {\n checkSizeHandler()\n checkScrollPos()\n checkForTouch()\n fixBannerImg()\n slideIntoPlace()\n}", "title": "" }, { "docid": "1afba09ff8424555ced72331867197c1", "score": "0.4970911", "text": "function utils() {\n checkSizeHandler();\n checkScrollPos();\n checkForTouch();\n fixBannerImg();\n slideIntoPlace();\n}", "title": "" }, { "docid": "66265674c39a25615ea0e7f4c0786e72", "score": "0.4970699", "text": "function fn() {\n\t\t\n\t}", "title": "" }, { "docid": "885513ec9ebd2a696dc34302112e9dc7", "score": "0.49594232", "text": "function s4() { }", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.4959129", "text": "function Wrapper() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.4959129", "text": "function Wrapper() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.4959129", "text": "function Wrapper() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.4959129", "text": "function Wrapper() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.4959129", "text": "function Wrapper() {}", "title": "" }, { "docid": "58e17abadc414430c1942e3f48b4e4bc", "score": "0.49591088", "text": "function _i(){}", "title": "" }, { "docid": "c2ab77f5ef828a7079c80a72326c9b96", "score": "0.49587265", "text": "_map_data() { }", "title": "" }, { "docid": "43ffe14c6d9d5356326c9d83c42d123e", "score": "0.49563506", "text": "function ALTlwNbT_azuAkDe1GRJsqQ() {}", "title": "" }, { "docid": "9f4f6f36652f34541517e8bb317956b6", "score": "0.49442023", "text": "function EBB6YpS42zKw0RTPI65LPQ() {}", "title": "" }, { "docid": "e8ef1c9d9f6bc53e42232d7792a2ac8b", "score": "0.49345306", "text": "function DisplayHelper() {\n}", "title": "" }, { "docid": "9f11183badffc756e10287142244d9b5", "score": "0.49264577", "text": "function rp7SJnnHHDS3bGGGnOxkBw() {}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.49248523", "text": "function Interfaz() {}", "title": "" }, { "docid": "ab57d407091faaefba838444a9bc56ef", "score": "0.4916027", "text": "function mjjQ_bLOD2jy_aGF35IHnfvQ() {}", "title": "" }, { "docid": "910c7dab37c966cce745b41a9caac21e", "score": "0.49119976", "text": "function TomatoUtils() {}", "title": "" }, { "docid": "7507a48e1c46cccacd6a4c6665901960", "score": "0.48970264", "text": "function Rn(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48810688", "text": "function r(){}", "title": "" }, { "docid": "dc102f42b8f62a99e82c6ea06cb7e082", "score": "0.4879145", "text": "function junk() { return }", "title": "" }, { "docid": "437a7df16829474a27436d983fd611ee", "score": "0.4874134", "text": "function ei(){}", "title": "" }, { "docid": "437a7df16829474a27436d983fd611ee", "score": "0.4874134", "text": "function ei(){}", "title": "" }, { "docid": "b49aa481639e55b0ad90fd6ea4a41fea", "score": "0.4867168", "text": "function _5MoheFcFBz_aCSksX6eoQvw() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.48586372", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.48586372", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.48586372", "text": "function dummy() {}", "title": "" }, { "docid": "23e82a916b3e45ce61e834a0488bf96c", "score": "0.48566276", "text": "function GoogleCloud() {}", "title": "" }, { "docid": "2a46e042fec3ca3ca75ca6d8f976911f", "score": "0.48468667", "text": "function ec(){}", "title": "" }, { "docid": "d58a9805a75ab82ee593178b8069dea0", "score": "0.4838407", "text": "function utils() {\n checkSizeHandler();\n}", "title": "" }, { "docid": "a2a7e36a7f4047c2eea44496cbfe90e7", "score": "0.4838298", "text": "function format(str) {\n\n// WRITE A HELPER FUNCTION TO ACCESS IN OTHER FUNCTIONS\n\n}", "title": "" }, { "docid": "fa6dd38aa115b735c8ab3242acd69b92", "score": "0.48356357", "text": "function amr477308() { return ' x'; }", "title": "" }, { "docid": "d140de93c4598cf91c04b029883f0940", "score": "0.48319417", "text": "function StackingUtil(){}", "title": "" }, { "docid": "6122317267d88f327f538c3c8fa81609", "score": "0.48285475", "text": "function i(e,t){return t}", "title": "" }, { "docid": "92032b36d6af1f6d8437cf883bc2b86e", "score": "0.48266172", "text": "_noop() {}", "title": "" } ]
189af3da386178fc6f975801b6f1807d
funcao chamada quando ocorre mudanca no campo tamanho
[ { "docid": "f07fecb66f514a08969dd9684c95fd39", "score": "0.0", "text": "function selectSize(){\n let selectedSize = document.getElementById(\"size\").value;\n if(selectedSize == \"\"){\n document.getElementById(\"options_order\").style.display = \"none\";\n }\n else{\n document.getElementById(\"options_order\").style.display = \"block\";\n // document.getElementById(\"limitFlavors\").innerHTML = sizeOptions[selectedSize];\n document.getElementById(\"numFlavors\").innerHTML = 0;\n\n // ajax\n let req = new XMLHttpRequest();\n req.open(\"GET\", \"ajax/size.php?initials=\"+selectedSize, true);\n req.send();\n req.onreadystatechange = function(){\n if (this.readyState == 4 && this.status == 200){\n let data = JSON.parse(this.responseText);\n flavorsAmount = data.flavorsAmount;\n document.getElementById(\"showPrice\").innerHTML = parseFloat(data.price).toLocaleString('en-US', { style: 'currency', currency: 'USD' });\n document.getElementById(\"limitFlavors\").innerHTML = data.flavorsAmount;\n document.getElementById(\"price\").value = data.price;\n document.getElementById(\"codSize\").value = data.code;\n document.getElementById(\"nameSize\").value = data.name;\n }\n };\n // fim ajax\n\n // limpar todos os checkboxes\n let checks = document.getElementsByName(\"flavors[]\");\n for(let i = 0; i < checks.length; i++)\n checks[i].checked = false;\n \n // retirar estilo selecionado de todas as divs\n let divs = document.getElementsByClassName(\"flavor\");\n for(let i = 0; i < divs.length; i++) \n divs[i].classList.remove(\"selected\");\n }\n}", "title": "" } ]
[ { "docid": "00f753d260fc3229d00c534816121eb5", "score": "0.61678994", "text": "function restar_caracteres(campo,campo2)\n{\n var value = $(campo).val().length;\n value = 400 - value;\n $(campo2).html(value);\n}", "title": "" }, { "docid": "6324774e2a61ea389f2ef418272f44db", "score": "0.6150797", "text": "function setMaxLength(size,element)\n{\n if (element.value.length >= size) {\n element.value = element.value.substr(0,size); \n return true;\n }else{\n return false; \n }\n}", "title": "" }, { "docid": "10a3b4dbdc3d9f27423e1e207880f9db", "score": "0.6045554", "text": "function editingLengthChange(el) {\n\talterClass(el, 'required', !el.value.length && /var(char|binary)$/.test(selectValue(el.parentNode.previousSibling.firstChild)));\n}", "title": "" }, { "docid": "c681b6ca808f998f94deb0bf57ac0dcd", "score": "0.59657776", "text": "function textoComTamanhoEntre(min, max, erro, texto) {\n const tamanho = (texto || '').trim().length\n\n if(tamanho < min || tamanho > max) {\n throw erro\n }\n}", "title": "" }, { "docid": "4b6f9ffb8bcd268c101bce0e0158170b", "score": "0.5959609", "text": "function maxLengthCheck(object) {\r\n if (object.value.length > object.maxLength)\r\n object.value = object.value.slice(0, object.maxLength)\r\n }", "title": "" }, { "docid": "e1146bd58288e1417b90c4646ef5c163", "score": "0.59460074", "text": "function maxLengthCheck(object) {\n if (object.value.length > object.maxLength)\n object.value = object.value.slice(0, object.maxLength)\n }", "title": "" }, { "docid": "a1772a92d18adcb4bd5de565ae1780eb", "score": "0.5918462", "text": "function imposeMaxLength(event,maxLen,object)\n{\n\tif(object.value.length > maxLen)\n\t{\t\n\t\tvar newText=object.value.substring(0,maxLen);\t\n\t\tobject.value=newText;\t\t\t\n\t\treturn object.value;\n\t\t\n\t}\n\telse\t\n\t{\t\t\n\t\treturn(object.value.length < maxLen);\n\t}\n}", "title": "" }, { "docid": "fb172575e7884860ab5fbaa3145c0bad", "score": "0.58637506", "text": "function onLostFocusDocumento() {\n documento = document.getElementById(\"documento\");\n var size = documento.value.length;\n if (size < 11) {\n documento.value = '';\n }\n}", "title": "" }, { "docid": "a7773ec5a10ef11cf6ee8a07924a985e", "score": "0.5841991", "text": "function verificar(t,c)\r\n{\r\n\tvar aux\t\t= t.value;\r\n\tvar largo\t= (aux.length);\r\n\tif(largo == c)\r\n\t{\r\n\t\talert(\"Ha completado el maximo de caracteres permitidos\");\r\n\t}\r\n}", "title": "" }, { "docid": "0878db5fad19d7af89783ca12fd312a7", "score": "0.582167", "text": "function longitudID(field,maxLength) {\r\n if (field.value.length < maxLength) {\r\n setValido(field);\r\n return true;\r\n } else {\r\n setInvalido(\r\n field,\r\n `${field.name} debe tener menos de ${maxLength} caracteres`\r\n );\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "62907bf54a5e96d1bf61b1c1f6ac9b65", "score": "0.58184534", "text": "function pulaCampo(campo,proxcampo,tam)\n{\n\tif(campo.value.length == tam)\n\t\tproxcampo.focus();\n\t\n\treturn true;\n}", "title": "" }, { "docid": "d4b3811b0608cc706b4cbc786bde7249", "score": "0.5808821", "text": "valida() {\n validacoes.campoStringNaoNulo(this.titulo, \"título\");\n validacoes.campoTamanhoMinimo(this.titulo, \"título\", 5);\n\n validacoes.campoStringNaoNulo(this.conteudo, \"conteúdo\");\n validacoes.campoTamanhoMaximo(this.conteudo, \"conteúdo\", 140);\n }", "title": "" }, { "docid": "a56c3d76fe7ae52b9d6931eeabd5c389", "score": "0.5805549", "text": "function limitSize(ob) {\n if (ob.getAttribute(\"maxlength\")) {\n var ml = ob.getAttribute(\"maxlength\");\n if (ob.value.length > ml) {\n ob.value = ob.value.substr(0, ml);\n alert(\"ERR_FIELD_MAX_SIZE_EXCEEDED\" + \":\" + ml);\n }\n }\n}", "title": "" }, { "docid": "2b5cc48a3990ab246a495cc3facc0d42", "score": "0.5778211", "text": "function MaxLengthCheck(ctl, e){\r\n var maxLength = 4;\r\n if (ctl.value.length > maxLength)\r\n {ctl.value = ctl.value.slice(0,maxLength); }\r\n}", "title": "" }, { "docid": "c49cd0e3f8cb4471145e4f4117438f45", "score": "0.5777316", "text": "function contador(event) {\n\tvar input = event.target;\n\tvar total = input.value.length;\n\tvar quantidade = maxLength;\n\tvar resto;\n\tif(total <= quantidade){\n\t\tresto = quantidade - total;\n\t}\n\telse{\n\t\tresto = 0;\n\t\tvalue = input.value.substr(0, 50);\n\t\tinput.value = value;\n\t}\n\tdocument.getElementById(\"total\").innerHTML = resto;\n}", "title": "" }, { "docid": "0eb40d3c10bb8734a93dcbf2376484ef", "score": "0.57402587", "text": "function chkLength(ctrl, size) {\r\n var prmData = Trim(ctrl.value);\r\n \r\n var prmAllowedSize = parseInt(size);\r\n\r\n if (prmData.length > prmAllowedSize) {\r\n alert(\"Data length cannot be greater than \" + size);\r\n ctrl.focus();\r\n }\r\n \r\n }", "title": "" }, { "docid": "2cb0ba0f8d2a4e4f191859829d02c8bf", "score": "0.5686051", "text": "function contarCaracteres() {\n $(\"#campo-mensagem\").on(\"input\", function() {\n var campo = $(\"#campo-mensagem\").val();\n var qtd_caracteres = campo.length;\n $(\"#contador-piupiu\").text(qtd_caracteres);\n });\n}", "title": "" }, { "docid": "8427df15af805fde5660ab38634127f4", "score": "0.56851774", "text": "function maxLengthCheck(object)\n{\n\tconsole.log(object.maxLength);\n\tif (object.value.length > object.maxLength)\n\t\tobject.value = object.value.slice(0, object.maxLength)\n}", "title": "" }, { "docid": "7e3f264377bdedc51afe3ddb47452c05", "score": "0.56652", "text": "setMaxlen(el, size) {\n el.setAttribute('maxlength', size)\n }", "title": "" }, { "docid": "d7ded4b35897c5082db838a604aa44e1", "score": "0.5665144", "text": "function counterUpdate2(opt_countedTextBox2, opt_countBody2, opt_maxSize2) { \r\r\nvar countedTextBox2 = opt_countedTextBox2 ? opt_countedTextBox2 : \"form_txtdestaque\"; \r\r\nvar countBody2 = opt_countBody2 ? opt_countBody2 : \"countBody2\"; \r\r\nvar maxSize2 = opt_maxSize2 ? opt_maxSize2 : 1024; \r\r\n\r\r\nvar field2 = document.getElementById(countedTextBox2); \r\r\n\r\r\nif (field2 && field2.value.length >= maxSize2) { \r\r\nfield2.value = field2.value.substring(0, maxSize2); \r\r\n} \r\r\nvar txtField2 = document.getElementById(countBody2); \r\r\nif (txtField2) { \r\r\ntxtField2.innerHTML = field2.value.length; \r\r\n} \r\r\n}", "title": "" }, { "docid": "36fce382f984e7e49c960e8e2e6307c3", "score": "0.5643816", "text": "function check_input_length(id, msg_id, field, minlength, maxlength) {\n //check trường không được để trống\n if (($(\"#\" + id).val()) == \"\") {\n check_input_empty(id, msg_id, field);\n }\n //tính length chuỗi nhập vào\n else {\n var len = $(\"#\" + id).val().length;\n if (maxlength > 0) {\n if (len > maxlength) {\n $(\"#\" + msg_id).html(\"Trường \" + field + \" không được vượt quá\" + maxlength + \"kí tự\");\n $(\"#\" + id).focus();\n return false;\n }\n }\n if (minlength > 0) {\n if (len < minlength) {\n $(\"#\" + msg_id).html(\"Độ dài \" + field + \" cần tối thiểu \" + minlength + \" kí tự\");\n $(\"#\" + id).focus();\n return false;\n }\n }\n }\n\n}", "title": "" }, { "docid": "3cde097216b4678c886e6a2da929af08", "score": "0.56393397", "text": "function mudaCorTexto(){\n caracteres.textContent = texto.value.length + '/140';\n if(texto.value.length == 0){\n textoAviso.textContent = 'Você precisa escrever algo';\n textoAviso.className = 'vermelho textoPiu';\n }\n else if (texto.value.length < 140){\n textoAviso.className = 'transparente textoPiu';\n }\n\n if(texto.value.length <= 40){\n caracteres.className = '';\n }\n\n \n else if(texto.value.length <= 80){\n caracteres.className = 'amarelo';\n }\n\n\n else if(texto.value.length < 140){\n caracteres.className = 'laranja';\n }\n\n else{\n caracteres.className = 'vermelho';\n textoAviso.className = 'vermelho textoPiu';\n textoAviso.textContent = 'Você atingiu o limite de caracteres';\n }\n\n}", "title": "" }, { "docid": "f850069f629dde9f37326fcddd9156df", "score": "0.5628054", "text": "function miqCheckMaxLength(obj) {\n var ml = obj.getAttribute ? parseInt(obj.getAttribute(\"maxlength\"), 10) : \"\";\n var counter = obj.getAttribute ? obj.getAttribute(\"counter\") : \"\";\n\n if (obj.getAttribute && obj.value.length > ml) {\n obj.value = obj.value.substring(0, ml);\n }\n if (counter) {\n if (ManageIQ.browser != 'Explorer') {\n $('#' + counter)[0].textContent = obj.value.length;\n } else {\n $('#' + counter).innerText = obj.value.length;\n }\n }\n}", "title": "" }, { "docid": "6166c975b1542fafd374aae4126c9fe3", "score": "0.5620672", "text": "function alteraTamanho(){\n\tvar classe = Math.floor(Math.random() * 3)\n\tswitch (classe) {\n\t\tcase 0:\n\t\t\treturn 'mosquito1'\n\t\tcase 1:\n\t\t\treturn 'mosquito2'\n\t\tcase 2:\n\t\t\treturn 'mosquito3'\n\t}\n}", "title": "" }, { "docid": "40d0657e1da06b4485e442163019d335", "score": "0.56185454", "text": "function limite(que,cuanto)\n {\n var v=que.value\n if(v.length>cuanto)\n que.value=v.substring(0,cuanto)\n }", "title": "" }, { "docid": "a42d5d418905de10fe44ceaaead0847b", "score": "0.5616897", "text": "function mascaraTelefone(campo)\n{\n\tvar tel = campo.value;\n\n\tif (tel.length == 4)\n\t{ \n\t\ttel = tel + '-'; \n\t\tcampo.value = tel; \n\t\treturn true; \n\t} \n}", "title": "" }, { "docid": "b68581caf84c41c421e808fa6f3e327b", "score": "0.56095", "text": "function textLimit(field, maxlen, idlimite) \n{\n if (field.value.length > maxlen)\n {\n field.value = field.value.substring(0, maxlen);\n alert('Dépassement de la limite de caractères');\n\t idlimite.style.color='red';\n\t setTimeout(function(){idlimite.style.color='green';},2000);\n }\n else if((maxlen > field.value.length) && (field.value.length > 0))\n {\n\t setTimeout(function(){idlimite.style.color='green';},2000);\n }\n \n}", "title": "" }, { "docid": "cac0a0f62b6cdcf22fc6a5b356ae1b63", "score": "0.560085", "text": "function countEntradas() {\n var element = document.getElementById('contador');\n var obj = document.getElementById('input-textarea');\n\n obj.maxLength = 5000;\n element.innerHTML = 5000 - obj.value.length;\n\n if (4500 - obj.value.length < 0) {\n element.style.color = 'red';\n\n } else {\n element.style.color = 'grey';\n }\n}", "title": "" }, { "docid": "726907667ee65e1bb6a775d676af45f7", "score": "0.56004316", "text": "maxlength(input, maxValue) {\n\n let inputLength = input.value.length;\n\n let mensagem_error = `O campo precisa ter menos que ${maxValue} caracteres`;\n\n if (inputLength > maxValue) {\n this.imprimirMensagem(input, mensagem_error);\n }\n }", "title": "" }, { "docid": "35ebaf1b32c5328d82ff72b826e3710d", "score": "0.55778575", "text": "preventOverfill(fieldNameData, fieldLength) { \r\n fieldNameData.addEventListener(\"keyup\", function(e){ \r\n if (this.value.length >= fieldLength) { \r\n this.value = this.value.substr(0, fieldLength);\r\n } \r\n });\r\n }", "title": "" }, { "docid": "8efc059648b85441fb69cfdc4dc3ad49", "score": "0.5566914", "text": "function cadastraAtividade(){\n if(input.value.length > 3){\n erro.style.display = \"none\";\n //criaAtividade();\n }else{\n erro.style.display = \"grid\";\n erro.innerHTML = `${input.value} não é uma atividade válida!`\n }\n limpaInput();\n}", "title": "" }, { "docid": "264405e9439c165edb7405da6a705e09", "score": "0.55665517", "text": "function agregarMuestras(){\r\n\t\tvar cantMuestras = $(\"#idCantMuestras\").val();\r\n\t\t\r\n\t\tif(cantMuestras==\"\"){\r\n\t\t\talert(\"Ingrese la cantidad de muestras\");\r\n\t\t\t$(\"#idCantMuestras\").focus();\r\n\t\t}\r\n\t\tfor ( var i = 0; i < cantMuestras; i++) {\r\n\t\t\tagregarFila();\r\n\t\t}\t\r\n\t\t$('[name=\"fiscalizacionDTO.tamanioMuestra\"]').val($('#tablaMuestras [id*=fila]').size());\r\n\t\t\r\n\t\t\r\n\t}", "title": "" }, { "docid": "f562934cd7d364684b77f5459d688422", "score": "0.5559708", "text": "function limpaCampo() {\r\n campo.value = ''\r\n}", "title": "" }, { "docid": "3a310ba3dd2d4e47e24129714093ba5d", "score": "0.55293936", "text": "function chkMaxLength(e, t, n) { try { if (document.getElementById(e) != null) { e = document.getElementById(e) } if (e != null) { if (e.value[0] == \" \") { e.value = e.value.substr(1, e.value.length); e.value = e.value.trim() } if (e.value.length > t) { e.value = e.value.substring(0, t); BootstrapAlert(\"Maximum \" + t + \" characters are allowed.\", e); e.focus() } } n = document.getElementById(n); if (n != null) { if (e.value.length == 0) { $(n).html(\"Maximum \" + t + \" characters are allowed.\") } else { $(n).html(t - e.value.length + \" characters are left.\") } } } catch (r) { } }", "title": "" }, { "docid": "3f23f0a6e3e919b97a816421e572cef4", "score": "0.5526354", "text": "function limparPadrao(campo) {\r\n\tif (campo.value == campo.defaultValue) {\r\n\t\tcampo.value = \"\";\r\n\t}\r\n}", "title": "" }, { "docid": "eceb729cd74402e6ecdfd317687478ac", "score": "0.55183524", "text": "function ForceMaxLength(objField, nLength, strWarning){\n var strField = new String(objField.attr(\"value\"));\n\n if (strField.length > nLength) {\n errorMessage = \"Maximum Allowed Length is \" + nLength ;\n DisplayError(objField,errorMessage);\n return false;\n } else\n return true;\n}", "title": "" }, { "docid": "93f03e5ab79f91ee9af752817aaecc4c", "score": "0.55107445", "text": "function elimPart(partSize){\nconsole.log('dentro de la funcion elimPart')\n for (var i = 0; i < memFija.length; i++) {\n if (memFija[i].size == partSize){\n memFija[i].size = 0;\n }\n }\n}", "title": "" }, { "docid": "c0d95882b372477db7974ad1f65bf143", "score": "0.5508896", "text": "function inputlenCheck(e,minilen) {\n if (e.target.value.length < minilen) {\n alert('input length less than'+minilen+',input again!')\n e.target.value = ''\n }\n else {\n }\n}", "title": "" }, { "docid": "14384a28b0a3c6eec0dd63828437fdef", "score": "0.54971594", "text": "function longitud(field, minLength, maxLength) {\r\n if (field.value.length >= minLength && field.value.length < maxLength) {\r\n setValido(field);\r\n return true;\r\n } else if (field.value.length < minLength) {\r\n setInvalido(\r\n field,\r\n `${field.name} debe tener al menos ${minLength} caracteres`\r\n );\r\n return false;\r\n } else {\r\n setInvalido(\r\n field,\r\n `${field.name} debe tener menos de ${maxLength} caracteres`\r\n );\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "3dcf7e59916c1b7242c3e36d344da1f7", "score": "0.5489092", "text": "function valMaxLengthTextArea(objCampo, maxLength) {\n if (objCampo.value.length > maxLength) {\n objCampo.style.border = '1px solid red';\n objCampo.focus();\n alert(maxLength + \" caracteres, maximo.\");\n return false;\n }\n objCampo.style.border = 'none';\n return true;\n }", "title": "" }, { "docid": "31358de7e13b76d8e2e80c159aad5fdf", "score": "0.54756474", "text": "function _Field_isLengthGT(len){\n\tif( this.obj.value.length <= len){\n\t\tthis.error = \"The \" + this.description + \" field must be greater than \" + len + \" characters.\";\n\t}\n}", "title": "" }, { "docid": "91f58ab4a56648b14563243dedda75ac", "score": "0.54685235", "text": "function checkLength(pValue,pMaxLength)\n{\n if (pValue.length >= pMaxLength)\n {\n event.returnValue = false;\n }\n}", "title": "" }, { "docid": "bb02949d44a0261a312d2c6c93a6f3d2", "score": "0.54681087", "text": "function isMaxLength( obj ) {\n\tvar mlength=obj.getAttribute?parseInt( obj.getAttribute( \"maxlength\" ) ):\"\"\n\tif( obj.getAttribute && obj.value.length>mlength )\n\tobj.value=obj.value.substring( 0, mlength )\n}", "title": "" }, { "docid": "28e68329556bbde4bc3751213e4dc122", "score": "0.5448522", "text": "function mascaraNumero(id) {\n console.log(\"alterou\");\n var numero = $(\"#\" + id);\n console.log(typeof numero.val());\n if (numero.val() == 0)\n numero.val('(' + telefone.value) ; //quando começamos a digitar, o script irá inserir um parênteses no começo do campo.\n if (numero.val() == 3)\n numero.val(telefone.value + ') '); //quando o campo já tiver 3 caracteres (um parênteses e 2 números) o script irá inserir mais um parênteses, fechando assim o código de área.\n}", "title": "" }, { "docid": "bdad729b7fd8b78526a6c84b456858f4", "score": "0.544734", "text": "function ForceLength(objField, nLength, strWarning)\r\n{\r\n\tvar strField = new String(objField.value);\r\n\r\n\tif (strField.length > nLength) {\r\n\t\talert(strWarning);\r\n\t\treturn false;\r\n\t} else\r\n\t\treturn true;\r\n}", "title": "" }, { "docid": "224d0ccb6a388ab8d6e3700bb221cf19", "score": "0.54423887", "text": "function MaskMoeda(campo){\r\n\tcampo.value = MoedaToDec(campo.value);\r\n\tcampo.value = DecToMoeda(campo.value);\t\t\r\n}", "title": "" }, { "docid": "5b448d412bc468a638fd954d5477f329", "score": "0.5432497", "text": "function cuentaCaracteres(texto){\n\n return texto.length;\n }", "title": "" }, { "docid": "0fce578dc1938dc84ef3dc5af49f620c", "score": "0.54270923", "text": "function actualizar_cod(){\n\n var codigo = document.getElementById(\"codigo\");\n codigo.value = \"\";\n codigo.value =\"00\" +( Math.trunc(Estudiante[Estudiante.length-1].codigo) + 1);\n\n if(Math.trunc(Estudiante[Estudiante.length-1].codigo)+1 > 9){\n codigo.value =\"0\" +( Math.trunc(Estudiante[Estudiante.length-1].codigo) + 1);\n }\n}", "title": "" }, { "docid": "3fc3c7ad922fa7af733048512f97c46b", "score": "0.5420424", "text": "function maxLength(object, maxLength) {\n if( object.value.length >= maxLength) {\n object.value = object.value.substring(0, maxLength); \n }\n }", "title": "" }, { "docid": "6b28dc63f6e5c0d710b7ef546674cb9e", "score": "0.54165393", "text": "function imposeMaxLength(object, maxLen) {\n\tif (object.value.length > maxLen) {\n object.value = object.value.substring(0, maxLen);\n\t}\n}", "title": "" }, { "docid": "962b98005c2b1b25bc2e81ab9281cea4", "score": "0.5388172", "text": "setLength(length){\n\t\tthis.length = length;\n\t\tthis.props.getLength(length);\n\t}", "title": "" }, { "docid": "5aac3f9058b05a755b4c6dbc42e1295a", "score": "0.53873193", "text": "function campo_vacio(campo) {\r\n\tif (campo.value == \"\") {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Proceso de validacion de tamaņo en las cadenas de caracteres.\r\n\t * \r\n\t * @param campo\r\n\t * Cadena a comprobar.\r\n\t * @param tamaņo\r\n\t * Tamaņo maximo de la cadena.\r\n\t * @returns {Boolean} Indicador del proceso.\r\n\t */\r\n\tfunction comprobar_tamaņo(campo, tamaņo) {\r\n\t\tvar valido = true;\r\n\t\tif (campo.length > tamaņo) {\r\n\t\t\tvalido = false;\r\n\t\t}\r\n\t\treturn valido;\r\n\t}\r\n\r\n\t/**\r\n\t * Validacion numerica del contenido de un campo mediante el uso de\r\n\t * expresiones regulares.\r\n\t * \r\n\t * @param campo\r\n\t * @returns {Boolean}\r\n\t */\r\n\tfunction isNumero(campo) {\r\n\t\tvar texto = campo.value;\r\n\t\tvar expresion = /^[-]?\\d*\\.?\\d*$/;\r\n\t\ttexto = texto.toString();\r\n\t\tif (!texto.match(expresion)) {\r\n\t\t\talert(\"Solo se admiten numero para el campo.\");\r\n\t\t\tsetTimeout(\"focusElement('\" + campo.form.name + \"', '\" + campo.name\r\n\t\t\t\t\t+ \"')\", 0);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (texto == NaN) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Validacion de un Email. Solo que el formato sea correcto no si existe\r\n\t * realmente.\r\n\t * \r\n\t * @param campo\r\n\t * @returns {Boolean}\r\n\t */\r\n\tfunction isEMailAddr(campo) {\r\n\t\tvar texto = campo.value;\r\n\t\tvar expresion = /^[\\w-]+(\\.[\\w-]+)*@([\\w-]+\\.)+[a-zA-Z]{2,7}$/;\r\n\t\tif (!texto.match(expresion)) {\r\n\t\t\talert(\"No es un email correcto\");\r\n\t\t\tsetTimeout(\"focusElement('\" + campo.form.name + \"', '\" + campo.name\r\n\t\t\t\t\t+ \"')\", 0);\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction validar_Telefono(campo) {\r\n\t\tvar valido = true;\r\n\t\t// EXPRESION REGULAR PARA TELEFONOS\r\n\t\tvar expresion_telefono = /(?:\\d{3}|\\(\\d{3}\\))([-\\/\\.])\\d{3}\\1\\d{4}/;\r\n\t\tvar numero = campo.value;\r\n\t\tif (!numero.match(expresion_telefono)) {\r\n\t\t\tvalido = false;\r\n\t\t}\r\n\t\treturn valido;\r\n\t}\r\n\r\n\tfunction validar_TelefonoInternacional() {\r\n\t\tvar valido = true;\r\n\t\t// EXPRESION REGULAR PARA TELEFONOS DE CUALQUIER PAIS\r\n\t\tvar expresion_telefono = /\t^\\+?\\d{1,3}?[- .]?\\(?(?:\\d{2,3})\\)?[- .]?\\d\\d\\d[- .]?\\d\\d\\d\\d$/;\r\n\t\tvar numero = campo.value;\r\n\t\tif (!numero.match(expresion_telefono)) {\r\n\t\t\tvalido = false;\r\n\t\t}\r\n\t\treturn valido;\r\n\t}\r\n\r\n\tfunction validar_CodigoPostal(campo) {\r\n\t\tvar valido = true;\r\n\t\t// EXPRESION REGULAR PARA CODIGOS POSTALES\r\n\t\tvar expresion_cp = /^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$/;\r\n\t\tvar codigo = campo.value;\r\n\t\tif (!codigo.match(expresion_cp)) {\r\n\t\t\tvalido = false;\r\n\t\t}\r\n\t\treturn valido;\r\n\t}\r\n\r\n\t/**\r\n\t * Funcion auxiliar para pasar el foco al campo elegido.\r\n\t * \r\n\t * @param formName\r\n\t * @param elemName\r\n\t */\r\n\tfunction focusElement(formName, elemName) {\r\n\t\tvar elem = document.forms[formName].elements[elemName];\r\n\t\telem.focus();\r\n\t\telem.select();\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "c2a074dcf26a8d65137db34277b6061f", "score": "0.53741443", "text": "set setLength(length){\n\t\tthis.length = length;\n\t}", "title": "" }, { "docid": "c705f9df95475b9e73cbef7a48533b6b", "score": "0.536973", "text": "function TextMaxLength(Id, Number) {\n $(Id).bind(\"input propertychange\", function () {\n var a = $(Id).val();\n //Select Character of Number In Sequence\n if(a.length > Number){\n $(Id).val($(Id).val().substr(0, Number));\n }\n });\n}", "title": "" }, { "docid": "ad96e977c4a7c0e567789a55bc2f34fa", "score": "0.5367645", "text": "function documetoSeleccionado(){\n \n switch(document.getElementById(\"tipoIdentificacionAlu\").value) {\n case \"cedula\": \n document.getElementById(\"regidentificacionAlu\").setAttribute(\"maxlength\", \"10\");\n break;\n case \"pasaporte\":\n document.getElementById(\"regidentificacionAlu\").setAttribute(\"maxlength\", \"15\");\n break;\n \n }\n}", "title": "" }, { "docid": "fbc291601fdc9b38406bfc2cd4e55a15", "score": "0.535887", "text": "function limitValueLength(oFormElement, strMessage, intLength) {\r\n\t\tif (oFormElement && oFormElement.value) {\r\n\t\t\tvalLength = oFormElement.value.length;\r\n\t\t\tif ( valLength > intLength ) {\r\n\t\t\t\talert(strMessage);\r\n\t\t\t\toFormElement.value = oFormElement.value.slice(0, intLength - 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7c324992ede7d542c48ba8e2f161001a", "score": "0.5342787", "text": "function mascara_hora(hora, field){ \r\n\t\t \t var horafield = field;\r\n var myhora = ''; \r\n myhora = myhora + hora; \r\n if (myhora.length == 2){ \r\n myhora = myhora + ':'; \r\n horafield.value = myhora; \r\n } \r\n if (myhora.length == 5){ \r\n verifica_hora(horafield); \r\n } \r\n }", "title": "" }, { "docid": "d34abfe37c903978f510615ac7593f04", "score": "0.533883", "text": "function colorirLetras() {\n $(\"#campo-mensagem\").on(\"input\", function(){\n var qtd_caracteres = $(\"#campo-mensagem\").val().length;\n if(qtd_caracteres > 150) { //VERIFICA SE A QUANTIDADE DE CARACTERES E MAIOR QUE 150\n $(\"#campo-mensagem\").css(\"color\", \"#8f399a\");\n $(\"#contador\").css(\"color\", \"#8f399a\"); //SE SIM, A COR DAS LETRAS SE TORNARA ROXO, INCICANDO QUE A MENSAGEM EXCEDEU 150 CARACTERES\n } else {\n $(\"#campo-mensagem\").css(\"color\", \"black\"); //SE NAO, NAO HAVERA NENHUMA INDICACAO DE COR NAS LETRAS, CONTINUANDO PRETO\n $(\"#contador\").css(\"color\", \"black\");\n }\n });\n}", "title": "" }, { "docid": "17286708adf02da8f2a83ba0286a1436", "score": "0.53088737", "text": "function resizeInput() {\n if (this.value.length == 0) { this.style.width = \"3ch\" }\n else {\n this.style.width = this.value.length + \"ch\";\n }\n }", "title": "" }, { "docid": "c690647af46362980ee8b265a4caf682", "score": "0.530629", "text": "function limitTextLength(textareabox, limit) {\n if (textareabox.value.length > limit) textareabox.value = textareabox.value.substring(0, limit);\n }", "title": "" }, { "docid": "ad0f95e576952048512277e134a02c35", "score": "0.5299762", "text": "function clearPvalorSoma(numero) {\n buildIdPValorSoma(numero).text(0);\n}", "title": "" }, { "docid": "f3fc4a096a1a27244216247c5abc7f8f", "score": "0.5295719", "text": "function textLimit(field, maxlen) {\n\tif (field.value.length > maxlen + 1)\n\t\talert('Maximum ' + maxlen + ' characters. Your input has been truncated!');\n\tif (field.value.length > maxlen)\n\t\tfield.value = field.value.substring(0, maxlen);\n}", "title": "" }, { "docid": "dd055b7dafda4a01f55e95741ec356d9", "score": "0.5290906", "text": "validateLength() {\r\n let $this = this;\r\n let inputs = this.inputs.length = this.formHandler.findByAttr('length');\r\n\r\n inputs.on(this.options.events, function () {\r\n let input = $(this);\r\n\r\n $this.length(input);\r\n });\r\n }", "title": "" }, { "docid": "054b3e13e095bd2620f349a3179af83e", "score": "0.5290606", "text": "function enforceLength(txt) {\n if ( 'string' !== typeof txt ) {\n txt = txt && txt.toString ? txt.toString() : txt + '';\n }\n\n txt = txt.replace(new RegExp('<br/>', 'g'), \"\\n\");\n txt = txt.replace(new RegExp('{{br}}', 'g'), \"\\n\");\n txt = txt.replace(new RegExp('{br}', 'g'), \"\\n\");\n\n if ('edit' === element.page.form.mode) {\n return txt;\n }\n\n if (!element.maxLen || '' === element.maxLen || 0 === element.maxLen) {\n // no limit\n element.maxLen = 0;\n return txt;\n }\n\n txt = txt.substr(0, element.maxLen);\n return txt;\n }", "title": "" }, { "docid": "ee67e80d463d43a487d8567f993b90eb", "score": "0.52894664", "text": "function pre_length(){\n val = val.toString();\n }", "title": "" }, { "docid": "8ba007769f1400466cbf2bc332abb499", "score": "0.52892244", "text": "function ismaxlength(obj){\nvar mlength=obj.getAttribute? parseInt(obj.getAttribute(\"maxlength\")) : \"\"\nif (obj.getAttribute && obj.value.length>mlength)\nobj.value=obj.value.substring(0,mlength)\n}", "title": "" }, { "docid": "0bd533f4dd8e69852a1f6006d9ed2046", "score": "0.5285672", "text": "function _Field_isLengthLT(len){\n\tif( this.obj.value.length >= len){\n\t\tthis.error = \"The \" + this.description + \" field must be less than \" + len + \" characters.\";\n\t}\n}", "title": "" }, { "docid": "42b74ab4981a38c371444b4298b8dd00", "score": "0.52856714", "text": "function formataCampo(campo, Mascara, evento) {\n var boleanoMascara;\n\n var Digitato = evento.keyCode;\n exp = /\\-|\\.|\\/|\\(|\\)| /g\n campoSoNumeros = campo.value.toString().replace( exp, \"\" );\n\n var posicaoCampo = 0;\n var NovoValorCampo=\"\";\n var TamanhoMascara = campoSoNumeros.length;;\n\n if (Digitato != 8) { // backspace\n for(i=0; i<= TamanhoMascara; i++) {\n boleanoMascara = ((Mascara.charAt(i) == \"-\") || (Mascara.charAt(i) == \".\")\n || (Mascara.charAt(i) == \"/\"))\n boleanoMascara = boleanoMascara || ((Mascara.charAt(i) == \"(\")\n || (Mascara.charAt(i) == \")\") || (Mascara.charAt(i) == \" \"))\n if (boleanoMascara) {\n NovoValorCampo += Mascara.charAt(i);\n TamanhoMascara++;\n }else {\n NovoValorCampo += campoSoNumeros.charAt(posicaoCampo);\n posicaoCampo++;\n }\n }\n campo.value = NovoValorCampo;\n return true;\n }else {\n return true;\n }\n}", "title": "" }, { "docid": "57aa5c0055e9abadcab7f6bbf5052b18", "score": "0.5278452", "text": "function resizeInput() {\n $(this).attr('size', $(this).val().length);\n}", "title": "" }, { "docid": "57aa5c0055e9abadcab7f6bbf5052b18", "score": "0.5278452", "text": "function resizeInput() {\n $(this).attr('size', $(this).val().length);\n}", "title": "" }, { "docid": "de032929875b86e3ff305c0c15204c19", "score": "0.5276184", "text": "function check_length(my_form)\n{\n maxLen = 50;\n // max number of characters allowed\n if (my_form.my_text.value.length > maxLen) {\n // Alert message if maximum limit is reached. \n // If required Alert can be removed. \n var msg = \"You have reached your maximum limit of characters allowed\";\n $(\"#test-upload-product\").prop(\"readonly\", true);\n// document.getElementById(\"test-upload-product\").readOnly = true;\n $('.biderror .mes').html(\"<div class='pop_content'>\" + msg + \"</div>\");\n $('#posterrormodal').modal('show');\n\n // Reached the Maximum length so trim the textarea\n my_form.my_text.value = my_form.my_text.value.substring(0, maxLen);\n } else {\n// $(\"#test-upload-product\").prop(\"readonly\", false);\n //document.getElementById(\"test-upload-product\").readOnly = false;\n // Maximum length not reached so update the value of my_text counter\n my_form.text_num.value = maxLen - my_form.my_text.value.length;\n }\n}", "title": "" }, { "docid": "a31145e23b11088c0b201c6db0d202b9", "score": "0.5257044", "text": "function onTBRestrChng(e){\n\n var max_len = parseInt($('#max_len').val(), 10);\n var min_len = parseInt($('#min_len').val(), 10);\n\n for(var i = 0; i < mySel.length; i++){\n\n // Negavtive select deletes and set to undefined\n if(mySel[i] === undefined)\n continue;\n \n\n if(max_len)\n mySel[i].max_len = max_len;\n else\n mySel[i].max_len = 0;\n if(min_len)\n mySel[i].min_len = min_len;\n else\n mySel[i].min_len = 0;\n\n if(max_len === max_len && max_len === max_len &&\n min_len !== 0 && max_len !==0 &&\n min_len > max_len){\n mySel[i].min_len = 0;\n $('#min_len').val(0);\n }\n\n mySel[i].not_empty = $('#not_empty').is(':checked'); \n }\n}", "title": "" }, { "docid": "8779597d1995803c5c43234756317236", "score": "0.52555704", "text": "function validateLength (field) {\n if (field.value.length > 0) {\n field.style.borderBottomColor = 'green';\n field.classList.remove ('error');\n }else{\n field.style.borderBottomColor = 'red';\n field.classList.add ('error');\n }\n\n }", "title": "" }, { "docid": "ca6b86815850ee970268286ac1ada372", "score": "0.5254713", "text": "function formataCampo(campo, Mascara, evento) { \n var boleanoMascara; \n \n var Digitato = evento.keyCode;\n exp = /\\-|\\.|\\/|\\(|\\)|\\:| /g\n campoSoNumeros = campo.value.toString().replace( exp, \"\" ); \n \n var posicaoCampo = 0; \n var NovoValorCampo=\"\";\n var TamanhoMascara = campoSoNumeros.length;; \n \n if (Digitato != 8) { // backspace \n for(i=0; i<= TamanhoMascara; i++) { \n boleanoMascara = ((Mascara.charAt(i) == \"-\") || (Mascara.charAt(i) == \".\")|| (Mascara.charAt(i) == \":\")\n || (Mascara.charAt(i) == \"/\")) \n boleanoMascara = boleanoMascara || ((Mascara.charAt(i) == \"(\") \n || (Mascara.charAt(i) == \")\") || (Mascara.charAt(i) == \" \")) \n if (boleanoMascara) { \n NovoValorCampo += Mascara.charAt(i); \n TamanhoMascara++;\n }else { \n NovoValorCampo += campoSoNumeros.charAt(posicaoCampo); \n posicaoCampo++; \n } \n } \n campo.value = NovoValorCampo;\n return true; \n }else { \n return true; \n }\n }", "title": "" }, { "docid": "d9d08658e5e2373a62e1dc7ab947bd71", "score": "0.525229", "text": "function definirTamanho(valor, id) {\n console.log(id, valor)\n let label = document.getElementById(`displayscala${id}`)\n label.textContent = valor\n let bolinha = document.getElementById(id)\n bolinha.style.width = `${valor}.1em`\n bolinha.style.height = `${valor}.1em`\n}", "title": "" }, { "docid": "1ee04c036435e6552f4062c70446ae6e", "score": "0.52510744", "text": "function brojacBeleska() { // max 500 karaktera\n\n var el_t = document.getElementById('beleska');\n var length = el_t.getAttribute(\"maxlength\");\n var el_c = document.getElementById('brojac');\n el_c.innerHTML = length;\n el_t.onkeyup = function () {\n document.getElementById('brojac').innerHTML = (length - this.value.length) + \"/500\";\n };\n}", "title": "" }, { "docid": "cb7a55d87dc9edbe3c62d40051e8727d", "score": "0.52359", "text": "function lengde(dato) \r\n{\r\n return (dato.length == 10); \r\n}", "title": "" }, { "docid": "ef38805930f3cd570a2f2d34521ada09", "score": "0.5235263", "text": "length(input) {\r\n let value = input.val(),\r\n length = Number(input.attr('length'));\r\n\r\n if (Is.NaN(length) || value == '') {\r\n this.hideError(input, 'length', Validator.DO_NOT_MARK_AS_VALID);\r\n return;\r\n }\r\n\r\n if (value.length != length) {\r\n this._displayError(input, 'length', 'length', [length]);\r\n } else {\r\n this.hideError(input, 'length');\r\n }\r\n }", "title": "" }, { "docid": "7f14f08e21a13e95c7c2bdcdb0df3d09", "score": "0.52303785", "text": "function publicar(){\n var nome = \"Mateus Roni\";\n var usuario = \"@mateusroni\";\n var fotoDePerfil = \"./Imagens/Foto.jpeg\";\n\n if(texto.value.length > 0 && texto.value.length < 140){\n adicionaPiu(nome, usuario, fotoDePerfil, texto.value, 'antes');\n texto.value = '';\n caracteres.textContent = texto.value.length + '/140';\n }\n mudaCorTexto();\n}", "title": "" }, { "docid": "595845ffa73b35b724ec40a15b0139d4", "score": "0.5229902", "text": "function isLength(dato) {\n return (dato.length === 10) \n}", "title": "" }, { "docid": "2e3f9294405f4ef7bfd066fa7f2b173e", "score": "0.5222728", "text": "function validarRequeridos(campo){\r\n\r\n\tcampo.trim();\r\n\r\n\tif(campo.length == 0){\r\n\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "title": "" }, { "docid": "2357d29ca940b385fde147d1217552dc", "score": "0.5217286", "text": "function registerFieldLengthValidator()\n{\n registerCustomConverter(\n \"String\",\n\n\n (value, ctx) => {\n const maxLength = getMaxLength(ctx);\n if (maxLength > 0 && value.length > maxLength)\n {\n return i18n(\"Value too long\");\n }\n return null;\n },\n false,\n false\n );\n}", "title": "" }, { "docid": "e38de63ad052c0c7c409a02aff897639", "score": "0.52162856", "text": "function agregarTarea(e) {\n //evito la funcion por defecto del boton\n e.preventDefault();\n //pregunto si el campo esta vacio. si lo esta, pido que se ingrese una tarea\n //si no lo esta, lo agrego a la lista y lo guardo en local storage\n if (campo.value === \"\") {\n alert(\"Ingrese una tarea\");\n } else {\n agregarItemLista(campo.value);\n guardarEnAlmacenamientoLocal(campo.value);\n\n //vacio el campo\n campo.value = \"\";\n }\n}", "title": "" }, { "docid": "592bde35f7cbeaea16cf7fe889b125e8", "score": "0.52149886", "text": "function verificarCamposVacios(e) {\n var campo = $(event.target);\n campo.next().remove();\n var valueCampo = campo.val();//llamo el valor del campo\n var error = '';\n\n if (valueCampo.length > 0) {//validamos si no hay string vacio\n campo.removeClass(\"is-invalid\").addClass(\"is-valid\");// se concatenan removeClass y addClas,s\n\n } else {\n error = 'Campo Obligatorio'\n campo.removeClass(\"is-valid\").addClass(\"is-invalid\");\n campo.parent().append(`<div class= 'invalid-feedback'>${error}</div>`)//agregamos la clase del error\n }\n\n if (event.type === 'blur') {\n campo.on('input', verificarCamposVacios)\n }\n validarSiTodoOkey();\n }", "title": "" }, { "docid": "68aa6b8da57084e4fa71d6bcac6f1ca2", "score": "0.5191413", "text": "function checkTextAreaMaxLength(textBox, e, parent) {\n var maxLength = parseInt($(textBox).data(\"length\"));\n if (!checkSpecialKeys(e)) { \n if (textBox.value.length > maxLength - 1) textBox.value = textBox.value.substring(0, maxLength); \n }\n $(\".char-count\", parent).html(maxLength - textBox.value.length);\n return true; \n }", "title": "" }, { "docid": "9f7c999b5f41dfd0cfb8c4f51c7765e9", "score": "0.5187397", "text": "function carritoCantidad(e) {\n\tconst cantidad = parseInt(e.value),\n\t\t id = parseInt(e.id);\n\n\tif(actualizarCantidad({cantidad, id})){\n\t\tstorage.addStorage(productos)\n\t\t\t.then(res => {\n\t\t\t\tcarrito.agregarCarrito(productos);\n\t\t\t})\n\t}\n}", "title": "" }, { "docid": "1bbb5b05151f749e71ffc6fb593a32d7", "score": "0.51871026", "text": "function validar_longitud(campo,longitud)\n{\n var campo_sin_espacios = $.trim($(campo).val());\n if(campo_sin_espacios.length < longitud)\n {\n return false;\n }\n else\n return true\n}", "title": "" }, { "docid": "32bf795b70c3e9b8eba30fb0d63df328", "score": "0.5184922", "text": "function checkForLength(obj) {\n // alert(obj);\n var length = $(\"#\" + obj).val().length;\n //alert(length);\n if (length < 6) {\n ShowMessage('info', 'Need your Kind Attention!', \"You are not allow to enter Mobile number less than 6 .\", \"bottom-left\");\n $('#' + obj).val('0');\n // $('#' + obj).focus();\n }\n\n}", "title": "" }, { "docid": "93cdbacbd6281e3deeb918b5adab0acb", "score": "0.5177368", "text": "function cleanDados(limpar) {\r\n var limpa = limpar;\r\n if(limpa == \"clean\"){\r\n document.getElementById(\"valor\").value = innerHTML = \"\";\r\n document.getElementById(\"res\").innerHTML = \"\";\r\n }else if(limpa == \"CancelE\"){\r\n document.getElementById(\"valor\").value = innerHTML = \"\";\r\n }else{\r\n valorUm = document.getElementById(\"valor\").value;\r\n document.getElementById(\"valor\").value = innerHTML = valorUm.slice(0, -1);\r\n /*O método slice () retorna os elementos selecionados em uma matriz, \r\n como um novo objeto de matriz.\r\n O método slice () seleciona os elementos que começam no argumento de início fornecido e termina em,\r\n mas não inclui , o argumento de fim especificado .*/ \r\n }\r\n}", "title": "" }, { "docid": "64e22b9be94878d2f3a02b52d2aceeb4", "score": "0.5172573", "text": "function setCadastroRemoverPermissao(element) {\n $(element).hide(100);\n setTimeout(function () {\n $(element).remove();\n if ($('#cardCadastroListaPermissao').find('.div-registro').length == 0) {\n $('#cardCadastroListaPermissao').html('<div class=\"listaVazia\" style=\"padding: 15px\"><small class=\"text-muted\">Nenhum registros encontrado ...</small></div>');\n $('#cardCadastroListaPermissaoSize').html('0 permissõe(s) atribuída(s)');\n } else {\n $('#cardCadastroListaPermissaoSize').html($('#cardCadastroListaPermissao').find('.div-registro').length + ' permissõe(s) atribuída(s)');\n }\n }, 100);\n\n}", "title": "" }, { "docid": "ff4e26ddc4ac44211e5b7728d2b66b45", "score": "0.5170418", "text": "function ContarCaracteres(field,countfield,maxlimit){\n\tif (field.value.length > maxlimit) // if too long...trim it!\n\tfield.value = field.value.substring(0, maxlimit);\n\t// otherwise, update 'characters left' counter\nelse\n\tcountfield.value = maxlimit - field.value.length;\n}", "title": "" }, { "docid": "b7a84e8680cd5eeff5500c4229501321", "score": "0.51699007", "text": "function formataCampo(campo, Mascara, evento) {\n var boleanoMascara;\n\n var Digitato = evento.keyCode;\n exp = /\\-|\\.|\\/|\\(|\\)| /g\n campoSoNumeros = campo.value.toString().replace(exp, \"\");\n\n var posicaoCampo = 0;\n var NovoValorCampo = \"\";\n var TamanhoMascara = campoSoNumeros.length;;\n\n if (Digitato != 8) { // backspace\n for (i = 0; i <= TamanhoMascara; i++) {\n boleanoMascara = ((Mascara.charAt(i) == \"-\") || (Mascara.charAt(i) == \".\")\n || (Mascara.charAt(i) == \"/\"))\n boleanoMascara = boleanoMascara || ((Mascara.charAt(i) == \"(\")\n || (Mascara.charAt(i) == \")\") || (Mascara.charAt(i) == \" \"))\n if (boleanoMascara) {\n NovoValorCampo += Mascara.charAt(i);\n TamanhoMascara++;\n } else {\n NovoValorCampo += campoSoNumeros.charAt(posicaoCampo);\n posicaoCampo++;\n }\n }\n campo.value = NovoValorCampo;\n return true;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "4732f90994ad181515bd8030a403d641", "score": "0.5159302", "text": "function validarRequeridos(campo){\n\tcampo.trim(); // Saca los espacios en blanco del string.\n\tif (campo.length == 0) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "356784d7c021ffc58c6ca5b58a942bdf", "score": "0.51502705", "text": "function formataCampo(campo, Mascara, evento) {\n var boleanoMascara;\n\n var Digitato = evento.keyCode;\n exp = /\\-|\\.|\\/|\\(|\\)| /g;\n campoSoNumeros = campo.value.toString().replace(exp, \"\");\n\n var posicaoCampo = 0;\n var NovoValorCampo = \"\";\n var TamanhoMascara = campoSoNumeros.length;;\n\n if (Digitato != 8) { // backspace\n for (i = 0; i <= TamanhoMascara; i++) {\n boleanoMascara = ((Mascara.charAt(i) == \"-\") || (Mascara.charAt(i) == \".\")\n || (Mascara.charAt(i) == \"/\"))\n boleanoMascara = boleanoMascara || ((Mascara.charAt(i) == \"(\")\n || (Mascara.charAt(i) == \")\") || (Mascara.charAt(i) == \" \"))\n if (boleanoMascara) {\n NovoValorCampo += Mascara.charAt(i);\n TamanhoMascara++;\n } else {\n NovoValorCampo += campoSoNumeros.charAt(posicaoCampo);\n posicaoCampo++;\n }\n }\n campo.value = NovoValorCampo;\n return true;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "e60cc0173cc67eceb3f19ea99687a625", "score": "0.51476806", "text": "function _Field_isLength(len, type){\n\tvar len = parseInt(_param(arguments[0], 10, \"number\"), 10);\n\tvar type = _param(arguments[1], \"numeric\");\n\n\t// check to make sure the phone is the correct length\n\tif( !_isLength(this.value, len, type) ){\n\t\tthis.error = \"The \" + this.description + \" field must include \" + len + \" \" + type + \" characters.\";\n\t}\n}", "title": "" }, { "docid": "d7396dd331ab98dba5ddde9a090f91c1", "score": "0.51420635", "text": "function addMascaraPesquisa(elemento) {\n\tvar id = getValorElementPorIdJQuery('valorPesquisa');\n\tvar vals = elemento.split(\"*\");\n\tvar campoBanco = vals[0];\n\tvar typeCampo = vals[1];\n\t\n\t$(id).unmask();\n\t$(id).unbind(\"keypress\"); \n\t$(id).unbind(\"keyup\");\n\t$(id).unbind(\"focus\");\n\t$(id).val('');\n\tif (id != idundefined) {\n\t\tjQuery(function($) {\n\t\t\tif (typeCampo === classTypeLong) {\n\t\t\t\t$(id).keypress(permitNumber);\n\t\t\t}\n\t\t\telse if (typeCampo === classTypeBigDecimal) {\t\n\t\t\t\t$(id).maskMoney({precision:4, decimal:\",\", thousands:\".\"}); \n\t\t\t}\n\t\t\telse if (typeCampo === classTypeDate) {\n\t\t\t\t$(id).mask('99/99/9999');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(id).unmask();\n\t\t\t\t$(id).unbind(\"keypress\");\n\t\t\t\t$(id).unbind(\"keyup\");\n\t\t\t\t$(id).unbind(\"focus\");\n\t\t\t\t$(id).val('');\n\t\t\t}\n\t\t\taddFocoAoCampo(\"valorPesquisa\");\n\t\t});\n\t}\n}", "title": "" }, { "docid": "d1322134fe67bb495bd077f6796dd86d", "score": "0.51314753", "text": "function editingLengthFocus(field) {\n\tvar td = field.parentNode;\n\tif (/(enum|set)$/.test(selectValue(td.previousSibling.firstChild))) {\n\t\tvar edit = document.getElementById('enum-edit');\n\t\tvar val = field.value;\n\t\tedit.value = (/^'.+'$/.test(val) ? val.substr(1, val.length - 2).replace(/','/g, \"\\n\").replace(/''/g, \"'\") : val); //! doesn't handle 'a'',''b' correctly\n\t\ttd.appendChild(edit);\n\t\tfield.style.display = 'none';\n\t\tedit.style.display = 'inline';\n\t\tedit.focus();\n\t}\n}", "title": "" }, { "docid": "170d813fa0d7e9b1442718697a989ee5", "score": "0.51272774", "text": "function limpiarTextArea($numero) {\n\n if ($numero == 1) {\n\n // limpiar campos de registrod de area\n\n $(\"#txtRegArea\").val(\"\");\n\n\n } else if ($numero == 2) {\n\n // Limpiar campos de registro de Asignatura\n\n $(\"#txtRegAsignatura\").val(\"\");\n\n }\n\n }", "title": "" }, { "docid": "5d004541edf76243e5e9fe896eee8de1", "score": "0.5122819", "text": "function validarLongitud(campo) {\n\n if(campo.value.length > 0 ) {\n campo.style.border = '';\n campo.classList.remove('error');\n } else {\n campo.style.border = '1px solid red';\n campo.classList.add('error');\n }\n}", "title": "" }, { "docid": "9558c062750f6b376510a54042409ecb", "score": "0.51214576", "text": "function maximo(elemento, caracteres) {\n //se almacena el texto que contiene el textarea al que se enlaza el evento, referenciado como \"this\"\n var texto = elemento.value;\n\n // muestra los resultados de las variables en la \"CONSOLA\" del explorador, de esta manera no hace falta hacer alerts\n console.log(texto); \n console.log(caracteres);\n\n //si la longitud del texto ya es mayor que 10, se devuelve false cancelando el evento\n if (texto.length > caracteres) {\n elemento.value = texto.substr(0,caracteres);\n }\n }", "title": "" }, { "docid": "e9556a2f7bea7c8d3191c05ba6671fe0", "score": "0.5119224", "text": "function formataCampo(campo, Mascara, evento) { \r\r\n var boleanoMascara; \r\r\n \r\r\n var Digitato = evento.keyCode;\r\r\n exp = /\\-|\\.|\\/|\\(|\\)| /g\r\r\n campoSoNumeros = campo.value.toString().replace( exp, \"\" ); \r\r\n \r\r\n var posicaoCampo = 0; \r\r\n var NovoValorCampo=\"\";\r\r\n var TamanhoMascara = campoSoNumeros.length;; \r\r\n \r\r\n if (Digitato != 8) { // backspace \r\r\n for(i=0; i<= TamanhoMascara; i++) { \r\r\n boleanoMascara = ((Mascara.charAt(i) == \"-\") || (Mascara.charAt(i) == \".\")\r\r\n || (Mascara.charAt(i) == \"/\")) \r\r\n boleanoMascara = boleanoMascara || ((Mascara.charAt(i) == \"(\") \r\r\n || (Mascara.charAt(i) == \")\") || (Mascara.charAt(i) == \" \")) \r\r\n if (boleanoMascara) { \r\r\n NovoValorCampo += Mascara.charAt(i); \r\r\n TamanhoMascara++;\r\r\n }else { \r\r\n NovoValorCampo += campoSoNumeros.charAt(posicaoCampo); \r\r\n posicaoCampo++; \r\r\n } \r\r\n } \r\r\n campo.value = NovoValorCampo;\r\r\n return true; \r\r\n }else { \r\r\n return true; \r\r\n }\r\r\n}", "title": "" } ]
06c616687408b698eb989a13282c78b1
DO NOT CONVERT TO STRING
[ { "docid": "0ad9f2e4e9e080b8cd11a57404d2688c", "score": "0.0", "text": "function reverseInteger(number) {\n // TODO: Implement this function!\n\n if (number < 0) {\n return null;\n }\n\n if (number === 0) {\n return 0;\n }\n\n // var reverse = number;\n var reverse = 0;\n\n while (number !== 0) {\n var endDigit = number % 10;\n\n reverse = reverse * 10;\n reverse = reverse + endDigit;\n number = number - endDigit;\n number = number / 10;\n }\n\n return reverse;\n}", "title": "" } ]
[ { "docid": "a109ef87671f312bf91a4dc97f481ba6", "score": "0.65701747", "text": "function _toString(val){return null==val?\"\":\"object\"==typeof val?JSON.stringify(val,null,2):String(val)}", "title": "" }, { "docid": "666db2fcc9d64efd5862af3951c70984", "score": "0.6409203", "text": "convertToString (value) {\n return 'IRRELEVANT';\n }", "title": "" }, { "docid": "c3bac65ecd0518460965354c7ffcc52c", "score": "0.6407165", "text": "toString() {}", "title": "" }, { "docid": "79b6bb1c826954e150850d34c261d644", "score": "0.6327655", "text": "function to_string(val)\n{\n return (val.toString());\n}", "title": "" }, { "docid": "5c6b1c53aef13a46cb751666f58c22d6", "score": "0.631905", "text": "function toString(value){return''+value;}", "title": "" }, { "docid": "5c6b1c53aef13a46cb751666f58c22d6", "score": "0.631905", "text": "function toString(value){return''+value;}", "title": "" }, { "docid": "5c6b1c53aef13a46cb751666f58c22d6", "score": "0.631905", "text": "function toString(value){return''+value;}", "title": "" }, { "docid": "5c6b1c53aef13a46cb751666f58c22d6", "score": "0.631905", "text": "function toString(value){return''+value;}", "title": "" }, { "docid": "5c6b1c53aef13a46cb751666f58c22d6", "score": "0.631905", "text": "function toString(value){return''+value;}", "title": "" }, { "docid": "5c6b1c53aef13a46cb751666f58c22d6", "score": "0.631905", "text": "function toString(value){return''+value;}", "title": "" }, { "docid": "d3cab016acd31b45fa649fa4f0fe07aa", "score": "0.62706625", "text": "function e(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "d3cab016acd31b45fa649fa4f0fe07aa", "score": "0.62706625", "text": "function e(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "94656fc4f0959b5b8d69e869405a7463", "score": "0.62356013", "text": "function _p2s(c) \n{ return String(c);\n}", "title": "" }, { "docid": "438aeeb497f68136147d249ff08ebf3a", "score": "0.6219294", "text": "ToString() {}", "title": "" }, { "docid": "438aeeb497f68136147d249ff08ebf3a", "score": "0.6219294", "text": "ToString() {}", "title": "" }, { "docid": "438aeeb497f68136147d249ff08ebf3a", "score": "0.6219294", "text": "ToString() {}", "title": "" }, { "docid": "438aeeb497f68136147d249ff08ebf3a", "score": "0.6219294", "text": "ToString() {}", "title": "" }, { "docid": "438aeeb497f68136147d249ff08ebf3a", "score": "0.6219294", "text": "ToString() {}", "title": "" }, { "docid": "438aeeb497f68136147d249ff08ebf3a", "score": "0.6219294", "text": "ToString() {}", "title": "" }, { "docid": "438aeeb497f68136147d249ff08ebf3a", "score": "0.6219294", "text": "ToString() {}", "title": "" }, { "docid": "438aeeb497f68136147d249ff08ebf3a", "score": "0.6219294", "text": "ToString() {}", "title": "" }, { "docid": "cdc5f61affef3b4423ec0672d3641d29", "score": "0.61659247", "text": "function toString(value){return ''+value;}", "title": "" }, { "docid": "201ece0d91aaa3fc3f655656fa5fac68", "score": "0.6150768", "text": "function convertNoToString(num){\n let n = num.toString();\n console.log(n);\n console.log (typeof (n));\n}", "title": "" }, { "docid": "1f52b15379cb7ee8943b732426ce6aa4", "score": "0.6145688", "text": "function toString(val) {\n return val == null ? '' : typeof val === 'object' ? JSON.stringify(val, null, 2) : String(val)\n }", "title": "" }, { "docid": "b4256adc9f1caba0637f6d99771be692", "score": "0.61423343", "text": "function _str(o) \n{ if (o===null) return \"null\";\n return o.toString_0(); \n}", "title": "" }, { "docid": "a1e2f4032d5298e226e3cd7541198b95", "score": "0.61378235", "text": "function f(a) {\n return a.toString;\n }", "title": "" }, { "docid": "180181cad7c54363070305135aae9180", "score": "0.6117546", "text": "toBinaryString(){\n return (this.val===null)\n ? ''\n : this.val.toString(2).slice(1);\n }", "title": "" }, { "docid": "32ad3c7af1303ef6140f80c3f751d107", "score": "0.6112978", "text": "function a(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "0ef14a924a13234dce3577ed8df54ad5", "score": "0.61104196", "text": "function i(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "0ef14a924a13234dce3577ed8df54ad5", "score": "0.61104196", "text": "function i(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "2646e9d13b5c73eb8a999db39eb5fac2", "score": "0.610701", "text": "function _toString (val) {\n\t return val == null\n\t ? ''\n\t : typeof val === 'object'\n\t ? JSON.stringify(val, null, 2)\n\t : String(val)\n\t}", "title": "" }, { "docid": "2646e9d13b5c73eb8a999db39eb5fac2", "score": "0.610701", "text": "function _toString (val) {\n\t return val == null\n\t ? ''\n\t : typeof val === 'object'\n\t ? JSON.stringify(val, null, 2)\n\t : String(val)\n\t}", "title": "" }, { "docid": "2646e9d13b5c73eb8a999db39eb5fac2", "score": "0.610701", "text": "function _toString (val) {\n\t return val == null\n\t ? ''\n\t : typeof val === 'object'\n\t ? JSON.stringify(val, null, 2)\n\t : String(val)\n\t}", "title": "" }, { "docid": "2646e9d13b5c73eb8a999db39eb5fac2", "score": "0.610701", "text": "function _toString (val) {\n\t return val == null\n\t ? ''\n\t : typeof val === 'object'\n\t ? JSON.stringify(val, null, 2)\n\t : String(val)\n\t}", "title": "" }, { "docid": "2646e9d13b5c73eb8a999db39eb5fac2", "score": "0.610701", "text": "function _toString (val) {\n\t return val == null\n\t ? ''\n\t : typeof val === 'object'\n\t ? JSON.stringify(val, null, 2)\n\t : String(val)\n\t}", "title": "" }, { "docid": "572b70577aefedafbf73a4e8b8ad88eb", "score": "0.60962206", "text": "function toStr(value) {\n return Object.prototype.toString.call(value);\n }", "title": "" }, { "docid": "dcd9dd4bb6ceb57058076deb1c337868", "score": "0.6092199", "text": "function _nullCoerce() {\n return '';\n}", "title": "" }, { "docid": "fe8137d4d75245adeb60d892fc529d12", "score": "0.6083623", "text": "function toString (val) {\n return val == null\n ? ''\n : typeof val === 'object'\n ? JSON.stringify(val, null, 2)\n : String(val)\n }", "title": "" }, { "docid": "fe8137d4d75245adeb60d892fc529d12", "score": "0.6083623", "text": "function toString (val) {\n return val == null\n ? ''\n : typeof val === 'object'\n ? JSON.stringify(val, null, 2)\n : String(val)\n }", "title": "" }, { "docid": "d7c68a6c8ae6fc3aba255a830b080101", "score": "0.6078505", "text": "function as_string(v) {\r\n return setType(v, 'string');\r\n}", "title": "" }, { "docid": "abbb9328a9fbb14ce8f6b3a1e6333012", "score": "0.6076839", "text": "function toStr(x) {\n if (typeof x === \"string\") {\n return x;\n }\n else if (typeof x.toString === \"function\") {\n return x.toString();\n }\n else {\n return JSON.stringify(x, undefined, \"\\t\");\n }\n}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "46d875a3ed76f0656a961fee873318c0", "score": "0.6070513", "text": "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.60668206", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "cd05af68bda5f28a5f2966dc39dc2bc5", "score": "0.6062174", "text": "function dataToString(data) {\n\t\t\t// data.toString() might throw or return null if data is the return\n\t\t\t// value of Console.log in some versions of Firefox (behavior depends on\n\t\t\t// version)\n\t\t\ttry {\n\t\t\t\tif (typeof data !== \"boolean\" &&\n\t\t\t\t\t\tdata != null &&\n\t\t\t\t\t\tdata.toString() != null) return data\n\t\t\t} catch (e) {\n\t\t\t\t// silently ignore errors\n\t\t\t}\n\t\t\treturn \"\"\n\t\t}", "title": "" }, { "docid": "87910e7f48dfd5c8e505727d96d5b0cb", "score": "0.6036405", "text": "function n(t) {\n return null == t ? \"\" : \"object\" == typeof t ? JSON.stringify(t, null, 2) : String(t);\n }", "title": "" } ]
a574b22b62d7dcfc943cc11e08340b8a
Set area to each child, and calculate data extent for visual coding.
[ { "docid": "aea9f72c0f27edad54ef63110d7d8632", "score": "0.512247", "text": "function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n\t var viewChildren = node.children || [];\n\t var orderBy = options.sort;\n\t orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n\n\t var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\n\n\t // leafDepth has higher priority.\n\t if (hideChildren && !overLeafDepth) {\n\t return (node.viewChildren = []);\n\t }\n\n\t // Sort children, order by desc.\n\t viewChildren = zrUtil.filter(viewChildren, function (child) {\n\t return !child.isRemoved();\n\t });\n\n\t sort(viewChildren, orderBy);\n\n\t var info = statistic(nodeModel, viewChildren, orderBy);\n\n\t if (info.sum === 0) {\n\t return (node.viewChildren = []);\n\t }\n\n\t info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n\t if (info.sum === 0) {\n\t return (node.viewChildren = []);\n\t }\n\n\t // Set area to each child.\n\t for (var i = 0, len = viewChildren.length; i < len; i++) {\n\t var area = viewChildren[i].getValue() / info.sum * totalArea;\n\t // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\t viewChildren[i].setLayout({area: area});\n\t }\n\n\t if (overLeafDepth) {\n\t viewChildren.length && node.setLayout({isLeafRoot: true}, true);\n\t viewChildren.length = 0;\n\t }\n\n\t node.viewChildren = viewChildren;\n\t node.setLayout({dataExtent: info.dataExtent}, true);\n\n\t return viewChildren;\n\t }", "title": "" } ]
[ { "docid": "607b4da300632c702a8ae1be02f3cb8e", "score": "0.6498927", "text": "async _measureChildren() {\n if (this._ordered.length > 0) {\n const {indices, children} = this._toMeasure;\n await Promise.resolve();\n const pm = await Promise.all(children.map(c => this._measureChild(c)));\n const mm = /** @type {{ number: { width: number, height: number } }} */\n (pm.reduce((out, cur, i) => {\n out[indices[i]] = cur;\n return out;\n }, {}));\n this._measureCallback(mm);\n }\n }", "title": "" }, { "docid": "ee16801764197da5a793f9eb894301e7", "score": "0.59865224", "text": "calculateBounds() {\n this._bounds.clear();\n this._calculateBounds();\n let child;\n let next;\n for (child = this._firstChild; child; child = next) {\n next = child.nextChild;\n if (!child.visible || !child.renderable) {\n continue;\n }\n child.calculateBounds();\n // TODO: filter+mask, need to mask both somehow\n if (child._mask) {\n const maskObject = (child._mask.maskObject || child._mask);\n maskObject.calculateBounds();\n this._bounds.addBoundsMask(child._bounds, maskObject._bounds);\n }\n else if (child.filterArea) {\n this._bounds.addBoundsArea(child._bounds, child.filterArea);\n }\n else {\n this._bounds.addBounds(child._bounds);\n }\n }\n this._bounds.updateID = this._boundsID;\n }", "title": "" }, { "docid": "157fc2e75159793cd0edd6aa46f85331", "score": "0.5860055", "text": "function resize() {\n for (var i = 0; i < renderedTrees.length; i++) {\n var data = renderedTrees[i].data;\n $(\"#\" + data.canvasId + \" svg\").width($(\"#\" + data.canvasId).width());\n $(\"#\" + data.canvasId + \" svg\").height($(\"#\" + data.canvasId).height());\n }\n\n }", "title": "" }, { "docid": "712e260ee30a705608c6bb7acf97774b", "score": "0.57963043", "text": "function _calcGeometry() {\n\n i_CalcFocusArea();\n i_CalcFishEyeArea();\n i_CalcHiddenArea();\n i_CalcMinArea(); // It should be the last one to be calculated as it is the area left over\n // Recalculates the sector angle of the hidden area\n // adding what's missing to 360 degrees\n\n _hiddenArea.angleSector = 360 - _fishEyeArea.angleSector*2 - _focusArea.angleSector - _minArea.angleSector*2;\n\n // The calculation of the number of bars must be performed after the calculation of the area elements\n _numMaxBars = _focusArea.numBars + 2*_fishEyeArea.numBars + 2*_minArea.numBars;\n _numTotalBars = model.data.children.data.length; // number of coauthors of the selected author\n\n // The calculation of the index in the dataVis vector where the center of the focus is to be calculated after the elements of the areas\n _focusArea.indexCenter = _minArea.numBars + _fishEyeArea.numBars + Math.floor(_focusArea.numBars/2);\n\n // Initializes the dataVis vector with capacity for the maximum number of bars\n // Do not associate the dataVis with the data vector (indicated by the value -1 in the indices)\n i_InicDataVisVector();\n i_BindDataVisToData();\n\n\n //--------\n function i_CalcFocusArea() {\n _focusArea.angleBar = _widthToAngle( _focusArea.widthBar + _focusArea.marginBar , _innerRadius );\n _focusArea.angleSector = _focusArea.angleBar * _focusArea.numBars;\n }\n\n //--------\n function i_CalcFishEyeArea() {\n let index = 0;\n _fishEyeArea.angleSector = 0.0;\n _fishEyeArea.geometry = [ {width:0.0, angle:0.0}];\n for (let widthBar= _minArea.widthBar+1; widthBar< _focusArea.widthBar; widthBar++) {\n _fishEyeArea.geometry[index] = { width : widthBar, angle : _widthToAngle( widthBar + _fishEyeArea.marginBar, _innerRadius) };\n _fishEyeArea.angleSector += _fishEyeArea.geometry[index].angle;\n index++;\n }\n _fishEyeArea.numBars = index;\n }\n\n //--------\n function i_CalcHiddenArea() {\n _hiddenArea.angleBar = _widthToAngle( _hiddenArea.widthBar+1, _innerRadius );\n _hiddenArea.angleSector = _hiddenArea.angleBar * _hiddenArea.numBars;\n }\n\n //--------\n function i_CalcMinArea() {\n _minArea.angleBar = _widthToAngle( _minArea.widthBar + _minArea.marginBar , _innerRadius );\n _minArea.numBars = Math.floor( (360.0 - _fishEyeArea.angleSector*2 - _focusArea.angleSector - _hiddenArea.angleSector)/(2*_minArea.angleBar));\n _minArea.angleSector = _minArea.numBars * _minArea.angleBar;\n }\n\n //--------\n function i_InicDataVisVector() {\n let angleRotBar;\n\n _dataVis = d3.range( _numMaxBars ).map( function() { return {angleRot:0.0, width:0, widthText:0, indexData:0 };});\n\n // Determines as the initial rotation angle of the bar with index 0 the angle of the upper line of the sector of the not visible area\n angleRotBar = 180 + _hiddenArea.angleSector/2;\n\n // ---------- Minimum Area 1\n angleRotBar = i_CalcGeometryFixedArea(angleRotBar, 0, _minArea.numBars-1, _minArea.widthBar,_minArea.angleBar);\n\n // ---------- Fish Eye Area 1\n angleRotBar = i_CalcGeometryFishEyeArea(angleRotBar, _minArea.numBars, _minArea.numBars + _fishEyeArea.numBars-1,true);\n\n // ---------- Focus Area\n angleRotBar = i_CalcGeometryFixedArea(angleRotBar, _minArea.numBars + _fishEyeArea.numBars,\n _minArea.numBars + _fishEyeArea.numBars + _focusArea.numBars-1,\n _focusArea.widthBar, _focusArea.angleBar); // Focus Area\n // ---------- Fish Eye Area 2\n angleRotBar = i_CalcGeometryFishEyeArea(angleRotBar, _minArea.numBars + _fishEyeArea.numBars + _focusArea.numBars,\n _minArea.numBars + 2*_fishEyeArea.numBars + _focusArea.numBars-1,\n false);\n\n // ---------- Minimum Area 2\n angleRotBar = i_CalcGeometryFixedArea(angleRotBar, _minArea.numBars + 2*_fishEyeArea.numBars + _focusArea.numBars,\n 2*_minArea.numBars + 2*_fishEyeArea.numBars + _focusArea.numBars-1,\n _minArea.widthBar, _minArea.angleBar);\n\n //--------\n function i_CalcGeometryFixedArea (angleRotBar, startIndex, finalIndex, width, angleBar) {\n let radiusText = _innerRadius + _maxHeightBar;\n for (let i=startIndex; i<=finalIndex; i++) { // adjusts the angle of rotation to the center of the bar\n _dataVis[i].angleRot = (angleRotBar + angleBar/2)%360;\n _dataVis[i].indexData = -1;\n _dataVis[i].width = width;\n _dataVis[i].widthText = _angleToWidth(angleBar, radiusText);\n angleRotBar = (angleRotBar+angleBar)%360;\n }\n return angleRotBar;\n }\n\n //--------\n function i_CalcGeometryFishEyeArea(angleRotBar, startIndex, finalIndex, ascending) {\n let indexGeometry,\n lastIndex = _fishEyeArea.geometry.length-1,\n radiusText = _innerRadius + _maxHeightBar;\n\n for (let i=startIndex; i<=finalIndex; i++) {\n indexGeometry = (ascending) ? i-startIndex : lastIndex-(i-startIndex);\n _dataVis[i].angleRot = (angleRotBar + _fishEyeArea.geometry[indexGeometry].angle/2) % 360;\n _dataVis[i].indexData = -1;\n _dataVis[i].width = _fishEyeArea.geometry[indexGeometry].width;\n _dataVis[i].widthText = _angleToWidth(_fishEyeArea.geometry[indexGeometry].angle, radiusText);\n angleRotBar = (angleRotBar + _fishEyeArea.geometry[indexGeometry].angle) % 360;\n }\n\n return angleRotBar;\n }\n }\n //--------\n function i_BindDataVisToData() {\n let i,startIndex,endIndex,index, sizeDataChildren;\n\n sizeDataChildren = model.data.children.data.length;\n\n if (sizeDataChildren >= _dataVis.length)\n for (i=0; i< _dataVis.length; i++)\n _dataVis[i].indexData = i;\n else {\n startIndex = _focusArea.indexCenter - Math.floor(sizeDataChildren/2);\n _indexFirstData = startIndex;\n endIndex = startIndex + sizeDataChildren;\n index = 0;\n for (i=startIndex; i<endIndex; i++,index++)\n _dataVis[i].indexData = index;\n }\n } // End i_BindDataVisToData\n }", "title": "" }, { "docid": "98b69f7be0d27225b156f83d51744c92", "score": "0.573141", "text": "function extractLayout(children) {\n for (var i = 0; i < children.length; i++) {\n var node = children[i];\n if (node.depth <= that._drawDepth) extractLayout(node.children);\n else {\n node.id = node.data.key;\n node.data = d3plusCommon.merge(node.data.values);\n shapeData.push(node);\n }\n }\n }", "title": "" }, { "docid": "78defac0549344c868e07aea0de860d1", "score": "0.56708777", "text": "function setChildrenLayout(){\t\t\t\n\t\t\t// lays out children for horizontal or vertical modes\n\t\t\tif(options.mode == 'horizontal' || options.mode == 'vertical'){\n\t\t\t\t\t\t\t\t\n\t\t\t\t// get the children behind\n\t\t\t\tvar $prependedChildren = getArraySample($children, 0, options.moveSlideQty, 'backward');\n\t\t\t\t\n\t\t\t\t// add each prepended child to the back of the original element\n\t\t\t\t$.each($prependedChildren, function(index) {\n\t\t\t\t\t$parent.prepend($(this));\n\t\t\t\t});\t\t\t\n\t\t\t\t\n\t\t\t\t// total number of slides to be hidden after the window\n\t\t\t\tvar totalNumberAfterWindow = ($children.length + options.moveSlideQty) - 1;\n\t\t\t\t// number of original slides hidden after the window\n\t\t\t\tvar pagerExcess = $children.length - options.displaySlideQty;\n\t\t\t\t// number of slides to append to the original hidden slides\n\t\t\t\tvar numberToAppend = totalNumberAfterWindow - pagerExcess;\n\t\t\t\t// get the sample of extra slides to append\n\t\t\t\tvar $appendedChildren = getArraySample($children, 0, numberToAppend, 'forward');\n\t\t\t\t\n\t\t\t\tif(options.infiniteLoop){\n\t\t\t\t\t// add each appended child to the front of the original element\n\t\t\t\t\t$.each($appendedChildren, function(index) {\n\t\t\t\t\t\t$parent.append($(this));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d96748d4fd69ff40765808bb0161e522", "score": "0.56428057", "text": "redisplay() {\n // workaround to update width and height values\n this.vfunc_get_preferred_height();\n\n for (let i = 0; i < this._items.length; i++) {\n let bbox = this._items[i];\n bbox.setSize(this._childWidth, this._childHeight);\n\n let leftPadding = bbox.get_theme_node().get_padding(St.Side.LEFT);\n let rightPadding = bbox.get_theme_node().get_padding(St.Side.RIGHT);\n let topPadding = bbox.get_theme_node().get_padding(St.Side.TOP);\n let bottomPadding = bbox.get_theme_node().get_padding(St.Side.BOTTOM);\n\n for (let i = 0; i < bbox.get_child().get_children().length; i++) {\n let item = bbox.get_child().get_children()[i];\n if (item instanceof GWorkspaceThumbnail.WorkspaceThumbnail) {\n // 2 is magic number. Can not find the reason for it.\n item.setScale((bbox.get_width() - leftPadding - rightPadding - 2) / item.get_width(), (bbox.get_height() - topPadding - bottomPadding - 2) / item.get_height());\n }\n if (item instanceof SwitcherButton) {\n item.setSize(this._childWidth - leftPadding - rightPadding, this._childHeight - topPadding - bottomPadding);\n let label = item.get_child();\n label.style = 'font-size: ' + Math.min(this._childHeight, this._childWidth) / 8 + 'px;';\n }\n }\n }\n\n let workspaceManager = global.workspace_manager;\n this.highlight(workspaceManager.get_active_workspace_index());\n }", "title": "" }, { "docid": "7102be8b353672481dd41e8df0596b53", "score": "0.5573422", "text": "function initChildren(node,nodeModel,totalArea,options,hideChildren,depth){var viewChildren=node.children||[];var orderBy=options.sort;orderBy!=='asc'&&orderBy!=='desc'&&(orderBy=null);var overLeafDepth=options.leafDepth!=null&&options.leafDepth<=depth;// leafDepth has higher priority.\nif(hideChildren&&!overLeafDepth){return node.viewChildren=[];}// Sort children, order by desc.\nviewChildren=filter(viewChildren,function(child){return!child.isRemoved();});sort$1(viewChildren,orderBy);var info=statistic(nodeModel,viewChildren,orderBy);if(info.sum===0){return node.viewChildren=[];}info.sum=filterByThreshold(nodeModel,totalArea,info.sum,orderBy,viewChildren);if(info.sum===0){return node.viewChildren=[];}// Set area to each child.\nfor(var i=0,len=viewChildren.length;i<len;i++){var area=viewChildren[i].getValue()/info.sum*totalArea;// Do not use setLayout({...}, true), because it is needed to clear last layout.\nviewChildren[i].setLayout({area:area});}if(overLeafDepth){viewChildren.length&&node.setLayout({isLeafRoot:true},true);viewChildren.length=0;}node.viewChildren=viewChildren;node.setLayout({dataExtent:info.dataExtent},true);return viewChildren;}", "title": "" }, { "docid": "8f83990a6f23c735cc9e82d1404c7f76", "score": "0.55521554", "text": "assignCoordinates(tree, treeData) {\n const { x, y } = this.bb.removeBoundingBox(tree.x, tree.y)\n treeData.x = x\n treeData.y = y\n for (let i = 0; i < tree.c.length; i++) {\n this.assignCoordinates(tree.c[i], treeData.children[i])\n }\n }", "title": "" }, { "docid": "905911eb18e73a255b76243d4765d15e", "score": "0.5545471", "text": "function initChildren(node,nodeModel,totalArea,options,hideChildren,depth){var viewChildren=node.children||[];var orderBy=options.sort;orderBy!=='asc'&&orderBy!=='desc'&&(orderBy=null);var overLeafDepth=options.leafDepth!=null&&options.leafDepth<=depth;// leafDepth has higher priority.\nif(hideChildren&&!overLeafDepth){return node.viewChildren=[];}// Sort children, order by desc.\nviewChildren=zrUtil.filter(viewChildren,function(child){return!child.isRemoved();});sort(viewChildren,orderBy);var info=statistic(nodeModel,viewChildren,orderBy);if(info.sum===0){return node.viewChildren=[];}info.sum=filterByThreshold(nodeModel,totalArea,info.sum,orderBy,viewChildren);if(info.sum===0){return node.viewChildren=[];}// Set area to each child.\nfor(var i=0,len=viewChildren.length;i<len;i++){var area=viewChildren[i].getValue()/info.sum*totalArea;// Do not use setLayout({...}, true), because it is needed to clear last layout.\nviewChildren[i].setLayout({area:area});}if(overLeafDepth){viewChildren.length&&node.setLayout({isLeafRoot:true},true);viewChildren.length=0;}node.viewChildren=viewChildren;node.setLayout({dataExtent:info.dataExtent},true);return viewChildren;}", "title": "" }, { "docid": "e2eecb5309f1bf4a720a24477e58f4ce", "score": "0.54957503", "text": "function sizeChildrens() {\n scroll.childrenHeight = 0;\n //Recorremos todos sus elementos (children) y sumamos sus alturas.\n for (var i = 0; i < scroll.children.length; i++) {\n scroll.childrenHeight += scroll.children[i].size.height;\n };\n //Si supera la altura del scroll mostramos la flecha \"down\".\n arrowDown.setVisible(scroll.childrenHeight > scroll.size.height);\n\n scroll.removeEventListener('postlayout', sizeChildrens);\n }", "title": "" }, { "docid": "06db6211806bdf2a9fa0b12abe353d92", "score": "0.54658777", "text": "makeSubPoints(){\n\t\tlet curWidth = this.boxSize/2;\n\t\tlet toReturn = [];\n\t\ttoReturn.push(new nullclinePoint(this.pos.x,this.pos.y,\t\t false,curWidth));\n\t\ttoReturn.push(new nullclinePoint(this.pos.x+curWidth,this.pos.y+curWidth,false,curWidth));\n\t\ttoReturn.push(new nullclinePoint(this.pos.x,\t\t this.pos.y+curWidth,false,curWidth));\n\t\ttoReturn.push(new nullclinePoint(this.pos.x+curWidth,this.pos.y,\t\t false,curWidth));\n\t\t\n\t\t//this.children = toReturn;\n\t\t\n\t\treturn toReturn;\n\t}", "title": "" }, { "docid": "710efcb32b3dde7b09e9ea498b48d623", "score": "0.54525167", "text": "function drawArea(data, container, options){\n \n }", "title": "" }, { "docid": "ab8cc09217af3c69a880ae61942a0fa7", "score": "0.54407835", "text": "function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority.\n\n if (hideChildren && !overLeafDepth) {\n return node.viewChildren = [];\n } // Sort children, order by desc.\n\n\n viewChildren = filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n sort$1(viewChildren, orderBy);\n var info = statistic(nodeModel, viewChildren, orderBy);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n }\n\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n } // Set area to each child.\n\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\n viewChildren[i].setLayout({\n area: area\n });\n }\n\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({\n isLeafRoot: true\n }, true);\n viewChildren.length = 0;\n }\n\n node.viewChildren = viewChildren;\n node.setLayout({\n dataExtent: info.dataExtent\n }, true);\n return viewChildren;\n }", "title": "" }, { "docid": "ed38b1ee849eccdb6678d1d44b0d9e7d", "score": "0.54067945", "text": "function plotSubSets() {\n\n //ctx.svgBody.attr({\n // height: ctx.svgHeight//ctx.rowScale.rangeExtent()[1] + ctx.logicPanelNode.\n //})\n\n// // to limit the foraignobject again\n// updateFrames($(window).height(), null);\n\n //console.log(\"plot sets\");\n updateColumnBackgrounds();\n\n var separatorRow = null;\n // generate <g> elements for all rows\n var allRows = updateSubSetGroups().filter(function(r){\n if (r.data.type==ROW_TYPE.SEPARATOR){\n //console.log(r.id);\n separatorRow = d3.select(this);\n return false;\n }\n else\n {\n //console.log(r.id);\n return true;\n }\n })\n\n var setScale = d3.scale.ordinal().domain([0, 1]).range(ctx.grays);\n\n var subSetRows = allRows.filter(function (d) {\n return d.data.type === ROW_TYPE.SUBSET;\n })\n\n // decorate subset rows\n updateSubsetRows(subSetRows, setScale);\n\n var groupRows = allRows.filter(function (d, i) {\n if (d.data.type === ROW_TYPE.GROUP || d.data.type === ROW_TYPE.AGGREGATE)\n return true;\n return false;\n })\n\n // decorate GroupRows\n updateGroupRows(groupRows);\n\n // add BarLabels to all bars\n updateBarLabels(allRows);\n //console.log(\"call overlay from \");\n//\n // Rendering the highlights and ticks for selections on top of the selected subsets\n updateOverlays(allRows);\n\n // ----------------------- expected value bars -------------------\n\n //updateRelevanceBars(allRows);\n\n // ----------------------- all Rows -------------------\n //updateAttributeStatistic(allRows);\n\n\n// var separatorColumns = renderRows.filter(function(d){return (d.data instanceof Separator)});\n// separatorColumns.append(\"\")\n\n if (separatorRow!=null){\n var sepRowLine = separatorRow.selectAll(\".gSeparatorLine\").data([1])\n sepRowLine.enter().append(\"line\").attr({\n class:\"gSeparatorLine\"\n })\n\n sepRowLine.attr({\n x1:-ctx.leftOffset,\n x2:ctx.w,\n y1:ctx.cellSize/2,\n y2:ctx.cellSize/2\n })\n\n }\n\n //highlight newly added col\n d3.selectAll(\".setSizeBackground\").each(function(d,i){\n if(d.elementName == ctx.newlyAddedSet){\n //mouseoutColumn();\n mouseoverColumn(d,i);\n //setTimeout(mouseoutColumn, 3000);\n ctx.newlyAddedSet = \"\";\n }\n })\n\n // Adjust the row height\n d3.select(\".divForeign\").select(\"svg\").attr(\"height\", renderRows.length * ctx.cellDistance);\n }", "title": "" }, { "docid": "c35fa49667010e3826037eb3b5a3d8e8", "score": "0.5394465", "text": "updateChildHeights() {\n let childHeights = [];\n if(this.props.nodes.byId[this.props.nodeId].toggled) {\n childHeights.push(16)\n for(let i=0; i<this.props.nodes.byId[this.props.nodeId].childNodes.length-1; i++){\n let child = this.props.nodes.byId[this.props.nodeId].childNodes[i];\n let nestedChildren = countNestedChildren(this.props.nodes, child);\n childHeights.push(28*(nestedChildren+1) + childHeights[i])\n }\n }\n this.props.updateTrace(this.props.nodeId, {childHeights: childHeights})\n this.updateTrace();\n }", "title": "" }, { "docid": "8dee255f4b7c39732442b675fe3f8275", "score": "0.5386546", "text": "function childrenAcessor(d){return d.values}", "title": "" }, { "docid": "8dee255f4b7c39732442b675fe3f8275", "score": "0.5386546", "text": "function childrenAcessor(d){return d.values}", "title": "" }, { "docid": "a9e39fee6c298498ec7e08373f6de05f", "score": "0.5379095", "text": "resize() {\n let leafs = this.leafs;\n for (let i=0; leafs[i]; i++) { \n leafs[i].resize();\n }\n }", "title": "" }, { "docid": "a8b810da9dd789ae8eda4d1ba241b09d", "score": "0.537009", "text": "subdivide () {\n this.isParent = true\n\n const tlX = this.bounds.tl.x\n const tlY = this.bounds.tl.y\n const halfW = this.bounds.w / 2\n const halfH = this.bounds.h / 2\n\n const tlChildTl = this.bounds.tl\n const trChildTl = new Point(tlX + halfW, tlY)\n const blChildTl = new Point(tlX, tlY - halfH)\n const brChildTl = new Point(tlX + halfW, tlY - halfH)\n\n const tlChildBounds = new Rectangle(tlChildTl, halfW, halfH)\n const trChildBounds = new Rectangle(trChildTl, halfW, halfH)\n const blChildBounds = new Rectangle(blChildTl, halfW, halfH)\n const brChildBounds = new Rectangle(brChildTl, halfW, halfH)\n\n this.children.tl = new QuadTree(tlChildBounds)\n this.children.tr = new QuadTree(trChildBounds)\n this.children.bl = new QuadTree(blChildBounds)\n this.children.br = new QuadTree(brChildBounds)\n }", "title": "" }, { "docid": "c3b90974b21e7d36bcba1609f54c9218", "score": "0.5346539", "text": "_draw(callback) {\n\n super._draw(callback);\n\n const height = this._orient === \"vertical\"\n ? this._height - this._margin.top - this._margin.bottom\n : this._width - this._margin.left - this._margin.right,\n left = this._orient === \"vertical\" ? \"left\" : \"top\",\n that = this,\n transform = `translate(${this._margin.left}, ${this._margin.top})`,\n width = this._orient === \"horizontal\"\n ? this._height - this._margin.top - this._margin.bottom\n : this._width - this._margin.left - this._margin.right;\n\n const treeData = this._treeData = this._tree\n .separation(this._separation)\n .size([width, height])(\n hierarchy({\n key: \"root\",\n values: nest(this._filteredData, this._groupBy.slice(0, this._drawDepth + 1))\n }, d => d.key && d.values ? d.values : null).sort(this._sort)\n )\n .descendants()\n .filter(d => d.depth <= this._groupBy.length && d.parent);\n\n /**\n Merges the values of a given nest branch.\n @private\n */\n function flattenBranchData(branch) {\n return merge(branch.values.map(l => l.key && l.values ? flattenBranchData(l) : l), that._aggs);\n }\n\n treeData.forEach((d, i) => {\n if (d.data.key && d.data.values) d.data = flattenBranchData(d.data);\n d.__d3plus__ = true;\n d.i = i;\n });\n\n let r = this._shapeConfig.r;\n if (typeof r !== \"function\") r = constant(r);\n const rBufferRoot = max(treeData, d => d.depth === 1 ? r(d.data, d.i) : 0);\n const rBufferEnd = max(treeData, d => d.children ? 0 : r(d.data, d.i));\n\n const yExtent = extent(treeData, d => d.y);\n this._labelHeight = min([\n this._orient === \"vertical\" ? 50 : 100,\n (yExtent[1] - rBufferRoot - rBufferEnd) / (this._groupBy.length + 1)\n ]);\n\n this._labelWidths = nest(treeData, d => d.depth)\n .map(d => d.values.reduce((num, v, i) => {\n const next = i < d.values.length - 1 ? d.values[i + 1].x : width + this._margin[left],\n prev = i ? d.values[i - 1].x : this._margin[left];\n return min([num, next - v.x, v.x - prev]);\n }, width));\n\n const yScale = scaleLinear()\n .domain(yExtent)\n .range([rBufferRoot + this._labelHeight, height - rBufferEnd - this._labelHeight]);\n\n treeData.forEach(d => {\n const val = yScale(d.y);\n if (this._orient === \"horizontal\") {\n d.y = d.x;\n d.x = val;\n }\n else d.y = val;\n });\n\n const elemObject = {parent: this._select, enter: {transform}, update: {transform}};\n\n this._shapes.push(new Path()\n .data(treeData.filter(d => d.depth > 1))\n .select(elem(\"g.d3plus-Tree-Links\", elemObject).node())\n .config(configPrep.bind(this)(this._shapeConfig, \"shape\", \"Path\"))\n .config({\n d: d => {\n\n let r = this._shapeConfig.r;\n\n if (typeof r === \"function\") r = r(d.data, d.i);\n\n const px = d.parent.x - d.x + (this._orient === \"vertical\" ? 0 : r),\n py = d.parent.y - d.y + (this._orient === \"vertical\" ? r : 0),\n x = this._orient === \"vertical\" ? 0 : -r,\n y = this._orient === \"vertical\" ? -r : 0;\n\n return this._orient === \"vertical\"\n ? `M${x},${y}C${x},${(y + py) / 2} ${px},${(y + py) / 2} ${px},${py}`\n : `M${x},${y}C${(x + px) / 2},${y} ${(x + px) / 2},${py} ${px},${py}`;\n\n },\n id: (d, i) => this._ids(d, i).join(\"-\")\n })\n .render());\n\n this._shapes.push(new Circle()\n .data(treeData)\n .select(elem(\"g.d3plus-Tree-Shapes\", elemObject).node())\n .config(configPrep.bind(this)(this._shapeConfig, \"shape\", \"Circle\"))\n .config({\n id: (d, i) => this._ids(d, i).join(\"-\"),\n label: (d, i) => {\n if (this._label) return this._label(d.data, i);\n const ids = this._ids(d, i).slice(0, d.depth);\n return ids[ids.length - 1];\n },\n labelConfig: {\n textAnchor: d => this._orient === \"vertical\" ? \"middle\"\n : d.data.children && d.data.depth !== this._groupBy.length ? \"end\" : \"start\",\n verticalAlign: d => this._orient === \"vertical\" ? d.data.depth === 1 ? \"bottom\" : \"top\" : \"middle\"\n },\n hitArea: (d, i, s) => {\n\n const h = this._labelHeight,\n w = this._labelWidths[d.depth - 1];\n\n return {\n width: this._orient === \"vertical\" ? w : s.r * 2 + w,\n height: this._orient === \"horizontal\" ? h : s.r * 2 + h,\n x: this._orient === \"vertical\" ? -w / 2 : d.children && d.depth !== this._groupBy.length ? -(s.r + w) : -s.r,\n y: this._orient === \"horizontal\" ? -h / 2 : d.children && d.depth !== this._groupBy.length ? -(s.r + this._labelHeight) : -s.r\n };\n\n },\n labelBounds: (d, i, s) => {\n\n const h = this._labelHeight,\n height = this._orient === \"vertical\" ? \"height\" : \"width\",\n w = this._labelWidths[d.depth - 1],\n width = this._orient === \"vertical\" ? \"width\" : \"height\",\n x = this._orient === \"vertical\" ? \"x\" : \"y\",\n y = this._orient === \"vertical\" ? \"y\" : \"x\";\n\n return {\n [width]: w,\n [height]: h,\n [x]: -w / 2,\n [y]: d.children && d.depth !== this._groupBy.length ? -(s.r + h) : s.r\n };\n\n }\n })\n .render());\n\n return this;\n\n }", "title": "" }, { "docid": "14bca07d59085e6b816312b5cbdd6172", "score": "0.53161263", "text": "function resizeImageMapAreas()\n {\n // Get current width/height\n var width = m.width;\n var height = m.height;\n\n // Don't do anything if the size of the img didn't change\n if (width == lastWidth && height == lastHeight)\n return;\n\n lastWidth = width;\n lastHeight = height;\n\n // Loop through each area in this map\n areas.forEach(function(a)\n {\n // Get coords from map\n var coords = coordsAll.get(a);\n\n for (var i = 0; i < coords.val.length; i++)\n {\n // Multiply the percentage coord by the width or height to get the pixel coord\n var px = coords.val[i] * (i % 2 == 0 ? width : height);\n coords.str[i] = Math.round(px).toString();\n }\n\n // Join the string array and set coords attribute on area\n a.setAttribute(\"coords\", coords.str.join());\n });\n }", "title": "" }, { "docid": "2a99924beb1f90660045880272d70637", "score": "0.53062457", "text": "function clearParentPoints() {\n var nrows = app.getImage().getGeometry().getSize().getNumberOfRows();\n for( var i = 0; i < nrows; ++i ) {\n parentPoints[i] = [];\n }\n }", "title": "" }, { "docid": "24ac0c5e5da2b56e8c1c38a4931ea295", "score": "0.5302335", "text": "constructor(treeCSV,partition,basedata) {\r\n this._maxsize = 0;\r\n this.treewidth = 670;\r\n this.treelength =380;\r\n this.translatex = 50;\r\n this.translatey = 100;\r\n let totalpers = [];\r\n partition.pers.map(function(item) {\r\n totalpers.push(parseFloat(item));\r\n });\r\n this.pers = totalpers;\r\n treeCSV.forEach(d=> {\r\n\r\n d.id = d.C1+ \", \"+d.C2+\", \"+d.Ci;\r\n d.index = d.C1+ \", \"+d.C2;\r\n d.par = d.P1+ \", \"+d.P2+\", \"+d.Pi;\r\n d._persistence = (this.pers[d.Ci]!=undefined)?this.pers[d.Ci]:0;\r\n });\r\n //Children relations\r\n this._root = d3.stratify()\r\n .id(d => d.id)\r\n .parentId(d => d.par === \", , 0\" ? '' : d.par)\r\n (treeCSV);\r\n //console.log(this._root);\r\n let accum;\r\n this._root.descendants().forEach(d=>{\r\n accum = [];\r\n accum = getbaselevelInd(d, accum);\r\n //d.data.children = d.children;\r\n //d.data.parent = d.parent;\r\n\r\n d.data._baselevel = new Set(accum);\r\n d.data._total = new Set();\r\n d.data._baselevel.forEach(dd=> {\r\n if (basedata[dd] != null) {\r\n basedata[dd].forEach(ddd=>{\r\n\r\n if (!d.data._total.has(ddd))\r\n d.data._total.add(ddd);\r\n })\r\n }\r\n });\r\n d.data._size = d.data._total.size;\r\n this._maxsize = (this._maxsize>d.data._size)?this._maxsize :d.data._size;\r\n\r\n });\r\n this._initsize = this._root.descendants().length;\r\n this._alldata = treeCSV;\r\n this._treefunc = d3.tree()\r\n .size([this.treewidth,this.treelength]);\r\n this._color = d3.scaleSqrt().domain([1,this._maxsize])\r\n //.interpolate(d3.interpolateHcl)\r\n .range([\"#bae4b3\", '#006d2c']);\r\n //console.log(this);\r\n let svg = d3.select(\"#tree\").attr(\"transform\", \"translate(\"+this.translatex+\",\"+this.translatey+\")\");\r\n this._linkgroup = svg.append('g');\r\n this._nodegroup = svg.append('g');\r\n\r\n console.log(this);\r\n }", "title": "" }, { "docid": "c3e46788373a0e4e02f54c4d51bbebee", "score": "0.5301668", "text": "draw(canvas) {\r\n if (this.m_areaNum === 0) return;\r\n for(let i = 0; i < this.m_areaNum - 1; i++){\r\n this.m_splitter[i].draw(canvas);\r\n }\r\n }", "title": "" }, { "docid": "57979bd1ae50fc26ed1d5dfd204902a0", "score": "0.5270377", "text": "setStaticHeightsForExternalObjects() {\n\n //Register the children container to be able to calculate chunk\n this.currentChunkObj._containerEl = this.itemsContainerEl;\n\n this.bodyHg = this.bodyEl.offsetHeight;\n this.viewportHg = this.viewportEl.offsetHeight;\n this.baseChunkHg = this.currentChunkObj.fullHeight;\n\n this.chunckItemHg = Math.floor( this.baseChunkHg / this.end );\n this.allChunksHg = this.chunckItemHg * this.totalItems;\n\n this.viewportEl.scrollTop = 0;\n }", "title": "" }, { "docid": "8f7aec7f665dfe09f6a128dd5d4c10f9", "score": "0.5260029", "text": "constructor() {\n super();\n /**\n * @hidden\n * @private\n */\n this.gridSize = new SizeF(0, 0);\n /**\n * Check the child grid is ' split or not'\n */\n this.isGridSplit = false;\n /**\n * @hidden\n * @private\n */\n this.isRearranged = false;\n /**\n * @hidden\n * @private\n */\n this.pageBounds = new RectangleF();\n /**\n * @hidden\n * @private\n */\n this.listOfNavigatePages = [];\n /**\n * @hidden\n * @private\n */\n this.parentCellIndex = 0;\n this.tempWidth = 0;\n /**\n * @hidden\n * @private\n */\n this.breakRow = true;\n this.splitChildRowIndex = -1;\n /**\n * The event raised on `begin cell lay outing`.\n * @event\n * @private\n */\n //public beginPageLayout : Function;\n /**\n * The event raised on `end cell lay outing`.\n * @event\n * @private\n */\n //public endPageLayout : Function;\n this.hasRowSpanSpan = false;\n this.hasColumnSpan = false;\n this.isSingleGrid = true;\n }", "title": "" }, { "docid": "7fd5a52b043302ab3462447879427203", "score": "0.52529395", "text": "function totalLayout(){\n updateScale();\n if(parentView){\n force.gravity(-0.01).charge(defaultCharge).friction(0.9).on(\"tick\", function(e) {\n circle.each(totalSort(e.alpha)).each(buoyancy(e.alpha)).attr(\"cx\", function(d) {\n return d.x;\n }).attr(\"cy\", function(d) {\n return d.y;\n });\n }).start();\n }\n }", "title": "" }, { "docid": "843686a082a4e55ff524d5ca8b1fcbfe", "score": "0.5247519", "text": "computeCoordinates(parent, child) {\n const s = TreeNode.sketch;\n if (!parent[child]) return;\n\n // upper level nodes should be far from each other\n // to avoid collisions in lower levels\n let dx = s.width / (Math.pow(2, parent[child].level + 1));\n if (child === 'left') {\n parent.left.x = parent.x - dx;\n parent.left.y = parent.y + 55;\n } else if (child === 'right') {\n parent.right.x = this.x + dx;\n parent.right.y = this.y + 55;\n }\n }", "title": "" }, { "docid": "c84a46e1a354d532c2522aab2a6dd636", "score": "0.5238011", "text": "function cellChildren(i,j) {\n var r = [];\n if ( i > 0 && j < imageWidth ) r.push( { i: i-1, j:j, p:1} );\n if ( i > 0 && j > 0) r.push( { i:i-1, j:j-1, p:3} );\n if ( i < imageHeight && j > 0 ) r.push( { i: i, j:j-1, p:5} );\n if ( i < imageHeight && j < imageWidth ) r.push( { i:i, j:j, p:7} );\n return r;\n}", "title": "" }, { "docid": "fce4a7fdb64bb8a42b8e0dd3e5c33607", "score": "0.5224692", "text": "function layoutRealizedRange(){if(that._groups.length===0){return;}var realizedItemRange=that._getRealizationRange(),len=tree.length,i,firstChangedGroup=site.groupIndexFromItemIndex(changedRange.firstIndex);for(i=firstChangedGroup;i<len;i++){layoutGroupContent(i,realizedItemRange,true);that._layoutGroup(i);}}// Asynchronously lays out the unrealized items", "title": "" }, { "docid": "d9e9bdb1ca27fbcf8cc71a6bb4ea6761", "score": "0.5216121", "text": "init () {\n const c = this\n c.lastValue = c.d[c.d.length - 1].Dublin // TODO: hard-coded\n\n d3.select(c.e).select('svg').remove()\n c.eN = d3.select(c.e).node()\n c.eW = c.eN.getBoundingClientRect().width\n\n // margin\n c.m = [20, 10, 25, 10]\n c.w = c.eW - c.m[1] - c.m[3]\n c.h = 120 - c.m[0] - c.m[2]\n\n c.setScales()\n c.drawBars()\n // c.drawLabels()\n }", "title": "" }, { "docid": "4de39d85fe410ed5934507b7cdcfacd5", "score": "0.5181478", "text": "function setUi() {\n //get container width\n //get root width\n const maxWidth = el.getBoundingClientRect().width;\n\n //set position min & max limit\n const handle_width = handles[0].scrollWidth;\n props.pos_min = 0;\n props.pos_max = maxWidth - handle_width;\n\n //set handle positions based on value\n const positions = []; // to be used when setting to band size \n for (let i = 0; i < props.values.length; i++) {\n const position = valToPos(handles[i].getAttribute(\"data-value\"));\n positions.push(position);\n handles[i].style.left = `${position}px`;\n }\n\n //set band size and position\n band.style.left = Math.min(...positions) + \"px\";\n band.style.right = (props.pos_max - Math.max(...positions)) + \"px\";\n }", "title": "" }, { "docid": "ce2a89ccb67782caf2acba1f2e49358e", "score": "0.5164072", "text": "function Area(x, y, hw, hh, leaf)\n{\n this.x = x;\n this.y = y;\n this.hw = hw;\n this.hh = hh;\n this.leaf = leaf; // is this object (not area)\n // are childs leafs (true) or tree's nodes (false)\n // uses only if this.leaf is false\n this.leafs = true;\n this.childs = [];\n // childs indexes are 'id', so this.child.length don't work fine\n // uses only if this.leafs is true\n this.count = 0;\n}", "title": "" }, { "docid": "65e4b39a174c5b639b98226d89074783", "score": "0.51588625", "text": "createManagedObjectsLayout(jsonData)\n {\n this.jsonAbsClasses = [];\n // console.log(\"createManagedObjectsLayout\", jsonData, \"Count: \", jsonData.totalCount);\n\n if(jsonData.totalCount === 0)\n { // tidy up - error\n alert(\">>>>>************>>>>>>>no top level root children ????\")\n }\n\n\n /********************************************************************\n get JSON data passed, build new json having top level unique \n abs class names and the children the concrete classes DN names.\n *********************************************************************/\n\n //console.log(\"root length= \", jsonData.imdata.length);\n\n //for( var i=0; i<jsonData.totalCount; i++ )\n for( var i=0; i<jsonData.imdata.length; i++ )\n {\n for(firstKey in jsonData.imdata[i]); // the abstract class name\n\n // does this class already exist\n this.bClassExists = false;\n for( var j in this.jsonAbsClasses)\n {\n if(this.jsonAbsClasses[j].classname === firstKey)\n {\n // add the DN as class already exists\n this.jsonAbsClasses[j].dn.push(jsonData.imdata[i][firstKey].attributes.dn);\n this.bClassExists = true;\n break;\n } \n }\n\n // if we dont have this abs class already in JSON, add it along with DN\n if(!this.bClassExists)\n {\n // add the Abstract class and dn along with it\n this.jsonAbsClasses.push( {\"classname\": firstKey , \"dn\":[jsonData.imdata[i][firstKey].attributes.dn] } );\n } \n\n }\n\n // sort alpha (classname)\n this.jsonAbsClasses.sort(function (x,y) { return ((x.classname == y.classname) ? 0 : ((x.classname > y.classname) ? 1 : -1 )); });\n //console.log(\"Abstract Classes Length: \", this.jsonAbsClasses.length, this.jsonAbsClasses) ;\n\n\n /******************************************************************** \n * Build Layout \n ********************************************************************/\n\n // get existing main container\n var sParent = d3.select(\"#root-node-body\");\n\n // create main outer container\n var dContainer = \n sParent.append(\"div\") // is an all encompasing container div\n .attr(\"id\", \"#root-node-sel-container\")\n .style(\"display\", \"none\") // hide until ready\n .style(\"height\", \"250px\");\n\n\n // curr sel\n dContainer.append(\"div\")\n .attr(\"id\", \"root-curr-sel\")\n .style(\"width\", \"75%\")\n .style(\"height\", \"40px\")\n //.style(\"vertical-align\", \"middle\")\n .style(\"margin\", \"25px 50px 0px 50px\")\n .text(function(){ return \"Active Root: \" + root.dn; });\n\n\n // abstract class selection\n dContainer.append(\"div\")\n .attr(\"id\", \"root-abs-sel-cont\")\n .append(\"select\")\n .attr(\"id\", \"root-abs-sel\")\n .classed(\"rootselect\", true)\n .on('change', this.absClassSelChange.bind(this) )\n\n .selectAll(\"option\")\n .data(this.jsonAbsClasses).enter()\n .append(\"option\")\n .text( function(d){ \n //console.log(\"d\", d.classname);\n return d.classname; });\n // concrete class selection\n dContainer.append(\"div\")\n .attr(\"id\", \"root-con-sel\")\n .append(\"select\")\n .attr(\"id\", \"root-con-sel\")\n .classed(\"rootselect\", true);\n\n // show this\n dContainer.style(\"display\", \"block\");\n\n // hide loader\n d3.select(\"div#main-loader-container\").style(\"display\", \"none\"); \n\n return;\n }", "title": "" }, { "docid": "a10e55a29dca1cb46177087015da247d", "score": "0.51541466", "text": "function computeLayout(data) {\n data.forEach((d, i) => {\n d.x = 0;\n d.y = (cellHeight + rowGap) * i;\n });\n }", "title": "" }, { "docid": "5c9040f83cd1cd4628de4c0160a8a8b1", "score": "0.5145778", "text": "onChildsRendered() {\n /* For convenience. */\n }", "title": "" }, { "docid": "0ca8df992b092fe983fb85fb94177149", "score": "0.51361966", "text": "function staircase() {\n // ****** TODO: PART II ******\n bcChildren = document.getElementById(\"barchart1\").children;\n //console.log(document);\n for (var i = bcChildren.length - 1; i >= 0; i--) {\n bcChildren[i].setAttribute(\"height\", (i*10).toString());\n }\n //barchart1\n}", "title": "" }, { "docid": "d427e98f1f4370ba5ba0991c4b9663ad", "score": "0.51298434", "text": "function underScale(ct){\n\tvar x;\n\tfor(x = 0; x < ct.children.length; x++){\n\t\t//Corta pela metade o size dos objetos.\n\t\t(ct.getChildAt(x)).scaleX = (ct.getChildAt(x)).scaleY = 0.44;\n\t}\n}", "title": "" }, { "docid": "87c85c6e368b3a50c3f119be94ccca84", "score": "0.5129152", "text": "get innerExtent() {\r\n return this.i.a3;\r\n }", "title": "" }, { "docid": "6780cedeec665eab6fe23643f0d4af44", "score": "0.5120735", "text": "function setBounds() {\n let el = angular.element(canvas);\n\n //set initial style\n if ( scope.options.layout.height === \"inherit\" ) {\n let viewHeight = view.getHeight();\n el.css(\"height\", `${viewHeight}px`);\n el.attr(\"height\", `${viewHeight * view.scale}px`);\n } else {\n el.css(\"height\", `${scope.options.layout.height}px`);\n el.attr(\"height\", `${scope.options.layout.height * view.scale}px`);\n }\n //set initial style\n if ( scope.options.layout.width === \"inherit\" ) {\n let viewWidth = view.getWidth();\n el.css(\"width\", `${viewWidth}px`);\n el.attr(\"width\", `${viewWidth * view.scale}px`);\n } else {\n el.css(\"width\", `${scope.options.layout.width}px`);\n el.attr(\"width\", `${scope.options.layout.width * view.scale}px`);\n }\n\n }", "title": "" }, { "docid": "7d58517909a54b30ae614d32e7fc6ce3", "score": "0.5104771", "text": "onDomResize () {\n this.updateContainerViaDom();\n for (let { resize, morph: layoutableSubmorph } of this.cellGroups) {\n if (!layoutableSubmorph) continue;\n const node = this.getNodeFor(layoutableSubmorph);\n if (!node) continue;\n this.updateSubmorphViaDom(layoutableSubmorph, node, resize, true);\n }\n }", "title": "" }, { "docid": "fd4f4dc4238ee074381ae32cad249ccc", "score": "0.510457", "text": "function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority.\n\n if (hideChildren && !overLeafDepth) {\n return node.viewChildren = [];\n } // Sort children, order by desc.\n\n\n viewChildren = zrUtil.filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n sort(viewChildren, orderBy);\n var info = statistic(nodeModel, viewChildren, orderBy);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n }\n\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n } // Set area to each child.\n\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\n viewChildren[i].setLayout({\n area: area\n });\n }\n\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({\n isLeafRoot: true\n }, true);\n viewChildren.length = 0;\n }\n\n node.viewChildren = viewChildren;\n node.setLayout({\n dataExtent: info.dataExtent\n }, true);\n return viewChildren;\n}", "title": "" }, { "docid": "fd4f4dc4238ee074381ae32cad249ccc", "score": "0.510457", "text": "function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority.\n\n if (hideChildren && !overLeafDepth) {\n return node.viewChildren = [];\n } // Sort children, order by desc.\n\n\n viewChildren = zrUtil.filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n sort(viewChildren, orderBy);\n var info = statistic(nodeModel, viewChildren, orderBy);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n }\n\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n } // Set area to each child.\n\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\n viewChildren[i].setLayout({\n area: area\n });\n }\n\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({\n isLeafRoot: true\n }, true);\n viewChildren.length = 0;\n }\n\n node.viewChildren = viewChildren;\n node.setLayout({\n dataExtent: info.dataExtent\n }, true);\n return viewChildren;\n}", "title": "" }, { "docid": "21e9f440862a1800d247fa4fb04947ec", "score": "0.51039976", "text": "_treemapAlgorithm(data,width,height,x=0,y=0,color = \"rgb(0,0,250)\",importance = 1, orientation = \"v\") {\n\n //color the triconnecrted block\n (data.name == 's') ? color = \"rgb(250,250,0)\" : ((data.name == 'p') ? color = \"rgb(250,0,250)\" : ((data.name == 'r') ? color = \"rgb(0,250,250)\" : color = color));\n\n //set the current node\n this._drawRectangle(x, y, width, height, color, data.name, importance * 100);\n data.x = x;\n data.y = y;\n data.width = width;\n data.height = height;\n data.orientation = orientation;\n\n //if is a leaf return because a leaf haven't childrens\n if(data.children == undefined) return;\n\n //if your width or height are < borderWidth you can't remove the borderWidth\n if(width > (2 * this.borderWidth) && height > (2 * this.borderWidth)) {\n //I must iterate to all mi childrens (connected components)\n x = x + this.borderWidth;\n y = y + this.borderWidth;\n width = width - (2 * this.borderWidth);\n height = height - (2 * this.borderWidth);\n }\n data.children.forEach((children) => {\n //calculare the importance of this node in the draw, to assign the inheritance of the father\n const importance = children.size / data.size;\n\n if (data.orientation == 'v') {\n const myDimensionality = width * importance;\n this._treemapAlgorithm(children,myDimensionality, height, x, y, \"rgb(0,250,0)\",importance, \"h\");\n //the width must reduce the inheritance assign to this son\n x = x + myDimensionality;\n }\n else {\n const myDimensionality = height * importance;\n this._treemapAlgorithm(children, width, myDimensionality, x, y, \"rgb(250,0,0)\", importance, \"v\");\n //the width must reduce the inheritance assign to this son\n y = y + myDimensionality;\n }\n });\n }", "title": "" }, { "docid": "652d83c833e0b00bc6d058f307550735", "score": "0.51000875", "text": "scaleValues() {\n //scale by extrema\n\n // console.log(this.extrema.width / 2)\n for(let i = 0; i < this.values.length; i++){\n this.values[i].x = (this.values[i].x - this.extrema.center_x) / (this.extrema.width / 2)\n this.values[i].y = (this.values[i].y - this.extrema.center_y) / (this.extrema.height / 2)\n // if(this.values[i].x < this.extrema.center_x)\n // this.values[i].x = (this.extrema.center_x - this.values[i].x) / (this.extrema.width / 2) * -1\n // else\n // this.values[i].x = (this.extrema.x.max - this.values[i].x) / (this.extrema.width / 2)\n\n // if(this.values[i].y < this.extrema.center_y)\n // this.values[i].y = (this.extrema.center_y - this.values[i].y) / (this.extrema.height / 2) * -1\n // else\n // this.values[i].y = (this.extrema.y.max - this.values[i].y) / (this.extrema.height / 2)\n\n // this.values[i].x = this.round(this.values[i].x / 2)\n // this.values[i].y = this.round(this.values[i].y / 2)\n // console.log(JSON.stringify(this.values[i]))\n }\n // console.log(this.values)\n\n }", "title": "" }, { "docid": "3eb728dc9bff3421131a51a0213f38bb", "score": "0.50930035", "text": "function setWidths() {\n\n\t\t//finding max depth.\n\t\tsetMaxDepth();\n\n\t\t//calculate and set width for each node\n\t\ttree.forEach(function(node) {\n\t\t\tnode.width = maxWidth / (node.maxDepth+1);\n\t\t});\n\t}", "title": "" }, { "docid": "daf4c14e06b02d55925cb90d9ca50017", "score": "0.5091173", "text": "function explodeLayout(){\n if(parentView){\n force.gravity(-0.01).charge(defaultCharge).friction(0.9).on(\"tick\", function(e) {\n exp.each(explodeSort(e.alpha)).attr(\"cx\", function(d) {\n return d.x;\n }).attr(\"cy\", function(d) {\n return d.y;\n });\n }).start();\n }\n }", "title": "" }, { "docid": "d6a04e8cd4ed31b2ed23cc07f01f0535", "score": "0.5087489", "text": "resetGrid() {\n\n\t\tutils.forEach.call(this.children, child => child.style.height = '');\n\n\t}", "title": "" }, { "docid": "dad1f1355e762ce63f21dfe95acb7669", "score": "0.50837034", "text": "function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n\t var viewChildren = node.children || [];\n\t var orderBy = options.sort;\n\t orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n\n\t var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\n\n\t // leafDepth has higher priority.\n\t if (hideChildren && !overLeafDepth) {\n\t return node.viewChildren = [];\n\t }\n\n\t // Sort children, order by desc.\n\t viewChildren = zrUtil.filter(viewChildren, function (child) {\n\t return !child.isRemoved();\n\t });\n\n\t sort(viewChildren, orderBy);\n\n\t var info = statistic(nodeModel, viewChildren, orderBy);\n\n\t if (info.sum === 0) {\n\t return node.viewChildren = [];\n\t }\n\n\t info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n\t if (info.sum === 0) {\n\t return node.viewChildren = [];\n\t }\n\n\t // Set area to each child.\n\t for (var i = 0, len = viewChildren.length; i < len; i++) {\n\t var area = viewChildren[i].getValue() / info.sum * totalArea;\n\t // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\t viewChildren[i].setLayout({ area: area });\n\t }\n\n\t if (overLeafDepth) {\n\t viewChildren.length && node.setLayout({ isLeafRoot: true }, true);\n\t viewChildren.length = 0;\n\t }\n\n\t node.viewChildren = viewChildren;\n\t node.setLayout({ dataExtent: info.dataExtent }, true);\n\n\t return viewChildren;\n\t}", "title": "" }, { "docid": "8ee2d7d884d8f7464a1600fb753d261a", "score": "0.50804335", "text": "getRowColumns(children){\n if(!(children instanceof Array)){\n throw new TypeError(\"not an array\")\n };\n let rows = [];\n let columns = [];\n children.forEach((child) => {\n rows.push(child.data.top);\n rows.push(child.data.top + child.data.height)\n //add vertical edges to rows\n columns.push(child.data.left);\n columns.push(child.data.left + child.data.width);\n //add horizontal edges to columns\n \n });\n function compareNumeric(a, b) {\n if (a > b) return 1;\n if (a == b) return 0;\n if (a < b) return -1;\n };\n columns.sort(compareNumeric);\n rows.sort(compareNumeric);\n //create sets so every entry is unique\n let rowSet = new Set(rows);\n let columnSet = new Set(columns);\n return {rows: rowSet, columns: columnSet};\n }", "title": "" }, { "docid": "2405d6a2770425508bcd7792c2ebd5ed", "score": "0.50664234", "text": "function resize() {\n var targetWidth;\n if ( referenceId ) {\n var measure = document.querySelector(\"#\" + referenceId);\n var initialWidth = measure.getAttribute(\"data-width\");\n if ( initialWidth ) {\n targetWidth = relativeWidth * initialWidth;\n } else {\n targetWidth = relativeWidth * measure.offsetWidth;\n }\n } else {\n var grandparent = container.node().parentNode;\n targetWidth = relativeWidth * grandparent.offsetWidth;\n }\n svg.attr(\"width\", targetWidth);\n var targetHeight = targetWidth / aspect;\n svg.attr(\"height\", targetHeight);\n container.style(\"width\", Math.round(targetWidth) + \"px\");\n container.style(\"height\", Math.round(targetHeight) + \"px\");\n container.attr(\"width\", targetWidth);\n container.attr(\"height\", targetHeight);\n var firstRect = svg.select(\"rect\");\n firstRect.attr(\"width\", targetWidth);\n firstRect.attr(\"height\", targetHeight);\n }", "title": "" }, { "docid": "6b205a4171ec8b9cebd5574f1a6571c6", "score": "0.50657046", "text": "mount(parentEl) {\n VisualizerConfig.values.map((viz) => {\n parentEl.appendChild(this.generateCol(viz));\n });\n }", "title": "" }, { "docid": "a2b72c8f94c7ed8ec3adb524cf620f8c", "score": "0.50614417", "text": "function resize() {\n\t\tpositionExpandedLevels();\n\t}", "title": "" }, { "docid": "5e09ab97a819250cae4aef658f57dedb", "score": "0.5055167", "text": "function _slice(result, parent, rectangle, comparator, nodes, start, end, weight, depth) {\n var last = end-1;\n var treeModel = comparator.getTreeModel();\n if (rectangle.width < rectangle.height) {\n //split horizontally\n var sx = rectangle.x;\n var sy = rectangle.y;\n var maxy = rectangle.y+rectangle.height;\n var i;\n for (i = start; i < end && sy < maxy; i++) {\n var c = nodes[i];\n var wc = treeModel.getViews(c);\n var step = (i!=last)?Math.round(rectangle.height*wc/weight):(rectangle.height-(sy-rectangle.y));\n if (step > 0) {\n var child = new _Rectangle(c, sx, sy, rectangle.width, step,colorProvider.getColor(c));\n _addChild(result, parent, child);\n if (treeModel.hasChildren(c)) {\n _layout(result, child, comparator, depth+1);\n }\n sy += step;\n } else {\n // too small to actually display\n var rest = rectangle.height-(sy-rectangle.y);\n if (rest > 0) {\n var child = new _Rectangle(c, sx, sy, rectangle.width, 1,colorProvider.getColor(c));\n _addChild(result, parent, child);\n sy++;\n }\n }\n }\n } else {\n //split vertically\n var sx = rectangle.x;\n var sy = rectangle.y;\n var maxx = rectangle.x+rectangle.width;\n var i;\n for (i = start; i < end && sx < maxx; i++) {\n var c = nodes[i];\n var wc = treeModel.getViews(c);\n var step = (i!=last)?Math.round(rectangle.width*wc/weight):(rectangle.width-(sx-rectangle.x));\n if (step > 0) {\n var child = new _Rectangle(c, sx, sy, step, rectangle.height,colorProvider.getColor(c));\n _addChild(result, parent, child);\n if (treeModel.hasChildren(c)) {\n _layout(result, child, comparator, depth+1);\n }\n sx += step;\n } else {\n // too small to actually display\n var rest = rectangle.width-(sx-rectangle.x);\n if (rest > 0) {\n var child = new _Rectangle(c, sx, sy, 1, rectangle.height,colorProvider.getColor(c));\n _addChild(result, parent, child);\n sx++;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "ca1e2c33d369d78ff365d173893064f9", "score": "0.50498545", "text": "setChildren() {\n\n\t\tthis.children = [];\n\n\t\tif (!this.el.hasChildNodes()) {\n\n\t\t\treturn [];\n\n\t\t}\n\t\t\n\t\tlet childNodes = this.el.childNodes;\n\n\t\tutils.forEach.call(childNodes, child => {\n\n\t\t\tif (child.nodeType !== this.TEXT_NODE && child.nodeType !== this.COMMENT_NODE) {\n\n\t\t\t\tthis.children.push(child);\n\n\t\t\t}\n\n\t\t});\n\n\t}", "title": "" }, { "docid": "775a290b3c0be0cc7409883dc0b4a702", "score": "0.504639", "text": "function monthlySalesAreaResize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right;\n\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 // Axes\n // -------------------------\n\n // Horizontal range\n x.range([0, width]);\n\n // Horizontal axis\n svg.selectAll('.d3-axis-horizontal').call(xAxis);\n\n // Horizontal axis subticks\n svg.selectAll('.d3-axis-subticks').attr('x1', x).attr('x2', x);\n\n\n // Chart elements\n // -------------------------\n\n // Area path\n svg.selectAll('.d3-area').datum(data).attr('d', area);\n\n // Crosshair\n svg.selectAll('.d3-crosshair-overlay').attr('width', width);\n }", "title": "" }, { "docid": "c4a16d3aad565aa5c1b82d229d5c1dfc", "score": "0.50370914", "text": "get innerExtent() {\r\n return this.i.ct;\r\n }", "title": "" }, { "docid": "ef2da0558f1bfef2828652ab3b3e4911", "score": "0.50358075", "text": "setPosValues() {\n this.board.width = this.element.parentElement.offsetWidth;\n this.board.height = this.element.parentElement.offsetHeight;\n\n // svg comapred to screen size\n this.scale = this.element.viewBox.baseVal.width / this.element.parentElement.offsetWidth;\n\n // deadzone values: area between the eyes\n const leftBounds = this.interactives.eyes.left.eye.getBBox();\n const rightBounds = this.interactives.eyes.right.eye.getBBox();\n\n // deadzone center: relative point between the eyes\n this.deadZone.centerX = (rightBounds.x - leftBounds.x - leftBounds.width) / 2 + leftBounds.x + leftBounds.width;\n this.deadZone.centerY = (Math.min(leftBounds.y, rightBounds.y) + Math.max(leftBounds.y + leftBounds.height, rightBounds.y + rightBounds.height)) / 2;\n\n this.deadZone.x = this.deadZone.centerX - this.deadZone.width / 2;\n this.deadZone.y = this.deadZone.centerY - this.deadZone.height / 2;\n }", "title": "" }, { "docid": "4774d88ee611123541ae32b75a1954b4", "score": "0.5034277", "text": "function scaleImage(self) {\n var d = d3.select(self).datum(),\n isMinZoomFavorite = zoomLevelIndex === minZoomIndex && isImageVisible(d),\n childrenHeight = self.querySelector('.children').getBoundingClientRect().height,\n mainHeight = (isMinZoomFavorite ? zoomLevel.maxImageHeight : zoomLevel.maxHeight) - childrenHeight;\n d3.select(self).select('.parent').style('max-height', mainHeight + 'px');\n }", "title": "" }, { "docid": "f2d7e8008c9a572c7cd30911c4425c90", "score": "0.5032352", "text": "computeDimensions() {\n\n var width = this.svg.style(\"width\");\n var height = this.svg.style(\"height\");\n\n width = width.slice(0, width.length - 2);\n height = height.slice(0, height.length - 2);\n\n this.width = parseInt(width);\n this.height = parseInt(height);\n\n this.svg.attr(\"width\", this.width);\n this.svg.attr(\"height\", this.height);\n\n }", "title": "" }, { "docid": "90324357c85854143e0fe41933741911", "score": "0.5024312", "text": "function augmentData(baseData, grid) {\n baseData.forEach(function (d, i) {\n d.layout = {\n x: grid[i].x,\n y: grid[i].y,\n scale: grid[i].scale\n };\n });\n } // Layout function.", "title": "" }, { "docid": "9c4717b892c120f4089c1280dd2c3e4f", "score": "0.5024276", "text": "function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\n\n // leafDepth has higher priority.\n if (hideChildren && !overLeafDepth) {\n return (node.viewChildren = []);\n }\n\n // Sort children, order by desc.\n viewChildren = zrUtil.filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n\n sort(viewChildren, orderBy);\n\n var info = statistic(nodeModel, viewChildren, orderBy);\n\n if (info.sum === 0) {\n return (node.viewChildren = []);\n }\n\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n if (info.sum === 0) {\n return (node.viewChildren = []);\n }\n\n // Set area to each child.\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea;\n // Do not use setLayout({...}, true), because it is needed to clear last layout.\n viewChildren[i].setLayout({area: area});\n }\n\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({isLeafRoot: true}, true);\n viewChildren.length = 0;\n }\n\n node.viewChildren = viewChildren;\n node.setLayout({dataExtent: info.dataExtent}, true);\n\n return viewChildren;\n }", "title": "" }, { "docid": "9c4717b892c120f4089c1280dd2c3e4f", "score": "0.5024276", "text": "function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\n\n // leafDepth has higher priority.\n if (hideChildren && !overLeafDepth) {\n return (node.viewChildren = []);\n }\n\n // Sort children, order by desc.\n viewChildren = zrUtil.filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n\n sort(viewChildren, orderBy);\n\n var info = statistic(nodeModel, viewChildren, orderBy);\n\n if (info.sum === 0) {\n return (node.viewChildren = []);\n }\n\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n if (info.sum === 0) {\n return (node.viewChildren = []);\n }\n\n // Set area to each child.\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea;\n // Do not use setLayout({...}, true), because it is needed to clear last layout.\n viewChildren[i].setLayout({area: area});\n }\n\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({isLeafRoot: true}, true);\n viewChildren.length = 0;\n }\n\n node.viewChildren = viewChildren;\n node.setLayout({dataExtent: info.dataExtent}, true);\n\n return viewChildren;\n }", "title": "" }, { "docid": "8fb20d5cc39b06b0281fdfc34b422653", "score": "0.5019703", "text": "createTheSetOfNodesAndEdgesForTheRenderer(){\n let nodes = [], edges = [];\n this._calculateTheSetOfNodesAndEdjes(this.tree.root, nodes, edges);\n this.tree.nodes = nodes;\n this.tree.edges = edges;\n }", "title": "" }, { "docid": "42516bdd79ac590eb35de2bbb1d018b1", "score": "0.50162786", "text": "function decorateChildren(parent) {\n parent.children.forEach(function (c) {\n c.userData.partOfModal = e;\n decorateChildren(c);\n });\n }", "title": "" }, { "docid": "1961df23bd1ca3d1c857a6392645cf6d", "score": "0.5004395", "text": "function calculateGrid(){\n var image = $(background_container).children('img');\n cellSize = $(background_container).attr('dnd_cellsize');\n hCells = Math.round($(image).width() / cellSize);\n vCells = Math.round($(image).height() / cellSize);\n }", "title": "" }, { "docid": "1c1c532cbc4e368348c7c4032fd0cf76", "score": "0.5002198", "text": "function onChildCellConfigChanged(child) {\r\n if (child.parent && child.parent.layout instanceof GridLayout) {\r\n child.parent.fit();\r\n }\r\n }", "title": "" }, { "docid": "1c1c532cbc4e368348c7c4032fd0cf76", "score": "0.5002198", "text": "function onChildCellConfigChanged(child) {\r\n if (child.parent && child.parent.layout instanceof GridLayout) {\r\n child.parent.fit();\r\n }\r\n }", "title": "" }, { "docid": "8848a5511ec45147c22ba497cb58dd68", "score": "0.5000898", "text": "constructor() {\r\n this._tree = [];\r\n this._height = 0;\r\n }", "title": "" }, { "docid": "6f01a0dfa348cf4b9c42d4fea7f4399f", "score": "0.4996654", "text": "function drawArea(i) {\n image(area[i].image,width*area[i].x,height*area[i].y, width*area[i].width, height*area[i].height);\n image(area[i].label,mouseX - ((width*area[i].labelWidth)/2),mouseY, width*area[i].labelWidth, height*area[i].labelHeight);\n}", "title": "" }, { "docid": "d0c840bea18ce5b95b472c51b6c1245b", "score": "0.49962392", "text": "fitAxis () {\n let totalStaticHeight;\n let totalStaticWidth;\n [this.grid.row(0), ...this.grid.row(0).axisAfter].map(r => {\n r.adjustLengthToProportion(this.container.height);\n totalStaticHeight = this.grid.totalStaticHeight;\n return r;\n }).forEach(r => {\n if (!r.fixed) r.length = r.proportion * Math.max(0, this.container.height - totalStaticHeight);\n });\n [this.grid.col(0), ...this.grid.col(0).axisAfter].map(c => {\n c.adjustLengthToProportion(this.container.width);\n totalStaticWidth = this.grid.totalStaticWidth;\n return c;\n }).forEach(c => {\n if (!c.fixed) c.length = c.proportion * Math.max(0, this.container.width - totalStaticWidth);\n });\n }", "title": "" }, { "docid": "aa385ee25290afc0907958ef420f8a78", "score": "0.4995742", "text": "treeDensity() { return this.trees / this.area; }", "title": "" }, { "docid": "224208226a6513dfbc0e0357f3db1a92", "score": "0.49918714", "text": "updateChildren (props = this.props, manual) {\n let {autoSize, totalSpace} = this.calculateAutoSize(props)\n let nextPosition = 0\n\n return Children.map(props.children, (child, index) => {\n let childProps = this.evaluateDeprecatedProps(child)\n\n if (manual) {\n childProps.key = 'section--' + shortid.generate()\n }\n\n childProps.type = props.type\n childProps.mode = props.mode\n childProps.borders = props.borders\n childProps.index = index\n\n if (childProps.size) {\n let sizeType = this.evaluateSizeType(childProps.size)\n let parsedSize = parseFloat(childProps.size)\n\n childProps.position = nextPosition + '%'\n\n if (sizeType === 'pixel') {\n nextPosition += parsedSize * 100 / totalSpace\n } else if (sizeType === 'percent') {\n nextPosition += parsedSize\n }\n } else {\n childProps.size = autoSize + '%'\n childProps.position = nextPosition + '%'\n\n nextPosition += autoSize\n }\n\n return React.cloneElement(child, childProps)\n })\n }", "title": "" }, { "docid": "27f955820835f073040776ae423a28c3", "score": "0.49857545", "text": "function AdjustHeightWidthOfMyCanvas(){\n var c = $(\"#myCanvas25\");\n var container = $(c).parent();\n var maxWidth = $(container).width();\n var maxHeight = $(container).height();\n c.attr('width', maxWidth);\n c.attr('height', maxHeight);\n stepX = Math.floor((maxWidth-50)/9);\n stepY = Math.floor((maxHeight-50)/9);\n maxX = stepX * 9;\n }", "title": "" }, { "docid": "8e20754f7ad7e191d09f8866c2906c37", "score": "0.49854362", "text": "assignLayout(tree, treeData, box = null) {\n const { x, y } = this.bb.removeBoundingBox(tree.x, tree.y)\n treeData.x = x\n treeData.y = y\n\n const { width, height } = treeData\n if (box === null) {\n box = { left: x, right: x + width, top: y, bottom: y + height }\n }\n box.left = Math.min(box.left, x)\n box.right = Math.max(box.right, x + width)\n box.top = Math.min(box.top, y)\n box.bottom = Math.max(box.bottom, y + height)\n\n for (let i = 0; i < tree.c.length; i++) {\n this.assignLayout(tree.c[i], treeData.children[i], box)\n }\n\n return { result: treeData, boundingBox: box }\n }", "title": "" }, { "docid": "c767bf192f5644902bb2be67786f2eb0", "score": "0.4985043", "text": "calcArea() {\n return this.height * this.width;\n }", "title": "" }, { "docid": "b52481f5d8544a9ee46cb245dc547c0e", "score": "0.4982322", "text": "function calculateScales() {\n //clear nested data\n nestedData = [];\n\n //check whether the x values is not empty\n if (diagram.xAxis.xValues && diagram.xAxis.xValues.length > 0) {\n //set groups\n groups = diagram.xAxis.xValues.sort();\n\n //set nested data if there are predefined groups\n groups.forEach(function (currentGroup) {\n //set current nested data\n let currentSet = {\n key: currentGroup,\n values: []\n };\n\n //iterate all data\n diagram.data.forEach(function (d) {\n //set values\n if (d[groupField] === currentGroup)\n currentSet.values.push(e.clone(d));\n });\n\n //set nested data\n nestedData.push(currentSet)\n });\n } else {\n //nest data\n nestedData = d3.nest().key(function (d) { return d[currentSerie.groupField]; }).entries(diagram.data);\n }\n\n //calculate measures\n minMeasure = d3.min(diagram.data, function (d) { return +d[currentSerie.measureField]; });\n maxMeasure = d3.max(diagram.data, function (d) { return +d[currentSerie.measureField]; }) * 1.1;\n minRange = d3.min(diagram.data, function (d) { return d[currentSerie.rangeField]; });\n maxRange = d3.max(diagram.data, function (d) { return d[currentSerie.rangeField]; });\n groups = (diagram.xAxis.xValues && diagram.xAxis.xValues.length > 0) ? diagram.xAxis.xValues : e.getUniqueValues(diagram.data, currentSerie.groupField);\n\n //set min measure if there is an axis lock\n if (!isNaN(diagram.yAxis.min) && diagram.yAxis.min !== null)\n minMeasure = diagram.yAxis.min;\n\n //set max measure if there is an axis lock\n if (!isNaN(diagram.yAxis.max) && diagram.yAxis.max !== null)\n maxMeasure = diagram.yAxis.max * 1.2;\n\n //set min measure if there is an axis lock\n if (!isNaN(diagram.xAxis.min) && diagram.xAxis.min !== null)\n minRange = diagram.xAxis.min;\n\n //set max measure if there is an axis lock\n if (!isNaN(diagram.xAxis.max) && diagram.xAxis.max !== null)\n maxRange = diagram.xAxis.max;\n\n //create temp text\n tempTextSVG = diagram.svg.append('text')\n .text(e.formatNumber(maxMeasure, diagram.yAxis.labelFormat))\n .style('font-size', diagram.yAxis.labelFontSize + 'px')\n .style('color', diagram.yAxis.labelFontColor)\n .style('font-family', diagram.yAxis.labelFontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', diagram.yAxis.labelFontStyle == 'bold' ? 'normal' : diagram.yAxis.labelFontStyle)\n .style('font-weight', diagram.yAxis.labelFontStyle == 'bold' ? 'bold' : 'normal');\n\n //get offset\n tempTextOffset = tempTextSVG.node().getBoundingClientRect();\n\n //remnove temp text\n tempTextSVG.remove();\n\n //add previously substracted margins\n width += leftMargin;\n height += topMargin * 2 + groupTitleMaxHeight;\n\n //re-arrange dimension\n leftMargin = tempTextOffset.width + 10;\n topMargin = diagram.title.fontSize * 2;\n width -= leftMargin;\n height -= topMargin * 2;\n\n //calculat slope widths\n let slopeWidth = width - 10,\n singleSlopeWidth = slopeWidth / nestedData.length - leftMargin;\n\n //iterate nested\n groupTitleMaxHeight = 0;\n nestedData.forEach(function (currentNestedData) {\n let groupTitleText = (currentNestedData.key === null || currentNestedData.key === undefined || currentNestedData.key === 'undefined') ? '' : currentNestedData.key;\n\n //create temp text\n tempTextSVG = diagram.svg.append('text')\n .style('fill', diagram.title.fontColor)\n .style('font-size', diagram.title.fontSize + 'px')\n .style('font-family', diagram.title.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', diagram.title.fontStyle === 'bold' ? 'normal' : diagram.title.fontStyle)\n .style('font-weight', diagram.title.fontStyle === 'bold' ? 'bold' : 'normal')\n .style('text-anchor', 'middle')\n .text(groupTitleText);\n\n //wrap temp text\n diagram.wrapText(tempTextSVG, singleSlopeWidth);\n\n //get bbox of title\n groupTitleOffset = tempTextSVG.node().getBoundingClientRect();\n\n //remnove temp text\n tempTextSVG.remove();\n\n //set max height\n if (groupTitleOffset.height > groupTitleMaxHeight)\n groupTitleMaxHeight = groupTitleOffset.height;\n });\n\n //re-arrange dimension\n height -= groupTitleMaxHeight;\n\n //create y scale\n yScale = d3.scaleLinear().range([height, 0]).domain([minMeasure, maxMeasure]);\n\n //set diagram g\n diagramG = diagram.svg.append('g')\n .attr('class', 'eve-vis-g')\n .attr('transform', 'translate(' + diagram.plot.left + ',' + topMargin + ')');\n }", "title": "" }, { "docid": "b940c6476e79ae8d8f60959b4c74d764", "score": "0.49762842", "text": "function onChildCellConfigChanged(child) {\n if (child.parent && child.parent.layout instanceof GridLayout) {\n child.parent.fit();\n }\n }", "title": "" }, { "docid": "cae19fb159e37659ba8e8ccb1ed6df51", "score": "0.4967798", "text": "function setArea(width, height) {\n activeRoom.scaleToWidth(width);\n activeRoom.scaleToHeight(height);\n console.log(activeRoom.width);\n console.log(activeRoom.height);\n canvas.renderAll();\n}", "title": "" }, { "docid": "4e09d3f5366fc10f2a0efa376c5d9c36", "score": "0.49663967", "text": "bindData() {\n const partition = data => {\n const root = d3$5.hierarchy(data).sum(d => d[this.cfg.value]);\n return d3$5.partition()(root);\n };\n\n this.hData = partition(this.data[0]).descendants();\n this.itemg = this.gcenter.selectAll('.chart__slice-group').data(this.hData, d => d.data[this.cfg.key]); // Set transition\n\n this.transition = d3$5.transition('t').duration(this.cfg.transition.duration).ease(d3$5[this.cfg.transition.ease]);\n }", "title": "" }, { "docid": "a74c0dab5e2c4d1c83c11597a64eb4e0", "score": "0.49663454", "text": "function groupSize(nodes) {\n\tvar minPos = [Infinity, Infinity];\n\tvar maxPos = [-Infinity, -Infinity];\n\tfor (var i in nodes) {\n\t\tvar node = nodes[i];\n\t\tif (node.isParent) {\n\t\t\tcontinue;\n\t\t}\n\t\tminPos[0] = Math.min(minPos[0], node.value.pos[0]);\n\t\tminPos[1] = Math.min(minPos[1], node.value.pos[1]);\n\t\tmaxPos[0] = Math.max(maxPos[0], node.value.pos[0] + node.value.width);\n\t\tmaxPos[1] = Math.max(maxPos[1], node.value.pos[1] + node.value.height);\n\t}\n\treturn [maxPos[0] - minPos[0], maxPos[1] - minPos[1]];\n}", "title": "" }, { "docid": "e8b7870012d1044da228837d888df541", "score": "0.49656218", "text": "function Init() {\n\n google.charts.load('current', {packages: [\"orgchart\"]});\n google.charts.setOnLoadCallback(drawChart);\n function drawChart() {\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Variable');\t// pk\n data.addColumn('string', 'Parent');\t// fk to Variable\n data.addColumn('string', 'layer_name');\n\n var providers = ['CanESM2', 'CCSM4', 'CNRM-CM5', 'HadGEM2-ES'];\n\n data.addRow([\n {\n v: 'ensemble_tmin',\n f: \"Ensemble<div style='color:blue;'>tmin</div>\"\n },\n '',\n 'tmin'\n ]);\n\n data.addRow([\n {\n v: 'ensemble_tmax',\n f: \"Ensemble<div style='color:blue;'>tmax</div>\"\n },\n '',\n 'tmax'\n ]);\n\n for (var i = 0; i < providers.length; i++) {\n var name = providers[i];\n data.addRow([\n {\n v: name + '_tmin',\n f: name + \"<div style='color:blue;'>tmin</div>\"\n },\n 'ensemble_tmin',\n 'tmin'\n ]);\n data.addRow([\n {\n v: name + '_tmax',\n f: name + \"<div style='color:blue;'>tmax</div>\"\n },\n 'ensemble_tmax',\n 'tmax'\n ]);\n }\n\n var chart = new google.visualization.OrgChart(document.getElementById(\"providers-tree\"));\n chart.draw(data, {allowHtml: true, allowCollapse: true, size: 'small'});\n\n function selectHandler() {\n var selection = chart.getSelection();\n if (selection.length > 0) {\n UpdateVariable(data.getValue(selection[0].row, 0), data.getValue(selection[0].row, 2));\n }\n }\n\n google.visualization.events.addListener(chart, 'select', selectHandler);\n }\n\n // get the dimensions of the elevation attribute\n $.getJSON('dimensions', function(response) {\n dimensions = response;\n x_tiles = Math.ceil(dimensions.x/EEMS_TILE_SIZE[0]);\n y_tiles = Math.ceil(dimensions.y/EEMS_TILE_SIZE[1]);\n fill_value = Number(dimensions.fill_value);\n CreateTiles();\n });\n }", "title": "" }, { "docid": "8e053ddeafecda3b9ad7570c82718e7d", "score": "0.49583498", "text": "fitToContainer() {\n this.w = this.canvas.width = this.canvas.offsetWidth;\n this.h = this.canvas.height = this.canvas.offsetHeight;\n }", "title": "" }, { "docid": "4ab5837758771b25e6d35b0bd6626ba5", "score": "0.49568436", "text": "function augmentData(baseData, grid) {\n baseData.forEach((d, i) => {\n d.layout = {\n x: grid[i].x,\n y: grid[i].y,\n scale: grid[i].scale,\n };\n });\n }", "title": "" }, { "docid": "44850f14f804e1e4b67246a648155fe3", "score": "0.49532056", "text": "initializeArea (initialBounds) {\n this.LEVELS[0].initializeArea(initialBounds)\n }", "title": "" }, { "docid": "96323eab320c387b0876214b8e9b8039", "score": "0.49487945", "text": "_arrange_children(parentBox, limits, up, initialiser) {\n const unitHeight = parentBox.height / parentBox.factoryData.totalWeight;\n\n let childTop;\n let childBottom;\n if (up === undefined) {\n childTop = parentBox.top;\n initialiser = -1;\n up = false;\n }\n else if (up) {\n childBottom = parentBox.childBoxes[initialiser].top;\n }\n else {\n childTop = parentBox.childBoxes[initialiser].bottom;\n }\n const direction = (up ? -1 : 1)\n\n const childLength = parentBox.childBoxes.length;\n for(\n let index = initialiser + direction;\n index >= 0 && index < childLength;\n index += direction\n ) {\n const childBox = parentBox.childBoxes[index];\n const childHeight = childBox.factoryData.weight * unitHeight;\n if (up) {\n childTop = childBottom - childHeight;\n }\n else {\n childBottom = childTop + childHeight;\n }\n\n const shouldSpawn = (\n limits.spawnThreshold === undefined ||\n childHeight >= limits.spawnThreshold) &&\n childBottom > limits.top && childTop < limits.bottom;\n\n if (shouldSpawn) {\n const childLeft = limits.solve_left(childHeight);\n const childWidth = limits.width - childLeft;\n \n childBox.set_dimensions(\n childLeft, childWidth,\n childBottom - (childHeight / 2), childHeight);\n \n this._configure_child_boxes(childBox);\n if (childBox.factoryData.totalWeight === undefined) {\n // Next function is async but this code doesn't wait for it\n // to finish.\n this._predict_weights(childBox, limits);\n }\n else {\n this._arrange_children(childBox, limits);\n }\n }\n else {\n childBox.erase();\n // Clear the child boxes only if their weights could be\n // generated again.\n if (\n childBox.template.cssClass === null &&\n childBox.childBoxes !== undefined\n ) {\n // console.log(`erasing childs \"${childBox.cssClass} \"${childBox.message}\"`);\n if (!childBox.factoryData.gettingWeights) {\n // throw new Error(\n // 'Erasing when prediction is in progress.')\n childBox.clear_child_boxes();\n childBox.factoryData.totalWeight = undefined; \n }\n }\n }\n\n if (up) {\n childBottom -= childHeight;\n }\n else {\n childTop += childHeight;\n }\n }\n return up ? childBottom : childTop;\n }", "title": "" }, { "docid": "68a5a5c0d3410052f39ba50eae4c8859", "score": "0.4942979", "text": "function Area(theX0, theY0, theX1, theY1, theColor, theBase, theTooltipText, theOnClickAction, theOnMouseoverAction, theOnMouseoutAction)\r\n{ this.ID=\"Area\"+_N_Area; _N_Area++; _zIndex++;\r\n this.X0=theX0;\r\n this.Y0=theY0;\r\n this.X1=theX1;\r\n this.Y1=theY1;\r\n this.Color=theColor;\r\n this.Base=theBase;\r\n this.TooltipText=theTooltipText;\r\n this.SetVisibility=_SetVisibility;\r\n this.SetColor=_SetColor; \r\n this.SetTitle=_SetTitle;\r\n this.MoveTo=_MoveTo;\r\n this.ResizeTo=_AreaResizeTo;\r\n this.Delete=_Delete;\r\n this.EventActions=\"\";\r\n if (_nvl(theOnClickAction,\"\")!=\"\") this.EventActions+=\" href='javascript:\"+_nvl(theOnClickAction,\"\")+\"' \";\r\n if (_nvl(theOnMouseoverAction,\"\")!=\"\") this.EventActions+=\"onMouseover='\"+_nvl(theOnMouseoverAction,\"\")+\"' \";\r\n if (_nvl(theOnMouseoutAction,\"\")!=\"\") this.EventActions+=\"onMouseout='\"+_nvl(theOnMouseoutAction,\"\")+\"' \";\r\n var dd, ll, rr, tt, bb, ww, hh;\r\n if (theX0<=theX1) { ll=theX0; rr=theX1; }\r\n else { ll=theX1; rr=theX0; }\r\n if (theY0<=theY1) { tt=theY0; bb=theY1; }\r\n else { tt=theY1; bb=theY0; }\r\n ww=rr-ll; hh=bb-tt;\r\n if (theBase<=tt)\r\n _DiagramTarget.document.writeln(\"<layer left=\"+ll+\" top=\"+theBase+\" id='\"+this.ID+\"' z-index=\"+_zIndex+\">\");\r\n else\r\n _DiagramTarget.document.writeln(\"<layer left=\"+ll+\" top=\"+tt+\" id='\"+this.ID+\"' z-index=\"+_zIndex+\">\");\r\n if (theBase<=tt)\r\n { if ((theBase<tt)&&(ww>0))\r\n _DiagramTarget.document.writeln(\"<layer left=2 top=2><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"o_\"+theColor+\".gif' width=\"+ww+\" height=\"+eval(tt-theBase)+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n if (((theY0<theY1)&&(theX0<theX1))||((theY0>theY1)&&(theX0>theX1)))\r\n _DiagramTarget.document.writeln(\"<layer left=2 top=\"+eval(tt-theBase+2)+\"><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"q_\"+theColor+\".gif' width=\"+ww+\" height=\"+hh+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n if (((theY0>theY1)&&(theX0<theX1))||((theY0<theY1)&&(theX0>theX1)))\r\n _DiagramTarget.document.writeln(\"<layer left=2 top=\"+eval(tt-theBase+2)+\"><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"p_\"+theColor+\".gif' width=\"+ww+\" height=\"+hh+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n }\r\n if ((theBase>tt)&&(theBase<bb))\r\n { dd=Math.round((theBase-tt)/hh*ww);\r\n if (((theY0<theY1)&&(theX0<theX1))||((theY0>theY1)&&(theX0>theX1)))\r\n { _DiagramTarget.document.writeln(\"<layer left=2 top=2><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"b_\"+theColor+\".gif' width=\"+dd+\" height=\"+eval(theBase-tt)+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n _DiagramTarget.document.writeln(\"<layer left=\"+eval(dd+2)+\" top=\"+eval(theBase-tt+2)+\"><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"q_\"+theColor+\".gif' width=\"+eval(ww-dd)+\" height=\"+eval(bb-theBase)+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n }\r\n if (((theY0>theY1)&&(theX0<theX1))||((theY0<theY1)&&(theX0>theX1)))\r\n { _DiagramTarget.document.writeln(\"<layer left=2 top=\"+eval(theBase-tt+2)+\"><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"p_\"+theColor+\".gif' width=\"+eval(ww-dd)+\" height=\"+eval(bb-theBase)+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n _DiagramTarget.document.writeln(\"<layer left=\"+eval(ww-dd+2)+\" top=2><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"d_\"+theColor+\".gif' width=\"+dd+\" height=\"+eval(theBase-tt)+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n }\r\n }\r\n if (theBase>=bb)\r\n { if ((theBase>bb)&&(ww>0))\r\n _DiagramTarget.document.writeln(\"<layer left=2 top=\"+eval(hh+2)+\"><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"o_\"+theColor+\".gif' width=\"+ww+\" height=\"+eval(theBase-bb)+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n if (((theY0<theY1)&&(theX0<theX1))||((theY0>theY1)&&(theX0>theX1)))\r\n _DiagramTarget.document.writeln(\"<layer left=2 top=2><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"b_\"+theColor+\".gif' width=\"+ww+\" height=\"+hh+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n if (((theY0>theY1)&&(theX0<theX1))||((theY0<theY1)&&(theX0>theX1)))\r\n _DiagramTarget.document.writeln(\"<layer left=2 top=2><a\"+this.EventActions+\"><img src='\" + _DiagramImagesHref + \"d_\"+theColor+\".gif' width=\"+ww+\" height=\"+hh+\" border=0 align=top valign=left alt='\"+_nvl(theTooltipText,\"\")+\"'></a></layer>\");\r\n }\r\n _DiagramTarget.document.writeln(\"</layer>\");\r\n}", "title": "" }, { "docid": "2e8841d5e3e46623d4fe033b1f6b6b0a", "score": "0.49389556", "text": "drawChildren(renderer, skip) {\n for (var i = 0; i < this.children.length; i++) {\n const c = this.children[i];\n if (c.isDragging) {\n // TODO: move\n c.moveTo(c.dragOffsetX + c.stage.mouseX, c.dragOffsetY + c.stage.mouseY);\n }\n if (c.visible && c !== skip) {\n renderer.drawChild(c);\n }\n }\n }", "title": "" }, { "docid": "9f687acb2431fe547e4b04cf22a29e23", "score": "0.4938173", "text": "function CGE_Area(x,y,w,h,sprites_data){\n\t// position\n\tthis.x = x;\n\tthis.y = y;\n\tthis.z = 100;\n\t// size\n\tthis.width = w;\n\tthis.height = h;\n\tthis.sprites_data = sprites_data;\n\tthis.spritesets = [];\n\tthis.type = \"CGE_Area\";\n\tthis.variables = {};\n\t\n\tthis.show = false;\n}", "title": "" }, { "docid": "63316294678cfd49bc745ed67b31d4f7", "score": "0.49334186", "text": "subdivide() {\n // Subdivide the boundary and make 4 subtrees, one per\n // sub-boundary.\n let sub_boundaries = this.boundary.subdivide();\n this.children = sub_boundaries.map((b) => \n new Quadtree(b, this.capacity));\n \n // Since there are only 4 subtrees, all leaves,\n // this runs in O(4n) time where n is the number of\n // points in the original overfull node.\n for (let [x, y, c] of this.points) {\n \n // For each point, try each subtree and see if\n // we can insert it. Stop on the first valid insertion.\n for (let child of this.children) {\n if (child.contains(x, y)) {\n child.insert(x, y, c);\n break;\n }\n }\n }\n \n // Finally, clear the points list since we've moved\n // all the points down the tree.\n this.points = [];\n }", "title": "" }, { "docid": "dd647b280e8c9b445765218ec249273f", "score": "0.49287206", "text": "constructor(extent) {\n this.topLeftCorner = new Types_1.Point(extent[0][0], extent[0][1]);\n this.topRightCorner = new Types_1.Point(extent[1][0], extent[0][1]);\n this.bottomLefttCorner = new Types_1.Point(extent[0][0], extent[1][1]);\n this.bottomRightCorner = new Types_1.Point(extent[1][0], extent[1][1]);\n this.topBorder = new Segment_1.Segment(this.topLeftCorner, this.topRightCorner);\n this.leftBorder = new Segment_1.Segment(this.topLeftCorner, this.bottomLefttCorner);\n this.rightBorder = new Segment_1.Segment(this.topRightCorner, this.bottomRightCorner);\n this.bottomBorder = new Segment_1.Segment(this.bottomRightCorner, this.bottomLefttCorner);\n }", "title": "" }, { "docid": "b236ab7d300147c5275cf0e4ed0838c6", "score": "0.49229106", "text": "appendChildren(){\n this.leftdiv.appendChild(this.employeephoto);\n this.rightdiv.appendChild(this.employeename)\n this.rightdiv.appendChild(this.employeebio)\n this.maindiv.appendChild(this.leftdiv);\n this.maindiv.appendChild(this.rightdiv);\n }", "title": "" }, { "docid": "b251499f8c858a89ad52ab763315a9c8", "score": "0.49219954", "text": "slideShowChildViewSizing() {\n // Calculate new children width\n const width = this.carouselWrapper.clientWidth;\n\n // Assign new value of children width into class variable\n this.childSize.childWidth = width;\n\n // change child width\n for (let index = 0; index < this.childrenView.length; index += 1) {\n this.childrenView[index].style.width = `${width}px`;\n }\n }", "title": "" }, { "docid": "ad47727b258416cd2383726a657fbef8", "score": "0.49205586", "text": "function layoutRealizedRange() {\n\t if (that._groups.length === 0) {\n\t return;\n\t }\n\n\t var realizedItemRange = that._getRealizationRange(),\n\t len = tree.length,\n\t i,\n\t firstChangedGroup = site.groupIndexFromItemIndex(changedRange.firstIndex);\n\n\t for (i = firstChangedGroup; i < len; i++) {\n\t layoutGroupContent(i, realizedItemRange, true);\n\t that._layoutGroup(i);\n\t }\n\t }", "title": "" }, { "docid": "98873191a6cf3a6fcb737d1a8f44cc5b", "score": "0.49164996", "text": "layout(treeData) {\n const tree = this.convert(treeData)\n layout(tree)\n const { boundingBox, result } = this.assignLayout(tree, treeData)\n\n return { result, boundingBox }\n }", "title": "" }, { "docid": "f3e35bc66a2652e2ce8e175533ae67dc", "score": "0.4914436", "text": "function fitToContainer(){\n layoutCanvas(canvas, canvasHeight);\n layoutCanvas(canvasHabitableZone, canvasHeight);\n calculateScreenCenter();\n }", "title": "" }, { "docid": "7fe813f6e96731dda5ab7029b1c3876a", "score": "0.4914345", "text": "function maxFloor(){\n\tvar layout=View.getLayoutManager('nested_north');\n\tlayout.collapseRegion('east');\n\tlayout=View.getLayoutManager('main');\n\tlayout.collapseRegion('north');\n\tlayout=View.getLayoutManager('nested_west');\n\tlayout.collapseRegion('north');\n\tcontroller.abSpAsgnRmcatRmTypeToRm_drawingPanel.actions.get('max').show(false);\n\tcontroller.abSpAsgnRmcatRmTypeToRm_drawingPanel.actions.get('normal').show(true);\n\tView.getView('parent').defaultLayoutManager.collapseRegion('west');\n\tif(controller.abSpAsgnRmcatRmTypeToRm_drawingPanel.isLoadedDrawing){\n\t\tresizeDrawingPanel.defer(100);\n\t}\n}", "title": "" }, { "docid": "8490f34d4da2160fdd584bb4d1e2d4dd", "score": "0.49067113", "text": "function select_area(){\n\tvar rect1 = elems[\"paper_\"+current_graph_id].rect(((2*paddingx[current_graph_id])), 2*paddingy[current_graph_id] , 0, (height[current_graph_id]-(4*paddingy[current_graph_id]))).attr({\n\t\topacity : 0,\n\t});\n\telems['zoom_rect_'+current_graph_id] = rect1;\n}", "title": "" } ]
2a6131f1cc882f65a8f9d23a7c9d4b21
console.log(data); filter for types of crime
[ { "docid": "9f29129cfb693fa0523e5f0cc79196d3", "score": "0.0", "text": "function batteryType(battery) {\n return battery.primary_type == \"BATTERY\"\n }", "title": "" } ]
[ { "docid": "876f8ae9166a91fd731a3b8386c94839", "score": "0.70095116", "text": "function getCrimeTypes() {\n return mongodb.getDistinct(\"crimes\", \"crime_type\")\n}", "title": "" }, { "docid": "ded71d7ad7e558f48c0a99aedb1da5d0", "score": "0.66110253", "text": "function filterType(data)\n{\n let displayTypes = [];\n let typeRadios = document.getElementsByClassName('typeRadios');\n\n for (var i = 0, length = typeRadios.length; i < length; i++) {\n if (typeRadios[i].checked) {\n displayTypes.push(typeRadios[i].value);\n }\n }\n data = data.filter(d => displayTypes.includes(d['types']));\n\n return data;\n}", "title": "" }, { "docid": "bbe2377a908af7bf257ff721e88e23e5", "score": "0.6465791", "text": "function filterSubtype(data)\n{\n let subtypeElems = document.getElementsByClassName(\"subtype active\")\n let subtypes = [];\n for (let subtypeElem of subtypeElems) {\n subtypes.push(subtypeElem.text);\n }\n\n if (subtypes.length > 0)\n {\n data = data.filter(\n d => d.subtypes.split(\",\").some(d => subtypes.includes(d)));\n }\n\n return data;\n}", "title": "" }, { "docid": "0dc481e2cb892c6ec1abf0af1440a81f", "score": "0.64370584", "text": "function getCollectables(data) {\n return data.filter(card => card.collectible)\n}", "title": "" }, { "docid": "80fc3f241e04b612b142787f86fa1819", "score": "0.63008803", "text": "function filterData(value){\n d3.json(\"http://api.nobelprize.org/v1/prize.json\").then(data => {\n var filteredData = data.prizes.filter(record => record['category'] == value);\n console.log(filteredData);\n\n\n // OPTIONAL: display all the resuls in paragraphs\n textArea = d3.select(\"#textArea\")\n\n // clear the existing display\n textArea.html(\"\")\n\n // loop through array of objects\n filteredData.forEach(function (record) {\n \n // append the year\n textArea.append(\"h4\").text(record.year)\n\n // append the laureates, if any\n if (record.laureates) {\n record.laureates.forEach(function (winner) {\n textArea.append(\"p\")\n .text(`${winner.firstname} ${winner.surname}: ${winner.motivation}`)\n })\n }\n\n // else, append an explanation\n else {\n textArea.append(\"p\")\n .text(record.overallMotivation)\n }\n })\n })\n}", "title": "" }, { "docid": "fd37042c70abe23f1447ee3f35163bdc", "score": "0.61253077", "text": "function crimeTypeFilterData() {\n isBrushed = false;\n // Check if crime type has been selected\n if (crimeTypeFilter.length === 0) {\n // Reset stacked area chart to total data if no crime selected (crime filter empty)\n stackedAreaChart.data = data;\n bubbleChart.data = bubbleCrimeData;\n } else {\n // Filter temp data according to selected crime type and set stacked area chart's data to it and re-render\n const selectedCrimeData = data.filter(d => crimeTypeFilter.includes(d.typeGeneral));\n // set bubble chart data to this crime category\n stackedAreaChart.data = selectedCrimeData;\n bubbleCrimeData = selectedCrimeData;\n // Check if brush selection made at the time of crime type and update data\n if (yearBrushDomain.length === 0) {\n bubbleBrushedYearData = selectedCrimeData;\n bubbleChart.data = bubbleBrushedYearData;\n } else {\n bubbleBrushedYearData = bubbleCrimeData.filter(d =>\n d.YEAR < yearBrushDomain[1] && d.YEAR > yearBrushDomain[0]);\n bubbleChart.data = bubbleBrushedYearData;\n }\n }\n stackedAreaChart.updateVis();\n donutChart.updateVis();\n bubbleChart.updateVis();\n}", "title": "" }, { "docid": "e3b0da178e1877d560ea7d65040bf92c", "score": "0.6077233", "text": "function filterFunction(data) {\n // TODO: add sql commands inplace of the loop below\n var temp=[]\n for(var i=0; i<data.length; i++) {\n if (data[i].type === \"business\" && data[i].category == \"5 star\") {\n temp.push({\"category\": data[i].category, \"type\": data[i].type,\n \"name\": data[i].name, \"price\": data[i].price, \"id\": data[i].id,\n \"requirement_rating\": data[i].requirement_rating })\n }\n }\n return temp;\n}", "title": "" }, { "docid": "fbb56f1991bf615af17b74bd4fcda061", "score": "0.60199386", "text": "function dataFilterMurder(data) {\n return data.filter(victim => victim.statistical_murder_flag == true);\n}", "title": "" }, { "docid": "3bba52e514a1a1ffae1db8f9f51d28f0", "score": "0.5945001", "text": "function getFinals(data) {\n const final = data.filter( fifa => fifa.Stage === \"Final\");\n return final; \n}", "title": "" }, { "docid": "2e995fd6bd78ee930e01df454bfacafe", "score": "0.5792785", "text": "getAllCategoricalFeatures() {\n return Object.keys(this.data[0]).filter((key) => {\n return this.filterTypes[key] === FILTER_CATEGORICAL;\n });\n }", "title": "" }, { "docid": "6615adc7cd7ed7220a770258caf2e138", "score": "0.57897234", "text": "function filterCrimes(event){\n var crimeCategory = event.target.innerText;\n crimeCategory = crimeCategory.replace(/^[\\s\\d]+/, '');\n for(marker of state.markers){\n marker.setMap(null);\n }\n mapCrimes(crimeCategory);\n}", "title": "" }, { "docid": "21267a97c2e4c3636d7ca4ced655edca", "score": "0.5770177", "text": "function cleanResults (data, category) {\n return data\n .filter(s => s.category === category)\n .map(s => {\n const { geography, category, ...o } = s\n return o\n })\n}", "title": "" }, { "docid": "606401785a86c05bbc5a5d0493a06bca", "score": "0.57334006", "text": "function getTypes (data) {\n const beerTypes = [];\n for (let i = 0; i < data.length; i++) {\n for (let y = 0; y < data[i].types.length; y++) {\n if (beerTypes.indexOf(data[i].types[y]) === -1) beerTypes.push(data[i].types[y]);\n }\n }\n beerTypes.sort();\n const allTypesObj = [];\n beerTypes.forEach(el => allTypesObj.push({\n key: el,\n text: el,\n value: el\n }));\n // console.log(allTypesObj)\n return allTypesObj;\n}", "title": "" }, { "docid": "af10eff3ad3fd6585eb30593a2dae4a3", "score": "0.573295", "text": "function filter(filter) {\n\t\t\tswitch(filter) {\n\t\t\t\tcase \"firstOwner\": {\n\t\t\t\t\tif(getData.firstOwner == 'on') {\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].owners != 1) {\n\t\t\t\t\t\t\t\tresult.splice(x,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} break;\n\t\t\t\tcase \"fuelType\": {\n\t\t\t\t\tif(getData.fuelType == 'diesel') {\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].fuelType != 'Diesel') {\n\t\t\t\t\t\t\t\tresult.splice(x,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\telse if(getData.fuelType == 'petrol') {\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].fuelType != 'Petrol') {\n\t\t\t\t\t\t\t\tresult.splice(x,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} break;\n\t\t\t\tcase \"priceMin\": {\n\t\t\t\t\tif(getData.priceMin != \"\") {\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].price<getData.priceMin) {\n\t\t\t\t\t\t\t\tresult.splice(x,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} break;\n\t\t\t\tcase \"priceMax\": {\n\t\t\t\t\tif(getData.priceMax != \"\") {\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].price>getData.priceMax) {\n\t\t\t\t\t\t\t\tresult.splice(x,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} break;\n\t\t\t\tcase \"engineSize\": {\n\t\t\t\t\tif(getData.engineSize != 'all') {\n\t\t\t\t\tvar eSMin = -1;\n\t\t\t\t\tvar eSMax = -1;\n\t\t\t\t\t\tswitch(getData.engineSize) {\n\t\t\t\t\t\t\tcase \"0\": {\n\t\t\t\t\t\t\t\teSMin=0;\n\t\t\t\t\t\t\t\teSMax=999;\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase \"1\": {\n\t\t\t\t\t\t\t\teSMin=1000;\n\t\t\t\t\t\t\t\teSMax=1399;\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase \"2\": {\n\t\t\t\t\t\t\t\teSMin=1400;\n\t\t\t\t\t\t\t\teSMax=1699;\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase \"3\": {\n\t\t\t\t\t\t\t\teSMin=1700;\n\t\t\t\t\t\t\t\teSMax=1999;\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase \"4\": {\n\t\t\t\t\t\t\t\teSMin=2000;\n\t\t\t\t\t\t\t\teSMax=2999;\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase \"5\": {\n\t\t\t\t\t\t\t\teSMin=3000;\n\t\t\t\t\t\t\t\teSMax=99999;\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].engineSize<eSMin || result[x].engineSize>eSMax) {\n\t\t\t\t\t\t\t\tresult.splice(x,1);\n\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}\n\t\t\t\t} break;\n\t\t\t\tcase \"transmission\": {\n\t\t\t\t\tif(getData.transmission == \"manual\") {\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].transmission!='Manual') {\n\t\t\t\t\t\t\t\tresult.splice(x,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\telse if(getData.transmission == 'automatic') {\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].transmission!='Automatic') {\n\t\t\t\t\t\t\t\tresult.splice(x,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} break;\n\t\t\t\tcase \"mileageMin\": {\n\t\t\t\t\tif(getData.mileageMin != \"\") {\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].mileage<getData.mileageMin) {\n\t\t\t\t\t\t\t\tresult.splice(x,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} break;\n\t\t\t\tcase \"mileageMax\": {\n\t\t\t\t\tif(getData.mileageMax != \"\") {\n\t\t\t\t\t\tfor(var x=result.length-1;x>=0;x--) {\n\t\t\t\t\t\t\tif(result[x].mileage>getData.mileageMax) {\n\t\t\t\t\t\t\t\tresult.splice(x,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} break;\n\t\t\t\tdefault: {\n\t\t\t\t\talert(\"Unknown filter.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(result == \"\") {\n\t\t\t\tresultMsg.innerHTML += \"No results were found meeting criteria.\";\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "b914346627a988fb65e7a14b3a4ff196", "score": "0.570992", "text": "function getCrimesByTypeCount() {\n const aggregation = [\n {\n \"$group\": { _id: \"$crime_type\", count: { $sum: 1 } }\n },\n {\n $sort: {\n _id: 1\n }\n }\n ]\n return mongodb.getAggregate('crimes', aggregation );\n }", "title": "" }, { "docid": "a91601e97e5ff036f1a4d47779d9b5b5", "score": "0.5704463", "text": "function getFinals(data) {\n return data.filter((el, i) => {\n return el.Stage === \"Final\";\n });\n}", "title": "" }, { "docid": "46f367c4f5bb45fa8b860e43aae33ef2", "score": "0.5668535", "text": "function getCasualitiesByGender(data, gender) {\n\tconst survivedG = data.filter( p => p.fields.sex == (gender))\n\t.filter(p => p.fields.survived === 'No')\n\treturn survivedG.length\n}", "title": "" }, { "docid": "67a76f2d3d010b6d1c0c6bee3858a8a6", "score": "0.5630285", "text": "function select(category) {\n // You can also change the data set to reflect if every letter is a vowel or a consonant. \n var vowels = ['A', 'E', 'I', 'O', 'U'];\n if (category == 'All letters') {\n render(data);\n } else if (category = 'Vowels') {\n console.log(data.filter(function (d) { \n return vowels.includes(d.letter); \n }));\n\n render(data.filter(function (d) { \n return vowels.includes(d.letter); \n }));\n \n } else if (category = 'Consonants') {\n render(data.filter(function (d) { \n console.log(!vowels.includes(d.letter)); \n return !vowels.includes(d.letter); \n }));\n }\n }", "title": "" }, { "docid": "e47af79e08ce006fc73c4b35452bbc89", "score": "0.5610497", "text": "function highRisk(people) {\n let risks=[]\n\n people.filter(person=>{\n if (person.isSocialDistancing==false){\n person.friends.filter(friend=>{\n if (friend.isInfected === true && friend.isSocialDistancing === false && !risks.includes(person.lastName)){\n risks.push(person.firstName+\" \"+person.lastName)\n }\n })\n }\n })\n return risks\n}", "title": "" }, { "docid": "9509a9db2b82e0c11b8ae255a6e5cf76", "score": "0.5610036", "text": "function getSurvivorsByGender(data, gender) {\n\tconst survivedG = data.filter( p => p.fields.sex == (gender))\n\t.filter(p => p.fields.survived === 'Yes')\n\treturn survivedG.length\n}", "title": "" }, { "docid": "8363b67f870ed5937eb59f0c031654dc", "score": "0.5609323", "text": "function getType(projects, projectFilter) {\n var filteredProjects = []\n projects.forEach(function (element) {\n var projectType = element[categoryColumn]\n if (projectType === projectFilter) filteredProjects.push(element)\n console.log(\"i made it here\")\n })\n return filteredProjects\n}", "title": "" }, { "docid": "05cbd9c6dda10a4d4991c6fb9eabb8f1", "score": "0.55740166", "text": "function peopleWhoBelongToTheIlluminati(arr){\n arr.filter(mem=>{\n if(mem.member===true){\n console.log(mem)\n }\n })\n}", "title": "" }, { "docid": "e03341d3c17c495430f2706b67848744", "score": "0.55734026", "text": "function getFilterTypes( data, filterObj) {\n if(!data) return;\n\n for( var i = 0; i < data.length; i++){\n /**\n * This is an individual item, we will be pulling values from here\n * to build the selection options from\n */\n var item = data[i];\n\n for( var type in item){\n /**\n * The type here is a selection category. It needs to exist in the\n * filterObj object to get recognized.\n */\n if( item.hasOwnProperty(type) && filterObj[type] !== undefined){\n var opt = data[i][type];\n\n var optL = opt.toLowerCase();\n if( !optL) continue;\n var feature = {name: optL, value: true};\n\n /**\n * Here we de-dupe the filter options so we don't get\n * dupes in the list\n */\n var match = false;\n for( var x = 0; x < filterObj[type].length; x++){\n if( filterObj[type][x].name === feature.name) {\n match = true;\n }\n }\n\n /* don't make dupes! */\n if( !match) {\n filterObj[type].push( feature);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "c132913545c7d2c82603c618cbfa922a", "score": "0.5568022", "text": "function filterData(category) {\n\t\n\t\n\t\n\t\tlet filtered = attractions.filter(d=>d.Category===category)\n\t\t\t.sort(function(a,b){return b.Visitors-a.Visitors})\n\t\t\t.slice(0,5);\n\t\treturn filtered;\n\t\t//attractions.filter(d=>d.Category===category).sort(function(a,b){return b-a}).slice(0,5);\n\t\t/* **************************************************\n\t\t *\n\t\t * TODO: filter attractions by the selected category\n\t\t * TODO: filter top 5 attractions\n\t\t *\n\t\t * CALL THE FOLLOWING FUNCTION TO RENDER THE BAR-CHART:\n\t\t *\n\t\t*/\n\t\t/*\n\t\t *\n\t\t * - 'data' must be an array of JSON objects\n\t\t * - the max. length of 'data' is 5\n\t\t *\n\t\t * **************************************************/\n\t\n\t}", "title": "" }, { "docid": "33f0be5223831af38b6bc65e3e91bbf2", "score": "0.5558592", "text": "function filterByHouse() {\r\n\r\nhouseFilter = this.dataset.category;\r\n\r\nconsole.log(houseFilter);\r\n\r\n buildList();\r\n\r\n}", "title": "" }, { "docid": "da21bc5b3c86e8d78c0c323dad8db1fe", "score": "0.55456907", "text": "function takeSearchedData(data){\n const cancertype = $(\"input[name='cancertype']\").val();\n const cellline = $(\"input[name='cellline']\").val();\n const ionchannel = $(\"input[name='ionchannel']\").val();\n const result = [];\n\n for(var i=0; i < data.length; i++){\n if ((data[i].cancerType == cancertype || cancertype == '') && (data[i].cellLine == cellline || cellline == '') && (data[i].ionChannel == ionchannel || ionchannel == '' )) {\n result.push(data[i]);\n } \n if (cancertype == '' && cellline == '' && ionchannel ==''){\n result.length = 0;\n } \n }\n return result;\n}", "title": "" }, { "docid": "2be66c4005199a6a2bab4c9c7f9300a6", "score": "0.55292827", "text": "function preprocess_data() { \n var data_sub = jsPsych.data.get().filter({ \"trial_type\": \"survey-text\" }); \n var data_sub = data_sub.filterCustom(function (trial) { return trial.trial_index > 0 });\n var data_sub = data_sub.filterCustom(function (trial) { return trial.rt > 200 });\n return data_sub;\n}", "title": "" }, { "docid": "cc81da79f498b6ee31ee2d58e68b3ca9", "score": "0.55148226", "text": "filterByCategory(plates, categoryfilter) {\n let res = [];\n if (categoryfilter.indexOf('Other') !==-1) {\n plates.forEach((plate) => {\n var founded =false;\n for (var key in plate.category) {\n if (allFilters.indexOf(key) !==1 && !founded) {\n founded = true;\n }\n }\n if (!founded){\n res.push(plate);\n };\n })\n }\n // no more filters except 'Other' filter\n if (categoryfilter.length ===1 &&\n categoryfilter[0] === 'Other') return res;\n\n // Add on top of 'Other' filter if it exists\n plates.forEach((plate) => {\n categoryfilter.forEach((filter)=>{\n if (filter in plate.category) {\n res.push(plate)\n return;\n };\n })\n });\n return res = helpers.shuffle(res);;\n }", "title": "" }, { "docid": "7815272ad4711ce5d17e5daea9134074", "score": "0.5491774", "text": "async filterCountry(value, dataType) {\n const weatherArr = await this.checkDataType(dataType)\n const filteredArr = []\n for (let i = 0; i < weatherArr.length; i++) {\n if (\n weatherArr[i]._country._name === value &&\n weatherArr[i]._country._name !== undefined\n ) {\n filteredArr.push(weatherArr[i])\n }\n }\n return filteredArr\n }", "title": "" }, { "docid": "8aa40d199af37d6c8cdbd553d81922d8", "score": "0.5489965", "text": "function mapCrimes(type){ \n\n state.crimes.forEach(function(crime){\n if(type && crime.category != type){return;}\n var location = {lat: Number(crime.location.latitude), lng: Number(crime.location.longitude)}\n var outcome = crime.outcome_status|| \"Not Known\";\n if (outcome != \"Not Known\"){outcome = outcome.category} \n var content = \"Category: \" + crime.category + \"<br> Location: \" + crime.location.street.name + \"<br> Outcome: \" + outcome;\n state.map.addInfoWindow(location, content);\n\n })\n state.map.googleMap.setZoom(14);\n geoFind();\n}", "title": "" }, { "docid": "63b74d2c06c5252e446be6eba5c591b1", "score": "0.54868776", "text": "function filterData(data, city) {\n return data.filter((a) => a.city.toLowerCase() === city);\n}", "title": "" }, { "docid": "c6e7c393f9695760225d36129cf58d1c", "score": "0.548315", "text": "searchDoctorsForAllSpecialties(data) {\n let specialtyArray = [];\n for(let i=0; i < data.data.length; i++) {\n for( let specialties of data.data[i].specialties ) {\n specialtyArray.push(specialties.name);\n }\n }\n return specialtyArray;\n }", "title": "" }, { "docid": "50f09a43014b67f15c744b70f0ca5c56", "score": "0.5479212", "text": "function adddataCrime(crime){\r\n\tvar aux = [\r\n\t\tcrime.latitude, \t\r\n crime.longitude, \t\t\r\n crime.ofns_desc,\t//2 \r\n \"crime\"\t\t\t\t//3 \r\n ];\r\n aux.push( distanceTo(nyus_coord,[ aux[IDX_LAT], aux[IDX_LON] ]) );\t\t//4: distance to nyu \r\n if(aux[4] < max_radio){\r\n CRIMEDATA.push(aux);\r\n }\r\n}", "title": "" }, { "docid": "81f15edba6f833a593b92d1eb991f90f", "score": "0.54693806", "text": "function filter (type, data) {\n removeFilter()\n filterPrices()\n filterStatus()\n $scope.collection.fetch()\n }", "title": "" }, { "docid": "db8c973a6a131ec03d62e567187d5482", "score": "0.54669136", "text": "function negocios(countryData){\nlet newdataNegocios=[];\nlet indicatorNegocios=[];\n\nnewdataNegocios =countryData.indicators.filter(indicators=>\n {\n return indicators.indicatorName.includes(\"mujeres\") && (indicators.indicatorName.includes(\"iniciar\")\n | indicators.indicatorName.includes(\"Independientes\")| indicators.indicatorName.includes(\"propiedad\"))\n })\n\n // función que retorna los nombres de los indicadores para Brasil \"Mujeres y Negocios\"\n for (var i = 0; i < newdataNegocios.length; i++)\n {\n indicatorNegocios.push(newdataNegocios[i].indicatorName)\n\n }\n return indicatorNegocios;\n}", "title": "" }, { "docid": "16460dc595612491315b5e3ba57395da", "score": "0.5463206", "text": "function filterColor(data)\n{\n let displayColors = [];\n let colorRadios = document.getElementsByClassName('colorRadios');\n\n for (var i = 0, length = colorRadios.length; i < length; i++) {\n if (colorRadios[i].checked) {\n displayColors.push(colorRadios[i].value);\n }\n }\n data = data.filter(d => displayColors.includes(d['colorIdentity']));\n\n return data\n}", "title": "" }, { "docid": "7acf30c0e7d45e19d5c3291be1fcc5cf", "score": "0.54610646", "text": "function filterByType(house) {\r\n\r\n function filterType(element) {\r\n\r\n return house === \"all\" || element.house == house;\r\n }\r\n\r\n let filterJson = newArray.filter(filterType);\r\n return filterJson;\r\n \r\n}", "title": "" }, { "docid": "af355d90d17bd559a4f451a9d1304d87", "score": "0.54550284", "text": "function uc2_getFilteredData(data, mutationTypes) {\n\n return data.filter( function(mutation) {\n\n return mutationTypes.map( \n function(t){ \n if(t.from==\"*\" && t.to==\"*\")\n return true;\n if(t.from==\"*\") \n return t.to==mutation.to \n if(t.to==\"*\") \n return t.from==mutation.from \n\n return t.from == mutation.from && t.to==mutation.to \n }\n ).reduce( function(t1,t2){ return t1 || t2 });\n\n\n });\n}", "title": "" }, { "docid": "7234f59cf23214b4c80c66ed3fbd112e", "score": "0.54526246", "text": "function filterForConsumer(dataBrick,consumer) {\n var filteredData=[];\n for(var l = 0; l < dataBrick.length;l++) {\n if (!dataBrick[l].name.search(consumer)) {\n filteredData.push(dataBrick[l]);\n break;\n }\n }\n return filteredData;\n\n}", "title": "" }, { "docid": "8ba6222956e5e973cb534dfe53502211", "score": "0.54445803", "text": "function getFilterDataTypeOnly() {\n\t var sumType = [];\n\t $('.delcheck:checked').each(function(){\n\t sumType.push($(this).data('type'));\n\t $.each(sumType,function(i) {\n\t\t});\n\t //console.log(\"(Control.js)Type: \",sumType);\n\t });\n\t return sumType;\n\t}", "title": "" }, { "docid": "d695c060c1ccbd4aa2af90d96d02c3b0", "score": "0.54383016", "text": "function beginFiltering() {\n // After of filtered the levels then call to filter by Categories\n // First arg is id level, second is the list objects, third message and fourth last register\n getCategory(1, beg, 'Beginner', $('#questionsBeg')[0].dataset.questions);\n getCategory(2, int, 'Intermediate', $('#questionsInt')[0].dataset.questions);\n getCategory(3, adv, 'Advanced', $('#questionsAdv')[0].dataset.questions);\n getCategory(4, eru, 'Erudit', $('#questionsEru')[0].dataset.questions);\n}", "title": "" }, { "docid": "732e60a9e7790e9b02d73870aea1b78f", "score": "0.5422407", "text": "function filterQuestionsByType(response, type) {\n questions = [];\n for (let i = 0; i < response.length; i++) {\n if (response[i].isEssayQuestion == type) {\n questions.push(response[i]);\n }\n }\n return questions;\n }", "title": "" }, { "docid": "5966312c62c47e740e07e0322b4cc6c7", "score": "0.54186493", "text": "static async filterQueries(type, filter){\n let filterKeyword;\n if (type === \"companies\"){\n filterKeyword = `name=${filter}`\n } else if (type === \"jobs\"){\n filterKeyword = `title=${filter}`\n }\n let url = `${type}?${filterKeyword}`\n let res = await this.request(url);\n return res.companies;\n }", "title": "" }, { "docid": "eada3d39bd219ca19faf576937c48b95", "score": "0.5413482", "text": "function washDataClean(data) {\r\n const people = [];\r\n let pairs = { };\r\n\r\n const favourites = FavouriteStore.getCurrentFavourites();\r\n const banned = PeopleSearchDefaults.IGNORED_VALUES;\r\n\r\n data.forEach(function(row) {\r\n pairs = { };\r\n\r\n row.Cells.forEach(function(item) {\r\n // build a new object and store the key and value as an associated pair\r\n if (banned.indexOf(item.Key) === -1) {\r\n pairs[item.Key] = item.Value;\r\n }\r\n });\r\n\r\n // check to see if this person is a favourite\r\n pairs.Favourite = favourites.some(function(item) {\r\n return item.name === pairs.PreferredName;\r\n });\r\n\r\n people.push({\r\n 'Cells': pairs,\r\n });\r\n });\r\n\r\n // we need to check if any of these people are favourites and update accordingly\r\n return people;\r\n}", "title": "" }, { "docid": "7467befaac68b99e692d05632690f21b", "score": "0.540591", "text": "filterFields(data) {\n return data.map((p) => {\n var _a, _b;\n return ({\n flight_number: p.flight_number,\n mission_name: p.mission_name,\n rocket_name: (_a = p.rocket) === null || _a === void 0 ? void 0 : _a.rocket_name,\n rocket_type: (_b = p.rocket) === null || _b === void 0 ? void 0 : _b.rocket_type,\n details: p.details,\n launch_success: p.launch_success,\n });\n });\n }", "title": "" }, { "docid": "6342066b89a39df83595bdfece7d61f6", "score": "0.54026264", "text": "function findFilteredCityData(value) {\n return cityData.filter(item => item.woonplaats.includes(value));\n}", "title": "" }, { "docid": "52cd51bae043bf3c919c9793d66134af", "score": "0.53665924", "text": "function filter(array, type) {\n const filteredArray = array.filter((element) => {\n if (element.type === type) {\n return true;\n }\n return false;\n });\n //if type is \"\" means we are selection option so no need to filter the array\n if (type === \"\")\n return array;\n\n return filteredArray;\n}", "title": "" }, { "docid": "e9fa15864ba6644611a46e7602fa8b88", "score": "0.5365162", "text": "function violencia (countryData){\nlet newdataViolencia =[];\nlet indicatorViolencia =[];\n\nnewdataViolencia = countryData.indicators.filter(indicators=>\n{\nreturn (indicators.indicatorName.includes(\"mujeres\")|indicators.indicatorName.includes(\"Mujeres\")) && (indicators.indicatorName.includes(\"violencia\")\n| indicators.indicatorName.includes(\"casaron\")| indicators.indicatorName.includes(\"golpee\"))\n})\n\n// función que retorna los nombres de los indicadores para Brasil \"Mujeres y violencia\"\nfor (var i = 0; i < newdataViolencia.length; i++)\n{\nindicatorViolencia.push(newdataViolencia[i].indicatorName)\n}\nreturn indicatorViolencia;\n}", "title": "" }, { "docid": "c39bf61faa38a088808bca5cd0b1587c", "score": "0.53544945", "text": "function filter(data) {\n if(!_.isArray(data)) return new Exception(\"Response from upcoming not an array\");\n return _.filter(data,(item)=>{\n return _.contains(interest,item.leagueId);\n });\n}", "title": "" }, { "docid": "e2e1a7429534f419a25d1431511ef913", "score": "0.5352476", "text": "function removeHeroObjects(data) {\n return data.filter(card => card.type !== 'Hero' && card.type !== 'Hero Power')\n}", "title": "" }, { "docid": "887c65837b49c0a75bc9bb76e117e8f5", "score": "0.5343418", "text": "function getFinals(data) {\n const finalsOnly = data.filter(function(specificGame) {\n return specificGame.Stage === 'Final';\n });\n return finalsOnly;\n}", "title": "" }, { "docid": "1e8daee431029c447b17846d538ca7a7", "score": "0.5336901", "text": "function filterByType() {\n var type = this.firstChild.nodeValue.substring(0,this.firstChild.nodeValue.indexOf(' '));\n if (!type) return;\n var localA;\n var stateUL = this.parentNode.parentNode;\n if (stateUL) {\n var as = stateUL.getElementsByTagName('A');\n for (var i = 0; i < as.length; i++) {\n var a = as[i];\n var text = a.firstChild.nodeValue.substring(0,a.firstChild.nodeValue.indexOf(' '));\n a.firstChild.nodeValue = a.firstChild.nodeValue.replace(' *','');\n if (text == type) { localA = a; a.firstChild.nodeValue += ' *' }\n }\n }\n type = type.substring(0,type.length-1).toLowerCase();\n for (var a in animes) {\n var anime = animes[a];\n if (!anime) continue;\n var row = document.getElementById('a'+anime.id);\n if (!row) continue;\n if (type == 'al') { row.style.display = ''; filteredAnimes--; anime.filtered = false; }\n else {\n if (anime.type.toLowerCase().indexOf(type) >= 0) { row.style.display = ''; filteredAnimes--; anime.filtered = false; }\n else { row.style.display = 'none'; filteredAnimes++; anime.filtered = true; }\n }\n }\n curpage = 1; showPage(curpage);\n}", "title": "" }, { "docid": "aea1a45bef692c3b4d12d25d423b70c9", "score": "0.53340876", "text": "function findDataItem() {\r\n // you will find the SINGLE item in \"data\" array that corresponds to \r\n //the USER_SEX (sex), USER_RACESIMP (racesimp), and USER_AGEGRP(agegrp) variable values\r\n \r\n\r\n //HINT: uncomment and COMPLETE the below lines of code\r\n var item = data.filter(function (d) {\r\n return d.sex == USER_SEX && d.racesimp == USER_RACESIMP && d.agegrp == USER_AGEGRP;\r\n \r\n });\r\n\r\n if (item.length == 1) {\r\n return item[0];\r\n }\r\n return null;\r\n\r\n}", "title": "" }, { "docid": "6eb92bdcc26eeb7578ef9421d558e568", "score": "0.53338087", "text": "function filterCats() {\n const onlyCats = allAnimals.filter(isCat);\n displayList(onlyCats);\n}", "title": "" }, { "docid": "9897b135a9b91689ba1bea11c453df77", "score": "0.532849", "text": "filterHeroes(type, filter) {\n \n }", "title": "" }, { "docid": "ef66976a79da02384219168c472526db", "score": "0.53259575", "text": "function getCrimeData() {\n $.ajax({\n url: '/crimes',\n type: 'GET',\n dataType: 'json'\n }).then(drawCrimes);\n }", "title": "" }, { "docid": "a71988db7830b8a4009f3337f6c37d7e", "score": "0.5325242", "text": "getItems(data, type) {\n let mineArray = [];\n\n data.forEach(datarow => {\n datarow.forEach(dataitem => {\n switch (type) {\n case \"mine\":\n if (dataitem.isMine) {\n mineArray.push(dataitem);\n }\n break;\n case \"flag\":\n if (dataitem.isFlagged) {\n mineArray.push(dataitem);\n }\n break;\n case \"hidden\":\n if (!dataitem.isRevealed) {\n mineArray.push(dataitem);\n }\n break;\n default:\n return <h1>Something went wrong.</h1>;\n }\n\n });\n });\n\n return mineArray;\n }", "title": "" }, { "docid": "37ad9ca8bebb830a0f8f534619da3016", "score": "0.53218526", "text": "function filterData(pais, code){//agregue pais como parametro de la función\n\nlet country_indicator = \"\";//variable que s etoma y va cambiando con swith\nswitch (pais) // me permite dar mas indicaciones por cada caso. paises \n{\n case \"WORLDBANK.CHL\": \n country_indicator = window.WORLDBANK.CHL;//si aprietan brasil toma este let\n break;\n case \"WORLDBANK.BRA\": \n country_indicator = window.WORLDBANK.BRA;//si aprietan brasil toma este let\n break;\n case \"WORLDBANK.MEX\": \n country_indicator = window.WORLDBANK.MEX;//si aprietan mexico toma este let\n break;\n case \"WORLDBANK.PER\": \n country_indicator = window.WORLDBANK.PER;//si aprietan peru toma este let\n break; \n default: \n country_indicator = window.WORLDBANK.CHL;// por defecto chile\n}\n\nconst filterChile = Object.entries(country_indicator);//convertir objeto en array\nconst filterCHL= (filterChile[0])[1];//filtrando indicadores\n\nlet arrTime = [];\nlet arrtimeData=[];\n\n\nfor(const index in filterCHL){//recorriendo indicadores\n const filterIndicator= filterCHL[index];//resultado de recorrido\n \n for (let obj in filterIndicator){\n if(filterIndicator.indicatorCode==code){\n \n arrTime.push(filterIndicator[obj])\n \n arrtimeData=arrTime[0];//entrando a la data\n \n \n \n }\n } \n\n}\n return (arrtimeData)\n \n}", "title": "" }, { "docid": "23ed0472ce12ac053e29c6b55ffcf0f3", "score": "0.5318301", "text": "_filterData(){\n // filter Nan's out of data\n this.carsData = this.carsData.filter(function (elem){\n if(!isNaN(parseFloat(elem.Horsepower)) \n && !isNaN(parseFloat(elem.Displacement)) \n && !isNaN(parseFloat(elem.MPG))){\n return elem;\n }\n }) \n }", "title": "" }, { "docid": "21dc247c701cb37bfe64346cf0dd88b2", "score": "0.5305987", "text": "function filterByType(typeValue, array){\n return array.filter((element) => {\n return element.cardType === typeValue;\n })\n }", "title": "" }, { "docid": "df296bedaf7b77fab5935e0d2b61d9d1", "score": "0.52947336", "text": "function logFilter(data)\n{\n\tresult = [];\n\t$.each(data, function(index, row) {\n\t\tif(row.indexOf(0) == -1)\n\t\t\tresult.push(row);\n\t});\n\t\n\treturn result;\n}", "title": "" }, { "docid": "3b62991781df7aad74282e28924fe308", "score": "0.529036", "text": "function getDifficultiesByType(type) {\n var options = [];\n var iDifficulty = 0;\n if(localCategoriesData.currentCategoryData === null) {\n if(type === \"\") {\n iDifficulty = 7;\n }\n else {\n for(var i=0; i<localCategoriesData.localCategories.trivia_categories.length; i++) {\n var item = localCategoriesData.localCategories.trivia_categories[i];\n \n var iTempDifficulty = getDifficultiesByCategory(item, type);\n iDifficulty |= iTempDifficulty;\n if(iDifficulty === 7) break;\n }\n }\n } else {\n iDifficulty = getDifficultiesByCategory(localCategoriesData.currentCategoryData, type);\n }\n //console.log(\"iDifficulty: \"+iDifficulty);\n if((iDifficulty & 1) === 1) options.push(\"easy\");\n if((iDifficulty & 2) === 2) options.push(\"medium\");\n if((iDifficulty & 4) === 4) options.push(\"hard\");\n return options;\n}", "title": "" }, { "docid": "dd95667b780eb35108351e1dd5cbd8b7", "score": "0.5286936", "text": "function filterSearch(data){\n ajaxKopacke(function (kopacke){\n kopacke = kopacke.filter(k=>{\n if(k.naziv.toLowerCase().indexOf(data.toLowerCase()) !== -1){\n return true;\n }\n if(k.markaKop.naziv.toLowerCase().indexOf(data.toLowerCase()) !== -1){\n return true;\n }\n if(k.opis.toLowerCase().indexOf(data.toLowerCase()) !== -1){\n return true;\n }\n });\n ispisCategory(kopacke);\n });\n }", "title": "" }, { "docid": "18695bb82bb660fcdcdf393fca4a6763", "score": "0.52764565", "text": "function filterByCategory(e) {\n fetch(`https://www.themealdb.com/api/json/v1/1/filter.php?c=Seafood\n `)\n .then((res) => res.json())\n .then((data) => {\n console.log(data);\n });\n}", "title": "" }, { "docid": "b7f389ba886143cb60dba2408e6f8c12", "score": "0.5273558", "text": "function filter (type, data) {\n $scope.collection.meta.set(type, data)\n $scope.collection.meta.set('api.options.limit', 1000)\n $scope.collection.fetch().then(function (response) {\n $log.log('response:', response)\n })\n }", "title": "" }, { "docid": "982b90bfa811e026cf5a3faeb306bfd4", "score": "0.5270683", "text": "function filterYours(){\n\t//TODO: fill in!\n}", "title": "" }, { "docid": "b0d8b37296a2c7deac046091c0227468", "score": "0.5269309", "text": "function displayPokemonOfType(type = \"\"){\r\n //reset the display div \r\n const display = document.getElementById(\"pokemon-display\");\r\n display.innerHTML = getTableHeaders();\r\n //add all pokemon of a certain type to the display container\r\n allPokemon.filter(pokemon=>{\r\n [type1,type2] = pokemon.types;\r\n return (type1.type.name.toLowerCase() === type.toLowerCase() ||\r\n (type2 != null && type2.type.name.toLowerCase() === type.toLowerCase()))\r\n }).forEach(pokemon=>{\r\n addPokemonToDisplayListForm(pokemon);\r\n });\r\n display.innerHTML += \"</table>\"\r\n}", "title": "" }, { "docid": "1e542c674553603cb382a96bbe7135d2", "score": "0.525709", "text": "function applyFilter(currentType) {\n $(\".dishes\").empty();\n restGet(TEXT_HOST + '/dishes/query/?shopId=' + restaurantId, GET_METHOD,\n function(data) {\n $.each(data, function(i, dish) {\n if (currentType == \"All\" || dish.type == currentType) {\n appendDish(dish);\n }\n });\n }, '.dishes');\n}", "title": "" }, { "docid": "774a9a2d1cfb3d45d6f8d6844e40a8d8", "score": "0.52570105", "text": "function showMillionaires() {\n data = data.filter((user) => user.money > 1000000);\n\n updateDOM();\n}", "title": "" }, { "docid": "5fbd677c4b7e1fdbf209c12db0e5d235", "score": "0.52553964", "text": "function filterProfils(search, searchOthers)\n{\n\tlet profils = searchOthers;\n\tif (search.filter.sex)\n\t{\n\t\tprofils = searchOthers.filter(e => {\n\t\t\tif (search.sexpref === 'bi')\n\t\t\t\treturn (e.gender === 'male' || e.gender === 'female')\n\t\t\telse\n\t\t\t\treturn (e.gender === search.sexpref)\n\t\t}).filter(f => {\n\t\t\tif (search.gender === 'male')\n\t\t\t\treturn (f.sexpref === 'bi' || f.sexpref === 'male');\n\t\t\telse if (search.gender === 'female')\n\t\t\t\treturn (f.sexpref === 'bi' || f.sexpref === 'female');\n\t\t\telse\n\t\t\t\treturn (f.sexpref === 'other');\n\t\t});\n\t}\n\tif (search.filter.age)\n\t\tprofils = profils.filter(e => (e.age >= search.ageMin && e.age <= search.ageMax))\n\tif (search.filter.local)\n\t\tprofils = profils.filter(e => (distanceKm(e.latitude, e.longitude,\n\t\t\tsearch.lat, search.lon) <= search.localMax))\n\tif (search.filter.popular)\n\t\tprofils = profils.filter(e => (e.popular >= search.popularMin && e.popular <= search.popularMax))\n\tif (search.filter.tags)\n\t\tprofils = profils.filter(e => (search.tags.map(e => (e.name_interest)).every(f => (e.interest.includes(f)))))\n\tif (search.filter.search && search.filter.search.bool === true\n\t\t&& search.filter.search.val)\n\t{\n\t\tif (/^[a-zA-Z]+$/.test(search.filter.search.val))\n\t\t{\n\t\t\tlet regexp = new RegExp(search.filter.search.val, 'i');\n\t\t\tprofils = profils.filter(e => (e.username.match(regexp)\n\t\t\t\t|| e.firstname.match(regexp)))\n\t\t}\n\t}\n\treturn (profils);\n}", "title": "" }, { "docid": "eba0e4072507a124995df940e809b733", "score": "0.52538633", "text": "async function FilterData (data) {\n let returnVal = data;\n\n // Filter duplicate friends https://stackoverflow.com/questions/2218999/remove-duplicates-from-an-array-of-objects-in-javascript\n returnVal.payload.friends = returnVal.payload.friends.filter((entry, index) => {\n let stringEntry = JSON.stringify(entry);\n return index === returnVal.payload.friends.findIndex((item) => {\n return stringEntry === JSON.stringify(item)\n });\n })\n\n // Filter person = friend\n returnVal.payload.friends = returnVal.payload.friends.filter((entry) => {\n return entry.id !== returnVal.payload.id;\n })\n return returnVal;\n}", "title": "" }, { "docid": "f3efddec4541722cb874acc3b6aa5a27", "score": "0.5248072", "text": "searchDoctorJSONForSpecialty(data, specialty) {\n let array = [];\n for(let i=0; i < data.data.length; i++) {\n try {\n if (data.data[i].specialties[0].name === specialty) {\n array.push(data.data[i]);\n }\n } catch(error) {\n console.error(`Error: ${error.message}`);\n }\n }\n return array;\n }", "title": "" }, { "docid": "b4720bd7500b95c165dfd9065542f435", "score": "0.5243797", "text": "function getData(canton) {\n var data = selectedData.results.filter(function(element){\n if(element.canton == canton) {\n return element;\n }\n });\n return data[0];\n}", "title": "" }, { "docid": "a9ce320087690115834aee9ff42181ba", "score": "0.52403724", "text": "function filterForPh(dataBrick) {\n var filteredData=[];\n for(var l = 0; l < dataBrick.length;l++) {\n if (!dataBrick[l].name.search(\"PH1\") || !dataBrick[l].name.search(\"PH2\") || !dataBrick[l].name.search(\"PH3\")) {\n filteredData.push(dataBrick[l]);\n }\n }\n return filteredData;\n\n}", "title": "" }, { "docid": "64d64755320d1418ebf469ff8a429d24", "score": "0.5233508", "text": "function getLinkTypes(data) {\n\t\tvar linkTypes = []\n\t\tvar max = data.links.length - 1\n\n\t\tfor (var n = 0; n <= max; n++) {\n\t\t\t// console.log(data.links[n].tr_age)\n\t\t\tif (linkTypes.indexOf(data.links[n].tr_age) == -1) {\n\t\t\t\tlinkTypes.push(data.links[n].tr_age)\n\t\t\t}\n\t\t}\n\t\treturn linkTypes\n\t}", "title": "" }, { "docid": "386ae558a598f9d9164da0c2b545aed7", "score": "0.5232646", "text": "function gotData(data){\n console.log(data);\n\n\n\n//preliminary functions\n\nfunction getRandomIntInclusive(min, max) {\n min = Math.ceil(200);\n max = Math.floor(650);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive\n}\n\nfunction getIndex(d,i){\n return xScale(d.index);\n}\n\nfunction getColor(d,i){\n if (d.income == \"Low income\"){\n return (\"#f2e4e0\")\n }else if (d.income == \"Upper middle income\" || d.income == \"Lower middle income\"){\n return (\"#f6b89e\")\n }else if (d.income == \"High income\"){\n return (\"#ff5f56\")\n }\n}\n\n\nlet year2009 = data.filter(function(d){\n if (d.year == 2009){\n return true;\n }else{\n return false;\n }\n})\n\nlet year2010 = data.filter(function(d){\n if (d.year == 2010){\n return true;\n }else{\n return false;\n }\n})\n\n\nlet year2011 = data.filter(function(d){\n if (d.year == 2011){\n return true;\n }else{\n return false;\n }\n})\n\n\nlet year2012 = data.filter(function(d){\n if (d.year == 2012){\n return true;\n }else{\n return false;\n }\n})\n\n\nlet year2013 = data.filter(function(d){\n if (d.year == 2013){\n return true;\n }else{\n return false;\n }\n})\n\n\nlet year2014 = data.filter(function(d){\n if (d.year == 2014){\n return true;\n }else{\n return false;\n }\n})\n\n\nlet year2015 = data.filter(function(d){\n if (d.year == 2015){\n return true;\n }else{\n return false;\n }\n})\n\n\n\nlet year2016 = data.filter(function(d){\n if (d.year == 2016){\n return true;\n }else{\n return false;\n }\n})\n\n\nlet year2017 = data.filter(function(d){\n if (d.year == 2017){\n return true;\n }else{\n return false;\n }\n})\n\nlet year2018 = data.filter(function(d){\n if (d.year == 2018){\n return true;\n }else{\n return false;\n }\n})\n\n\n//FILTER: REGION\n\nlet southAsia = year2018.filter(function(d){\n if (d.region == 'South Asia'){\n return true;\n }else{\n return false;\n }\n})\n\nlet europe = year2018.filter(function(d){\n if (d.region == 'Europe & Central Asia'){\n return true;\n }else{\n return false;\n }\n})\n\nlet mena = year2018.filter(function(d){\n if (d.region == 'Middle East & North Africa'){\n return true;\n }else{\n return false;\n }\n})\n\nlet africa = year2018.filter(function(d){\n if (d.region == 'Sub-Saharan Africa'){\n return true;\n }else{\n return false;\n }\n})\n\nlet caribbean = year2018.filter(function(d){\n if (d.region == 'Latin America & Caribbean'){\n return true;\n }else{\n return false;\n }\n})\n\nlet oecd = year2018.filter(function(d){\n if (d.region == 'High income: OECD'){\n return true;\n }else{\n return false;\n }\n})\n\nlet eastAsia = year2018.filter(function(d){\n if (d.region == 'East Asia & Pacific'){\n return true;\n }else{\n return false;\n }\n})\n\n//x axis\n\n xPadding = 30;\n\n let xScale = d3.scaleLinear().domain([0,100]).range([xPadding,w-xPadding]);\n\n let xAxis = d3.axisBottom(xScale);\n let xAxisGroup = viz.append(\"g\").attr(\"class\", \"xaxis\");\n xAxisGroup.call(xAxis);\n\n let xAxisYPos = h - 30;\n xAxisGroup.attr(\"transform\", \"translate(0, \"+ xAxisYPos +\")\");\n\n//y axis\n\n let yScale = d3.scaleLinear().domain([]).range([xPadding, h-xPadding]);\n\n let yAxis = d3.axisLeft(yScale);\n let yAxisGroup = viz.append(\"g\").attr(\"class\", \"yaxis\");\n yAxisGroup.call(yAxis);\n yAxisGroup.attr(\"transform\", \"translate(\" + xPadding + \", 0)\")\n\n\n//group to hold the graph\nlet graphGroup = viz.append(\"g\").classed(\"graphGroup\", true);\n\n//the tricky part of dealing with the data\nlet theSituation = graphGroup.selectAll(\".datapoint\").data(year2009);\n console.log(\"the full situation: \", theSituation);\n\nlet enteringElements = theSituation.enter();\nlet exitingElements = theSituation.enter();\n\nlet dataGroups = enteringElements.append(\"g\").classed(\"datapoint\", true);\n\ndataGroups.append(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n\n//VISUALIZING THE AVERAGE INDEX SCORES FOR EVERY COUNTRY BY YEAR\n\n\n function visualize2009 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2009);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n\n function visualize2010 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2010);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n\n function visualize2011 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2011);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n function visualize2012 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2012);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n function visualize2013 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2013);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n function visualize2014 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2014);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n function visualize2015 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2015);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n function visualize2016 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2016);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n function visualize2017 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2017);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n function visualize2018 (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(year2018);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\n exitingDataGroups = theSituation.exit();\n\n\n }\n\n// VISUALIZE BY REGIONS\n\nfunction visualizeSouthAsia (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(southAsia);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\nexitingDataGroups = theSituation.exit();\n\n\n}\n\nfunction visualizeEurope (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(europe);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\nexitingDataGroups = theSituation.exit();\n\n\n}\n\nfunction visualizeMiddleEastNorthAfrica (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(mena);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\nexitingDataGroups = theSituation.exit();\n\n\n}\n\n\n\nfunction visualizeAfrica (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(africa);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\nexitingDataGroups = theSituation.exit();\n\n\n}\n\nfunction visualizeCaribbean (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(caribbean);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\nexitingDataGroups = theSituation.exit();\n\n\n}\n\nfunction visualizeOECD (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(oecd);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\nexitingDataGroups = theSituation.exit();\n\n\n}\n\nfunction visualizeeastAsia (data){\n\n theSituation = graphGroup.selectAll(\".datapoint\").data(eastAsia);\n console.log (\"the NEW full situation: \", theSituation);\n\n enteringElements = theSituation.enter();\n exitingElements = theSituation.exit();\n\n theSituation.select(\"circle\")\n .attr(\"r\", 10)\n .attr(\"cx\", getIndex)\n .attr(\"cy\", getRandomIntInclusive)\n .attr(\"fill\", getColor)\n .attr(\"stroke\", \"black\")\n\n\n let exitingDataGroups = exitingElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n ;\n\nexitingDataGroups = theSituation.exit();\n\n\n}\n\n\ndocument.getElementById('buttonA').addEventListener(\"click\", visualize2009);\ndocument.getElementById('buttonB').addEventListener(\"click\", visualize2010);\ndocument.getElementById('buttonC').addEventListener(\"click\", visualize2011);\ndocument.getElementById('buttonD').addEventListener(\"click\", visualize2012);\ndocument.getElementById('buttonE').addEventListener(\"click\", visualize2013);\ndocument.getElementById('buttonF').addEventListener(\"click\", visualize2014);\ndocument.getElementById('buttonG').addEventListener(\"click\", visualize2015);\ndocument.getElementById('buttonH').addEventListener(\"click\", visualize2016);\ndocument.getElementById('buttonI').addEventListener(\"click\", visualize2017);\ndocument.getElementById('buttonJ').addEventListener(\"click\", visualize2018);\n\n\n\ndocument.getElementById('buttonK').addEventListener(\"click\", visualizeSouthAsia);\ndocument.getElementById('buttonL').addEventListener(\"click\", visualizeEurope);\ndocument.getElementById('buttonM').addEventListener(\"click\", visualizeMiddleEastNorthAfrica);\ndocument.getElementById('buttonN').addEventListener(\"click\", visualizeAfrica);\ndocument.getElementById('buttonO').addEventListener(\"click\", visualizeCaribbean);\ndocument.getElementById('buttonP').addEventListener(\"click\", visualizeOECD);\ndocument.getElementById('buttonQ').addEventListener(\"click\", visualizeeastAsia);\n\n\n\n\n// scrolling event listener\n// you might move this block into the part of your code\n// in which your data is loaded/available\nlet previousSection;\nd3.select(\"#textboxes\").on(\"scroll\", function(){\n // the currentBox function is imported on the\n // very fist line of this script\n currentBox(function(box){\n console.log(box.id);\n\n if(box.id==\"six\" && box.id!=previousSection){\n console.log(\"changing viz\");\n\n visualize2009 ();\n\n\n previousSection = box.id;\n }else if (box.id==\"seven\" && box.id!=previousSection){\n console.log(\"changing viz\");\n\n visualizeSouthAsia ();\n\n previousSection = box.id;\n }\n\n })\n})\n\n\n\n\n}", "title": "" }, { "docid": "1b28eb7c1839ece8ea00a1048d3b685b", "score": "0.52244526", "text": "filterByDate(data){\n let today = new Date();\n let dd = today.getDate();\n let mm = today.getMonth()+1;\n let yyyy = today.getFullYear();\n\n if(dd<10) {\n dd='0'+dd\n }\n\n if(mm<10) {\n mm='0'+mm\n }\n\n today = yyyy+'-'+mm+'-'+dd;\n let filteredData = [];\n\n for(var prop in data) {\n let obj = data[prop];\n let date = parseDate(obj.electionDate);\n let todayParsed = parseDate(today);\n\n //Filter dates from today moving forward or President...\n if (obj.electionOffice == 'President' || date > todayParsed){\n filteredData.push(obj);\n }\n }\n\n function parseDate(dateStr) {\n let date = dateStr.split('-');\n let day = date[2];\n let month = date[1] - 1; //January = 0\n let year = date[0];\n return new Date(year, month, day);\n }\n return filteredData;\n }", "title": "" }, { "docid": "9a0d1fcfdf7dd73a7d07cd1d9613319a", "score": "0.522095", "text": "function filterPokemon(arrayPokemones, paramFilter) {\n let arrFiltrado = []\n arrayPokemones.forEach(element => {\n if (element.type.includes(paramFilter)) {\n arrFiltrado.push(element)\n }\n })\n return arrFiltrado\n}", "title": "" }, { "docid": "5ec65982e073aafa0936b93771d60c7e", "score": "0.52188146", "text": "function getFuelTypeCategories() {\n var categories = [];\n for (x in datasetFuelType) {\n categories.push(x);\n }\n return categories;\n}", "title": "" }, { "docid": "5dd1ac09fee2183bb2a6accfce48b74c", "score": "0.52114433", "text": "function sezonLokasyonFiltrele(kanton,sezon){ \nlet lokasyonBazli=[];\nfishFarm.filter(c => { \n if (c.saleLocations.includes(kanton) && c.season.includes(sezon)) {\n lokasyonBazli.push(c.fishType);\n }\n});\nreturn lokasyonBazli;\n}", "title": "" }, { "docid": "9e7700da281d64f96a22093ff3aeaa88", "score": "0.52012485", "text": "function getCategories() {\n return ($scope.chosenBeverageType || [])\n .map( (beverage) => beverage.category)\n .filter((elem, pos, arr) => arr.indexOf(elem) === pos);\n }", "title": "" }, { "docid": "84504598707c1a0fedf56a3064019855", "score": "0.519746", "text": "function _filterData(data, filterFn){\n return _.filter(data, filterFn);\n }", "title": "" }, { "docid": "25408c20e4a4484c958c279f1423f56e", "score": "0.5193957", "text": "function getCarInfo(carsArr,type){\n return carsArr.filter(function(car){\n return car.type === type;\n });\n}", "title": "" }, { "docid": "d9f0610719264073415b7d757a07200a", "score": "0.5187166", "text": "function getCrimes(){\r\n const URL = \"https://data.cityofnewyork.us/resource/9s4h-37hy.json?$select= boro_nm, ofns_desc, lat_lon, CMPLNT_FR_DT&$where=cmplnt_fr_dt=\\\"2015-12-31T00:00:00.000\\\" AND lat_lon IS NOT NULL &$limit=40000\";\r\n\tvar data = $.get(URL)\r\n\t\t.done(function(){\r\n var json = data.responseJSON;\r\n for (var i = 0; i < json.length; i++) {\r\n crimes.push(json[i]);\r\n }\r\n\t\t})\r\n\t\t.fail( function(error){\r\n\t\t\tconsole.error(error);\r\n\t\t})\r\n}", "title": "" }, { "docid": "8a554afab02cb062da7821aa13db310d", "score": "0.51870555", "text": "function FilterByAccNum() {\r\n Name = \"Alice\";\r\n var res = acctData.filter(function(test) {\r\n return test.user == Name;\r\n });\r\n console.log(res);\r\n}", "title": "" }, { "docid": "55342da66daa76082458b291e86ba7bd", "score": "0.5183572", "text": "function apply_filter(data)\n{\n for(let favorite of data.favorites)\n {\n favorite[\"@ignore\"] = false;\n if (active_tags.length && !have_all(favorite.tags, active_tags))\n favorite[\"@ignore\"] = true;\n }\n return data;\n}", "title": "" }, { "docid": "6400738b6a8644e02acc7f329565bb47", "score": "0.517771", "text": "getFilteredData(data){\n for(let i=0; i<data.length; i++){\n if(data[i].avatar_large){\n this.filteredData.push(data[i]);\n }\n }\n return this.filteredData;\n }", "title": "" }, { "docid": "ea75601deed33ffd9e7a7dc9af141e7f", "score": "0.5171355", "text": "async function filterByType(type){\r\n var pokemon = document.getElementById('grid').children;\r\n $(pokemon).remove(); //clear list to have empty grid\r\n await getData(); //repopulate list (and wait until process is done)\r\n //filter\r\n for(var i=0; i<pokemon.length; i++){\r\n if(!pokemon[i].classList.contains(type)){\r\n $(pokemon[i]).remove();\r\n i--;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "641ee7d65a0a17c0faa8028ce3a6dcd7", "score": "0.5166358", "text": "function listAllFemaleCoders (users) {\n const femaleCoders = users.filter((coder) => {\n if (coder.gender === 'f') {\n return coder.name;\n }\n });\n console.log(femaleCoders)\n return femaleCoders;\n}", "title": "" }, { "docid": "758d50dbd61fe830f212c1822490dac1", "score": "0.5165159", "text": "function filterData(data) {\n\t\n\tvar filter = $(\"#filtering .active\").attr('id');\n\n\tif (filter === 'show-all') {\n\t\tsortData(data);\n\t} else {\n\t\tdata = data.filter(function(el) { \n\t\t\treturn el.status === filter; })\n\t\tsortData(data);\n\t}\n}", "title": "" }, { "docid": "758d50dbd61fe830f212c1822490dac1", "score": "0.5165159", "text": "function filterData(data) {\n\t\n\tvar filter = $(\"#filtering .active\").attr('id');\n\n\tif (filter === 'show-all') {\n\t\tsortData(data);\n\t} else {\n\t\tdata = data.filter(function(el) { \n\t\t\treturn el.status === filter; })\n\t\tsortData(data);\n\t}\n}", "title": "" }, { "docid": "8cfc44efa9dae9df501f275d35473d13", "score": "0.51648754", "text": "function filterRoleDesktop (event){\n let role = event.target.value;\n //const classify = datos.filter(rol => rol['tags'].includes(role));\n let changeViewData = filterData (datos, role);\n if (role === 'All') {\n getData (datos)\n }else{\n getData (changeViewData)\n }\n console.log(changeViewData)\n}", "title": "" }, { "docid": "c931b7eecd393ae2d3502ae7230a845b", "score": "0.51517165", "text": "function filterData(data, field, compare) {\n if(compare !== \"\") {\n return data.filter(function(ufo) {\n if (ufo[field] === compare) {\n return true;\n }\n });\n }\n return data;\n}", "title": "" }, { "docid": "a0e85cc1a9b0fb3682ec5a395a94e931", "score": "0.51514393", "text": "function objectData(data) {\n let obj = []\n let birthday = data.map((d)=>{\n\n if(parseInt(d.birthday.split('-')[2]) < 1990)\n {\n obj.push(d)\n }\n });\n return obj; \n }", "title": "" }, { "docid": "a4e2c1c33e2c43f416d058c5e70edde1", "score": "0.51513773", "text": "function peopleWhoBelongToTheIlluminati(arr) {\n return arr.filter(a => a.member)\n}", "title": "" }, { "docid": "c6e0f140ef23f3a722deeb9a64652dec", "score": "0.5146409", "text": "function makeArray(dataset, sex, race){\n dataList = [];\n for (object in dataset){\n if (dataset[object].sex == sex && dataset[object].race == race){\n dataList.push(dataset[object])\n }\n }\n return dataList;\n}", "title": "" }, { "docid": "e1c74c75668816f73beb59474b6550d2", "score": "0.5138643", "text": "function getCoats(shirtFinal, coats, weather, style, badColors){\n coatsArr = []\n nocoat = {image:''}\n for(var i in coats){\n if(weather === 'warm' || weather === 'hot'){\n coatsArr.push(nocoat)\n return coatsArr\n }\n else if (coats[i].weather.indexOf(weather) !== -1 && coats[i].style.indexOf(style) !== -1){\n if(badColors[shirtFinal.color].indexOf(coats[i].color) === -1){\n coatsArr.push(coats[i])\n }\n }\n }\n return coatsArr\n}", "title": "" }, { "docid": "e1f0574fa9aae41cbebbc89aff7aadf0", "score": "0.51311487", "text": "function filterFromBubble(info) {\n\n var filtered = [], dateData = [], barData = [], listDict = {}, listData = [];\n\n if(info[0] === \"unit\") {\n //console.log(info[1]);\n \n if(info[1] === \"Cornell Johnson College of Business\") {\n info[1] = \"Cornell SC Johnson College of Business\";\n }\n\n /* Filter original data. */\n for (let obj of originalJournalData) {\n if((obj.unit).toLowerCase() === info[1].toLowerCase()) { \n filtered.push(obj); \n\n if(dateData[obj.year]) { dateData[obj.year]++; } else { dateData[obj.year] = 1; }\n\n if(listDict[obj.journal]) { listDict[obj.journal]++; } else { listDict[obj.journal] = 1; }\n\n }\n }\n\n /* Process bar graph data. */ \n for (var i = 1965 ; i < 2018 ; i++) {\n tmp = {\"date\":String(i)+\"-03-02T00:00:00-05:00\" , \"value\": dateData[String(i)]}\n barData.push(tmp);\n }\n\n /* Process list graph data. */\n sortListData = sortByValue(listDict);\n for (let entry of sortListData) {\n tmp = {\"journal\":entry , \"count\": listDict[entry]}\n listData.push(tmp);\n }\n\n return {\"barData\":barData, \"listData\":listData};\n\n }\n\n}", "title": "" }, { "docid": "1ea5d516eccf9b8c765eb6227459c29b", "score": "0.51302725", "text": "getCategory() {\n const categories = Object.values(recipes).map((recipe) =>\n recipe.Course.toLowerCase()\n );\n return categories.filter((a, b) => categories.indexOf(a) === b);\n }", "title": "" }, { "docid": "72e59f74af1fd575eefc1f5571b59e28", "score": "0.5124824", "text": "function filterData(state) {\n if (state.selectedFeature === \"All\") {\n draw(state.data, '#ffffff00');\n } else {\n state.filteredData = state.data.filter(d => d.Feature_Type === state.selectedFeature);\n draw(state.filteredData, '#ffffff30');\n }\n}", "title": "" }, { "docid": "2dcc078ca2354b961f8a7c663c00eecb", "score": "0.5123053", "text": "filter(type) {\r\n const results = [];\r\n for (const key in this._container) {\r\n const ware = this._container[key];\r\n if (ware.cycleType === _1.CycleType.None)\r\n continue;\r\n if (ware.cycleType === type)\r\n results.push(ware);\r\n }\r\n return results;\r\n }", "title": "" } ]
1d9ea7c7180cfb290b31806346c30aa2
second form input value for weekly target
[ { "docid": "e10eb0186ce555a72d10ce229172010b", "score": "0.6024794", "text": "function addWeeklyTotal(userWeeklyTarget1) {\n\tconsole.log(userWeeklyTarget1);\n\tdocument.querySelector('#target').innerText = userWeeklyTarget1;\n\treturn userWeeklyTarget1;\n}", "title": "" } ]
[ { "docid": "a46bd98b5752074451b72da30bbce3f3", "score": "0.6516652", "text": "function updateForm(userData) {\n //calculate current week from user profile.startDate\n var startDate = new Date(userData.StartDate);\n var currentDate = new Date();\n weeksSinceStart = (Math.round((currentDate - startDate) / (7 * 24 * 60 * 60 * 1000)))+1;\n document.getElementById(\"week-number\").value = weeksSinceStart;\n}", "title": "" }, { "docid": "25fd03f318d8b522cf4c7753443d90cf", "score": "0.57882345", "text": "function addAnotherPowerValue() {\n\t\tvar form = document.getElementsByClassName(\"form-group\");\n\t\tvar p = document.createElement(\"p\");\n\t\tvar l = document.createElement(\"label\");\n\t\tvar node = document.createTextNode(\"Power reading (in Watts): \");\n\t\tl.appendChild(node);\n\t\tp.appendChild(l);\n\t\tvar input = document.createElement(\"input\");\n\t\tinput.type = \"number\";\n\t\tinput.name = \"power\";\n\t\tinput.className = \"form-control\";\n\t\tinput.step = \"any\";\n\t\tinput.min = \"0\";\n\t\tinput.required = true;\n\t\tp.appendChild(input);\n\t\tform[0].appendChild(p);\n\t}", "title": "" }, { "docid": "874ff3a9b7dbc939258ba299954f27d1", "score": "0.5724235", "text": "function sliderDays(e) {\r\n var days = e.value;\r\n document.getElementById(\"time-unit-days\").value = days;\r\n potentialPayout();\r\n}", "title": "" }, { "docid": "4dd5a1c2f8621c403e4ee1b5a0404549", "score": "0.5668558", "text": "function costReworkCal() {\n $('#id_rework_external_time').on('input', function(){\n $('#rework_external_cost').val(this.value * 50);\n });\n}", "title": "" }, { "docid": "5b8912506ded1911e8a9cc3c3298ea05", "score": "0.56611025", "text": "function high_pull_deductor() {\n var sets = document.getElementById(\"high_pull_sets\").value;\n var reps = document.getElementById(\"high_pull_reps\").value;\n var high_pull = 3;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((high_pull * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"High pull\" + \" - \" + sets + \" sets \" + reps + \" reps\\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "95ae97158176bbbdf1b9116cbeecd9d8", "score": "0.55998194", "text": "function backOneWeekButtonClicked() {\n weekStartDateInput.valueAsDate = moment(weekStartDateInput.valueAsDate).subtract(7, \"days\").toDate();\n fillButtonDiv();\n// TODO change, then update, select first\n selectToday();\n\n}", "title": "" }, { "docid": "122dc90e44adf76d7a56f348dee3cc31", "score": "0.5595837", "text": "updateStartDate(){\n var startWeek = document.getElementById(\"start-week\");\n var startDate = document.getElementById(\"start-date\");\n \n startDate.value = util.getWeekDateRange(startWeek.value.split(\"-W\")[0], startWeek.value.split(\"-W\")[1]).startDate;\n }", "title": "" }, { "docid": "43354b503ccd5481dd3d8836bc1a4cf6", "score": "0.5552621", "text": "function timeOnSite() {\n timeonsite += 1;\n $('input[name=a_time_on_site]').val(timeonsite);\n }", "title": "" }, { "docid": "a041bb24c7ede7caebf681dfb2f49451", "score": "0.5530454", "text": "function toggleSelect(event) {\n //remove all classes .active\n document.querySelectorAll('.button-select button')\n .forEach(button => button.classList.remove('active'));\n\n //put class .active\n const button = event.currentTarget;\n button.classList.add('active');\n\n //refresh hidden input w/ value selected\n const input = document.querySelector('[name=\"open_on_weekends\"]');\n\n //get and data-value\n input.value = button.dataset.value;\n console.log(input);\n\n}", "title": "" }, { "docid": "818eaf9d03d9adea90a36a6142454cef", "score": "0.55158514", "text": "function press_up_deductor() {\n var sets = document.getElementById(\"press_up_sets\").value;\n var reps = document.getElementById(\"press_up_reps\").value;\n var press_up = 1;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((press_up * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Press up\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "e2588f9aba2db587c83b0b4f4c6ef47b", "score": "0.55127937", "text": "function weekNum() {\n var inputWeekNum = document.getElementById(\"inputWeekNumber\").value;\n var outputWeekNum = document.getElementById(\"outputWeekNumber\");\n switch (inputWeekNum) {\n case \"1\":\n outputWeekNum.innerHTML = `${inputWeekNum} is Monday`\n break;\n\n case \"2\":\n outputWeekNum.innerHTML = `${inputWeekNum} is Tuesday`\n break;\n\n case \"3\":\n outputWeekNum.innerHTML = `${inputWeekNum} is Wednesday`\n break;\n\n case \"4\":\n outputWeekNum.innerHTML = `${inputWeekNum} isThursday`\n break;\n\n case \"5\":\n outputWeekNum.innerHTML = `${inputWeekNum} is Friday`\n break;\n\n case \"6\":\n outputWeekNum.innerHTML = `${inputWeekNum} is Saturday`\n break;\n\n case \"7\":\n outputWeekNum.innerHTML = `${inputWeekNum} is Sunday`\n break;\n\n default:\n outputWeekNum.innerHTML = `enter week number please`\n break;\n }\n}", "title": "" }, { "docid": "57c7ca996642117135183ae756af117c", "score": "0.5508", "text": "function inputDays() {\r\n var days = document.getElementById(\"time-unit-days\").value\r\n document.getElementsByClassName(\"calc-range__time__slider\")[0].value = days;\r\n initRangeColorTooltip()\r\n potentialPayout();\r\n}", "title": "" }, { "docid": "65b8568a1a4f2527a72fa9c9e5d952c3", "score": "0.5498057", "text": "function getInputFoodPrice() {\n \n var oneWeekFood = document.getElementsByName('input2').value = 899.99;\n \n if ('input1' !== 'input2') {\n\n document.getElementById('totalPrice2').innerHTML = \"Selected One Week Meals $\" + oneWeekFood.toFixed(2) + \"<br>\" + \"Total Amount Due: $\" + (oneWeekFood + 2289.99).toFixed(2);\n } else\n \n document.getElementById('totalPrice2').innerHTML = \"Selected One Week Meals $\" + oneWeekFood.toFixed(2);\n \n}", "title": "" }, { "docid": "80b04319cf2fbb3304b0dc01e76f25d8", "score": "0.5492639", "text": "function getInputValue(){\n \tvar age=parseInt(document.getElementById('age').value);\n var maxAge=parseInt(document.getElementById('maxAge').value);\n var food=document.getElementById('food').value;\n var foodPerDay=parseFloat(document.getElementById('foodPerDay').value);\n \tcalcSupply(age, maxAge, food, foodPerDay);\n }", "title": "" }, { "docid": "09d3b1eda2503ac86803b722d7289917", "score": "0.547804", "text": "function toggleSelect (event) {\n //remove .active class from both buttons\n document.querySelectorAll('.button-select button')\n .forEach(function(button){\n button.classList.remove(\"active\");\n })\n //put the .active class\n const button = event.currentTarget\n button.classList.add(\"active\")\n //update my hidden input with the selected value\n const input = document.querySelector('[name=\"open_on_weekends\"]') \n //verify if the button is yes or no\n input.value = button.dataset.value\n}", "title": "" }, { "docid": "4b05bbb9f10bba98e2dd2e4743324c54", "score": "0.54747933", "text": "function bench_press_deductor() {\n var sets = document.getElementById(\"bench_press_sets\").value;\n var reps = document.getElementById(\"bench_press_reps\").value;\n var bench_press = 3;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((bench_press * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Bench Press\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "8ffd975204a6b5c60fd568add63b6cf7", "score": "0.5442129", "text": "function leg_press_deductor() {\n var sets = document.getElementById(\"leg_press_sets\").value;\n var reps = document.getElementById(\"leg_press_reps\").value;\n var leg_press = 3;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((leg_press * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Leg Press\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "eccb1ec1a58d1e1c6ae757ba6214df5d", "score": "0.543537", "text": "updateEndDate(week){\n var endWeek = document.getElementById(\"end-week\");\n var endDate = document.getElementById(\"end-date\");\n var startWeek = document.getElementById(\"start-week\");\n var startDate = document.getElementById(\"start-date\");\n\n endDate.value = util.getWeekDateRange(endWeek.value.split(\"-W\")[0], endWeek.value.split(\"-W\")[1]).endDate;\n\n if (startWeek.value == \"\") {\n startWeek.value = endWeek.value;\n startDate.value = util.getWeekDateRange(startWeek.value.split(\"-W\")[0], startWeek.value.split(\"-W\")[1]).startDate;\n }\n }", "title": "" }, { "docid": "cc711f972a694554d7efe3c132ddee50", "score": "0.5422154", "text": "function setEndRunOnForm(thisRun) {\n document.getElementById(\"endRunInput\").value=thisRun;\n\n}", "title": "" }, { "docid": "3a27dfb38c7fa18ab4be23fff5fbf85d", "score": "0.5419276", "text": "function showSelectedWeek(field, action, view){\n\tvar currentvalue = document.getElementById(field).value;\n\tvar sign = currentvalue.substr(0,1);\n\tvar finalvalue = \"\";\n\tvar number = new Number(currentvalue.substr(2,currentvalue.length));\n\t\n\tif(sign == \"a\" && action == \"a\"){\n\t\tnumber = number + 1;\n\t\tfinalvalue = \"a \"+number;\n\t\n\t} else if(sign == \"a\" && action == \"s\"){\n\t\tif(number > 0){\n\t\t\tnumber = number - 1;\n\t\t\tfinalvalue = \"a \"+number;\n\t\t} else {\n\t\t\tnumber = 1;\n\t\t\tfinalvalue = \"s \"+number;\n\t\t}\n\t\n\t} else if(sign == \"s\" && action == \"a\"){\n\t\tif(number > 0){\n\t\t\tnumber = number - 1;\n\t\t\tfinalvalue = \"s \"+number;\n\t\t} else {\n\t\t\tnumber = 1;\n\t\t\tfinalvalue = \"a \"+number;\n\t\t}\n\t\t\n\t} else if(sign == \"s\" && action == \"s\"){\n\t\tif(number > 0){\n\t\t\tnumber = number + 1;\n\t\t\tfinalvalue = \"s \"+number;\n\t\t} else {\n\t\t\tnumber = 1;\n\t\t\tfinalvalue = \"s \"+number;\n\t\t}\n\t}\n\t\n\tdocument.getElementById(field).value = finalvalue;\n\tif(view == \"\"){\n\t\tdocument.location.href= \"../operations/?cw=\"+finalvalue;\n\t} else {\n\t\tdocument.location.href= \"../operations/?cw=\"+finalvalue+\"&a=\"+view;\n\t}\n}", "title": "" }, { "docid": "d67b82f7a747cfbd592eae3f783a6383", "score": "0.5416079", "text": "function calculate_goal() {\n\tvar goal = parseInt(document.getElementById(\"goal\").value);\n\tvar initial = parseInt(document.getElementById(\"initial\").value);\n\tvar year = parseInt(document.getElementById(\"year\").value);\n\tvar interest = parseInt(document.getElementById(\"interest\").value);\n\tvar compound = parseInt(document.getElementById(\"compound\").value);\n\t\n\t//Writing to main Total\n\tdocument.getElementById(\"monthly\").value = \"Hello World\";\n}", "title": "" }, { "docid": "756f9afafbe3f1a131f4b79421db9223", "score": "0.5401397", "text": "function toggleSelect(event){\n \n //From each button remove active class\n //console.log(document.querySelectorAll('.button-select button'));\n document.querySelectorAll('.button-select button').forEach((button) => button.classList.remove('active') );\n \n //Assign as active th button clicked\n const button = event.currentTarget;\n button.classList.add('active');\n \n const input = document.querySelector('[name=\"open_on_weekends\"]');\n \n \n input.value = button.dataset.value;\n \n\n}", "title": "" }, { "docid": "e1570ad5cf9e7883627c0e278dbfa7d5", "score": "0.5396286", "text": "function copyStartDate() {\n if (!document.querySelector('input[name=end]').value)\n document.querySelector('input[name=end]').value = document.querySelector('input[name=start]').value;\n}", "title": "" }, { "docid": "1d5d99f5b6d198dd42af66f1e3aaf8cc", "score": "0.5384701", "text": "function ball_twist_deductor() {\n var sets = document.getElementById(\"ball_twist_sets\").value;\n var reps = document.getElementById(\"ball_twist_reps\").value;\n var ball_twist = 1;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((ball_twist * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Medicine Ball Twist\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "bd38e3f83c867a931a081c94a88b726c", "score": "0.53784984", "text": "function leg_extension_deductor() {\n var sets = document.getElementById(\"leg_extension_sets\").value;\n var reps = document.getElementById(\"leg_extension_reps\").value;\n var leg_extension = 2;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((leg_extension * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Leg extension\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r \";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "64c8a616b23a92d36a8464fa71b44ed1", "score": "0.53469896", "text": "function setrd(form,idx) {var h=prompt(\"Enter hours to delay\",\"0\");if(h!=null){form.elements[idx].value=h;form.submit()};}", "title": "" }, { "docid": "72ed761457bc13c6d97f850df7cabe1b", "score": "0.5322957", "text": "function formSubmit(){\n\tvar input = {\n\t\tmiteCount300: document.getElementById(\"loadInput\").value,\n\t\tzip: document.getElementById(\"zipInput\").value,\n\t\tseason: \"increasing\",\n\t\tsupers: false, \n \t\tbrood: false,\n \t\tsynthetic: false\n \t};\n \t//loop through radio button to get correct value\n\n \tif (document.getElementById(\"dormant\").checked)\n \t\t{input.season=\"dormant\"}\n \telse if (document.getElementById(\"peak\").checked)\n \t\t{input.season=\"peak\"}\n\telse if (document.getElementById(\"decreasing\").checked)\n\t\t{input.season=\"decreasing\"}\n\t\n \tif (document.getElementById(\"supersInput\").checked)\n \t\t{input.supers = true};\n \tif (document.getElementById(\"broodInput\").checked)\n \t\t{input.brood = true};\n \tif (document.getElementById(\"syntheticInput\").checked)\n \t\t{input.synthetic = true};\n \tconsole.log(input);\n \tdocument.getElementById(\"name\").innerHTML = treatmentOptions[0].name;\n }", "title": "" }, { "docid": "6bd7223750bddcb6371c2a328ca32b54", "score": "0.5318679", "text": "function toggleSelect(event) {\n //remove class .active (both buttons)\n document.querySelectorAll(\".button-select button\")\n .forEach(function(button) {\n button.classList.remove(\"active\");\n })\n //put class .active\n const button = event.currentTarget;\n button.classList.add(\"active\");\n\n //att the input hidden\n const input = document.querySelector('[name=\"open_on_weekends\"]');\n \n input.value = button.dataset.value;\n}", "title": "" }, { "docid": "9986e9f260a99fd9bc948a9a2d6f3bf5", "score": "0.53050315", "text": "function confiramBookBtn(){\n \n const formCity= document.getElementById(\"formCityId\").value;\n document.getElementById(\"showFormCityID\").innerText=formCity;\n\n const date= document.getElementById(\"toCityId\").value;\n document.getElementById(\"showToCity\").innerText=date;\n\n\n const issueDate=document.getElementById(\"issueDateID\").value;\n const newIssueDate=parseInt(issueDate.value);\n document.getElementById(\"showIssueDateID\").value=newIssueDate;\n\n const returnDate=document.getElementById(\"returnDateID\").value;\n const newReturnDate=parseInt(returnDate.value);\n document.getElementById(\"showReturnDateID\").value=newReturnDate;\n\n\n\n\n}", "title": "" }, { "docid": "47c0b647c3f070c71f76cd675891146e", "score": "0.52988833", "text": "function toggleSelect(event) {\n // Retirar a classe active dos botões\n document.querySelectorAll(\".button-select button\").forEach(button => button.classList.remove(\"active\"));\n // Colocar a classe active no botão selecionado\n const button = event.currentTarget;\n button.classList.add(\"active\");\n // Atualizar o meu input value com o valor selecionado\n document.querySelector('[name=\"open_on_weekends\"]').value = button.dataset.value;\n\n}", "title": "" }, { "docid": "bd3c20ea6b45c50209068bd15ee635a9", "score": "0.52899414", "text": "function bkap_get_per_night_price(date,inst){\n\tvar monthValue = inst.selectedMonth+1;\n\tvar dayValue = inst.selectedDay;\n\tvar yearValue = inst.selectedYear;\n\tvar current_dt = dayValue + \"-\" + monthValue + \"-\" + yearValue;\n\tjQuery( MODAL_ID + \"#wapbk_hidden_date_checkout\" ).val(current_dt);\n\tbkap_calculate_price();\n}", "title": "" }, { "docid": "2762adabc79eeb6c9dfbad300815e348", "score": "0.5286869", "text": "function onChangeCheckout() {\n sDate = document.getElementById('bookStart').valueAsDate;\n eDate = document.getElementById('bookEnd').valueAsDate;\n document.getElementById('totalCost').value = (getDifferenceInDays(sDate, eDate)) * pricePerDay;\n}", "title": "" }, { "docid": "d8f8f67668fa0d1330095586715a6f96", "score": "0.52867013", "text": "function add_weekend1(){\n weekend1_amount+=1;\n if ($(\".weekend1_cart_amount\").css('display') == 'block'){\n $(\".weekend1_cart_amount\").val(weekend1_amount);\n }\n else{\n $(\".weekend1_cart_amount\").val(weekend1_amount); \n $(\".weekend1_cart_amount\").css('display', 'block');\n }\n update_total();\n}", "title": "" }, { "docid": "67f3244ad68f7bf87b250398043dde4a", "score": "0.52774453", "text": "function fillDateFieldsWithLatestDates()\n{\n\tvar currentDate = new Date();\n\n\tvar todate= currentDate.getMonth()+ 1 +\"/\"+ currentDate.getDate()+\"/\"+currentDate.getFullYear();\n\tdocument.getElementById('inputDate2').value = todate ;\n\tdocument.getElementById('inputDate1').value = todate ;\n\n}", "title": "" }, { "docid": "fe7486151374f738db6d18e1f10437b5", "score": "0.52564234", "text": "function toggleSelect(event) {\n //get button pressed\n document.querySelectorAll('.button-select button')\n .forEach((button) => {button.classList.remove('active')})\n\n //inser .active class in selected button \n const button = event.currentTarget\n button.classList.add('active')\n\n // refresh hidden input with selected value\n const input = document.querySelector('[name=\"open_on_weekends\"]')\n\n input.value = button.dataset.value\n}", "title": "" }, { "docid": "f7c9755e59cc5b4b4828ad286bd8cdc6", "score": "0.52474785", "text": "function onChangeCheckin() {\n sDate = document.getElementById('bookStart').value;\n eDate = document.getElementById('bookEnd').value;\n startDate = new Date(sDate);\n endDate = new Date(eDate);\n endDate = new Date(startDate.getTime() + 1000 * 60 * 60 * 24);\n document.getElementById('bookEnd').valueAsDate = endDate;\n document.getElementById('bookEnd').min = startDate.toISOString().slice(0, 10);\n document.getElementById('totalCost').value = (getDifferenceInDays(startDate, endDate)) * pricePerDay;\n}", "title": "" }, { "docid": "ffc08566f7c918e3ee2ce00bc678ecc5", "score": "0.5235951", "text": "function crunch_deductor() {\n var sets = document.getElementById(\"crunch_sets\").value;\n var reps = document.getElementById(\"crunch_reps\").value;\n var crunch = 1;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((crunch * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Crunch\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "12714cbd1e1c3d286b674673b6885b91", "score": "0.5228085", "text": "function getFutureValue()\n{\n let initialDepositField = document.getElementById(\"initialDeposit\").value;\n initialDepositField = Number(initialDepositField);\n\n let intRteField = document.getElementById(\"interestRate\").value;\n intRteField = Number(intRteField);\n\n let depositTermField = document.getElementById(\"depositTerm\").value;\n depositTermField = Number(depositTermField);\n\n let futureValueField = initialDepositField \n *\n Math.pow ((1 + ((intRteField/100)/12)), 12*depositTermField);\n futureValueField = parseFloat(futureValueField.toFixed(2));\n document.getElementById(\"futureValue\").value=futureValueField.toFixed(2);\n \n \n let totalInterestEarnedField = futureValueField - initialDepositField;\n totalInterestEarnedField = parseFloat(totalInterestEarnedField.toFixed(2));\n document.getElementById(\"totalInterestEarned\").value=totalInterestEarnedField.toFixed(2);\n}", "title": "" }, { "docid": "7b01263425aa6ed44e4f8eddbd20ece7", "score": "0.5223359", "text": "function triceps_deductor() {\n var sets = document.getElementById(\"triceps_sets\").value;\n var reps = document.getElementById(\"triceps_reps\").value;\n var triceps = 3;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((triceps * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Tricep pushdown\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "6054a4126ea8ec297c6ee898a1a61210", "score": "0.52128273", "text": "function residencyPeriod() {\n\tdocument.forms[0].param.value = \"home\";\n\tdocument.forms[0].action = \"promotion.htm\";\n\tdocument.forms[0].submit();\n}", "title": "" }, { "docid": "b76ff5c70022cde0b95f38788453115c", "score": "0.52096635", "text": "function monitorPeriod() {\n return $(\"#monitor-period\").val();\n}", "title": "" }, { "docid": "cda66740a023166cb9c9feb9a3600fdb", "score": "0.5203761", "text": "function newLogForExistingSir()\n{\n //default the log date in the form so it can be used as a default date for the new log\n $(\"#newLogDate\").val($(\"#dailyEntryDate\").val());\n $(\"#logOptions\").submit();\n}", "title": "" }, { "docid": "106a5a0cd0f39288f6a7238b57779b9d", "score": "0.5197519", "text": "function getCurrentDateForFormSeach(){\n month = $('#mesBack').val()\n year = $('#anoBack').val()\n\n //month++;\n //preciso formatar para o fullcalendar\n if(month <= 9)\n month = \"0\"+month;\n\n $(\"#dt_mes\").val(month).trigger(\"change\");\n $(\"#dt_ano\").val(year).trigger(\"change\");\n}", "title": "" }, { "docid": "719b5131c450a10b35ebb5d3f61610d8", "score": "0.5197445", "text": "function setWeekAssignments(field){\n\tvar fields_array = document.getElementsByTagName(\"input\");\n\t\n\tfor(var i=0; i<fields_array.length; i++){\n\t\tif(fields_array[i].id.substr(0,12) == field.id){\n\t\t\tfields_array[i].value = field.value;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d0a00965cef1c2db1045d1cb575d6cd2", "score": "0.51887786", "text": "function pump1() {\n var type = $('#type_1').find('option:selected').val();\n var html = '';\n if (type === '1' || type === '2') {\n html = \"<div><label class=\\\"fixedwidth\\\">PH Levels:</label></br><label class=\\\"fixedwidth\\\">Level:</label><input id=\\\"ph_1\\\" type=\\\"text\\\"></br></div>\";\n } else if (type === '3') {\n html = \"<div><label>Other Chemicals:</label></br><label class=\\\"fixedwidth\\\">Description:</label><input id=\\\"description_1\\\" type=\\\"text\\\"></br><label class=\\\"fixedwidth\\\">How Often:</label><input id=\\\"days_1\\\" type=\\\"text\\\" placeholder=\\\"days\\\"></br><label class=\\\"fixedwidth\\\">Amount:</label><input id=\\\"amount_1\\\" type=\\\"text\\\" placeholder=\\\"oz\\\"></br><label class=\\\"fixedwidth\\\">Start Date:</label><input id=\\\"start_1\\\" type=\\\"text\\\"></br><label class=\\\"fixedwidth\\\">End Date:</label><input id=\\\"end_1\\\" type=\\\"text\\\"></br></div>\";\n }\n $(\"#div_p_1\").html(html);\n $('#start_1').datetimepicker({\n format:'Y-m-d',\n timepicker:false\n });\n $('#end_1').datetimepicker({\n format:'Y-m-d',\n timepicker:false\n });\n}", "title": "" }, { "docid": "685e386b91947f8ccb1997f24d39619f", "score": "0.517079", "text": "function futureValue() {\n // Get Data from screen \n let depositAmnt = document.getElementById(\"depositAmnt\").value;\n depositAmnt = parseFloat(depositAmnt);\n\n let anIntRate = document.getElementById(\"anIntRate\").value;\n anIntRate = parseFloat(anIntRate);\n\n let numOfYears = document.getElementById(\"numOfYears\").value;\n numOfYears = parseFloat(numOfYears);\n\n // Convert from monthly percentage to annual percentage and decimal form\n let term = numOfYears * 12\n let apr = anIntRate / 1200\n\n // Calculate future value\n let futurev = depositAmnt * Math.pow(1 + apr, term);\n const resultField = document.getElementById(\"results\");\n resultField.value = futurev.toFixed(2);\n\n // Put result back in UI\n let interestEarn = futurev - depositAmnt\n const result2Field = document.getElementById(\"results2\");\n result2Field.value = interestEarn.toFixed(2);\n\n}", "title": "" }, { "docid": "c5f5b33ef0e4f48f1ea964d5caa07597", "score": "0.516702", "text": "function getHostingPrice()\n{\n var hostingPrice=0;\n //Get a reference to the form id=\"pricing-form\"\n var pricingForm = document.forms[\"pricing-form\"];\n //Get a reference to the select id=\"hosting\"\n var selectedHosting = pricingForm.elements[\"hosting\"];\n \n //set hostingPrice equal to value user chose\n hostingPrice = hosting_prices[selectedHosting.value];\n\n return hostingPrice;\n}", "title": "" }, { "docid": "0cf4c6df14378f7b66afb77595cb7a1d", "score": "0.51665884", "text": "function update() {\r\n var date1 = new Date(document.getElementById(\"from\").value);\r\n var date2 = new Date(document.getElementById(\"to\").value);\r\n var days = days_between(date1, date2);\r\n if (days == 0) {\r\n var price = tolvTimer; //siden funskojnen tolker dette som null dager regnes dette som et halvdagsleie\r\n } else {\r\n \r\n var price = days*basePrice;\r\n }\r\n if (document.getElementById(\"onskerVask\").checked) {\r\n price += vask; //henter vaskeprisen til hytten\r\n }\r\n\r\n if (document.getElementById(\"medlem\").checked) {\r\n price = Math.round(price*0.85);\r\n }\r\n document.getElementById(\"pris\").innerHTML = price + \" kr\";\r\n }", "title": "" }, { "docid": "be5dc506cf24650eafa2b539425736c3", "score": "0.51646763", "text": "function updateInputMinDate() {\n let min = document.querySelector('#invest-currency').selectedOptions[0].attributes.min;\n let minDate = '';\n if (min) {\n minDate = min.value;\n }\n let investDate = document.querySelector('#invest-date');\n investDate.attributes.min.value = minDate;\n if (investDate.value < minDate) {\n investDate.value = minDate;\n }\n}", "title": "" }, { "docid": "57a1273af6b2c65a5bff003eb2ce9754", "score": "0.5164342", "text": "function bicep_curls_deductor() {\n var sets = document.getElementById(\"curls_sets\").value;\n var reps = document.getElementById(\"curls_reps\").value;\n var bicep_curl = 8;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((bicep_curl * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Bicep Curls\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r \";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "c8c526060401e2bd2ce9f4c35d39f84c", "score": "0.5160436", "text": "function setMax() {\r\n var startDate = document.getElementById(\"from\").value;\r\n var twoWeeks = new Date(startDate)\r\n twoWeeks.setDate(twoWeeks.getDate() + 14);\r\n var dd = twoWeeks.getDate();\r\n var mm = twoWeeks.getMonth()+1; //January is 0!\r\n var yyyy = twoWeeks.getFullYear();\r\n \r\n if(dd<10){\r\n dd='0'+dd\r\n } \r\n \r\n if(mm<10){\r\n mm='0'+mm\r\n } \r\n\r\n today = yyyy+'-'+mm+'-'+dd;\r\n document.getElementById(\"to\").setAttribute(\"min\", startDate);\r\n document.getElementById(\"to\").setAttribute(\"max\", today);\r\n document.getElementById(\"toDate\").style.display = 'block';\r\n }", "title": "" }, { "docid": "142d4688413187aceb6b80b07a45d00d", "score": "0.5140521", "text": "function weightRateCalc() {\n 'use strict';\n if (bmrCalories === 0 || tdeeCalories === 0) {\n document.getElementById(\"weightRateDisplay\").innerHTML = \"Fill out the information in the preceeding steps before continuing.\";\n } else {\n var x = document.getElementById(\"weightRateForm\"),\n weightRate = x.elements.weightRate.value,\n amountToLose = x.elements.amountToLose.value,\n howLong,\n numberOfWeeks,\n goal;\n switch (weightRate) {\n case 'one':\n goal = 500;\n howLong = 1;\n break;\n case 'two':\n goal = 1000;\n howLong = 2;\n break;\n case 'maintain':\n goal = 0;\n break;\n case 'gain':\n goal = -300;\n howLong = 0.5;\n break;\n }\n caloriesPerDay = tdeeCalories - goal;\n numberOfWeeks = amountToLose / howLong;\n \n document.getElementById(\"weightRateDisplay\").innerHTML = \"In order to lose \" + weightRate + \" pounds per week, you need to eat \" + caloriesPerDay + \" Calories per day.\";\n \n if (goal !== 0) {\n document.getElementById(\"howLongDisplay\").innerHTML = \"It should take you approximately \" + numberOfWeeks + \" weeks, or \" + numberOfWeeks / 4 + \" months to reach your goal.\";\n } else {\n document.getElementById(\"howLongDisplay\").innerHTML = \"You should not add or lose weight.\";\n }\n }\n}", "title": "" }, { "docid": "8f632a3094e9a7ba5dc0ccfa5d8335bf", "score": "0.51357985", "text": "function update() {\n let monthlyPaymentField = document.getElementById(\"monthly-payment\")\n monthlyPaymentField.innerText = `$${calculateMonthlyPayment(getCurrentUIValues())}`\n}", "title": "" }, { "docid": "7abb9660e1610da4e0aa0e3902be6f69", "score": "0.51337737", "text": "function dateSubmitWithKey(keyEvent, wk) // wk true als week, anders wordt jaar ingesteld \r\n{\r\n\t// twee methodes, voor compatibiliteit\r\n if (keyEvent.keyCode) var code = keyEvent.keyCode;\r\n\telse if (keyEvent.which) var code = keyEvent.which;\r\n\t\r\n\t// alleen als 'enter' ingetoetst werd, wordt er gehandeld\r\n\tif (code == 13)\r\n\t{\r\n\t\tif(wk) // week instellen\r\n\t\t{\r\n\t\t\tvar input = document.getElementById(\"week_box\");\r\n\t\t\tsetWeek(input.value); // setWeek wordt aangeroepen\r\n\t\t}\r\n\t\telse // jaar instellen\r\n\t\t{\r\n\t\t\tvar input = document.getElementById(\"jaar_box\");\r\n\t\t\tsetYear(input.value); // setYear wordt aangeroepen\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "a328e969f987e266f1ac2775c7cdd8cb", "score": "0.5133202", "text": "function month(mon,url){//월 선택\n\t var frm = document.modifyRec;\n\t $('#choice_month').val(mon);\n\t frm.action = url;\n\t frm.submit();\n}", "title": "" }, { "docid": "cd8de4e3328ae3aa8ef1d0e5d95568de", "score": "0.5127688", "text": "function setupIntialValues() {\n // get inputs\n let loanAmount = document.getElementById('loan-amount');\n let loanYears = document.getElementById('loan-years');\n let loanRate = document.getElementById('loan-rate');\n\n // add default values:\n loanAmount.value = '50000';\n loanYears.value = '10';\n loanRate.value = '1.2';\n\n // display default values\n loanAmount.innerText = '50000';\n loanYears.innerText = '10';\n loanRate.innerText = '1.2';\n\n // call function to calculate current monthly payment\n update();\n}", "title": "" }, { "docid": "0efdfc1c67385025c54eeac0db1154da", "score": "0.5127674", "text": "function dueDate() {\n\n const CURRENTDATE = new Date();\n const DATEINPUT = paybackInput.value;\n const WHOLEDATE = new Date(DATEINPUT);\n const WEEKDAY = WHOLEDATE.getDay();\n let date = WHOLEDATE.getDate();\n let finalDate = date + '.' + (WHOLEDATE.getMonth() +1) + '.' + WHOLEDATE.getFullYear();\n\n if (CURRENTDATE > WHOLEDATE) {\n \n document.getElementById(\"loanDue\").innerHTML = \"Pick a future date!\";\n\n } else {\n\n if (WEEKDAY == 6) {\n\n finalDate = (date + 2) + '.' + (WHOLEDATE.getMonth() +1) + '.' + WHOLEDATE.getFullYear();\n \n } else if (WEEKDAY === 0) {\n\n finalDate = (date + 1) + '.' + (WHOLEDATE.getMonth() +1) + '.' + WHOLEDATE.getFullYear();\n \n }\n\n document.getElementById(\"loanDue\").innerHTML = finalDate;\n }\n}", "title": "" }, { "docid": "2615f373c3bdbe44947fc84d84789330", "score": "0.5120513", "text": "function toggleTwoWeeks(option){\n if(option==1){\n //show Two Weeks form\n $(\".weekA\").addClass(\"col-md-6\");\n $(\".weekB\").removeClass(\"hide\");\n $(\".weekTitle\").removeClass(\"hide\");\n $(\"#multipleWeeks\").val(1);\n }\n else{\n $(\".weekA\").removeClass(\"col-md-6\");\n $(\".weekB\").addClass(\"hide\");\n $(\".weekTitle\").addClass(\"hide\");\n $(\"#multipleWeeks\").val(0);\n }\n}", "title": "" }, { "docid": "cfbe5f47a98dfba1c2c5d8e18c24f051", "score": "0.51125526", "text": "function readInput(){\r\n \r\n target = Number(document.querySelector('.add__target').value);\r\n incType = document.querySelector('.add__type').value;\r\n description = document.querySelector('.add__description').value;\r\n value = Number(document.querySelector('.add__value').value);\r\n type = document.querySelector('.add__act_pas').value;\r\n\r\n localStorage.setItem('target', target);\r\n \r\n\r\n if(description){\r\n writeStorage(incType,type,description,value);\r\n if(type === 'act' && value >0){\r\n active(incType,value,description,type)\r\n }else if(type === 'pas' && value >0){\r\n passive(incType,value,description,type)\r\n }\r\n }\r\n calcMonth();\r\n}", "title": "" }, { "docid": "f51f8f03db927e14327f3cbbe0587b2e", "score": "0.5111292", "text": "function plank_deductor() {\n var seconds = document.getElementById(\"plank_seconds\").value;\n var plank = 0.3;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - (plank * seconds);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Plank\" + \" - \" + seconds + \" seconds \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "a9e04899b8908ac55e3f1b197fee169c", "score": "0.51097244", "text": "function setupIntialValues() {\n \n let p = loanAmountInputField.value = 50000; //Amount of principle\n let y = termInYearsInputField.value = 5;\n let r = yearlyRateInputField.value = 5;\n calculateMonthlyPayment({ amount: p, years: y, rate: r })\n update();\n}", "title": "" }, { "docid": "18eebf0d869b3ab859117ec0c09da33f", "score": "0.51010746", "text": "function submit(){\r\n budget = document.querySelector('.max-budget').value;\r\n console.log(budget);\r\n if(budget == ''){\r\n alert('Enter your budget');\r\n }\r\n else{\r\n budget =parseInt(budget);\r\n balance = document.querySelector(\".balance\");\r\n balance.innerHTML = budget;\r\n }\r\n}", "title": "" }, { "docid": "34ccfab334d9e95bc01448641947feae", "score": "0.509083", "text": "function inputDeposit() {\r\n var days = document.getElementById(\"currency\").value\r\n document.getElementsByClassName(\"calc-range__deposit__slider\")[0].value = days;\r\n initRangeColorTooltip()\r\n potentialPayout();\r\n}", "title": "" }, { "docid": "ec378a5164899ee8b07da792daf1327f", "score": "0.5086449", "text": "function getMaxTimePointsToShow() {\n return document.getElementById(\"maxTimePointsForm\").value;\n}", "title": "" }, { "docid": "68ee393fe1f77cc3d4623f6887d552d6", "score": "0.50862813", "text": "function processDate()\n{\n var day = parseInt($(\"#day\").val());\n var month = parseInt($(\"#month\").val());\n var year = parseInt($(\"#year\").val());\n var date = new Date(year + \"-\" + month + \"-\" + day);\n var dayOfWeek = date.getDay();\n if(dayOfWeek == 0)\n $(\"#dayOfWeek\").val(\"Sunday\");\n else if(dayOfWeek == 1)\n $(\"#dayOfWeek\").val(\"Monday\");\n else if(dayOfWeek == 2)\n $(\"#dayOfWeek\").val(\"Tuesday\");\n else if(dayOfWeek == 3)\n $(\"#dayOfWeek\").val(\"Wednesday\");\n else if(dayOfWeek == 4)\n $(\"#dayOfWeek\").val(\"Thursday\");\n else if(dayOfWeek == 5)\n $(\"#dayOfWeek\").val(\"Friday\");\n else if(dayOfWeek == 6)\n $(\"#dayOfWeek\").val(\"Saturday\");\n else\n $(\"#dayOfWeek\").val(\"Error\");\n}", "title": "" }, { "docid": "fd7a5fc2096a15749619ed8d1e127658", "score": "0.5086119", "text": "function handleCalculation(event) {\n event.preventDefault();\n let value_1 = INPUT_1.value\n let value_2 = INPUT_2.value\n console.log(value_1, value_2)\n\n}", "title": "" }, { "docid": "9a9a771ab60d0611f6e143f3db8b0fe9", "score": "0.5083604", "text": "function checkMaximumValueForBookingFirstStep(this_value,type,id)\n{\t\n\tvar type,id; \n\tvar this_value= parseInt(this_value);\n\tvar dia_check=document.getElementById('dia_check').value;\n\t\n\tif(dia_check=='Y')\n\t{\n\tif(type=='weight')\n\t{\n\t\tvar weight=document.getElementById('maximum_weight').value;\n\t\t//alert(weight);\n\t\tif(weight<this_value)\n\t\t{\n\t\t\talert(lang_please_enter_less_weight+weight+\"Kg\");\n\t\t\tdocument.getElementById('parcel_weight_'+id).value=weight;\n\t\t\tdocument.getElementById('document_weight').value=weight;\n\t\t}\n\t}\n\t\n\tif(type=='height')\n\t{\n\t\tvar height=document.getElementById('maximum_height').value;\n\t\tif(this_value>height)\n\t\t{\n\t\t\talert(lang_please_enter_less_height +height+\"Cm\");\n\t\t\tdocument.getElementById('parcel_height_'+id).value=height;\n\t\t}\n\t}\n\tif(type=='width')\n\t{\n\t\tvar width=document.getElementById('maximum_width').value;\n\t\tif(this_value>width)\n\t\t{\n\t\t\talert(lang_please_enter_less_width+width+\"Cm\");\n\t\t\tdocument.getElementById('parcel_width_'+id).value=width;\n\t\t}\n\t}\n\tif(type=='girth')\n\t{\n\t\tvar girth=document.getElementById('maximum_girth').value;\n\t\tif(this_value>girth)\n\t\t{\n\t\t\talert(lang_please_enter_less_grith+girth+\"Cm\");\n\t\t\tdocument.getElementById('parcel_girth_'+id).value=girth;\n\t\t}\n\t}\n\t}\n}", "title": "" }, { "docid": "6bf2dc7941bdb0fe6ef783efc778a4b4", "score": "0.508293", "text": "function counterpay_ed_change(rdval){\n // alert(rdval)\n // alert(rdval.value)\n $('input[name=cntr_pay_ed]').val=rdval.value;\n // document.getElementsByName(\"is_dccb_ed\").value=rdval.value;\n \n }", "title": "" }, { "docid": "088e8a4693b7f4eccf5b42c0a2b30085", "score": "0.5074948", "text": "function getInputvalue(product) {\n return parseInt(document.getElementById(product + \"-cost\").innerText);\n\n}", "title": "" }, { "docid": "b32174e9c76939f23c0e1ebefe187e88", "score": "0.5068313", "text": "function getSummInputs(form) {\n let people = document.querySelectorAll(form + ' .people_qua');\n let summ = Number(people[0].value) + Number(people[1].value) + Number(people[2].value);\n switch (summ) {\n case 2:\n case 3:\n case 4:\n summ = summ + ' человекa';\n break;\n default:\n summ = summ + ' человек'\n break;\n }\n\n let fly_class_js = document.querySelector(form + ' .fly_class_js'); //\n (fly_class_js.checked) ? summ = summ + ', бизнес': summ = summ + ', эконом';\n\n document.querySelector(form + ' .mf_people').value = '';\n document.querySelector(form + ' .mf_people').value = summ;\n\n}", "title": "" }, { "docid": "08aabd6eee2b21576c785d6964809a6a", "score": "0.50635064", "text": "function setupIntialValues() {\n const amount = document.querySelector('#loan-amount').value;\n const years = document.querySelector(\"#loan-years\").value;\n const rate = document.querySelector(\"#loan-rate\").value;\n console.log(amount);\n \n calculateMonthlyPayment({amount,years,rate});\n }", "title": "" }, { "docid": "aed7e131c2c34893d0ff03123258d80f", "score": "0.50611347", "text": "function setupIntialValues() {\n\n const form = document.getElementById(\"calc-form\");\n\n form.addEventListener(\"submit\", function(event) {\n\n \n loanAmount = document.getElementById(\"loan-amount\").value;\n loanYears = document.getElementById(\"loan-years\").value;\n loanRate = document.getElementById(\"loan-rate\").value;\n\n monthyPayment = calculateMonthlyPayment(loanAmount, loanYears,loanRate);\n\n });\n\n}", "title": "" }, { "docid": "afb23de5f959be59ff2fd3ec3c66bf97", "score": "0.5051328", "text": "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n // document.querySelector('#step2_btn').addEventListener('click', e=>{\n // let selectedCategory = [];\n // let checkedBoxes = document.querySelectorAll('input[name=categories]:checked');\n // console.log(checkedBoxes)\n // let institutions = document.querySelector(\"div[data-step='3']\").querySelectorAll('.form-group.form-group--checkbox');\n // checkedBoxes.forEach(el => {\n // selectedCategory.push(el.value)\n // console.log(el.value)\n // })\n // institutions.forEach(el=>{\n // let category = el.querySelector('.description > div:nth-child(3)').textContent\n // console.log(category);\n // if (!selectedCategory.includes(category)) {\n // el.style.display = 'none'\n // }\n // })\n // })\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 6;\n this.$step.parentElement.hidden = this.currentStep >= 6;\n\n // TODO: get data from inputs and show them in summary\n let bags_text = document.querySelectorAll(\".summary--text\")[0];\n let bags = document.querySelector('input[name=\"quantity\"]').value;\n bags_text.innerHTML = bags + \" worków z darowiznami dla fundacji\";\n\n }", "title": "" }, { "docid": "ecd6467e6ee1726246b6c84c0643ac9c", "score": "0.50503886", "text": "function updatePayment(e) {\r\n monthlyPaymentInput.value = myCalc.getMonthlyPayment().toFixed(2);\r\n }", "title": "" }, { "docid": "007362749e9edc88d98c6c7ee9aa5a36", "score": "0.504987", "text": "function docCal(form, pfield) {\n\tif (pfield==\"result\") {\n\t\tif (form.chbox.checked) {\n\t\t\tform.t1.value=math.sqrt(form.result.value);\n\t\t}\n\t} else {\n\t\tif (form.chbox.checked) {\n\t\t\tform.result.value=form.t1.value*form.t1.value;\n\t\t} else {\n\t\t\tform.result.value=form.t1.value*2;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6df0488fc5311be46871eba905121cac", "score": "0.50457954", "text": "function set_current_variables(prijs, age, use, leven, power, useyear) {\n\t\t\t$(\".current_price\").val(Math.round(prijs * 10) / 10);\n\t\t\t$(\".current_age\").val(age);\n\t\t\t$(\".current_lifespan\").val(Math.round(leven * 10) / 10);\n\t\t\t$(\".current_power\").val(Math.round(power));\n\t\t\t$(\".current_use_day\").val(use);\n\t\t\t$(\".current_use_year\").val(Math.round(useyear * 10) / 10);\n\t\t}", "title": "" }, { "docid": "7da013c2b26885e821e3cbe148b6b00e", "score": "0.5045643", "text": "function setFirstTargetPeriod() {\n browser.moveToObject('div.controls.col-sm-6>input#id_target_frequency_start');\n browser.moveToObject('div.controls.col-sm-6>input#id_target_frequency_num_periods');\n}", "title": "" }, { "docid": "fef784fea969b807af1a744d3e0b5992", "score": "0.5041638", "text": "function stay_duration_clicked(e){\n\tvar number_of_nigths = $(e.currentTarget).val();\n\tnumber_of_nights = Math.max(number_of_nigths, parseInt($(\"#sha-num-nights\").val(), 10) );\n\tvar start_date = Date.parse(reservation.booking_start);\n\tvar end_date = start_date + number_of_nigths*24*60*60*1000;\n\treservation.booking_end = new Date(end_date);\n\treservation.booking_end = reservation.booking_end.toISOString().substr(0, 10);\n\t$(\"#sha-num-nights\").val( number_of_nights );\n\tupdate_reservation_details();\n\t\n\t\n\t// filter objectives and duration \n\tobjectives_filter_clicked(e);\n\t\n}", "title": "" }, { "docid": "02394fae48a61733159922a939c2c4a0", "score": "0.50397843", "text": "function rowing_deductor() {\n var minutes = document.getElementById(\"rowing_minutes\").value;\n var rowing = 7;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - (rowing * minutes);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Rowing\" + \" - \" + minutes + \" minutes \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "3f7fe62864c17e9b2a37f44693615e25", "score": "0.50396395", "text": "getBpm(e) {\n e.preventDefault();\n //this.bpm = bpmInput.value;\n }", "title": "" }, { "docid": "028d05bab601b5822359ce70f6c89086", "score": "0.5036517", "text": "function dead_lift_deductor() {\n var sets = document.getElementById(\"dead_lift_sets\").value;\n var reps = document.getElementById(\"dead_lift_reps\").value;\n var dead_lift = 5;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((dead_lift * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Dead lift\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "4cee952ca794f0dff7261e670cd00cb7", "score": "0.50206757", "text": "function toggleMilestone() {\n var milestone = document.getElementById('task_milestone').checked;\n if (milestone) {\n //set finish date\n document.getElementById('end_date').value = document.getElementById('start_date').value;\n document.getElementById('task_end_date').value = document.getElementById('task_start_date').value;\n document.getElementById('end_date').disabled = true;\n } else {\n document.getElementById('end_date').disabled = false;\n }\n}", "title": "" }, { "docid": "236e67771130663cb5cb20cbb6c29de0", "score": "0.50171304", "text": "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 6;\n this.$step.parentElement.hidden = this.currentStep >= 6;\n\n // TODO: get data from inputs and show them in summary\n }", "title": "" }, { "docid": "236e67771130663cb5cb20cbb6c29de0", "score": "0.50171304", "text": "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 6;\n this.$step.parentElement.hidden = this.currentStep >= 6;\n\n // TODO: get data from inputs and show them in summary\n }", "title": "" }, { "docid": "cdc73b2c284206596b27f39f1a8de1cd", "score": "0.5013305", "text": "function onParkspotChange(event){\n currentParkspotValue = event.target.value;\n //console.log(\"parkspot value set to \" + event.target.value);\n}", "title": "" }, { "docid": "4d2fcd23bf678c9e0cf79f912a43fbd0", "score": "0.5011066", "text": "function onInput() {\n // Get both specified and calculated max heart rates.\n const specMHR = val('form1-mhr');\n const calcMHR = calculateMHR();\n // Pick the 'actual' one.\n const chosenMHR = ck('form1-spec-mhr') ? specMHR : calcMHR;\n\n // Output display is for calculated value.\n const o = el('form1-out1');\n o.value = calcMHR;\n\n // Always show regular training zone data.\n createRegularZoneData(chosenMHR);\n\n // Only show Karvonen data if corresponding check box checked.\n const karvTable = el('form1-karv-data');\n if (ck('form1-create-karv')) {\n createKarvZoneData(chosenMHR);\n karvTable.style.display = 'table';\n } else {\n karvTable.style.display = 'none';\n }\n}", "title": "" }, { "docid": "b60320f72ae63fc34bb132fa2dd7f627", "score": "0.5006749", "text": "function makeestimatedshippingdate(){\n \n var orderchipcodate = document.getElementById(\"datesubmitchipco\").value;\n //alert(orderchipcodate);\n var shippingvalue = document.getElementById(\"producttypedeliverydays\").value;\n //alert(shippingvalue); //var shippingvalue = document.getElementById(\"shippingvalue\").value;\n if(shippingvalue && orderchipcodate){\n var splarr = orderchipcodate.split(\"-\");\n var spldate = splarr[0]+\"-\"+splarr[1]+\"-\"+splarr[2];\n \n var totalDate = new Date();\n totalDate.setYear(splarr[2]);\n totalDate.setMonth(splarr[0]-1);\n totalDate.setDate(splarr[1]);\n totalDate.setDate(totalDate.getDate()+parseInt(shippingvalue));\n \n var now = new Date(totalDate);\n\n var curr_date = now.getDate();\n if(curr_date < 10){\n var curr_date = '0'+curr_date;\n }\n var curr_month = (now.getMonth()+1);\n\n if(curr_month < 10){\n var curr_month = '0'+curr_month;\n }\n var curr_year = now.getFullYear()\n\n\n document.getElementById(\"dateestship\").value = curr_month+'-'+curr_date+'-'+curr_year;\n }else{\n document.getElementById(\"dateestship\").value = '';\n return false;\n }\n \n}", "title": "" }, { "docid": "37f32f7fe8f016e8d9605e2c82098c6d", "score": "0.500561", "text": "function bar_curl_deductor() {\n var sets = document.getElementById(\"bar_curl_sets\").value;\n var reps = document.getElementById(\"bar_curl_reps\").value;\n var bar_curl = 8;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((bar_curl * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Bar Curls\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "7f2c9a16ceedc888a19d719e0ad2aa69", "score": "0.50020933", "text": "function getinputvalue(product){\n const amountphn=document.getElementById(product+'-number');\n const getphnnumber=parseInt(amountphn.value);\n return getphnnumber;\n}", "title": "" }, { "docid": "15b7f3ca8ca0cd78f8d56b2d90b85356", "score": "0.4998686", "text": "function onSubmit(event){\n\t\n\tconsole.log(selected_value);\n\t$('#selected_value').val(selected_value);\n\tdocument.getElementById(\"amt-form\").submit();\n}", "title": "" }, { "docid": "e5b4e632dd38236c5c4207ac1a777daa", "score": "0.49979186", "text": "function manual_deductor() {\n var self_calories = document.getElementById(\"manual_calories\").value;\n var name_of_food = document.getElementById(\"enter_food\").value;\n // if function to make sure that a target has been entered\n if (typeof calories !== 'undefined' && calories) {\n // if function to check if you've reached your target\n if (calories >= 0) {\n calories = calories - self_calories;\n document.getElementById(\"CalorieCounter\").innerHTML =\n calories + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newtext =\n name_of_food + \" - \" + self_calories + \" calories \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n\n }\n}", "title": "" }, { "docid": "e013938fd66ff4d2ae7d459541027b5d", "score": "0.49975118", "text": "function updateCostForm(newValue) {\n const form = document.getElementById('cost-form');\n form.value = Math.max(parseInt(form.value) + newValue, 0).toString();\n const currentItem = edgePopup.currentItem;\n if (currentItem) {\n currentItem.tag = {\n flow: currentItem.tag.flow,\n color: currentItem.tag.color,\n capacity: currentItem.tag.capacity,\n cost: parseInt(form.value)\n };\n if (currentItem.labels.size > 1) {\n const label = currentItem.labels.get(1);\n graphComponent.graph.setLabelText(label, `${currentItem.tag.cost} \\u20AC`);\n }\n }\n}", "title": "" }, { "docid": "b10ca3781a7a32f52dd2081ba2f0dbf5", "score": "0.49973378", "text": "function getInputValue(product) {\n const productInput = document.getElementById(product + '-cost');\n const productPrice = parseInt(productInput.innerText);\n return productPrice;\n}", "title": "" }, { "docid": "09929dc0a4903a8eb82c1f33c45c33d3", "score": "0.49953035", "text": "function bent_over_row_deductor() {\n var sets = document.getElementById(\"bent_over_row_sets\").value;\n var reps = document.getElementById(\"bent_over_row_reps\").value;\n var bent_over_row = 2;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((bent_over_row * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Bent over row\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "eb4da1529bcbc75e7fca99ddc8358ef9", "score": "0.49949816", "text": "function calculate() {\n // Be strict:\n 'use strict';\n\n // Variable to store the total cost:\n var cost = 0;\n\n // Get a reference to the form elements:\n var type = document.getElementById(\"type\");\n var years = document.getElementById(\"years\");\n\n //document.getElementById('cost').value = type;\n // TODO Convert the year to a number:\n //years = +document.getElementById('years').innerText;\n // Check for valid data:\n if (type && type.value && years && (years > 0)) {\n\n // TODO Add a switch statement to determine the base cost using the value of \"type\"\n switch (type) {\n\n case \"basic\":\n cost = 10;\n break;\n\n case \"premium\":\n cost = 15;\n break;\n\n case \"gold\":\n cost = 20;\n break;\n\n case \"platinum\":\n cost = 25;\n break;\n }\n\n // TODO Update cost to factor in the number of years:\n cost = cost * years;\n\n // Discount multiple years:\n if (years > 1) {\n cost *= .80; // 80%\n }\n\n var costElement = document.getElementById(\"cost\");\n\n // TODO update the value property of 'costElement' to the calculated cost\n costElement.value = cost;\n //document.getElementById('cost').value = cost;\n } else { // Show an error:\n document.getElementById(\"cost\").value = \"Please enter valid values.\";\n }\n\n // Return false to prevent submission:\n return false;\n}", "title": "" }, { "docid": "3a47fb69df3af9fb46d93d29f90b1a52", "score": "0.4991986", "text": "function squat_deductor() {\n var sets = document.getElementById(\"squat_sets\").value;\n var reps = document.getElementById(\"squat_reps\").value;\n var squat = 4;\n // if function to make sure that a target has been entered\n if (typeof calories_burnt !== 'undefined' && calories_burnt) {\n // if function to check if you've reached your target\n if (calories_burnt > 0) {\n calories_burnt = calories_burnt - ((squat * reps) * sets);\n document.getElementById(\"ExerciseCounter\").innerHTML =\n calories_burnt + \"<span class='countertext'>calories left</span>\";\n document.myform.food_history.value += newline =\n \"Squat\" + \" - \" + sets + \" sets \" + reps + \" reps \\n\\r\";\n } else {\n alert(\"You have reached your target\");\n }\n } else {\n alert(\"You need to re/set your target\");\n }\n}", "title": "" }, { "docid": "a061623a2f6d4ed7eaf474b9656f8994", "score": "0.49904326", "text": "function trainSchedule () {\n let tName = $('#train-input').val();\n let destination = $('#destination-input').val();\n let frequency = $('#frequency-input').val();\n let trainTimeHr = $('#train-time-input-hr').val();\n let trainTimeMin = $('#train-time-input-min').val();\n let firstTrain = trainTimeHr + trainTimeMin\n console.log(frequency)\n \n if (tName === '' || destination === '' || frequency === '' || frequency === '0' || firstTrain === ''){\n alert('Please check inputs')\n return false\n }\n database.ref().push({\n Train: tName,\n Destination: destination,\n frequency: frequency,\n firstTrain: firstTrain\n \n })\n\n}", "title": "" }, { "docid": "9c27893c962030ba4482048b0133b1d7", "score": "0.49882036", "text": "function populateForm(data) {\r\n $('#trainName').val(data.trainName);\r\n $('#destination').val(data.destination);\r\n var time = moment(data.firstTime.toDate());\r\n $('#firstTime').val(time.format(\"HH:MM\"));\r\n $('#frequency').val(data.frequency);\r\n }", "title": "" }, { "docid": "08c4db302920d68b37de694b31678700", "score": "0.4986789", "text": "function getEndRunFromForm() {\n return document.getElementById(\"endRunInput\").value;\n}", "title": "" }, { "docid": "f610b3232ac8b877f99212e296c6a492", "score": "0.49842286", "text": "function toggleSelect (event) {\n // pegar o botão clicado\n const button = event.currentTarget;\n\n // retirar a class active\n document.querySelectorAll('.button-select button').forEach(button => button.classList.remove('active'));\n\n // atualizar o input hidden com o valor selecionado\n const input = document.querySelector('[name=\"open_on_weekends\"');\n\n // verificar se é sim ou Não\n input.value = button.dataset.value;\n\n // colocar a class active no botão clicado\n button.classList.add('active');\n\n}", "title": "" } ]
7aed2669c018f4b79e6fa26600d1733b
for end marker of params for the request/response type will emit received data chunks as data event, and emit end, error events
[ { "docid": "bed23d1aabd0cd5772c6efe4ff6898bf", "score": "0.0", "text": "function writeToLength(data){\n readBytes += data.length;\n result.push(data.toString('utf-8'));\n msgEmitter.emit('data', data);\n if (readBytes === resultLength) {\n result = result.join('');\n oraSock.removeListener('data', acceptOracleResult);\n oraSock.busy = false;\n cb && cb(oraStatus, result, oraResHead2);\n msgEmitter.emit('end', null);\n }\n }", "title": "" } ]
[ { "docid": "90575884d755cdceb38a803a3921dafe", "score": "0.6308976", "text": "_registerDataMessage() {\n this.on('data', (data) => {\n //when its done with a complete chunk, call this.emit('dataBig', completed)\n this.unchunker.registerChunk(data);\n });\n }", "title": "" }, { "docid": "a1e8ae0dd2449dc628685b28c5775ec9", "score": "0.6235922", "text": "_EndDataRequestFunction(pRequest, pResponse, fNext)\n\t{\n\t\treturn fNext();\n\t}", "title": "" }, { "docid": "4f5938f5ac631f7487de5d28bd957fd4", "score": "0.6153171", "text": "onDataRequest(req, res) {\n if (this.dataReq) {\n // assert: this.dataRes, '.dataReq and .dataRes should be (un)set together'\n this.onError(\"data request overlap from client\");\n res.writeHead(500);\n res.end();\n return;\n }\n\n this.dataReq = req;\n this.dataRes = res;\n\n let chunks = \"\";\n const self = this;\n\n function cleanup() {\n req.removeListener(\"data\", onData);\n req.removeListener(\"end\", onEnd);\n req.removeListener(\"close\", onClose);\n self.dataReq = self.dataRes = chunks = null;\n }\n\n function onClose() {\n cleanup();\n self.onError(\"data request connection closed prematurely\");\n }\n\n function onData(data) {\n let contentLength;\n chunks += data;\n contentLength = Buffer.byteLength(chunks);\n\n if (contentLength > self.maxHttpBufferSize) {\n chunks = \"\";\n req.connection.destroy();\n }\n }\n\n function onEnd() {\n self.onData(chunks);\n\n const headers = {\n // text/html is required instead of text/plain to avoid an\n // unwanted download dialog on certain user-agents (GH-43)\n \"Content-Type\": \"text/html\",\n \"Content-Length\": 2\n };\n\n res.writeHead(200, self.headers(req, headers));\n res.end(\"ok\");\n cleanup();\n }\n\n req.on(\"close\", onClose);\n req.setEncoding(\"utf8\");\n req.on(\"data\", onData);\n req.on(\"end\", onEnd);\n }", "title": "" }, { "docid": "607db07c6265828107ab908c63b8e595", "score": "0.61347497", "text": "function endEvent(response, eventData) {\n console.log(`OnEventComplete message received:`)\n console.log(eventData)\n\n //Put your logic here\n\n response.writeHead(200)\n response.end()\n}", "title": "" }, { "docid": "76bf06629b1ff77b1582bfcc842c7ba4", "score": "0.6112779", "text": "registerStreamSendEvent(out, info) {\n // note : Implementation use recursive calls, but stack won't never get near v8 max call stack size\n //since event launched for stream parameter only\n this.paramWritten = function() {\n while (true) {\n if (this.currentParam === this.queryParts.length) {\n //********************************************\n // all parameters are written.\n // flush packet\n //********************************************\n out.flushBuffer(true);\n this.sending = false;\n this.emit('send_end');\n return;\n } else {\n const value = this.values[this.currentParam - 1];\n\n if (value === null) {\n out.writeStringAscii('NULL');\n out.writeString(this.queryParts[this.currentParam++]);\n continue;\n }\n\n if (\n typeof value === 'object' &&\n typeof value.pipe === 'function' &&\n typeof value.read === 'function'\n ) {\n //********************************************\n // param is stream,\n //********************************************\n out.writeInt8(QUOTE);\n value.once(\n 'end',\n function() {\n out.writeInt8(QUOTE);\n out.writeString(this.queryParts[this.currentParam++]);\n this.paramWritten();\n }.bind(this)\n );\n value.on('data', function(chunk) {\n out.writeBufferEscape(chunk);\n });\n return;\n }\n\n //********************************************\n // param isn't stream. directly write in buffer\n //********************************************\n this.writeParam(out, value, this.opts, info);\n out.writeString(this.queryParts[this.currentParam++]);\n }\n }\n }.bind(this);\n }", "title": "" }, { "docid": "f10d3541906c4a8ea74c9b89820f5acb", "score": "0.59682083", "text": "end() {\n // Reset state\n this.req && this.req.reset();\n this.status(200);\n this.finished = true;\n this.emit('finish');\n }", "title": "" }, { "docid": "f5f90cf7951eab7457f343ebd093ad14", "score": "0.59290606", "text": "function requestCompleted(){\n\t\twriteStream.emit(\"requestCompleted\");\n\t}", "title": "" }, { "docid": "96efaeaafdf7dccd3e9475aef9fd15f8", "score": "0.58994514", "text": "function onRequest(req, res) {\n var dataPosted = \"\";\n var pathname = url.parse(req.url).pathname;\n console.log(\"Request for\" + pathname + \" recieved\");\n\n req.setEncoding(\"utf8\");\n req.addListener(\"data\", function (chunk) {\n dataPosted += chunkPosted;\n console.log(\"Recieved chunk POST '\" + chunkPost + \"'.\");\n });\n\n req.addListener(\"end\", function () {\n route(handle, pathname, res, dataPosted);\n });\n\n // route(handle, pathname, res);\n // res.writeHead(200, { \"Content-Type\": \"text / html\" }); //the request\n // var content = route(handle, pathname);\n // res.write(content); //the response\n // res.end();\n }", "title": "" }, { "docid": "6cdf7047d0b1dcdf3d3f229596af4a62", "score": "0.5830099", "text": "_onEnd() {}", "title": "" }, { "docid": "5e12bf58b077e5130f55c4a045dcc7ff", "score": "0.5744909", "text": "onEndHeaders() {}", "title": "" }, { "docid": "2036031f50c9c4d232a0b5630f9ae900", "score": "0.56257856", "text": "function RequestData(request, whatToDo){\r\n asyncProcessing= true;\r\n var requestData = '';\r\n request.on('data', function (data){\r\n requestData += data;\r\n });\r\n\r\n request.on('end',function(){\r\n whatToDo( requestData );\r\n\r\n });\r\n}", "title": "" }, { "docid": "8c1a521cbaf47892ef083438fb76c97e", "score": "0.56219876", "text": "_BeginDataRequestFunction(pRequest, pResponse, fNext)\n\t{\n\t\treturn fNext();\n\t}", "title": "" }, { "docid": "6cd7ee69f8fc64929928bdaeb835dc86", "score": "0.5606375", "text": "constructor(stream){\n super();\n let buffer = '';\n stream.on('data', (data)=> {\n buffer += data;\n \n let boundary = buffer.indexOf('\\n');\n while (boundary !== -1){\n const input = buffer.substring(0, boundary);\n buffer = buffer.substring(boundary+1);\n // console.log(buffer);\n this.emit('message', JSON.parse(input)); //returning an unexpected end of input? Looks like chunkOne is writing but chunkTwo is not. <-- Need to go back to testJSONService.js and add the \\n back in as per instructions.\n boundary = buffer.indexOf('\\n');\n \n }\n\n })\n }", "title": "" }, { "docid": "c9e48a25ee5d24daef18a0a3a4cd100a", "score": "0.5571928", "text": "globalRespond(event,data){\n\t\tdata = JSON.stringify(data);\n\t\tthis.io.emit(event,data);\n\t}", "title": "" }, { "docid": "d6a072b3ff9084f1e5bdfaf6395261dd", "score": "0.55470663", "text": "function emitEnd() {\n console.log('Finished execution');\n self.emit('end');\n }", "title": "" }, { "docid": "d6a072b3ff9084f1e5bdfaf6395261dd", "score": "0.55470663", "text": "function emitEnd() {\n console.log('Finished execution');\n self.emit('end');\n }", "title": "" }, { "docid": "f8698cc17f4c3ed4a7477cb0b0933bc7", "score": "0.55448365", "text": "function emitend (reader) {\n return emitstate(reader, 'onend', reader.data)\n }", "title": "" }, { "docid": "1ad96f8de4bbd27b8c03547b06795a4f", "score": "0.5542653", "text": "function gather_body( request, response, next) {\n request.setEncoding('utf8');\n request.rawBody = '';\n function append( chunk ) {\n request.rawBody += chunk;\n };\n request.on( 'data', append );\n function pass() {\n next();\n };\n request.on( 'end', pass );\n}", "title": "" }, { "docid": "0d1b3997a750721f7c62dc8bd904a3b6", "score": "0.553366", "text": "endOfStream(error) {\n this.error_ = error;\n }", "title": "" }, { "docid": "5b35f72e6d0a9cbb49dd0183515e7074", "score": "0.5519486", "text": "function onData (res, chunk) {\n var name\n if (!(name = shouldContinue.call(this, res))) {\n return\n }\n\n decompressed = name\n if (chunk && chunk.length > 0) {\n this.emit('data', this.options.encoding ? chunk.toString(this.options.encoding) : chunk)\n }\n }", "title": "" }, { "docid": "c7bd3bcf1d483fce9b3109136c617042", "score": "0.5456256", "text": "function callback (response) {\n response.on(\"data\", callback2);\n}", "title": "" }, { "docid": "96be1383cb9f22f8db54bd128e50ecc1", "score": "0.54388416", "text": "function responseHandler(res) {\n var buffer = [];\n var toltalLength = 0;\n res.on('data', function (d) {\n buffer.push(d);\n toltalLength += d.length;\n });\n\n res.on('end', function () {\n // no error\n callback(null, Buffer.concat(buffer, toltalLength).toString());\n });\n }", "title": "" }, { "docid": "59a16ea1ab06f27b56512546dfde6a4b", "score": "0.54355633", "text": "_onEnd() {\n this.fire(\"end\");\n }", "title": "" }, { "docid": "859db7d1968a5a862b37daf6a0641caa", "score": "0.5418513", "text": "function _end(request, callback) {\n request.end(function (res) {\n callback(res.error, res);\n });\n}", "title": "" }, { "docid": "eb63cc018e483467aeb10dead8176a80", "score": "0.54165983", "text": "done(chunk) {\n this.end(chunk);\n }", "title": "" }, { "docid": "65e0217b309634b96005d424a739c415", "score": "0.5406916", "text": "processData(content) {\n if (this.header[':event-type'] === 'Records') {\n this.flowing = this.push(content);\n } else if (this.header[':event-type'] === 'End') {\n this.ended = true;\n }\n this.emit('on-process-data', {\n header: this.header,\n content,\n });\n }", "title": "" }, { "docid": "dd067cadd84642a982326b98bf19def7", "score": "0.540516", "text": "function parserOnBody(buf, start, len) {\n var parser = this;\n var incoming = parser.incoming;\n\n if (!incoming) {\n return;\n }\n\n // Push body part into incoming stream, which will emit 'data' event\n var body = buf.slice(start, start + len);\n incoming.push(body);\n}", "title": "" }, { "docid": "a8679fe5b6679a925b83b363e5074130", "score": "0.53952485", "text": "function onData(data) {\n\t\t\n // add data to buffer\n\t\tself._buffer = concatBuffer([self._buffer, data]);\n //self._buffer = data; //= Buffer.concat([self._buffer, data]);\n\n\t\tconsole.log(\"onData buf: \", self._buffer, self._buffer.byteLength);\n\t\t//console.log(self._buffer);\n\t\tvar bufferLength = self._buffer.byteLength ;\n\t\t//console.log(\"onData byteLength: \");\n\t\t//console.log(\"onData length: \", self._buffer.length);\n\t\t\n for (var i = 0; i < bufferLength; ) {\n\t\t\tvar length = self._buffer.readUInt8(i);\n\t\t\tif (length + i +1 > bufferLength || length < 1)\n\t\t\t{\n\t\t\t\tconsole.log(\"length error: \", i,length, bufferLength);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//console.log(\"read ok: \", i);\n\t\t\tvar cmd = self._buffer.readUInt8(i+1);\n\t\t\t//console.log(\"receive data : \", length, cmd);\n\t\t\tself._emitData(i, length+1);\n\t\t\ti += (length +1);\n\t\t}\n\n }", "title": "" }, { "docid": "0b0998df53786fdeedfdcda765b677a7", "score": "0.53766716", "text": "end() {\n this.emitter.end(true);\n this.receiver.end(true);\n }", "title": "" }, { "docid": "8ac18b000afab90d03bcb66efc4ba842", "score": "0.5335812", "text": "onBufferEos(data) {\r\n var sb = this.sourceBuffer;\r\n let dataType = data.type;\r\n for(let type in sb) {\r\n if (!dataType || type === dataType) {\r\n if (!sb[type].ended) {\r\n sb[type].ended = true;\r\n __WEBPACK_IMPORTED_MODULE_2__utils_logger__[\"b\" /* logger */].log(`${type} sourceBuffer now EOS`);\r\n }\r\n }\r\n }\r\n this.checkEos();\r\n }", "title": "" }, { "docid": "b7dab3267e877dad71511e6b0d9c653c", "score": "0.5319639", "text": "handleTrailingData() {\n const endIndex = this.buffer.length + this.offset;\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InNumericEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InHexEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) ;\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n }", "title": "" }, { "docid": "c514f034c8d3402f2f05f2eda21f82df", "score": "0.5315451", "text": "end (event) {\n \n }", "title": "" }, { "docid": "4830cda738117487b5001cf4e5702976", "score": "0.5301372", "text": "function handleDataAvailable(e) {\n recordedChunks.push(e.data);\n}", "title": "" }, { "docid": "10fff52a3893d1301b045768383941e7", "score": "0.53005475", "text": "end(param) {\n\n for (let i = 0; i < this.listeners.length; i++) {\n this.listeners[i].end(this, param);\n }\n }", "title": "" }, { "docid": "1c2aec5c5046e3bd56593f1e062c788a", "score": "0.5298259", "text": "async onRequest(data) {\n try {\n const [commandPart, ...args] = data.toString('utf8').match(/\\S+/g) || [];\n const [cmd, id] = commandPart.split(':');\n\n const cmdResponse = await this.requestsHandler.process(cmd, args);\n\n if (cmdResponse instanceof Readable) {\n return cmdResponse.on('data', (data) => {\n this.emit('data', this._buildResponseMsg(data, cmd, id) );\n });\n }\n\n return this.emit('data', this._buildResponseMsg(cmdResponse, cmd, id) );\n } catch (err) {\n console.log(err);\n this.emit('error', `Error ${err} occured whilre processing message ${data}.`);\n }\n }", "title": "" }, { "docid": "50bca9f9f53e71e2f1be876f13f40fe9", "score": "0.52920943", "text": "function onend() { onerror(end) }", "title": "" }, { "docid": "fbad0550731676b759ebfa7fa98cbfde", "score": "0.52584594", "text": "function emitData() {\n if (i > 0) {\n var s = buf.slice(0, i);\n telnet.emit('data', s);\n\n buf = buf.slice(i);\n i = 0;\n }\n }", "title": "" }, { "docid": "8d2426de63251af03db1af108eace978", "score": "0.5255759", "text": "function We(oa){Re(\"ondata\"),ra=!1;var na=Ve.write(oa);!1!==na||ra||((1===Ze.pipesCount&&Ze.pipes===Ve||1<Ze.pipesCount&&-1!==Me(Ze.pipes,Ve))&&!ta&&(Re(\"false write response, pause\",Qe._readableState.awaitDrain),Qe._readableState.awaitDrain++,ra=!0),Qe.pause())}// if the dest has an error, then stop piping into it.", "title": "" }, { "docid": "ecb87a4d73cee63316f399b5e77112aa", "score": "0.52366966", "text": "flowEnd(){}", "title": "" }, { "docid": "fa8690ffe1f3af334c67fb63027e71dd", "score": "0.5227171", "text": "end(chunk) {\n var _a, _b;\n if (this.ended) {\n (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, Error(\".end() after done!\"));\n return;\n }\n if (chunk)\n this.write(chunk);\n this.ended = true;\n this.tokenizer.end();\n }", "title": "" }, { "docid": "e18162cd990e1013451cd784b1a480c3", "score": "0.5204583", "text": "_final(fireFinishEvent = () => { }) {\n this.upstreamEnded = true;\n this.once('uploadFinished', fireFinishEvent);\n process.nextTick(() => {\n this.emit('upstreamFinished');\n // it's possible `_write` may not be called - namely for empty object uploads\n this.emit('writing');\n });\n }", "title": "" }, { "docid": "72bade3c8f994143d0972df9d354c23d", "score": "0.51990306", "text": "function ParseHttpRequestEnd( line )\r\n{\r\n\tvar rc = null;\r\n\tvar prefix, offs;\r\n\t\r\n\tprefix = \"HttpRequestEnd: Type: \";\r\n\toffs = line.indexOf(prefix);\r\n\tif( offs>=0 )\r\n\t{ // handle older HttpRequestEnd logging as used by FOG\r\n\t // refer DELIA-57887 \"[FOG] inconsistent HttpRequestEnd logging\"\r\n\t\t// preliminary review shared which introduces \"br\" (bitrate) field in log - it's present for abrs_fragment#t:VIDEO\r\n\t\t// but not HttpRequestEnd\r\n\t\tvar httpRequestEnd = {};\r\n\t\tline = \"Type: \" + line.substr(offs+prefix.length);\r\n\t\tline = line.split(\", \");\r\n\t\tfor( var i=0; i<line.length; i++ )\r\n\t\t{\r\n\t\t\tvar pat = line[i].split( \": \" );\r\n\t\t\thttpRequestEnd[pat[0]] = pat[1];\r\n\t\t}\r\n\t\tif( httpRequestEnd.Type == \"DASH-MANIFEST\" )\r\n\t\t{\r\n\t\t\thttpRequestEnd.type = eMEDIATYPE_MANIFEST;\r\n\t\t}\r\n\t\telse if( httpRequestEnd.Type==\"IFRAME\" )\r\n\t\t{\r\n\t\t\thttpRequestEnd.type = eMEDIATYPE_IFRAME;\r\n\t\t}\r\n\t\telse if( httpRequestEnd.Type==\"VIDEO\" )\r\n\t\t{\r\n\t\t\thttpRequestEnd.type = eMEDIATYPE_VIDEO;\r\n\t\t}\r\n\t\telse if( httpRequestEnd.Type==\"AUDIO\" )\r\n\t\t{\r\n\t\t\thttpRequestEnd.type = eMEDIATYPE_AUDIO;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tconsole.log( \"unk type! '\" + httpRequestEnd.Type + \"'\" );\r\n\t\t}\r\n\t\t//httpRequestEnd.br = hack_cur_bitrate;\r\n\t\thttpRequestEnd.ulSz = httpRequestEnd.RequestedSize;\r\n\t\thttpRequestEnd.dlSz = httpRequestEnd.DownloadSize;\r\n\t\thttpRequestEnd.total = httpRequestEnd.TotalTime;\r\n\t\thttpRequestEnd.responseCode = parseInt(httpRequestEnd.hcode)||parseInt(httpRequestEnd.cerr);\r\n\t\thttpRequestEnd.url = httpRequestEnd.Url;\r\n\t\t\r\n\t\treturn httpRequestEnd;\r\n\t}\r\n\t\r\n\t\r\n\tprefix = \"HttpRequestEnd:\";\r\n\toffs = line.indexOf(prefix);\r\n\tif( offs>=0 )\r\n\t{ // handle HttpRequestEnd as logged by aamp\r\n\t\tvar json = line.substr(offs+prefix.length);\r\n\t\ttry\r\n\t\t{\r\n\t\t\trc = JSON.parse(json);\r\n\t\t}\r\n\t\tcatch( err )\r\n\t\t{\r\n\r\n\t\t\t// Parse the logs having comma in url\r\n\t\t\tvar parseUrl = json.split(\",http\");\r\n\r\n\t\t\tvar param = parseUrl[0].split(\",\");\r\n\r\n\t\t\t//insert url to param list\r\n\t\t\tparam.push(\"http\" + parseUrl[1]);\r\n\r\n\t\t\tvar fields = \"mediaType,type,responseCode,curlTime,total,connect,startTransfer,resolve,appConnect,preTransfer,redirect,dlSz,ulSz\";\r\n\t\t\tif( param[0] != parseInt(param[0]) )\r\n\t\t\t{\r\n\t\t\t\t// Old log format\r\n\t\t\t\tif( param.length == 16) {\r\n\t\t\t\t\t// use downloadbps value as br\r\n\t\t\t\t\tfields = \"appName,\" + fields + \",br,url\";\r\n\t\t\t\t} else if( param.length == 17) {\r\n\t\t\t\t\tfields = \"appName,\" + fields + \",downloadbps,br,url\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif( param.length == 15) {\r\n\t\t\t\t\tfields += \",br,url\";\r\n\t\t\t\t} else if( param.length == 16) {\r\n\t\t\t\t\tfields += \",downloadbps,br,url\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfields = fields.split(\",\");\r\n\t\t\tvar httpRequestEnd = {};\r\n\t\t\tfor( var i=0; i<fields.length; i++ )\r\n\t\t\t{\r\n\t\t\t\thttpRequestEnd[fields[i]] = param[i];\r\n\t\t\t};\r\n\t\t\thttpRequestEnd.type = parseInt(httpRequestEnd.type);\r\n\t\t\thttpRequestEnd.responseCode = parseInt(httpRequestEnd.responseCode);\r\n\t\t\thttpRequestEnd.curlTime = parseFloat(httpRequestEnd.curlTime);\r\n\t\t\treturn httpRequestEnd;\r\n\t\t}\r\n\t}\r\n\t\r\n\tprefix = \"HttpLicenseRequestEnd:\";\r\n\toffs = line.indexOf(prefix);\r\n\tif( offs>=0 )\r\n\t{\r\n\t\tvar json = line.substr(offs+prefix.length);\r\n\t\ttry\r\n\t\t{\r\n\t\t\trc = JSON.parse(json);\r\n\t\t\trc.url = rc.license_url;\r\n\t\t\trc.type = eMEDIATYPE_LICENSE;\r\n\t\t}\r\n\t\tcatch( err )\r\n\t\t{\r\n\t\t\tconsole.log( \"ignoring corrupt JSON from receiver log<JSON>\" + json + \"</JSON>\" );\r\n\t\t}\r\n\t}\r\n\treturn rc;\r\n}", "title": "" }, { "docid": "40127021ec20ecba907ca95539a42fd5", "score": "0.5190383", "text": "function Ze(ut){Ke(\"ondata\"),pt=!1;var bt=Ve.write(ut);!1!==bt||pt||((1===at.pipesCount&&at.pipes===Ve||1<at.pipesCount&&-1!==Ce(at.pipes,Ve))&&!st&&(Ke(\"false write response, pause\",dt._readableState.awaitDrain),dt._readableState.awaitDrain++,pt=!0),dt.pause())}// if the dest has an error, then stop piping into it.", "title": "" }, { "docid": "657c4e118d7ae3e8a4f2de93acebd566", "score": "0.5185121", "text": "function onRequestFinished() {\n requestCounter--;\n\n //Check if requests are remaining\n if (requestCounter <= 0) {\n //Avoid negative counts\n requestCounter = 0;\n\n //Emit event indicating that all HTTP requests have concluded\n $rootScope.$emit(\"requestsFinished\");\n } else {\n //Emit event indicating HTTP requests in progress\n $rootScope.$emit(\"requestsProgressing\", requestCounter);\n }\n }", "title": "" }, { "docid": "fb1f147826740642a044210909f74e0b", "score": "0.5180437", "text": "handleData(data) {\n let shifted = Buffer.alloc(data.length+1)\n data.copy(shifted, 1)\n\n if(Protocol.isReplyData(shifted)) {\n // TODO: find out whats in ReplyData-Packet\n const cb = this.curPacketsReply.shift()\n cb()\n return\n }\n\n const cmd = shifted[3]\n const body = Protocol.sliceResponse(shifted)\n const cb = this.curPackets[cmd]\n if(cb) {\n this.curPackets[cmd] = undefined\n cb(body)\n } else {\n this.emit('error', `got packet without sending request (cmd: ${cmd})`)\n }\n\n }", "title": "" }, { "docid": "3884f982ba77d0325a7e818036e3d321", "score": "0.51716113", "text": "function onDataReceived(data){\r\n\t\t\t\t\tintermediateResults = intermediateResults.concat(data.results);\r\n\t\t\t\t\tjobFinish++;\r\n\t\t\t\t\tdownloadTime += data.time.download;\r\n\t\t\t\t\tmapTime += data.time.map;\r\n\t\t\t\t\tevents.progress(jobFinish / jobs.length * 100, {\r\n\t\t\t\t\t\ttime : (new Date() - timeStart),\r\n\t\t\t\t\t\tdownload : downloadTime,\r\n\t\t\t\t\t\tmap : mapTime\r\n\t\t\t\t\t});\r\n\t\t\t\t\tif(jobs.length == jobFinish){\r\n\t\t\t\t\t\tfunction groupBy(list) {\r\n\t\t\t\t\t\t\tvar ret = [];\r\n\t\t\t\t\t\t\tfor (var i in list) {\r\n\t\t\t\t\t\t\t\tvar key = list[i].key;\r\n\t\t\t\t\t\t\t\tvar value = list[i].value;\r\n\t\t\t\t\t\t\t\tif (!ret[key]) {\r\n\t\t\t\t\t\t\t\t\tret[key] = [];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tret[key].push(value);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn ret;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar groups = groupBy(intermediateResults);\r\n\t\t\t\t\t\tfor(var key in groups) {\r\n\t\t\t\t\t\t\tvar values = groups[key];\r\n\t\t\t\t\t\t\tresults.push(args.reduce(key, values));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tevents.finish(results);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "title": "" }, { "docid": "b02fe2beb5369dba79150384915ea75f", "score": "0.51706827", "text": "function getAllChunkDataFn(req, res){\n\n res.send(slaveTable.getAllChunk());\n}", "title": "" }, { "docid": "005ea1859e5a260d38ec450e315408c0", "score": "0.5170217", "text": "handleRequest(payload, next, end) {\n if (this.requiresSignature(payload.method)) {\n this.handleSignatureRequest(payload, end);\n return;\n }\n next();\n }", "title": "" }, { "docid": "b31df212f891986d33a76422c75d3794", "score": "0.5161773", "text": "requestRawWithCallback(info, data, onResult) {\n if (typeof data === \"string\") {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers[\"Content-Length\"] = Buffer.byteLength(data, \"utf8\");\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n __name(handleResult, \"handleResult\");\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(void 0, res);\n });\n let socket;\n req.on(\"socket\", (sock) => {\n socket = sock;\n });\n req.setTimeout(this._socketTimeout || 3 * 6e4, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on(\"error\", function(err) {\n handleResult(err);\n });\n if (data && typeof data === \"string\") {\n req.write(data, \"utf8\");\n }\n if (data && typeof data !== \"string\") {\n data.on(\"close\", function() {\n req.end();\n });\n data.pipe(req);\n } else {\n req.end();\n }\n }", "title": "" }, { "docid": "a8f68b94abf54cce4dfefef6256734ab", "score": "0.5158505", "text": "_handleData(data) {\n // Clear response timeout\n clearTimeout(this.responseTimeout)\n\n this.responseData.push(...Array.from(data))\n\n if (this.responseData.length < 4 ||\n this.responseData[this.responseData.length - 1] !== 0x04 ||\n this.responseData[this.responseData.length - 2] == 0x10)\n return\n\n // Unescape control characters and strip front and back\n let response = this.unescape(this.responseData.slice(1, -1))\n\n // Empty response buffer\n this.responseData = []\n\n // Set the last response\n this.lastResponse = response.slice(1, -2)\n\n // Emit new processed data event\n this.emit('newData', this.lastResponse)\n }", "title": "" }, { "docid": "d971e7f649ee58a313baee647cb58efc", "score": "0.51550394", "text": "onReceiveSeriesData() {}", "title": "" }, { "docid": "4425df0b0dcda25cc4d35f6a0dcbd3f2", "score": "0.5149385", "text": "function invokeSuper() {\n if (data === undefined) {\n return end.call(req.res);\n } else if (encoding === undefined) {\n return end.call(req.res, data);\n } else {\n return end.call(req.res, data, encoding);\n }\n }", "title": "" }, { "docid": "214ef651cc81eefbd57d0210cf058a7d", "score": "0.51483786", "text": "async beforeEnd() {\n // To be extended by subclasses\n }", "title": "" }, { "docid": "b3bce11eecf002bb41d1ec473b9f2258", "score": "0.5141363", "text": "onend() {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n }", "title": "" }, { "docid": "0b7fe41f8049503d86d2de3d6de7b83d", "score": "0.513966", "text": "function httpResponseCallback(response) {\n var httpContent;\n\n //another chunk of data has been recieved, so append it to `httpContent`\n response.on('data', function (chunk) {\n if (httpContent === undefined) httpContent = chunk;else httpContent += chunk;\n });\n\n //Response complete. Call callback function to handle data\n response.on('end', function () {\n console.log(\"Response.END\");\n callerCallback(context, identifier, JSON.parse(httpContent));\n });\n\n //on error, logs an event\n response.on('error', function () {\n console.log(\"getFromApi Error in HTTP response\");\n console.log(\"Resource asked:\" + link);\n });\n }", "title": "" }, { "docid": "01a8cdcc490eb71708ea5f0dcf06569a", "score": "0.5130145", "text": "function onEnd(fn) {\n onEndCallback = fn;\n}", "title": "" }, { "docid": "17489a0e180c121bbbb59c156632650a", "score": "0.51260304", "text": "recieveData(data){}", "title": "" }, { "docid": "7c0458127d152bd565f06a55426ce12a", "score": "0.5109168", "text": "end() {}", "title": "" }, { "docid": "7c0458127d152bd565f06a55426ce12a", "score": "0.5109168", "text": "end() {}", "title": "" }, { "docid": "bbdd56097f60c6cb5f9f3e0e6f9c0725", "score": "0.5108036", "text": "function closeloop (err) {\n proxd.remove(req);\n proxd.remove(res);\n\n if (err) {\n debug('(http) error: %s - %s:%d', err.message, out.host, out.port);\n self.emit('error', err, out);\n if (cb) return cb(err);\n writeError(req, res, err);\n } else {\n debug('(http) end: %s %s:%d %s', out.method, out.host, out.port, out.path);\n self.emit('end', out);\n if (cb) return cb(null);\n }\n }", "title": "" }, { "docid": "f7b23e54029e599c2fa10d40a6fe5d9a", "score": "0.5104217", "text": "onData(chunk, level) {\n this.documentStarted = true;\n return this.onDataCallback(chunk, level + 1);\n }", "title": "" }, { "docid": "39e3a20bec583f250664c1ab45c71989", "score": "0.50986177", "text": "handleEvent(stream) {\n stream.on('data', (data) => this.receive(data));\n stream.on('end', () => this.server.close());\n }", "title": "" }, { "docid": "3717a1d27fe6ef93d8d76740a9bc0fe1", "score": "0.50595766", "text": "_onStreamData(data) {\n const text = data.toString();\n debug(`receiving data: ${text}`);\n this._accumulatedText += text;\n }", "title": "" }, { "docid": "a0a2abacce5597c1f9d57ccae9f55d2f", "score": "0.5053711", "text": "function FinishRequest(response, result,status) // vamos a pasar result \r\n{\r\n if(status)\r\n response.statusCode = status;\r\n else\r\n response.statusCode = 200;\r\n response.end(JSON.stringify(result));\r\n}", "title": "" }, { "docid": "db7e744ede81877c61ec29257ddb75f1", "score": "0.5046629", "text": "function callback(response) {\n var result = '';\t\t// string to hold the response\n\n // as each chunk comes in, add it to the result string:\n response.on('data', function (data) {\n result += data;\n });\n\n // when the final chunk comes in, print it out:\n response.on('end', function () {\n console.log(result);\n });\n }", "title": "" }, { "docid": "71756313900b6d7f163f4a49a81c80da", "score": "0.50454295", "text": "function onRequest(req,res){ \n var dataPosteada =\"\";\n var pathname= url.parse(req.url).pathname;\n console.log(\"Peticion para \"+ pathname +\" recibida.\");\n\n req.setEncoding(\"utf8\");\n\n req.addListener(\"data\", function(trozoPosteado){\n dataPosteada += trozoPosteado;\n console.log(\"Recibido trozo Post '\" + trozoPosteado + \"'.\");\n });\n \n req.addListener(\"end\", function(){\n route(handle, pathname,res, dataPosteada);\n });\n\n }", "title": "" }, { "docid": "13b8b2aa9ca5b3ecccfbf5789a8ad848", "score": "0.5045282", "text": "function addChunk(data){if(self._input!==null){self._input+=data;self._tokenizeToEnd(callback,false);}}// Parses until the end", "title": "" }, { "docid": "4cd65879a3076b719eb1d20a851e3e08", "score": "0.50413185", "text": "function through(write, end, opts) {\n write = write || function (data) {\n this.queue(data);\n };\n\n end = end || function () {\n this.queue(null);\n };\n\n var ended = false,\n destroyed = false,\n buffer = [],\n _ended = false;\n var stream = new Stream();\n stream.readable = stream.writable = true;\n stream.paused = false; // stream.autoPause = !(opts && opts.autoPause === false)\n\n stream.autoDestroy = !(opts && opts.autoDestroy === false);\n\n stream.write = function (data) {\n write.call(this, data);\n return !stream.paused;\n };\n\n function drain() {\n while (buffer.length && !stream.paused) {\n var data = buffer.shift();\n if (null === data) return stream.emit('end'); else stream.emit('data', data);\n }\n }\n\n stream.queue = stream.push = function (data) {\n // console.error(ended)\n if (_ended) return stream;\n if (data === null) _ended = true;\n buffer.push(data);\n drain();\n return stream;\n }; //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n\n stream.on('end', function () {\n stream.readable = false;\n if (!stream.writable && stream.autoDestroy) process.nextTick(function () {\n stream.destroy();\n });\n });\n\n function _end() {\n stream.writable = false;\n end.call(stream);\n if (!stream.readable && stream.autoDestroy) stream.destroy();\n }\n\n stream.end = function (data) {\n if (ended) return;\n ended = true;\n if (arguments.length) stream.write(data);\n\n _end(); // will emit or queue\n\n\n return stream;\n };\n\n stream.destroy = function () {\n if (destroyed) return;\n destroyed = true;\n ended = true;\n buffer.length = 0;\n stream.writable = stream.readable = false;\n stream.emit('close');\n return stream;\n };\n\n stream.pause = function () {\n if (stream.paused) return;\n stream.paused = true;\n return stream;\n };\n\n stream.resume = function () {\n if (stream.paused) {\n stream.paused = false;\n stream.emit('resume');\n }\n\n drain(); //may have become paused again,\n //as drain emits 'data'.\n\n if (!stream.paused) stream.emit('drain');\n return stream;\n };\n\n return stream;\n }", "title": "" }, { "docid": "c0f09a60734ea6d39d191d4d23e2d670", "score": "0.50360835", "text": "emitBuffered() {\n this.receiveBuffer.forEach((args)=>this.emitEvent(args)\n );\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet)=>this.packet(packet)\n );\n this.sendBuffer = [];\n }", "title": "" }, { "docid": "8f0d247defb60abfa99006bbd29d4416", "score": "0.5035721", "text": "emitBuffered() {\n this.receiveBuffer.forEach(args => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach(packet => this.packet(packet));\n this.sendBuffer = [];\n }", "title": "" }, { "docid": "8f0d247defb60abfa99006bbd29d4416", "score": "0.5035721", "text": "emitBuffered() {\n this.receiveBuffer.forEach(args => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach(packet => this.packet(packet));\n this.sendBuffer = [];\n }", "title": "" }, { "docid": "ae564c42a32c14f393eee18013227d7e", "score": "0.5034636", "text": "parseChunks(chunk, byteStart) {\n if (!this._onError || !this._onMediaInfo || !this._onTrackMetadata || !this._onDataAvailable) {\n throw new IllegalStateException('Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified');\n }\n\n // qli5: fix nonzero byteStart\n let offset = byteStart || 0;\n let le = this._littleEndian;\n\n if (byteStart === 0) { // buffer with FLV header\n if (chunk.byteLength > 13) {\n let probeData = FLVDemuxer.probe(chunk);\n offset = probeData.dataOffset;\n } else {\n return 0;\n }\n }\n\n if (this._firstParse) { // handle PreviousTagSize0 before Tag1\n this._firstParse = false;\n if (offset !== this._dataOffset) {\n Log.w(this.TAG, 'First time parsing but chunk byteStart invalid!');\n }\n\n let v = new DataView(chunk, offset);\n let prevTagSize0 = v.getUint32(0, !le);\n if (prevTagSize0 !== 0) {\n Log.w(this.TAG, 'PrevTagSize0 !== 0 !!!');\n }\n offset += 4;\n }\n\n while (offset < chunk.byteLength) {\n this._dispatch = true;\n\n let v = new DataView(chunk, offset);\n\n if (offset + 11 + 4 > chunk.byteLength) {\n // data not enough for parsing an flv tag\n break;\n }\n\n let tagType = v.getUint8(0);\n let dataSize = v.getUint32(0, !le) & 0x00FFFFFF;\n\n if (offset + 11 + dataSize + 4 > chunk.byteLength) {\n // data not enough for parsing actual data body\n break;\n }\n\n if (tagType !== 8 && tagType !== 9 && tagType !== 18) {\n Log.w(this.TAG, `Unsupported tag type ${tagType}, skipped`);\n // consume the whole tag (skip it)\n offset += 11 + dataSize + 4;\n continue;\n }\n\n let ts2 = v.getUint8(4);\n let ts1 = v.getUint8(5);\n let ts0 = v.getUint8(6);\n let ts3 = v.getUint8(7);\n\n let timestamp = ts0 | (ts1 << 8) | (ts2 << 16) | (ts3 << 24);\n\n let streamId = v.getUint32(7, !le) & 0x00FFFFFF;\n if (streamId !== 0) {\n Log.w(this.TAG, 'Meet tag which has StreamID != 0!');\n }\n\n let dataOffset = offset + 11;\n\n switch (tagType) {\n case 8: // Audio\n this._parseAudioData(chunk, dataOffset, dataSize, timestamp);\n break;\n case 9: // Video\n break;\n case 18: // ScriptDataObject\n break;\n }\n\n let prevTagSize = v.getUint32(11 + dataSize, !le);\n if (prevTagSize !== 11 + dataSize) {\n Log.w(this.TAG, `Invalid PrevTagSize ${prevTagSize}`);\n }\n\n offset += 11 + dataSize + 4; // tagBody + dataSize + prevTagSize\n }\n\n // dispatch parsed frames to consumer (typically, the remuxer)\n if (this._isInitialMetadataDispatched()) {\n if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {\n this._onDataAvailable(this._audioTrack, this._videoTrack);\n }\n }\n\n return offset; // consumed bytes, just equals latest offset index\n }", "title": "" }, { "docid": "3307813ea7cf607c7b9fb205d7c09152", "score": "0.50302714", "text": "function logEnd(req,res,next) {\n logger.info(helpers.endReqHandlingString(req,res));\n if (next) next();\n}", "title": "" }, { "docid": "b22e44b88a46bb2102c4f0027180cf0c", "score": "0.50262374", "text": "function completeRequest(err) {\n if (err) {\n // prepare error message\n res.error = new JsonRpcError.InternalError(err);\n // return error-first and res with err\n return onDone(err, res);\n }\n var returnHandlers = allReturnHandlers.filter(Boolean).reverse();\n onDone(null, { isComplete: isComplete, returnHandlers: returnHandlers });\n }", "title": "" }, { "docid": "565e445522c1d962db95013b41bd458b", "score": "0.502561", "text": "onData(data) { }", "title": "" }, { "docid": "fe9284d3bda4241e0adb366cff8082d4", "score": "0.5024671", "text": "function handleDataAvailable(e) {\n console.log('video data available');\n recordedChunks.push(e.data);\n}", "title": "" }, { "docid": "fa9815f898bacee7b6207545a260607b", "score": "0.50200516", "text": "parseChunks(chunk, byteStart) {\n if (!this._onError || !this._onMediaInfo || !this._onTrackMetadata || !this._onDataAvailable) {\n throw new _exception.IllegalStateException('Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified');\n }\n\n let offset = 0;\n let le = this._littleEndian;\n\n if (byteStart === 0) {\n // buffer with FLV header\n if (chunk.byteLength > 13) {\n let probeData = FLVDemuxer.probe(chunk);\n offset = probeData.dataOffset;\n } else {\n return 0;\n }\n }\n\n if (this._firstParse) {\n // handle PreviousTagSize0 before Tag1\n this._firstParse = false;\n\n if (byteStart + offset !== this._dataOffset) {\n _logger.default.w(this.TAG, 'First time parsing but chunk byteStart invalid!');\n }\n\n let v = new DataView(chunk, offset);\n let prevTagSize0 = v.getUint32(0, !le);\n\n if (prevTagSize0 !== 0) {\n _logger.default.w(this.TAG, 'PrevTagSize0 !== 0 !!!');\n }\n\n offset += 4;\n }\n\n while (offset < chunk.byteLength) {\n this._dispatch = true;\n let v = new DataView(chunk, offset);\n\n if (offset + 11 + 4 > chunk.byteLength) {\n // data not enough for parsing an flv tag\n break;\n }\n\n let tagType = v.getUint8(0);\n let dataSize = v.getUint32(0, !le) & 0x00FFFFFF;\n\n if (offset + 11 + dataSize + 4 > chunk.byteLength) {\n // data not enough for parsing actual data body\n break;\n }\n\n if (tagType !== 8 && tagType !== 9 && tagType !== 18) {\n _logger.default.w(this.TAG, `Unsupported tag type ${tagType}, skipped`); // consume the whole tag (skip it)\n\n\n offset += 11 + dataSize + 4;\n continue;\n }\n\n let ts2 = v.getUint8(4);\n let ts1 = v.getUint8(5);\n let ts0 = v.getUint8(6);\n let ts3 = v.getUint8(7);\n let timestamp = ts0 | ts1 << 8 | ts2 << 16 | ts3 << 24;\n let streamId = v.getUint32(7, !le) & 0x00FFFFFF;\n\n if (streamId !== 0) {\n _logger.default.w(this.TAG, 'Meet tag which has StreamID != 0!');\n }\n\n let dataOffset = offset + 11;\n\n switch (tagType) {\n case 8:\n // Audio\n this._parseAudioData(chunk, dataOffset, dataSize, timestamp);\n\n break;\n\n case 9:\n // Video\n this._parseVideoData(chunk, dataOffset, dataSize, timestamp, byteStart + offset);\n\n break;\n\n case 18:\n // ScriptDataObject\n this._parseScriptData(chunk, dataOffset, dataSize);\n\n break;\n }\n\n let prevTagSize = v.getUint32(11 + dataSize, !le);\n\n if (prevTagSize !== 11 + dataSize) {\n _logger.default.w(this.TAG, `Invalid PrevTagSize ${prevTagSize}`);\n }\n\n offset += 11 + dataSize + 4; // tagBody + dataSize + prevTagSize\n } // dispatch parsed frames to consumer (typically, the remuxer)\n\n\n if (this._isInitialMetadataDispatched()) {\n if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {\n this._onDataAvailable(this._audioTrack, this._videoTrack);\n }\n }\n\n return offset; // consumed bytes, just equals latest offset index\n }", "title": "" }, { "docid": "fea378f001f6493330cdef2e94d2c304", "score": "0.5019264", "text": "requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }", "title": "" }, { "docid": "fea378f001f6493330cdef2e94d2c304", "score": "0.5019264", "text": "requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }", "title": "" }, { "docid": "fea378f001f6493330cdef2e94d2c304", "score": "0.5019264", "text": "requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }", "title": "" }, { "docid": "fea378f001f6493330cdef2e94d2c304", "score": "0.5019264", "text": "requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }", "title": "" }, { "docid": "fea378f001f6493330cdef2e94d2c304", "score": "0.5019264", "text": "requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }", "title": "" }, { "docid": "aa02ed6bcc6cb44a0a5476be27912ecd", "score": "0.50184387", "text": "function emitBuffer() {\n if (!this._buffer) {\n return;\n }\n for (var i = this._marker; i < this._buffer.length; i++) {\n var data = this._buffer[i];\n if (data.writable === true) {\n break;\n } else if (data.writable === false) {\n emitBuffer.call(data);\n } else {\n this.emit('data', data, 'utf8');\n }\n }\n if (i === this._buffer.length) {\n delete this._buffer;\n delete this._marker;\n if (!this.writable) {\n this.emit('end');\n }\n } else {\n this._marker = i;\n }\n}", "title": "" }, { "docid": "7c8d19bade4e54afb36280af24754ee4", "score": "0.5013595", "text": "respond(event,data,socket){\n\t\tdata = JSON.stringify(data);\n\t\tthis.io.to(socket.id).emit(event,data);\n\t}", "title": "" }, { "docid": "7ead409813f26e3262a3ac06a6ba613d", "score": "0.5003047", "text": "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "title": "" }, { "docid": "a879f7419b3f9a955c9f39587e8b57bb", "score": "0.50029564", "text": "function nudge(emitter, eventSpecs) {\n\t'use strict';\n\n\tcheckValidity(eventSpecs);\n\n\tvar proxy = makeProxyEmitter(emitter, eventSpecs);\n\t\n\n\t\n\treturn function (req, res) {\n\t\tfunction write(string) {\n\t\t\tres.write(string);\n\t\t}\n\t\t\n\t\n\t\t// Necessary headers for SSE.\n\t\tres.status(200).set({\n\t\t\t'Content-Type': 'text/event-stream',\n\t\t\t'Cache-Control': 'no-cache',\n\t\t\t'Connection': 'keep-alive'\n\t\t});\n\t\t\n\t\t// SSE required newline.\n\t\tres.write('\\n');\n\t\t\n\t\tif (req.hasOwnProperty('headers')) {\n\t\t\twrite.lastEventId = req.headers['last-event-id'];\n\t\t}\n\t\t\t\n\t\tproxy.on('data', write);\n\n\t\treq.once('close', function () {\n\t\t\tproxy.removeListener('data', write);\n\t\t});\n\n\t\t\n\n\t};\n}", "title": "" }, { "docid": "fc94f339651227f855dfc60aa2b12582", "score": "0.5000448", "text": "requestRawWithCallback(info, data, onResult) {\n let socket;\n if (typeof (data) === 'string') {\n info.options.headers[\"Content-Length\"] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n let handleResult = (err, res) => {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n };\n let req = info.httpModule.request(info.options, (msg) => {\n let res = new HttpClientResponse(msg);\n handleResult(null, res);\n });\n req.on('socket', (sock) => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error('Request timeout: ' + info.options.path), null);\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err, null);\n });\n if (data && typeof (data) === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof (data) !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }", "title": "" }, { "docid": "fc94f339651227f855dfc60aa2b12582", "score": "0.5000448", "text": "requestRawWithCallback(info, data, onResult) {\n let socket;\n if (typeof (data) === 'string') {\n info.options.headers[\"Content-Length\"] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n let handleResult = (err, res) => {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n };\n let req = info.httpModule.request(info.options, (msg) => {\n let res = new HttpClientResponse(msg);\n handleResult(null, res);\n });\n req.on('socket', (sock) => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error('Request timeout: ' + info.options.path), null);\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err, null);\n });\n if (data && typeof (data) === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof (data) !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }", "title": "" }, { "docid": "fc94f339651227f855dfc60aa2b12582", "score": "0.5000448", "text": "requestRawWithCallback(info, data, onResult) {\n let socket;\n if (typeof (data) === 'string') {\n info.options.headers[\"Content-Length\"] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n let handleResult = (err, res) => {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n };\n let req = info.httpModule.request(info.options, (msg) => {\n let res = new HttpClientResponse(msg);\n handleResult(null, res);\n });\n req.on('socket', (sock) => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error('Request timeout: ' + info.options.path), null);\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err, null);\n });\n if (data && typeof (data) === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof (data) !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }", "title": "" }, { "docid": "e59c77d41f04115a08f746b406c985ea", "score": "0.49987406", "text": "function through (write, end) {\n write = write || function (data) { this.emit('data', data) }\n end = end || function () { this.emit('end') }\n\n var ended = false, destroyed = false\n var stream = new Stream(), buffer = []\n stream.buffer = buffer\n stream.readable = stream.writable = true\n stream.paused = false\n stream.write = function (data) {\n write.call(this, data)\n return !stream.paused\n }\n\n function drain() {\n while(buffer.length && !stream.paused) {\n var data = buffer.shift()\n if(null === data)\n return stream.emit('end')\n else\n stream.emit('data', data)\n }\n }\n\n stream.queue = function (data) {\n buffer.push(data)\n drain()\n }\n\n //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n stream.on('end', function () {\n stream.readable = false\n if(!stream.writable)\n process.nextTick(function () {\n stream.destroy()\n })\n })\n\n function _end () {\n stream.writable = false\n end.call(stream)\n if(!stream.readable)\n stream.destroy()\n }\n\n stream.end = function (data) {\n if(ended) return\n ended = true\n if(arguments.length) stream.write(data)\n _end() // will emit or queue\n }\n\n stream.destroy = function () {\n if(destroyed) return\n destroyed = true\n ended = true\n buffer.length = 0\n stream.writable = stream.readable = false\n stream.emit('close')\n }\n\n stream.pause = function () {\n if(stream.paused) return\n stream.paused = true\n stream.emit('pause')\n }\n stream.resume = function () {\n if(stream.paused) {\n stream.paused = false\n }\n drain()\n //may have become paused again,\n //as drain emits 'data'.\n if(!stream.paused)\n stream.emit('drain')\n }\n return stream\n}", "title": "" }, { "docid": "e59c77d41f04115a08f746b406c985ea", "score": "0.49987406", "text": "function through (write, end) {\n write = write || function (data) { this.emit('data', data) }\n end = end || function () { this.emit('end') }\n\n var ended = false, destroyed = false\n var stream = new Stream(), buffer = []\n stream.buffer = buffer\n stream.readable = stream.writable = true\n stream.paused = false\n stream.write = function (data) {\n write.call(this, data)\n return !stream.paused\n }\n\n function drain() {\n while(buffer.length && !stream.paused) {\n var data = buffer.shift()\n if(null === data)\n return stream.emit('end')\n else\n stream.emit('data', data)\n }\n }\n\n stream.queue = function (data) {\n buffer.push(data)\n drain()\n }\n\n //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n stream.on('end', function () {\n stream.readable = false\n if(!stream.writable)\n process.nextTick(function () {\n stream.destroy()\n })\n })\n\n function _end () {\n stream.writable = false\n end.call(stream)\n if(!stream.readable)\n stream.destroy()\n }\n\n stream.end = function (data) {\n if(ended) return\n ended = true\n if(arguments.length) stream.write(data)\n _end() // will emit or queue\n }\n\n stream.destroy = function () {\n if(destroyed) return\n destroyed = true\n ended = true\n buffer.length = 0\n stream.writable = stream.readable = false\n stream.emit('close')\n }\n\n stream.pause = function () {\n if(stream.paused) return\n stream.paused = true\n stream.emit('pause')\n }\n stream.resume = function () {\n if(stream.paused) {\n stream.paused = false\n }\n drain()\n //may have become paused again,\n //as drain emits 'data'.\n if(!stream.paused)\n stream.emit('drain')\n }\n return stream\n}", "title": "" }, { "docid": "e59c77d41f04115a08f746b406c985ea", "score": "0.49987406", "text": "function through (write, end) {\n write = write || function (data) { this.emit('data', data) }\n end = end || function () { this.emit('end') }\n\n var ended = false, destroyed = false\n var stream = new Stream(), buffer = []\n stream.buffer = buffer\n stream.readable = stream.writable = true\n stream.paused = false\n stream.write = function (data) {\n write.call(this, data)\n return !stream.paused\n }\n\n function drain() {\n while(buffer.length && !stream.paused) {\n var data = buffer.shift()\n if(null === data)\n return stream.emit('end')\n else\n stream.emit('data', data)\n }\n }\n\n stream.queue = function (data) {\n buffer.push(data)\n drain()\n }\n\n //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n stream.on('end', function () {\n stream.readable = false\n if(!stream.writable)\n process.nextTick(function () {\n stream.destroy()\n })\n })\n\n function _end () {\n stream.writable = false\n end.call(stream)\n if(!stream.readable)\n stream.destroy()\n }\n\n stream.end = function (data) {\n if(ended) return\n ended = true\n if(arguments.length) stream.write(data)\n _end() // will emit or queue\n }\n\n stream.destroy = function () {\n if(destroyed) return\n destroyed = true\n ended = true\n buffer.length = 0\n stream.writable = stream.readable = false\n stream.emit('close')\n }\n\n stream.pause = function () {\n if(stream.paused) return\n stream.paused = true\n stream.emit('pause')\n }\n stream.resume = function () {\n if(stream.paused) {\n stream.paused = false\n }\n drain()\n //may have become paused again,\n //as drain emits 'data'.\n if(!stream.paused)\n stream.emit('drain')\n }\n return stream\n}", "title": "" }, { "docid": "492d70e4759070e6bef6decfb0aa2acb", "score": "0.49964136", "text": "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "title": "" }, { "docid": "492d70e4759070e6bef6decfb0aa2acb", "score": "0.49964136", "text": "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "title": "" }, { "docid": "492d70e4759070e6bef6decfb0aa2acb", "score": "0.49964136", "text": "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "title": "" }, { "docid": "e7d72c4e1ef6d2ea9ee289cdf33e4252", "score": "0.4996387", "text": "_onData(data) {\n while (this._process) {\n switch (this._state) {\n case STATE_HEADER:\n this._getHeader();\n break;\n case STATE_PAYLOAD:\n this._getPayload();\n break;\n }\n }\n }", "title": "" }, { "docid": "10eddb556c557760d8709a4c2ecda01e", "score": "0.49938896", "text": "_read() {\n this.data += 1;\n if (this.data <= 5) {\n const chunk = this.data.toString();\n //console.log(\"_read() was called with chunk=\"+chunk)\n this.push(chunk);\n } else {\n this.push(null); //push null to say \"end of stream\"\n }\n }", "title": "" }, { "docid": "7daba6fdc96a7c48fe6fd96eaa5da2de", "score": "0.49914753", "text": "get end() { return this._end; }", "title": "" }, { "docid": "7daba6fdc96a7c48fe6fd96eaa5da2de", "score": "0.49914753", "text": "get end() { return this._end; }", "title": "" }, { "docid": "7daba6fdc96a7c48fe6fd96eaa5da2de", "score": "0.49914753", "text": "get end() { return this._end; }", "title": "" }, { "docid": "3b8715f6950a63defd2c476145cee591", "score": "0.498384", "text": "function q_send(data) {\n \n Session.request_id += 1;\n \n var xhr = createXHR();\n \n xhr.open('POST', self.url.protocol+'://'+self.url.host+':'+self.url.port+'/'+Session.prefix+'/session/'+Session.id+'/'+Session.request_id);\n xhr.setRequestHeader(\"Content-Type\", \"text/plain\");\n \n xhr.onreadystatechange = function(event) {\n \n if (xhr.readyState == 4) {\n if (xhr.status == 200) {\n \n // Check if more stuff has arrived... can I do this here?? hmmm\n if (output_queue.length>0) {\n var more_data = '';\n for(var i=0; i<output_queue.length; i++) {\n more_data += output_queue.shift();\n }\n \n q_send(more_data); // Send it\n } else {\n Session.sending = 0;\n }\n \n // Something went wrong so the connection will be closed\n } else {\n self.close();\n }\n }\n \n }\n xhr.send(data);\n \n // Update stats\n self.stats.bytes_send += data.length;\n self.stats.frames_send += 1\n \n }", "title": "" } ]
b26e18b5df165aba5b646a41ea641c24
Open the IndexedDB database (automatically creates one if one didn't previously exist), using any options set in the config.
[ { "docid": "136f71d0f817b82794466678b417eb24", "score": "0.0", "text": "function _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n // Initialize a singleton container for all running localForages.\n if (!dbContexts) {\n dbContexts = {};\n }\n\n // Get the current context of the database;\n var dbContext = dbContexts[dbInfo.name];\n\n // ...or create a new context.\n if (!dbContext) {\n dbContext = {\n // Running localForages sharing a database.\n forages: [],\n // Shared database.\n db: null,\n // Database readiness (promise).\n dbReady: null,\n // Deferred operations on the database.\n deferredOperations: []\n };\n // Register the new context in the global container.\n dbContexts[dbInfo.name] = dbContext;\n }\n\n // Register itself as a running localForage in the current context.\n dbContext.forages.push(self);\n\n // Replace the default `ready()` function with the specialized one.\n if (!self._initReady) {\n self._initReady = self.ready;\n self.ready = _fullyReady;\n }\n\n // Create an array of initialization states of the related localForages.\n var initPromises = [];\n\n function ignoreErrors() {\n // Don't handle errors here,\n // just makes sure related localForages aren't pending.\n return Promise$1.resolve();\n }\n\n for (var j = 0; j < dbContext.forages.length; j++) {\n var forage = dbContext.forages[j];\n if (forage !== self) {\n // Don't wait for itself...\n initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n }\n }\n\n // Take a snapshot of the related localForages.\n var forages = dbContext.forages.slice(0);\n\n // Initialize the connection process only when\n // all the related localForages aren't pending.\n return Promise$1.all(initPromises).then(function () {\n dbInfo.db = dbContext.db;\n // Get the connection or open a new one without upgrade.\n return _getOriginalConnection(dbInfo);\n }).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n dbInfo.db = dbContext.db = db;\n self._dbInfo = dbInfo;\n // Share the final connection amongst related localForages.\n for (var k = 0; k < forages.length; k++) {\n var forage = forages[k];\n if (forage !== self) {\n // Self is already up-to-date.\n forage._dbInfo.db = dbInfo.db;\n forage._dbInfo.version = dbInfo.version;\n }\n }\n });\n}", "title": "" } ]
[ { "docid": "0902dfd5f18da4d6554aa55574ea552f", "score": "0.7571323", "text": "function openDb() {\n console.log(\"openDb ...\");\n var req = indexedDB.open(DB_NAME, DB_VERSION);\n req.onsuccess = function (evt) {\n // Better use \"this\" than \"req\" to get the result to avoid problems with\n // garbage collection.\n // db = req.result;\n db = this.result;\n console.log(\"openDb DONE\");\n };\n req.onerror = function (evt) {\n console.error(\"openDb:\", evt.target.errorCode);\n };\n\n req.onupgradeneeded = function (evt) {\n console.log(\"openDb.onupgradeneeded\");\n var store = evt.currentTarget.result.createObjectStore(\n DB_STORE_NAME, { keyPath: 'parada'});\n\n store.createIndex('titulo', 'titulo', { unique: false });\n store.createIndex('descripcion', 'descripcion', { unique: false });\n \n };\n }", "title": "" }, { "docid": "e5389aeef129bf380cc0485a05895adb", "score": "0.73137146", "text": "function openIndexedDb(create) {\n let req = window.indexedDB.open(DB_NAME, 1);\n\n req.onupgradeneeded = evt => {\n if (!create) {\n evt.target.transaction.abort();\n return;\n }\n\n let db = evt.target.result;\n if (!db.objectStoreNames.contains(\"keys\")) {\n db.createObjectStore(\"keys\", { keyPath: \"id\", autoIncrement: true });\n }\n };\n\n return req;\n}", "title": "" }, { "docid": "22dfa8e614fb78190cc1884dced12674", "score": "0.7297252", "text": "static openDB() {\r\n // return db promise object\r\n return idb.open(DB_NAME, 1, upgradeDB => {\r\n if (!upgradeDB.objectStoreNames.contains(RESTAURANTS_STR)) {\r\n // create restaurant object store\r\n const restaurants_store = upgradeDB.createObjectStore(RESTAURANTS_STR,\r\n {keyPath: 'id'}\r\n );\r\n // create neighborhood and cuisine indices\r\n restaurants_store.createIndex('neighborhood', 'neighborhood', {\r\n unique: false\r\n });\r\n restaurants_store.createIndex('cuisine', 'cuisine_type', {\r\n unique: false\r\n });\r\n }\r\n\r\n if (!upgradeDB.objectStoreNames.contains(REVIEWS_STR)) {\r\n // create reviews object store\r\n const reviews_store = upgradeDB.createObjectStore(REVIEWS_STR,\r\n {keyPath: 'id'}\r\n );\r\n // create restaurant_id index\r\n reviews_store.createIndex('restaurant_id', 'restaurant_id', {\r\n unique: false\r\n }); \r\n }\r\n });\r\n }", "title": "" }, { "docid": "11bf076436c45f53b7a6a937bd9d30ff", "score": "0.7283351", "text": "function openDb() {\n var req = indexedDB.open(DB_NAME, DB_VERSION);\n req.onsuccess = function (evt) {\n db = this.result;\n getResult(db.store);\n\n // Save button click event\n document.getElementById(\"save-data\").addEventListener(\"click\", (event) => {\n event.preventDefault();\n saveAllChanges(db.store);\n });\n // clearObjectStore(db.store);\n };\n req.onerror = function (evt) {\n console.error(\"openDb:\", evt.target.errorCode);\n };\n\n req.onupgradeneeded = function (evt) {\n console.log(\"openDb.onupgradeneeded\");\n var store = evt.currentTarget.result.createObjectStore(\n DB_STORE_NAME, {keyPath: 'id', autoIncrement: true});\n\n store.createIndex(\"id\", \"id\", {unique: true});\n store.createIndex(\"conditionAnswer\", \"conditionAnswer\", {unique: false});\n store.createIndex(\"condition\", \"condition\", {unique: false});\n store.createIndex(\"question\", \"question\", {unique: false});\n store.createIndex(\"type\", \"type\", {unique: false});\n store.createIndex(\"subquestions\", \"subquestions\", {unique: false});\n };\n}", "title": "" }, { "docid": "57661a5e09783d2af80cb5f1140f32c5", "score": "0.7271357", "text": "function openIndexedDB(chain_id) {\n\t return iDB.root.getProperty(\"current_wallet\", \"default\").then(function (current_wallet) {\n\t current_wallet_name = current_wallet;\n\t var database_name = getDatabaseName(current_wallet, chain_id);\n\t return openDatabase(database_name);\n\t });\n\t }", "title": "" }, { "docid": "5b27eb2a82ead568b198f60290595e00", "score": "0.7177996", "text": "static openDB() {\r\n const DB_NAME = `Restaurants Reviews`;\r\n let DB_VERSION = 1;\r\n\r\n // If the browser doesn't support indexedDB,\r\n // we don't care about having a database\r\n if (!('indexedDB' in window)) {\r\n return null;\r\n }\r\n\r\n return idb.open(DB_NAME, DB_VERSION, (upgradeDb) => {\r\n if (!upgradeDb.objectStoreNames.contains(DBHelper.RESTAURANT_STORE)) {\r\n const restaurant_store = upgradeDb.createObjectStore(DBHelper.RESTAURANT_STORE, { keyPath: 'id' });\r\n restaurant_store.createIndex('id', 'id');\r\n const reviews_store = upgradeDb.createObjectStore(DBHelper.REVIEW_STORE, { keyPath: 'id' });\r\n reviews_store.createIndex('restaurant_id', 'restaurant_id', { unique: false });\r\n const outbox_data = upgradeDb.createObjectStore(DBHelper.OFFLINE_STORE, { keyPath: 'createdAt' });\r\n outbox_data.createIndex('createdAt', 'createdAt');\r\n }\r\n });\r\n }", "title": "" }, { "docid": "2bac91f3d192f95cdc80baceee275f79", "score": "0.7146736", "text": "function openDB(name, version, { blocked, upgrade, blocking } = {}) {\n var request = indexedDB.open(name, version);\n if (upgrade) {\n request.addEventListener('upgradeneeded', event => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction));\n });\n }\n\n return wrap(request);\n}", "title": "" }, { "docid": "907ba56660dc04b7355b75b3f243b1e5", "score": "0.7076001", "text": "function initDatabase(){\n dbPromise = idb.openDb(APP_DB_NAME, 1, function (upgradeDb) {\n if (!upgradeDb.objectStoreNames.contains(STORY_STORE_NAME)) {\n var storyOS = upgradeDb.createObjectStore(STORY_STORE_NAME, {keyPath: 'id', autoIncrement: true});\n storyOS.createIndex('id', '_id', {unique: true, multiEntry: false});\n storyOS.createIndex('author', 'author.username', {unique: false, multiEntry:true})\n }\n if(!upgradeDb.objectStoreNames.contains(EVENT_STORE_NAME)) {\n var eventOS = upgradeDb.createObjectStore(EVENT_STORE_NAME, {keyPath: 'id', autoIncrement: true});\n eventOS.createIndex('id', '_id', {unique: true, multiEntry: false});\n }\n });\n}", "title": "" }, { "docid": "3348d6186ff95f7c4ef75af886c2f290", "score": "0.70560056", "text": "function openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap_idb_value_wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap_idb_value_wrap(request.result), event.oldVersion, event.newVersion, wrap_idb_value_wrap(request.transaction));\n });\n }\n if (blocked)\n request.addEventListener('blocked', () => blocked());\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking)\n db.addEventListener('versionchange', () => blocking());\n })\n .catch(() => { });\n return openPromise;\n}", "title": "" }, { "docid": "78a0b227f8220a53f9f335a14d429ecb", "score": "0.70079553", "text": "static openDatabase() {\n if (!navigator.serviceWorker) {\n console.warn(\"[service-worker] is not supported in this browser\");\n return;\n }\n return idb.open(this.DBNAME, 1, upgradeDb => {\n if (!upgradeDb.objectStoreNames.contains(this.RESTAURANTS_STORE)) {\n const store = upgradeDb.createObjectStore(this.RESTAURANTS_STORE, {\n keyPath: this.ID_INDEX\n });\n store.createIndex(this.ID_INDEX, this.ID_INDEX);\n }\n\n if (!upgradeDb.objectStoreNames.contains(this.REVIEWS_STORE)) {\n const objs = upgradeDb.createObjectStore(this.REVIEWS_STORE, {\n keyPath: this.ID_INDEX\n });\n objs.createIndex(this.ID_INDEX, this.REVIEWS_INDEX);\n }\n\n if (!upgradeDb.objectStoreNames.contains(this.PENDING_REVIEWS_STORE)) {\n const objs = upgradeDb.createObjectStore(this.PENDING_REVIEWS_STORE, {\n autoIncrement: true\n });\n }\n });\n }", "title": "" }, { "docid": "78a0b227f8220a53f9f335a14d429ecb", "score": "0.70079553", "text": "static openDatabase() {\n if (!navigator.serviceWorker) {\n console.warn(\"[service-worker] is not supported in this browser\");\n return;\n }\n return idb.open(this.DBNAME, 1, upgradeDb => {\n if (!upgradeDb.objectStoreNames.contains(this.RESTAURANTS_STORE)) {\n const store = upgradeDb.createObjectStore(this.RESTAURANTS_STORE, {\n keyPath: this.ID_INDEX\n });\n store.createIndex(this.ID_INDEX, this.ID_INDEX);\n }\n\n if (!upgradeDb.objectStoreNames.contains(this.REVIEWS_STORE)) {\n const objs = upgradeDb.createObjectStore(this.REVIEWS_STORE, {\n keyPath: this.ID_INDEX\n });\n objs.createIndex(this.ID_INDEX, this.REVIEWS_INDEX);\n }\n\n if (!upgradeDb.objectStoreNames.contains(this.PENDING_REVIEWS_STORE)) {\n const objs = upgradeDb.createObjectStore(this.PENDING_REVIEWS_STORE, {\n autoIncrement: true\n });\n }\n });\n }", "title": "" }, { "docid": "288cee357125048fc30e244e2a8f6c53", "score": "0.7006968", "text": "static async open (orbitdbC, encAddr, aesKey, dbOptions = {}) {\n if (!orbitdbC) throw new Error('orbitdbC must be defined')\n if (!encAddr) throw new Error('encAddr must be defined')\n if (!aesKey) throw new Error('aesKey must be defined')\n const keyCheck = await this.keyCheck(encAddr, aesKey)\n if (!keyCheck) throw new Error('keyCheck failed')\n const dbVector = { address: encAddr.toString(), options: dbOptions }\n const db = await orbitdbC.openDb(dbVector)\n try {\n return new EncryptedIndex(db, aesKey)\n } catch (e) {\n console.error(e)\n throw new Error('failed to mount EncryptedDocstore')\n }\n }", "title": "" }, { "docid": "d4e53afb650ff2f66b3968fe47d49b29", "score": "0.6962502", "text": "constructor () {\n this.db = null;\n\n this.db_req = indexedDB.open(dbName, dbVersion);\n\n this.db_req.onerror = (event) => {\n console.log(\"Error creating/accessing IndexedDB database\");\n }\n\n this.db_req.onsuccess = (event) => {\n this.db = this.db_req.result;\n\n this.db.onerror = (event) => {\n console.log(\"Error creating/accessing IndexedDB database\");\n };\n\n if (this.db.setVersion) {\n if (this.db.version != dbVersion) {\n const setVersion = this.db.setVersion(dbVersion);\n setVersion.onsuccess = (event) => {\n this.createObjectStore(db);\n };\n }\n }\n };\n\n this.db_req.onupgradeneeded = (event) => {\n this.createObjectStore(event.target.result);\n };\n }", "title": "" }, { "docid": "ec3380745a11c39f6b3a4808073e60d2", "score": "0.691793", "text": "function openDatabase(options) {\n var db;\n var sqlitePlugin = 'sqlitePlugin';\n if (global[sqlitePlugin]) {\n // device implementation\n options = _.clone(options);\n if (!options.key) {\n if (options.security) {\n options.key = options.security;\n delete options.security;\n }\n else if (options.credentials) {\n options.key = cipher.hashJsonSync(options.credentials, 'sha256').toString('hex');\n delete options.credentials;\n }\n }\n if (!options.location) {\n options.location = 2;\n }\n db = global[sqlitePlugin].openDatabase(options);\n }\n else if (global['openDatabase']) {\n // native implementation\n db = global['openDatabase'](options.name, options.version || '', options.description || '', options.size || 1024 * 1024);\n }\n else if (process && !process['browser']) {\n // node.js implementation\n var websql = void 0;\n try {\n websql = require('websql');\n }\n catch (error) {\n diag.debug.warn(error);\n }\n if (websql) {\n db = websql(options.name, options.version || '', options.description || '', options.size || 1024 * 1024);\n }\n }\n if (!db) {\n // when this is reached no supported implementation is present\n throw new Error('WebSQL implementation is not available');\n }\n return db;\n}", "title": "" }, { "docid": "dacda75defd52548bfa3c8bc732911f3", "score": "0.6910028", "text": "static openDatabase() {\n if (!navigator.serviceWorker) {\n return Promise.resolve();\n }\n return idb.open('restaurant-reviews-app', 2, function (upgradeDb) {\n switch (upgradeDb.oldVersion) {\n case 0:\n const store = upgradeDb.createObjectStore('restaurants', {\n keyPath: 'id'\n });\n store.createIndex('cuisine', 'cuisine_type');\n store.createIndex('neighborhood', 'neighborhood');\n case 1:\n const reviewsStore = upgradeDb.createObjectStore('reviews', {\n keyPath: 'id'\n });\n reviewsStore.createIndex('restaurant', 'restaurant_id');\n upgradeDb.createObjectStore('reviewQueue', {\n autoIncrement: true\n });\n upgradeDb.createObjectStore('favoriteQueue', {\n autoIncrement: true\n });\n }\n });\n }", "title": "" }, { "docid": "3ee08329812ac494139cd9744dbdae15", "score": "0.67912465", "text": "init() {\n let self = this;\n let request = window.indexedDB.open(this.get('dbName'),this.get('version'));\n\n request.onerror = function() {\n console.log('Unable to open IndexedDB');\n };\n\n request.onupgradeneeded = function(event) {\n let db = event.target.result;\n \n db.onerror = function(event) {\n console.log('IndexedDB error: ' + event.target.errorCode);\n };\n\n self.get('models').forEach(model => {\n if (!db.objectStoreNames.contains(model)) {\n db.createObjectStore(model, {keyPath: 'id'});\n }\n });\n };\n }", "title": "" }, { "docid": "30ad7ade631c05693fc985ed845d00c1", "score": "0.6789449", "text": "function _initStorage(options) {\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n return new Promise(function(resolve, reject) {\n var openreq = indexedDB.open(dbInfo.name, dbInfo.version);\n openreq.onerror = function withStoreOnError() {\n reject(openreq.error);\n };\n openreq.onupgradeneeded = function withStoreOnUpgradeNeeded() {\n // First time setup: create an empty object store\n openreq.result.createObjectStore(dbInfo.storeName);\n };\n openreq.onsuccess = function withStoreOnSuccess() {\n db = openreq.result;\n resolve();\n };\n });\n }", "title": "" }, { "docid": "616fbe83e1415caeabcb37c5dcfd9371", "score": "0.6776221", "text": "function createDB() {\n const createDB = window.indexedDB.open('crm', 4);\n\n createDB.onerror = function() {\n console.log('Error')\n }\n\n createDB.onsuccess = function() {\n DB = createDB.result;\n };\n\n createDB.onupgradeneeded = function(e) {\n const db = e.target.result;\n\n const objectStore = db.createObjectStore('crm', { keyPath: 'id', autoIncrement: true });\n\n objectStore.createIndex('name', 'name', { unique: false });\n objectStore.createIndex('email', 'email', { unique: true});\n objectStore.createIndex('phone', 'phone', { unique: false });\n objectStore.createIndex('company', 'company', { unique: false });\n objectStore.createIndex('id', 'id', { unique: true });\n \n console.log('DB ready 🚀')\n }\n }", "title": "" }, { "docid": "dd78251b5226f93c2d372345b635466a", "score": "0.67522633", "text": "static openIDBConnection() {\r\n if (!navigator.serviceWorker) {\r\n return Promise.resolve();\r\n }\r\n return idb.open(IDB_DATABASE, 1, upgradeDatabase => {\r\n const store = upgradeDatabase.createObjectStore(IDB_OBJECT, {\r\n keyPath: \"id\"\r\n });\r\n store.createIndex(\"by-id\", \"id\");\r\n const reviewsStore = upgradeDatabase.createObjectStore(\r\n IDB_REVIEWS_OBJECT,\r\n {\r\n keyPath: \"id\"\r\n }\r\n );\r\n reviewsStore.createIndex(\"restaurant_id\", \"restaurant_id\");\r\n upgradeDatabase.createObjectStore(IDB_REVIEWS_OBJECT_OFFLINE, {\r\n keyPath: \"updatedAt\"\r\n });\r\n });\r\n }", "title": "" }, { "docid": "fb4f7d1e7f0de43b4c8adb526e210d9b", "score": "0.6745798", "text": "async connect() {\n return new Promise((resolve, reject) => {\n\n let request = window.indexedDB.open(this.DB_NAME, this.DB_VERSION)\n\n request.onerror = e => {\n console.log('Error opening ' + this.DB_NAME, e)\n reject('Error')\n }\n\n request.onsuccess = e => {\n resolve(e.target.result)\n }\n\n request.onupgradeneeded = e => {\n console.log('onupgradeneeded')\n let db = e.target.result\n let objectStore = db.createObjectStore('store', {autoIncrement: true, keyPath: 'id'})\n }\n })\n }", "title": "" }, { "docid": "976e21a6b6b2451cf42d637cbe511a31", "score": "0.6730576", "text": "function openConnection() {\n return new Promise((reslove, reject) => {\n const req = idb.open(dbName, dbVersion);\n let db;\n\n req.onupgradeneeded = () => {\n db = req.result;\n if (!db.objectStoreNames.contains(storeName)) {\n db.createObjectStore(storeName);\n }\n };\n\n req.onsuccess = () => {\n db = req.result;\n reslove(db);\n };\n\n req.onerror = (error) => {\n reject(error);\n };\n });\n}", "title": "" }, { "docid": "5877f95c06fee4cd4a9c92ddfa0fd7ed", "score": "0.6712889", "text": "openDatabase() {\r\n \r\n // If there is no support for service workers, we wont use DB for offline first techniques\r\n if (!navigator.serviceWorker) {\r\n return Promise.resolve();\r\n }\r\n\r\n // Open a connection and initialise store\r\n this.db = idb.open(DB_NAME, DB_VERSION, upgradeDb => {\r\n\r\n // Initialise store.\r\n upgradeDb.createObjectStore(DB_STORE_NAME_RESTAURANTS);\r\n upgradeDb.createObjectStore(DB_STORE_NAME_REVIEWS);\r\n \r\n const pendingReviewsStore = upgradeDb.createObjectStore(DB_STORE_NAME_PENDING_REVIEWS);\r\n pendingReviewsStore.createIndex(\"restaurant_id\", \"restaurant_id\", { unique: false, multiEntry: true });\r\n pendingReviewsStore.createIndex(\"_id\", \"_id\", { unique: true, multiEntry: false });\r\n\r\n });\r\n\r\n return this.db;\r\n }", "title": "" }, { "docid": "b00a0c8a3c70612de37d641eda20df0c", "score": "0.6683159", "text": "function openConnection() {\n // open the indexedDB database\n var request = indexedDB.open(\"MoviesDatabase\", 1);\n\n request.onupgradeneeded = function (e) { // cuando es necesario crear las tablas de la base de datos, la primera vez\n dbMoviesDatabase = e.target.result;\n if (!dbMoviesDatabase.objectStoreNames.contains(objectStoreName)) {\n var os = dbMoviesDatabase.createObjectStore(objectStoreName, { keyPath: \"id\" }); // crear tabla\n }\n }\n //the database was opened successfully\n request.onsuccess = function (e) {\n dbMoviesDatabase = e.target.result;\n }\n //An error was fired\n request.onerror = function (e) {\n alert('error opening the BD');\n }\n }", "title": "" }, { "docid": "3bf98728570fb39453277959e18e8a81", "score": "0.66246915", "text": "function _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n return new Promise(function(resolve, reject) {\n var openreq = indexedDB.open(dbInfo.name, dbInfo.version);\n openreq.onerror = function() {\n reject(openreq.error);\n };\n openreq.onupgradeneeded = function() {\n // First time setup: create an empty object store\n openreq.result.createObjectStore(dbInfo.storeName);\n };\n openreq.onsuccess = function() {\n dbInfo.db = openreq.result;\n self._dbInfo = dbInfo;\n resolve();\n };\n });\n }", "title": "" }, { "docid": "c514b57af492ed5456c2aa2d54c669eb", "score": "0.66189855", "text": "static openDatabase() {\n return idb.open('restaurant-reviews', 3, function(upgradeDb) {\n switch(upgradeDb.oldVersion) {\n case 0:\n upgradeDb.createObjectStore('restaurants', {\n keyPath: 'id'\n });\n case 1:\n upgradeDb.createObjectStore('reviews', {\n keyPath: 'id',\n autoIncrement: true\n });\n }\n });\n }", "title": "" }, { "docid": "34089f2d11976b810d5931ea3bbbe47d", "score": "0.6616837", "text": "function DB(){\n\t\t\t\treturn window.openDatabase('testdb', '1.0', 'testdb', 200000);\n\t\t\t}", "title": "" }, { "docid": "ed8697294783a0d78f3d9b0760ac86f4", "score": "0.6615261", "text": "static async open(dbName, dbVersion) {\n const noteDatabase = new NoteDatabase()\n const openReq = indexedDB.open(dbName, dbVersion)\n \n openReq.onupgradeneeded = (event) => {\n const db = event.target.result\n\n if (event.oldVersion < 1) {\n const objectStore = db.createObjectStore(\"notes\", {\n keyPath: \"id\",\n autoIncrement: true\n })\n }\n\n if (event.oldVersion < 3) {\n const transaction = event.target.transaction\n const objectStore = transaction.objectStore(\"notes\")\n const time = new Date().getTime()\n objectStore.add({\n createAt: time,\n modifiedAt: time,\n title: \"Notepad へようこそ\",\n body: \"Notepad へようこそ。\\nhttps://github.com/comame/pwa_tools/tree/master/notepad\"\n })\n }\n }\n\n return new Promise((resolve, reject) => {\n openReq.onsuccess = (event) => {\n noteDatabase.db = event.target.result\n resolve(noteDatabase)\n }\n })\n }", "title": "" }, { "docid": "a840df01b7751029d671567e3b04f8f8", "score": "0.6548541", "text": "static openDB() {\n return idb.open('restorevs', dbVersion, upgradeDb => {\n var storeRestaurants = upgradeDb.createObjectStore('restaurants', {\n keyPath: 'id'\n });\n var storeReviews = upgradeDb.createObjectStore('reviews', {\n keyPath: 'id'\n });\n });\n }", "title": "" }, { "docid": "603d96f1e8dbb09ec4030a5e0c3d9c7e", "score": "0.6524246", "text": "open() {\n let promise = new Promise((resolve, reject) => {\n let request = indexedDB.open(this.databaseName, this.version);\n \n request.onsuccess = () => {\n this.db = request.result;\n \n // BUGBUG - Need better UI by letting the main page handle this.\n this.db.onversionchange = (event) => {\n this.close();\n alert(\"A new version of this page is ready. Please refresh.\");\n };\n \n resolve(this.db);\n };\n \n request.onerror = () => {\n reject(request.error);\n };\n \n request.onupgradeneeded = (event) => {\n this.db = request.result;\n this.upgradeDatabase(event.oldVersion);\n };\n \n request.onblocked = (event) => {\n // If some other tab is loaded with the database, \n // then it needs to be closed before we can proceed.\n // BUGBUG - need better UI by letting the main page handle this.\n alert(\"Please close all other tabs with this site open!\");\n };\n \n });\n\n return promise;\n }", "title": "" }, { "docid": "2d16969cef66eb993721334acfba3099", "score": "0.6476784", "text": "function _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n return new Promise(function(resolve, reject) {\n var openreq = indexedDB.open(dbInfo.name, dbInfo.version);\n openreq.onerror = function() {\n reject(openreq.error);\n };\n openreq.onupgradeneeded = function(e) {\n // First time setup: create an empty object store\n openreq.result.createObjectStore(dbInfo.storeName);\n if (e.oldVersion <= 1) {\n // added when support for blob shims was added\n openreq.result.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n }\n };\n openreq.onsuccess = function() {\n dbInfo.db = openreq.result;\n self._dbInfo = dbInfo;\n resolve();\n };\n });\n }", "title": "" }, { "docid": "9232013b44d136506f8223c54b787363", "score": "0.64705837", "text": "function initDatabase() {\n //open database, create the object store ('table') and create the indexes ('fields')\n dbPromise = idb.openDb(SOCIAL_MEDIA_DB_NAME, 1, function (upgradeDb) {\n if (!upgradeDb.objectStoreNames.contains(LOGIN_STORE_NAME)) {\n var loginOS = upgradeDb.createObjectStore(LOGIN_STORE_NAME, {keyPath: 'username'});\n loginOS.createIndex('username', 'username', {unique: true, multiEntry: false});\n loginOS.createIndex('password', 'password', {unique: false, multiEntry: false});\n }\n if (!upgradeDb.objectStoreNames.contains(USERS_STORE_NAME)) {\n var usersOS = upgradeDb.createObjectStore(USERS_STORE_NAME, {keyPath: 'username'});\n usersOS.createIndex('username', 'username', {unique: false, multiEntry: true});\n usersOS.createIndex('first_name', 'first_name', {unique: false, multiEntry: true});\n usersOS.createIndex('last_name', 'last_name', {unique: false, multiEntry: true});\n }\n if (!upgradeDb.objectStoreNames.contains(STORIES_STORE_NAME)) {\n var storiesOS = upgradeDb.createObjectStore(STORIES_STORE_NAME, {keyPath: 'story_id'});\n storiesOS.createIndex('story_id', 'story_id', {unique: true, multiEntry: false});\n storiesOS.createIndex('username', 'username', {unique: false, multiEntry: false});\n storiesOS.createIndex('story_date', 'story_date', {unique: false, multiEntry: false});\n storiesOS.createIndex('story_text', 'story_text', {unique: false, multiEntry: false});\n storiesOS.createIndex('input_image', 'input_image', {unique: false, multiEntry: false});\n\n // add the other field later e.g pictures\n }\n if (!upgradeDb.objectStoreNames.contains(RATINGS_STORE_NAME)) {\n var ratingsOS = upgradeDb.createObjectStore(RATINGS_STORE_NAME, {keyPath: 'story_id'});\n ratingsOS.createIndex('story_id', 'story_id', {unique: false, multiEntry: false});\n ratingsOS.createIndex('username', 'username', {unique: false, multiEntry: false});\n ratingsOS.createIndex('vote', 'vote', {unique: false, multiEntry: false});\n ratingsOS.createIndex('rating_date', 'rating_date', {unique: false, multiEntry: false});\n }\n });\n}", "title": "" }, { "docid": "d926d6980de80aeefee5bfcf06b26409", "score": "0.64172596", "text": "function initDB() {\n dbPromise = idb.openDb(DB_NAME, 1, function (upgradeDB) {\n if (!upgradeDB.objectStoreNames.contains(DB_NAME)) {\n initBlogDB(upgradeDB);\n initImageDB(upgradeDB);\n initEventDB(upgradeDB);\n initBlogDraftDB(upgradeDB);\n initImageDraftDB(upgradeDB)\n }\n })\n}", "title": "" }, { "docid": "57a6b5ae214db43ff9ad0faf1a71c360", "score": "0.6386683", "text": "static dbPromise() {\r\n return idb.open('db', 3, upgradeDB => { \r\n switch(upgradeDB.oldVersion) {\r\n case 0:\r\n upgradeDB.createObjectStore('restaurants', {\r\n keyPath: 'id'\r\n });\r\n case 1:\r\n const reviewsDB = upgradeDB.createObjectStore('reviews', {\r\n keyPath: 'id'\r\n });\r\n reviewsDB.createIndex('restaurant', 'restaurant_id');\r\n }\r\n });\r\n }", "title": "" }, { "docid": "a52633ded1fe3164f7fa4948d07dd4e4", "score": "0.63865685", "text": "function openDb(readonly){\n return new sqlite3.Database('db/dbtest.sqlite', readonly ? sqlite3.OPEN_READONLY : (sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE), function (err) {\n if(err)\n console.log(err);\n });\n}", "title": "" }, { "docid": "bec2249e7a377ebf963f5f07d5bb576e", "score": "0.6377521", "text": "function test() {\n request = indexedDB.open('database-basics');\n request.onupgradeneeded = upgradeNeeded;\n request.onsuccess = onSuccess;\n request.onerror = unexpectedErrorCallback;\n request.onblocked = unexpectedBlockedCallback;\n}", "title": "" }, { "docid": "844914b86fbc0aff785125acae886d1b", "score": "0.6346058", "text": "static getDb() {\n return idb.open(DBHelper.DB_NAME, DBHelper.DB_VER, upgrade => {\n const storeRestaurants = upgrade.createObjectStore(DBHelper.STORE_RESTAURANTS, {\n keyPath: 'id',\n autoIncrement: true\n });\n // values for pendingUpdate 'yes', 'no' are used instead of boolean because IndexedDb doesn't support index on boolean column\n // due to many possible 'falsy' values\n storeRestaurants.createIndex('pending-updates', 'pendingUpdate', {\n unique: false\n });\n\n const storeReviews = upgrade.createObjectStore(DBHelper.STORE_REVIEWS, {\n keyPath: 'id',\n autoIncrement: true\n });\n\n storeReviews.createIndex('pending-updates', 'pendingUpdate', {\n unique: false\n });\n });\n }", "title": "" }, { "docid": "7a0550e10276c7f4a2f64bd2a050e406", "score": "0.6342218", "text": "async open() {\n await this.ndb.open();\n\n await this.indexer.open();\n\n await this.http.open();\n }", "title": "" }, { "docid": "a6676bb6b168ead026f0f40a39cfe8b6", "score": "0.63076764", "text": "static db(DB_NAME, DB_VERSION, TABLE) {\n return new Promise(function (resolve, reject) {\n // Make sure IndexedDB is supported before attempting to use it\n if (!self.indexedDB) {\n reject(\"IndexedDB not supported\");\n }\n const request = self.indexedDB.open(DB_NAME, DB_VERSION);\n request.onerror = function (event) {\n reject(\"Database error: \" + event.target.error);\n };\n request.onupgradeneeded = function (event) {\n const db = event.target.result;\n const upgradeTransaction = event.target.transaction;\n if (!db.objectStoreNames.contains(TABLE)) {\n DB_NAME = db.createObjectStore(TABLE, {\n keyPath: \"id\" // use this as index field\n });\n } else {\n DB_NAME = upgradeTransaction.objectStore(TABLE);\n }\n };\n request.onsuccess = function (event) {\n resolve(event.target.result);\n };\n });\n }", "title": "" }, { "docid": "1a6f52ab948b2d21a9d1081dee2d152a", "score": "0.6304344", "text": "static dbPromise() {\r\n return idb.open('db', 2, function(upgradeDb) {\r\n switch (upgradeDb.oldVersion) {\r\n case 0:\r\n // a placeholder case so that the switch block will\r\n // execute when the database is first created\r\n // (oldVersion is 0)\r\n // RL debugger;\r\n console.log('case 0');\r\n // RL console.log('id = ', id);\r\n upgradeDb.createObjectStore('restaurants', {keyPath: 'id'});\r\n case 1:\r\n //RL debugger;\r\n console.log('case 1');\r\n // RL console.log('id = ', id);\r\n const reviewsStore = upgradeDb.createObjectStore('reviews', {keyPath: 'id'});\r\n // RL From https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndex\r\n reviewsStore.createIndex('restaurant', 'restaurant_id');\r\n }\r\n }); // RL Put a semicolon here or not ???\r\n }", "title": "" }, { "docid": "3b0170dfe282b023068189a5c1083d11", "score": "0.6302575", "text": "function initDB() {\n _db = new Loki('settingsDB', {\n autosave: true,\n autosaveInterval: 1000, // 1 second\n });\n }", "title": "" }, { "docid": "fb3cdc71fc8630825f636eb992b56683", "score": "0.6289749", "text": "async function setupDB(){\n db = await idb.openDB(dbName, undefined, {\n upgrade(db){\n //console.log('creating object store');\n // Create object store\n objectStore=db.createObjectStore(osName, {keyPath: \"recid\" , autoIncrement:true});\n // Create an index to search records by datetime.\n objectStore.createIndex(\"dateidx\", \"date\", { unique: true });\n // Create an index to search records by room.\n objectStore.createIndex(\"roomidx\", \"room\", { unique: false });\n }\n });\n}", "title": "" }, { "docid": "08c4f22fd50c23aa3a081eac4acb96bf", "score": "0.628643", "text": "function withDB(callback) {\n let request = indexedDB.open(\"zipcodes\", 1); // Request v1 of the database\n request.onerror = console.error; // Log any errors\n request.onsuccess = () => {\n // Or call this when done\n let db = request.result; // The result of the request is the database\n callback(db); // Invoke the callback with the database\n };\n\n // If version 1 of the database does not yet exist, then this event\n // handler will be triggered. This is used to create and initialize\n // object stores and indexes when the DB is first created or to modify\n // them when we switch from one version of the DB schema to another.\n request.onupgradeneeded = () => {\n initdb(request.result, callback);\n };\n}", "title": "" }, { "docid": "e83adf87dd3dc64826661cd0c66aebab", "score": "0.6265571", "text": "async openDb() {\n const { open } = require('sqlite');\n const sqlite3 = require('sqlite3');\n\n // Path\n const appRoot = require('app-root-path');\n let dbPath = appRoot + '/movies.db';\n\n const env = process.env.NODE_ENV || 'development';\n if (env === 'test') {\n dbPath = appRoot + '/test.db';\n }\n\n // Connect\n return open({\n filename: dbPath,\n driver: sqlite3.Database,\n });\n }", "title": "" }, { "docid": "e2d62312afe69d09bf0c76dee8c4c324", "score": "0.62285966", "text": "function initDB()\n{\n\tconst dbName = getDBName();\n\tvar request = indexedDB.open(dbName,2);\n\t\n\trequest.onerror = function(event) {\n\t\tconsole.log(\"An error occurred while accessing trustmark DB:\" + event.target.errorCode);\n\t};\n\n\trequest.onsuccess = function(event) {\n\t\tconsole.log(\"DB successfully initialized.\");\n\t}\n\n\trequest.onupgradeneeded = function(event) {\n\t\tvar db = event.target.result;\n\t\t\n\t\t//Create all the tables/object stores\n\t\tcreateObjectStores(db);\n \t}\n\n\n}", "title": "" }, { "docid": "836eebfb0c7962e6c27534a10aa483ff", "score": "0.61810446", "text": "static dBPromise() {\n return idb.open('restaurantDb', 2, upgradeDB => {\n switch (upgradeDB.oldVersion) {\n case 0:\n upgradeDB.createObjectStore('restaurants', {\n keyPath: 'id'\n });\n case 1:\n upgradeDB.createObjectStore('reviews', {\n keyPath: 'id'\n });\n }\n });\n }", "title": "" }, { "docid": "b2c95a69ee11bcd7eecef8938663ac0e", "score": "0.6175306", "text": "function openDB(name, ver) {\n ///<summary>\n ///\t\tOpen databese with specified version\n ///</summary>\n ///<param name=\"name\" type=\"String\">\n ///\t\tName of the database to be open\n ///</param>\n ///<param name=\"ver\" type=\"Number\" optional=\"true\">\n ///\t\tVersion of database to be open\n ///</param>\n \t///<returns type=\"Promise\">Return open database promise</returns>\n \treturn new Promise(function (resolve, reject) {\n \t\tvar version = ver || 1,\n\t\t\t\trq = dragonDB.open(name, version);\n\n \t\trq.onsuccess = function (evt) {\n \t\t\tdragonDatabase = evt.target.result;\n \t\t\tdragonDatabase.onversionchange = function (event) {\n \t\t\t\t//close db if updated elseware\n \t\t\t\tif (event.target.close) {\n \t\t\t\t\tevent.target.close();\n \t\t\t\t}\n \t\t\t}\n \t\t\tresolve(dragonDatabase);\n \t\t};\n \t\trq.onerror = function (evt) {\n \t\t\tonerror(evt);\n \t\t\treject(evt.target.errorCode);\n \t\t}\n\n \t\trq.onupgradeneeded = function (evt) {\n \t\t\tdragonDatabase = evt.currentTarget.result;\n \t\t\ttry {\n \t\t\t\tif (initCallback) {\n \t\t\t\t\tPromise\n\t\t\t\t\t\t\t.all(initCallback())\n\t\t\t\t\t\t\t.then(function () {\n\t\t\t\t\t\t\t\t//dragonDatabase = evt.currentTarget.result;\n\t\t\t\t\t\t\t\tconsole.log(\"initCallback resolved\");\n\t\t\t\t\t\t\t}, function () {\n\t\t\t\t\t\t\t\treject();\n\t\t\t\t\t\t\t});\n \t\t\t\t}\n \t\t\t}\n \t\t\tcatch (ex) {\n \t\t\t\treject(ex);\n \t\t\t}\n \t\t}\n \t});\n }", "title": "" }, { "docid": "be7576091a5b89bba2cefe99f172ed5b", "score": "0.6139504", "text": "function openDatabaseWithOpts(opts) {\n return opts.websql(opts.name, opts.version, opts.description, opts.size);\n}", "title": "" }, { "docid": "be7576091a5b89bba2cefe99f172ed5b", "score": "0.6139504", "text": "function openDatabaseWithOpts(opts) {\n return opts.websql(opts.name, opts.version, opts.description, opts.size);\n}", "title": "" }, { "docid": "be7576091a5b89bba2cefe99f172ed5b", "score": "0.6139504", "text": "function openDatabaseWithOpts(opts) {\n return opts.websql(opts.name, opts.version, opts.description, opts.size);\n}", "title": "" }, { "docid": "a3d0d05df68571ae7c0d05992579406e", "score": "0.6136238", "text": "constructor( dbv, verbose )\n {\n Librarian.verbose = verbose;\n\n this.DB = null;\n this.DBVersion = dbv;\n // this.DBRequest = Librarian.indexedDB.open( 'Librarian', this.DBVersion );\n //\n // this.DBRequest.onerror = e => {\n // this.DB = e.target.result;\n // console.warn( 'User does not allow IndexedDB', e.target.errorCode );\n // };\n //\n // this.DBRequest.onupgradeneeded = e => {\n // this.DB = e.target.result;\n // this.fileStorage = this.createObjectStore( 'fileStorage', { keyPath: 'name' } );\n // this.fileIndex = this.createIndex( this.fileStorage, 'fileIndex', [ 'file.name', 'file.data' ] );\n // };\n //\n // this.DBRequest.onsuccess = e => {\n // this.DB = e.target.result;\n //\n // };\n //\n // this.DBRequest.onsuccess = function( e ) {\n // if( Librarian.verbose )\n // console.log( 'Librarian: onsuccess' );\n //\n // var db = e.target.result;\n // var tx = db.transaction( \"MyObjectStore\", \"readwrite\" );\n // if( Librarian.verbose )\n // console.log( tx );\n // var store = tx.objectStore( \"MyObjectStore\" );\n // var index = store.index( \"NameIndex\" );\n //\n // // Add some data\n // store.put( { id: 12345, name: { first: \"John\", last: \"Doe\" }, age: 42 } );\n // store.put( { id: 67890, name: { first: \"Bob\", last: \"Smith\" }, age: 35 } );\n //\n // // Query the data\n // var getJohn = store.get( 12345 );\n // var getBob = index.get( [ \"Smith\", \"Bob\" ] );\n //\n // getJohn.onsuccess = function() {\n // console.log( getJohn.result.name.first ); // => \"John\"\n // };\n //\n // getBob.onsuccess = function() {\n // console.log( getBob.result.name.first ); // => \"Bob\"\n // };\n //\n // // Close the db when the transaction is done\n // tx.oncomplete = function() {\n // db.close();\n // };\n // };\n }", "title": "" }, { "docid": "0b379a3a408b66f34e5601e7d9b2e304", "score": "0.61259997", "text": "constructor(dbName, dbVersion, dbUpgrade) {\n\n return new Promise((resolve, reject) => {\n\n // connection object\n this.db = null;\n\n // no support\n if (!('indexedDB' in window)) reject('not supported');\n\n // open database\n const dbOpen = indexedDB.open(dbName, dbVersion);\n\n if (dbUpgrade) {\n\n // database upgrade event\n dbOpen.onupgradeneeded = e => {\n dbUpgrade(dbOpen.result, e.oldVersion, e.newVersion);\n };\n }\n\n dbOpen.onsuccess = () => {\n this.db = dbOpen.result;\n resolve( this );\n };\n\n dbOpen.onerror = e => {\n reject(`IndexedDB error: ${ e.target.errorCode }`);\n };\n\n });\n\n }", "title": "" }, { "docid": "09a3640edd9f3f55ae49eacd95b4746d", "score": "0.61235464", "text": "function InitDb() {\n /* indexeddb jquery use based on https://github.com/axemclion/jquery-indexeddb/blob/master/example/index.html */ \n var key = null;\n /* remember: export my journey: add datetime persistence value to each object, with index, cluster on ranges, produce step-by-step interaction replay */\n var request = $.indexedDB(appName, {\n 'version': appVersion,\n 'schema': {\n '1': function (trans) { \n\n var seriesStore = trans.createObjectStore(series, {\n 'keypath': 'SeriesID',\n 'autoIncrement': false\n });\n\n var sitesStore = trans.createObjectStore(sites, {\n 'keypath': 'SiteID',\n 'autoIncrement': false\n });\n // sitesStore.createIndex('SiteName'); /* use in autocomplete? */\n\n var valuesStore = trans.createObjectStore(values, {\n 'keypath': 'myMetadata.SeriesID',\n 'autoIncrement': false\n });\n },\n '2': function (trans) {\n var stateStore = trans.createObjectStore(history, {\n 'keypath': 'Id',\n 'autoIncrement': true\n }); \n\n var ontologyStore = trans.createObjectStore(ontologyitems, {\n 'keypath': 'Id',\n 'autoIncrement': false\n });\n\n trans.deleteObjectStore(series);\n var seriesStore = trans.createObjectStore(series, {\n 'keypath': 'SeriesID',\n 'autoIncrement': false\n }); \n seriesStore.createIndex('LastDataRequest'); // tracks last time data values for this series were requested \n\n var datasetStore = trans.createObjectStore(datasets, {\n 'keypath': 'Id',\n 'autoIncrement': true\n });\n datasetStore.createIndex('CreationTime');\n datasetStore.createIndex('myTags', \n {\n 'unique': true,\n 'multientry': true // all tags for all objects listed in get() of this index, for single-loop search\n });\n\n // ontologyStore.createIndex('FacetID');\n },\n '3': function (trans) {\n var settingsStore = trans.createObjectStore(mysettings, {\n 'keypath': 'Id',\n 'autoIncrement': true\n });\n settingsStore.add({\n 'showTooltips': true,\n 'showIntroMovie': true\n });\n\n var selectionsStore = trans.createObjectStore(myselections, {\n 'keypath': 'Id',\n 'autoIncrement': false\n });\n },\n '4': function (trans) {\n var ontologyStore = trans.objectStore(ontologyitems);\n ontologyStore.createIndex('FacetID');\n },\n '5': function (trans) {\n var theNow = Date.now();\n var valueStore = trans.objectStore(values);\n var iter = valueStore.each(function (item) {\n var newItem = item;\n newItem.value.AccessTime = theNow; /* all data accessed before this update considered accessed at moment of update */\n item.update(newItem);\n });\n\n iter.done(function (result, event) {\n valueStore.createIndex('AccessTime');\n });\n \n iter.fail(function (error, event) {\n debugConsole('failed on insert of datetimes into valuestore objects during upgrade to schema 5. AccessTime index never created.');\n debugConsole(error);\n debugConsole(event);\n });\n\n },\n '6': function (trans) {\n trans.deleteObjectStore(myselections);\n }\n }\n });\n return request;\n}", "title": "" }, { "docid": "59adafb5037c106dfe0ddc7a10b10866", "score": "0.6110132", "text": "initDB() {\n cal.ASSERT(this.mStorageDb, \"Database has not been opened!\", true);\n\n try {\n this.mStorageDb.executeSimpleSQL(\"PRAGMA journal_mode=WAL\");\n this.mStorageDb.executeSimpleSQL(\"PRAGMA cache_size=-10240\"); // 10 MiB\n this.mStatements = new CalStorageStatements(this.mStorageDb);\n this.mItemModel = CalStorageModelFactory.createInstance(\n \"cached-item\",\n this.mStorageDb,\n this.mStatements,\n this\n );\n this.mOfflineModel = CalStorageModelFactory.createInstance(\n \"offline\",\n this.mStorageDb,\n this.mStatements,\n this\n );\n this.mMetaModel = CalStorageModelFactory.createInstance(\n \"metadata\",\n this.mStorageDb,\n this.mStatements,\n this\n );\n } catch (e) {\n this.mStorageDb.logError(\"Error initializing statements.\", e);\n }\n }", "title": "" }, { "docid": "65cce9abc11f21dfe791203c962e4cdc", "score": "0.60951155", "text": "function indexDB(idb, _options){\n\tthis.transaction;\n\tthis.objectStore;\n\tthis.$idb = {\"db\":idb};\n\tthis.options= merge({\n\t\tconsole: {\n\t\t\tviewTrans: true,\n\t\t\tviewWrite: false,\n\t\t\tviewRead: false\n\t\t}\n\t}, _options);\n}", "title": "" }, { "docid": "58862d87c74bcf1438c0a4d6fe0c86a6", "score": "0.60940766", "text": "function openDb() {\n return jsonfile.readFile(dbFilePath);\n}", "title": "" }, { "docid": "4c4bb1cd019755883fc3997c94b2d41e", "score": "0.60916543", "text": "function openDB() {\n var deferred = $q.defer();\n db = window.openDatabase(\"activityDB\", \"1.0\", \"Activities\", 1000000); \n deferred.resolve(db.transaction(createTable, errorCB, successCB));\n return deferred.promise;\n }", "title": "" }, { "docid": "5e8d1036c96afef38455a35ac34f9df3", "score": "0.60725385", "text": "function initDatabase() {\n //console.debug('called initDatabase()');\n\n try {\n if (!window.openDatabase) {\n alert('not supported');\n } else {\n var shortName = 'GolfDB';\n var version = '1.0';\n var displayName = 'Golf DB App';\n var maxSizeInBytes = 5000000;\n db = openDatabase(shortName, version, displayName, maxSizeInBytes);\n\n createTableIfNotExists();\n }\n } catch(e) {\n if (e == 2) {\n alert('Invalid database version');\n } else {\n alert('Unknown error ' + e);\n }\n return;\n }\n}", "title": "" }, { "docid": "cd054d6e84ed92d6fef9c4c052b4ba35", "score": "0.6011301", "text": "function initDB() {\n _db = new Loki('observationDB', {\n autosave: true,\n autosaveInterval: 1000, // 1 second\n });\n }", "title": "" }, { "docid": "ba6c102c8c33ba9ed5e44fd55f48e7f0", "score": "0.600152", "text": "function newDB(name, version, displayName, size) {\n\tDB = window.openDatabase(name, version, displayName, size);\n\tDB.transaction(createDB, errorDB, successDB);\n}", "title": "" }, { "docid": "37f65df4ef0c6cb3bd62fa1b067b4565", "score": "0.5997699", "text": "function onsuccess(db) {\n self._db = db\n\n var exists = self._db.objectStoreNames.contains(self._idbOpts.storeName)\n\n if (options.errorIfExists && exists) {\n self._db.close()\n callback(new Error('store already exists'))\n return\n }\n\n if (!options.createIfMissing && !exists) {\n self._db.close()\n callback(new Error('store does not exist'))\n return\n }\n\n if (options.createIfMissing && !exists) {\n self._db.close()\n\n var req2 = indexedDB.open(self.location, self._db.version + 1)\n\n req2.onerror = function(ev) {\n callback(ev.target.error)\n }\n\n req2.onupgradeneeded = function() {\n var db = req2.result\n db.createObjectStore(self._idbOpts.storeName, self._idbOpts)\n }\n\n req2.onsuccess = function() {\n self._db = req2.result\n callback(null, self)\n }\n\n return\n }\n\n callback(null, self)\n }", "title": "" }, { "docid": "90e85549bfb09b424d88735bcd30266c", "score": "0.5931127", "text": "function open() {\n try {\n var db = LS.LocalStorage.openDatabaseSync(\"harbour-weight-log\", \"\", \"Weight Log Storage\", 1000000);\n\n if (db.version == \"\") {\n db.changeVersion(\"\", \"1\",\n function(tx) {\n // date is measured in days since epoch\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS entries(date INTEGER UNIQUE, weight REAL);\");\n }\n );\n }\n } catch (e) {\n console.log(\"Could not open DB: \" + e);\n }\n return db;\n}", "title": "" }, { "docid": "ea58a3a6bba5bde677f552d3b0f657aa", "score": "0.59120965", "text": "function openDBConnection() {\n return new Promise((resolve, reject) => {\n dbObject = new sqlite3.Database('./reactApiConnectLayer/SQLiteDB/sqlite.db', (err) => {\n if (err) {\n reject({\n status: 'failure',\n message: err.message,\n data: []\n })\n } else {\n resolve({\n status: 'success',\n message: 'Connection successful',\n data: []\n })\n }\n })\n })\n}", "title": "" }, { "docid": "3be95ee1858f032d5de662acf4fe7c26", "score": "0.5906985", "text": "static get DB_PROMISE() {\r\n return idb.open('restaurants-db', 8, function (upgradeDb) {\r\n console.log('making a new object store');\r\n if (!upgradeDb.objectStoreNames.contains('restaurant')) {\r\n upgradeDb.createObjectStore('restaurant', { keyPath: 'id' });\r\n }\r\n if (!upgradeDb.objectStoreNames.contains('reviews')) {\r\n upgradeDb.createObjectStore('reviews', { keyPath: 'id' });\r\n }\r\n if (!upgradeDb.objectStoreNames.contains('reviews-unposted')) {\r\n upgradeDb.createObjectStore('reviews-unposted', { keyPath: 'id', autoIncrement: true });\r\n }\r\n });\r\n }", "title": "" }, { "docid": "eb16ec811d1e10310c0a4a96c936ae43", "score": "0.58933336", "text": "function startDBconneection(dbname) {\n //opens connection, if database exists open, if not create then open\n let sb = new sqlite3.Database('Code/db/scoozi.db', (err) => {\n //lets us know the status of what happened\n if (err) {\n console.error(err.message);\n } else {\n //if succeeded\n console.log('Connected to the '+ dbname +' database.');\n }\n\n });\n //returns obejct database\n db = sb;\n return sb;\n}", "title": "" }, { "docid": "40be085abbec53ec728440b581367651", "score": "0.5883628", "text": "function initDB() {\n _db = new Loki('lessonsDB', {\n autosave: true,\n autosaveInterval: 1000, // 1 second\n });\n }", "title": "" }, { "docid": "98ebcac5e804018eb070944935893e8a", "score": "0.58828884", "text": "function handleOpenDatabaseRequest(openDatabaseRequest)\r\n\t\t{\r\n\t\t\t//Creates database structures using configuration data specified in optionsObj, provided the open() call\r\n\t\t\t//which spawned openDatabaseRequest was called with a database version higher than the current one. This is triggered before onsuccess()\r\n\t\t\topenDatabaseRequest.onupgradeneeded = function(){\r\n\r\n\t\t\t\t//Get a handle to the requested database and use it to create the \r\n\t\t\t\t//object store specified by the pertinent properties in optionsObj\r\n\t\t\t\tvar database = openDatabaseRequest.result;\r\n\t\t\t\tvar targetObjectStore = database.createObjectStore(optionsObj.objectStoreData.name, optionsObj.objectStoreData);\r\n\t\t\t\t/////\r\n\r\n\t\t\t\t//Store the array of objects each containing configuration data for a \r\n\t\t\t\t//prospective index of targetObjectStore in a local variable for easier access\r\n\t\t\t\tvar objectStoreIndexDataArray = optionsObj.objectStoreIndexDataArray;\r\n\r\n\t\t\t\t//Loop through the objects in objectStoreIndexDataArray, using the\r\n\t\t\t\t//data contained in each to create an index for targetObjectStore\r\n\t\t\t\tvar indexCount = objectStoreIndexDataArray.length;\r\n\t\t\t\tfor(var i = 0; i < indexCount; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar currentIndexDataObj = objectStoreIndexDataArray[i];\r\n\t\t\t\t\ttargetObjectStore.createIndex(currentIndexDataObj.name, currentIndexDataObj.keyPath, currentIndexDataObj);\r\n\t\t\t\t}\r\n\t\t\t\t/////\r\n\t\t\t\t\r\n\t\t\t\twasUpgradeNeeded = true;\r\n\t\t\t}\r\n\t\t\t/////\r\n\r\n\t\t\t//Delegates control flow to set() using openDatabaseRequest's result: the specified database\r\n\t\t\topenDatabaseRequest.onsuccess = function(){ set(openDatabaseRequest.result); }\r\n\r\n\t\t\t//Progresses the execution of the set of operations the parent operation\r\n\t\t\t//belongs to in the event the desired database cannot be accessed\r\n\t\t\topenDatabaseRequest.onerror = openDatabaseRequest.onblocked = errorComplete;\r\n\t\t}", "title": "" }, { "docid": "f465c5c0e9ed55140c4c86a54fa71998", "score": "0.5851735", "text": "function testNewDBInstance() {\n if (!capability.indexedDb) {\n return;\n }\n\n asyncTestCase.waitForAsync('testNewDBInstance');\n\n /**\n * @param {!lf.raw.BackStore} rawDb\n * @return {!IThenable}\n */\n var onUpgrade = goog.testing.recordFunction(function(rawDb) {\n assertEquals(0, rawDb.getVersion());\n return goog.Promise.resolve();\n });\n\n var db = new lf.backstore.IndexedDB(lf.Global.get(), schema);\n db.init(onUpgrade).then(function() {\n onUpgrade.assertCallCount(1);\n asyncTestCase.continueTesting();\n });\n}", "title": "" }, { "docid": "97c53f90b9d9c67ad4b264450afe6bf8", "score": "0.5754787", "text": "function getDatabase() {\n return LocalStorage.openDatabaseSync(\"MyFinanceApp_db\", \"1.0\", \"StorageDatabase\", 1000000);\n}", "title": "" }, { "docid": "24594de5bef10bd2679c634559c9a59a", "score": "0.5753368", "text": "createDbConnection() {\n\t\treturn new sqlite.Database('users.db3');\n\t}", "title": "" }, { "docid": "51ba8bce1673adc6422a40697e6ee828", "score": "0.5728585", "text": "function validateIndexedDBOpenable() {\n return new Promise((resolve, reject) => {\n try {\n let preExist = true;\n const DB_CHECK_NAME =\n \"validate-browser-context-for-indexeddb-analytics-module\";\n const request = self.indexedDB.open(DB_CHECK_NAME);\n request.onsuccess = () => {\n request.result.close();\n // delete database only when it doesn't pre-exist\n if (!preExist) {\n self.indexedDB.deleteDatabase(DB_CHECK_NAME);\n }\n resolve(true);\n };\n request.onupgradeneeded = () => {\n preExist = false;\n };\n request.onerror = () => {\n var _a;\n reject(\n ((_a = request.error) === null || _a === void 0\n ? void 0\n : _a.message) || \"\"\n );\n };\n } catch (error) {\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "f5e374bb66b227cff74d6b7cdd8bd39e", "score": "0.5727483", "text": "function connDB() {\n return new Promise(function (resolve, reject) {\n let db = new sqlite.Database(DBPath, err => {\n if (err) {\n reject(err);\n } else {\n globalDB = db;\n resolve(db);\n }\n });\n });\n}", "title": "" }, { "docid": "6b950f56619d7e4b9be080b87e71f2a9", "score": "0.572542", "text": "function initDB() {\n\ttry {\n\t\tAlloy.createCollection(\"Settings\");\n\t\tAlloy.createCollection(\"CoginitionTestResult\");\n\t\tAlloy.createCollection(\"Survey\");\n\t\tAlloy.createCollection(\"SurveyListings\");\n\t\tAlloy.createCollection(\"SurveyResult\");\n\t\tAlloy.createCollection(\"SurveyResultListing\");\n\t\tAlloy.createCollection(\"Alerts\");\n\t\tAlloy.createCollection(\"location\");\n\t\tAlloy.createCollection(\"Articles\");\n\t\tAlloy.createCollection(\"surveyOptionList\");\n\t\tAlloy.createCollection(\"JewelCollection\");\n\t\tAlloy.createCollection(\"AdminShedule\");\n\t\tAlloy.createCollection(\"LocalSchedule\");\n\t\tif (OS_IOS) {\n\t\t\tvar db = Ti.Database.open(Alloy.Globals.DATABASE);\n\t\t\tdb.remoteBackup = false;\n\t\t\tdb.close();\n\t\t}\n\t\t \n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"Index\", \"initDb\", ex);\n\t}\n}", "title": "" }, { "docid": "ea0c51a2e4b702d3a6f63078148d656b", "score": "0.5711519", "text": "function validateIndexedDBOpenable() {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n let preExist = true;\r\n const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\r\n const request = self.indexedDB.open(DB_CHECK_NAME);\r\n request.onsuccess = () => {\r\n request.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist) {\r\n self.indexedDB.deleteDatabase(DB_CHECK_NAME);\r\n }\r\n resolve(true);\r\n };\r\n request.onupgradeneeded = () => {\r\n preExist = false;\r\n };\r\n request.onerror = () => {\r\n var _a;\r\n reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "ea0c51a2e4b702d3a6f63078148d656b", "score": "0.5711519", "text": "function validateIndexedDBOpenable() {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n let preExist = true;\r\n const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\r\n const request = self.indexedDB.open(DB_CHECK_NAME);\r\n request.onsuccess = () => {\r\n request.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist) {\r\n self.indexedDB.deleteDatabase(DB_CHECK_NAME);\r\n }\r\n resolve(true);\r\n };\r\n request.onupgradeneeded = () => {\r\n preExist = false;\r\n };\r\n request.onerror = () => {\r\n var _a;\r\n reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "bcec3dca8917125fb294003543511dc0", "score": "0.5699935", "text": "function validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = self.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n self.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "63de435ffa09fb69821d503cec3123d5", "score": "0.5687443", "text": "function validateIndexedDBOpenable() {\n return new Promise((resolve, reject) => {\n try {\n let preExist = true;\n const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\n const request = self.indexedDB.open(DB_CHECK_NAME);\n request.onsuccess = () => {\n request.result.close();\n // delete database only when it doesn't pre-exist\n if (!preExist) {\n self.indexedDB.deleteDatabase(DB_CHECK_NAME);\n }\n resolve(true);\n };\n request.onupgradeneeded = () => {\n preExist = false;\n };\n request.onerror = () => {\n var _a;\n reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\n };\n }\n catch (error) {\n reject(error);\n }\n });\n}", "title": "" }, { "docid": "2bae7885321dc6f4253429a784e790ec", "score": "0.568605", "text": "function createDB() {\n webSQLFlag = 1;\n baseObjectId = kony.db.openDatabase(\"webSqlDB\", \"1.0\", \"Sample SQL Database\", 5 * 1024 * 1024); // 5MB database\n kony.db.transaction(baseObjectId, createTable, commonErrorCallback, commonVoidcallback);\n}", "title": "" }, { "docid": "6c8efef18c2542e303fbbc57d47c8974", "score": "0.56832504", "text": "async Dt(t) {\n return this.db || (k(\"SimpleDb\", \"Opening database:\", this.name), this.db = await new Promise(((e, n) => {\n // TODO(mikelehen): Investigate browser compatibility.\n // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\n // suggests IE9 and older WebKit browsers handle upgrade\n // differently. They expect setVersion, as described here:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\n const s = indexedDB.open(this.name, this.version);\n s.onsuccess = t => {\n const n = t.target.result;\n e(n);\n }, s.onblocked = () => {\n n(new Gs(t, \"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\"));\n }, s.onerror = e => {\n const s = e.target.error;\n \"VersionError\" === s.name ? n(new K(q.FAILED_PRECONDITION, \"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\")) : \"InvalidStateError\" === s.name ? n(new K(q.FAILED_PRECONDITION, \"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \" + s)) : n(new Gs(t, s));\n }, s.onupgradeneeded = t => {\n k(\"SimpleDb\", 'Database \"' + this.name + '\" requires upgrade from version:', t.oldVersion);\n const e = t.target.result;\n this.At.Ct(e, s.transaction, t.oldVersion, this.version).next((() => {\n k(\"SimpleDb\", \"Database upgrade to version \" + this.version + \" complete\");\n }));\n };\n }))), this.Nt && (this.db.onversionchange = t => this.Nt(t)), this.db;\n }", "title": "" }, { "docid": "1050eed9abdfa63f69bdb023438af5f2", "score": "0.56770116", "text": "function validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "5ecf950bfed89bb7605925eeae4caff3", "score": "0.56649196", "text": "function index_esm2017_validateIndexedDBOpenable() {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n let preExist = true;\r\n const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\r\n const request = self.indexedDB.open(DB_CHECK_NAME);\r\n request.onsuccess = () => {\r\n request.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist) {\r\n self.indexedDB.deleteDatabase(DB_CHECK_NAME);\r\n }\r\n resolve(true);\r\n };\r\n request.onupgradeneeded = () => {\r\n preExist = false;\r\n };\r\n request.onerror = () => {\r\n var _a;\r\n reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "1b51ef8afc8dd5e91ef90ede4361ab6a", "score": "0.5651335", "text": "async Dt(t) {\n return this.db || (x(\"SimpleDb\", \"Opening database:\", this.name), this.db = await new Promise(((e, n) => {\n // TODO(mikelehen): Investigate browser compatibility.\n // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\n // suggests IE9 and older WebKit browsers handle upgrade\n // differently. They expect setVersion, as described here:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\n const s = indexedDB.open(this.name, this.version);\n s.onsuccess = t => {\n const n = t.target.result;\n e(n);\n }, s.onblocked = () => {\n n(new Ws(t, \"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\"));\n }, s.onerror = e => {\n const s = e.target.error;\n \"VersionError\" === s.name ? n(new q(U.FAILED_PRECONDITION, \"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\")) : \"InvalidStateError\" === s.name ? n(new q(U.FAILED_PRECONDITION, \"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \" + s)) : n(new Ws(t, s));\n }, s.onupgradeneeded = t => {\n x(\"SimpleDb\", 'Database \"' + this.name + '\" requires upgrade from version:', t.oldVersion);\n const e = t.target.result;\n this.At.Ct(e, s.transaction, t.oldVersion, this.version).next((() => {\n x(\"SimpleDb\", \"Database upgrade to version \" + this.version + \" complete\");\n }));\n };\n }))), this.Nt && (this.db.onversionchange = t => this.Nt(t)), this.db;\n }", "title": "" }, { "docid": "1766149c067cefac70966ce2f24866cc", "score": "0.56464434", "text": "db() { \n return new sqlite3.Database(this.dbFile); \n }", "title": "" }, { "docid": "098fd45e92c84ad2f1d9661a092c98f4", "score": "0.56461465", "text": "function leggoDatabase (){\n db = window.openDatabase(\"PROVADBDue\", \"1.0\", \"Darabse prova\", 200000);\n db.transaction(leggoDb,onSelectSucces,onDbError);\n }", "title": "" }, { "docid": "8d6ce14ddd75e37a279f09e5c6538f47", "score": "0.5640142", "text": "function validateIndexedDBOpenable() {\n return new Promise((resolve, reject) => {\n try {\n let preExist = true;\n const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\n const request = self.indexedDB.open(DB_CHECK_NAME);\n\n request.onsuccess = () => {\n request.result.close(); // delete database only when it doesn't pre-exist\n\n if (!preExist) {\n self.indexedDB.deleteDatabase(DB_CHECK_NAME);\n }\n\n resolve(true);\n };\n\n request.onupgradeneeded = () => {\n preExist = false;\n };\n\n request.onerror = () => {\n var _a;\n\n reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\n };\n } catch (error) {\n reject(error);\n }\n });\n}", "title": "" }, { "docid": "1bc1683c05ec6c4bdf0beac4535ed9ae", "score": "0.5632105", "text": "function validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = self.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n self.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "1bc1683c05ec6c4bdf0beac4535ed9ae", "score": "0.5632105", "text": "function validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = self.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n self.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "30695058b36985d914b27446d9eca851", "score": "0.5631436", "text": "function initDB() {\n database = new PouchDB('entries', {\n adapter: 'websql'\n });\n }", "title": "" }, { "docid": "19cb514599f103e4c8fca1043174fe87", "score": "0.5622893", "text": "function initializeDB()\r\n{\r\n\ttry {\r\n\t\topenDB();\r\n\r\n\t\tif (!db) {\r\n\t\t\talert(\"UD : Failed to open the database on disk. This is probably because the version was bad or there is not enough space left in this domain's quota\");\r\n\t\t\tblackberry.app.exit();\r\n\t\t}\r\n\r\n\t\t// Load data from the database.\r\n\t\tif (!isFirstLaunch) {\r\n\t\t\tdb.transaction(loadData, function(/*SQLError*/ error){\r\n\t\t\t\tinitDB(db);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t} catch(ex) {\r\n\t\tif (ex == 2)\r\n\t\t{\r\n\t\t\t// Version number mismatch.\r\n\t\t\talert(\"Invalid database version.\");\r\n\t\t\tconsole.log(\"Invalid database version.\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\talert(\"Unknown error \"+ex+\".\");\r\n\t\t\tconsole.log(\"Unknown error \"+ex+\".\");\r\n\t\t}\r\n//\t\tblackberry.app.exit();\r\n\t}\r\n}", "title": "" }, { "docid": "b6ba2f1d56a44b2f83352e16128f7035", "score": "0.56021637", "text": "function validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "b6ba2f1d56a44b2f83352e16128f7035", "score": "0.56021637", "text": "function validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "b6ba2f1d56a44b2f83352e16128f7035", "score": "0.56021637", "text": "function validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "b6ba2f1d56a44b2f83352e16128f7035", "score": "0.56021637", "text": "function validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\r\n request_1.onsuccess = function () {\r\n request_1.result.close();\r\n // delete database only when it doesn't pre-exist\r\n if (!preExist_1) {\r\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\r\n }\r\n resolve(true);\r\n };\r\n request_1.onupgradeneeded = function () {\r\n preExist_1 = false;\r\n };\r\n request_1.onerror = function () {\r\n var _a;\r\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\r\n };\r\n }\r\n catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "6ef6a9ca390f10d628e692569ef60456", "score": "0.55933094", "text": "function getDb() {\n\treturn openDatabaseSync(\"Trifecta\",\"1.0\",\"Trifecta Recipe Database\",1000000);\n}", "title": "" }, { "docid": "eb0d206eadf15c29c82df4d95404c566", "score": "0.5593213", "text": "async getDb() {\n if (!this._db) {\n this._db = await (0,idb__WEBPACK_IMPORTED_MODULE_0__.openDB)(DB_NAME, 1, {\n upgrade: this._upgradeDbAndDeleteOldDbs.bind(this),\n });\n }\n return this._db;\n }", "title": "" }, { "docid": "f14f2d9a067bccb112b9af64ed11db8f", "score": "0.55854857", "text": "function validateIndexedDBOpenable() {\n return new Promise(function (resolve, reject) {\n try {\n var preExist_1 = true;\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\n request_1.onsuccess = function () {\n request_1.result.close();\n // delete database only when it doesn't pre-exist\n if (!preExist_1) {\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\n }\n resolve(true);\n };\n request_1.onupgradeneeded = function () {\n preExist_1 = false;\n };\n request_1.onerror = function () {\n var _a;\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\n };\n } catch (error) {\n reject(error);\n }\n });\n}", "title": "" }, { "docid": "d5388e3a62cba301c0e5d15d0b280076", "score": "0.5576126", "text": "function validateIndexedDBOpenable() {\n return new Promise(function (resolve, reject) {\n try {\n var preExist_1 = true;\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\n request_1.onsuccess = function () {\n request_1.result.close();\n // delete database only when it doesn't pre-exist\n if (!preExist_1) {\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\n }\n resolve(true);\n };\n request_1.onupgradeneeded = function () {\n preExist_1 = false;\n };\n request_1.onerror = function () {\n var _a;\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\n };\n }\n catch (error) {\n reject(error);\n }\n });\n}", "title": "" }, { "docid": "0de03a00e4c644bf8314111f2ec7283d", "score": "0.5572827", "text": "function indexedDB_set(dataArray, optionsObj, complete)\r\n\t{\r\n\t\tvar i = 0;\r\n\t\tvar dataCount = dataArray.length;\r\n\t\t\r\n\t\t//Will be used to help determine whether the databse connection created by this operation should be \r\n\t\t//closed after its conclusion (a value of true indicates that the onversionchange event has been\r\n\t\t//fired, which prevents subsequent version changing connections to the database from being made)\r\n\t\tvar wasUpgradeNeeded = false; \r\n\t\t\r\n\t\t//Create a function that will be used to advance the set of operations \r\n\t\t//that this operation belongs to in the event of its failure\r\n\t\tvar errorComplete = createErrorCompleteFunction(complete, [0]);\r\n\r\n\t /**\r\n\t\t* Assigns functions to handle the various events that may fire during\r\n\t\t* the handling of a request to open a database for a set operation.\r\n\r\n\t\t* @param openDatabaseRequest an IDBOpenDBRequest \r\n\t\t*/\r\n\t\tfunction handleOpenDatabaseRequest(openDatabaseRequest)\r\n\t\t{\r\n\t\t\t//Creates database structures using configuration data specified in optionsObj, provided the open() call\r\n\t\t\t//which spawned openDatabaseRequest was called with a database version higher than the current one. This is triggered before onsuccess()\r\n\t\t\topenDatabaseRequest.onupgradeneeded = function(){\r\n\r\n\t\t\t\t//Get a handle to the requested database and use it to create the \r\n\t\t\t\t//object store specified by the pertinent properties in optionsObj\r\n\t\t\t\tvar database = openDatabaseRequest.result;\r\n\t\t\t\tvar targetObjectStore = database.createObjectStore(optionsObj.objectStoreData.name, optionsObj.objectStoreData);\r\n\t\t\t\t/////\r\n\r\n\t\t\t\t//Store the array of objects each containing configuration data for a \r\n\t\t\t\t//prospective index of targetObjectStore in a local variable for easier access\r\n\t\t\t\tvar objectStoreIndexDataArray = optionsObj.objectStoreIndexDataArray;\r\n\r\n\t\t\t\t//Loop through the objects in objectStoreIndexDataArray, using the\r\n\t\t\t\t//data contained in each to create an index for targetObjectStore\r\n\t\t\t\tvar indexCount = objectStoreIndexDataArray.length;\r\n\t\t\t\tfor(var i = 0; i < indexCount; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar currentIndexDataObj = objectStoreIndexDataArray[i];\r\n\t\t\t\t\ttargetObjectStore.createIndex(currentIndexDataObj.name, currentIndexDataObj.keyPath, currentIndexDataObj);\r\n\t\t\t\t}\r\n\t\t\t\t/////\r\n\t\t\t\t\r\n\t\t\t\twasUpgradeNeeded = true;\r\n\t\t\t}\r\n\t\t\t/////\r\n\r\n\t\t\t//Delegates control flow to set() using openDatabaseRequest's result: the specified database\r\n\t\t\topenDatabaseRequest.onsuccess = function(){ set(openDatabaseRequest.result); }\r\n\r\n\t\t\t//Progresses the execution of the set of operations the parent operation\r\n\t\t\t//belongs to in the event the desired database cannot be accessed\r\n\t\t\topenDatabaseRequest.onerror = openDatabaseRequest.onblocked = errorComplete;\r\n\t\t}\r\n\r\n\t /**\r\n\t\t* Performs a set operation using the data contained in the members objects\r\n\t\t* of {@code dataArray} on the object store specified in {@code optionsObj}.\r\n\r\n\t\t* @param database the IDBDatabase object containing the object store that this operation will target\r\n\t\t*/\r\n\t\tfunction set(database)\r\n\t\t{\r\n\t\t\t//Create the transaction that the set operation is to take place in\r\n\t\t\tvar setTransaction = database.transaction([optionsObj.objectStoreData.name], \"readwrite\");\r\n\t\t\tsetTransaction.onerror = errorComplete;\r\n\r\n\t\t\t//Get a handle to the target object store\r\n\t\t\tvar targetObjectStore = setTransaction.objectStore(optionsObj.objectStoreData.name);\r\n\r\n\t\t\t//Store the presence of a key path in a local variable for use in determining how the data in dataArray will be stored\r\n\t\t\tvar hasKeyPath = (targetObjectStore.keyPath !== null);\r\n\r\n\t\t /**\r\n\t\t\t* Advances the set operation.\r\n\t\t\t*/\r\n\t\t\tfunction advance()\r\n\t\t\t{\r\n\t\t\t\tif(++i >= dataCount)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(wasUpgradeNeeded || optionsObj.closeConnection)\r\n\t\t\t\t\t\tdatabase.close();\r\n\t\t\t\t\tcomplete(i);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tsetDataItem();\t\t//process the data item at i (which was just incremented in the 'if' clause) \t\t\r\n\t\t\t}\r\n\r\n\t\t /**\r\n\t\t\t* Inserts data derived from an object in {@code dataArray} in to {@code targetObjectStore}.\r\n\t\t\t*/\r\n\t\t\tfunction setDataItem()\r\n\t\t\t{\r\n\t\t\t\t//Create the argument array for the set (\"put\") operation based on the presence of a key path for targetObjectStore\r\n\t\t\t\tvar argArray = (hasKeyPath ? [dataArray[i].value] : [dataArray[i].value, dataArray[i].key]);\r\n\r\n\t\t\t\t//Create a request to insert the data contained in argArray in to targetObjectStore,\r\n\t\t\t\t//and specify advance() as the function to call upon success of the sub-operation\r\n\t\t\t\tvar setRequest = targetObjectStore.put.apply(targetObjectStore, argArray); \r\n\t\t\t\tsetRequest.onsuccess = advance; \r\n\t\t\t\t/////\r\n\t\t\t}\r\n\r\n\t\t\tsetDataItem();\t//starts the operation\r\n\t\t}\r\n\r\n\t\tindexedDB_executeStorageOperation(optionsObj, handleOpenDatabaseRequest, errorComplete);\r\n\t}", "title": "" }, { "docid": "bde7ccd6c4eb9b710571e450e88b5455", "score": "0.55529636", "text": "function IDBOpenDBRequest(){\n\t this.onblocked = this.onupgradeneeded = null;\n\t }", "title": "" }, { "docid": "696f30a932dac8cd08fe5c4e16422e77", "score": "0.5552799", "text": "_connectDb() {\n\t\tdb.connect({\n\t\t\t'dialect': 'sqlite',\n\t\t\t'storage': join(process.cwd(), this.settings.dbPath)\n\t\t});\n\n\t\tdb.loadModels('models');\n\t}", "title": "" }, { "docid": "e83de3ded2fac6dcae23fa6d9c0e4c7d", "score": "0.55438304", "text": "_initDb(){\n if(!this.db){\n if(!this.getConfigFilePath()){\n this.exitByError(`> the file g-config.json is not exists`)\n }\n const dbConfig = this.getGConfig().db;\n this.db = new Database(dbConfig)\n }\n }", "title": "" }, { "docid": "5bb75002b45c9d3531b3bd0e3ca71e36", "score": "0.5526683", "text": "function validateIndexedDBOpenable() {\n return new Promise(function (resolve, reject) {\n try {\n var preExist_1 = true;\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\n\n request_1.onsuccess = function () {\n request_1.result.close(); // delete database only when it doesn't pre-exist\n\n if (!preExist_1) {\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\n }\n\n resolve(true);\n };\n\n request_1.onupgradeneeded = function () {\n preExist_1 = false;\n };\n\n request_1.onerror = function () {\n var _a;\n\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\n };\n } catch (error) {\n reject(error);\n }\n });\n}", "title": "" } ]
a079a4cd3e5bc07f7e656b6e67a50355
Converts an RDF triple object to a JSONLD object.
[ { "docid": "0334856c583b691cfbae8b9df5d5ab92", "score": "0.68095523", "text": "function _RDFToObject(o, useNativeTypes) {\n // convert IRI/blank node object to JSON-LD\n if(o.type === 'IRI' || o.type === 'blank node') {\n return {'@id': o.value};\n }\n\n // convert literal to JSON-LD\n var rval = {'@value': o.value};\n\n // add language\n if(o.language) {\n rval['@language'] = o.language;\n } else {\n var type = o.datatype;\n if(!type) {\n type = XSD_STRING;\n }\n // use native types for certain xsd types\n if(useNativeTypes) {\n if(type === XSD_BOOLEAN) {\n if(rval['@value'] === 'true') {\n rval['@value'] = true;\n } else if(rval['@value'] === 'false') {\n rval['@value'] = false;\n }\n } else if(_isNumeric(rval['@value'])) {\n if(type === XSD_INTEGER) {\n var i = parseInt(rval['@value'], 10);\n if(i.toFixed(0) === rval['@value']) {\n rval['@value'] = i;\n }\n } else if(type === XSD_DOUBLE) {\n rval['@value'] = parseFloat(rval['@value']);\n }\n }\n // do not add native type\n if([XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING]\n .indexOf(type) === -1) {\n rval['@type'] = type;\n }\n } else if(type !== XSD_STRING) {\n rval['@type'] = type;\n }\n }\n\n return rval;\n}", "title": "" } ]
[ { "docid": "1e71c59272fe3cf48d0dd3d7e52670f4", "score": "0.6958315", "text": "function _RDFToObject(o,useNativeTypes){// convert IRI/blank node object to JSON-LD\nif(o.type==='IRI'||o.type==='blank node'){return{'@id':o.value};}// convert literal to JSON-LD\nvar rval={'@value':o.value};// add language\nif(o.language){rval['@language']=o.language;}else{var type=o.datatype;if(!type){type=XSD_STRING;}// use native types for certain xsd types\nif(useNativeTypes){if(type===XSD_BOOLEAN){if(rval['@value']==='true'){rval['@value']=true;}else if(rval['@value']==='false'){rval['@value']=false;}}else if(_isNumeric(rval['@value'])){if(type===XSD_INTEGER){var i=parseInt(rval['@value'],10);if(i.toFixed(0)===rval['@value']){rval['@value']=i;}}else if(type===XSD_DOUBLE){rval['@value']=parseFloat(rval['@value']);}}// do not add native type\nif([XSD_BOOLEAN,XSD_INTEGER,XSD_DOUBLE,XSD_STRING].indexOf(type)===-1){rval['@type']=type;}}else if(type!==XSD_STRING){rval['@type']=type;}}return rval;}", "title": "" }, { "docid": "6d0f631ff9c994666dbca570d9e18e55", "score": "0.6815559", "text": "function _RDFToObject(o, useNativeTypes) {\n // convert IRI/blank node object to JSON-LD\n if(o.type === 'IRI' || o.type === 'blank node') {\n return {'@id': o.value};\n }\n\n // convert literal to JSON-LD\n var rval = {'@value': o.value};\n\n // add language\n if(o['language']) {\n rval['@language'] = o.language;\n } else {\n var type = o.datatype;\n if(!type) {\n type = XSD_STRING;\n }\n // use native types for certain xsd types\n if(useNativeTypes) {\n if(type === XSD_BOOLEAN) {\n if(rval['@value'] === 'true') {\n rval['@value'] = true;\n } else if(rval['@value'] === 'false') {\n rval['@value'] = false;\n }\n } else if(_isNumeric(rval['@value'])) {\n if(type === XSD_INTEGER) {\n var i = parseInt(rval['@value']);\n if(i.toFixed(0) === rval['@value']) {\n rval['@value'] = i;\n }\n } else if(type === XSD_DOUBLE) {\n rval['@value'] = parseFloat(rval['@value']);\n }\n }\n // do not add native type\n if([XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING]\n .indexOf(type) === -1) {\n rval['@type'] = type;\n }\n } else if(type !== XSD_STRING) {\n rval['@type'] = type;\n }\n }\n\n return rval;\n}", "title": "" }, { "docid": "6e0ca34fa24f5e3d71ff7a4ca8b6fbba", "score": "0.6744559", "text": "async function fromJSONLD (obj) {\n const opts = {\n // don't unbox arrays so that object structure will be predictable\n compactArrays: false\n }\n if (!('@context' in obj)) {\n // if context is missing, try filling in ours\n opts.expandContext = this.context\n }\n const compact = await jsonld.compact(obj, this.context, opts)\n // strip context and graph wrapper for easier access, escape mongo special characters\n return escape(compact['@graph'][0])\n}", "title": "" }, { "docid": "ddda8efcea7c9006ef6a34eeb4ccee83", "score": "0.6723139", "text": "function _RDFToObject(o, useNativeTypes) {\n\t // convert IRI/blank node object to JSON-LD\n\t if(o.type === 'IRI' || o.type === 'blank node') {\n\t return {'@id': o.value};\n\t }\n\t\n\t // convert literal to JSON-LD\n\t var rval = {'@value': o.value};\n\t\n\t // add language\n\t if(o.language) {\n\t rval['@language'] = o.language;\n\t } else {\n\t var type = o.datatype;\n\t if(!type) {\n\t type = XSD_STRING;\n\t }\n\t // use native types for certain xsd types\n\t if(useNativeTypes) {\n\t if(type === XSD_BOOLEAN) {\n\t if(rval['@value'] === 'true') {\n\t rval['@value'] = true;\n\t } else if(rval['@value'] === 'false') {\n\t rval['@value'] = false;\n\t }\n\t } else if(_isNumeric(rval['@value'])) {\n\t if(type === XSD_INTEGER) {\n\t var i = parseInt(rval['@value'], 10);\n\t if(i.toFixed(0) === rval['@value']) {\n\t rval['@value'] = i;\n\t }\n\t } else if(type === XSD_DOUBLE) {\n\t rval['@value'] = parseFloat(rval['@value']);\n\t }\n\t }\n\t // do not add native type\n\t if([XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING]\n\t .indexOf(type) === -1) {\n\t rval['@type'] = type;\n\t }\n\t } else if(type !== XSD_STRING) {\n\t rval['@type'] = type;\n\t }\n\t }\n\t\n\t return rval;\n\t}", "title": "" }, { "docid": "6e8e2d15881ff54e1f13628ca11a2341", "score": "0.6713341", "text": "function _RDFToObject(o, useNativeTypes, rdfDirection) {\n // convert NamedNode/BlankNode object to JSON-LD\n if(o.termType.endsWith('Node')) {\n return {'@id': o.value};\n }\n\n // convert literal to JSON-LD\n const rval = {'@value': o.value};\n\n // add language\n if(o.language) {\n rval['@language'] = o.language;\n } else {\n let type = o.datatype.value;\n if(!type) {\n type = XSD_STRING;\n }\n if(type === RDF_JSON_LITERAL) {\n type = '@json';\n try {\n rval['@value'] = JSON.parse(rval['@value']);\n } catch(e) {\n throw new JsonLdError(\n 'JSON literal could not be parsed.',\n 'jsonld.InvalidJsonLiteral',\n {code: 'invalid JSON literal', value: rval['@value'], cause: e});\n }\n }\n // use native types for certain xsd types\n if(useNativeTypes) {\n if(type === XSD_BOOLEAN) {\n if(rval['@value'] === 'true') {\n rval['@value'] = true;\n } else if(rval['@value'] === 'false') {\n rval['@value'] = false;\n }\n } else if(types.isNumeric(rval['@value'])) {\n if(type === XSD_INTEGER) {\n const i = parseInt(rval['@value'], 10);\n if(i.toFixed(0) === rval['@value']) {\n rval['@value'] = i;\n }\n } else if(type === XSD_DOUBLE) {\n rval['@value'] = parseFloat(rval['@value']);\n }\n }\n // do not add native type\n if(![XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING].includes(type)) {\n rval['@type'] = type;\n }\n } else if(rdfDirection === 'i18n-datatype' &&\n type.startsWith('https://www.w3.org/ns/i18n#')) {\n const [, language, direction] = type.split(/[#_]/);\n if(language.length > 0) {\n rval['@language'] = language;\n if(!language.match(REGEX_BCP47)) {\n console.warn(`@language must be valid BCP47: ${language}`);\n }\n }\n rval['@direction'] = direction;\n } else if(type !== XSD_STRING) {\n rval['@type'] = type;\n }\n }\n\n return rval;\n}", "title": "" }, { "docid": "549aeca3ddbdb5063051b2aeab026cf2", "score": "0.6586338", "text": "function _objectToRDF(item){var object={};// convert value object to RDF\nif(_isValue(item)){object.type='literal';var value=item['@value'];var datatype=item['@type']||null;// convert to XSD datatypes as appropriate\nif(_isBoolean(value)){object.value=value.toString();object.datatype=datatype||XSD_BOOLEAN;}else if(_isDouble(value)||datatype===XSD_DOUBLE){if(!_isDouble(value)){value=parseFloat(value);}// canonical double representation\nobject.value=value.toExponential(15).replace(/(\\d)0*e\\+?/,'$1E');object.datatype=datatype||XSD_DOUBLE;}else if(_isNumber(value)){object.value=value.toFixed(0);object.datatype=datatype||XSD_INTEGER;}else if('@language'in item){object.value=value;object.datatype=datatype||RDF_LANGSTRING;object.language=item['@language'];}else{object.value=value;object.datatype=datatype||XSD_STRING;}}else{// convert string/node object to RDF\nvar id=_isObject(item)?item['@id']:item;object.type=id.indexOf('_:')===0?'blank node':'IRI';object.value=id;}// skip relative IRIs\nif(object.type==='IRI'&&!_isAbsoluteIri(object.value)){return null;}return object;}", "title": "" }, { "docid": "217db3b895ce168fdf989d7761fa028d", "score": "0.64006686", "text": "function _objectToRDF(item, issuer, dataset, graphTerm, rdfDirection) {\n const object = {};\n\n // convert value object to RDF\n if(graphTypes.isValue(item)) {\n object.termType = 'Literal';\n object.value = undefined;\n object.datatype = {\n termType: 'NamedNode'\n };\n let value = item['@value'];\n const datatype = item['@type'] || null;\n\n // convert to XSD/JSON datatypes as appropriate\n if(datatype === '@json') {\n object.value = jsonCanonicalize(value);\n object.datatype.value = RDF_JSON_LITERAL;\n } else if(types.isBoolean(value)) {\n object.value = value.toString();\n object.datatype.value = datatype || XSD_BOOLEAN;\n } else if(types.isDouble(value) || datatype === XSD_DOUBLE) {\n if(!types.isDouble(value)) {\n value = parseFloat(value);\n }\n // canonical double representation\n object.value = value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n object.datatype.value = datatype || XSD_DOUBLE;\n } else if(types.isNumber(value)) {\n object.value = value.toFixed(0);\n object.datatype.value = datatype || XSD_INTEGER;\n } else if(rdfDirection === 'i18n-datatype' &&\n '@direction' in item) {\n const datatype = 'https://www.w3.org/ns/i18n#' +\n (item['@language'] || '') +\n `_${item['@direction']}`;\n object.datatype.value = datatype;\n object.value = value;\n } else if('@language' in item) {\n object.value = value;\n object.datatype.value = datatype || RDF_LANGSTRING;\n object.language = item['@language'];\n } else {\n object.value = value;\n object.datatype.value = datatype || XSD_STRING;\n }\n } else if(graphTypes.isList(item)) {\n const _list =\n _listToRDF(item['@list'], issuer, dataset, graphTerm, rdfDirection);\n object.termType = _list.termType;\n object.value = _list.value;\n } else {\n // convert string/node object to RDF\n const id = types.isObject(item) ? item['@id'] : item;\n object.termType = id.startsWith('_:') ? 'BlankNode' : 'NamedNode';\n object.value = id;\n }\n\n // skip relative IRIs, not valid RDF\n if(object.termType === 'NamedNode' && !_isAbsoluteIri(object.value)) {\n return null;\n }\n\n return object;\n}", "title": "" }, { "docid": "b8e18ef46eba5414b21e11aa5eef3214", "score": "0.6338142", "text": "function _objectToRDF(item) {\n var object = {};\n\n // convert value object to RDF\n if(_isValue(item)) {\n object.type = 'literal';\n var value = item['@value'];\n var datatype = item['@type'] || null;\n\n // convert to XSD datatypes as appropriate\n if(_isBoolean(value)) {\n object.value = value.toString();\n object.datatype = datatype || XSD_BOOLEAN;\n } else if(_isDouble(value) || datatype === XSD_DOUBLE) {\n if(!_isDouble(value)) {\n value = parseFloat(value);\n }\n // canonical double representation\n object.value = value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n object.datatype = datatype || XSD_DOUBLE;\n } else if(_isNumber(value)) {\n object.value = value.toFixed(0);\n object.datatype = datatype || XSD_INTEGER;\n } else if('@language' in item) {\n object.value = value;\n object.datatype = datatype || RDF_LANGSTRING;\n object.language = item['@language'];\n } else {\n object.value = value;\n object.datatype = datatype || XSD_STRING;\n }\n } else {\n // convert string/node object to RDF\n var id = _isObject(item) ? item['@id'] : item;\n object.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n object.value = id;\n }\n\n // skip relative IRIs\n if(object.type === 'IRI' && !_isAbsoluteIri(object.value)) {\n return null;\n }\n\n return object;\n}", "title": "" }, { "docid": "b8e18ef46eba5414b21e11aa5eef3214", "score": "0.6338142", "text": "function _objectToRDF(item) {\n var object = {};\n\n // convert value object to RDF\n if(_isValue(item)) {\n object.type = 'literal';\n var value = item['@value'];\n var datatype = item['@type'] || null;\n\n // convert to XSD datatypes as appropriate\n if(_isBoolean(value)) {\n object.value = value.toString();\n object.datatype = datatype || XSD_BOOLEAN;\n } else if(_isDouble(value) || datatype === XSD_DOUBLE) {\n if(!_isDouble(value)) {\n value = parseFloat(value);\n }\n // canonical double representation\n object.value = value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n object.datatype = datatype || XSD_DOUBLE;\n } else if(_isNumber(value)) {\n object.value = value.toFixed(0);\n object.datatype = datatype || XSD_INTEGER;\n } else if('@language' in item) {\n object.value = value;\n object.datatype = datatype || RDF_LANGSTRING;\n object.language = item['@language'];\n } else {\n object.value = value;\n object.datatype = datatype || XSD_STRING;\n }\n } else {\n // convert string/node object to RDF\n var id = _isObject(item) ? item['@id'] : item;\n object.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n object.value = id;\n }\n\n // skip relative IRIs\n if(object.type === 'IRI' && !_isAbsoluteIri(object.value)) {\n return null;\n }\n\n return object;\n}", "title": "" }, { "docid": "b8e18ef46eba5414b21e11aa5eef3214", "score": "0.6338142", "text": "function _objectToRDF(item) {\n var object = {};\n\n // convert value object to RDF\n if(_isValue(item)) {\n object.type = 'literal';\n var value = item['@value'];\n var datatype = item['@type'] || null;\n\n // convert to XSD datatypes as appropriate\n if(_isBoolean(value)) {\n object.value = value.toString();\n object.datatype = datatype || XSD_BOOLEAN;\n } else if(_isDouble(value) || datatype === XSD_DOUBLE) {\n if(!_isDouble(value)) {\n value = parseFloat(value);\n }\n // canonical double representation\n object.value = value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n object.datatype = datatype || XSD_DOUBLE;\n } else if(_isNumber(value)) {\n object.value = value.toFixed(0);\n object.datatype = datatype || XSD_INTEGER;\n } else if('@language' in item) {\n object.value = value;\n object.datatype = datatype || RDF_LANGSTRING;\n object.language = item['@language'];\n } else {\n object.value = value;\n object.datatype = datatype || XSD_STRING;\n }\n } else {\n // convert string/node object to RDF\n var id = _isObject(item) ? item['@id'] : item;\n object.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n object.value = id;\n }\n\n // skip relative IRIs\n if(object.type === 'IRI' && !_isAbsoluteIri(object.value)) {\n return null;\n }\n\n return object;\n}", "title": "" }, { "docid": "b8e18ef46eba5414b21e11aa5eef3214", "score": "0.6338142", "text": "function _objectToRDF(item) {\n var object = {};\n\n // convert value object to RDF\n if(_isValue(item)) {\n object.type = 'literal';\n var value = item['@value'];\n var datatype = item['@type'] || null;\n\n // convert to XSD datatypes as appropriate\n if(_isBoolean(value)) {\n object.value = value.toString();\n object.datatype = datatype || XSD_BOOLEAN;\n } else if(_isDouble(value) || datatype === XSD_DOUBLE) {\n if(!_isDouble(value)) {\n value = parseFloat(value);\n }\n // canonical double representation\n object.value = value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n object.datatype = datatype || XSD_DOUBLE;\n } else if(_isNumber(value)) {\n object.value = value.toFixed(0);\n object.datatype = datatype || XSD_INTEGER;\n } else if('@language' in item) {\n object.value = value;\n object.datatype = datatype || RDF_LANGSTRING;\n object.language = item['@language'];\n } else {\n object.value = value;\n object.datatype = datatype || XSD_STRING;\n }\n } else {\n // convert string/node object to RDF\n var id = _isObject(item) ? item['@id'] : item;\n object.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n object.value = id;\n }\n\n // skip relative IRIs\n if(object.type === 'IRI' && !_isAbsoluteIri(object.value)) {\n return null;\n }\n\n return object;\n}", "title": "" }, { "docid": "51491bd8638d991fa1fd3bb8343c5a0c", "score": "0.6337325", "text": "function _objectToRDF(item) {\n var object = {};\n\n // convert value object to RDF\n if(_isValue(item)) {\n object.type = 'literal';\n var value = item['@value'];\n var datatype = item['@type'] || null;\n\n // convert to XSD datatypes as appropriate\n if(_isBoolean(value)) {\n object.value = value.toString();\n object.datatype = datatype || XSD_BOOLEAN;\n } else if(_isDouble(value) || datatype === XSD_DOUBLE) {\n // canonical double representation\n object.value = value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n object.datatype = datatype || XSD_DOUBLE;\n } else if(_isNumber(value)) {\n object.value = value.toFixed(0);\n object.datatype = datatype || XSD_INTEGER;\n } else if('@language' in item) {\n object.value = value;\n object.datatype = datatype || RDF_LANGSTRING;\n object.language = item['@language'];\n } else {\n object.value = value;\n object.datatype = datatype || XSD_STRING;\n }\n } else {\n // convert string/node object to RDF\n var id = _isObject(item) ? item['@id'] : item;\n object.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n object.value = id;\n }\n\n // skip relative IRIs\n if(object.type === 'IRI' && !_isAbsoluteIri(object.value)) {\n return null;\n }\n\n return object;\n}", "title": "" }, { "docid": "c447a4c6fc35c1907cc98c3387d2cdcd", "score": "0.63315004", "text": "async function toJSONLD (obj) {\n return unescape(await jsonld.compact(obj, this.context, {\n // must supply initial context because it was stripped for easy handling\n expandContext: this.context,\n // unbox arrays on federated objects, in case other apps aren't using real json-ld\n compactArrays: true\n }))\n}", "title": "" }, { "docid": "a64f0a2b24aabc4e96f41036a2a60b9d", "score": "0.626156", "text": "function _objectToRDF(item) {\n\t var object = {};\n\t\n\t // convert value object to RDF\n\t if(_isValue(item)) {\n\t object.type = 'literal';\n\t var value = item['@value'];\n\t var datatype = item['@type'] || null;\n\t\n\t // convert to XSD datatypes as appropriate\n\t if(_isBoolean(value)) {\n\t object.value = value.toString();\n\t object.datatype = datatype || XSD_BOOLEAN;\n\t } else if(_isDouble(value) || datatype === XSD_DOUBLE) {\n\t if(!_isDouble(value)) {\n\t value = parseFloat(value);\n\t }\n\t // canonical double representation\n\t object.value = value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n\t object.datatype = datatype || XSD_DOUBLE;\n\t } else if(_isNumber(value)) {\n\t object.value = value.toFixed(0);\n\t object.datatype = datatype || XSD_INTEGER;\n\t } else if('@language' in item) {\n\t object.value = value;\n\t object.datatype = datatype || RDF_LANGSTRING;\n\t object.language = item['@language'];\n\t } else {\n\t object.value = value;\n\t object.datatype = datatype || XSD_STRING;\n\t }\n\t } else {\n\t // convert string/node object to RDF\n\t var id = _isObject(item) ? item['@id'] : item;\n\t object.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n\t object.value = id;\n\t }\n\t\n\t // skip relative IRIs\n\t if(object.type === 'IRI' && !_isAbsoluteIri(object.value)) {\n\t return null;\n\t }\n\t\n\t return object;\n\t}", "title": "" }, { "docid": "2529a428158fbe20d02ba68f70626ed3", "score": "0.5635742", "text": "parse(data) {\n const dataset = {};\n dataset['@default'] = [];\n\n const subjects = data.getSubjects();\n for(let si = 0; si < subjects.length; ++si) {\n const subject = subjects[si];\n if(subject === null) {\n continue;\n }\n\n // get all related triples\n const triples = data.getSubjectTriples(subject);\n if(triples === null) {\n continue;\n }\n const predicates = triples.predicates;\n for(const predicate in predicates) {\n // iterate over objects\n const objects = predicates[predicate].objects;\n for(let oi = 0; oi < objects.length; ++oi) {\n const object = objects[oi];\n\n // create RDF triple\n const triple = {};\n\n // add subject\n if(subject.indexOf('_:') === 0) {\n triple.subject = {type: 'blank node', value: subject};\n } else {\n triple.subject = {type: 'IRI', value: subject};\n }\n\n // add predicate\n if(predicate.indexOf('_:') === 0) {\n triple.predicate = {type: 'blank node', value: predicate};\n } else {\n triple.predicate = {type: 'IRI', value: predicate};\n }\n\n // serialize XML literal\n let value = object.value;\n if(object.type === RDF_XML_LITERAL) {\n // initialize XMLSerializer\n const XMLSerializer = getXMLSerializerClass();\n const serializer = new XMLSerializer();\n value = '';\n for(let x = 0; x < object.value.length; x++) {\n if(object.value[x].nodeType === _Node.ELEMENT_NODE) {\n value += serializer.serializeToString(object.value[x]);\n } else if(object.value[x].nodeType === _Node.TEXT_NODE) {\n value += object.value[x].nodeValue;\n }\n }\n }\n\n // add object\n triple.object = {};\n\n // object is an IRI\n if(object.type === RDF_OBJECT) {\n if(object.value.indexOf('_:') === 0) {\n triple.object.type = 'blank node';\n } else {\n triple.object.type = 'IRI';\n }\n } else {\n // object is a literal\n triple.object.type = 'literal';\n if(object.type === RDF_PLAIN_LITERAL) {\n if(object.language) {\n triple.object.datatype = RDF_LANGSTRING;\n triple.object.language = object.language;\n } else {\n triple.object.datatype = XSD_STRING;\n }\n } else {\n triple.object.datatype = object.type;\n }\n }\n triple.object.value = value;\n\n // add triple to dataset in default graph\n dataset['@default'].push(triple);\n }\n }\n }\n\n return dataset;\n }", "title": "" }, { "docid": "75cebf6616eea552ead69f7418fa87c7", "score": "0.54936075", "text": "function rdfToJsonLd(input, frame) {\n\n return buildJSON(input).then(function(json) {\n\n if (frame) {\n return new Promise(function(resolve) { \n var framedJson = jsonld.frame(json, frame);\n resolve(framedJson); \n }).then(framedJson => { \n return framedJson; \n }).catch(function(e) {\n console.error(\"Unable to process JSONLD frame!\");\n console.error(e);\n process.exit(1);\n });\n\n } else if (json.length == 1) {\n return json[0];\n }\n\n return json;\n });\n}", "title": "" }, { "docid": "64ec906914505ffb6201d6115da02fe1", "score": "0.54487234", "text": "static entitiesToJSONLDFlat(res, callback){\n let context = {};\n res['@context']::entries().forEach(([k, v]) => {\n if (v::isObject() && \"@id\" in v && v[\"@id\"].includes(\"apinatomy:\")) {\n } else if (typeof(v) === \"string\" && v.includes(\"apinatomy:\")) {\n } else if (k === \"class\") { // class uses @context @base which is not 1.0 compatible\n } else {\n context[k] = v;\n }});\n // TODO reattach context for rdflib-jsonld prefix construction\n jsonld.flatten(res).then(flat => {\n jsonld.compact(flat, context).then(compact => {\n callback(compact)})});\n }", "title": "" }, { "docid": "08e931a9a17840e7cc268355e2a1b6aa", "score": "0.54348624", "text": "AddTripleToGraph(subjectLongPrefix, subjectName, predicateLongPrefix, predicateName, objectFirstParameter, objectSecondParameter, objectIsLiteral)\r\n\t{\r\n\t\tlet subjectShortPrefix = this.longFormToShortFormNamespaceLookup.get(subjectLongPrefix);\r\n\t\t//subjectLongPrefix; zadano\r\n\t\tlet subjectShortName;\r\n\t\tlet subjectLongName = subjectLongPrefix + subjectName;\r\n\t\t\r\n\t\t//muze se vlozit uzel nebo propojeni, ktery nema zkracenou fromu prefixu - do kratkeho prefixu vlozime taky dlouhy prefix, short prefix nechame undefined\r\n\t\tif (subjectShortPrefix === undefined)\r\n\t\t{\r\n\t\t\tsubjectShortName = subjectLongName;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsubjectShortName = subjectShortPrefix + \":\" + subjectName;\r\n\t\t}\r\n\t\t\r\n\t\tlet predicateShortPrefix = this.longFormToShortFormNamespaceLookup.get(predicateLongPrefix);\r\n\t\t//predicateLongPrefix; zadano\r\n\t\tlet predicateShortName;\r\n\t\tlet predicateLongName = predicateLongPrefix + predicateName;\r\n\t\t\r\n\t\t//muze se vlozit uzel nebo propojeni, ktery nema zkracenou fromu prefixu - do kratkeho prefixu vlozime taky dlouhy prefix, short prefix nechame undefined\r\n\t\tif (predicateShortPrefix === undefined)\r\n\t\t{\r\n\t\t\tpredicateShortName = predicateLongName;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tpredicateShortName = predicateShortPrefix + \":\" + predicateName;\r\n\t\t}\r\n\t\t\r\n\t\tlet objectShortPrefix;\r\n\t\tlet objectLongPrefix;\r\n\t\tlet objectShortName;\r\n\t\tlet objectLongName;\r\n\t\tlet objectValue;\r\n\t\tlet objectValueType;\r\n\t\t\r\n\t\t//subjekt bude vzdy objektovy uzel\r\n\t\t//pokud nenajdeme existujici, tak vytvorime novy\r\n\t\tlet subjectNode = this.objectNodes.get(subjectShortName);\r\n\t\tif (subjectNode === undefined)\r\n\t\t{\r\n\t\t\tsubjectNode = new ObjectNode(subjectShortPrefix, subjectLongPrefix, subjectShortName, subjectLongName);\r\n\t\t\tthis.objectNodes.set(subjectShortName, subjectNode);\r\n\t\t\tthis.allNodes.push(subjectNode);\r\n\t\t}\r\n\t\t\r\n\t\t//najdeme uzel reprezentujici objekt\r\n\t\t//zalezi jestli je objektovy nebo literalni\r\n\t\tlet objectNode;\r\n\t\tif (objectIsLiteral === true)\r\n\t\t{\r\n\t\t\tobjectValue = objectFirstParameter;\r\n\t\t\tobjectValueType = objectSecondParameter;\r\n\t\t\t\r\n\t\t\t//musime zjistit, jestli toto literalni spojeni uz existuje - jenomze literaly nemaji unikatni identifikator\r\n\t\t\t//tedy bohuzel musime projit vsechny literalni propojeni uzlu - linearni slozitost - jediny krok u ktereho nejde snizit na konstantni\r\n\t\t\tif (subjectNode.DoesLiteralConnectionAlreadyExist(predicateShortName, objectValue) === false)\r\n\t\t\t{\r\n\t\t\t\t//pokud je literal, vzdy vytvorime novy - i stejne hodnoty maji rozdilne uzly\r\n\t\t\t\tobjectNode = new LiteralNode(this.literalNodeActIdentifier, objectValue, objectValueType);\r\n\t\t\t\tthis.literalNodes.set(objectNode.identifier, objectNode);\r\n\t\t\t\tthis.literalNodeActIdentifier++;\r\n\t\t\t\tthis.allNodes.push(objectNode);\r\n\t\t\t\t\r\n\t\t\t\t//propojeni\r\n\t\t\t\t//pocet propojeni s literalnim uzlem bude vzdy 1\r\n\t\t\t\t//tedy vytvorime ConnectionCluster s jednim Connection\r\n\t\t\t\tlet connectionCluster = new ConnectionCluster(subjectNode, objectNode, this.clusterActIdentifier);\r\n\t\t\t\tthis.clusterActIdentifier++;\r\n\t\t\t\tthis.connectionClusters.push(connectionCluster);\r\n\t\t\t\tconnectionCluster.AddConnection(subjectNode, objectNode, predicateShortPrefix, predicateLongPrefix, predicateShortName, predicateLongName);\r\n\t\t\t\t//ulozime propojeni do obou uzlu\r\n\t\t\t\tsubjectNode.AddConnectionClusterToNode(objectNode.identifier, connectionCluster, true);\r\n\t\t\t\tobjectNode.AddConnectionClusterToNode(subjectShortName, connectionCluster, false);\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tobjectLongPrefix = objectFirstParameter;\r\n\t\t\tobjectShortPrefix = this.longFormToShortFormNamespaceLookup.get(objectLongPrefix);\r\n\t\t\tobjectLongName = objectLongPrefix + objectSecondParameter;\r\n\t\t\t\r\n\t\t\t//muze se vlozit uzel nebo propojeni, ktery nema zkracenou fromu prefixu - do kratkeho prefixu vlozime taky dlouhy prefix, short prefix nechame undefined\r\n\t\t\tif (objectShortPrefix === undefined)\r\n\t\t\t{\r\n\t\t\t\tobjectShortName = objectLongName;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tobjectShortName = objectShortPrefix + \":\" + objectSecondParameter;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tobjectNode = this.objectNodes.get(objectShortName);\r\n\t\t\t\r\n\t\t\tif (objectNode === undefined)\r\n\t\t\t{\r\n\t\t\t\tobjectNode = new ObjectNode(objectShortPrefix, objectLongPrefix, objectShortName, objectLongName);\r\n\t\t\t\tthis.objectNodes.set(objectShortName, objectNode);\r\n\t\t\t\tthis.allNodes.push(objectNode);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//propojeni\r\n\t\t\t//najdeme jestli subjekt a objekt jsou jiz propojeny\r\n\t\t\t//muzeme se zeptat bud jestli prvni je propojen s druhym nebo obracene - nezalezi na tom\t\t\t\r\n\t\t\tlet connectionCluster = this.objectNodes.get(objectShortName).connectedNodesClusters.get(subjectShortName);\r\n\t\t\t\r\n\t\t\tif (connectionCluster === undefined)\r\n\t\t\t{\r\n\t\t\t\tconnectionCluster = new ConnectionCluster(subjectNode, objectNode, this.clusterActIdentifier);\r\n\t\t\t\tthis.clusterActIdentifier++;\r\n\t\t\t\tconnectionCluster.AddConnection(subjectNode, objectNode, predicateShortPrefix, predicateLongPrefix, predicateShortName, predicateLongName);\r\n\t\t\t\tthis.connectionClusters.push(connectionCluster);\r\n\t\t\t\t\r\n\t\t\t\tsubjectNode.AddConnectionClusterToNode(objectShortName, connectionCluster, false);\r\n\t\t\t\tobjectNode.AddConnectionClusterToNode(subjectShortName, connectionCluster, false);\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//pokud uz tam takove propojeni je - tak se nic nestane\r\n\t\t\t\tif (connectionCluster.DoesConnectionAlreadyExist(subjectNode, predicateShortName) === false)\r\n\t\t\t\t{\r\n\t\t\t\t\tconnectionCluster.AddConnection(subjectNode, objectNode, predicateShortPrefix, predicateLongPrefix, predicateShortName, predicateLongName);\r\n\t\t\t\t\r\n\t\t\t\t\t//do uzlu uz cluster nepridavame kdyz cluster existuje - odkaz uz tam je\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "40ef39011924682d472b7d8ca4f1811b", "score": "0.53797054", "text": "toJSONLD() {\n let tags = this.get('tags') || [];\n if (this.get('layout')) { tags = tags.concat(this.get('layout')); }\n if (this.get('vertical')) { tags = tags.concat(this.get('vertical').name); }\n if (this.get('tracking_tags')) { tags = tags.concat(this.get('tracking_tags')); }\n return compactObject({\n \"@context\": \"http://schema.org\",\n \"@type\": \"NewsArticle\",\n \"headline\": this.get('thumbnail_title'),\n \"url\": this.fullHref(),\n \"thumbnailUrl\": this.get('thumbnail_image'),\n \"datePublished\": this.get('published_at'),\n \"dateCreated\": this.get('published_at'),\n \"articleSection\": this.getParselySection(),\n \"creator\": this.getAuthorArray(),\n \"keywords\": tags\n });\n }", "title": "" }, { "docid": "f90cae66f693881b0b44f244bbc33388", "score": "0.5302979", "text": "entitiesToJSONLD(){\n let res = {\n \"id\": this.id,\n \"resources\": {}\n };\n (this.entitiesByID||{})::entries().forEach(([id,obj]) =>\n res.resources[id] = (obj instanceof Resource) ? obj.toJSON() : obj);\n return res;\n }", "title": "" }, { "docid": "afcac337c94e4e81ac350955456647c1", "score": "0.5289865", "text": "function HandleTriple(response,triple)\n{ \n //TODO: handle question\n\n var property_name = triple.predicate.entities[0][\"property name\"];\n var domain = triple.predicate.entities[0][\"domain\"];\n var range = triple.predicate.entities[0][\"range\"];\n var subject_instance = triple[\"subject instances\"][0][\"phrase\"];\n var object_instance = triple[\"object instances\"][0][\"phrase\"];\n\n var ce_sentence = \"the \"+domain+\" '\"+subject_instance+\"' \"+property_name+\" the \"+range+\" '\"+object_instance+\"'.\";\n\n PostToChat(\"Updating Knowledge with: '\"+ce_sentence+\"'\");\n SaveSentence(ce_sentence);\n \n}", "title": "" }, { "docid": "5b987496d339989ee8ae966051806dc9", "score": "0.52797896", "text": "function _toNQuad(triple, graphName) {\n var s = triple.subject;\n var p = triple.predicate;\n var o = triple.object;\n var g = graphName || null;\n if('name' in triple && triple.name) {\n g = triple.name.value;\n }\n\n var quad = '';\n\n // subject is an IRI\n if(s.type === 'IRI') {\n quad += '<' + s.value + '>';\n } else {\n quad += s.value;\n }\n quad += ' ';\n\n // predicate is an IRI\n if(p.type === 'IRI') {\n quad += '<' + p.value + '>';\n } else {\n quad += p.value;\n }\n quad += ' ';\n\n // object is IRI, bnode, or literal\n if(o.type === 'IRI') {\n quad += '<' + o.value + '>';\n } else if(o.type === 'blank node') {\n quad += o.value;\n } else {\n var escaped = o.value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\\"/g, '\\\\\"');\n quad += '\"' + escaped + '\"';\n if(o.datatype === RDF_LANGSTRING) {\n if(o.language) {\n quad += '@' + o.language;\n }\n } else if(o.datatype !== XSD_STRING) {\n quad += '^^<' + o.datatype + '>';\n }\n }\n\n // graph\n if(g !== null && g !== undefined) {\n if(g.indexOf('_:') !== 0) {\n quad += ' <' + g + '>';\n } else {\n quad += ' ' + g;\n }\n }\n\n quad += ' .\\n';\n return quad;\n}", "title": "" }, { "docid": "5b987496d339989ee8ae966051806dc9", "score": "0.52797896", "text": "function _toNQuad(triple, graphName) {\n var s = triple.subject;\n var p = triple.predicate;\n var o = triple.object;\n var g = graphName || null;\n if('name' in triple && triple.name) {\n g = triple.name.value;\n }\n\n var quad = '';\n\n // subject is an IRI\n if(s.type === 'IRI') {\n quad += '<' + s.value + '>';\n } else {\n quad += s.value;\n }\n quad += ' ';\n\n // predicate is an IRI\n if(p.type === 'IRI') {\n quad += '<' + p.value + '>';\n } else {\n quad += p.value;\n }\n quad += ' ';\n\n // object is IRI, bnode, or literal\n if(o.type === 'IRI') {\n quad += '<' + o.value + '>';\n } else if(o.type === 'blank node') {\n quad += o.value;\n } else {\n var escaped = o.value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\\"/g, '\\\\\"');\n quad += '\"' + escaped + '\"';\n if(o.datatype === RDF_LANGSTRING) {\n if(o.language) {\n quad += '@' + o.language;\n }\n } else if(o.datatype !== XSD_STRING) {\n quad += '^^<' + o.datatype + '>';\n }\n }\n\n // graph\n if(g !== null && g !== undefined) {\n if(g.indexOf('_:') !== 0) {\n quad += ' <' + g + '>';\n } else {\n quad += ' ' + g;\n }\n }\n\n quad += ' .\\n';\n return quad;\n}", "title": "" }, { "docid": "5b987496d339989ee8ae966051806dc9", "score": "0.52797896", "text": "function _toNQuad(triple, graphName) {\n var s = triple.subject;\n var p = triple.predicate;\n var o = triple.object;\n var g = graphName || null;\n if('name' in triple && triple.name) {\n g = triple.name.value;\n }\n\n var quad = '';\n\n // subject is an IRI\n if(s.type === 'IRI') {\n quad += '<' + s.value + '>';\n } else {\n quad += s.value;\n }\n quad += ' ';\n\n // predicate is an IRI\n if(p.type === 'IRI') {\n quad += '<' + p.value + '>';\n } else {\n quad += p.value;\n }\n quad += ' ';\n\n // object is IRI, bnode, or literal\n if(o.type === 'IRI') {\n quad += '<' + o.value + '>';\n } else if(o.type === 'blank node') {\n quad += o.value;\n } else {\n var escaped = o.value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\\"/g, '\\\\\"');\n quad += '\"' + escaped + '\"';\n if(o.datatype === RDF_LANGSTRING) {\n if(o.language) {\n quad += '@' + o.language;\n }\n } else if(o.datatype !== XSD_STRING) {\n quad += '^^<' + o.datatype + '>';\n }\n }\n\n // graph\n if(g !== null && g !== undefined) {\n if(g.indexOf('_:') !== 0) {\n quad += ' <' + g + '>';\n } else {\n quad += ' ' + g;\n }\n }\n\n quad += ' .\\n';\n return quad;\n}", "title": "" }, { "docid": "97ab57f2e1d5de83ae9c440703ece7e5", "score": "0.52525866", "text": "function get_triple_data_as_string(add_header, triple_data)\n{\n var out_data = '';\n var last_subject = '';\n if(add_header)\n {\n out_data = out_data + \"@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\\n@prefix \"+ prefix +\" <\" + uri +\"> .\\n\";\n }\n for (t in triple_data)\n {\n // dont add malformed triples\n if (triple_data[t][0] == \"None\" || triple_data[t][1] == \"None\" || triple_data[t][2] == \"None\")\n {\n continue;\n }\n\n // check if can continue in series of previous triple\n if (last_subject != '')\n {\n if(last_subject == triple_data[t][0])\n {\n out_data = out_data + ';' + \"\\n \";\n out_data = out_data + triple_data[t][1] + \" \" + triple_data[t][2] + \" \";\n continue;\n } else\n {\n out_data = out_data + '.' + \"\\n\\n\";\n }\n \n }\n\n // add new triple\n out_data = out_data + triple_data[t][0] + \" \" + triple_data[t][1] + \" \" + triple_data[t][2] + \" \";\n last_subject = triple_data[t][0];\n }\n out_data += '.' + '\\n';\n return out_data;\n}", "title": "" }, { "docid": "223a72734683a0f3039d4c4dd51ffd9a", "score": "0.5227601", "text": "function _toNQuad(triple, graphName) {\n\t var s = triple.subject;\n\t var p = triple.predicate;\n\t var o = triple.object;\n\t var g = graphName || null;\n\t if('name' in triple && triple.name) {\n\t g = triple.name.value;\n\t }\n\t\n\t var quad = '';\n\t\n\t // subject is an IRI\n\t if(s.type === 'IRI') {\n\t quad += '<' + s.value + '>';\n\t } else {\n\t quad += s.value;\n\t }\n\t quad += ' ';\n\t\n\t // predicate is an IRI\n\t if(p.type === 'IRI') {\n\t quad += '<' + p.value + '>';\n\t } else {\n\t quad += p.value;\n\t }\n\t quad += ' ';\n\t\n\t // object is IRI, bnode, or literal\n\t if(o.type === 'IRI') {\n\t quad += '<' + o.value + '>';\n\t } else if(o.type === 'blank node') {\n\t quad += o.value;\n\t } else {\n\t var escaped = o.value\n\t .replace(/\\\\/g, '\\\\\\\\')\n\t .replace(/\\t/g, '\\\\t')\n\t .replace(/\\n/g, '\\\\n')\n\t .replace(/\\r/g, '\\\\r')\n\t .replace(/\\\"/g, '\\\\\"');\n\t quad += '\"' + escaped + '\"';\n\t if(o.datatype === RDF_LANGSTRING) {\n\t if(o.language) {\n\t quad += '@' + o.language;\n\t }\n\t } else if(o.datatype !== XSD_STRING) {\n\t quad += '^^<' + o.datatype + '>';\n\t }\n\t }\n\t\n\t // graph\n\t if(g !== null && g !== undefined) {\n\t if(g.indexOf('_:') !== 0) {\n\t quad += ' <' + g + '>';\n\t } else {\n\t quad += ' ' + g;\n\t }\n\t }\n\t\n\t quad += ' .\\n';\n\t return quad;\n\t}", "title": "" }, { "docid": "5e8c584caa3e132ce58a97d0b22e4625", "score": "0.5206632", "text": "function makeSchemaJsonld () {\n // \"@id\": \"_Indicator_\",\n // \"@type\": \"Dataset\",\n // \"startid\": \"foafiaf:Scorecard_Top_25\",\n // \"name\": \"Transform Rockford Scorecard Indicators\",\n // \"description\": \"A updated dataset of scorecard indicator relationships, values and metrics to provide insight into were the comminuty transformation process is at and where is it going\",\n // \"url\": \"\",\n // \"sameAs\": \"\",\n // \"keywords\": [\n \n // ],\n // \"creator\": {\n // \"@type\": \"Organization\",\n // \"url\": \"\",\n // \"name\": \"\",\n // \"contactPoint\": {\n // \"@type\": \"ContactPoint\",\n // \"contactType\": \"customer service\",\n // \"telephone\": \"\",\n // \"email\": \"\"\n // }\n // },\n // \"includedInDataCatalog\": {\n \n // },\n // \"distribution\": [\n \n // ],\n // \"temporalCoverage\": \"\",\n // \"spatialCoverage\": {\n \n // },\n // \"updated\": \"2018-12-25T12:34:56Z\",\n // \"published\": \"2018-12-25T12:34:56Z\"\n } // end ", "title": "" }, { "docid": "5bf0634d434f5e6c10a9463290a892e7", "score": "0.5200268", "text": "function formatTriplePattern(triple) {\n let subject = null\n let predicate = null\n let object = null\n if (!triple.subject.startsWith('?')) {\n subject = triple.subject\n }\n if (!triple.predicate.startsWith('?')) {\n predicate = triple.predicate\n }\n if (!triple.object.startsWith('?')) {\n object = triple.object\n }\n return { subject, predicate, object }\n}", "title": "" }, { "docid": "fed2500a30e329b4417e29be80e5040a", "score": "0.5170853", "text": "function _parseRdfaApiData(data) {\n var dataset = {};\n dataset['@default'] = [];\n\n var subjects = data.getSubjects();\n for(var si = 0; si < subjects.length; ++si) {\n var subject = subjects[si];\n if(subject === null) {\n continue;\n }\n\n // get all related triples\n var triples = data.getSubjectTriples(subject);\n if(triples === null) {\n continue;\n }\n var predicates = triples.predicates;\n for(var predicate in predicates) {\n // iterate over objects\n var objects = predicates[predicate].objects;\n for(var oi = 0; oi < objects.length; ++oi) {\n var object = objects[oi];\n\n // create RDF triple\n var triple = {};\n\n // add subject\n if(subject.indexOf('_:') === 0) {\n triple.subject = {type: 'blank node', value: subject};\n } else {\n triple.subject = {type: 'IRI', value: subject};\n }\n\n // add predicate\n if(predicate.indexOf('_:') === 0) {\n triple.predicate = {type: 'blank node', value: predicate};\n } else {\n triple.predicate = {type: 'IRI', value: predicate};\n }\n\n // serialize XML literal\n var value = object.value;\n if(object.type === RDF_XML_LITERAL) {\n // initialize XMLSerializer\n if(!XMLSerializer) {\n _defineXMLSerializer();\n }\n var serializer = new XMLSerializer();\n value = '';\n for(var x = 0; x < object.value.length; x++) {\n if(object.value[x].nodeType === Node.ELEMENT_NODE) {\n value += serializer.serializeToString(object.value[x]);\n } else if(object.value[x].nodeType === Node.TEXT_NODE) {\n value += object.value[x].nodeValue;\n }\n }\n }\n\n // add object\n triple.object = {};\n\n // object is an IRI\n if(object.type === RDF_OBJECT) {\n if(object.value.indexOf('_:') === 0) {\n triple.object.type = 'blank node';\n } else {\n triple.object.type = 'IRI';\n }\n } else {\n // object is a literal\n triple.object.type = 'literal';\n if(object.type === RDF_PLAIN_LITERAL) {\n if(object.language) {\n triple.object.datatype = RDF_LANGSTRING;\n triple.object.language = object.language;\n } else {\n triple.object.datatype = XSD_STRING;\n }\n } else {\n triple.object.datatype = object.type;\n }\n }\n triple.object.value = value;\n\n // add triple to dataset in default graph\n dataset['@default'].push(triple);\n }\n }\n }\n\n return dataset;\n}", "title": "" }, { "docid": "fed2500a30e329b4417e29be80e5040a", "score": "0.5170853", "text": "function _parseRdfaApiData(data) {\n var dataset = {};\n dataset['@default'] = [];\n\n var subjects = data.getSubjects();\n for(var si = 0; si < subjects.length; ++si) {\n var subject = subjects[si];\n if(subject === null) {\n continue;\n }\n\n // get all related triples\n var triples = data.getSubjectTriples(subject);\n if(triples === null) {\n continue;\n }\n var predicates = triples.predicates;\n for(var predicate in predicates) {\n // iterate over objects\n var objects = predicates[predicate].objects;\n for(var oi = 0; oi < objects.length; ++oi) {\n var object = objects[oi];\n\n // create RDF triple\n var triple = {};\n\n // add subject\n if(subject.indexOf('_:') === 0) {\n triple.subject = {type: 'blank node', value: subject};\n } else {\n triple.subject = {type: 'IRI', value: subject};\n }\n\n // add predicate\n if(predicate.indexOf('_:') === 0) {\n triple.predicate = {type: 'blank node', value: predicate};\n } else {\n triple.predicate = {type: 'IRI', value: predicate};\n }\n\n // serialize XML literal\n var value = object.value;\n if(object.type === RDF_XML_LITERAL) {\n // initialize XMLSerializer\n if(!XMLSerializer) {\n _defineXMLSerializer();\n }\n var serializer = new XMLSerializer();\n value = '';\n for(var x = 0; x < object.value.length; x++) {\n if(object.value[x].nodeType === Node.ELEMENT_NODE) {\n value += serializer.serializeToString(object.value[x]);\n } else if(object.value[x].nodeType === Node.TEXT_NODE) {\n value += object.value[x].nodeValue;\n }\n }\n }\n\n // add object\n triple.object = {};\n\n // object is an IRI\n if(object.type === RDF_OBJECT) {\n if(object.value.indexOf('_:') === 0) {\n triple.object.type = 'blank node';\n } else {\n triple.object.type = 'IRI';\n }\n } else {\n // object is a literal\n triple.object.type = 'literal';\n if(object.type === RDF_PLAIN_LITERAL) {\n if(object.language) {\n triple.object.datatype = RDF_LANGSTRING;\n triple.object.language = object.language;\n } else {\n triple.object.datatype = XSD_STRING;\n }\n } else {\n triple.object.datatype = object.type;\n }\n }\n triple.object.value = value;\n\n // add triple to dataset in default graph\n dataset['@default'].push(triple);\n }\n }\n }\n\n return dataset;\n}", "title": "" }, { "docid": "fed2500a30e329b4417e29be80e5040a", "score": "0.5170853", "text": "function _parseRdfaApiData(data) {\n var dataset = {};\n dataset['@default'] = [];\n\n var subjects = data.getSubjects();\n for(var si = 0; si < subjects.length; ++si) {\n var subject = subjects[si];\n if(subject === null) {\n continue;\n }\n\n // get all related triples\n var triples = data.getSubjectTriples(subject);\n if(triples === null) {\n continue;\n }\n var predicates = triples.predicates;\n for(var predicate in predicates) {\n // iterate over objects\n var objects = predicates[predicate].objects;\n for(var oi = 0; oi < objects.length; ++oi) {\n var object = objects[oi];\n\n // create RDF triple\n var triple = {};\n\n // add subject\n if(subject.indexOf('_:') === 0) {\n triple.subject = {type: 'blank node', value: subject};\n } else {\n triple.subject = {type: 'IRI', value: subject};\n }\n\n // add predicate\n if(predicate.indexOf('_:') === 0) {\n triple.predicate = {type: 'blank node', value: predicate};\n } else {\n triple.predicate = {type: 'IRI', value: predicate};\n }\n\n // serialize XML literal\n var value = object.value;\n if(object.type === RDF_XML_LITERAL) {\n // initialize XMLSerializer\n if(!XMLSerializer) {\n _defineXMLSerializer();\n }\n var serializer = new XMLSerializer();\n value = '';\n for(var x = 0; x < object.value.length; x++) {\n if(object.value[x].nodeType === Node.ELEMENT_NODE) {\n value += serializer.serializeToString(object.value[x]);\n } else if(object.value[x].nodeType === Node.TEXT_NODE) {\n value += object.value[x].nodeValue;\n }\n }\n }\n\n // add object\n triple.object = {};\n\n // object is an IRI\n if(object.type === RDF_OBJECT) {\n if(object.value.indexOf('_:') === 0) {\n triple.object.type = 'blank node';\n } else {\n triple.object.type = 'IRI';\n }\n } else {\n // object is a literal\n triple.object.type = 'literal';\n if(object.type === RDF_PLAIN_LITERAL) {\n if(object.language) {\n triple.object.datatype = RDF_LANGSTRING;\n triple.object.language = object.language;\n } else {\n triple.object.datatype = XSD_STRING;\n }\n } else {\n triple.object.datatype = object.type;\n }\n }\n triple.object.value = value;\n\n // add triple to dataset in default graph\n dataset['@default'].push(triple);\n }\n }\n }\n\n return dataset;\n}", "title": "" }, { "docid": "fed2500a30e329b4417e29be80e5040a", "score": "0.5170853", "text": "function _parseRdfaApiData(data) {\n var dataset = {};\n dataset['@default'] = [];\n\n var subjects = data.getSubjects();\n for(var si = 0; si < subjects.length; ++si) {\n var subject = subjects[si];\n if(subject === null) {\n continue;\n }\n\n // get all related triples\n var triples = data.getSubjectTriples(subject);\n if(triples === null) {\n continue;\n }\n var predicates = triples.predicates;\n for(var predicate in predicates) {\n // iterate over objects\n var objects = predicates[predicate].objects;\n for(var oi = 0; oi < objects.length; ++oi) {\n var object = objects[oi];\n\n // create RDF triple\n var triple = {};\n\n // add subject\n if(subject.indexOf('_:') === 0) {\n triple.subject = {type: 'blank node', value: subject};\n } else {\n triple.subject = {type: 'IRI', value: subject};\n }\n\n // add predicate\n if(predicate.indexOf('_:') === 0) {\n triple.predicate = {type: 'blank node', value: predicate};\n } else {\n triple.predicate = {type: 'IRI', value: predicate};\n }\n\n // serialize XML literal\n var value = object.value;\n if(object.type === RDF_XML_LITERAL) {\n // initialize XMLSerializer\n if(!XMLSerializer) {\n _defineXMLSerializer();\n }\n var serializer = new XMLSerializer();\n value = '';\n for(var x = 0; x < object.value.length; x++) {\n if(object.value[x].nodeType === Node.ELEMENT_NODE) {\n value += serializer.serializeToString(object.value[x]);\n } else if(object.value[x].nodeType === Node.TEXT_NODE) {\n value += object.value[x].nodeValue;\n }\n }\n }\n\n // add object\n triple.object = {};\n\n // object is an IRI\n if(object.type === RDF_OBJECT) {\n if(object.value.indexOf('_:') === 0) {\n triple.object.type = 'blank node';\n } else {\n triple.object.type = 'IRI';\n }\n } else {\n // object is a literal\n triple.object.type = 'literal';\n if(object.type === RDF_PLAIN_LITERAL) {\n if(object.language) {\n triple.object.datatype = RDF_LANGSTRING;\n triple.object.language = object.language;\n } else {\n triple.object.datatype = XSD_STRING;\n }\n } else {\n triple.object.datatype = object.type;\n }\n }\n triple.object.value = value;\n\n // add triple to dataset in default graph\n dataset['@default'].push(triple);\n }\n }\n }\n\n return dataset;\n}", "title": "" }, { "docid": "fed2500a30e329b4417e29be80e5040a", "score": "0.5170853", "text": "function _parseRdfaApiData(data) {\n var dataset = {};\n dataset['@default'] = [];\n\n var subjects = data.getSubjects();\n for(var si = 0; si < subjects.length; ++si) {\n var subject = subjects[si];\n if(subject === null) {\n continue;\n }\n\n // get all related triples\n var triples = data.getSubjectTriples(subject);\n if(triples === null) {\n continue;\n }\n var predicates = triples.predicates;\n for(var predicate in predicates) {\n // iterate over objects\n var objects = predicates[predicate].objects;\n for(var oi = 0; oi < objects.length; ++oi) {\n var object = objects[oi];\n\n // create RDF triple\n var triple = {};\n\n // add subject\n if(subject.indexOf('_:') === 0) {\n triple.subject = {type: 'blank node', value: subject};\n } else {\n triple.subject = {type: 'IRI', value: subject};\n }\n\n // add predicate\n if(predicate.indexOf('_:') === 0) {\n triple.predicate = {type: 'blank node', value: predicate};\n } else {\n triple.predicate = {type: 'IRI', value: predicate};\n }\n\n // serialize XML literal\n var value = object.value;\n if(object.type === RDF_XML_LITERAL) {\n // initialize XMLSerializer\n if(!XMLSerializer) {\n _defineXMLSerializer();\n }\n var serializer = new XMLSerializer();\n value = '';\n for(var x = 0; x < object.value.length; x++) {\n if(object.value[x].nodeType === Node.ELEMENT_NODE) {\n value += serializer.serializeToString(object.value[x]);\n } else if(object.value[x].nodeType === Node.TEXT_NODE) {\n value += object.value[x].nodeValue;\n }\n }\n }\n\n // add object\n triple.object = {};\n\n // object is an IRI\n if(object.type === RDF_OBJECT) {\n if(object.value.indexOf('_:') === 0) {\n triple.object.type = 'blank node';\n } else {\n triple.object.type = 'IRI';\n }\n } else {\n // object is a literal\n triple.object.type = 'literal';\n if(object.type === RDF_PLAIN_LITERAL) {\n if(object.language) {\n triple.object.datatype = RDF_LANGSTRING;\n triple.object.language = object.language;\n } else {\n triple.object.datatype = XSD_STRING;\n }\n } else {\n triple.object.datatype = object.type;\n }\n }\n triple.object.value = value;\n\n // add triple to dataset in default graph\n dataset['@default'].push(triple);\n }\n }\n }\n\n return dataset;\n}", "title": "" }, { "docid": "fb5eab7d6b0b12c1e824c7325f9e9497", "score": "0.51502", "text": "function _toNQuad(triple, graphName, bnode) {\n var s = triple.subject;\n var p = triple.predicate;\n var o = triple.object;\n var g = graphName;\n\n var quad = '';\n\n // subject is an IRI\n if(s.type === 'IRI') {\n quad += '<' + s.value + '>';\n } else if(bnode) {\n // bnode normalization mode\n quad += (s.value === bnode) ? '_:a' : '_:z';\n } else {\n // bnode normal mode\n quad += s.value;\n }\n quad += ' ';\n\n // predicate is an IRI\n if(p.type === 'IRI') {\n quad += '<' + p.value + '>';\n } else if(bnode) {\n // FIXME: TBD what to do with bnode predicates during normalization\n // bnode normalization mode\n quad += '_:p';\n } else {\n // bnode normal mode\n quad += p.value;\n }\n quad += ' ';\n\n // object is IRI, bnode, or literal\n if(o.type === 'IRI') {\n quad += '<' + o.value + '>';\n } else if(o.type === 'blank node') {\n // normalization mode\n if(bnode) {\n quad += (o.value === bnode) ? '_:a' : '_:z';\n } else {\n // normal mode\n quad += o.value;\n }\n } else {\n var escaped = o.value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\\"/g, '\\\\\"');\n quad += '\"' + escaped + '\"';\n if(o.datatype === RDF_LANGSTRING) {\n if(o.language) {\n quad += '@' + o.language;\n }\n } else if(o.datatype !== XSD_STRING) {\n quad += '^^<' + o.datatype + '>';\n }\n }\n\n // graph\n if(g !== null) {\n if(g.indexOf('_:') !== 0) {\n quad += ' <' + g + '>';\n } else if(bnode) {\n quad += ' _:g';\n } else {\n quad += ' ' + g;\n }\n }\n\n quad += ' .\\n';\n return quad;\n }", "title": "" }, { "docid": "46d3e45551023aa367b9209cde98833e", "score": "0.51397616", "text": "function _toNQuad(triple, graphName, bnode) {\n var s = triple.subject;\n var p = triple.predicate;\n var o = triple.object;\n var g = graphName;\n\n var quad = '';\n\n // subject is an IRI\n if(s.type === 'IRI') {\n quad += '<' + s.value + '>';\n } else if(bnode) {\n // bnode normalization mode\n quad += (s.value === bnode) ? '_:a' : '_:z';\n } else {\n // bnode normal mode\n quad += s.value;\n }\n quad += ' ';\n\n // predicate is an IRI\n if(p.type === 'IRI') {\n quad += '<' + p.value + '>';\n } else if(bnode) {\n // FIXME: TBD what to do with bnode predicates during normalization\n // bnode normalization mode\n quad += '_:p';\n } else {\n // bnode normal mode\n quad += p.value;\n }\n quad += ' ';\n\n // object is IRI, bnode, or literal\n if(o.type === 'IRI') {\n quad += '<' + o.value + '>';\n } else if(o.type === 'blank node') {\n // normalization mode\n if(bnode) {\n quad += (o.value === bnode) ? '_:a' : '_:z';\n } else {\n // normal mode\n quad += o.value;\n }\n } else {\n var escaped = o.value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\\"/g, '\\\\\"');\n quad += '\"' + escaped + '\"';\n if(o.datatype === RDF_LANGSTRING) {\n if(o.language) {\n quad += '@' + o.language;\n }\n } else if(o.datatype !== XSD_STRING) {\n quad += '^^<' + o.datatype + '>';\n }\n }\n\n // graph\n if(g !== null) {\n if(g.indexOf('_:') !== 0) {\n quad += ' <' + g + '>';\n } else if(bnode) {\n quad += ' _:g';\n } else {\n quad += ' ' + g;\n }\n }\n\n quad += ' .\\n';\n return quad;\n}", "title": "" }, { "docid": "46d3e45551023aa367b9209cde98833e", "score": "0.51397616", "text": "function _toNQuad(triple, graphName, bnode) {\n var s = triple.subject;\n var p = triple.predicate;\n var o = triple.object;\n var g = graphName;\n\n var quad = '';\n\n // subject is an IRI\n if(s.type === 'IRI') {\n quad += '<' + s.value + '>';\n } else if(bnode) {\n // bnode normalization mode\n quad += (s.value === bnode) ? '_:a' : '_:z';\n } else {\n // bnode normal mode\n quad += s.value;\n }\n quad += ' ';\n\n // predicate is an IRI\n if(p.type === 'IRI') {\n quad += '<' + p.value + '>';\n } else if(bnode) {\n // FIXME: TBD what to do with bnode predicates during normalization\n // bnode normalization mode\n quad += '_:p';\n } else {\n // bnode normal mode\n quad += p.value;\n }\n quad += ' ';\n\n // object is IRI, bnode, or literal\n if(o.type === 'IRI') {\n quad += '<' + o.value + '>';\n } else if(o.type === 'blank node') {\n // normalization mode\n if(bnode) {\n quad += (o.value === bnode) ? '_:a' : '_:z';\n } else {\n // normal mode\n quad += o.value;\n }\n } else {\n var escaped = o.value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\\"/g, '\\\\\"');\n quad += '\"' + escaped + '\"';\n if(o.datatype === RDF_LANGSTRING) {\n if(o.language) {\n quad += '@' + o.language;\n }\n } else if(o.datatype !== XSD_STRING) {\n quad += '^^<' + o.datatype + '>';\n }\n }\n\n // graph\n if(g !== null) {\n if(g.indexOf('_:') !== 0) {\n quad += ' <' + g + '>';\n } else if(bnode) {\n quad += ' _:g';\n } else {\n quad += ' ' + g;\n }\n }\n\n quad += ' .\\n';\n return quad;\n}", "title": "" }, { "docid": "1e36084902d759b648d89c8b0bf2745e", "score": "0.5085631", "text": "function pushTriple(object, key, value) {\n\n if (key === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type') {\n if (typeof object['@type'] === 'undefined') {\n object['@type'] = [];\n }\n object['@type'].push(value['@id']);\n } else {\n if (typeof object[key] === 'undefined') {\n object[key] = value;\n } else {\n if (!Array.isArray(object[key])) {\n object[key] = [object[key]];\n }\n object[key].push(value);\n }\n }\n}", "title": "" }, { "docid": "aa2d3d6229c988b989fe3ceb8a2febb3", "score": "0.5083819", "text": "function _toNQuad(triple,graphName){var s=triple.subject;var p=triple.predicate;var o=triple.object;var g=graphName||null;if('name'in triple&&triple.name){g=triple.name.value;}var quad='';// subject is an IRI\nif(s.type==='IRI'){quad+='<'+s.value+'>';}else{quad+=s.value;}quad+=' ';// predicate is an IRI\nif(p.type==='IRI'){quad+='<'+p.value+'>';}else{quad+=p.value;}quad+=' ';// object is IRI, bnode, or literal\nif(o.type==='IRI'){quad+='<'+o.value+'>';}else if(o.type==='blank node'){quad+=o.value;}else{var escaped=o.value.replace(/\\\\/g,'\\\\\\\\').replace(/\\t/g,'\\\\t').replace(/\\n/g,'\\\\n').replace(/\\r/g,'\\\\r').replace(/\\\"/g,'\\\\\"');quad+='\"'+escaped+'\"';if(o.datatype===RDF_LANGSTRING){if(o.language){quad+='@'+o.language;}}else if(o.datatype!==XSD_STRING){quad+='^^<'+o.datatype+'>';}}// graph\nif(g!==null&&g!==undefined){if(g.indexOf('_:')!==0){quad+=' <'+g+'>';}else{quad+=' '+g;}}quad+=' .\\n';return quad;}", "title": "" }, { "docid": "8901cfd49b551dfd8ac99b2854fb6b2c", "score": "0.5036818", "text": "function displayGraphJson(object, endpoint, svg, table) {\n // Initialise the visualisation graph and start extracting JSON-LD content.\n var data = { nodes: [], links: [] },\n entityList = [],\n construction = object['@graph'],\n context = object['@context'],\n propertyCount = 0;\n\n console.log(object);\n\n // JSON-LD graphs with a single subject don't wrap it in a @graph element.\n if (construction === undefined) construction = [object];\n \n // Add extra information about namespace prefixes to the JSON-LD @context element to make it easier to link properties with their specifications later.\n for (elem in context) {\n let prefix = \"\";\n // Work out what namespace is associated with each property used in the graph.\n if (typeof context[elem] !== \"string\") {\n // Filter out the namespace declarations; only want properties at first.\n prefix = context[elem][\"@id\"];\n if (prefix !== undefined) {\n // Namespaces end in '#' or '/'.\n let separationPoint = prefix.indexOf(\"#\");\n if (separationPoint == -1)\n separationPoint = prefix.lastIndexOf(\"/\");\n prefix = prefix.slice(0, separationPoint + 1);\n for (elem2 in context) {\n if (elem2 == \"@vocab\") {\n continue; // Skip this case.\n } else if (context[elem2] === prefix) {\n context[elem].prefix = elem2\n break; // Finish this search.\n }\n }\n }\n }\n }\n\n // Build the graph from the JSON-LD.\n for (i = 0; i < construction.length; i++) {\n let entity = construction[i][\"@id\"], index;\n // Need a node for every subject in the JSON-LD.\n if (!entityList.includes(entity)) {\n data.nodes.push({ id: entity, title: entity, group: 0 });\n index = entityList.push(entity) - 1;\n } else {\n index = entityList.indexOf(entity);\n }\n // Examine each entry in the JSON-LD in turn to learn more.\n for (j in construction[i]) {\n if (j === \"@id\" || j === \"@context\") {\n continue; // Ignore @ids (already checked) and @context elements.\n } else if (j === \"@type\") {\n // If @type information is provided, extract it.\n let type = construction[i][\"@type\"];\n if (Array.isArray(type)) {\n // If there are multiple types, treat as an individual.\n data.nodes[index].group = 2;\n } else if (type === \"owl:Class\")\n data.nodes[index].group = 1;\n else if (type === \"owl:NamedIndividual\")\n data.nodes[index].group = 2;\n else if (type === \"owl:ObjectProperty\")\n data.nodes[index].group = 3;\n else if (type === \"owl:DataProperty\")\n data.nodes[index].group = 4;\n } else {\n // Look at every property for every subject in turn.\n let pIndex, fullName, pPrefix;\n pId = j + propertyCount;\n\n if (context[j] !== undefined) pPrefix = context[j].prefix;\n // Because properties nodes are not unique, use a counter to differentiate different uses of the same property.\n propertyCount++;\n // Attach the namespace to the property label where available.\n if (pPrefix === undefined)\n pPrefix = \"null\"; // Just in case.\n fullName = pPrefix + \":\" + j;\n // Create an intermediary node for every property encountered.\n if(!entityList.includes(pId)) {\n data.nodes.push({ id: pId, title: fullName, group: 3 });\n pIndex = entityList.push(pId) - 1;\n } else {\n pIndex = entityList.indexOf(pId);\n }\n data.links.push({ source: entity, target: pId });\n // Link to every object; create new nodes for objects where needed.\n let values = construction[i][j];\n if (Array.isArray(values)) {\n // If a property has several objects, check them all.\n for (k = 0; k < values.length; k++) {\n if (typeof values[k][\"@value\"] === \"string\") {\n // If a property is a data property, create a data node.\n let dId = \"data\" + propertyCount;\n propertyCount++;\n data.nodes.push({ id: dId, title: values[k][\"@value\"], group: 5 });\n data.links.push({ source: pId, target: dId });\n } else if (typeof values[k] === \"number\") {\n let dId = \"data\" + propertyCount;\n propertyCount++;\n data.nodes.push({ id: dId, title: values[k], group: 5 });\n data.links.push({ source: pId, target: dId });\n } else {\n if (!entityList.includes(values[k])) {\n let group = (values[k].split(\":\").length == 1) ? 5 : 0;\n data.nodes.push({ id: values[k], title: values[k], group: group });\n entityList.push(values[k]);\n }\n data.links.push({ source: pId, target: values[k] });\n }\n }\n } else if (typeof values === \"string\") {\n // If a property has only one object, check that.\n if (!entityList.includes(values)) {\n let group = (values.split(\":\").length == 1) ? 5 : 0;\n data.nodes.push({ id: values, title: values, group: group });\n entityList.push(values);\n }\n data.links.push({ source: pId, target: values });\n } else if (typeof values === \"number\") {\n // If a numeric data property...\n let dId = \"data\" + propertyCount;\n propertyCount++;\n data.nodes.push({ id: dId, title: values, group: 5 });\n data.links.push({ source: pId, target: dId });\n } else if (typeof values[\"@value\"] === \"string\") {\n // If a property is a data property, create a data node.\n let dId = \"data\" + propertyCount;\n propertyCount++;\n data.nodes.push({ id: dId, title: values[\"@value\"], group: 5 });\n data.links.push({ source: pId, target: dId });\n }\n }\n }\n }\n\n // Add extra metadata to nodes.\n for (i = 0; i < data.nodes.length; i++) {\n data.nodes[i].endpoint = endpoint;\n data.nodes[i].table = table;\n data.nodes[i].visualiser = svg;\n }\n\n console.log(data.nodes);\n console.log(data.links);\n\n // Create the visualistion using D3.\n updateVisualiser(svg, data);\n}", "title": "" }, { "docid": "5203fa967837dbc461789420a6889c63", "score": "0.50079703", "text": "_convertThingFromJson(thing) {\n const id = `0x${sha3_256(`${thing.name}.${thing.id}`, null, 0)}`;\n\n const otObject = {\n '@type': 'otObject',\n '@id': id,\n identifiers: [\n {\n '@type': 'id',\n '@value': id,\n },\n ],\n relations: [],\n properties: {\n id: thing.id,\n name: thing.name,\n description: thing.description,\n tags: thing.tags,\n },\n };\n\n const createRelation = (id, relType, data) => ({\n '@type': 'otRelation',\n relationType: relType,\n direction: 'direct', // think about direction\n linkedObject: {\n '@id': id,\n },\n properties: data,\n });\n\n if (thing.customFields) {\n for (const obj of thing.customFields) {\n let relType;\n switch (obj.type) {\n case 'readPoint':\n relType = 'OBSERVATION_READ_POINT';\n break;\n case 'observedObject':\n relType = 'OBSERVES';\n break;\n default:\n relType = 'PART_OF';\n break;\n }\n otObject.relations.push(createRelation(obj.id, relType, {\n type: obj.type,\n }));\n }\n }\n\n return otObject;\n }", "title": "" }, { "docid": "132bacc12d8446eb5c9c25500fcef09a", "score": "0.4987376", "text": "function _parseRdfaApiData(data) {\n\t var dataset = {};\n\t dataset['@default'] = [];\n\t\n\t var subjects = data.getSubjects();\n\t for(var si = 0; si < subjects.length; ++si) {\n\t var subject = subjects[si];\n\t if(subject === null) {\n\t continue;\n\t }\n\t\n\t // get all related triples\n\t var triples = data.getSubjectTriples(subject);\n\t if(triples === null) {\n\t continue;\n\t }\n\t var predicates = triples.predicates;\n\t for(var predicate in predicates) {\n\t // iterate over objects\n\t var objects = predicates[predicate].objects;\n\t for(var oi = 0; oi < objects.length; ++oi) {\n\t var object = objects[oi];\n\t\n\t // create RDF triple\n\t var triple = {};\n\t\n\t // add subject\n\t if(subject.indexOf('_:') === 0) {\n\t triple.subject = {type: 'blank node', value: subject};\n\t } else {\n\t triple.subject = {type: 'IRI', value: subject};\n\t }\n\t\n\t // add predicate\n\t if(predicate.indexOf('_:') === 0) {\n\t triple.predicate = {type: 'blank node', value: predicate};\n\t } else {\n\t triple.predicate = {type: 'IRI', value: predicate};\n\t }\n\t\n\t // serialize XML literal\n\t var value = object.value;\n\t if(object.type === RDF_XML_LITERAL) {\n\t // initialize XMLSerializer\n\t if(!XMLSerializer) {\n\t _defineXMLSerializer();\n\t }\n\t var serializer = new XMLSerializer();\n\t value = '';\n\t for(var x = 0; x < object.value.length; x++) {\n\t if(object.value[x].nodeType === Node.ELEMENT_NODE) {\n\t value += serializer.serializeToString(object.value[x]);\n\t } else if(object.value[x].nodeType === Node.TEXT_NODE) {\n\t value += object.value[x].nodeValue;\n\t }\n\t }\n\t }\n\t\n\t // add object\n\t triple.object = {};\n\t\n\t // object is an IRI\n\t if(object.type === RDF_OBJECT) {\n\t if(object.value.indexOf('_:') === 0) {\n\t triple.object.type = 'blank node';\n\t } else {\n\t triple.object.type = 'IRI';\n\t }\n\t } else {\n\t // object is a literal\n\t triple.object.type = 'literal';\n\t if(object.type === RDF_PLAIN_LITERAL) {\n\t if(object.language) {\n\t triple.object.datatype = RDF_LANGSTRING;\n\t triple.object.language = object.language;\n\t } else {\n\t triple.object.datatype = XSD_STRING;\n\t }\n\t } else {\n\t triple.object.datatype = object.type;\n\t }\n\t }\n\t triple.object.value = value;\n\t\n\t // add triple to dataset in default graph\n\t dataset['@default'].push(triple);\n\t }\n\t }\n\t }\n\t\n\t return dataset;\n\t}", "title": "" }, { "docid": "31ee1f79fc09401ffe82f9db82184e8a", "score": "0.49195346", "text": "function _graphToRDF(dataset, graph, graphTerm, issuer, options) {\n const ids = Object.keys(graph).sort();\n for(const id of ids) {\n const node = graph[id];\n const properties = Object.keys(node).sort();\n for(let property of properties) {\n const items = node[property];\n if(property === '@type') {\n property = RDF_TYPE;\n } else if(isKeyword(property)) {\n continue;\n }\n\n for(const item of items) {\n // RDF subject\n const subject = {\n termType: id.startsWith('_:') ? 'BlankNode' : 'NamedNode',\n value: id\n };\n\n // skip relative IRI subjects (not valid RDF)\n if(!_isAbsoluteIri(id)) {\n continue;\n }\n\n // RDF predicate\n const predicate = {\n termType: property.startsWith('_:') ? 'BlankNode' : 'NamedNode',\n value: property\n };\n\n // skip relative IRI predicates (not valid RDF)\n if(!_isAbsoluteIri(property)) {\n continue;\n }\n\n // skip blank node predicates unless producing generalized RDF\n if(predicate.termType === 'BlankNode' &&\n !options.produceGeneralizedRdf) {\n continue;\n }\n\n // convert list, value or node object to triple\n const object =\n _objectToRDF(item, issuer, dataset, graphTerm, options.rdfDirection);\n // skip null objects (they are relative IRIs)\n if(object) {\n dataset.push({\n subject,\n predicate,\n object,\n graph: graphTerm\n });\n }\n }\n }\n }\n}", "title": "" }, { "docid": "0675f6d35a0a8fabec33871e3efedcd0", "score": "0.49037474", "text": "function _parseRdfaApiData(data){var dataset={};dataset['@default']=[];var subjects=data.getSubjects();for(var si=0;si<subjects.length;++si){var subject=subjects[si];if(subject===null){continue;}// get all related triples\nvar triples=data.getSubjectTriples(subject);if(triples===null){continue;}var predicates=triples.predicates;for(var predicate in predicates){// iterate over objects\nvar objects=predicates[predicate].objects;for(var oi=0;oi<objects.length;++oi){var object=objects[oi];// create RDF triple\nvar triple={};// add subject\nif(subject.indexOf('_:')===0){triple.subject={type:'blank node',value:subject};}else{triple.subject={type:'IRI',value:subject};}// add predicate\nif(predicate.indexOf('_:')===0){triple.predicate={type:'blank node',value:predicate};}else{triple.predicate={type:'IRI',value:predicate};}// serialize XML literal\nvar value=object.value;if(object.type===RDF_XML_LITERAL){// initialize XMLSerializer\nif(!XMLSerializer){_defineXMLSerializer();}var serializer=new XMLSerializer();value='';for(var x=0;x<object.value.length;x++){if(object.value[x].nodeType===Node.ELEMENT_NODE){value+=serializer.serializeToString(object.value[x]);}else if(object.value[x].nodeType===Node.TEXT_NODE){value+=object.value[x].nodeValue;}}}// add object\ntriple.object={};// object is an IRI\nif(object.type===RDF_OBJECT){if(object.value.indexOf('_:')===0){triple.object.type='blank node';}else{triple.object.type='IRI';}}else{// object is a literal\ntriple.object.type='literal';if(object.type===RDF_PLAIN_LITERAL){if(object.language){triple.object.datatype=RDF_LANGSTRING;triple.object.language=object.language;}else{triple.object.datatype=XSD_STRING;}}else{triple.object.datatype=object.type;}}triple.object.value=value;// add triple to dataset in default graph\ndataset['@default'].push(triple);}}}return dataset;}// register the RDFa API RDF parser", "title": "" }, { "docid": "ff396b3f2c6db352dc2aa451701f2693", "score": "0.48548844", "text": "function serializeBookmarksRdf(object){\n\t\t//dom constants\n\t\tconst nsIDOMDocument = Components.interfaces.nsIDOMDocument;\n\t\t//rdf constants\n\t\tconst nsIRDFDate = Components.interfaces.nsIRDFDate;\n \tconst nsIRDFLiteral = Components.interfaces.nsIRDFLiteral;\n \tconst nsIRDFResource = Components.interfaces.nsIRDFResource;\n \tconst nsIEntityConverter = Components.interfaces.nsIEntityConverter;\n \t//property constants\n \tconst nsName = 'Name';\n \tconst rdfSeq = 'Seq';\n \tconst rdfli = 'li';\n \tconst rdfabout = 'about';\n \tconst nsNameSpace = 'NC';\n \tconst rdfNameSpace = 'RDF';\n \t//bookmark properties we are interested in\n\t\tconst ImportantProperties = \n\t\t\t\t['LastVisitDate','BookmarkAddDate','LastModifiedDate','LastCharset',\n\t\t\t\t'Description','FeedURL','Name','ShortcutURL','URL'];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tvar dom = Components.classes['@mozilla.org/xul/xul-document;1']\n\t\t\t.createInstance(nsIDOMDocument);\n\t\tvar parent = dom.createElement(rdfNameSpace+':RDF');\n parent = dom.appendChild(parent);\n //just in case if we later decide to use name spaces\n\t \tparent.setAttribute('xmlns:'+rdfNameSpace,rdfRdf);\t//default namespace\n parent.setAttribute('xmlns:'+nsNameSpace,nsRdf); \t\n \tconst entityConverter = Components.classes['@mozilla.org/intl/entityconverter;1']\n \t\t.createInstance(Components.interfaces.nsIEntityConverter);\n \t\t\n \texportFolder(nsRdf_root,true,parent);\n \tconst xmlSerializer = Components.classes['@mozilla.org/xmlextras/xmlserializer;1']\n \t\t.createInstance(Components.interfaces.nsIDOMSerializer);\n \tobject.value = '<?xml version=\"1.0\"?>'+xmlSerializer.serializeToString(dom);\n \t\n \tfunction exportMark(res,url,isFeed,parentli){\n \t\tvar parent = dom.createElement(rdfNameSpace+':'+rdfli);\n \t\tparentli.appendChild(parent);\n \t\tparent.setAttribute('id',res.Value);\n \t\tvar arcs = mBds.ArcLabelsOut(res);\n \t\t//iterate through links properties\n \t\twhile(arcs.hasMoreElements()){\n \t\t\tvar next = arcs.getNext().QueryInterface(nsIRDFResource);\n \t\t\tvar prop = next.Value;\n \t\t\tvar which;\n \t\t\tvar doEnc = false;\n \t\t\tif (!(which = prop.endsWith(ImportantProperties)))\n \t\t\t\t\tcontinue;\n \t\t\tvar target = mBds.GetTarget(res,next,true);\n \t\t\tvar val;\n \t\t\t//is date?\n \t\t\ttry{\n\t \t\t\tif (which < 4){\n\t \t\t\t\tvar v = target.QueryInterface(nsIRDFDate).Value;\n\t \t\t\t\tval = Math.floor(parseInt(v)/1000000);//result = timestamp in seconds\n\t \t\t\t}else{\n\t \t\t\t\tval = target.QueryInterface(nsIRDFLiteral).Value;\n\t \t\t\t\t//1st remove all special symbols (they shouldn't be here anyways)\n\t \t\t\t\tval = entityConverter.ConvertToEntities(val,nsIEntityConverter.html40);\n\t \t\t\t}\n\t \t\t\tvar e = dom.createElement(nsNameSpace+':'+ImportantProperties[which-1]);\n\t \t\t\te = parent.appendChild(e);\n\t \t\t\tvar v = dom.createTextNode(val);\n\t \t\t\te.appendChild(v);\n\t \t\t}catch(e){\n\t \t\t\tdmp('failed setting property:'+prop+' for:'+res.Value);\n\t \t\t}\n \t\t}\n \t}\n \tfunction exportFolder(res,isRoot,parent){\n \t\tvar name = null;\n \t\tif (!isRoot){\n \t\t\tname = mBds.GetTarget(res,nsRdf_Name,true);\n\t\t\t\tif (name == null)\t//this is not a folder (probably a separator)\n\t\t\t\t\treturn;\n\t\t\t\tname = name.QueryInterface(nsIRDFLiteral).Value;\n\t \t\t//remove special symbols (i.e. copyright signs...)\n\t \t\tname = entityConverter.ConvertToEntities(name,nsIEntityConverter.html40);\n \t\t}\n \t\tvar e = dom.createElement(rdfNameSpace+':'+rdfSeq);\n \t\te = parent.appendChild(e);\n \t\te.setAttribute(rdfNameSpace+':'+rdfabout,res.Value);\n \t\tif (name){\n \t\t\te.setAttribute(rdfNameSpace+':'+nsName,name);\n \t\t}\n \t\tparent = e;\n \t\tvar cnt = Components.classes['@mozilla.org/rdf/container;1']\n \t\t\t\t.createInstance(Components.interfaces.nsIRDFContainer);\n \t\tcnt.Init(mBds,res);\n \t\tvar enum = cnt.GetElements();\n \t\t//this is not exactly a valid rdf file, but it simplifies a couple of things :)\n \t\twhile(enum.hasMoreElements()){\n \t\t\tvar el = enum.getNext()\n \t\t\tel.QueryInterface(Components.interfaces.nsIRDFResource);\n \t\t\tif ((target = mBds.GetTarget(el,nsRdf_FeedURL,true)) != null){\n \t\t\t\texportMark(el,target.QueryInterface(nsIRDFLiteral).Value,true,parent);\n \t\t\t}else if((target = mBds.GetTarget(el,nsRdf_URL,true)) != null){\n \t\t\t\texportMark(el,target.QueryInterface(nsIRDFLiteral).Value,false,parent);\n \t\t\t}else{\n \t\t\t\t//folders are never inserted into li tags, so that we can easily gather all links using li tag\n \t\t\t\texportFolder(el,false,parent);\n \t\t\t}\n \t\t}\n \t}\n }", "title": "" }, { "docid": "56a9871db04118e54320f98d280e3313", "score": "0.4833534", "text": "function parse(str,kb,base,contentType,callback){try{if(contentType==='text/n3'||contentType==='text/turtle'){var p=N3Parser(kb,kb,base,base,null,null,'',null);p.loadBuf(str);executeCallback();}else if(contentType==='application/rdf+xml'){var parser=new RDFParser(kb);parser.parse(Util.parseXML(str),base,kb.sym(base));executeCallback();}else if(contentType==='application/xhtml+xml'){parseRDFaDOM(Util.parseXML(str,{contentType:'application/xhtml+xml'}),kb,base);executeCallback();}else if(contentType==='text/html'){parseRDFaDOM(Util.parseXML(str,{contentType:'text/html'}),kb,base);executeCallback();}else if(contentType==='application/sparql-update'){// @@ we handle a subset\nsparqlUpdateParser(str,kb,base);executeCallback();}else if(contentType==='application/ld+json'||contentType==='application/nquads'||contentType==='application/n-quads'){var n3Parser=N3.Parser();var triples=[];if(contentType==='application/ld+json'){var jsonDocument;try{jsonDocument=JSON.parse(str);}catch(parseErr){callback(parseErr,null);}jsonld.toRDF(jsonDocument,{format:'application/nquads'},nquadCallback);}else{nquadCallback(null,str);}}else{throw new Error(\"Don't know how to parse \"+contentType+' yet');}}catch(e){executeErrorCallback(e);}function executeCallback(){if(callback){callback(null,kb);}else{return;}}function executeErrorCallback(e){if(contentType!=='application/ld+json'||contentType!=='application/nquads'||contentType!=='application/n-quads'){if(callback){callback(e,kb);}else{throw new Error('Error trying to parse <'+base+'> as '+contentType+':\\n'+e+':\\n'+e.stack);}}}/*\n function setJsonLdBase (doc, base) {\n if (doc instanceof Array) {\n return\n }\n if (!('@context' in doc)) {\n doc['@context'] = {}\n }\n doc['@context']['@base'] = base\n }\n*/function nquadCallback(err,nquads){if(err){callback(err,kb);}try{n3Parser.parse(nquads,tripleCallback);}catch(err){callback(err,kb);}}function tripleCallback(err,triple,prefixes){if(err){callback(err,kb);}if(triple){triples.push(triple);}else{for(var i=0;i<triples.length;i++){addTriple(kb,triples[i]);}callback(null,kb);}}function addTriple(kb,triple){var subject=createTerm(triple.subject);var predicate=createTerm(triple.predicate);var object=createTerm(triple.object);var why=null;if(triple.graph){why=createTerm(triple.graph);}kb.add(subject,predicate,object,why);}function createTerm(termString){var value;if(N3.Util.isLiteral(termString)){value=N3.Util.getLiteralValue(termString);var language=N3.Util.getLiteralLanguage(termString);var datatype=new NamedNode(N3.Util.getLiteralType(termString));return new Literal(value,language,datatype);}else if(N3.Util.isIRI(termString)){return new NamedNode(termString);}else if(N3.Util.isBlank(termString)){value=termString.substring(2,termString.length);return new BlankNode(value);}else{return null;}}}", "title": "" }, { "docid": "b7939365ed68f015206f1ce340be106b", "score": "0.48328513", "text": "function _graphToRDF(graph,issuer,options){var rval=[];var ids=Object.keys(graph).sort();for(var i=0;i<ids.length;++i){var id=ids[i];var node=graph[id];var properties=Object.keys(node).sort();for(var pi=0;pi<properties.length;++pi){var property=properties[pi];var items=node[property];if(property==='@type'){property=RDF_TYPE;}else if(_isKeyword(property)){continue;}for(var ii=0;ii<items.length;++ii){var item=items[ii];// RDF subject\nvar subject={};subject.type=id.indexOf('_:')===0?'blank node':'IRI';subject.value=id;// skip relative IRI subjects\nif(!_isAbsoluteIri(id)){continue;}// RDF predicate\nvar predicate={};predicate.type=property.indexOf('_:')===0?'blank node':'IRI';predicate.value=property;// skip relative IRI predicates\nif(!_isAbsoluteIri(property)){continue;}// skip blank node predicates unless producing generalized RDF\nif(predicate.type==='blank node'&&!options.produceGeneralizedRdf){continue;}// convert @list to triples\nif(_isList(item)){_listToRDF(item['@list'],issuer,subject,predicate,rval);}else{// convert value or node object to triple\nvar object=_objectToRDF(item);// skip null objects (they are relative IRIs)\nif(object){rval.push({subject:subject,predicate:predicate,object:object});}}}}}return rval;}", "title": "" }, { "docid": "ec11cec6bfd47f8824a9d860683c988f", "score": "0.48240405", "text": "function RDFLiteral(value, lang, datatype) {\n this.value = value\n this.lang=lang;\t // string\n this.datatype=datatype; // term\n this.toString = RDFLiteralToString\n this.toNT = RDFLiteral_toNT\n //if (LiteralSmush[this.toNT()]) return LiteralSmush[this.toNT()];\n //else LiteralSmush[this.toNT()]=this;\n return this\n}", "title": "" }, { "docid": "1aa894d3f4838c0393765c01350fc150", "score": "0.48215613", "text": "function OWLJSONLD2JSONSchema(_owljsonld, cb) {\n console.log('OWLJSONLD2JSONSchema _json', _json)\n\n return new Promise(function (resolve, reject) {\n try {\n let _JSON = JSON.stringify(_json) || _json;\n console.log('OWLJSONLD2JSONSchema entry', _JSON)\n\n resolve();\n\n }\n catch (e) {\n console.log('catch error OWLJSONLD2JSONSchema', e);\n if (cb) cb(e);\n reject(e);\n\n }\n }); // end promise\n}", "title": "" }, { "docid": "1a88ab56ea2d7572056fcb5b10b6ec6d", "score": "0.48121032", "text": "function serializeToTurtle(sObj){\n let s = \"\"\n let num_nodes = Object.keys(sObj).length\n let count = 0\n for(var key in sObj){\n let pfname = key.split(\"/\")\n let iri = key.split(\"#\")\n let kname = pfname[pfname.length-1].split(\"#\")\n let iri_complete = iri[0] + \"#\"\n let prefix_name = getPrefix(iri_complete)\n let node_name = prefix_name+\":\"+ kname[1]\n s = s + node_name + \" \"\n\n let node_length = sObj[key].length\n let pObj = sObj[key]\n for(let i = 0; i<node_length-1; i++){\n let pf_key = getPrefixKeyForm(pObj[i])\n s = s + pf_key + \" ;\\n\"\n s = s + \" \"\n }\n let pf_key = getPrefixKeyForm(pObj[node_length-1])\n s = s + pf_key + \" .\\n\"\n }//for\n return s\n}", "title": "" }, { "docid": "8213fdd0448b80e31ea97e07bcb15a5b", "score": "0.47940558", "text": "function tagElementToObject(tag_object) {\n var type = tag_object.hasClass('concept') ? 'concept' : 'freeterm';\n return {tid: tag_object.attr(\"data-tid\"), uri: tag_object.attr(\"data-uri\"), label: tag_object.attr(\"data-label\"), type: type};\n }", "title": "" }, { "docid": "ac7e06ef93491ff7f4c1c8ed8202e32a", "score": "0.47419322", "text": "function createTripleDiv(rdfObject, property){\n\tvar tripleDiv = \"\"; \n\ttripleDiv += createContentDivs(rdfObject,property); \n\treturn tripleDiv;\n}", "title": "" }, { "docid": "0dd2dd78042c02984a0ce70c9fd68c0d", "score": "0.46926603", "text": "function processJRD(JRD, cb) {\n var links = JSON.parse(JRD).links;\n if (!links) {\n var serverResp = JSON.parse(JRD);\n if (typeof serverResp.error !== 'undefined') {\n cb(serverResp.error);\n } else {\n cb('received unknown response from server');\n }\n return;\n }\n\n var result = {\n properties: {},\n links: links,\n JRD: JRD // raw webfinger JRD\n };\n\n // process properties\n var props = JSON.parse(JRD).properties;\n for (var key in props) {\n result.properties[key] = props[key];\n }\n cb(null, result);\n }", "title": "" }, { "docid": "f9a9eef007975a922270009b4f3fae62", "score": "0.46689773", "text": "toJSONObject() {\n return JSON.parse(this.ast.serialize());\n }", "title": "" }, { "docid": "e4ab784da3bb9664652bcd0f5b7b0ae5", "score": "0.46576983", "text": "_convertEntity(entity) {\n // Rename blank nodes\n if (entity.type === 'blank node')\n return entity.value + 'bnode' + this._blankNodeId;\n else if (entity.type !== 'literal') {\n if (entity.value.startsWith('unknown://'))\n this.emit('error', 'Could not expand the JSON-LD shortcut \"' + entity.value.replace('unknown://', '')\n + '\". Are all the required modules available and JSON-LD contexts included?');\n else\n return entity.value;\n }\n else {\n // Add a language tag to the literal if present\n if ('language' in entity)\n return '\"' + entity.value + '\"@' + entity.language;\n // Add a datatype to the literal if present\n if (entity.datatype !== 'http://www.w3.org/2001/XMLSchema#string')\n return '\"' + entity.value + '\"^^' + entity.datatype;\n // Otherwise, return the regular literal\n return '\"' + entity.value + '\"';\n }\n }", "title": "" }, { "docid": "afa90af8809346ac23717a3933e89d08", "score": "0.46038064", "text": "_convertPropertiesFromJson(object) {\n const { things } = object;\n if (things == null) {\n throw new Error('Invalid WOT document!');\n }\n\n const root = things.properties;\n if (root == null) {\n return [];\n }\n\n const result = [];\n for (const property of root) {\n const id = `0x${sha3_256(`${things.thing.name}.${things.thing.id}.${property.id}`, null, 0)}`;\n\n const otObject = {\n '@type': 'otObject',\n '@id': id,\n identifiers: [\n {\n '@type': 'id',\n '@value': id,\n },\n {\n '@type': 'internal_id',\n '@value': property.id,\n },\n {\n '@type': 'name',\n '@value': property.name,\n },\n ],\n properties: { data: property.values },\n relations: [],\n };\n\n result.push(otObject);\n }\n return result;\n }", "title": "" }, { "docid": "e0e3262e48b5504d420ce93a7449aa6f", "score": "0.45889437", "text": "_convertThingToJson(otThing) {\n const thing = {\n id: otThing.properties.id,\n name: otThing.properties.name,\n description: otThing.properties.description,\n tags: otThing.properties.tags,\n\n };\n\n return thing;\n }", "title": "" }, { "docid": "9d36ee8c4778e8dba5d4dac0ab04a4dd", "score": "0.4523595", "text": "async function triplesToTurtle(quads) {\n const n3 = await loadN3();\n const format = \"text/turtle\";\n const writer = new n3.Writer({\n format: format\n });\n // Remove any potentially lingering references to Named Graphs in Quads;\n // they'll be determined by the URL the Turtle will be sent to:\n const triples = quads.map(quad => DataFactory.quad(quad.subject, quad.predicate, quad.object, undefined));\n writer.addQuads(triples);\n const writePromise = new Promise((resolve, reject) => {\n writer.end((error, result) => {\n /*istanbul ignore if [n3.js doesn't actually pass an error nor a result, apparently: https://github.com/rdfjs/N3.js/blob/62682e48c02d8965b4d728cb5f2cbec6b5d1b1b8/src/N3Writer.js#L290]*/\n if (error) {\n return reject(error);\n }\n resolve(result);\n });\n });\n const rawTurtle = await writePromise;\n return rawTurtle;\n}", "title": "" }, { "docid": "abbe592bd95ae7787395733052fc0ad9", "score": "0.4461127", "text": "function makeTerm(val) {\n // fyi(\"Making term from \" + val)\n if (typeof val == 'object') return val;\n if (typeof val == 'string') return new RDFLiteral(val);\n if (typeof val == 'undefined') return undefined;\n alert(\"Can't make term from \" + val + \" of type \" + typeof val) // @@ add numbers\n}", "title": "" }, { "docid": "c36b43e50af897832a01e39c1424bb76", "score": "0.44527307", "text": "function _parseNQuads(input){// define partial regexes\nvar iri='(?:<([^:]+:[^>]*)>)';var bnode='(_:(?:[A-Za-z0-9]+))';var plain='\"([^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*)\"';var datatype='(?:\\\\^\\\\^'+iri+')';var language='(?:@([a-z]+(?:-[a-z0-9]+)*))';var literal='(?:'+plain+'(?:'+datatype+'|'+language+')?)';var comment='(?:#.*)?';var ws='[ \\\\t]+';var wso='[ \\\\t]*';var eoln=/(?:\\r\\n)|(?:\\n)|(?:\\r)/g;var empty=new RegExp('^'+wso+comment+'$');// define quad part regexes\nvar subject='(?:'+iri+'|'+bnode+')'+ws;var property=iri+ws;var object='(?:'+iri+'|'+bnode+'|'+literal+')'+wso;var graphName='(?:\\\\.|(?:(?:'+iri+'|'+bnode+')'+wso+'\\\\.))';// full quad regex\nvar quad=new RegExp('^'+wso+subject+property+object+graphName+wso+comment+'$');// build RDF dataset\nvar dataset={};// split N-Quad input into lines\nvar lines=input.split(eoln);var lineNumber=0;for(var li=0;li<lines.length;++li){var line=lines[li];lineNumber++;// skip empty lines\nif(empty.test(line)){continue;}// parse quad\nvar match=line.match(quad);if(match===null){throw new JsonLdError('Error while parsing N-Quads; invalid quad.','jsonld.ParseError',{line:lineNumber});}// create RDF triple\nvar triple={};// get subject\nif(!_isUndefined(match[1])){triple.subject={type:'IRI',value:match[1]};}else{triple.subject={type:'blank node',value:match[2]};}// get predicate\ntriple.predicate={type:'IRI',value:match[3]};// get object\nif(!_isUndefined(match[4])){triple.object={type:'IRI',value:match[4]};}else if(!_isUndefined(match[5])){triple.object={type:'blank node',value:match[5]};}else{triple.object={type:'literal'};if(!_isUndefined(match[7])){triple.object.datatype=match[7];}else if(!_isUndefined(match[8])){triple.object.datatype=RDF_LANGSTRING;triple.object.language=match[8];}else{triple.object.datatype=XSD_STRING;}var unescaped=match[6].replace(/\\\\\"/g,'\"').replace(/\\\\t/g,'\\t').replace(/\\\\n/g,'\\n').replace(/\\\\r/g,'\\r').replace(/\\\\\\\\/g,'\\\\');triple.object.value=unescaped;}// get graph name ('@default' is used for the default graph)\nvar name='@default';if(!_isUndefined(match[9])){name=match[9];}else if(!_isUndefined(match[10])){name=match[10];}// initialize graph in dataset\nif(!(name in dataset)){dataset[name]=[triple];}else{// add triple if unique to its graph\nvar unique=true;var triples=dataset[name];for(var ti=0;unique&&ti<triples.length;++ti){if(_compareRDFTriples(triples[ti],triple)){unique=false;}}if(unique){triples.push(triple);}}}return dataset;}// register the N-Quads RDF parser", "title": "" }, { "docid": "8d9fdbcf293f37dcfaffc0f98be0f0f4", "score": "0.44405678", "text": "function ontologyAsRootNode(ontology) {\n return {\n \"id\": ontology.ontologyDbId,\n \"parent\": \"#\",\n \"text\": ontology.ontologyName,\n \"data\": ontology,\n \"type\": \"ontology\"\n };\n}", "title": "" }, { "docid": "d603199993ceb9d4506cbb0120e04a6a", "score": "0.44358346", "text": "function _graphToRDF(graph, issuer, options) {\n\t var rval = [];\n\t\n\t var ids = Object.keys(graph).sort();\n\t for(var i = 0; i < ids.length; ++i) {\n\t var id = ids[i];\n\t var node = graph[id];\n\t var properties = Object.keys(node).sort();\n\t for(var pi = 0; pi < properties.length; ++pi) {\n\t var property = properties[pi];\n\t var items = node[property];\n\t if(property === '@type') {\n\t property = RDF_TYPE;\n\t } else if(_isKeyword(property)) {\n\t continue;\n\t }\n\t\n\t for(var ii = 0; ii < items.length; ++ii) {\n\t var item = items[ii];\n\t\n\t // RDF subject\n\t var subject = {};\n\t subject.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n\t subject.value = id;\n\t\n\t // skip relative IRI subjects\n\t if(!_isAbsoluteIri(id)) {\n\t continue;\n\t }\n\t\n\t // RDF predicate\n\t var predicate = {};\n\t predicate.type = (property.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n\t predicate.value = property;\n\t\n\t // skip relative IRI predicates\n\t if(!_isAbsoluteIri(property)) {\n\t continue;\n\t }\n\t\n\t // skip blank node predicates unless producing generalized RDF\n\t if(predicate.type === 'blank node' && !options.produceGeneralizedRdf) {\n\t continue;\n\t }\n\t\n\t // convert @list to triples\n\t if(_isList(item)) {\n\t _listToRDF(item['@list'], issuer, subject, predicate, rval);\n\t } else {\n\t // convert value or node object to triple\n\t var object = _objectToRDF(item);\n\t // skip null objects (they are relative IRIs)\n\t if(object) {\n\t rval.push({subject: subject, predicate: predicate, object: object});\n\t }\n\t }\n\t }\n\t }\n\t }\n\t\n\t return rval;\n\t}", "title": "" }, { "docid": "833a1a930b216a7475c6a14def9825fd", "score": "0.44182566", "text": "function _graphToRDF(graph, issuer, options) {\n var rval = [];\n\n var ids = Object.keys(graph).sort();\n for(var i = 0; i < ids.length; ++i) {\n var id = ids[i];\n var node = graph[id];\n var properties = Object.keys(node).sort();\n for(var pi = 0; pi < properties.length; ++pi) {\n var property = properties[pi];\n var items = node[property];\n if(property === '@type') {\n property = RDF_TYPE;\n } else if(_isKeyword(property)) {\n continue;\n }\n\n for(var ii = 0; ii < items.length; ++ii) {\n var item = items[ii];\n\n // RDF subject\n var subject = {};\n subject.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n subject.value = id;\n\n // skip relative IRI subjects\n if(!_isAbsoluteIri(id)) {\n continue;\n }\n\n // RDF predicate\n var predicate = {};\n predicate.type = (property.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n predicate.value = property;\n\n // skip relative IRI predicates\n if(!_isAbsoluteIri(property)) {\n continue;\n }\n\n // skip blank node predicates unless producing generalized RDF\n if(predicate.type === 'blank node' && !options.produceGeneralizedRdf) {\n continue;\n }\n\n // convert @list to triples\n if(_isList(item)) {\n _listToRDF(item['@list'], issuer, subject, predicate, rval);\n } else {\n // convert value or node object to triple\n var object = _objectToRDF(item);\n // skip null objects (they are relative IRIs)\n if(object) {\n rval.push({subject: subject, predicate: predicate, object: object});\n }\n }\n }\n }\n }\n\n return rval;\n}", "title": "" }, { "docid": "833a1a930b216a7475c6a14def9825fd", "score": "0.44182566", "text": "function _graphToRDF(graph, issuer, options) {\n var rval = [];\n\n var ids = Object.keys(graph).sort();\n for(var i = 0; i < ids.length; ++i) {\n var id = ids[i];\n var node = graph[id];\n var properties = Object.keys(node).sort();\n for(var pi = 0; pi < properties.length; ++pi) {\n var property = properties[pi];\n var items = node[property];\n if(property === '@type') {\n property = RDF_TYPE;\n } else if(_isKeyword(property)) {\n continue;\n }\n\n for(var ii = 0; ii < items.length; ++ii) {\n var item = items[ii];\n\n // RDF subject\n var subject = {};\n subject.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n subject.value = id;\n\n // skip relative IRI subjects\n if(!_isAbsoluteIri(id)) {\n continue;\n }\n\n // RDF predicate\n var predicate = {};\n predicate.type = (property.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n predicate.value = property;\n\n // skip relative IRI predicates\n if(!_isAbsoluteIri(property)) {\n continue;\n }\n\n // skip blank node predicates unless producing generalized RDF\n if(predicate.type === 'blank node' && !options.produceGeneralizedRdf) {\n continue;\n }\n\n // convert @list to triples\n if(_isList(item)) {\n _listToRDF(item['@list'], issuer, subject, predicate, rval);\n } else {\n // convert value or node object to triple\n var object = _objectToRDF(item);\n // skip null objects (they are relative IRIs)\n if(object) {\n rval.push({subject: subject, predicate: predicate, object: object});\n }\n }\n }\n }\n }\n\n return rval;\n}", "title": "" }, { "docid": "833a1a930b216a7475c6a14def9825fd", "score": "0.44182566", "text": "function _graphToRDF(graph, issuer, options) {\n var rval = [];\n\n var ids = Object.keys(graph).sort();\n for(var i = 0; i < ids.length; ++i) {\n var id = ids[i];\n var node = graph[id];\n var properties = Object.keys(node).sort();\n for(var pi = 0; pi < properties.length; ++pi) {\n var property = properties[pi];\n var items = node[property];\n if(property === '@type') {\n property = RDF_TYPE;\n } else if(_isKeyword(property)) {\n continue;\n }\n\n for(var ii = 0; ii < items.length; ++ii) {\n var item = items[ii];\n\n // RDF subject\n var subject = {};\n subject.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n subject.value = id;\n\n // skip relative IRI subjects\n if(!_isAbsoluteIri(id)) {\n continue;\n }\n\n // RDF predicate\n var predicate = {};\n predicate.type = (property.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n predicate.value = property;\n\n // skip relative IRI predicates\n if(!_isAbsoluteIri(property)) {\n continue;\n }\n\n // skip blank node predicates unless producing generalized RDF\n if(predicate.type === 'blank node' && !options.produceGeneralizedRdf) {\n continue;\n }\n\n // convert @list to triples\n if(_isList(item)) {\n _listToRDF(item['@list'], issuer, subject, predicate, rval);\n } else {\n // convert value or node object to triple\n var object = _objectToRDF(item);\n // skip null objects (they are relative IRIs)\n if(object) {\n rval.push({subject: subject, predicate: predicate, object: object});\n }\n }\n }\n }\n }\n\n return rval;\n}", "title": "" }, { "docid": "0b58a612ece0b3e6f0cbf7836f0dd0f3", "score": "0.43834323", "text": "function objectTree(obj) {\n var res;\n switch(obj.termType) {\n case 'NamedNode':\n var anchor = myDocument.createElement('a')\n anchor.setAttribute('href', obj.uri)\n anchor.addEventListener('click', UI.widgets.openHrefInOutlineMode, true);\n anchor.appendChild(myDocument.createTextNode(UI.utils.label(obj)));\n return anchor;\n\n case 'Literal':\n\n if (!obj.datatype || !obj.datatype.uri) {\n res = myDocument.createElement('div');\n res.setAttribute('style', 'white-space: pre-wrap;');\n res.textContent = obj.value;\n return res\n } else if (obj.datatype.uri == 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral') {\n res = myDocument.createElement('div');\n res.setAttribute('class', 'embeddedXHTML');\n res.innerHTML = obj.value; // Try that @@@ beware embedded dangerous code\n return res;\n };\n return myDocument.createTextNode(obj.value); // placeholder - could be smarter,\n\n case 'BlankNode':\n if (obj.toNT() in doneBnodes) { // Break infinite recursion\n referencedBnodes[(obj.toNT())] = true;\n var anchor = myDocument.createElement('a')\n anchor.setAttribute('href', '#'+obj.toNT().slice(2))\n anchor.setAttribute('class','bnodeRef')\n anchor.textContent = '*'+obj.toNT().slice(3);\n return anchor;\n }\n doneBnodes[obj.toNT()] = true; // Flag to prevent infinite recusruion in propertyTree\n var newTable = propertyTree(obj);\n doneBnodes[obj.toNT()] = newTable; // Track where we mentioned it first\n if (UI.utils.ancestor(newTable, 'TABLE') && UI.utils.ancestor(newTable, 'TABLE').style.backgroundColor=='white') {\n newTable.style.backgroundColor='#eee'\n } else {\n newTable.style.backgroundColor='white'\n }\n return newTable;\n\n case 'collection':\n var res = myDocument.createElement('table')\n res.setAttribute('class', 'collectionAsTables')\n for (var i=0; i<obj.elements.length; i++) {\n var tr = myDocument.createElement('tr');\n res.appendChild(tr);\n tr.appendChild(objectTree(obj.elements[i]));\n }\n return res;\n case 'formula':\n var res = UI.panes.dataContents.statementsAsTables(obj.statements, myDocument);\n res.setAttribute('class', 'nestedFormula')\n return res;\n case 'Variable':\n var res = myDocument.createTextNode('?' + obj.uri);\n return res;\n\n }\n throw \"Unhandled node type: \"+obj.termType\n }", "title": "" }, { "docid": "980a70736ec30c86a9386c256288bf06", "score": "0.43799698", "text": "function _graphToRDF(graph, namer, options) {\n var rval = [];\n\n var ids = Object.keys(graph).sort();\n for(var i = 0; i < ids.length; ++i) {\n var id = ids[i];\n var node = graph[id];\n var properties = Object.keys(node).sort();\n for(var pi = 0; pi < properties.length; ++pi) {\n var property = properties[pi];\n var items = node[property];\n if(property === '@type') {\n property = RDF_TYPE;\n } else if(_isKeyword(property)) {\n continue;\n }\n\n for(var ii = 0; ii < items.length; ++ii) {\n var item = items[ii];\n\n // RDF subject\n var subject = {};\n subject.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n subject.value = id;\n\n // skip relative IRI subjects\n if(!_isAbsoluteIri(id)) {\n continue;\n }\n\n // RDF predicate\n var predicate = {};\n predicate.type = (property.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n predicate.value = property;\n\n // skip relative IRI predicates\n if(!_isAbsoluteIri(property)) {\n continue;\n }\n\n // skip blank node predicates unless producing generalized RDF\n if(predicate.type === 'blank node' && !options.produceGeneralizedRdf) {\n continue;\n }\n\n // convert @list to triples\n if(_isList(item)) {\n _listToRDF(item['@list'], namer, subject, predicate, rval);\n } else {\n // convert value or node object to triple\n var object = _objectToRDF(item);\n // skip null objects (they are relative IRIs)\n if(object) {\n rval.push({subject: subject, predicate: predicate, object: object});\n }\n }\n }\n }\n }\n\n return rval;\n}", "title": "" }, { "docid": "980a70736ec30c86a9386c256288bf06", "score": "0.43799698", "text": "function _graphToRDF(graph, namer, options) {\n var rval = [];\n\n var ids = Object.keys(graph).sort();\n for(var i = 0; i < ids.length; ++i) {\n var id = ids[i];\n var node = graph[id];\n var properties = Object.keys(node).sort();\n for(var pi = 0; pi < properties.length; ++pi) {\n var property = properties[pi];\n var items = node[property];\n if(property === '@type') {\n property = RDF_TYPE;\n } else if(_isKeyword(property)) {\n continue;\n }\n\n for(var ii = 0; ii < items.length; ++ii) {\n var item = items[ii];\n\n // RDF subject\n var subject = {};\n subject.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n subject.value = id;\n\n // skip relative IRI subjects\n if(!_isAbsoluteIri(id)) {\n continue;\n }\n\n // RDF predicate\n var predicate = {};\n predicate.type = (property.indexOf('_:') === 0) ? 'blank node' : 'IRI';\n predicate.value = property;\n\n // skip relative IRI predicates\n if(!_isAbsoluteIri(property)) {\n continue;\n }\n\n // skip blank node predicates unless producing generalized RDF\n if(predicate.type === 'blank node' && !options.produceGeneralizedRdf) {\n continue;\n }\n\n // convert @list to triples\n if(_isList(item)) {\n _listToRDF(item['@list'], namer, subject, predicate, rval);\n } else {\n // convert value or node object to triple\n var object = _objectToRDF(item);\n // skip null objects (they are relative IRIs)\n if(object) {\n rval.push({subject: subject, predicate: predicate, object: object});\n }\n }\n }\n }\n }\n\n return rval;\n}", "title": "" }, { "docid": "719e8e0803fde709174630a6627958d1", "score": "0.4378685", "text": "function convertJSON(stuff) {\r\n\tlet res = ''\r\n\r\n\tfor(let link of stuff) {\r\n\t\tres += link.title.replace(/\\n/g, ' ') + '\\n'\r\n\t\t\t+ link.url.replace(/\\n/g, ' ') + '\\n'\r\n\t\t\t+ link.desc.replace(/\\n/g, ' ') + '\\n'\r\n\t}\r\n\r\n\treturn res.slice(0, -1)\r\n}", "title": "" }, { "docid": "3764ef1ff8b5471a1368827629028016", "score": "0.43683124", "text": "function createGraph(json) {\n if (graphRender) {\n var tripleCt = 0;\n Object.keys(json).forEach(function(key) {\n var triples = json[key];\n triples.forEach(function(key) {\n if (tripleCt >= 100) {\n return;\n }\n tripleCt++;\n var triple = {};\n key.subject.value = key.subject.value.replace('>', '').replace('<', '');\n key.object.value = key.object.value.replace('>', '').replace('<', '');\n\n /* call to parse and extract predicate value */\n triple[\"predicate\"] = parsePredicateValue(key.predicate.value);\n triple[\"value\"] = 1;\n if (!(triple[\"predicate\"] === \"sameAs\")) {\n var node = {};\n node[\"id\"] = idShortener(key.subject.value);\n node[\"uri\"] = key.subject.value;\n node[\"group\"] = endptColor;\n if (key.subject.value.includes(\"wikidata\") || key.object.value.includes(\"wikidata\"))\n console.log(\"wiki\", key.object.value, key.subject.value);\n if (addNode(node)) {\n if ((key.subject.type === \"uri\" || key.subject.value.includes(\"http:/\")) && (URIs.indexOf(key.subject.value) === -1) && URI_filter(key.subject.value)) {\n if (key.subject.value.includes(\"wikidata\") || key.object.value.includes(\"wikidata\"))\n console.log(\"wikiPUsh\");\n URIs.push(key.subject.value);\n }\n UniversalN.push(node);\n }\n if (key.subject.value.includes(\"wikidata\") || key.object.value.includes(\"wikidata\"))\n console.log(\"wikiFins\");\n node = {};\n node[\"id\"] = idShortener(key.object.value);\n node[\"uri\"] = key.object.value;\n node[\"group\"] = endptColor;\n if (addNode(node)) {\n if ((key.object.type === \"uri\" || key.object.value.includes(\"http:/\")) && (URIs.indexOf(key.object.value) === -1) && URI_filter(key.object.value)) {\n if (key.subject.value.includes(\"wikidata\") || key.object.value.includes(\"wikidata\"))\n console.log(\"wikiPUsh\");\n URIs.push(key.object.value);\n }\n UniversalN.push(node);\n }\n\n let sourceIndex = UniversalN.findIndex(function(x) { return x.uri === key.subject.value });\n\n if (triple[\"predicate\"] === \"title\" || triple[\"predicate\"] === \"label\") {\n UniversalN[sourceIndex].id = key.object.value;\n }\n triple[\"source\"] = sourceIndex;\n\n triple[\"target\"] = UniversalN.findIndex(function(x) { return x.uri === key.object.value });\n var exists = UniversalL.filter( link => (link.source == triple[\"source\"] && link.target == triple[\"target\"]));\n if(exists.length > 0)\n console.log(\"exists\", exists);\n if(exists.length > 0){\n if(!(exists[0][\"predicate\"].includes(triple[\"predicate\"]))){\n exists[0][\"predicate\"] = exists[0][\"predicate\"] + \"/\" + triple[\"predicate\"]; \n }\n } else {\n UniversalL.push(triple);\n }\n \n }\n });\n });\n }\n}", "title": "" }, { "docid": "c87325d3f2cf2f15ba3c9730331db59f", "score": "0.43680954", "text": "_encodeObject(object) {\n return object.termType === 'Literal' ? this._encodeLiteral(object) : this._encodeIriOrBlank(object);\n }", "title": "" }, { "docid": "a1a6a93a8bfc356397def16877943db4", "score": "0.4352604", "text": "toJSON() {\n return {\n subject: this.subject.toJSON(),\n predicate: this.predicate.toJSON(),\n object: this.object.toJSON(),\n graph: this.graph.toJSON(),\n };\n }", "title": "" }, { "docid": "013fe7691d392cf6e296585f0826ae5a", "score": "0.4320566", "text": "function make_str_rdf_literal(in_str)\n{\n // return as float or integer\n var in_str_as_number = Number(in_str);\n if(String(in_str_as_number) != 'NaN')\n {\n if(in_str_as_number % 1 == 0)\n {\n return '\"' + in_str_as_number + '\"^^xsd:integer'\n }\n return '\"' + in_str_as_number + '\"^^xsd:float'\n }\n\n // return as boolean\n if(in_str.toLowerCase() == 'true' || in_str.toLowerCase() == 'false')\n {\n return '\"' + in_str.toLowerCase() + '\"^^xsd:boolean';\n }\n\n // return as default literal\n out_str = '\"' + in_str.replace(/^\\s*/g, '') + '\"';\n return out_str;\n}", "title": "" }, { "docid": "dc8aa684c516c1ee503e9d73d7954b80", "score": "0.43200064", "text": "function normalize(json) {\n if (json.rss || json['rdf:RDF']) {\n return json.rss || json['rdf:RDF'];\n }\n return json;\n}", "title": "" }, { "docid": "cb6b2c77ecc9c064497974f7eaad5ce7", "score": "0.43078157", "text": "converttoLDAP(dn, user, id) {\n log.debug('entry');\n log.trace(JSON.stringify(user));\n \n var obj = {\n dn: config.ldap.type+dn+\",\"+config.ldap.root,\n attributes: {\n objectclass: ['top','person','organizationalPerson','inetOrgPerson','ePerson'],\n cn: dn,\n uid: dn,\n sn: dn,\n description: '',\n sn: user.name.familyName,\n givenName: user.name.givenName,\n active: user.active,\n id: user.id,\n userName: user.name.userName,\n email: this.buildEMails(id.emails),\n phone: this.buildEMails(id.phoneNumbers),\n memberof: this.buildGroups(id.groups),\n created: id.meta.created,\n lastModified: id.meta.lastModified,\n pwdChangedTime: id['urn:ietf:params:scim:schemas:extension:ibm:2.0:User'].pwdChangedTime,\n userCategory: id['urn:ietf:params:scim:schemas:extension:ibm:2.0:User'].userCategory,\n twoFactorauth: id['urn:ietf:params:scim:schemas:extension:ibm:2.0:User'].twoFactorAuthentication,\n realm: id['urn:ietf:params:scim:schemas:extension:ibm:2.0:User'].realm\n }\n }\n return(obj);\n }", "title": "" }, { "docid": "810a22d20b8d7c69768ceb1b256a35bd", "score": "0.43004873", "text": "function encodeSketchJSON(sketchObj): Object {\n const encoded = toSJSON(sketchObj);\n return encoded ? JSON.parse(encoded) : {};\n}", "title": "" }, { "docid": "c268aa08498921f453ebec8b826d381b", "score": "0.4284679", "text": "function RDFStatement_toNT() {\n return (this.subject.toNT() + \" \"\n\t + this.predicate.toNT() + \" \"\n\t + this.object.toNT() +\" .\")\n}", "title": "" }, { "docid": "d2b3bc9639825faea05153052526e1f7", "score": "0.42773497", "text": "function objectify() {\r\n return through2.obj((str, enc, callback) => callback(null, JSON.parse(str)));\r\n}", "title": "" }, { "docid": "c883d8dfbdac5c94baaba4b86778003f", "score": "0.42763254", "text": "function convertCSLJSON(source) {\n let bibType = source.type;\n let result;\n\n // CSL types: http://docs.citationstyles.org/en/stable/specification.html#appendix-iii-types\n let typeMapping = {\n \"article\": \"journal-article\",\n \"article-magazine\": \"magazine-article\",\n \"article-newspaper\": \"newspaper-article\",\n \"article-journal\": \"journal-article\",\n //\"bill\"\n \"book\": \"book\",\n //\"broadcast\"\n \"chapter\": \"book\",\n \"dataset\": \"data-publication\",\n //\"entry\"\n \"entry-dictionary\": \"book\",\n \"entry-encyclopedia\": \"book\",\n //\"figure\"\n //\"graphic\"\n //\"interview\"\n //\"legislation\"\n //\"legal_case\"\n //\"manuscript\"\n //\"map\"\n //\"motion_picture\"\n //\"musical_score\"\n //\"pamphlet\"\n \"paper-conference\": \"conference-paper\",\n \"patent\": \"patent\",\n //\"post\"\n //\"post-weblog\"\n //\"personal_communication\"\n \"report\": \"report\",\n //\"review\"\n //\"review-book\"\n //\"song\"\n //\"speech\"\n \"thesis\": \"thesis\",\n //\"treaty\"\n \"webpage\": \"webpage\"\n //NA : \"software\"\n };\n\n if (typeMapping[bibType]) {\n result = _convertFromCSLJSON(source, typeMapping[bibType]);\n } else {\n throw new Error(`Bib type ${bibType} not yet supported`)\n }\n return result\n }", "title": "" }, { "docid": "fdb679b9ac3351272a4512864eaeecb9", "score": "0.42728683", "text": "function serialize(target, kb, base, contentType, callback, options) {\n base = base || target.uri;\n options = options || {};\n contentType = contentType || 'text/turtle'; // text/n3 if complex?\n var documentString = null;\n try {\n var sz = Serializer(kb);\n if (options.flags) sz.setFlags(options.flags);\n var newSts = kb.statementsMatching(undefined, undefined, undefined, target);\n var n3String;\n sz.suggestNamespaces(kb.namespaces);\n sz.setBase(base);\n switch (contentType) {\n case 'application/rdf+xml':\n documentString = sz.statementsToXML(newSts);\n return executeCallback(null, documentString);\n case 'text/n3':\n case 'application/n3':\n // Legacy\n documentString = sz.statementsToN3(newSts);\n return executeCallback(null, documentString);\n case 'text/turtle':\n case 'application/x-turtle':\n // Legacy\n sz.setFlags('si'); // Suppress = for sameAs and => for implies\n documentString = sz.statementsToN3(newSts);\n return executeCallback(null, documentString);\n case 'application/n-triples':\n sz.setFlags('deinprstux'); // Suppress nice parts of N3 to make ntriples\n documentString = sz.statementsToNTriples(newSts);\n return executeCallback(null, documentString);\n case 'application/ld+json':\n sz.setFlags('deinprstux'); // Use adapters to connect to incmpatible parser\n n3String = sz.statementsToNTriples(newSts);\n // n3String = sz.statementsToN3(newSts)\n convert.convertToJson(n3String, callback);\n break;\n case 'application/n-quads':\n case 'application/nquads':\n // @@@ just outpout the quads? Does not work for collections\n sz.setFlags('deinprstux q'); // Suppress nice parts of N3 to make ntriples\n documentString = sz.statementsToNTriples(newSts); // q in flag means actually quads\n return executeCallback(null, documentString);\n // n3String = sz.statementsToN3(newSts)\n // documentString = convert.convertToNQuads(n3String, callback)\n break;\n default:\n throw new Error('Serialize: Content-type ' + contentType + ' not supported for data write.');\n }\n } catch (err) {\n if (callback) {\n return callback(err);\n }\n throw err; // Don't hide problems from caller in sync mode\n }\n\n function executeCallback(err, result) {\n if (callback) {\n callback(err, result);\n return;\n } else {\n return result;\n }\n }\n}", "title": "" }, { "docid": "4ddaa9cd1f67e8b3ebc5034932a5d3bc", "score": "0.42712015", "text": "function dereferenceJSON(source) {\n\treturn JSON.parse(JSON.stringify(source));\n}", "title": "" }, { "docid": "3c8b7d0b59a20cde3c65ba1c7ff63c82", "score": "0.42678422", "text": "function _createTermDefinition(activeCtx,localCtx,term,defined){if(term in defined){// term already defined\nif(defined[term]){return;}// cycle detected\nthrow new JsonLdError('Cyclical context definition detected.','jsonld.CyclicalContext',{code:'cyclic IRI mapping',context:localCtx,term:term});}// now defining term\ndefined[term]=false;if(_isKeyword(term)){throw new JsonLdError('Invalid JSON-LD syntax; keywords cannot be overridden.','jsonld.SyntaxError',{code:'keyword redefinition',context:localCtx,term:term});}if(term===''){throw new JsonLdError('Invalid JSON-LD syntax; a term cannot be an empty string.','jsonld.SyntaxError',{code:'invalid term definition',context:localCtx});}// remove old mapping\nif(activeCtx.mappings[term]){delete activeCtx.mappings[term];}// get context term value\nvar value=localCtx[term];// clear context entry\nif(value===null||_isObject(value)&&value['@id']===null){activeCtx.mappings[term]=null;defined[term]=true;return;}// convert short-hand value to object w/@id\nif(_isString(value)){value={'@id':value};}if(!_isObject(value)){throw new JsonLdError('Invalid JSON-LD syntax; @context property values must be '+'strings or objects.','jsonld.SyntaxError',{code:'invalid term definition',context:localCtx});}// create new mapping\nvar mapping=activeCtx.mappings[term]={};mapping.reverse=false;if('@reverse'in value){if('@id'in value){throw new JsonLdError('Invalid JSON-LD syntax; a @reverse term definition must not '+'contain @id.','jsonld.SyntaxError',{code:'invalid reverse property',context:localCtx});}var reverse=value['@reverse'];if(!_isString(reverse)){throw new JsonLdError('Invalid JSON-LD syntax; a @context @reverse value must be a string.','jsonld.SyntaxError',{code:'invalid IRI mapping',context:localCtx});}// expand and add @id mapping\nvar id=_expandIri(activeCtx,reverse,{vocab:true,base:false},localCtx,defined);if(!_isAbsoluteIri(id)){throw new JsonLdError('Invalid JSON-LD syntax; a @context @reverse value must be an '+'absolute IRI or a blank node identifier.','jsonld.SyntaxError',{code:'invalid IRI mapping',context:localCtx});}mapping['@id']=id;mapping.reverse=true;}else if('@id'in value){var id=value['@id'];if(!_isString(id)){throw new JsonLdError('Invalid JSON-LD syntax; a @context @id value must be an array '+'of strings or a string.','jsonld.SyntaxError',{code:'invalid IRI mapping',context:localCtx});}if(id!==term){// expand and add @id mapping\nid=_expandIri(activeCtx,id,{vocab:true,base:false},localCtx,defined);if(!_isAbsoluteIri(id)&&!_isKeyword(id)){throw new JsonLdError('Invalid JSON-LD syntax; a @context @id value must be an '+'absolute IRI, a blank node identifier, or a keyword.','jsonld.SyntaxError',{code:'invalid IRI mapping',context:localCtx});}mapping['@id']=id;}}// always compute whether term has a colon as an optimization for\n// _compactIri\nvar colon=term.indexOf(':');mapping._termHasColon=colon!==-1;if(!('@id'in mapping)){// see if the term has a prefix\nif(mapping._termHasColon){var prefix=term.substr(0,colon);if(prefix in localCtx){// define parent prefix\n_createTermDefinition(activeCtx,localCtx,prefix,defined);}if(activeCtx.mappings[prefix]){// set @id based on prefix parent\nvar suffix=term.substr(colon+1);mapping['@id']=activeCtx.mappings[prefix]['@id']+suffix;}else{// term is an absolute IRI\nmapping['@id']=term;}}else{// non-IRIs *must* define @ids if @vocab is not available\nif(!('@vocab'in activeCtx)){throw new JsonLdError('Invalid JSON-LD syntax; @context terms must define an @id.','jsonld.SyntaxError',{code:'invalid IRI mapping',context:localCtx,term:term});}// prepend vocab to term\nmapping['@id']=activeCtx['@vocab']+term;}}// IRI mapping now defined\ndefined[term]=true;if('@type'in value){var type=value['@type'];if(!_isString(type)){throw new JsonLdError('Invalid JSON-LD syntax; an @context @type values must be a string.','jsonld.SyntaxError',{code:'invalid type mapping',context:localCtx});}if(type!=='@id'&&type!=='@vocab'){// expand @type to full IRI\ntype=_expandIri(activeCtx,type,{vocab:true,base:false},localCtx,defined);if(!_isAbsoluteIri(type)){throw new JsonLdError('Invalid JSON-LD syntax; an @context @type value must be an '+'absolute IRI.','jsonld.SyntaxError',{code:'invalid type mapping',context:localCtx});}if(type.indexOf('_:')===0){throw new JsonLdError('Invalid JSON-LD syntax; an @context @type values must be an IRI, '+'not a blank node identifier.','jsonld.SyntaxError',{code:'invalid type mapping',context:localCtx});}}// add @type to mapping\nmapping['@type']=type;}if('@container'in value){var container=value['@container'];if(container!=='@list'&&container!=='@set'&&container!=='@index'&&container!=='@language'){throw new JsonLdError('Invalid JSON-LD syntax; @context @container value must be '+'one of the following: @list, @set, @index, or @language.','jsonld.SyntaxError',{code:'invalid container mapping',context:localCtx});}if(mapping.reverse&&container!=='@index'&&container!=='@set'&&container!==null){throw new JsonLdError('Invalid JSON-LD syntax; @context @container value for a @reverse '+'type definition must be @index or @set.','jsonld.SyntaxError',{code:'invalid reverse property',context:localCtx});}// add @container to mapping\nmapping['@container']=container;}if('@language'in value&&!('@type'in value)){var language=value['@language'];if(language!==null&&!_isString(language)){throw new JsonLdError('Invalid JSON-LD syntax; @context @language value must be '+'a string or null.','jsonld.SyntaxError',{code:'invalid language mapping',context:localCtx});}// add @language to mapping\nif(language!==null){language=language.toLowerCase();}mapping['@language']=language;}// disallow aliasing @context and @preserve\nvar id=mapping['@id'];if(id==='@context'||id==='@preserve'){throw new JsonLdError('Invalid JSON-LD syntax; @context and @preserve cannot be aliased.','jsonld.SyntaxError',{code:'invalid keyword alias',context:localCtx});}}", "title": "" }, { "docid": "42cb828959b2d532ebbbf690e79ff66a", "score": "0.42677808", "text": "function convertEntity(entity) {\n // Return IRIs and blank nodes as-is\n if (entity.type !== 'literal')\n return entity.value;\n else {\n // Add a language tag to the literal if present\n if ('language' in entity)\n return '\"' + entity.value + '\"@' + entity.language;\n // Add a datatype to the literal if present\n if (entity.datatype !== 'http://www.w3.org/2001/XMLSchema#string')\n return '\"' + entity.value + '\"^^' + entity.datatype;\n // Otherwise, return the regular literal\n return '\"' + entity.value + '\"';\n }\n}", "title": "" }, { "docid": "cfae13c8912e65b4b775ebfb17a00860", "score": "0.42451832", "text": "function flatten(obj) {\n this.name = obj.name;\n this.gpa = obj.gpa;\n this.major = obj.major;\n this.loc = obj.loc;\n this.gen = obj.gen;\n this.age = obj.age;\n}", "title": "" }, { "docid": "354b3c550dbdf3e01c221dc9de6a4384", "score": "0.4236639", "text": "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "title": "" }, { "docid": "354b3c550dbdf3e01c221dc9de6a4384", "score": "0.4236639", "text": "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "title": "" }, { "docid": "354b3c550dbdf3e01c221dc9de6a4384", "score": "0.4236639", "text": "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "title": "" }, { "docid": "354b3c550dbdf3e01c221dc9de6a4384", "score": "0.4236639", "text": "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "title": "" }, { "docid": "354b3c550dbdf3e01c221dc9de6a4384", "score": "0.4236639", "text": "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "title": "" }, { "docid": "354b3c550dbdf3e01c221dc9de6a4384", "score": "0.4236639", "text": "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "title": "" }, { "docid": "354b3c550dbdf3e01c221dc9de6a4384", "score": "0.4236639", "text": "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "title": "" }, { "docid": "354b3c550dbdf3e01c221dc9de6a4384", "score": "0.4236639", "text": "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "title": "" }, { "docid": "7103d30fd8c3d944ee861f99362565f5", "score": "0.42336342", "text": "function sparqlConstructQuery(query, endpoint, svg, table) {\n // Construct the request and initialise the response string.\n var parameters = \"query=\" + encodeURI(query);\n var request = new XMLHttpRequest();\n var response = \"\";\n var quads = [];\n\n // Set up a POST request with JSON-LD response.\n request.open('POST', endpoint, true);\n request.onreadystatechange = function() {\n // Get response and build visualisation (graph).\n if (this.readyState == 4) {\n if (this.status == 200) {\n try {\n response = JSON.parse(this.responseText);\n displayGraphJson(response, endpoint, svg, table);\n } catch (err) {\n displayConstructError(table);\n }\n } else {\n alert(\"Error in response: \" + request.status + \" \" +\n request.responseText);\n }\n }\n };\n request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n request.setRequestHeader(\"Accept\", \"application/ld+json\");\n request.send(parameters);\n}", "title": "" }, { "docid": "73d7de738b2e3458cae725ddcd71718c", "score": "0.42283183", "text": "function toJSON(obj, cls) {\n var result = new _qrt.JSONObject();\n if (_qrt.equals((obj), (null))) {\n (result).setNull();\n return result;\n }\n if (_qrt.equals((cls), (null))) {\n cls = reflect.Class.get(_qrt._getClass(obj));\n }\n var idx = 0;\n if (_qrt.equals(((cls).name), (\"quark.String\"))) {\n (result).setString(obj);\n return result;\n }\n if (((((_qrt.equals(((cls).name), (\"quark.byte\"))) || (_qrt.equals(((cls).name), (\"quark.short\")))) || (_qrt.equals(((cls).name), (\"quark.int\")))) || (_qrt.equals(((cls).name), (\"quark.long\")))) || (_qrt.equals(((cls).name), (\"quark.float\")))) {\n (result).setNumber(obj);\n return result;\n }\n if (_qrt.equals(((cls).name), (\"quark.List\"))) {\n (result).setList();\n var list = obj;\n while ((idx) < ((list).length)) {\n (result).setListItem(idx, toJSON((list)[idx], null));\n idx = (idx) + (1);\n }\n return result;\n }\n if (_qrt.equals(((cls).name), (\"quark.Map\"))) {\n (result).setObject();\n var map = obj;\n return result;\n }\n (result).setObjectItem((\"$class\"), ((new _qrt.JSONObject()).setString((cls).id)));\n var fields = (cls).getFields();\n while ((idx) < ((fields).length)) {\n var fieldName = ((fields)[idx]).name;\n if (!(((fieldName).indexOf(\"_\")===0))) {\n (result).setObjectItem((fieldName), (toJSON((obj)._getField(fieldName), ((fields)[idx]).getType())));\n }\n idx = (idx) + (1);\n }\n return result;\n}", "title": "" }, { "docid": "690958a20df2e129eb25609eb7110002", "score": "0.4205841", "text": "static serializeQuad(quad) {\n const s = quad.subject;\n const p = quad.predicate;\n const o = quad.object;\n const g = quad.graph;\n\n let nquad = '';\n\n // subject and predicate can only be NamedNode or BlankNode\n [s, p].forEach(term => {\n if(term.termType === 'NamedNode') {\n nquad += '<' + term.value + '>';\n } else {\n nquad += term.value;\n }\n nquad += ' ';\n });\n\n // object is NamedNode, BlankNode, or Literal\n if(o.termType === 'NamedNode') {\n nquad += '<' + o.value + '>';\n } else if(o.termType === 'BlankNode') {\n nquad += o.value;\n } else {\n nquad += '\"' + _escape(o.value) + '\"';\n if(o.datatype.value === RDF_LANGSTRING) {\n if(o.language) {\n nquad += '@' + o.language;\n }\n } else if(o.datatype.value !== XSD_STRING) {\n nquad += '^^<' + o.datatype.value + '>';\n }\n }\n\n // graph can only be NamedNode or BlankNode (or DefaultGraph, but that\n // does not add to `nquad`)\n if(g.termType === 'NamedNode') {\n nquad += ' <' + g.value + '>';\n } else if(g.termType === 'BlankNode') {\n nquad += ' ' + g.value;\n }\n\n nquad += ' .\\n';\n return nquad;\n }", "title": "" }, { "docid": "0d4bb200e2dc8e870594fb4f5419d9d4", "score": "0.42019027", "text": "function add (s, p, o) {\n target.addQuad(RdfTerm.externalTriple({\n subject: s,\n predicate: p,\n object: n3ify(o)\n }, N3.DataFactory));\n return s;\n }", "title": "" }, { "docid": "cf3a560c96f5edd617fb43d2b4c881e8", "score": "0.42004022", "text": "function fromDatastore (obj) {\n obj.id = obj[Datastore.KEY].id;\n return obj;\n}", "title": "" }, { "docid": "0e3bfbacf5bca0015ffcacf66712eab3", "score": "0.41872874", "text": "function toJSON(obj) { \n\treturn gadgets.json.stringify(obj); \n}", "title": "" } ]
6e3124840629e8be6fe9b1162965bc5d
! jQuery UI Spinner 1.12.1 Copyright jQuery Foundation and other contributors Released under the MIT license. >>label: Spinner >>group: Widgets >>description: Displays buttons to easily input numbers via the keyboard or mouse. >>docs: >>demos: >>css.structure: ../../themes/base/core.css >>css.structure: ../../themes/base/spinner.css >>css.theme: ../../themes/base/theme.css
[ { "docid": "14b7ecb9cd46747faf3190bcf599cce5", "score": "0.0", "text": "function spinnerModifer( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" } ]
[ { "docid": "ab4430aa7d005f3a0619a18c6b099de3", "score": "0.7481154", "text": "function initializeSpinnerControlForQuantity() {\n\n\tvar jQueryFloat = parseFloat(jQuery.fn.jquery); // 1.1\n\tif (jQueryFloat >= 3) {\n\n\t\t// Extend spinner.\n\t\tif (typeof $.fn.spinner === \"function\" && $.widget(\"ui.spinner\", $.ui.spinner, {\n\t\t\t\t\t\t\t\t_buttonHtml: function() {\n\n\t\t\t\t\t\treturn `\\n\\t\\t\\t\\t\\t<a class=\"ui-spinner-button ui-corner-br ui-button ui-widget ui-state-default ui-button-text-only ui-spinner-down\" tabindex=\"-1\" role=\"button\">\\n\\t\\t\\t\\t\\t\\t<span class=\"ui-icon\"><i class=\\'fas fa-plus\\'></i></span>\\n\\t\\t\\t\\t\\t</a>\\n\\t\\t\\t\\t\\t<a class=\"ui-spinner-button ui-corner-tr ui-button ui-widget ui-state-default ui-button-text-only\" tabindex=\"-1\" role=\"button\">\\n\\t\\t\\t\\t\\t\\t<span class=\"ui-icon\"><i class=\\'fas fa-minus\\'></i></span>\\n\\t\\t\\t\\t\\t</a>\n\t\t`;\n\t\t\t\t\t}\n\t\t\t\t} ));\n\n\t}\n\n\n\tif (jQueryFloat < 3) {\n\n\t\tif ( $.isFunction( $.fn.spinner ) ) {\n\t\t$.widget( \"ui.spinner\", $.ui.spinner, {\n\t\t\t_buttonHtml: function() {\n\t\t\t\treturn `\n\t\t\t\t\t<a class=\"ui-spinner-button ui-spinner-down ui-corner-br ui-button ui-widget ui-state-default ui-button-text-only\" tabindex=\"-1\" role=\"button\">\n\t\t\t\t\t\t<span class=\"ui-icon\"><i class='fas fa-minus'></i></span>\n\t\t\t\t\t</a>\n\t\t\t\t\t<a class=\"ui-spinner-button ui-spinner-up ui-corner-tr ui-button ui-widget ui-state-default ui-button-text-only\" tabindex=\"-1\" role=\"button\">\n\t\t\t\t\t\t<span class=\"ui-icon\"><i class='fas fa-plus'></i></span>\n\t\t\t\t\t</a>`;\n\t\t\t},\n\t\t} );\n\t}\n\n\n\n\t}\n\n\n\n\n\n// WP5.6\n//\tif (typeof $.fn.spinner === \"function\" && $.widget(\"ui.spinner\", $.ui.spinner, {\n\t// _buttonHtml: function() {\n//\t\t\t\t\t\t\t\treturn '\\n\\t\\t\\t\\t\\t<a class=\"ui-spinner-button ui-corner-br ui-button ui-widget ui-state-default ui-button-text-only ui-spinner-down\" tabindex=\"-1\" role=\"button\">\\n\\t\\t\\t\\t\\t\\t<span class=\"ui-icon\"><i class=\\'fas fa-plus\\'></i></span>\\n\\t\\t\\t\\t\\t</a>\\n\\t\\t\\t\\t\\t<a class=\"ui-spinner-button ui-corner-tr ui-button ui-widget ui-state-default ui-button-text-only\" tabindex=\"-1\" role=\"button\">\\n\\t\\t\\t\\t\\t\\t<span class=\"ui-icon\"><i class=\\'fas fa-minus\\'></i></span>\\n\\t\\t\\t\\t\\t</a>'\n//\t\t\t\t\t\t}\n// }));\n\n\n\t// Initialze the spinner on load.\n\tinitSpinner();\n\n\t// Re-initialze the spinner on WooCommerce cart refresh.\n\t$( document.body ).on( 'updated_cart_totals', function() {\n\t\tinitSpinner();\n\t} );\n\n\t// Trigger quantity input when plus/minus buttons are clicked.\n\t(0,$)(document).on( 'click', '.ui-spinner-button', () => {\n\t\t$( '.ui-spinner-input' ).trigger( 'change' );\n\n\t} );\n}", "title": "" }, { "docid": "fbe24594c87f2dea1fdc36967ee64bfa", "score": "0.69248265", "text": "function spinner() {\n return span('hx-spinner');\n}", "title": "" }, { "docid": "f07ea292c5bab4e57825be3d86f768f2", "score": "0.68815035", "text": "function Spinner() {\n this.intervalId = null;\n this.isRunning = false;\n this.stopCallback = function() {};\n}", "title": "" }, { "docid": "a8c9408b3aed09db80fcfb0f2fa0616b", "score": "0.6814592", "text": "function module(selection) {\n var opts = {\n lines: 12, // The number of lines to draw\n length: 16, // The length of each line\n width: 6, // The line thickness\n radius: 16, // The radius of the inner circle\n corners: 1, // Corner roundness (0..1)\n rotate: 0, // The rotation offset\n direction: 1, // 1: clockwise, -1: counterclockwise\n color: '#000', // #rgb or #rrggbb\n speed: 1, // Rounds per second\n trail: 60, // Afterglow percentage\n shadow: true, // Whether to render a shadow\n hwaccel: true, // Whether to use hardware acceleration\n className: 'spinner', // The CSS class to assign to the spinner\n zIndex: 2e9, // The z-index (defaults to 2000000000)\n top: 0, // Top position relative to parent in px\n left: 0 // Left position relative to parent in px\n };\n \n spinner = new Spinner(opts);\n }", "title": "" }, { "docid": "4b4023c1cdc1d7183cc6ff4e6a3bd8e6", "score": "0.6812345", "text": "function createSpin() {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(spinnerSelector), function (index, spinner) {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(spinner).TouchSpin({\n verticalbuttons: true,\n verticalupclass: 'material-icons touchspin-up',\n verticaldownclass: 'material-icons touchspin-down',\n buttondown_class: 'btn btn-touchspin js-touchspin js-increase-product-quantity',\n buttonup_class: 'btn btn-touchspin js-touchspin js-decrease-product-quantity',\n min: parseInt(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(spinner).attr('min'), 10),\n max: 1000000\n });\n });\n}", "title": "" }, { "docid": "1f06f956b92617e70114a41778d9bfbc", "score": "0.676798", "text": "function startSpinner() { }", "title": "" }, { "docid": "d47c18657b4f4dfba4d9ea735c00a584", "score": "0.67678756", "text": "function startSpinner() { }", "title": "" }, { "docid": "a0e84cdb47446b471ef2e36eda8b2546", "score": "0.67439693", "text": "function SpinOptions(lines,length,width,radius,corners,direction,color,speed,trail,shadow,hardwareAccel,className,zIndex,top,left,spinOptions$){\n $init$SpinOptions();\n if(spinOptions$===undefined)spinOptions$=new SpinOptions.$$;\n if(lines===undefined){lines=(13);}\n spinOptions$.lines_=lines;\n if(length===undefined){length=(20);}\n spinOptions$.length_=length;\n if(width===undefined){width=(10);}\n spinOptions$.width_=width;\n if(radius===undefined){radius=(30);}\n spinOptions$.radius_=radius;\n if(corners===undefined){corners=m$6mi.Float(1.0);}\n spinOptions$.corners_=corners;\n if(direction===undefined){direction=getClockwise();}\n spinOptions$.direction_=direction;\n if(color===undefined){color=\"#000\";}\n spinOptions$.color_=color;\n if(speed===undefined){speed=(1);}\n spinOptions$.speed_=speed;\n if(trail===undefined){trail=(60);}\n spinOptions$.trail_=trail;\n if(shadow===undefined){shadow=false;}\n spinOptions$.shadow_=shadow;\n if(hardwareAccel===undefined){hardwareAccel=false;}\n spinOptions$.hardwareAccel_=hardwareAccel;\n if(className===undefined){className=\"spinner\";}\n spinOptions$.className_=className;\n if(zIndex===undefined){zIndex=(2000000000);}\n spinOptions$.zIndex_=zIndex;\n if(top===undefined){top=\"auto\";}\n spinOptions$.top_=top;\n if(left===undefined){left=\"auto\";}\n spinOptions$.left_=left;\n return spinOptions$;\n}", "title": "" }, { "docid": "37068a100d937ace66c7b12e3065341b", "score": "0.667913", "text": "function inputSpinner() {\n\t$('input.spinner').each(function() {\n\t\t\n\t\tvar attr_disable = $(this).prop(\"disabled\");\n\t\tvar thisWidth = $(this).width();\n \n\t\tif ($(this).hasClass('noSpinner'))\n\t\t{\n\t\t\t$(this).removeClass('spinner');\n\t\t\treturn false;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t\n\t\t\tif (attr_disable == true) {\n\t\t\t\t$(this).spinner({ disabled: true });\n\t\t\t} else {\n\t\t\t\t$(this).spinner({\n\t\t\t\t\tchange: function(event,ui){\n\t\t\t\t\t\t$(this).attr(\"value\",$(this).val());\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//만약 spinner로 만들어질 input에 인라인 스타일로 width가 있을시는 해당 width를 가져와서 spinner를 감싸는 span에 width를 넣어줌\n\t\t\t\n\t\t\tvar spinnerInputStyle = $(this).prop('style');\n\t\t\tfor (var i = 0; i < spinnerInputStyle.length; i++) {\n\t\t\t\tvar style_name = spinnerInputStyle[i];\n\t\t\t\tvar style_value = spinnerInputStyle[style_name];\n\t\t\t \n\t\t\t\tif (style_name == 'width') {\n\t\t\t\t\tvar thisSpinnerBox = $(this).parent('span.ui-spinner');\n\t\t\t\t\tthisSpinnerBox.css('width',style_value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t});\n}", "title": "" }, { "docid": "36bb41879ef27cb21353a33a7ece8ad0", "score": "0.65810066", "text": "function initNumberSpinners() {\n\t// Init Point Value Number Steppers\n\t$(\"input[name='point_value']\").TouchSpin({\n\t verticalbuttons: true,\n\t min: -100,\n max: 100,\n step: 1,\n boostat: 5,\n maxboostedstep: 10,\n verticalupclass: 'glyphicon glyphicon-plus',\n verticaldownclass: 'glyphicon glyphicon-minus'\n\t });\n}", "title": "" }, { "docid": "ac44160b22103c58f49358f2883ccd33", "score": "0.65320987", "text": "function SpinnerCustom() {\n var options = {\n lines: 17,\n length: 56,\n width: 25,\n radius: 84,\n scale: 0.75,\n corners: 1,\n color: '#FFF',\n opacity: 0,\n rotate: 49,\n direction: -1,\n speed: 0.5,\n trail: 100,\n fps: 20,\n zIndex: 2e9,\n className: 'spinner',\n top: '50%',\n left: '50%',\n shadow: true,\n hwaccel: false,\n position: 'fixed' // Element positioning\n };\n this.spinner = new Spinner(options);\n this.target = document.getElementById(\"app\");\n }", "title": "" }, { "docid": "e1159421e7524ec64f4efad59eda5537", "score": "0.65224", "text": "function startSpinner() {\n\t$(\"#spinner\").show();\n}", "title": "" }, { "docid": "72881542a19b6ae511ab29ae5641e51b", "score": "0.6510057", "text": "function showProgressSpinner() {\n\tvar opts = {\n\t lines: 13 // The number of lines to draw\n\t, length: 28 // The length of each line\n\t, width: 14 // The line thickness\n\t, radius: 51 // The radius of the inner circle\n\t, scale: 1 // Scales overall size of the spinner\n\t, corners: 1 // Corner roundness (0..1)\n\t, color: '#000' // #rgb or #rrggbb or array of colors\n\t, opacity: 0.2 // Opacity of the lines\n\t, rotate: 0 // The rotation offset\n\t, direction: 1 // 1: clockwise, -1: counterclockwise\n\t, speed: 1 // Rounds per second\n\t, trail: 60 // Afterglow percentage\n\t, fps: 20 // Frames per second when using setTimeout() as a fallback for CSS\n\t, zIndex: 2e9 // The z-index (defaults to 2000000000)\n\t, className: 'spinner' // The CSS class to assign to the spinner\n\t, top: '50%' // Top position relative to parent\n\t, left: '50%' // Left position relative to parent\n\t, shadow: false // Whether to render a shadow\n\t, hwaccel: false // Whether to use hardware acceleration\n\t, position: 'absolute' // Element positioning\n\t}\n\tvar target = document.getElementById('progressSpinner')\n\tvar spinner = new Spinner(opts).spin(target);\n}", "title": "" }, { "docid": "b8b11e79a468dd4983f8c006517a7b4e", "score": "0.6494362", "text": "function Spinner(_ref) {\n var _ref$active = _ref.active,\n active = _ref$active === void 0 ? true : _ref$active;\n return /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__[\"jsxDEV\"])(\"div\", {\n className: ['spinner', active && 'spinner--active'].join(' '),\n role: \"progressbar\",\n \"aria-busy\": active ? 'true' : 'false'\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 5\n }, this);\n}", "title": "" }, { "docid": "636cb3582540136662dee5924354ea9f", "score": "0.6479185", "text": "function Ace_Spinner(element , _options) {\n\t\tvar attrib_values = ace.helper.getAttrSettings(element, $.fn.ace_spinner.defaults);\n\t\tvar options = $.extend({}, $.fn.ace_spinner.defaults, _options, attrib_values);\n\t\n\t\tvar max = options.max\n\t\tmax = (''+max).length\n\t\tvar width = parseInt(Math.max((max * 20 + 40) , 90))\n\n\t\tvar $element = $(element);\n\t\t\n\t\tvar btn_class = 'btn-sm';//default\n\t\tvar sizing = 2;\n\t\tif($element.hasClass('input-sm')) {\n\t\t\tbtn_class = 'btn-xs';\n\t\t\tsizing = 1;\n\t\t}\n\t\telse if($element.hasClass('input-lg')) {\n\t\t\tbtn_class = 'btn-lg';\n\t\t\tsizing = 3;\n\t\t}\n\t\t\n\t\tif(sizing == 2) width += 25;\n\t\telse if(sizing == 3) width += 50;\n\t\t\n\t\t$element.addClass('spinbox-input form-control text-center').wrap('<div class=\"ace-spinner middle\">')\n\n\t\tvar $parent_div = $element.closest('.ace-spinner').spinbox(options).wrapInner(\"<div class='input-group'></div>\")\n\t\tvar $spinner = $parent_div.data('fu.spinbox');\n\t\t\n\t\tif(options.on_sides)\n\t\t{\n\t\t\t$element\n\t\t\t.before('<div class=\"spinbox-buttons input-group-btn\">\\\n\t\t\t\t\t<button type=\"button\" class=\"btn spinbox-down '+btn_class+' '+options.btn_down_class+'\">\\\n\t\t\t\t\t\t<i class=\"icon-only '+ ace.vars['icon'] + options.icon_down+'\"></i>\\\n\t\t\t\t\t</button>\\\n\t\t\t\t</div>')\n\t\t\t.after('<div class=\"spinbox-buttons input-group-btn\">\\\n\t\t\t\t\t<button type=\"button\" class=\"btn spinbox-up '+btn_class+' '+options.btn_up_class+'\">\\\n\t\t\t\t\t\t<i class=\"icon-only '+ ace.vars['icon'] + options.icon_up+'\"></i>\\\n\t\t\t\t\t</button>\\\n\t\t\t\t</div>');\n\n\t\t\t$parent_div.addClass('touch-spinner')\n\t\t\t$parent_div.css('width' , width+'px')\n\t\t}\n\t\telse {\n\t\t\t $element\n\t\t\t .after('<div class=\"spinbox-buttons input-group-btn\">\\\n\t\t\t\t\t<button type=\"button\" class=\"btn spinbox-up '+btn_class+' '+options.btn_up_class+'\">\\\n\t\t\t\t\t\t<i class=\"icon-only '+ ace.vars['icon'] + options.icon_up+'\"></i>\\\n\t\t\t\t\t</button>\\\n\t\t\t\t\t<button type=\"button\" class=\"btn spinbox-down '+btn_class+' '+options.btn_down_class+'\">\\\n\t\t\t\t\t\t<i class=\"icon-only '+ ace.vars['icon'] + options.icon_down+'\"></i>\\\n\t\t\t\t\t</button>\\\n\t\t\t\t</div>')\n\n\t\t\tif(ace.vars['touch'] || options.touch_spinner) {\n\t\t\t\t$parent_div.addClass('touch-spinner')\n\t\t\t\t$parent_div.css('width' , width+'px')\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$element.next().addClass('btn-group-vertical');\n\t\t\t\t$parent_div.css('width' , width+'px')\n\t\t\t}\n\t\t}\n\n\t\t$parent_div.on('changed', function(){\n\t\t\t$element.trigger('change')//trigger the input's change event\n\t\t});\n\n\t\tthis._call = function(name, arg) {\n\t\t\t$spinner[name](arg);\n\t\t}\n\t}", "title": "" }, { "docid": "115a7477a4e88bcfa793cc8742dd546f", "score": "0.64623636", "text": "function setSpinner() \n{\n $('#demo').html(spinner);\n}", "title": "" }, { "docid": "4685d8097bc080e5d92dfac4fae16cb1", "score": "0.64288145", "text": "function showSpinner(){\n \tif(spinTarget == null){\n \t\tspinTarget = $('<div id=\"spinner\" ></div>').css( {\n \t position: 'relative',\n \t width: '50px',\n \t height: '50px',\n \t margin: 'auto'\n \t\t}); \n \t\tspinTarget.appendTo(\"body\");\n \t\tspinner = new Spinner(spinnerOpts);\n \t}\n \tspinTarget.show();\n\t\tspinner.spin(spinTarget[0]);\n }", "title": "" }, { "docid": "43ee47bd45d4f0fc37f81d75d72ba14b", "score": "0.64159817", "text": "function Spinner() {\n var self = this;\n this.percent = 0;\n this.el = document.createElement('canvas');\n this.ctx = this.el.getContext('2d');\n this.size(50);\n this.fontSize(11);\n this.speed(60);\n this.font('helvetica, arial, sans-serif');\n this.stopped = false;\n\n (function animate() {\n if (self.stopped) return;\n raf(animate);\n self.percent = (self.percent + self._speed / 36) % 100;\n self.draw(self.ctx);\n })();\n}", "title": "" }, { "docid": "97e3593239eda3743731180e61c15751", "score": "0.63978016", "text": "function createSpinner(id, options) {\n jQuery(\"#\" + id).spinner(options);\n}", "title": "" }, { "docid": "5987a244a9bdb09d92b73006139855b7", "score": "0.6345267", "text": "function addSpinner () {\r\n\t\tspinner = new CanvasLoader(\"spinner\");\r\n\t\tspinner.setShape(\"spiral\");\r\n\t\tspinner.setDiameter(90);\r\n\t\tspinner.setDensity(90);\r\n\t\tspinner.setRange(1);\r\n\t\tspinner.setSpeed(4);\r\n\t\tspinner.setColor(\"#333333\");\r\n\t\t// As its hidden and not rendering by default we have to call its show() method\r\n\t\tspinner.show();\r\n\t\t// We use the jQuery fadeIn method to slowly fade in the preloader\r\n\t\t$(\"#spinner\").fadeIn(\"slow\");\r\n\t}", "title": "" }, { "docid": "309e85f02b09e27b3ed81447a95eb77e", "score": "0.6331258", "text": "function showSpinner(){\n \tspinTarget.show();\n\t\tspinner.spin(spinTarget[0]);\n }", "title": "" }, { "docid": "309e85f02b09e27b3ed81447a95eb77e", "score": "0.6331258", "text": "function showSpinner(){\n \tspinTarget.show();\n\t\tspinner.spin(spinTarget[0]);\n }", "title": "" }, { "docid": "a520ef5dfb79db9fc161962cb28cda19", "score": "0.6303428", "text": "function initSpinner() {\n\nif(typeof $.fn.spinner === \"function\" && (0, $)(\".qty\").spinner());\n\n}", "title": "" }, { "docid": "c85b308a6472343fa53a4297abc01d52", "score": "0.61938566", "text": "function createSpinnerForStyle(opts) {\n setDefaultStyleMetric(opts);\n pl = new QrSpinner(opts.style_value);\n pl.appendTo(opts.id);\n tan = createTaniComponent(opts.style_metric, opts.id);\n connectCSS2(pl, tan, opts);\n}", "title": "" }, { "docid": "0025722e7373982d81b39c6528d3fe64", "score": "0.6168712", "text": "function showSpinner() {\n // Animate loading spinner.\n $spinner = $('#spinner');\n\n if (!window.timerSpinner) {\n var spinnerStep = 0;\n window.timerSpinner = setInterval( function () {\n var shift = 24 - ( 56 * spinnerStep );\n $spinner.css( 'background-position', '24px ' + shift + 'px' );\n spinnerStep = ( 7 <= spinnerStep ) ? 0 : spinnerStep + 1;\n }, 90 );\n }\n\n $spinner.show();\n}", "title": "" }, { "docid": "dd0f840ca704881a5f41be1f8ba2ddab", "score": "0.61360735", "text": "function spinnerModifer(fn){return function(){var previous=this.element.val();fn.apply(this,arguments);this._refresh();if(previous!==this.element.val()){this._trigger(\"change\");}};}", "title": "" }, { "docid": "dd0f840ca704881a5f41be1f8ba2ddab", "score": "0.61360735", "text": "function spinnerModifer(fn){return function(){var previous=this.element.val();fn.apply(this,arguments);this._refresh();if(previous!==this.element.val()){this._trigger(\"change\");}};}", "title": "" }, { "docid": "d92be5382e809fdb7de2dd5f452f1527", "score": "0.6126175", "text": "function spin( yes ) {\n\t//console.log( 'spin', yes );\n\t$('#spinner').css({ visibility: yes ? 'visible' : 'hidden' });\n}", "title": "" }, { "docid": "baa3f828ab7d77ce3deff068a118d2d2", "score": "0.61188567", "text": "function startSpinnerInt() {\n spinner = ora(oraOptions).start()\n}", "title": "" }, { "docid": "f33ee6fd9466600293033f6c619d8f2a", "score": "0.6113536", "text": "function addSpinner(e) {\n return e.addClass('fa-spinner fa-spin');\n}", "title": "" }, { "docid": "04d6bec9f1f5f512e7339f72b28e79d2", "score": "0.61016166", "text": "function addSpinner(parent) {\n // if(!parent) parent = $('#target').parent(); // '.livePreview'; // 'body'\n parent = $('#target').parent().parent();\n tempColor = $('#target').parent().css('background');\n\n // add CSS animations definitons\n $('<style>' + \n '#liveSpinner:after {display: block;position: relative;width: 20px; height: 20px; animation: rotate 0.5s linear infinite; border-radius: 100%; border-top: 1px solid #545a6a; border-bottom: 1px solid #d4d4db; border-left: 1px solid #545a6a; border-right: 1px solid #d4d4db; content: \\'\\'; opacity: .5;}' +\n '#liveSpinner:after {width: 60px; height: 60px;}' +\n '@keyframes rotate {0% {transform: rotateZ(-360deg);}}' +\n '</style>').appendTo('body');\n\n // add spinner to the document, bind to spinner selector\n spinner = $('<div id=\"liveSpinner\" class=\"spin\"></div>').css({\n position: 'fixed',\n top: '55%',\n // left: '48%',\n 'z-index': '50000',\n }).appendTo(parent).hide(); \n\n setTimeout(showSpinner, 1200);\n }", "title": "" }, { "docid": "d9e3c0c73757b68cf542ac38fa3749af", "score": "0.60944617", "text": "function spinStart($widget) {\r\n var $spinnerContainer;\r\n if ($('.panel-body', $widget).length) {\r\n $spinnerContainer = $('.panel-body', $widget);\r\n } else {\r\n $spinnerContainer = $widget;\r\n }\r\n $spinnerContainer.append('<div class=\"ow-veil\"><span class=\"ow-spinner\"><i class=\"glyphicon glyphicon-refresh ow-rotate\"></i></span></div>');\r\n }", "title": "" }, { "docid": "094ea6d13afd8ba642cb79b6b0201ae0", "score": "0.6057396", "text": "function createSpinner(id, options) {\n jQuery(\"#\" + id).spinit(options);\n}", "title": "" }, { "docid": "99f9b32eb0298b0d060f53db7373da03", "score": "0.6007233", "text": "function Spin(_ref) {\n var props = _objectWithoutProperties(_ref, []);\n\n return (0, _preact.h)(\"div\", _extends({\n className: \"ket-spinner\"\n }, props));\n }", "title": "" }, { "docid": "bc222555243a3f581db224d6e5cdc0c2", "score": "0.6001229", "text": "function LoadSpinners (numResults) {\n\n console.log(\"loadSpinners called\");\n var opts = {\n lines: 7 // The number of lines to draw\n , length: 2 // The length of each line\n , width: 2 // The line thickness\n , radius: 5 // The radius of the inner circle\n , scale: 1 // Scales overall size of the spinner\n , corners: 1 // Corner roundness (0..1)\n , color: '#000' // #rgb or #rrggbb or array of colors\n , opacity: 0.25 // Opacity of the lines\n , rotate: 0 // The rotation offset\n , direction: 1 // 1: clockwise, -1: counterclockwise\n , speed: 0.7 // Rounds per second\n , trail: 42 // Afterglow percentage\n , fps: 20 // Frames per second when using setTimeout() as a fallback for CSS\n , zIndex: 2e9 // The z-index (defaults to 2000000000)\n , className: 'spinner' // The CSS class to assign to the spinner\n , top: '50%' // Top position relative to parent\n , left: '50%' // Left position relative to parent\n , shadow: false // Whether to render a shadow\n , hwaccel: false // Whether to use hardware acceleration\n , position: 'absolute' // Element positioning\n };\n\n /* var targets = document.getElementsByClassName('loading');\n var spinners = [];\n var i = 0;\n for (i = 0; i < targets.length; i++) {\n var temp = new Spinner(opts).spin();\n targets[i].appendChild(temp.el);\n spinners.push(temp); //throwing an error\n\n // this may fail if we receive less than ten results\n // or if doesn't gether targets in order\n var idNum = i+1;\n $('#i'+idNum).data('spinner-id', i);\n $('#i'+idNum).load(function () {\n spinners[$(this).data('spinner-id')].stop();\n $(this).parent().find('.loading').hide();\n });\n }\n \n\n // breaks it currenty.\n \n $('.pager').click(function () {\n var i = 0;\n for (i = 0; i < spinners.length; i++){\n var idNum = i+1;\n spinners[i].stop();\n $('#i'+idNum).parent().find('.loading').hide();\n }\n }); */\n\n var targets = document.getElementsByClassName('loading'); //NodeList object idx starts with 0\n spinners.length = 0;\n for (var i = 0; i < numResults; i++) {\n var iframeId = '#i'.concat(\"\", i+1);\n console.log(iframeId);\n $(iframeId).parent().find('.loading').show();\n spinners.push(new Spinner(opts).spin(targets[i])); //throwing an error\n\n var iframe = document.getElementById(iframeId.slice(1));\n iframe.onload = function () {\n console.log('iframe '+this.id+' loaded.');\n //spinners[i].stop();\n //spinners.shift();\n $(this).parent().find('.loading').hide();\n };\n }\n}", "title": "" }, { "docid": "5f740c9a86bc4fd1aebd28a091fc719e", "score": "0.5998605", "text": "showSpinner() {\n this.spinnerVisible = true;\n }", "title": "" }, { "docid": "520374132c83dd05a9e0efc135157c4b", "score": "0.598232", "text": "function quantityInputs() {\n if ( $.fn.inputSpinner ) {\n $(\"input[type='number']\").inputSpinner({\n decrementButton: '<i class=\"icon-minus\"></i>',\n incrementButton: '<i class=\"icon-plus\"></i>',\n groupClass: 'input-spinner',\n buttonsClass: 'btn-spinner',\n buttonsWidth: '26px'\n });\n }\n }", "title": "" }, { "docid": "decf5283ddc7ae92332f1b0214d907f2", "score": "0.5926006", "text": "function spinAtGivenPosition(posx, posy){\n // halt previous spin, if running\n stopSpin();\n \n //remove previous spinner target\n //jQ310('#spinnertargetid').remove();\n \n // var spinnertargetid = 'spinnertargetid';\n console.log('spinAtGivenPosition stopped');\n \nvar spinnertarget = \n jQ310('<span/>', { \n id: 'spinnertargetid',\n class: '',\n text: ''\n});//.appendTo('#mySelector');\n spinnertarget.appendTo('body');\n spinnertarget.css({position:\"absolute\", left:posx, top:posy});\n \n //spinnertarget.after(\"<span id='spinnerplaceholder'></span>\");//.wrap(\"<span id='spinnerplaceholderparent'></span>\");\n var target = document.getElementById('spinnertargetid'); \n submitinSpinner = new Spinner(getOpts()).spin(target); \n submitinSpinner.css({position:\"absolute\", left:posx, top:posy});\n console.log('spinAtGivenPosition created');\n\n}", "title": "" }, { "docid": "eb75d9f686bde07368e84fc1394e7476", "score": "0.58916205", "text": "function cartTouchSpin() {\n if ($('.quantity-spinner').length) {\n $(\"input.quantity-spinner\").TouchSpin({\n verticalbuttons: true\n });\n }\n}", "title": "" }, { "docid": "54e413302da189b59cae1e50a352e031", "score": "0.5866071", "text": "renderSpinner() {\n if (this.props.loading) {\n return (\n <Spinner size=\"large\" />\n );\n }\n }", "title": "" }, { "docid": "fbf259cf73a93164147b3f80e4196de1", "score": "0.5864227", "text": "spinner() {\n return (\n <Spinner />\n );\n }", "title": "" }, { "docid": "7f2d3cf6715b6f3db200114205e29dbe", "score": "0.58569556", "text": "function showSpinner(i) {\n $(`.spinner-${i}`).removeClass('hidden');\n}", "title": "" }, { "docid": "27fe555ce432050ad71815dced41f1f2", "score": "0.5839292", "text": "showSpinner () {\n this.spinnerEl.classList.add('active');\n }", "title": "" }, { "docid": "b914c626a89a0eba6ad002872732a15f", "score": "0.5833058", "text": "function adds_decorSpinner({\n spinner_domParent, //usually dragSurface\n opt,\n }) {\n //----------------------------------------------\n // //\\\\ api\n //----------------------------------------------\n var {\n //addFeaturesToDecPoint and addFeaturesToDecPoint.dragDecorColor\n //are flags,\n //addFeaturesToDecPoint.dragDecorColor is a condition to\n //run creates_spinnerOwnCss()\n addFeaturesToDecPoint,\n\n parent_classes,\n makeCentralDiskInvisible,\n orientation,\n tooltip,\n } = (opt||{});\n\n var { spinnerClsId, dragDecorColor, individual_zindex } =\n ( addFeaturesToDecPoint || {} );\n //----------------------------------------------\n // \\\\// api\n //----------------------------------------------\n\n //----------------------------------------------\n // //\\\\ builds cls and CSS\n //----------------------------------------------\n dpdec.createGlobal( makeCentralDiskInvisible ); //idempotent\n var cls = 'brc-slider-draggee';\n if( addFeaturesToDecPoint ) {\n if( dragDecorColor ) {\n dpdec.creates_spinnerOwnCss(\n spinnerClsId,\n dragDecorColor, //individual_color for arrows, and disk\n parent_classes,\n individual_zindex,\n );\n }\n cls += ' ' + spinnerClsId;\n }\n if( orientation === 'horiz' ) {\n cls += ' axis-y';\n } else if( orientation ) {\n cls += ' ' + orientation;\n } \n //----------------------------------------------\n // \\\\// builds cls and CSS\n //----------------------------------------------\n\n //----------------------------------------------\n // //\\\\ builds 3 DOM elements\n //----------------------------------------------\n var decPoint = document.createElement( 'div' );\n spinner_domParent.appendChild( decPoint );\n var mouseoverCb = haz( addFeaturesToDecPoint, 'mouseoverCb' );\n if( mouseoverCb ) {\n decPoint.addEventListener( 'mouseover', (ev) => {\n mouseoverCb( ev, decPoint );\n });\n }\n var mouseleaveCb = haz( addFeaturesToDecPoint, 'mouseleaveCb' );\n if( mouseleaveCb ) {\n decPoint.addEventListener( 'mouseleave', (ev) => {\n mouseleaveCb( ev, decPoint );\n });\n }\n\n decPoint.setAttribute( 'class', cls );\n if( tooltip ) {\n decPoint.setAttribute( 'title', tooltip );\n }\n var left = document.createElement( 'div' );\n left.setAttribute( 'class', 'brc-slider-draggee-left' );\n decPoint.appendChild( left );\n\n var right = document.createElement( 'div' );\n right.setAttribute( 'class', 'brc-slider-draggee-right' );\n decPoint.appendChild( right );\n //----------------------------------------------\n // \\\\// builds 3 DOM elements\n //----------------------------------------------\n return decPoint;\n }", "title": "" }, { "docid": "70bad47a3ad84e64f213e133640357ff", "score": "0.581775", "text": "function spinner() {\n return `<div class=\"sk-spinner sk-spinner-wave\">\n <div class=\"sk-rect1\"></div>\n <div class=\"sk-rect2\"></div>\n <div class=\"sk-rect3\"></div>\n <div class=\"sk-rect4\"></div>\n <div class=\"sk-rect5\"></div>\n </div>`;\n}", "title": "" }, { "docid": "a3b99c5bdf59091e55c4a092380e7f58", "score": "0.5803361", "text": "function sgny_woocom_spinner(){\n\tvar $content = $(\"body\")\n\t.has(\".quantity input.qty[type=number], .quantity input.qty[type=number]\")\n\t.length;\n\tif(true == $content){\n\tvar fidSelector = $('.woocommerce .quantity input.qty[type=number], .woocommerce-page .quantity input.qty[type=number]');\n\t fidSelector.before('<span class=\"qty-up\"></span>');\n\t fidSelector.after('<span class=\"qty-down\"></span>');\n\t setTimeout(function(){\n\t\t\t$('.woocommerce .quantity input.qty[type=number], .woocommerce-page .quantity input.qty[type=number]').each(function(){\n\t\t\t\tvar minNumber = $(this).attr(\"min\");\n\t\t\t\tvar maxNumber = $(this).attr(\"max\");\n\t\t\t\t$(this).prev('.qty-up').on('click', function() {\n\t\t\t\t\tif($(this).next(\"input.qty[type=number]\").val() == maxNumber){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$(this).next(\"input.qty[type=number]\").val( parseInt($(this).next(\"input.qty[type=number]\").val(), 10) + 1);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t$(this).next('.qty-down').on('click', function() {\n\t\t\t\t\tif($(this).prev(\"input.qty[type=number]\").val() == minNumber){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$(this).prev(\"input.qty[type=number]\").val( parseInt($(this).prev(\"input.qty[type=number]\").val(), 10) - 1);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t },100);\n }\n return;\n}", "title": "" }, { "docid": "d8c4a5807d3b3db60dcc00f176a4be4b", "score": "0.5795614", "text": "function spin($6mm){\n /*BEG dynblock*/\n return JQuerySpin($6mm.$_native);\n /*END dynblock*/\n}", "title": "" }, { "docid": "94ef21abeba4937996b0d36ed68e9e3d", "score": "0.5741229", "text": "function ActivateSpinner(htmlObj) {\n $(htmlObj).addClass(\"spinner-border\");\n $(htmlObj).addClass(\"spinner-border-sm\");\n}", "title": "" }, { "docid": "3e5ba026c16367d3a944151f36909559", "score": "0.57156533", "text": "function startLoading() {\n var opts = {\n lines: 9, // The number of lines to draw\n length: 24, // The length of each line\n width: 11, // The line thickness\n radius: 26, // The radius of the inner circle\n corners: 1, // Corner roundness (0..1)\n rotate: 0, // The rotation offset\n direction: 1, // 1: clockwise, -1: counterclockwise\n color: '#000', // #rgb or #rrggbb or array of colors\n speed: 0.9, // Rounds per second\n trail: 37, // Afterglow percentage\n shadow: false, // Whether to render a shadow\n hwaccel: false, // Whether to use hardware acceleration\n className: 'spinner', // The CSS class to assign to the spinner\n zIndex: 2e9, // The z-index (defaults to 2000000000)\n top: '50%', // Top position relative to parent\n left: '50%' // Left position relative to parent\n };\n var target = document.getElementById('loadingbody');\n var spinner = new Spinner(opts).spin(target); \n $('#loadingModal').modal('show');\n}", "title": "" }, { "docid": "e60a35b3d0eb381837bf6a36dfb83e7c", "score": "0.57061404", "text": "function startSpinner(instance, degSum, degMulti, delay) {\n\tvar div = instance;\n\tvar property = getTransformProperty(div);\n\tif (property) {\n\t\tvar d = 0;\n\t\tspinnerInterval = setInterval(function () { div.style[property] = 'rotate(' + ((d++ % degSum)*degMulti) + 'deg)'; }, delay);\n\t}\n}", "title": "" }, { "docid": "2464b72d3d25ff81611e80ef90a006c7", "score": "0.5702814", "text": "function SpinnerStart(title, msg )\n{\n SpinnerStop();\n \n // Note: spinner dialog is cancelable by default on Android and iOS. On WP8, it's fixed by default\n // so make fixed on all platforms.\n // Title is only allowed on Android so never show the title.\n// window.plugins.spinnerDialog.show(null, msg, true);\n navigator.notification.activityStart(title, msg);\n bSpinner = true;\n \n // Save to log file...\n PrintLog(1, \"Spinner: \" + msg );\n \n}", "title": "" }, { "docid": "f6bc060f13135f1ea150864952b0534c", "score": "0.5698217", "text": "function initializeInterface() {\n $(\".spinner\").hide();\n}", "title": "" }, { "docid": "64b7400444a7c015a86b1bab6e3983e0", "score": "0.5689327", "text": "function add_loading_spinner(selector) {\n\t$(selector).bind('keyup', function(){\n\t\tif ($(this).val().length >= 1) {\n\t\t\t$(this).addClass(\"inputloading\");\n\t\t} else {\n\t\t\t$(this).removeClass(\"inputloading\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "65f1b1c0fd74f685c405875eb0ff6962", "score": "0.567374", "text": "function buttonLoading(idButton, status) {\n if (status === 'start') {\n var iconTurnAround = '<i class=\"icon-spinner9 spinner position-right\"></i>';\n $('#' + idButton).append(iconTurnAround);\n $('#' + idButton).addClass('disabled');\n } else if (status = 'end') {\n $('#' + idButton).addClass('enable');\n $('#' + idButton + ' i').remove();\n $('#' + idButton).removeClass(\"disabled\");\n }\n}", "title": "" }, { "docid": "ea3f52d55b27bc174141486d7aaff0d0", "score": "0.56701636", "text": "function LoadingSpinner() {\n return (\n <div className='LoadingSpinner'>\n <Spinner\n color='success'\n style={{ height: '8rem', width: '8rem' }}\n />\n </div>\n );\n}", "title": "" }, { "docid": "e4836859618e6c4e264c373ae69393f7", "score": "0.56585413", "text": "function showSpinner() {\n $(options.selectors.placesContent).addClass('hidden');\n $(options.selectors.spinner).removeClass('hidden');\n }", "title": "" }, { "docid": "914adf1d578b1ea8dd9e97974ef93d57", "score": "0.5653953", "text": "function show_spinner() {\n jQuery(\".spinner\").removeClass(\"disp-block\");\n jQuery(\".spin_overlay\").removeClass(\"disp-block\");\n}", "title": "" }, { "docid": "69a1b142b89d6f3616b1426923f381df", "score": "0.5651427", "text": "function updateCurrentSpinner(number) {\n\tif (number === 1){\n\t\tfidget = 1;\n\t\tmoveAway(sceneRootSilver);\n\t\tmoveAway(sceneRootGreen);\n\t\tspinnerGreen.stopSpin();\n\t\tspinnerSilver.stopSpin();\n\t\tmoveToOrigin(sceneRootRed);\n\t\tstop();\n\t}\n\telse if (number === 2){\n\t\tfidget = 2;\n\t\tmoveAway(sceneRootRed);\n\t\tmoveAway(sceneRootGreen);\n\t\tspinnerGreen.stopSpin();\n\t\tspinnerRed.stopSpin();\n\t\tmoveToOrigin(sceneRootSilver);\n\t\tstop();\n\t}\n\telse if (number === 3){\n\t\tfidget = 3;\n\t\tmoveAway(sceneRootSilver);\n\t\tmoveAway(sceneRootRed);\n\t\tspinnerRed.stopSpin();\n\t\tspinnerSilver.stopSpin();\n\t\tmoveToOrigin(sceneRootGreen);\n\t\tstop();\n\t}\n\tisStopped = true;\n\tdocument.getElementById('button').innerHTML = \"START\";\n}", "title": "" }, { "docid": "ea9015a17ec8ccb20a801ce2dfcc7bcf", "score": "0.5637695", "text": "function SpinnyWait(container) {\n // jQuery div container\n this.c = $(container);\n\n this.progress_div = $('<div class=\"progress\" style=\"text-align: center;\"/>');\n this.progress_div.appendTo(this.c);\n this.progress_div.hide();\n\n this.loading_bar = $('<div class=\"progress-bar progress-bar-striped active\" \\\n role=\"progressbar\" \\\n aria-valuenow=\"100\" style=\"width: 100%\" \\\n aria-valuemin=\"0\" aria-valuemax=\"100\">\\\n message \\\n </div>');\n this.loading_bar.appendTo(this.progress_div);\n\n\n //\n // Functions\n //\n this.on = function(message) {\n this.loading_bar.text(message);\n this.progress_div.show();\n };\n\n this.off = function() {\n this.progress_div.hide();\n };\n\n this.remove = function() {\n this.progress_div.remove();\n };\n\n return this;\n}", "title": "" }, { "docid": "03c43cc5f980e51724784034410e91f6", "score": "0.5633628", "text": "function showProgressSpinner (status) {\n if(status.initialized){\n $(\"#atlas-deploy-progress-spinner\").show();\n // disable star button\n $(\"#action-btn\").prop(\"disabled\", true);\n } else {\n $(\"#atlas-deploy-progress-spinner\").hide();\n $(\"#action-btn\").prop(\"disabled\", false);\n }\n }", "title": "" }, { "docid": "3e1f5e5cd70dbb6b6c31636b30feae29", "score": "0.5622569", "text": "function Spinner(){\n const divSpinner = document.createElement('div');\n divSpinner.classList.add('sk-circle');\n\n divSpinner.innerHTML += `\n <div class=\"sk-circle1 sk-child\"></div>\n <div class=\"sk-circle2 sk-child\"></div>\n <div class=\"sk-circle3 sk-child\"></div>\n <div class=\"sk-circle4 sk-child\"></div>\n <div class=\"sk-circle5 sk-child\"></div>\n <div class=\"sk-circle6 sk-child\"></div>\n <div class=\"sk-circle7 sk-child\"></div>\n <div class=\"sk-circle8 sk-child\"></div>\n <div class=\"sk-circle9 sk-child\"></div>\n <div class=\"sk-circle10 sk-child\"></div>\n <div class=\"sk-circle11 sk-child\"></div>\n <div class=\"sk-circle12 sk-child\"></div>\n `;\n\n contenido.appendChild(divSpinner);\n}", "title": "" }, { "docid": "851c6e0ae54ab6732e0d17f3c76bcb2b", "score": "0.562244", "text": "function start_spinner() {\n hide_play_button();\n var spinner = document.getElementById('tv-spinner');\n spinner.classList.remove('paused');\n spinner.style.display = 'block';\n}", "title": "" }, { "docid": "476472b1addfec967af41bd8cbfb0ae8", "score": "0.56215614", "text": "function spinner(name) {\n\t\tvar fsm = spinnerByName[name];\n\t\tif (fsm) return fsm;\n\n\t\tvar spinner = {\n\n\t\t\tstopped: {\n\t\t\t\t$enter: function(cb) {\n\t\t\t\t\tspinner.qemit('stopped');\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\t\t\t\t\t\n\t\t\t\tstart: function(cb) {\n\t\t\t\t\tspinner.logger.log('starting', spinner.options.name);\n\t\t\t\t\tspinner.state = 'start';\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tstop: function(cb) {\n\t\t\t\t\tspinner.logger.log('already stopped');\n\t\t\t\t\tspinner.trigger('$enter');\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\t\t\t},\n\n\t\t\tstart: {\n\t\t\t\t$enter: function(cb) {\n\t\t\t\t\t\n\t\t\t\t\tfunction _findport(from, to, callback) {\n\t\t\t\t\t\tspinner.logger.log('looking for an available port in the range:', [from, to]);\n\t\t\t\t\t\treturn portscanner.findAPortNotInUse(from, to, 'localhost', function(err, port) {\n\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\tspinner.logger.error('unable to find available port for child', err);\n\t\t\t\t\t\t\t\treturn callback(err);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (port in usedPorts) {\n\t\t\t\t\t\t\t\tspinner.logger.log('Port ' + port + ' is already used, trying from ' + (port + 1));\n\t\t\t\t\t\t\t\treturn _findport(port + 1, to, callback);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tusedPorts[port] = true;\n\t\t\t\t\t\t\treturn callback(null, port);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t_findport(spinner.options.range[0], spinner.options.range[1], function(err, port) {\n\t\t\t\t\t\tif (err) return spinner.trigger('portNotFound');\n\t\t\t\t\t\telse return spinner.trigger('portAllocated', port);\n\t\t\t\t\t});\n\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tportNotFound: function(cb) {\n\t\t\t\t\tspinner.logger.error('out of ports... sorry... try again later');\n\t\t\t\t\tspinner.state = 'faulted';\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tportAllocated: function(cb, port) {\n\t\t\t\t\tspinner.logger.log('found port', port);\n\n\t\t\t\t\t// spawn the child process and store state\n\t\t\t\t\tspinner.port = port;\n\t\t\t\t\tspinner.logger.info('spawn', spinner.options.command, spinner.options.args);\n\t\t\t\t\tvar env = spinner.options.env || {};\n\t\t\t\t\tenv.port = env.PORT = spinner.port;\n\t\t\t\t\tvar cwd = spinner.options.cwd;\n\t\t\t\t\tspinner.child = spawn(spinner.options.command, spinner.options.args, { env: env, cwd: cwd });\n\t\t\t\t\tspinner.child.on('exit', function(code, signal) { return spinner.trigger('term', code, signal); });\n\t\t\t\t\tspinner.child.stdout.on('data', function(data) { return spinner.emit('stdout', data); });\n\t\t\t\t\tspinner.child.stderr.on('data', function(data) { return spinner.emit('stderr', data); });\n\n\t\t\t\t\t// pipe stdout/stderr if requested \n\t\t\t\t\t// keep the original streams opened after close event \n\t\t\t\t\t// as of node 0.6+ process.stdout.end() throws\n\t\t\t\t\tif (spinner.options.stdout) spinner.child.stdout.pipe(spinner.options.stdout, { end: false });\n\t\t\t\t\tif (spinner.options.stderr) spinner.child.stderr.pipe(spinner.options.stderr, { end: false });\n\n\t\t\t\t\tspinner.state = 'wait';\n\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tstart: function(cb) {\n\t\t\t\t\tspinner.logger.log('start already pending');\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tterm: 'faulted',\n\t\t\t},\n\n\t\t\twait: {\n\t\t\t\t$enter: function(cb) {\n\t\t\t\t\tspinner.logger.log('waiting for port ' + spinner.port + ' to be bound');\n\t\t\t\t\tspinner.wait.tries = spinner.options.timeout * 2;\n\t\t\t\t\tspinner.wait.backoff = 500;\n\n\t\t\t\t\t// will begin scanning\n\t\t\t\t\tspinner.trigger('wait');\n\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\twait: function(cb) {\n\t\t\t\t\tspinner.logger.log('checking status of port ' + spinner.port, 'tries left:', spinner.wait.tries);\n\n\t\t\t\t\tif (spinner.wait.tries-- === 0) {\n\t\t\t\t\t\tspinner.logger.warn('timeout waiting for port');\n\t\t\t\t\t\treturn spinner.trigger('waitTimeout');\n\t\t\t\t\t}\n\n\t\t\t\t\tportscanner.checkPortStatus(spinner.port, 'localhost', function(err, status) {\n\t\t\t\t\t\tspinner.logger.log('status is', status);\n\t\t\t\t\t\tif (status === \"open\") return spinner.trigger(\"opened\");\n\t\t\t\t\t\telse return spinner.waitTimeout = spinner.timeout(\"wait\", spinner.wait.backoff);\n\t\t\t\t\t});\n\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tterm: function(cb) {\n\t\t\t\t\tspinner.logger.error('process terminated while waiting');\n\t\t\t\t\tspinner.state = 'faulted';\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\twaitTimeout: function(cb) {\n\t\t\t\t\tspinner.logger.error('timeout waiting for port ' + spinner.port);\n\t\t\t\t\tspinner.child.kill();\n\t\t\t\t\tspinner.state = 'faulted';\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\topened: function(cb) {\n\t\t\t\t\tspinner.logger.log('port ' + spinner.port + ' opened successfuly');\n\t\t\t\t\tspinner.state = 'started';\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tstart: function(cb) {\n\t\t\t\t\tspinner.logger.log('start already pending');\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tstop: function(cb) {\n\t\t\t\t\tspinner.logger.log('stop waiting for child to start');\n\t\t\t\t\tspinner.state = 'stop';\n\t\t\t\t\tcb();\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t$exit: function(cb) {\n\t\t\t\t\tif (spinner.waitTimeout) {\n\t\t\t\t\t\tspinner.logger.log('clearing wait timeout');\n\t\t\t\t\t\tclearTimeout(spinner.waitTimeout);\n\t\t\t\t\t}\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\t\t\t},\n\n\t\t\tfaulted: {\n\t\t\t\t$enter: function(cb) {\n\t\t\t\t\tspinner._cleanup();\n\n\t\t\t\t\tspinner.faulted.count = spinner.faulted.count ? spinner.faulted.count + 1 : 1;\n\t\t\t\t\tspinner.logger.warn('faulted (' + spinner.faulted.count + '/' + spinner.options.attempts + ')');\n\n\t\t\t\t\tif (spinner.faulted.count > spinner.options.attempts) {\n\t\t\t\t\t\tspinner.logger.error('fault limit reached. staying in \"faulted\" state');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tspinner.logger.log('moving to stopped state');\n\t\t\t\t\t\tspinner.state = 'stopped';\n\t\t\t\t\t}\n\n\t\t\t\t\tspinner.qemit('error', new Error(\"unable to start child process\"));\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tstop: function(cb) {\n\t\t\t\t\tspinner.logger.log('moving to stop after faulted');\n\t\t\t\t\tspinner.state = 'stopped';\n\t\t\t\t\tspinner.faulted.count = 0; // reset fault caount\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tstart: function(cb) {\n\t\t\t\t\tspinner.qemit('error', new Error('start failed to start for ' + spinner.options.attempts + ' times, stop before start'));\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\t'.*': function(cb, e) {\n\t\t\t\t\tspinner.logger.error(e, 'triggered while in start-fault');\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\t\t\t},\n\t\t\t\n\t\t\tstarted: {\n\t\t\t\t$enter: function(cb, prev) {\n\n\t\t\t\t\t// start file monitor, if defined\n\t\t\t\t\tif (spinner.options.monitor) {\n\t\t\t\t\t\tif (!spinner.watch) {\n\t\t\t\t\t\t\tspinner.watch = fs.watch(spinner.options.monitor, function(event) {\n\t\t\t\t\t\t\t\tspinner.trigger('changed');\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// do not emit 'started' if we came from the same state\n\t\t\t\t\tif (spinner.started.emit) {\n\t\t\t\t\t\tspinner.qemit(spinner.started.emit, spinner.port);\n\t\t\t\t\t\tdelete spinner.started.emit;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tspinner.qemit('started', spinner.port);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tstart: function(cb) {\n\t\t\t\t\tspinner.logger.log('already started');\n\t\t\t\t\tspinner.trigger('$enter');\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tstop: function(cb) {\n\t\t\t\t\tspinner.logger.log('stopping');\n\t\t\t\t\tspinner.state = 'stop'\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tterm: function(cb) {\n\t\t\t\t\tspinner.logger.warn('child terminated unexpectedly, restarting');\n\t\t\t\t\tspinner.state = \"restart\";\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tchanged: function(cb) {\n\t\t\t\t\tspinner.logger.log('\"' + spinner.options.monitor + '\"', 'changed');\n\t\t\t\t\t\n\t\t\t\t\t// restart the child (bruite force for now)\n\t\t\t\t\tspinner.child.kill();\n\t\t\t\t\tspinner.state = \"restart\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\t$exit: function(cb) {\n\n\t\t\t\t\t// stop file watch\n\t\t\t\t\tif (spinner.watch) {\n\t\t\t\t\t\tspinner.watch.close();\n\t\t\t\t\t\tspinner.watch = null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// helper function that cleans up the spinner in case we killed the process\n\t\t\t_cleanup: function() {\n\t\t\t\tspinner.child.removeAllListeners();\n\t\t\t\tspinner.child = null;\n\t\t\t\tdelete usedPorts[spinner.port];\n\t\t\t\tspinner.port = null;\n\t\t\t},\n\n\t\t\tstop: {\n\t\t\t\t$enter: function(cb) {\n\t\t\t\t\tspinner.child.kill();\n\t\t\t\t\tspinner.stop.timeout = spinner.timeout('stopTimeout', spinner.options.stopTimeout * 1000);\n\t\t\t\t\tcb();\n\t\t\t\t},\n\n\t\t\t\tterm: function(cb, status) {\n\t\t\t\t\tspinner.logger.log('exited with status', status);\n\t\t\t\t\tspinner.exitStatus = status;\n\t\t\t\t\tspinner.state = 'stopped';\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\tstopTimeout: function(cb) {\n\t\t\t\t\tspinner.logger.log('stop timeout. sending SIGKILL');\n\t\t\t\t\tspinner.child.kill('SIGKILL');\n\t\t\t\t\tspinner.state = 'stopped';\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\n\t\t\t\t$exit: function(cb) {\n\t\t\t\t\tspinner.logger.log('cleaning up');\n\t\t\t\t\tclearTimeout(spinner.stop.timeout);\n\t\t\t\t\tspinner._cleanup();\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\t\t\t},\n\n\t\t\trestart: {\n\t\t\t\t$enter: function(cb) {\n\t\t\t\t\tspinner.logger.log('restarting');\n\t\t\t\t\tspinner._cleanup();\n\t\t\t\t\tspinner.state = 'start';\n\t\t\t\t\tspinner.started.emit = \"restarted\";\n\t\t\t\t\treturn cb();\n\t\t\t\t},\n\t\t\t},\n \n \t\t\tassert: function(cb, err) {\n\t\t\t\tspinner.logger.error('assertion', err);\n\t\t\t\treturn cb();\n\t\t\t},\n\t\t};\n\n\t\treturn spinnerByName[name] = fsmjs(spinner);\n\t}", "title": "" }, { "docid": "4702efb2a2b37e22776ddb7c7de2b83b", "score": "0.5612775", "text": "function enableSpinner() {\n if (isDataTableInit) {\n cloudIcon.removeClass('fa-cloud').addClass('fa-spinner fa-spin');\n }\n}", "title": "" }, { "docid": "debbc7bce455f0b480feee8840b0f535", "score": "0.5587538", "text": "function show_throbber() {\n\t\tjQuery('#datepicker-loading-spinner').css('display', '');\n\t}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "732ff5b7cc87a1a41a953c17ad518553", "score": "0.55705726", "text": "function spinner_modifier( fn ) {\n\treturn function() {\n\t\tvar previous = this.element.val();\n\t\tfn.apply( this, arguments );\n\t\tthis._refresh();\n\t\tif ( previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\t};\n}", "title": "" }, { "docid": "9b8f4922efea9d596c9cdba0119a3706", "score": "0.5562374", "text": "function addCameraSpinner( ) {\n var ph = $( \"figure > .icon\" );\n ph.setStyle( \"background\", \"url(img/bars.gif) no-repeat scroll center center\" );\n return false;\n }", "title": "" }, { "docid": "d829f8ec61c41d8eaaa5c1622ad690da", "score": "0.5542297", "text": "function addSpinner (spinnerId) {\n\t\t\tspinner = new CanvasLoader(spinnerId);\n\t\t\tspinner.setShape(\"spiral\");\n\t\t\tspinner.setDiameter(90);\n\t\t\tspinner.setDensity(90);\n\t\t\tspinner.setRange(1);\n\t\t\tspinner.setSpeed(4);\n\t\t\tspinner.setColor(spinnerColor);\n\t\t\t// As its hidden and not rendering by default we have to call its show() method\n\t\t\tspinner.show();\n\t\t\t// We use the jQuery fadeIn method to slowly fade in the preloader\n\t\t\t$this.find(\".spinner\").fadeIn(\"slow\");\n\t\t}", "title": "" }, { "docid": "5fc801a4abd894d8afcb69c5b84e7691", "score": "0.5538018", "text": "showSpinner() {\n const el = this.getSpinnerElement();\n if (el) {\n el.style['display'] = 'block';\n }\n }", "title": "" }, { "docid": "706d7e4d249e340d9af66ec81353abdf", "score": "0.5530945", "text": "function showSpinnerForUploadFile () {\n\tvar target = document.getElementById('spinner');\n\tobjOdata.spinner = new Spinner(opts).spin(target);\n\treturn objOdata.spinner;\n}", "title": "" }, { "docid": "2e1f172dc29c4c3788e13cd9eec89778", "score": "0.55055296", "text": "function spinner(plu, id, name, price, crop, crop2, margintop){\n\t\t\n\t\twindow.margin = margintop;\n\t\t\n\t\t// VARS\n\t\t// -- PLU is the ProductID and the Hidden form is used globally\t\n\t\tvar num;\t\n\t\tvar plu = \"\"+plu; // Convert Str to Int\n\t\tif (plu.length < 6) {\n\t\t\t\tplu = \"0\"+plu;\n\t\t}\n\t\tvar linkbtn = jQuery(\"a.productLink\");\n\t\t\n\t\tjQuery('.productKOTText').fadeOut(750).delay(750);\n\t\tjQuery('.productKOTText').html(''+name+'<br />'+price+'');\t\t\n\t\tjQuery('.productKOTText').fadeIn(1573);\t\t\n\t\tjQuery(linkbtn).fadeOut(750).delay(750);\n\t\tjQuery(linkbtn).attr(\"href\", \"http://www.jdsports.co.uk/product/\"+plu+\"\").attr('manual_cm_re','GiftShop-_-ProductSlider-_-'+plu+'');\n\t\tjQuery(linkbtn).fadeIn(1573);\t\t\n\t\tsetUpImageNavigation(plu, crop2, margintop);\n\n\t}", "title": "" }, { "docid": "88ea51666d2b095c197c5f0562d14992", "score": "0.54988486", "text": "function hideSpinner() {\n // Hide the spinner\n $('.kintone-spinner').hide();\n }", "title": "" }, { "docid": "a6fe0fe62f7f1067e0e952b46fe74a33", "score": "0.54969203", "text": "function spinner() {\n\t\t$(\".spinner\").hide();\n\n\t\t$(document).ajaxStart(function(){\n\t\t\t$(\".spinner\").fadeIn();\n\t\t\t$(\"#awfs-suc-war-err-container\").hide();\n\t\t});\n\n\t\t$(document).ajaxStop(function(){\n\t\t\t$(\".spinner\").fadeOut();\n\t\t\t$(\"#awfs-suc-war-err-container\").fadeIn();\n\t\t});\n\t}", "title": "" }, { "docid": "6bd132d286aecac75f1124e91cc893ab", "score": "0.5491571", "text": "buildLoadingIndicator_() {\n const loadingContainer = this.loadingContainer_;\n this.container_.appendChild(loadingContainer);\n\n // Add 4 vertical bars animated at different rates, as defined in the\n // style.\n for (let i = 0; i < 4; i++) {\n const loadingBar = this.document_.createElement('swg-loading-bar');\n loadingContainer.appendChild(loadingBar);\n }\n }", "title": "" }, { "docid": "1787d668170fbf73dbacae24db218c25", "score": "0.5484937", "text": "function spinner_after_button(selector) {\n\t$(selector).after('<img class=\"spinner\" src=\"/assets/smallspinner.gif\" />');\n}", "title": "" }, { "docid": "fe361e1918ed44f04fd51f10a612daff", "score": "0.5482175", "text": "toggleSpinner() {\n this.showSpinner = !this.showSpinner;\n }", "title": "" }, { "docid": "4b6658ed7fa495b9b58415ac73198134", "score": "0.5481131", "text": "function JQuerySpin($6my,jQuerySpin$){\n $init$JQuerySpin();\n if(jQuerySpin$===undefined)jQuerySpin$=new JQuerySpin.$$;\n jQuerySpin$.$6my_=$6my;\n JQuerySpinAbs(jQuerySpin$);\n \n //AttributeDecl native at jqueryspin.ceylon (78:1-78:29)\n jQuerySpin$.$prop$getNative={$crtmm$:function(){return{mod:$CCMM$,$t:{t:m$6mi.Anything},$cont:JQuerySpin,$an:function(){return[m$6mi.shared(),m$6mi.actual()];},d:['com.openswimsoftware.ceylon.examples.photogallery','JQuerySpin','$at','native']};}};\n /*BEG dynblock*/\n jQuerySpin$.$_native=jQuerySpin$.$6my;/*END dynblock*/\n return jQuerySpin$;\n}", "title": "" }, { "docid": "e9dea4ec6e45090642281adf3719e01c", "score": "0.54739636", "text": "function useSpinner(increment, decrement) {\n /**\n * To keep incrementing/decrementing on press, we call that `spinning`\n */\n var [isSpinning, setIsSpinning] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); // This state keeps track of the action (\"increment\" or \"decrement\")\n\n var [action, setAction] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); // To increment the value the first time you mousedown, we call that `runOnce`\n\n var [runOnce, setRunOnce] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true); // Store the timeout instance id in a ref, so we can clear the timeout later\n\n var timeoutRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); // Clears the timeout from memory\n\n var removeTimeout = () => clearTimeout(timeoutRef.current);\n /**\n * useInterval hook provides a performant way to\n * update the state value at specific interval\n */\n\n\n (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_1__.useInterval)(() => {\n if (action === \"increment\") {\n increment();\n }\n\n if (action === \"decrement\") {\n decrement();\n }\n }, isSpinning ? CONTINUOUS_CHANGE_INTERVAL : null); // Function to activate the spinning and increment the value\n\n var up = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {\n // increment the first fime\n if (runOnce) {\n increment();\n } // after a delay, keep incrementing at interval (\"spinning up\")\n\n\n timeoutRef.current = setTimeout(() => {\n setRunOnce(false);\n setIsSpinning(true);\n setAction(\"increment\");\n }, CONTINUOUS_CHANGE_DELAY);\n }, [increment, runOnce]); // Function to activate the spinning and increment the value\n\n var down = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {\n // decrement the first fime\n if (runOnce) {\n decrement();\n } // after a delay, keep decrementing at interval (\"spinning down\")\n\n\n timeoutRef.current = setTimeout(() => {\n setRunOnce(false);\n setIsSpinning(true);\n setAction(\"decrement\");\n }, CONTINUOUS_CHANGE_DELAY);\n }, [decrement, runOnce]); // Function to stop spinng (useful for mouseup, keyup handlers)\n\n var stop = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {\n setRunOnce(true);\n setIsSpinning(false);\n removeTimeout();\n }, []);\n /**\n * If the component unmounts while spinning,\n * let's clear the timeout as well\n */\n\n (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_2__.useUnmountEffect)(removeTimeout);\n return {\n up,\n down,\n stop\n };\n}", "title": "" }, { "docid": "99af55f265d02d46371620622eea6054", "score": "0.5461094", "text": "function LoadSpinner() {\n return (\n <div className=\"LoadSpinner\">\n <div className=\"spinner\"></div>\n </div>\n );\n}", "title": "" }, { "docid": "ff744bbcb6271ad7d519d335ceb1000f", "score": "0.5459749", "text": "function useSpinner(increment, decrement) {\n /**\n * To keep incrementing/decrementing on press, we call that `spinning`\n */\n var [isSpinning, setIsSpinning] = (0, _react.useState)(false); // This state keeps track of the action (\"increment\" or \"decrement\")\n\n var [action, setAction] = (0, _react.useState)(null); // To increment the value the first time you mousedown, we call that `runOnce`\n\n var [runOnce, setRunOnce] = (0, _react.useState)(true); // Store the timeout instance id in a ref, so we can clear the timeout later\n\n var timeoutRef = (0, _react.useRef)(null); // Clears the timeout from memory\n\n var removeTimeout = () => clearTimeout(timeoutRef.current);\n /**\n * useInterval hook provides a performant way to\n * update the state value at specific interval\n */\n\n\n (0, _hooks.useInterval)(() => {\n if (action === \"increment\") {\n increment();\n }\n\n if (action === \"decrement\") {\n decrement();\n }\n }, isSpinning ? CONTINUOUS_CHANGE_INTERVAL : null); // Function to activate the spinning and increment the value\n\n var up = (0, _react.useCallback)(() => {\n // increment the first fime\n if (runOnce) {\n increment();\n } // after a delay, keep incrementing at interval (\"spinning up\")\n\n\n timeoutRef.current = setTimeout(() => {\n setRunOnce(false);\n setIsSpinning(true);\n setAction(\"increment\");\n }, CONTINUOUS_CHANGE_DELAY);\n }, [increment, runOnce]); // Function to activate the spinning and increment the value\n\n var down = (0, _react.useCallback)(() => {\n // decrement the first fime\n if (runOnce) {\n decrement();\n } // after a delay, keep decrementing at interval (\"spinning down\")\n\n\n timeoutRef.current = setTimeout(() => {\n setRunOnce(false);\n setIsSpinning(true);\n setAction(\"decrement\");\n }, CONTINUOUS_CHANGE_DELAY);\n }, [decrement, runOnce]); // Function to stop spinng (useful for mouseup, keyup handlers)\n\n var stop = (0, _react.useCallback)(() => {\n setRunOnce(true);\n setIsSpinning(false);\n removeTimeout();\n }, []);\n /**\n * If the component unmounts while spinning,\n * let's clear the timeout as well\n */\n\n (0, _react.useEffect)(() => {\n return () => {\n removeTimeout();\n };\n }, []);\n return {\n up,\n down,\n stop\n };\n}", "title": "" }, { "docid": "091d96c2e3979d6a1e72558d4483298a", "score": "0.5452804", "text": "function spinner_on(tab) {\n console.log(\"Spinner on: \" + tab);\n $(\"#spinner_\" + tab).css('visibility', 'visible');\n}", "title": "" }, { "docid": "7ba31dbb6e263bffc14cf76fbd822d10", "score": "0.54409415", "text": "renderButtonORSpinner(){\n //if loading is true return spinner with the prop of small\n if (this.state.loading){\n return <Spinner size='small'/>\n }\n\n //otherwise loading must be false so return the button\n return (\n <Button onPress={this.onButtonPress.bind(this)}>\n Log In\n </Button>\n )\n \n }", "title": "" }, { "docid": "45ecb4351c486e0e022d9ae1d8dc6184", "score": "0.5429136", "text": "renderSpinner() {\n\t\tconst markup = `\n <div class=\"spinner\">\n <svg>\n <use href=\"${icons}#icon-loader\"></use>\n </svg>\n </div>`;\n\n\t\t// DOES => Empties recipe container before inserting spinner markup\n\t\tthis._clear();\n\t\tthis._parentElement.insertAdjacentHTML(\"afterbegin\", markup);\n\t}", "title": "" }, { "docid": "19da069a47f207317f9ca8096964e2de", "score": "0.5422816", "text": "function showLoadingSpinner() {\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "title": "" }, { "docid": "8b90c57aed66637b0617cf8bd1068f94", "score": "0.5418672", "text": "function spinner() {\n var list = $id('List');\n if (list) {\n list.style.display = \"none\";\n\n //get other items associated with it and set them to none display\n $id('Main-listing-header').style.display = \"none\";\n $id('Tools-menu').style.display = \"none\";\n var footer = document.getElementsByClassName('Main-Footer')[0];\n if (footer) {\n footer.style.display = \"none\";\n }\n var h1 = document.createElement('h1');\n h1.className = 'spinny';\n h1.innerHTML = '<span class=\"spinny-vinny\">\\xAF_\\u30C4_/\\xAF</span>';\n $id('Main-container').appendChild(h1);\n } else {\n $id('main').innerHTML = '<h1 class=\"spinny><span class=\"spinny-vinny\">\\xAF_\\u30C4_/\\xAF</span></h1>\"';\n }\n}", "title": "" }, { "docid": "ff08d8e20aa65157eb549440fb201239", "score": "0.54112834", "text": "function activarSpinner() {\n\n\tdocument.querySelector(\"#progreso\").innerHTML = \"<progress></progress>\";\n\n}", "title": "" }, { "docid": "df276f5e6c8563b99f22fb8b0df725dc", "score": "0.5405917", "text": "function toggle_spinner(link){\n jQuery(\"#spinner,#anatext_submit_button\").toggle()\n}", "title": "" }, { "docid": "49c38204761f600d97139593c2d98562", "score": "0.5402182", "text": "loader() {\n const spinner = document.querySelector('#spinning');\n\n if(spinner) {\n spinner.style.display = 'block';\n } \n }", "title": "" } ]
4c9f1c79082bd97f86602d0fadcd6920
Called at startup to retrieve course objects from the localStorage then calls createCourse to create the DOM objects
[ { "docid": "99a81ddb56b9319f93014001dd5086f8", "score": "0.6370679", "text": "function loadCourseItems(id) {\n var course = JSON.parse(localStorage.getItem(id)),\n newCourse = {};\n\n // restore as a Course object\n course.__proto__ = Course.prototype;\n course.restoreAssessments();\n\n newCourse = createCourse(course);\n\n for (var i = 0, len = course.assessments.length; i < len; i ++) {\n var assessment = course.assessmentMap[course.assessments[i]],\n assessmentItem = createAssessment(assessment);\n \n newCourse.find(\".assessments-container\").append(assessmentItem);\n }\n }", "title": "" } ]
[ { "docid": "7027c0c2af3d9b43550a4746a016da64", "score": "0.7022246", "text": "function loadCourseData() {\n // All code that needs to run before adapt starts should go here \n var courseFolder = \"course/\" + Adapt.config.get('_defaultLanguage')+\"/\";\n\n Adapt.course = new CourseModel(null, {url:courseFolder + \"course.json\", reset:true});\n \n Adapt.contentObjects = new AdaptCollection(null, {\n model: ContentObjectModel,\n url: courseFolder +\"contentObjects.json\"\n });\n \n Adapt.articles = new AdaptCollection(null, {\n model: ArticleModel,\n url: courseFolder + \"articles.json\"\n });\n \n Adapt.blocks = new AdaptCollection(null, {\n model: BlockModel,\n url: courseFolder + \"blocks.json\"\n });\n \n Adapt.components = new AdaptCollection(null, {\n model: ComponentModel,\n url: courseFolder + \"components.json\"\n });\n }", "title": "" }, { "docid": "bb79ed33b8086f92ded87fde0cdd58fe", "score": "0.6631656", "text": "function initCourse() {\n \n // set workDir\n workDir=new String(top.document.location);\n launchPath=((courseDir==\"\") ? launchFile : courseDir + \"/\" + launchFile);\n workDir=workDir.substring(0,workDir.lastIndexOf(launchPath)-1); \n \n setShowAllCookie(false);\n \n // Remove all the navigation\n if (hasRule(\"-nav\")) {\n showAll=true;\n auxWindow.tool=\"\";\n showContents=false;\n showAssessment=false;\n showBookmarks=false;\n showNextPrev=false;\n showSearch=false;\n showHome=false;\n showIndex=false;\n showPartfile=false;\n showGlossary=false;\n toolbar.pageNumbers=false;\n }\n \n // Remove all the navigation except next and prev buttons\n if (hasRule(\"-nav_nextprev\")) {\n showNextPrev=true;\n showAll=true;\n auxWindow.tool=\"\";\n showContents=false;\n showAssessment=false;\n showBookmarks=false;\n showSearch=false;\n showHome=false;\n showIndex=false;\n showPartfile=false;\n showGlossary=false; \n }\n \n // Turn on/off the page numbers\n if (hasRule(\"-pgnum\")) {\n toolbar.pageNumbers=false;\n } else if (hasRule(\"+pgnum\")) {\n toolbar.pageNumbers=true;\n }\n \n // If the \"-aux\" rule is set then reset the tool to \"\".\n if (hasRule(\"-aux\")) auxWindow.tool=\"\";\n \n // See if the home icon should be displayed.\n if (hasRule(\"-home\")) showHome=false;\n \n var bookmarkConfig= {\n targetFrame : \"top.content.main\",\n toolFrame : \"top.content.aux.aux_main\",\n ids : new Array(courseId),\n titles : new Array(courseName),\n workDir : workDir,\n project : project,\n type : \"topicSet\",\n launchFile : launchFile\n }\n \n bookmarkTool=new Bookmarks(bookmarkConfig);\n \n }", "title": "" }, { "docid": "889e22c308cad9fbb9a980819597b6db", "score": "0.66254956", "text": "function addCourseHandler() {\n var course = new Course(\"\", \"\");\n\n if (hasStorageSupport) saveToStorage(course.id, course);\n\n createCourse(course);\n }", "title": "" }, { "docid": "a1c30f1afb7beec81544e3f54521f12f", "score": "0.63854855", "text": "function saveCourseLocalStorage(course) {\r\n let courses;\r\n courses = getCoursesLocalStorage();\r\n courses.push(course);\r\n localStorage.setItem('courses', JSON.stringify(courses));\r\n}", "title": "" }, { "docid": "4ace1b1f2e80df163de9a1c8fc059333", "score": "0.6154935", "text": "function getCoursesLocalStorage() {\r\n let courseLS;\r\n if (localStorage.getItem('courses') === null) {\r\n courseLS = [];\r\n }\r\n else\r\n {\r\n courseLS = JSON.parse(localStorage.getItem('courses'));\r\n }\r\n return courseLS;\r\n}", "title": "" }, { "docid": "df1c48c5e79ba7361be3c0b9c35e2059", "score": "0.61266935", "text": "function getFromLocalStorage() {\n let coursesLS = getCoursesFromStorage();\n coursesLS.forEach(function (course) {\n //create the <tr></tr>\n const row = document.createElement(\"tr\");\n //build the template\n row.innerHTML = `\n <tr>\n <td>\n <img src=\"${course.image}\" width=100>\n </td>\n <td>\n ${course.title}\n </td>\n <td>\n ${course.price}\n </td>\n <td>\n <a href=\"#\" class=\"remove\" data-id=${course.id}>X</a>\n </td>\n </tr>\n `;\n //Add into the shopping shoppingCart\n shoppingCartContent.appendChild(row);\n });\n}", "title": "" }, { "docid": "7a8efdab5a1b9ec67e8c281c43e2aa8e", "score": "0.60548913", "text": "function readLocalStorage() {\r\n let coursesLS;\r\n coursesLS = getCoursesLocalStorage();\r\n coursesLS.forEach(function(course) {\r\n const row = document.createElement('tr');\r\n row.innerHTML = `\r\n <td>\r\n <img src=\"${course.image}\" width=100%>\r\n </td>\r\n <td>${course.title}</td>\r\n <td>${course.price}</td>\r\n <td><a href=\"#\" class=\"delete-course\" data-id=\"${course.id}\">X</a></td>\r\n `;\r\n list.appendChild(row);\r\n });\r\n}", "title": "" }, { "docid": "132ef35384b7fb9f25b054834c76ec86", "score": "0.60547155", "text": "function saveIntoStorage(course) {\n let courses = getCoursesFromStorage();\n //Add the course into the array\n courses.push(course);\n //Since storage only saves strings, we need to convert JSON into strings\n localStorage.setItem(\"courses\", JSON.stringify(courses));\n}", "title": "" }, { "docid": "03e3b6c8154791a71d1208d9e6a26b05", "score": "0.6020122", "text": "function saveIntoStorage(course) {\n let courses = getCoursesFromStorage();\n\n courses.push(course);\n //since storage only saves strings\n localStorage.setItem(\"courses\", JSON.stringify(courses));\n}", "title": "" }, { "docid": "c41f6eeafa5fe779f4db90d63c8df49e", "score": "0.59816647", "text": "function saveIntoStorage(course) {\n let courses = getCoursesFromStorage();\n //add courses into array\n courses.push(course);\n //convert JSON into string because storage le chai string ma matra save garx\n localStorage.setItem(\"courses\", JSON.stringify(courses));\n}", "title": "" }, { "docid": "9a7745a53699c001ed12260b1cec1a00", "score": "0.5978382", "text": "initCourse() {\n scormVars.lmsConnected = scormVars.scorm.init();\n scormVars.lessonStatus = scormVars.scorm.get('cmi.core.lesson_status');\n scormVars.scormEntry = scormVars.scorm.get('cmi.core.entry');\n \n if (scormVars.lmsConnected) {\n scormFunctions.getStudentName();\n\n if (scormVars.lessonStatus === 'completed' || scormVars.lessonStatus === 'passed') {\n alert('You have already finished this lesson. \\nYou do not have to do it again.');\n }\n \n else {\n scormFunctions.setWelcomeMessage();\n\n if (scormVars.scormEntry !== 'ab-initio') {\n scormFunctions.loadSuspendData();\n }\n }\n }\n \n else {\n alert('Could not connect to the LMS!');\n }\n\n init();\n }", "title": "" }, { "docid": "0c679904284a98c450808a8bab1f84fb", "score": "0.5971453", "text": "function qodeOnDocumentReady() {\n\t qodeInitCoursePopup();\n\t qodeInitCoursePopupClose();\n\t qodeCompleteItem();\n\t qodeCourseAddToWishlist();\n\t qodeRetakeCourse();\n\t qodeSearchCourses();\n\t qodeInitCourseList();\n\t qodeInitAdvancedCourseSearch();\n }", "title": "" }, { "docid": "462a94c4c8048c4abbc28aed5b1ad305", "score": "0.5961746", "text": "function init() {\n// Get stored cities from localStorage\nvar storedCities = JSON.parse(localStorage.getItem(\"cityName\"));\n\n// If cities were retrieved from localStorage\nif (storedCities !== null) {\n cityNames = storedCities;\n}\n\n// This is a helper function that will render cities to the DOM\nrenderCities();\n}", "title": "" }, { "docid": "9b8cf388646c857c2720ec4a47c30d0e", "score": "0.5933078", "text": "function getFromLocalStorage() {\n let coursesLS = getCoursesFromStorage();\n //LOOP THROUGH COURSES AND PRINT INTIO CART\n coursesLS.forEach(function(course) {\n const row = document.createElement(\"tr\");\n\n row.innerHTML = `\n <tr>\n <td> <img src=\"${course.image}\"></td>\n <td>${course.title}</td>\n <td>${course.price}</td>\n <td><a href =\"#\" class=\"remove\" data-id=\"${\n course.id\n }\">X</td>\n </tr>\n `;\n shoppingCartContent.appendChild(row);\n });\n}", "title": "" }, { "docid": "ddcee49612185d9ee294d0192788fdca", "score": "0.5912593", "text": "function getFromLocalStorage() {\n let coursesLS = getCoursesFromStorage();\n //loop through the courses and print into the cart\n coursesLS.forEach(function(course) {\n const row = document.createElement(\"tr\")\n\n row.innerHTML = `\n <tr>\n <td>\n <img src=\"${course.image}\" width=100>\n </td>\n <td>${course.title}</td>\n <td>${course.price}</td>\n <td>\n <a href=\"\" class=\"remove\" data-id=\"${course.id}\">X</a>\n </td>\n </tr>\n `\n shoppingCartContent.appendChild(row);\n })\n}", "title": "" }, { "docid": "a76b5451cd4323f4ce2959240cb3c2ab", "score": "0.58980846", "text": "function init(){\n renderCurrentDayDisplay();\n assignColorClasses();\n renderTextareas();\n renderIcons();\n\n // Get schedule from localStorage\n var storedScheduling = JSON.parse(localStorage.getItem(\"scheduling\"));\n // If schedule appointments were retrieved from localStorage, update the scheduling object to it\n if (storedScheduling !== null) {\n scheduling = storedScheduling;\n }\n\n // Render schedule to the DOM\n renderSchedule();\n}", "title": "" }, { "docid": "ec3245210dd86cc12fac924a6d44a652", "score": "0.5859514", "text": "function createCourses(){\n var a = [];\n var tem = schedule(createBlocks);\n var coloring = tem[0];\n var free = tem[1];\n for (var el in coloring) {\n var courses = coloring[el];\n for (var i=0, crn; crn=courses[i]; i++) {\n a.push(crn);\n courseObjList[crn]['color'] = el;\n }\n }\n for (var i=0, crn; crn=free[i]; i++) {\n a.push(crn);\n courseObjList[crn]['color'] = 0;\n }\n var cards = createCourseCards(a);\n addToContainer(cards, document.getElementById('course-list'));\n}", "title": "" }, { "docid": "9ecc66d7d8dee12e26df0a90eb3aa23b", "score": "0.5856556", "text": "function initializeLibrary () {\n let book = new Book();\n\n book.title = 'The Hobbit';\n book.author = 'J.R.R Tolkien';\n book.pages = '295';\n book.description = \"Gandalf tricks Bilbo Baggins into hosting a party for Thorin Oakenshield and his band of dwarves, who sing of reclaiming the Lonely Mountain and its vast treasure from the dragon Smaug. When the music ends, Gandalf unveils Thrór's map showing a secret door into the Mountain and proposes that the dumbfounded Bilbo serve as the expedition's \\\"burglar\\\". The dwarves ridicule the idea, but Bilbo, indignant, joins despite himself. \"\n book.read = 'read';\n book.cover = 'https://upload.wikimedia.org/wikipedia/en/4/4a/TheHobbit_FirstEdition.jpg'\n\n let myLibrary = [];\n\n myLibrary.push(book);\n\n localStorage.setItem('myLibrary', JSON.stringify(myLibrary));\n\n render()\n}", "title": "" }, { "docid": "ccffc9b314bb88cb86d3debde43925a8", "score": "0.5845285", "text": "function onLoad() {\n setLocalStorage();\n renderLocalStorageAsIdeas();\n}", "title": "" }, { "docid": "b795fc7e49a6c52a78f0d2db752b5c28", "score": "0.58406395", "text": "function showCourseDesigner() {\n hideAllPanels();\n\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n var errArea = document.getElementById(\"ErrAllCourses\");\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var hasCourses = false;\n courseList = web.get_lists().getByTitle('TrainingCourse');\n moduleList = web.get_lists().getByTitle('Module');\n topicList = web.get_lists().getByTitle('Topic');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = courseList.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n\n // Success returned from executeQueryAsync\n // Remove all nodes from the course <DIV> so we have a clean space to write to\n var courseTable = document.getElementById(\"AllCoursesList\");\n while (courseTable.hasChildNodes()) {\n courseTable.removeChild(courseTable.lastChild);\n }\n\n // Iterate through the Course list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Create a DIV to display the course name \n var course = document.createElement(\"div\");\n var courseLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n course.appendChild(courseLabel);\n\n // Add an ID to the course DIV\n course.id = listItem.get_id();\n\n // Add an class to the lead DIV\n course.className = \"item\";\n\n // Add an onclick event to show the lead details\n $(course).click(function (sender) {\n showCourseDetails(sender.target.id);\n });\n\n // Add the lead div to the UI\n courseTable.appendChild(course);\n hasCourses = true;\n }\n if (!hasCourses) {\n var noCourses = document.createElement(\"div\");\n noCourses.appendChild(document.createTextNode(\"There are currently no courses.\"));\n courseTable.appendChild(noCourses);\n }\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get courses. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n });\n $('#AllCoursesView').fadeIn(500, null);\n}", "title": "" }, { "docid": "408ede38bf49b2f0613602a92d48022e", "score": "0.5834082", "text": "function init() {\n\n if ($scope.activityData.newGame) {\n\n $scope.questionsGroups = _.groupBy($scope.activityData.questions, \"group\");\n $scope.englishWords.group_1 = _.groupBy(_.shuffle($scope.questionsGroups.group_1), \"englishWord\");\n $scope.greekWords.group_1 = _.groupBy(_.shuffle($scope.questionsGroups.group_1), \"greekWord\");\n $scope.englishWords.group_2 = _.groupBy(_.shuffle($scope.questionsGroups.group_2), \"englishWord\");\n $scope.greekWords.group_2 = _.groupBy(_.shuffle($scope.questionsGroups.group_2), \"greekWord\");\n\n }\n\n if (window.localStorage.getItem(\"questionsGroups\")) {\n console.log(\"read from localstorage\");\n $scope.questionsGroups = JSON.parse(window.localStorage.getItem(\"questionsGroups\"));\n }\n\n if (window.localStorage.getItem(\"englishWords\")) {\n console.log(\"read from localstorage\");\n\n $scope.englishWords = JSON.parse(window.localStorage.getItem(\"englishWords\"));\n }\n\n if (window.localStorage.getItem(\"greekWords\")) {\n console.log(\"read from localstorage\");\n\n $scope.greekWords = JSON.parse(window.localStorage.getItem(\"greekWords\"));\n }\n\n if (window.localStorage.getItem(\"englishWordsContainers\")) {\n console.log(\"read from localstorage\");\n\n englishWordsContainers = JSON.parse(window.localStorage.getItem(\"englishWordsContainers\"));\n }\n\n if (window.localStorage.getItem(\"greekWordsContainers\")) {\n console.log(\"read from localstorage\");\n greekWordsContainers = JSON.parse(window.localStorage.getItem(\"greekWordsContainers\"));\n }\n\n if (window.localStorage.getItem(\"rightWordsContainers\")) {\n console.log(\"read from localstorage\");\n rightWordsContainers = JSON.parse(window.localStorage.getItem(\"rightWordsContainers\"));\n }\n\n $scope.pageTitle = new createjs.Text($scope.selectedLesson.lessonTitle + \" - \" + $scope.selectedLesson.title, \"20px Arial\", \"white\");\n $scope.pageTitle.x = 120;\n $scope.pageTitle.y = 55;\n $scope.pageTitle.maxWidth = 500;\n $scope.mainContainer.addChild($scope.pageTitle);\n\n /*Adding page title and description $scope.activityData.title*/\n $scope.pageActivity = new createjs.Text(_.findWhere($scope.selectedLesson.activitiesMenu, {\n activityFolder: $scope.activityFolder\n }).name + \" \" + ($scope.activityData.revision ? \"- \" + $scope.activityData.revision : \"\") + \" - \" + $scope.activityData.description, \"20px Arial\", \"white\");\n $scope.pageActivity.x = 120;\n $scope.pageActivity.y = 630;\n $scope.pageActivity.maxWidth = 600;\n $scope.mainContainer.addChild($scope.pageActivity);\n\n $scope.activityData.score = 0;\n\n async.waterfall([\n\n /*Check Button*/\n function (initCallback) {\n $http.get($scope.rootDir + \"data/assets/check_answers_drag_and_drop_sprite.json\")\n .success(function (response) {\n response.images[0] = $scope.rootDir + \"data/assets/\" + response.images[0];\n var checkButtonSpriteSheet = new createjs.SpriteSheet(response);\n $scope.checkButton = new createjs.Sprite(checkButtonSpriteSheet, \"normal\");\n\n\n /*Press up event*/\n $scope.checkButton.addEventListener(\"pressup\", function (event) {\n console.log(\"Press up event on check button!\");\n\n if ($scope.activityData.newGame) {\n $scope.checkButton.gotoAndPlay(\"normal\");\n checkAnswers();\n }\n });\n\n $scope.checkButton.x = 90;\n $scope.checkButton.y = 555;\n $scope.mainContainer.addChild($scope.checkButton);\n initCallback();\n })\n .error(function (error) {\n\n console.log(\"Error on getting json data for check button...\", error);\n initCallback();\n });\n },\n\n /*Restart Button*/\n function (initCallback) {\n /*RESTART BUTTON*/\n $http.get($scope.rootDir + \"data/assets/restart_button_drag_and_drop_sprite.json\")\n .success(function (response) {\n //Reassigning images with the rest of resource\n response.images[0] = $scope.rootDir + \"data/assets/\" + response.images[0];\n var restartButtonSpriteSheet = new createjs.SpriteSheet(response);\n $scope.restartButton = new createjs.Sprite(restartButtonSpriteSheet, \"normal\");\n\n /*Mouse down event*/\n $scope.restartButton.addEventListener(\"mousedown\", function (event) {\n console.log(\"Mouse down event on restart button!\");\n $scope.restartButton.gotoAndPlay(\"onSelection\");\n $scope.stage.update();\n });\n\n /*Press up event*/\n $scope.restartButton.addEventListener(\"pressup\", function (event) {\n console.log(\"Press up event on restart button!\");\n $scope.restartButton.gotoAndPlay(\"normal\");\n //Action when restart button is pressed\n restartActivity();\n });\n $scope.restartButton.x = 300;\n $scope.restartButton.y = 570;\n $scope.mainContainer.addChild($scope.restartButton);\n initCallback();\n })\n .error(function (error) {\n console.log(\"Error on getting json data for return button...\", error);\n initCallback();\n });\n },\n\n /*Score Text*/\n function (initCallback) {\n\n $scope.scoreText = new createjs.Text(\"Score: \" + \"0\" + \" / \" + $scope.activityData.questions.length, \"30px Arial\", \"white\");\n $scope.scoreText.x = 620;\n $scope.scoreText.y = 575;\n $scope.mainContainer.addChild($scope.scoreText);\n initCallback(null);\n },\n\n function (initWaterfallCallback) {\n\n $http.get($scope.rootDir + \"data/assets/lesson_end_button_sprite.json\")\n .success(function (response) {\n response.images[0] = $scope.rootDir + \"data/assets/\" + response.images[0];\n var resultsButtonSpriteSheet = new createjs.SpriteSheet(response);\n $scope.resultsButton = new createjs.Sprite(resultsButtonSpriteSheet, \"normal\");\n $scope.resultsButton.x = 430;\n $scope.resultsButton.y = 580;\n $scope.resultsButton.scaleX = $scope.resultsButton.scaleY = 0.6;\n $scope.mainContainer.addChild($scope.resultsButton);\n\n $scope.endText = new createjs.Text(\"RESULTS\", \"25px Arial\", \"white\");\n $scope.endText.x = 460;\n $scope.endText.y = 570;\n $scope.mainContainer.addChild($scope.endText);\n\n $scope.resultsButton.visible = false;\n $scope.endText.visible = false;\n\n $scope.resultsButton.addEventListener(\"mousedown\", function (event) {\n console.log(\"mousedown event on a button !\");\n $scope.resultsButton.gotoAndPlay(\"onSelection\");\n $scope.stage.update();\n });\n $scope.resultsButton.addEventListener(\"pressup\", function (event) {\n console.log(\"pressup event!\");\n $scope.resultsButton.gotoAndPlay(\"normal\");\n $scope.stage.update();\n $rootScope.navigate(\"results\");\n });\n\n initWaterfallCallback();\n })\n .error(function (error) {\n console.error(\"Error on getting json for results button...\", error);\n initWaterfallCallback();\n });\n },\n\n /*Next Activity Button*/\n function (initCallback) {\n /*NEXT BUTTON*/\n $http.get($scope.rootDir + \"data/assets/next_activity_drag_and_drop_sprite.json\")\n .success(function (response) {\n response.images[0] = $scope.rootDir + \"data/assets/\" + response.images[0];\n var nextButtonSpriteSheet = new createjs.SpriteSheet(response);\n $scope.nextButton = new createjs.Sprite(nextButtonSpriteSheet, \"normal\");\n\n $scope.nextButton.addEventListener(\"mousedown\", function (event) {\n console.log(\"mousedown event on a button !\", !$scope.activityData.newGame);\n if (!$scope.activityData.newGame) {\n $scope.nextButton.gotoAndPlay(\"selected\");\n }\n $scope.stage.update();\n });\n $scope.nextButton.addEventListener(\"pressup\", function (event) {\n console.log(\"pressup event!\");\n\n if (!$scope.activityData.newGame) {\n $scope.nextButton.gotoAndPlay(\"onSelection\");\n $rootScope.nextActivity($scope.selectedLesson, $scope.activityFolder);\n }\n\n });\n $scope.nextButton.x = 460;\n $scope.nextButton.y = 590;\n $scope.mainContainer.addChild($scope.nextButton);\n $scope.stage.update();\n initCallback();\n })\n .error(function (error) {\n\n console.log(\"Error on getting json data for check button...\", error);\n initCallback();\n });\n },\n\n function (initCallback) {\n\n console.log(\"Add lines...\");\n\n /*Image Loader*/\n var imageLoader = new createjs.ImageLoader(new createjs.LoadItem().set({\n src: $scope.rootDir + \"data/assets/wizard_connecting_line.png\"\n }));\n\n imageLoader.load();\n\n /*IMAGE LOADER COMPLETED*/\n imageLoader.on(\"complete\", function (r) {\n\n var connectingLines = {};\n\n _.each($scope.activityData.questions, function (line, key, list) {\n\n connectingLines[key] = new createjs.Bitmap($scope.rootDir + \"data/assets/wizard_connecting_line.png\");\n connectingLines[key].x = 212;\n connectingLines[key].y = key === 0 ? 111 : key === 5 ? connectingLines[key - 1].y + 60 : connectingLines[key - 1].y + 40;\n $scope.mainContainer.addChild(connectingLines[key]);\n\n });\n\n initCallback(null);\n });\n\n },\n /*Getting the sprite of checkbox*/\n function (initCallback) {\n $http.get($scope.rootDir + \"data/assets/wizard_tick_wrong_bubble_sprite.json\")\n .success(function (response) {\n //Reassigning images with the rest of resource\n response.images[0] = $scope.rootDir + \"data/assets/\" + response.images[0];\n var checkboxSpriteSheet = new createjs.SpriteSheet(response);\n\n initCallback(null, checkboxSpriteSheet);\n\n })\n .error(function (error) {\n initCallback(true, error);\n console.log(\"Error on getting json data for checkbox...\", error);\n });\n },\n\n /*Creating the game, first foreach word a container, a shape and text is created*/\n function (restartButtonSpriteSheet, initCallback) {\n _.each($scope.questionsGroups, function (group, key, list) {\n\n var counter = 0;\n /*Deploying the english words*/\n _.each($scope.englishWords[key], function (word, wordKey, wordList) {\n\n /* 1.A. The container for the english words*/\n $scope.englishWordsContainers[wordKey] = new createjs.Container();\n $scope.englishWordsContainers[wordKey].width = 170;\n $scope.englishWordsContainers[wordKey].height = 35;\n $scope.englishWordsContainers[wordKey].x = 80;\n $scope.englishWordsContainers[wordKey].containerIndex = (englishWordsContainers ? englishWordsContainers[wordKey].containerIndex : counter);\n $scope.englishWordsContainers[wordKey].questionIsRight = false;\n counter++;\n\n var englishWordsContainersKeys = _.allKeys($scope.englishWordsContainers);\n var currentEnglishWordIndex = _.indexOf(englishWordsContainersKeys, wordKey);\n\n if (currentEnglishWordIndex >= 1) {\n var previousEnglishWordKey = englishWordsContainersKeys[currentEnglishWordIndex - 1];\n }\n\n /*Checking if it's the first element to enter*/\n $scope.englishWordsContainers[wordKey].y = (key === \"group_2\" && currentEnglishWordIndex === 5) ? $scope.englishWordsContainers[previousEnglishWordKey].y + 60 :\n (currentEnglishWordIndex === 0 ? 100 : $scope.englishWordsContainers[previousEnglishWordKey].y + 40);\n\n\n $scope.englishWordsContainers[wordKey].startingPointX = $scope.englishWordsContainers[wordKey].x;\n $scope.englishWordsContainers[wordKey].startingPointY = $scope.englishWordsContainers[wordKey].y;\n\n /** ************************************************ CHECK **********************************************************/\n\n /*Mouse down event*/\n $scope.englishWordsContainers[wordKey].on(\"mousedown\", function (evt) {\n //Check if completed\n if (!$scope.activityData.newGame || $scope.swappingWord) {\n return;\n }\n\n var global = $scope.mainContainer.localToGlobal(this.x, this.y);\n this.offset = {\n 'x': global.x - evt.stageX,\n 'y': global.y - evt.stageY\n };\n this.global = {\n 'x': global.x,\n 'y': global.y\n };\n _.each($scope.currentQuestions, function (question, k, list) {\n if (parseInt($scope.currentQuestions[k].userAnswer) === key + 1) {\n $scope.currentQuestions[k].userAnswer = \"\";\n }\n });\n });\n\n /*Press move event*/\n $scope.englishWordsContainers[wordKey].on(\"pressmove\", function (evt) {\n if (!$scope.activityData.newGame || $scope.swappingWord) {\n return;\n }\n var local = $scope.mainContainer.globalToLocal(evt.stageX + this.offset.x, evt.stageY + this.offset.y);\n this.x = local.x;\n this.y = local.y;\n });\n\n /*Press up event*/\n $scope.englishWordsContainers[wordKey].on(\"pressup\", function (evt) {\n console.log(\"Press up event while dropping the answer!\");\n\n if (!$scope.activityData.newGame || $scope.swappingWord) {\n console.log(\"Activity has not completed...\");\n return;\n }\n\n\n var collisionDetectedQuestion = collision(evt.stageX / $scope.scale - $scope.mainContainer.x / $scope.scale, evt.stageY / $scope.scale - $scope.mainContainer.y / $scope.scale, currentEnglishWordIndex);\n\n if (collisionDetectedQuestion !== -1) {\n console.log(wordKey);\n console.log(collisionDetectedQuestion);\n swapWords(wordKey, collisionDetectedQuestion, \"left\");\n } else {\n\n /*No collision going back to start point*/\n createjs.Tween.get(this, {\n loop: false\n })\n .to({\n x: this.startingPointX,\n y: this.startingPointY\n }, 200, createjs.Ease.getPowIn(2));\n $scope.stage.update();\n }\n }); //end of press up event\n\n $scope.mainContainer.addChild($scope.englishWordsContainers[wordKey]);\n\n /* 2.A. Creating the letterBackground*/\n var englishWordsGraphic = new createjs.Graphics().beginFill(\"blue\").drawRect(0, 0, $scope.englishWordsContainers[wordKey].width, $scope.englishWordsContainers[wordKey].height);\n $scope.englishWordsBackgrounds[wordKey] = new createjs.Shape(englishWordsGraphic);\n $scope.englishWordsContainers[wordKey].addChild($scope.englishWordsBackgrounds[wordKey]);\n\n /* 3.A Adding text*/\n $scope.englishWordsTexts[wordKey] = new createjs.Text($scope.englishWords[key][wordKey][0].englishWord, \"20px Arial\", \"white\");\n $scope.englishWordsTexts[wordKey].x = $scope.englishWordsContainers[wordKey].width / 2;\n $scope.englishWordsTexts[wordKey].y = $scope.englishWordsContainers[wordKey].height / 2;\n $scope.englishWordsTexts[wordKey].textAlign = \"center\";\n $scope.englishWordsTexts[wordKey].textBaseline = \"middle\";\n $scope.englishWordsContainers[wordKey].addChild($scope.englishWordsTexts[wordKey]);\n\n\n /*Adding checkboxes*/\n $scope.checkboxes[wordKey] = new createjs.Sprite(restartButtonSpriteSheet, \"normal\");\n $scope.checkboxes[wordKey].x = $scope.englishWordsContainers[wordKey].width + $scope.englishWordsContainers[wordKey].x + 500;\n $scope.checkboxes[wordKey].y = $scope.englishWordsContainers[wordKey].y;\n $scope.mainContainer.addChild($scope.checkboxes[wordKey]);\n $scope.checkboxes[wordKey].gotoAndPlay(\"normal\");\n\n });\n\n var secondCounter = 0;\n /*Deploying the greek words*/\n _.each($scope.greekWords[key], function (word, wordKey, wordList) {\n\n /* 1.B. The container for the greek words*/\n $scope.greekWordsContainers[wordKey] = new createjs.Container();\n $scope.greekWordsContainers[wordKey].width = 170;\n $scope.greekWordsContainers[wordKey].height = 35;\n $scope.greekWordsContainers[wordKey].x = 350;\n $scope.greekWordsContainers[wordKey].containerIndex = (greekWordsContainers ? greekWordsContainers[wordKey].containerIndex : secondCounter);\n secondCounter++;\n\n var greekWordsContainersKeys = _.allKeys($scope.greekWordsContainers);\n var currentGreekWordIndex = _.indexOf(greekWordsContainersKeys, wordKey);\n\n if (currentGreekWordIndex >= 1) {\n var previousGreekWordKey = greekWordsContainersKeys[currentGreekWordIndex - 1];\n }\n /*Checking if its the first element to enter*/\n $scope.greekWordsContainers[wordKey].y = (key === \"group_2\" && currentGreekWordIndex === 5) ? $scope.greekWordsContainers[previousGreekWordKey].y + 60 : (currentGreekWordIndex === 0 ? 100 : $scope.greekWordsContainers[previousGreekWordKey].y + 40);\n $scope.greekWordsContainers[wordKey].startingPointX = $scope.greekWordsContainers[wordKey].x;\n $scope.greekWordsContainers[wordKey].startingPointY = $scope.greekWordsContainers[wordKey].y;\n\n /*EVENTS*/\n /*Mouse down event*/\n $scope.greekWordsContainers[wordKey].on(\"mousedown\", function (evt) {\n //Check if completed\n if (!$scope.activityData.newGame || $scope.swappingWord) {\n return;\n }\n\n var global = $scope.mainContainer.localToGlobal(this.x, this.y);\n this.offset = {\n 'x': global.x - evt.stageX,\n 'y': global.y - evt.stageY\n };\n this.global = {\n 'x': global.x,\n 'y': global.y\n };\n _.each($scope.currentQuestions, function (question, k, list) {\n if (parseInt($scope.currentQuestions[k].userAnswer) === key + 1) {\n $scope.currentQuestions[k].userAnswer = \"\";\n }\n });\n });\n\n /*Press move event*/\n $scope.greekWordsContainers[wordKey].on(\"pressmove\", function (evt) {\n if (!$scope.activityData.newGame || $scope.swappingWord) {\n return;\n }\n var local = $scope.mainContainer.globalToLocal(evt.stageX + this.offset.x, evt.stageY + this.offset.y);\n this.x = local.x;\n this.y = local.y;\n });\n\n /*Press up event*/\n $scope.greekWordsContainers[wordKey].on(\"pressup\", function (evt) {\n console.log(\"Press up event while dropping the answer!\");\n\n if (!$scope.activityData.newGame || $scope.swappingWord) {\n console.log(\"Activity has not completed...\");\n return;\n }\n\n\n var collisionDetectedQuestion = collision(evt.stageX / $scope.scale - $scope.mainContainer.x / $scope.scale, evt.stageY / $scope.scale - $scope.mainContainer.y / $scope.scale, currentGreekWordIndex);\n\n if (collisionDetectedQuestion !== -1) {\n console.log(wordKey);\n console.log(collisionDetectedQuestion);\n swapWords(wordKey, collisionDetectedQuestion, \"right\");\n } else {\n\n /*No collision going back to start point*/\n createjs.Tween.get(this, {\n loop: false\n })\n .to({\n x: this.startingPointX,\n y: this.startingPointY\n }, 200, createjs.Ease.getPowIn(2));\n $scope.stage.update();\n }\n }); //end of press up event\n\n $scope.mainContainer.addChild($scope.greekWordsContainers[wordKey]);\n\n /* 2.A. Creating the letterBackground*/\n var greekWordsGraphic = new createjs.Graphics().beginFill(\"blue\").drawRect(0, 0, $scope.greekWordsContainers[wordKey].width, $scope.greekWordsContainers[wordKey].height);\n $scope.greekWordsBackgrounds[wordKey] = new createjs.Shape(greekWordsGraphic);\n $scope.greekWordsContainers[wordKey].addChild($scope.greekWordsBackgrounds[wordKey]);\n\n /* 3.B. Adding text*/\n $scope.greekWordsTexts[wordKey] = new createjs.Text($scope.greekWords[key][wordKey][0].greekWord, \"20px Arial\", \"white\");\n $scope.greekWordsTexts[wordKey].x = $scope.greekWordsContainers[wordKey].width / 2;\n $scope.greekWordsTexts[wordKey].y = $scope.greekWordsContainers[wordKey].height / 2;\n $scope.greekWordsTexts[wordKey].textAlign = \"center\";\n $scope.greekWordsTexts[wordKey].textBaseline = \"middle\";\n $scope.greekWordsContainers[wordKey].addChild($scope.greekWordsTexts[wordKey]);\n\n });\n\n var rightWordContainerCounter = 0;\n /*Deploying the right words*/\n _.each($scope.englishWords[key], function (word, wordKey, wordList) {\n\n /* 1.A. The container for the english words*/\n $scope.rightWordsContainers[wordKey] = new createjs.Container();\n $scope.rightWordsContainers[wordKey].width = 170;\n $scope.rightWordsContainers[wordKey].height = 35;\n $scope.rightWordsContainers[wordKey].x = 540;\n $scope.rightWordsContainers[wordKey].y = $scope.englishWordsContainers[wordKey].y;\n $scope.rightWordsContainers[wordKey].containerIndex = (rightWordsContainers ? rightWordsContainers[wordKey].containerIndex : rightWordContainerCounter);\n ;\n $scope.rightWordsContainers[wordKey].visible = false;\n rightWordContainerCounter++;\n\n /* 2.A. Creating the letterBackground*/\n var rightWordsGraphic = new createjs.Graphics().beginFill(\"red\").drawRect(0, 0, $scope.rightWordsContainers[wordKey].width, $scope.rightWordsContainers[wordKey].height);\n $scope.rightWordsBackgrounds[wordKey] = new createjs.Shape(rightWordsGraphic);\n $scope.rightWordsContainers[wordKey].addChild($scope.rightWordsBackgrounds[wordKey]);\n\n /* 3.A Adding text*/\n $scope.rightWordsTexts[wordKey] = new createjs.Text(\"\", \"20px Arial\", \"white\");\n $scope.rightWordsTexts[wordKey].x = $scope.rightWordsContainers[wordKey].width / 2;\n $scope.rightWordsTexts[wordKey].y = $scope.rightWordsContainers[wordKey].height / 2;\n $scope.rightWordsTexts[wordKey].textAlign = \"center\";\n $scope.rightWordsTexts[wordKey].textBaseline = \"middle\";\n $scope.rightWordsContainers[wordKey].addChild($scope.rightWordsTexts[wordKey]);\n\n $scope.mainContainer.addChild($scope.rightWordsContainers[wordKey]);\n });\n\n });\n\n //Waterfall callback\n initCallback(null);\n }\n\n ], function (error, result) {\n if (!error) {\n console.log(\"Success on creating game!\");\n\n if (!$scope.activityData.newGame) {\n console.log(\"THIS IS A COMPLETED GAME\");\n $scope.checkButton.gotoAndPlay(\"normal\");\n checkAnswers();\n }\n save();\n } else {\n console.error(\"Error on creating the game during init function. Error: \", result);\n }\n\n });\n\n } //end of function init()", "title": "" }, { "docid": "8402a74853357c95a2b68a51722580e4", "score": "0.58048123", "text": "function create_form_objects(){\n location.href = \"display.html\";\n var profile_object = {};\n profile_object.name = $(\"#name_input\").val();\n profile_object.location = $(\"#location_input\").val();\n profile_object.age = $(\"#age_input\").val();\n profile_object.description = $(\"#description_input\").val();\n profile_object.interest = $(\"#interest_input\").val();\n profile_object.skills = [];\n $(\".skill_checkbox input:checkbox:checked\").each(function(){\n profile_object.skills.push($(this).val());\n });\n profile_object.equipment = $(\"#equipment_input\").val();\n profile_object.youtube = [];\n $(\".youtube_clip_area iframe\").each(function(){\n profile_object.youtube.push($(this).data(\"video_id\"))\n });\n // localStorage.setItem(\"profiles\", \"[]\");\n var profilesString = localStorage.getItem(\"profiles\");\n if (profilesString === null) {\n profilesString = \"[]\";\n }\n //turns objects into strings to store in localstorage\n var profiles = JSON.parse(profilesString);\n profiles.push(profile_object);\n var newProfilesString = JSON.stringify(profiles);\n localStorage.setItem(\"profiles\", newProfilesString);\n}", "title": "" }, { "docid": "8335d06890f5902f3c7f63f1d2b3b413", "score": "0.58041376", "text": "function loadCart() {\n let courseCart = JSON.parse(localStorage.getItem('savedItems') || []);\n cartItem = new Cart(courseCart)\n if (courseCart !== null) {\n cartItem = courseCart\n };\n}", "title": "" }, { "docid": "81fa780c677aabec6b3cba5dcf3700c9", "score": "0.5801594", "text": "function init() {\n let saved_cities = JSON.parse(localStorage.getItem(\"cities\"));\n\n if (saved_cities !== null) {\n cities = saved_cities\n }\n\n renderButtons();\n}", "title": "" }, { "docid": "58c0dfe91592bc675becd1e004f78f32", "score": "0.57884157", "text": "function putLocal(cn) {\n window.scrollTop = 0;\n let innerText = cn.textContent;\n // let courseName = courseName;\n // let courseTitle = courseTitle;\n // let courseDescription = cn.description;\n let courseName = innerText.split(\":\")[0];\n let courseTitle = innerText.split(\":\")[1];\n let courseDescription = cn.getAttribute(\"value\");\n localStorage.setItem(\"courseName\", courseName);\n localStorage.setItem(\"courseTitle\", courseTitle);\n localStorage.setItem(\"courseDescription\", courseDescription);\n window.location.assign(\"/courses.html\");\n}", "title": "" }, { "docid": "bf18839bdb46aca55de1c08a2bdf33d1", "score": "0.5784972", "text": "function init(){\n\tstorage.get(STOARGES.CONTEXTS_STORAGE).then((storedItems) => {\n\t\tif (_.isArray(storedItems)){\n\t\t\tstoredItems.forEach((item) => {\n\t\t\t\tcontexts.push(new Map(item));\n\t\t\t\tProjectsStore.emitChange();\n\t\t\t});\n\t\t}\n\t}).catch(function(){\n\t\t// TODO what?\n\t});\n}", "title": "" }, { "docid": "f46cb8fdaf2e12bbda8690c2d21d6c20", "score": "0.5777954", "text": "function addCourse()\n{\n var courseId = coursesSelect.options[coursesSelect.selectedIndex].value;\n var course = courseList[courseId];\n\n if(isCourseInList(courseId)) {\n alert(\"A UC já está na lista\");\n return;\n }\n\n course[\"url\"] = getCourseURL(courseId);\n\n //Find what kind of classes the course has (PROBLEMS, TEORICA...)\n let loads = getCourseLoads(courseId);\n\n course[\"loads\"] = [];\n for(i in loads)\n {\n let loadLetter = courseLoadNameToLetter(loads[i].type);\n course.loads.push({text: loads[i].type, value: loadLetter, checked: true});\n }\n\n app.selectedCourses.push(course);\n}", "title": "" }, { "docid": "330ff3060ac08fbb111ec21e6faf556f", "score": "0.57629967", "text": "function getCoursesFromStorage() {\n let courses;\n\n if (localStorage.getItem(\"courses\") === null) {\n courses = [];\n } else {\n courses = JSON.parse(localStorage.getItem(\"courses\"));\n }\n return courses;\n}", "title": "" }, { "docid": "c7dfd790e0ce1f3edcccb0e75eb1679f", "score": "0.57276595", "text": "function init() {\n var notesListEl, noteText;\n //filling the list of notes\n for (i = localStorage.length - 1; i >= 0; i = i - 1) {\n notesListEl = document.createElement(\"li\");\n noteText = localStorage.getItem(localStorage.key(i));\n //our list of notes should only contain those values from local storage, whose keys start with \"note\"\n if (localStorage.key(i).substring(0, 4) === \"note\") {\n notesListEl.innerHTML =\n \"<div class='note' id='\" + localStorage.key(i) + \"'>\" +\n \"<div>\" +\n \"<label class='note-content'>\" + noteText + \"</label>\" +\n \"<button class='note-destroy'></button>\" +\n \"</div>\" +\n \"<div class='hidden'>\" +\n \"<input class='edit-note' type='text' maxlength='\" + maxLength + \"' value='\" + noteText + \"'></input>\" +\n \"</div>\" +\n \"</div>\";\n document.getElementById(\"notes\").appendChild(notesListEl);\n }\n }\n }", "title": "" }, { "docid": "f577b116df0142209502e014a8d797c3", "score": "0.5725327", "text": "function courseList() {\n\tif(kofferModel.isModelLoaded()) {\n\t\tvar myData = kofferModel.getModel();\n\t\t// show the loaded data\n\t\trenderCourseList(myData);\n\t}else{\n\t\t// data is not ready, just register the render method and request an update\n\t\t// it is not very likely that this case occurs?\n\t\t$('#cList').html('<div align=\"center\">Daten werden abgerufen</div>');\n\t\tkofferModel.setRenderingListener(renderCourseList);\n\t\tkofferModel.loadJsonModelFromService();\n\t}\n}", "title": "" }, { "docid": "055359f70f70871381360fb2a016c498", "score": "0.5725102", "text": "function load() {\n\tvar stud = JSON.parse(localStorage.getItem(\"user\"));\n\tif (stud === null) {\n\t\tvar classes = getStartingSchedule();\n\t\tstud = new Student(classes, 2, [6, 7, 10, 11, 14, 15]);\n\t}\n\t//console.log(stud);\n\treturn stud;\n}", "title": "" }, { "docid": "0186256c93e5eaf474b0afbabf876b13", "score": "0.5701307", "text": "function createCourses() {\n var courses = new Array();\n var course_list = getCourses();\n for (var i = 0; i < course_list.length; i++) {\n var course;\n course = {\n name: course_list[i++],\n description: course_list[i++],\n gpa: course_list[i]\n };\n courses.push(course);\n }\n return courses;\n}", "title": "" }, { "docid": "8c9289f6fb69b451747febdb53d13b5f", "score": "0.56849724", "text": "function init(){\n \n //make title\n var h = document.createElement('h1');\n h.setAttribute('id', 'title');\n var text = document.createTextNode(first);\n h.appendChild(text);\n document.getElementsByTagName('body')[0].appendChild(h);\n \n //make sidebar\n var sidebar = document.createElement('div');\n sidebar.setAttribute('id', 'sidebar')\n document.getElementsByTagName('body')[0].appendChild(sidebar);\n \n \n //make restart, placed in sidebar\n makeStartOver();\n \n //make form, placed in sidebar\n makeForm();\n \n \n //make cookies and loacalStorage, placed in sidebar\n makeToday();\n makelTab();\n \n\n //make center\n var centerdiv = document.createElement('div');\n centerdiv.setAttribute('id', 'centerdiv');\n document.getElementsByTagName('body')[0].appendChild(centerdiv);\n\n \n //make choices, placed in center\n makeSelect(first);\n\n}", "title": "" }, { "docid": "e8f20fcd825fc9d444ff0804fff9d403", "score": "0.56662375", "text": "function init(){\n //Styling and model visibility\n $(\".side-bar\").css(\"opacity\", \"0\");\n $(\".main-content\").css(\"opacity\",\"0\");\n $(\".modal\").toggle();\n //initialize local storage\n var storedCities = JSON.parse(localStorage.getItem(\"cityNames\"));\n if(storedCities !== null){\n cityNames = storedCities;\n }\n renderCities();\n }", "title": "" }, { "docid": "4c22bdf53f12e57316d5fb848c9fd9b4", "score": "0.5663365", "text": "function openMyCourses() {\n\n\t//block and unblock the button, so the only button the user can chose is the button to change the page\n\t$(\"#frontpage-course-list\").find(\"#show_all\").removeAttr(\"disabled\");\n\t$(\"#frontpage-course-list\").find(\"#show_current\").attr(\"disabled\",true);\n\t\n\tunsetHideUnhideButton(); //remove the hide/unhide button from all buttons\n\n\t//remove all the courses the user chose (the options to be hide are save in the local storage)\n\tfor (var i = 0; i < localStorage.length; i++) {\n\t\t$(\"[data-courseid=\"+localStorage.key(i)+\"]\").hide();\n\t}\t\n}", "title": "" }, { "docid": "67331a3e56f75e21c8e1cab7f2bc0ea2", "score": "0.56547797", "text": "function loadCoursesInstructor(id,name,surname){\n $.ajax({\n method: \"POST\",\n crossDomain: true, \n url: \"http://bigbiggym.altervista.org/server/getAllCourses_instructor.php\", \n data: {id:id},\n success: function(response) {\n console.log(JSON.parse(response));\n var courses= JSON.parse(response);\n var el = \"\";\n \n createContext(id,name,surname);\n if(courses.length>0){\n for (var i=0; i<courses.length; i++) {\n document.title=\"Courses of \"+name+\" \"+surname;\n console.log(courses[i].Name);\n\n el += \"<div class='col-md-6' id='courseInstructorBlock'>\";\n el += \"<img src='images/\" + courses[i].Name+\"/main.png' height='100' width='115' style='float:left; margin-right: 5%'/>\";\n el+= \"<div class='courseContainer'>\";\n el += \"<h3 class='courseName'>\" + courses[i].Name+\"</h3>\";\n el += \"<p class='courseLevel'>Level: \" + courses[i].Level + \"</p>\";\n el += \"<button class='btn' type='button' id='std-btn' onclick=\\\"parent.location='course.html?name=\" + courses[i].Name + \"&from=all'\\\" >More Info</button>\";\n el += \"</div> </div>\";\n }\n }else{\n el+= \"No courses\"; \n }\n $(\"#container\").html(el);\n },\n error: function(request,error) \n {\n console.log(\"Error\");\n }\n });\n}", "title": "" }, { "docid": "45e16015022e30612b1843b319de91bb", "score": "0.56451046", "text": "function runModule() {\n var catalogCourse = '';\n\n /* Call clickbait and return the JSON object with all course info objects (myJSON) */\n clickbait((err, catalogCourses) => {\n if (err) {\n course.error(err);\n stepCallback(null, course);\n return;\n }\n\n /* Set catalogCourse to the returned object from \n parseMyJSON (one course's PID and Course Code) */\n catalogCourse = catalogCourses.find(catalogCourse => {\n return catalogCourse.__catalogCourseId.replace(/\\s/g, '') == course.info.courseCode;\n });\n\n /* quit if unable to find course */\n if (catalogCourse === undefined) {\n course.warning('Unable to find a catalogCourseId. Exiting');\n stepCallback(null, course);\n return;\n }\n\n catalogCourse.pid = catalogCourse.pid.replace(/\\s/g, '');\n\n /* Using the current course's PID and Course Code, get the description of the course */\n getDescription(catalogCourse, (err, description) => {\n if (err) {\n course.error(err);\n stepCallback(null, course);\n return;\n }\n\n if (!description) {\n course.warning('Unable to find course description at http://www.byui.edu/catalog/#/courses. Exiting');\n stepCallback(null, course);\n return;\n }\n\n /* If the course description was retrieved from http://www.byui.edu/catalog/#/courses, \n then send the description to Canvas */\n sendToCanvas(description, err => {\n if (err) {\n course.error(err);\n stepCallback(null, course);\n return;\n }\n\n /* Log the description and course ID */\n course.log('Add Course Description', {\n 'Course ID': course.info.canvasOU,\n 'Course Description': description,\n });\n\n stepCallback(null, course);\n });\n });\n });\n }", "title": "" }, { "docid": "f519a8ff8de1c3f8ccafe9f7b61c0ac7", "score": "0.56419766", "text": "function startupRender() {\n let tasks;\n if(localStorage.getItem('tasks') !== null){\n tasks = JSON.parse(localStorage.getItem('tasks'));\n tasks.forEach(function(task, i, tasks) {\n createNewLi(task);\n hideDeleteAllBtn();\n });\n }\n}", "title": "" }, { "docid": "5cbcdf505bcbf7aebf0062206bf97235", "score": "0.56191456", "text": "init() {\r\n // fetch('./tasks.json')\r\n // .then(response => response.json())\r\n // .then(tasks => {\r\n // localStorage.setItem(`data`, JSON.stringify(tasks));\r\n\r\n // tasks.forEach(task => {\r\n // this.tasks.addTask(task.key, task.text, task.status, task.type);\r\n // // dodanie ich do pamięci przeglądarki\r\n // this.render(); // docelowo w innym miejscu, ale metoda jest asynchroniczna wyzej\r\n // })\r\n // })\r\n // .catch(error => console.log(error));\r\n\r\n\r\n // localStorage - ładowanie danych z przeglądarki\r\n const data = JSON.parse(localStorage.getItem('data'));\r\n if (data) {\r\n data.forEach(task => {\r\n this.tasks.addTask(task.id, task.value, task.status, task.type);\r\n if (this.tasks.getLenght() === data.length) {\r\n this.render();\r\n }\r\n })\r\n }\r\n }", "title": "" }, { "docid": "cdd9ef83de6b5ae2e553c38c7a155f51", "score": "0.56124294", "text": "function init() {\n var storeDay = JSON.parse(localStorage.getItem(\"dayPlanner\"));\n\n if (storeDay) {\n dayPlanner = storeDay;\n }\n\n saveData();\n displayData(); //functions call\n}", "title": "" }, { "docid": "8576cbd743d7b441760bb70faf2b3d71", "score": "0.5597489", "text": "function setupLocalStorage() {\n\n // Get an array of the events saved on the calendar\n var calendarEvents = JSON.parse(localStorage.getItem(\"events\"));\n\n // If there is no calendar array yet, create a new one and return\n if (!calendarEvents) {\n localStorage.setItem(\"events\", JSON.stringify([]));\n return;\n }\n\n // Populate in the calendar event elements with saved events\n for (var i = 0; i < 9; i++) {\n var textAreaEl = $(`#input${i}`);\n if (calendarEvents[i]) {\n textAreaEl.val(calendarEvents[i]);\n }\n }\n}", "title": "" }, { "docid": "de24ee57c5627aa9b1d01d9807a7208f", "score": "0.559687", "text": "function qodeOnWindowLoad() {\n qodeInitCourseListAnimation();\n qodeInitCoursePagination().init();\n qodeInitElementorCourseList();\n qodeInitElementorCourseSearch();\n qodeInitElementorCourseSlider();\n }", "title": "" }, { "docid": "e671cbc0d999365dcf5419665ece1329", "score": "0.5591875", "text": "function showCourseList() {\n hideAllPanels();\n\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n var errArea = document.getElementById(\"ErrAllCoursesStudent\");\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var hasCourses = false;\n courseList = web.get_lists().getByTitle('TrainingCourse');\n // moduleList = web.get_lists().getByTitle('Module');\n // topicList = web.get_lists().getByTitle('Topic');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = courseList.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n\n // Success returned from executeQueryAsync\n // Remove all nodes from the course <DIV> so we have a clean space to write to\n var courseTable = document.getElementById(\"AllCoursesStudentList\");\n while (courseTable.hasChildNodes()) {\n courseTable.removeChild(courseTable.lastChild);\n }\n\n // Iterate through the Quiz list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Create a DIV to display the course name \n var course = document.createElement(\"div\");\n var courseLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n course.appendChild(courseLabel);\n\n // Add an ID to the course DIV\n course.id = listItem.get_id();\n\n // Add an class to the lead DIV\n course.className = \"item\";\n\n // Add an onclick event to show the lead details\n $(course).click(function (sender) {\n startCourse(sender.target.id);\n });\n\n // Add the lead div to the UI\n courseTable.appendChild(course);\n hasCourses = true;\n }\n if (!hasCourses) {\n var noCourses = document.createElement(\"div\");\n noCourses.appendChild(document.createTextNode(\"There are currently no courses.\"));\n courseTable.appendChild(noCourses);\n }\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get Courses. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n });\n $('#AllCoursesStudent').fadeIn(500, null);\n}", "title": "" }, { "docid": "a088205db830bdbe08bd594657a7b3f5", "score": "0.55859435", "text": "function updateCourseList() {\n var URL = '/courses/';\n\n $.getJSON(URL, function (data) {\n console.log(data);\n if (data.success) {\n var course_list = data.courses;\n var course_list_div = $('#course_list');\n var prototype_course_div = $('#prototype_course_div');\n course_list_div.empty();\n\n for (var i = 0; i < course_list.length; i++) {\n var course = course_list[i];\n var course_div = prototype_course_div.clone();\n course_div.children('div.bars').click(toggleLectureListParent);\n course_div.find('button.new_button').click(createLecture);\n course_div.find('button.stat_button').click(showStatPage);\n course_div.find('button.del_button').click(deleteCourse);\n course_div.removeAttr('id style');\n course_div.data('course_id', course.course_id);\n course_div.data('delete_permission', false);\n // Insert title after first glyph icon\n course_div.find('span').first().append(course.course_title);\n course_list_div.append(course_div);\n }\n }\n });\n}", "title": "" }, { "docid": "bfd9f462bfba1a9612202adf1275f03f", "score": "0.55567896", "text": "_load(){\n let todos = localStorage.getItem('todos');\n\n if (todos) {\n let jsonTodos = JSON.parse(todos);\n\n for(let index=0; index < jsonTodos.length; index++) {\n let todo = new Todo(this);\n todo._todo = jsonTodos[index];\n // Et on ajoute à la liste\n this._todos.push(todo);\n }\n console.log('Mes todos : ' + this.toString());\n\n // Envoyer les todos dans le tableau HTML\n this._render();\n }\n }", "title": "" }, { "docid": "7c31857ee4f434eee91a8454c81643d9", "score": "0.55538577", "text": "function init() {\n // questions\n numAnswers = 2;\n\n // no courses loaded or selected\n courses = null;\n coursesSelectedIndex = -1;\n\n // connect ui elements with event handlers\n bindUIActions();\n }", "title": "" }, { "docid": "cb81df58ce954277c08be2564345b10e", "score": "0.5536525", "text": "function addCourse(course, body) {\n var div = document.createElement(\"div\");\n div.addEventListener(\"click\", didSelectCourse);\n div.id = course.code;\n div.setAttribute(\"class\", \"container\");\n\n addTextNode(course.title + \", \" + course.code, div);\n addTextNode(course.programme + \", \" + course.level, div);\n addTextNode(\"Semester: \" + course.semester, div);\n\n body.append(div);\n}", "title": "" }, { "docid": "b68b14c7b19b87d8a328ead0c8049ce8", "score": "0.55272114", "text": "function loadNotes() {\n var storedNotes = localStorage.getItem(\"notes\");\n if (storedNotes) {\n // passes the stored json back into an array of note objects\n var notesArray = JSON.parse(storedNotes);\n count = notesArray.length;\n\n var i;\n for (i = 0; i < count; i++) {\n var storedNote = notesArray[i];\n createNew(storedNote.Class, storedNote.Title, storedNote.Content);\n }\n }\n }", "title": "" }, { "docid": "94b9c3800c8029ff0e8f55b2510ad410", "score": "0.5524013", "text": "async function pageConstruct() {\n IMLibCalc.calculateRequiredObject = {}\n INTERMediator.currentEncNumber = 1\n INTERMediator.elementIds = []\n\n // Restoring original HTML Document from backup data.\n const bodyNode = document.getElementsByTagName('BODY')[0]\n if (INTERMediator.rootEnclosure === null) {\n INTERMediator.rootEnclosure = bodyNode.innerHTML\n } else {\n bodyNode.innerHTML = INTERMediator.rootEnclosure\n }\n INTERMediator.localizing()\n postSetFields = []\n INTERMediatorOnPage.setReferenceToTheme()\n IMLibPageNavigation.initializeStepInfo(false)\n\n IMLibLocalContext.bindingDescendant(document.documentElement)\n\n try {\n await seekEnclosureNode(bodyNode, null, null, null)\n } catch (ex) {\n if (ex.message === '_im_auth_required_') {\n throw ex\n } else {\n INTERMediatorLog.setErrorMessage(ex, 'EXCEPTION-9')\n }\n }\n\n // After work to set up popup menus.\n for (let i = 0; i < postSetFields.length; i++) {\n const node = document.getElementById(postSetFields[i].id)\n if (postSetFields[i].value === '' && node && node.tagName === 'SELECT') {\n // for compatibility with Firefox when the value of select tag is empty.\n const emptyElement = document.createElement('option')\n emptyElement.setAttribute('id', INTERMediator.nextIdValue())\n emptyElement.setAttribute('value', '')\n emptyElement.setAttribute('data-im-element', 'auto-generated')\n document.getElementById(postSetFields[i].id).insertBefore(\n emptyElement, document.getElementById(postSetFields[i].id).firstChild)\n }\n if (node) {\n node.value = postSetFields[i].value\n }\n }\n IMLibCalc.updateCalculationFields()\n IMLibPageNavigation.navigationSetup()\n IMLibLocalContext.archive()\n appendCredit()\n }", "title": "" }, { "docid": "ed3b489c65001a4aa803f99e67885f7e", "score": "0.5515951", "text": "_loadCourseUrl(e) {\n // reset dialog to appear to be loading\n this.$.loadingCourse.hidden = false;\n var normalizedEvent = dom(e);\n var local = normalizedEvent.localTarget; // this will have the id of the current course\n\n var active = local.getAttribute(\"data-course-id\"); // find the course by it's unique id and filter just to it\n\n let findCourse = this.originalCourses.filter((course) => {\n if (course.id !== active) {\n return false;\n }\n\n return true;\n }); // if we found one, make it the top level item\n\n if (findCourse.length > 0) {\n findCourse = findCourse.pop();\n }\n\n this.activeCourse = findCourse; // formulate the post data\n\n this._courseDataParams = {\n id: this.activeCourse.id,\n }; // @todo look at query cache mechanism to skip calls\n // if they've already happened. lrnapp-book has some stuff to do this\n\n this.$.courserequest.generateRequest();\n this.$.dialog.toggle();\n }", "title": "" }, { "docid": "9afdfc25b0669333d23f8e1429ec2167", "score": "0.5508501", "text": "function init() {\n // need to parse array of user score objects\n var storedScoreList = JSON.parse(localStorage.getItem(\"scoresList\"));\n\n // assign the parsed array to scoreList array to render later\n if (storedScoreList !== null) {\n scoreList = storedScoreList;\n }\n // prepare the score list to show later\n renderScoreList();\n // we are at start of the quiz\n currentQuestion = 0;\n}", "title": "" }, { "docid": "57a82809b4945ff3d4889280f1b093c4", "score": "0.5506684", "text": "function getCoursesFromStorage() {\n let courses;\n //if something exist on storage then we get the value, otherwise create an empty array\n if (localStorage.getItem(\"courses\") === null) {\n courses = [];\n } else {\n courses = JSON.parse(localStorage.getItem(\"courses\"));\n }\n return courses;\n}", "title": "" }, { "docid": "1e22c3185c1e963724959ba3ea6972ed", "score": "0.5502707", "text": "defaultQuizLSInsert() {\n // Feed into LS\n let stringedIconsDB = JSON.stringify(defaultQuizDB);\n let defaultQuizName = \"Quiz-Default\"; // Must begin with word \"quiz\"\n localStorage.setItem(defaultQuizName, stringedIconsDB);\n\n //Load (Parsed quizDB) From LS onto variable\n let retrievedDefQuiz = localStorage.getItem(defaultQuizName);\n // (parsed)\n let defaultQuizArray = JSON.parse(retrievedDefQuiz);\n\n /*********************VOCAB QUIZ INSERT AND LOAD********** */\n let stringedVocabDB = JSON.stringify(cSVocabQuizDB);\n let vocabQuizName = \"Quiz-Vocab\"; // Must begin with word \"quiz\"\n localStorage.setItem(vocabQuizName, stringedVocabDB);\n //Load (Parsed quizDB) From LS onto variable\n let retrievedVocabQuiz = localStorage.getItem(vocabQuizName);\n // (parsed)\n let vocabQuizArray = JSON.parse(retrievedVocabQuiz);\n\n this.setState(() => {\n return {\n defaultQuizArray,\n defaultQuizName,\n vocabQuizArray,\n vocabQuizName\n };\n });\n }", "title": "" }, { "docid": "ecdc8d049f5b4c6d45465c18b83d150b", "score": "0.549819", "text": "function getCoursesFromStorage() {\n let courses\n //if something exist on storage then we get the value, otherwise create an empty array\n if(localStorage.getItem(\"courses\") === null) {\n courses = [];\n } else {\n courses = JSON.parse(localStorage.getItem(\"courses\"));\n }\n return courses;\n}", "title": "" }, { "docid": "5358c39a4ff74827b72ffff9df9861cb", "score": "0.54952204", "text": "function setupPlaylists() {\n\n\tvar playlists = {}\n\n\tmodel.playlists.forEach(function(playlist){\n\t if (!playlists.hasOwnProperty(playlist._id))\n\t playlists[playlist._id] = playlist;\n\n \t});\n\n\n\t(function addLocalStoragePlaylists(){\n\t \tif(localStorage.playlists === undefined){\n\t \tlocalStorage.playlists = JSON.stringify({});\n\t \t} \n\n\t \tvar localStoragePlaylists = JSON.parse(localStorage.playlists);\n\t \t\n\t \tfor(var id in localStoragePlaylists){\n\t \t\t// id could be undefined for some reason...\n\t \t\t// No need to check \"!playlists.hasOwnProperty(id)\",\n\t \t\t// otherwise changes to playlists loaded from window.model.playlists \n\t \t\t// will not be shown on reloading\n\t \t\tif(id){ \n\t \t\t\tplaylists[id] = localStoragePlaylists[id];\n\t \t\t}\n\t \t}\t\t\n\t})();\t\n\n \tvar keys = Object.keys(playlists);\n\n\tkeys.forEach(function(key){\n\t appendNewPlaylistToMenu(playlists[key]);\n\t});\n}", "title": "" }, { "docid": "3b2c17446a266c5508935279968bb57c", "score": "0.5492261", "text": "function init()\n{\n $.getJSON(\"data_covidSocialShoppingApp.json\", function (data)\n {\n for (let elem of data.elements)\n {\n let newPerson = new Person(elem.firstName, elem.lastName, elem.job);\n shoppingListManagement.addPersonToManagement(newPerson);\n for (let list of elem.shoppingList)\n {\n let newShoppingList = new ShoppingList(list.shoppingListName, newPerson, list.createdOn, list.dueDate);\n shoppingListManagement.addShoppingListToManagement(newShoppingList);\n for (let article of list.article)\n {\n let newArticle = new Article(article.articleName, article.articleQuantity, article.maxPrice)\n newShoppingList.addArticleToShoppingList(newArticle);\n }\n }\n }\n let target = $('#listContainer');\n shoppingListManagement.printAllShoppingLists(target);\n\n //hide all detailView divs\n $(\"div.detailView\").hide();\n //register Click-Handlers\n registerClickHandler();\n //by default show seeker mode\n $(\".helper\").hide();\n //by default hide edit icons\n $(\".editIcons i\").hide();\n });\n}", "title": "" }, { "docid": "16e3d3364435a46417b67ab8ba8c97ab", "score": "0.54911864", "text": "function save() {\n // initiate an empty JSON object to store all data\n var timeObjList = {};\n\n // grab data from all the time slots on the page\n var slots = document.getElementsByClassName(\"time\");\n for (var i = 0, t; t = slots[i]; i++) {\n var id = t.id;\n // getting the label for the time slot and all its courses\n // default 6 slots\n if (i<6){\n var label=t.childNodes[1].childNodes[1].innerText;\n var courses=t.childNodes[1].childNodes[3].childNodes;\n }\n // extra slots created\n else{\n var label=t.childNodes[0].childNodes[0].innerText;\n var courses=t.childNodes[0].childNodes[2].childNodes;\n }\n\n // create the entry for the time slot in the JSON storage object\n timeObjList[id] = {};\n timeObjList[id][\"time\"]=label;\n timeObjList[id][\"courses\"]=[];\n\n // push data in the time slot\n if (courses.length>0){\n for (var k = 0; k<(courses.length); k++){\n timeObjList[id][\"courses\"].push(courses[k].id)\n }\n }\n }\n\n // store the unscheduled courses (courses not in time slots)\n timeObjList[\"not-scheduled\"] = [];\n var container = document.getElementById('course-list');\n var courses = container.childNodes;\n if (courses.length>1){\n for (var k=1; k<(courses.length); k++){\n timeObjList[\"not-scheduled\"].push(courses[k].id);\n }\n }\n\n // capture the current timestamp\n var date = new Date();\n var y = date.getFullYear();\n m = date.getMonth();\n d = date.getDate();\n h = date.getHours();\n min = date.getMinutes();\n fname = m+'-'+d+'-'+y+'--'+h+'-'+min+'.json';\n format = \"json\";\n var content = {courseObjList, timeObjList};\n\n // save the JSON storage with the name as current timestamp\n download(fname, format, JSON.stringify(content, null, '\\t'));\n}", "title": "" }, { "docid": "cd994d86f648334987e3321a291c957b", "score": "0.5481039", "text": "init() {\n this._super(...arguments);\n\n let tiles = this.get('localStorage').getItem(TILES_LOCAL_STORAGE_KEY);\n\n if (!tiles) {\n this.newTiles();\n\n this.saveTiles();\n\n return;\n }\n\n tiles = tiles.map((tile) => {\n const tileClass = EmberObject.create(tile);\n tileClass.activity = EmberObject.create(tileClass.activity);\n\n return tileClass;\n });\n this.set('tiles', tiles);\n this.saveTiles();\n }", "title": "" }, { "docid": "5bbe54a21bdfe09e728bb313f1fba51f", "score": "0.5480922", "text": "function initialiseCourseRecreation() {\n\n var windowWidth = $(window).width();\n var colorBoxWidth = \"80%\";\n if (windowWidth < 1000) {\n colorBoxWidth = \"860px\";\n }\n\n var windowHeight = $(window).width();\n var colorBoxHeight = \"80%\";\n if (windowHeight < 700) {\n colorBoxHeight = \"600px\";\n }\n\n $(\"a.course_recreate\").colorbox({\n iframe:true, width:colorBoxWidth, height:colorBoxHeight, top: '100px', className: \"migration\", opacity: \"0.7\",\n onLoad: function() {\n lightBoxCloseButton();\n },\n onCleanup:function() {\n $('#tii_close_bar').remove();\n }\n });\n\n $('.browser_checkbox').click(function() {\n if ($('.browser_checkbox:checked').length > 0) {\n $('.create_checkboxes').slideDown();\n } else {\n $('.create_checkboxes').slideUp();\n }\n });\n }", "title": "" }, { "docid": "a64a7b6c9957cb83bb7219b4add99b4e", "score": "0.54697454", "text": "function Instances() {\n var instancias = {},\n objLocation = window.location,\n modalLS = objLocation.pathname + objLocation.search;\n //Verificamoºs que el local storage esté disponible;\n if (!store.enabled) {\n alert('Local storage is not supported by your browser. Please disable \"Private Mode\", or upgrade to a modern browser.')\n return\n } else {\n instancias.LSinstance = store.get(modalLS); //Verificar si el hash es utilizable para los contextos.\n\n //Verificamos que exista una instancia del contexto window.location en local storage.\n if (instancias.LSinstance === undefined) {\n store.set(modalLS, {});\n instancias.LSinstance = store.get(modalLS);\n } else {\n __construirVentanas(instancias.LSinstance);\n }\n }\n\n function __construirVentanas(localInstances) {\n var i = 1;\n for (var inst in localInstances) {\n config = localInstances[inst];\n }\n }\n\n /**\n * Retorna las instancias disponibles.\n *\n * @method getInstancias\n * @return {Object} Objeto compuesto por las instancias creadas.\n */\n this.getInstancias = function () {\n return instancias;\n };\n /**\n * Crea una nueva instancia para el contexto seleccionado.\n *\n * @method newInstance\n * @param {Object} modalParent Objeto contexto\n */\n this.newInstance = function (modalParent) {\n var id = modalParent.attr(\"id\");\n if (!instancias.hasOwnProperty(id)) {\n instancias[id] = {};\n instancias[id].contexto = modalParent;\n instancias[id].modales = [];\n }\n };\n /**\n * Crea una nueva instancia del modal en el contexto seleccionado.\n *\n * @method setInstanciaModal\n * @param {object} modal Objeto modal\n * @param {string} idContenedor El identificador de la instancia que da contexto al contenedor de las ventanas minimizadas.\n */\n this.setInstanciaModal = function (modal, idContenedor) {\n var id = \"modal\" + Date.now();\n modal.ID = id;\n instancias[idContenedor].modales.push(modal);\n instancias.LSinstance[id] = modal.storeConfig;\n store.set(modalLS, instancias.LSinstance);\n };\n /**\n * [getInstanciaModal description]\n * @param {[type]} idModal [description]\n * @param {[type]} idContenedor [description]\n * @return {[type]} [description]\n */\n this.getInstanciaModal = function (idModal, idContenedor) {\n var instancia = instancias[idContenedor].modales,\n modal = $.grep(instancia, function (e) {\n return e.ID === idModal\n });\n return modal;\n }\n /**\n * Retorna instancia de los modales.\n *\n * @method getInstancia\n * @param {string} id El identificador de la instancia.\n * @return {object} Instacia requerida.\n */\n this.getInstancia = function (id) {\n return instancias[id];\n };\n /**\n * Crea la instancia para el contenedor de las ventanas minimizadas para el contexto seleccionado.\n *\n * @method setMiniContenedor\n * @param {string} id El identificador de la instancia que da contexto al contenedor de las ventanas minimizadas.\n * @param {object} contenedor Objeto con referencia html\n */\n this.setMiniContenedor = function (id, contenedor) {\n instancias[id].mini = contenedor;\n };\n /**\n * Retorna la instancia del contenedor de las ventanas minimizadas para el contexto seleccionado.\n *\n * getMiniContenedor\n * @param {string} idInstancia El identificador de la instancia que da contexto al contenedor de las ventanas minimizadas.\n * @return {object} Referencia al contenedor.\n */\n this.getMiniContenedor = function (idInstancia) {\n return instancias[idInstancia].mini;\n };\n\n }", "title": "" }, { "docid": "6dab13c8a7db7d1ae3626fb483aba8af", "score": "0.54649204", "text": "function displayCoursesOnPage(coursesObject) {\n let container = document.getElementById(\"class-body\");\n container.innerHTML = \"\";\n for (const course of coursesObject) {\n let header = document.createElement(\"h5\");\n header.textContent =\n course.CourseName + \" by Professor \" + course.Professor;\n container.appendChild(header);\n let courseAttributes = document.createElement(\"ul\");\n if (course.MeetingTime !== undefined) {\n let meetingTimeAttribute = document.createElement(\"li\");\n meetingTimeAttribute.textContent = \"Meeting time: \" + course.MeetingTime;\n courseAttributes.appendChild(meetingTimeAttribute);\n }\n\n let linksAttribute = document.createElement(\"li\");\n linksAttribute.textContent = \"Links:\";\n let linksList = document.createElement(\"ul\");\n for (const link of course.links) {\n let singleLinkItem = document.createElement(\"li\");\n singleLinkItem.innerHTML = `<a href=${link.Link}> ${link.Tag} </a>`;\n linksList.appendChild(singleLinkItem);\n }\n linksAttribute.appendChild(linksList);\n courseAttributes.appendChild(linksAttribute);\n container.appendChild(courseAttributes);\n\n updateDropDowns(course);\n }\n}", "title": "" }, { "docid": "ff40a1bd9241e85edee05760c6c72af8", "score": "0.54411435", "text": "function initQuiz() {\n\n //DO LAST//\n // Check Local Storage\n //your scorelist = localStorage(USE JSON.parse)\n // scoreList = localStorage.JSON.parse(\"#high-scores\");\n\n //If null \n //Score array is []\n\n // Start Screen\n let startScreen = document.getElementById(\"test-control-container\");\n\n // Setting Hide Attribute to Hide Start Screen\n startScreen.setAttribute(\"class\", \"hide\");\n\n // Remove Attribute of Hide for Test Question and Test Answers and Timer Divs (Display)\n testQuestion.removeAttribute(\"class\");\n clickOptions.removeAttribute(\"class\");\n timer.removeAttribute(\"class\");\n\n // Execute the Timer, Populate Qs and As\n initTimer();\n populateQuestion();\n populateButtons();\n\n }", "title": "" }, { "docid": "62611109d17ebae406531112d2df5acd", "score": "0.54403263", "text": "function init() { \n var storedAppointments = []; // Array to hold appointments in local storage\n\n // Get stored appointments from local storage\n storedAppointments = JSON.parse(localStorage.getItem(\"appointments\"));\n\n // If appointments were retrieved from localStorage, update the appointments array to it\n if (storedAppointments !== null) {\n appointments = storedAppointments;\n }\n\n // Create the hourly time blocks and display them\n renderAllHourlyTimeBlocks();\n\n // Get the current date and display it -- in format day, month digits\n $(\"#currentDay\").text(moment().format('dddd') + \", \" + moment().format('MMMM') + ' ' + moment().format('Do'));\n}", "title": "" }, { "docid": "8e28fd60818a83d9eac5e77a4964f68d", "score": "0.5432361", "text": "function getCourses() {\n var course_list = [\"Intermediate Programming with Java\",\n \"This course is a rigorous introduction to the fundamental concepts and techniques of computer programming using the Java programming language.\",\n \"A\",\n \"Discrete Structures for Computer Science\",\n \"The purpose of this course is to understand and use (abstract) discrete structures that are backbones of computer science. In particular, this class is meant to introduce logic, proofs, sets, relations, functions, counting, and probability, with an emphasis on applications in computer science.\",\n \"A\",\n \"Data Structure\",\n \"This course emphasizes the study of the basic data structures of computer science (stacks, queues, trees, lists, graphs) and their implementations using the Java language. Included in this study are programming techniques which use recursion and reference variables. Students in this course are also introduced to various searching and sorting methods and are also expected to develop an intuitive understanding of the complexity of these algorithms.\",\n \"B\",\n \"Computer Organization and Assembly Language\",\n \"The purpose of this course is to study the components of computing systems common to most computer architectures. In particular, this class is meant to introduce data representation, types of processors (e.g., RISC V. CISC), memory types and hierarchy, assembly language, linking and loading, and an introduction to device drivers.\",\n \"A-\",\n \"Introduction to Systems Software\",\n \"This course will introduce the students to the important systems language, C, and to several topics related to the hardware and software environment. These are issues related to device interfaces and hardware synchronization at the lowest level of the operating system, the linkage of operating system services to application software, and the fundamental mechanisms for computer communications.\",\n \"A\",\n \"Algorithm Implementation\",\n \"This course covers a broad range of the most commonly used algorithms. Some examples include algorithms for sorting, searching, encryption, compression and local search. The students will implement and test several algorithms. The course is programming intensive.\",\n \"B+\",\n \"Formal Methods in Computer Science\",\n \"The goals of the course are to develop student skills in modeling problems using discrete mathematics, to introduce students to new discrete structures, to further develop students' mathematical and algorithmic reasoning skills, and to introduce students to the theoretical study of information and computations as a physical phenomenon. Topics covered will include: discrete mathematics; algorithm analysis, including asymptotic notation, finding run times of iterative programs with nested loops, and using recurrence relations to find run times of recursive programs; and theory of computation, including finite state machines, regular languages, Kleene's Theorem, Church-Turing Thesis, and non-computability of the Halting Problem.\",\n \"B\",\n \"Introduction to Operating Systems\",\n \"The purpose of this course is to understand and use the basic concepts of operating systems, common to most computer systems, which interfaces the machine with the programmer. In particular, this class is meant to introduce processes such as the processing unit, process management, concurrency, communication, memory management and protection, and file systems.\",\n \"B\",\n \"Software Quality Assurance\",\n \"This course provides students with a broad understanding of modern software testing and quality assurance. Although it will cover testing theory, the emphasis is on providing practical skills in software testing currently used in industry. To that end, it will cover: manual and automated tests, test- driven and behavior-driven development, performance testing, and understanding and developing a testing process. The course is project-oriented, with students working in groups on specific deliverables on various software products, as would be expected in an industry setting.\",\n \"A\",\n \"Data Communication and Computer Networks\",\n \"The course emphasizes basic principles and topics of computer communications. The first part of the course provides an overview of interfaces that interconnect hardware and software components, describes the procedures and rules involved in the communication process and most importantly the software which controls computers communication. The second part of the course discusses network architectures and design principles, and describes the basic protocol suites. The third part of the course introduces the concept of internetworking, a powerful abstraction that deals with the complexity of multiple underlying communication technologies.\",\n \"TBD\",\n \"Software Engineering\",\n \"The purpose of this course is to provide a general survey of software engineering. Some of the topics covered include: project planning and management, design techniques, verification and validation, and software maintenance. Particular emphasis is on a group project in which a group of 2 students implement a system from its specification.\",\n \"TBD\"];\n return course_list;\n}", "title": "" }, { "docid": "d190b72c75b140154ecc09af00bfcbec", "score": "0.5422651", "text": "static load(){\n //1. Update Logo to redirect to Home\n HOME_BTN.onclick = () => {\n clearStorageExcept([\"token\"])\n MenuItem.hide();\n MyNotes.load();\n }\n\n //2. Update User Icon to edit and logout\n UserMenu.create(this)\n\n //4. Enable Body.\n AUTH_CONTAINER.style.display = \"block\";\n \n //5. Redirect to Home page\n MyNotes.load()\n }", "title": "" }, { "docid": "c96a7b49d94a92f91e9e54c361798288", "score": "0.5422294", "text": "async function createCourse() {\n const course = new Course({ // object made from courseSchema model / class\n name: 'Angular course',\n author: 'Ralph',\n tags: [ 'angular', 'frontend' ],\n isPublished: true // date not defined because we have that defaulted!\n });\n \n const result = await course.save(); // 'save()' is a asynchronous action\n console.log(result);\n }", "title": "" }, { "docid": "5f5eb76593b3b548bdf4ffe23676082d", "score": "0.54175806", "text": "function init() {\n var storedcityHistory = JSON.parse(localStorage.getItem(\"cityHistory\"));\n if (storedcityHistory !== null) {\n cityHistory = storedcityHistory;\n }\n\n rendercityHistory();\n}", "title": "" }, { "docid": "9bc2fde90bc6d683ff371659acf7e05a", "score": "0.5414141", "text": "function showCourseDetail(id) {\r\n changePage('course-template.html');\r\n $(document).ready(function(){\r\n $.getJSON(\"courses.json\", function (data) {\r\n $.each(data.courses, function () {\r\n if (this.course_id === id) {\r\n //change page to course template\r\n \r\n $(\"#c-title\").append(this.course_name);\r\n $(\"#c-desc\").text(this.course_description);\r\n $(\"#c-reccomend\").text(this.course_recommend);\r\n $(\"#c-price\").append(this.course_price);\r\n\r\n }\r\n });\r\n \r\n });\r\n });\r\n}", "title": "" }, { "docid": "fe898d1b559916833653e969dfb8e928", "score": "0.54093444", "text": "function onLoad() {\n document.addEventListener('keydown', onKeyPress);\n document.getElementById('add-task').addEventListener('click', addTask);\n document.getElementById('toggle-dark').addEventListener('click', toggleDarkMode);\n document.getElementById('close-modal').addEventListener('click', toggleAbout);\n document.getElementById('show-about').addEventListener('click', toggleAbout);\n document.getElementById('complete-all').addEventListener('click', markAllComplete);\n document.getElementById('tab-scroll-left').addEventListener('click', () => scrollTabList(-1));\n document.getElementById('tab-scroll-right').addEventListener('click', () => scrollTabList(1));\n\n window.addEventListener('resize', recomputeTabScroll);\n\n loadTasks();\n repopulateDOMTasks();\n repopulateDOMTabs();\n\n switchToList(0);\n\n // Note: values stored as booleans into localStorage may be returned as strings\n const useDarkMode = localStorage.getItem('dark-mode');\n if (useDarkMode === 'true' || useDarkMode === true) {\n toggleDarkMode();\n }\n\n // Note: values stored as booleans into localStorage may be returned as strings\n const returningUser = localStorage.getItem('returning-user');\n if (returningUser !== 'true' && returningUser !== true) {\n toggleAbout();\n localStorage.setItem('returning-user', true);\n }\n }", "title": "" }, { "docid": "50beb1b1f0c31c50e83108d88ce254c5", "score": "0.54030985", "text": "renderAllCourses() {\n const ul = currentPageDiv.querySelector('ul#course-list')\n ul.innerHTML = ''\n this.courses.forEach(course => course.renderCourse())\n }", "title": "" }, { "docid": "0917748f807abb7c26fa64df94890afb", "score": "0.53981775", "text": "function addCourse() {\n $.get(\"/menu/add_course\", function () {\n updateCourseDisplay();\n });\n }", "title": "" }, { "docid": "fa99bff94f29c1b3faff9276de6bad8b", "score": "0.5393025", "text": "function setup(){\n $newItemButton.show();\n $newItemForm.hide();\n\n\n var Todayposition = document.getElementById(\"TodayIs\");\n var todayIsText = document.createTextNode(\"Welcome : \"+today);\n Todayposition.appendChild(todayIsText);\n\n\n var monthSelectionPosition = document.getElementById(\"month\").children;\n monthSelectionPosition[month].setAttribute(\"selected\",\"selected\");\n\n var daySelectedPosition = document.getElementById(\"day\").children;\n daySelectedPosition[day].setAttribute(\"selected\",\"selected\");\n\n //var timeSelectedPosition = document.getElementById(\"time\");\n //var nowTime = hour+\":\" +minute\n //timeSelectedPosition.setAttribute(\"value\",nowTime);\n\n\n\n\n if(i>1){\n\n for (var j=1;j<i ;j++){\n if(localStorage.getItem(j)!=null) {\n\n var JSONOut = localStorage.getItem(j);\n var parsedJSON = JSON.parse(JSONOut);\n console.log(parsedJSON);\n var inText = parsedJSON.accessText;\n var inDate = parsedJSON.accessDate;\n var inID = parsedJSON.accessID;\n var inDueDate = parsedJSON.accessDueDate;\n var soon = parsedJSON.accessSoon;\n var difficult = parsedJSON.accessDifficult;\n\n if (inText != null) {\n createRow(inText, (inID), inDate, inDueDate, true, soon, difficult);\n\n }\n }\n }\n }\n}", "title": "" }, { "docid": "69685094e42318611895a676f6ba5562", "score": "0.53884196", "text": "function saveBook() {\r\n // get values from form elements\r\n var title = newBookTitle.value;\r\n var author = newBookAuthor.value;\r\n var year = newBookYear.value;\r\n var category = newBookCategory.options[newBookCategory.selectedIndex].text;\r\n var isbn = newBookIsbn.value;\r\n\r\n // create the new book object with those values\r\n var newBook = new Book(title, author, year, category, isbn);\r\n\r\n // check if the localStorage has a books data\r\n if (localStorage.getItem('books') === null) {\r\n // if not, create one\r\n var books = [];\r\n // and add the new book object to it\r\n books.push(newBook);\r\n localStorage.setItem('books', JSON.stringify(books));\r\n } else {\r\n // otherwise, add the new book object to the existing data\r\n var books = JSON.parse(localStorage.getItem('books'));\r\n books.push(newBook);\r\n localStorage.setItem('books', JSON.stringify(books));\r\n }\r\n\r\n // add the new book object to the book list too\r\n createListItem(newBook);\r\n}", "title": "" }, { "docid": "0c0ab627eebee5dd8a3a46872e067c41", "score": "0.5383313", "text": "function loadLibrary(){\n if(!localStorage.length){\n return;\n } else{\n const storedLibrary = JSON.parse(localStorage.getItem('library'));\n myLibrary = storedLibrary.map(book => new Book(book));\n render(myLibrary);\n }\n \n}", "title": "" }, { "docid": "b987ba0202b0732cff045549c1431720", "score": "0.53831464", "text": "function initCart() {\n if (cart_str !== null) {\n cart = new Cart(cart_obj.items, cart_obj.userId);\n }\n else {\n cart = new Cart([], null);\n localStorage.setItem('cart', JSON.stringify(cart));\n }\n}", "title": "" }, { "docid": "d45a94eabc0a200a71674f83d01a1622", "score": "0.5381001", "text": "function populateStorage() {\n localStorage.setItem(\"myLibrary\", JSON.stringify(myLibrary));\n}", "title": "" }, { "docid": "a74256f53aeee8413271f77754c045ed", "score": "0.5380545", "text": "function loadStorage() {\r\n if (localStorage.getItem(\"users\") === null) {\r\n // nao faz nada\r\n } else {\r\n const list = JSON.parse(localStorage.users); // converte de string para json\r\n\r\n console.log(\"Dom fully loaded...\"); // informaçao sobre o ready state do dom\r\n for (const user of list) {\r\n playerList.push(new Player(user.name, user.points));\r\n }\r\n updateLeaderboard();\r\n }\r\n}", "title": "" }, { "docid": "62c2bb19abcf5a10a43c7dd5baa9817f", "score": "0.536664", "text": "function populatelocalStorage() { \n console.log('populatelocalStorage'); \n localStorage.setItem('moduleNo', moduleNumber.value); \n localStorage.setItem('moduleName', moduleName.value); \n localStorage.setItem('className', className.value); \n localStorage.setItem('facultyName', facultyName.value); \n localStorage.setItem('date', datePicker.value); \n localStorage.setItem('timeValue', timePicker.options[timePicker.selectedIndex].value);\n localStorage.setItem('timeText', timePicker.options[timePicker.selectedIndex].text);\n \n}", "title": "" }, { "docid": "9004a328e581eb1848613a68950523c0", "score": "0.53641015", "text": "async componentWillMount() {\n const url = \"https://nut-case.s3.amazonaws.com/coursessc.json\";\n const response = await fetch(url);\n const data = await response.json();\n // saving data in localStorage\n localStorage.setItem(\"data\", JSON.stringify(data));\n }", "title": "" }, { "docid": "edc18ff92419573f4593c68d2aa91322", "score": "0.53622943", "text": "function init() {\n var storedCities = JSON.parse(localStorage.getItem(\"cityName\"));\n if (storedCities !== null) {\n cityName = storedCities;\n }\n cityHistory()\n }", "title": "" }, { "docid": "222069a8dc016b6f95c11ea081e37d98", "score": "0.5361283", "text": "function init(){\n\t//propiedad innerHTML para poder insertar los items del local storage en el nodo texto de los id p0 - p9\n\tdocument.getElementById(\"p1\").innerHTML= localStorage.getItem(\"texto1\");\n\tdocument.getElementById(\"p2\").innerHTML= localStorage.getItem(\"texto2\");\n\tdocument.getElementById(\"p3\").innerHTML= localStorage.getItem(\"texto3\");\n\tdocument.getElementById(\"p4\").innerHTML= localStorage.getItem(\"texto4\");\n\tdocument.getElementById(\"p5\").innerHTML= localStorage.getItem(\"texto5\");\n\tdocument.getElementById(\"p6\").innerHTML= localStorage.getItem(\"texto6\");\n\tdocument.getElementById(\"p7\").innerHTML= localStorage.getItem(\"texto7\");\n\tdocument.getElementById(\"p8\").innerHTML= localStorage.getItem(\"texto8\");\n\tdocument.getElementById(\"p9\").innerHTML= localStorage.getItem(\"texto9\");\n\tdocument.getElementById(\"p0\").innerHTML= localStorage.getItem(\"texto0\");\n}", "title": "" }, { "docid": "171b35e6a597a3fa8b1c29511eac1f21", "score": "0.5359891", "text": "function getTasks() {\n let tasks;\n\n //if there are task in localStorage, get it\n //else return empty array\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n\n const ul = document.querySelector(\".collection\");\n tasks.forEach(function (task) {\n ul.appendChild(createTask(task));\n })\n\n}", "title": "" }, { "docid": "9a70d58da434f000c8bbd03cbb52a70a", "score": "0.5356465", "text": "function populateStorage() {\n localStorage.setItem('city', document.getElementById('city').value);\n localStorage.setItem('startDate', document.getElementById('startDate').value);\n localStorage.setItem('endDate', document.getElementById('endDate').value);\n\n document\n .querySelectorAll('#entryHolder> div, section >div')\n .forEach((element, index) => {\n localStorage.setItem(`div${index}`, element.innerHTML);\n });\n}", "title": "" }, { "docid": "aa2e8d39d41dbd61371471f1f1449eb3", "score": "0.5354607", "text": "function init() {\n if (window.localStorage.getItem('productList')) {\n productList = JSON.parse(window.localStorage.getItem('productList'));\n } else {\n productList = [];\n }\n\n if (productList.length === 0) {\n noProducts.style.display = \"block\";\n }\n\n btnSave.addEventListener('click', saveProduct);\n showList();\n}", "title": "" }, { "docid": "663b4c1963337c7a0f20836d934c959b", "score": "0.5353576", "text": "function initLists(){\n\t\tvar initialLists = localStorage.getItem('ixigo');\n\t\tinitialLists = JSON.parse(initialLists)\n\t\tif(initialLists && initialLists.length > 0){\n\t\t\tpopulateLists(initialLists);\n\t\t}\n\t\telse{\n\t\t\t$('#lists').html('<h3> No Lists Added </h3>')\n\t\t}\n\t}", "title": "" }, { "docid": "4554feb9d858cdcf53c50cf1d249d2cf", "score": "0.53498656", "text": "function Init()\n{\n // Application shortcut\n application = $(\"#application\");\n \n // Setup window array and give each window an ID\n // This weird looking .each statement will add the windows in reverse order\n var i = 1;\n $($(\".window\").get().reverse()).each(function(){\n windows.windows.push( this );\n $(this).attr(\"id\", i++ );\n }); \n \n SetupWindows();\n InitSchedule();\n \n // Get the courses already added for this session\n Dajaxice.ssu.get_session_courses( ProcessSessionCourses );\n \n}", "title": "" }, { "docid": "ddc9b8943e2760fecdd07b856021a655", "score": "0.5347962", "text": "function getCourses() {\n if(coursesEl){coursesEl.innerHTML = ''};\n fetch(\"http://localhost:8888/moment5/api/read.php\")\n .then(response => response.json()\n .then(data => {\n data.forEach(courses => {\n if(coursesEl){coursesEl.innerHTML +=\n `<div class=\"course\"> \n<p> \n<b> Kurskod:</b> ${courses.code} <br/>\n<b> Kursnamn:</b> ${courses.name}<br/>\n<b> Progression:</b> ${courses.progression}<br/>\n<b> Kursplan:</b> <a class=\"syllabus_link\" href=\"${courses.coursesyllabus}\" target=\"_blank\">Länk här</a>\n</p>\n<button id=\"${courses.id}\" onClick=\"getOneToUpdate(${courses.id})\">Uppdatera</button>\n<button id=\"${courses.id}\" onClick=\"deleteCourse(${courses.id})\">Radera</button> \n</div>`}\n\n })\n }))\n}", "title": "" }, { "docid": "305bdad8221f2bea99626feb2249fe3a", "score": "0.5347251", "text": "function init() {\n const newCheckBox = document.createElement('span');\n const isStoredAsChecked =\n localStorage.getItem(requirementListItem.id) ?? false;\n if (isStoredAsChecked) {\n requirementListItem.className = liClassChecked;\n newCheckBox.className = cbClassChecked;\n } else {\n requirementListItem.className = liClassUnchecked;\n newCheckBox.className = cbClassUnchecked;\n }\n requirementListItem.insertBefore(\n newCheckBox,\n requirementListItem.firstChild,\n );\n }", "title": "" }, { "docid": "cbc8059c68c9cbef1fb699a7c8c98f5c", "score": "0.53469074", "text": "init() {\n\t\t// ES6 short notation for `function: init()`\n\t\tlet _contents = localStorage.getItem(CART.KEY);\n\t\tif (_contents) {\n\t\t\tCART.contents = JSON.parse(_contents);\n\t\t} else {\n\t\t\t// Dummy data; on production you'd use an empty array\n\t\t\tCART.contents = [\n\t\t\t\t{ id: 123, title: 'Nope', qty: 3, itemPrice: 2.3 },\n\t\t\t\t{ id: 456, title: 'Cool', qty: 2, itemPrice: 1.5 },\n\t\t\t\t{ id: 987, title: 'Ok', qty: 1, itemPrice: 1 },\n\t\t\t];\n\t\t\tCART.sync();\n\t\t}\n\t}", "title": "" }, { "docid": "087cdac8ee8d36f3a1dba042cfbfc47a", "score": "0.534334", "text": "function initialisation(){\r\n\r\n //load various data in the DOM\r\n loadRequiredShipList();\r\n loadRewardList();\r\n loadRequiredMapList();\r\n\r\n displayAllQuestBoxes(Object.keys(ALL_QUESTS_LIST));\r\n\r\n //load the pending quests saved in the cookie, or an empty one if no cookie are saved\r\n\r\n // load the user quest cookie or create an empty one\r\n\r\n var cookieContent = getCookie('user_quests');\r\n console.log(cookieContent);\r\n var questCookie = {};\r\n if (cookieContent === \"\"){\r\n questCookie = {pendingQuests:[], userDecisions:{}, periodicCompleted:false, questAdvice:[], timeStamp:moment().format()};\r\n } else {\r\n questCookie = JSON.parse(cookieContent);\r\n }\r\n\r\n console.log(questCookie);\r\n\r\n timeVerificationLoop(questCookie.timeStamp);\r\n\r\n calculateQuestState(questCookie);\r\n\r\n\r\n loadFlowchart();\r\n resizeWindow();\r\n displayFlowchart();\r\n updateFlowchartColors();\r\n }", "title": "" }, { "docid": "58ea64789823a540dad3e76bca2eacfc", "score": "0.5340676", "text": "function init(){\n var storedHS = JSON.parse(localStorage.getItem(\"scores\"));\n\n if(storedHS !== null ){\n scores = storedHS;\n }\n storeHS();\n renderHS();\n}", "title": "" }, { "docid": "376249a0a719d4b3814c4266603b4e91", "score": "0.5340437", "text": "function Course() {\n}", "title": "" }, { "docid": "116f2f55f2f019280ca527d79e06e3ba", "score": "0.53384006", "text": "_setLocalStorage() {\n localStorage.setItem('workouts', JSON.stringify(this.#workouts));\n //dont forget to use locally stored data at initiation. To APP class construtor this issue is added.\n }", "title": "" }, { "docid": "cdb7508aaeb4e3ac82dc5b435c16c423", "score": "0.5335707", "text": "function init() {\n // JSON used to retrieve an array from local storage\n var storedTodos = JSON.parse(localStorage.getItem(\"todos\"));\n // if storedTodos exists...\n if (storedTodos) {\n // update the main array with the stored data\n todos = storedTodos;\n }\n // update the display\n renderTodos();\n}", "title": "" }, { "docid": "591f9cfa54d8d9a02dc494ee86274457", "score": "0.5330339", "text": "function populateStorage() {\n localStorage.setItem('myLibrary',JSON.stringify(myLibrary));\n}", "title": "" }, { "docid": "dc3669abddcae6d49d06253e61a047d8", "score": "0.53274465", "text": "function _initializeData() {\n\t\t_saveDefaults();\n\n\t\tconst introClip =\n\t\t\tnew app.ClipItem(INTRO_TEXT, Date.now(), true,\n\t\t\t\tfalse, app.Device.myName());\n\t\tintroClip.save();\n\n\t\tapp.User.setInfo().catch((error) => {});\n\t}", "title": "" }, { "docid": "89d3527ac808251cc02f2de0c8c39152", "score": "0.5324362", "text": "function populateStorage() {\n localStorage.setItem('projects', JSON.stringify(projects));\n}", "title": "" }, { "docid": "456ba0f94dc11254792c128c9c039b77", "score": "0.5322375", "text": "function makeCapstoneWork(){\n helpPeersOutSection();\n helpPeersOut();\n readSection();\n populateList();\n populateBooks();\n bookReviews();\n studySection();\n getTextbook();\n homePageSection();\n }", "title": "" }, { "docid": "6c1471487cc711f035ae902e17f5ed54", "score": "0.5321913", "text": "function loadAfterPageSwitch() {\r\n careerFairData = PersistentStorage.retrieveObject(\"careerFairData\");\r\n categories = PersistentStorage.retrieveObject(\"categories\");\r\n filters = PersistentStorage.retrieveObject(\"filters\");\r\n}", "title": "" }, { "docid": "7fce7d33b28618c747feb4ffd8a86cfb", "score": "0.5318093", "text": "function load() {\n let data = localStorage.getItem('user_gizmos');\n if (!data) {\n gizmos = {};\n } else {\n gizmos = JSON.parse(data);\n console.log('Loading gizmos:', gizmos);\n // Build view\n for (const id of Object.keys(gizmos)) {\n build(id);\n lastGizmoId++;\n };\n }\n }", "title": "" } ]
6346390ed4ed06e9e775133b7f89f34a
super duper juggling algorithm
[ { "docid": "5c09d3fd1cab432549dbd4c0e780d3df", "score": "0.0", "text": "function rightRotate (arr, d) {\n let j, k, t, t2,\n n = arr.length,\n _gcd = gcd(d, n),\n jumps = n / _gcd\n for (let i = 0; i < _gcd; i++) {\n t = arr[i]\n for (let z = i, j = 0;\n j <= jumps;\n j++, z = (z + d) % n) {\n t2 = arr[z]\n arr[z] = t\n t = t2\n\n // info(arr+\" \"+t+\" \"+t2+\" \"+z+\" \"+j);\n }\n }\n return arr\n}", "title": "" } ]
[ { "docid": "f0d829c2cc9779e472035a490b3ecfd7", "score": "0.57766944", "text": "function find(nums, ordering, goal){\n let results=[0,0,0,0,0,0]\n let strs=[\"\",\"\",\"\",\"\",\"\",\"\"]\n results[0]=nums[ordering[0]]\n strs[0]=\"\"+nums[ordering[0]]\n for(let op1=0; op1<4; op1++){\n let outp=operate(results[0],nums[ordering[1]],op1, goal, 1+1, strs[0])\n // console.log(outp)\n results[1]=outp[0]\n strs[1] = outp[1]\n for(let op2=0; op2<4; op2++){\n let outp=operate(results[1],nums[ordering[2]],op2, goal, 2+1, strs[1])\n results[2]=outp[0]\n strs[2] = outp[1]\n\n for(let op3=0; op3<4; op3++){\n let outp=operate(results[2],nums[ordering[3]],op3, goal, 3+1, strs[2])\n results[3]=outp[0]\n strs[3] = outp[1]\n\n for(let op4=0; op4<4; op4++){\n let outp=operate(results[3],nums[ordering[4]],op4, goal, 4+1, strs[3])\n results[4]=outp[0]\n strs[4] = outp[1]\n\n for(let op5=0; op5<4; op5++){\n let outp=operate(results[4],nums[ordering[5]],op5, goal, 5+1, strs[4])\n results[5]=outp[0]\n strs[5] = outp[1]\n\n\n //account for using other 2 separately\n outp = operate(nums[ordering[4]], nums[ordering[5]], op4, goal, 2, \"\"+nums[ordering[4]])\n let tmpResults = outp[0]\n let tmpStr = outp[1]\n\n operate(results[3], tmpResults,op5, goal, 6, strs[3], \"(\"+tmpStr+\")\")\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "9bab276e3a8c9167580dcf52cac9e888", "score": "0.5736008", "text": "function Ja(a){var b,c,d,e,f;for(b=0;b<a.length;b++)for(c=a[b],d=0;d<c.length;d++)for(e=c[d],e.forwardSegs=[],f=b+1;f<a.length;f++)La(e,a[f],e.forwardSegs)}", "title": "" }, { "docid": "f8d9c299584abeb1365d4fc2051f0073", "score": "0.57345355", "text": "function part2(arr) {\n let trees = 0;\n let x = 0;\n let answer = 0;\n\n //A\n for (i = 1; i < arr.length; i++) {\n x = x + 1;\n\n if (x > 30) {\n over = x - 30;\n x = over - 1;\n }\n\n let yPosition = arr[i];\n let position = yPosition[x];\n\n if (position === \"#\") {\n trees++;\n }\n }\n answer = trees;\n trees = 0;\n x = 0;\n\n //B\n for (i = 1; i < arr.length; i++) {\n x = x + 3;\n\n if (x > 30) {\n over = x - 30;\n x = over - 1;\n }\n\n let yPosition = arr[i];\n let position = yPosition[x];\n\n if (position === \"#\") {\n trees++;\n }\n }\n answer = answer * trees;\n trees = 0;\n x = 0;\n\n //C\n for (i = 1; i < arr.length; i++) {\n x = x + 5;\n\n if (x > 30) {\n over = x - 30;\n x = over - 1;\n }\n\n let yPosition = arr[i];\n let position = yPosition[x];\n\n if (position === \"#\") {\n trees++;\n }\n }\n answer = answer * trees;\n trees = 0;\n x = 0;\n\n //D\n for (i = 1; i < arr.length; i++) {\n x = x + 7;\n\n if (x > 30) {\n over = x - 30;\n x = over - 1;\n }\n\n let yPosition = arr[i];\n let position = yPosition[x];\n\n if (position === \"#\") {\n trees++;\n }\n }\n answer = answer * trees;\n trees = 0;\n x = 0;\n\n //E\n for (i = 1; i < arr.length; i++) {\n i = i + 1;\n x = x + 1;\n\n if (x > 30) {\n over = x - 30;\n x = over - 1;\n }\n\n let yPosition = arr[i];\n let position = yPosition[x];\n\n if (position === \"#\") {\n trees++;\n }\n }\n answer = answer * trees;\n\n return answer;\n}", "title": "" }, { "docid": "cefa2851f778d539bcb759fd566fad87", "score": "0.5732372", "text": "function part2(input) {\n let data = input.split('').map(el => parseInt(el));\n const max = lodash.max(data);\n data = lodash.concat(data, lodash.range(max+1, 1000000+1));\n const sortedAllData = [...data].sort((a, b) => a - b);\n let i=0;\n \n for (; i<10000000; i++) {\n if (i % 100000 === 0) console.log(i/100000);\n const currentValue = data[0];\n const pickup = [data[1], data[2], data[3]];\n data = lodash.drop(data, 4);\n //console.log('CURRENT VALUE', currentValue, 'PICKUP', pickup);\n //console.log('DATA', data);\n //const dataSort = lodash.difference(sortedAllData, pickup);\n //if (i % 1 === 0) console.log(i, 'difference', dataSort);\n \n let destination = lodash.nth(sortedAllData, lodash.findLastIndex(sortedAllData, el => !pickup.includes(el), lodash.sortedIndexOf(sortedAllData, currentValue - 1)));\n //console.log('destination before', destination);\n if (pickup.includes(destination)) {\n const dataSort = lodash.difference(sortedAllData, pickup);\n destination = lodash.indexOf(data, dataSort[dataSort.length-1])\n }\n else {\n destination = lodash.indexOf(data, destination);\n }\n //if (i % 100000 === 0) console.log(i, 'destination', destination);\n const firstPart = lodash.slice(data, 0, destination+1);\n //console.log('FIRST PART', firstPart);\n const secondPart = lodash.slice(data, destination+1);\n //console.log('SECOND PART', secondPart);\n\n data = lodash.concat(firstPart, pickup, secondPart, currentValue);\n //console.log('DATA END', data);\n //if (i % 100000 === 0) console.log(i, 'replace');\n }\n\n const index1 = lodash.indexOf(data, 1);\n \n if (index1+2 < data.length) {\n console.log(data[index1+1], data[index1+2], data[index1+1]*data[index1+2]);\n }\n else if (index1+1 < data.length) {\n console.log(data[index1+1], data[0], data[index1+1]*data[0]);\n }\n else {\n console.log(data[0], data[1], data[0]*data[1]);\n }\n\n}", "title": "" }, { "docid": "ef7335a3337c7e936347fdc3f7d0b741", "score": "0.5682634", "text": "function solution(S, P, Q) {\n // write your code in JavaScript (Node.js 8.9.4)\n //used jagged array to hold the prefix sums of each A, C and G genoms\n //we don't need to get prefix sums of T, you will see why.\n var genoms=[];\n genoms[0] = [0];\n genoms[1] = [0];\n genoms[2] = [0];\n //if the char is found in the index i, then we set it to be 1 else they are 0\n //3 values are needed for this reason\n var a, c, g;\n for (var i = 0; i < S.length; i++) {\n a = 0; c = 0; g = 0;\n if ('A' == (S[i])) {\n a = 1;\n }\n else if ('C' == (S[i])) {\n c = 1;\n }\n else if ('G' == (S[i])) {\n g = 1;\n }\n //here we calculate prefix sums. To learn what's prefix sums look at here https://codility.com /media/train/3-PrefixSums.pdf\n genoms[0][i+1] = genoms[0][i] + a;\n genoms[1][i+1] = genoms[1][i] + c;\n genoms[2][i+1] = genoms[2][i] + g;\n }\n \n //console.log(genoms);\n \n var result = [];\n //here we go through the provided P[] and Q[] arrays as intervals\n for (var i=0; i < P.length; i++) {\n var fromIndex = P[i];\n //we need to add 1 to Q[i], \n //because our genoms[0][0], genoms[1][0] and genoms[2][0]\n //have 0 values by default, look above genoms[0][i+1] = genoms[0][i] + a; \n var toIndex = Q[i]+1;\n if (genoms[0][toIndex] - genoms[0][fromIndex] > 0) {\n result[i] = 1;\n } else if (genoms[1][toIndex] - genoms[1][fromIndex] > 0) {\n result[i] = 2;\n } else if (genoms[2][toIndex] - genoms[2][fromIndex] > 0) {\n result[i] = 3;\n } else {\n result[i] = 4;\n }\n }\n \n return result;\n}", "title": "" }, { "docid": "54f7ea31e5781b96826650d3902afbf1", "score": "0.5674816", "text": "function minimumBribes(q) {\n let maxPosition = q.length;\n let steps = 0;\n // Used to mimic possible bribes until we get to final position\n let initialState = Array.from({length: maxPosition}, (_, i) => i+1);\n // will store final position indexes difference with initial position for every element\n let afterTable = {};\n // same as above, but will not change, for info request only\n const afterTableStatic = {};\n // to avoid expensive cost of index searching in initial state\n let initialStateIndexes = {};\n\n // getting all the elements with - after position and + after posiition\n // - value: it is sure q[i] bribe a position\n // + value: moved forward its position lastly or as a result of - values movement\n // 0 value: ordered\n let i;\n for(i = 0; i < maxPosition; i++) {\n afterTable[q[i]] = ((i+1) - q[i]);\n afterTableStatic[q[i]] = i;\n initialStateIndexes[i+1] = i;\n }\n\n // hacker test purpose\n //let chaoticMsg = false;\n let tempValue;\n let currentElementLocation= 0;\n let element;\n let elementMinusOne;\n let elementMinusOneIndex\n let elementMinusTwo;\n let elementMinusTwoIndex;\n for(element in afterTable) {\n if(afterTable.hasOwnProperty(element)) {\n if(afterTable[element] < -2) {\n // hacker test purpose\n //chaoticMsg = true;\n //console.log('Too chaotic');\n //break;\n\n // for local testing\n return 'Too chaotic';\n\n }\n if(afterTable[element] < 0) {\n currentElementLocation = parseInt(element);\n // look backwards last two elements in initial state\n //second element\n elementMinusOne = initialState[currentElementLocation-2];\n // first element\n elementMinusTwo = initialState[currentElementLocation-3];\n // if element-2 is greater than element-1 then do nothin\n // if this was false, that means both were swapped before\n if(elementMinusOne > elementMinusTwo) {\n // search for its orders within q array, if they are in same order do nothing\n elementMinusOneIndex = afterTableStatic[elementMinusOne]\n elementMinusTwoIndex = afterTableStatic[elementMinusTwo]\n // if they are inverted, swap them before swap element\n if(elementMinusTwoIndex > elementMinusOneIndex) {\n // swap in initialState\n [initialState[initialStateIndexes[elementMinusOne]],\n initialState[initialStateIndexes[elementMinusTwo]]] =\n [initialState[initialStateIndexes[elementMinusTwo]],\n initialState[initialStateIndexes[elementMinusOne]]];\n // change indexes in initialStateIndexes\n [initialStateIndexes[elementMinusOne],\n initialStateIndexes[elementMinusTwo]] =\n [initialStateIndexes[elementMinusTwo],\n initialStateIndexes[elementMinusOne]];\n // update afterTable\n afterTable[elementMinusOne] =\n (afterTable[elementMinusOne] < 0) ? ++afterTable[elementMinusOne]\n : --afterTable[elementMinusOne];\n afterTable[elementMinusTwo] =\n (afterTable[elementMinusTwo] < 0) ? ++afterTable[elementMinusTwo]\n : --afterTable[elementMinusTwo];\n ++steps\n }\n }\n\n // relocate until afterTable is 0\n while(afterTable[element] < 0) {\n //console.log(initialState);\n tempValue = initialState[currentElementLocation-1];\n initialState[currentElementLocation-1] = initialState[currentElementLocation-2];\n initialState[currentElementLocation-2] = tempValue;\n\n // storing initial state indexes to avoid search for elements in second iteration over all afterTable elements\n initialStateIndexes[initialState[currentElementLocation-1]] = currentElementLocation-1\n initialStateIndexes[initialState[currentElementLocation-2]] = currentElementLocation-2\n\n // update current movement debt from table, movements done to get final state are removed\n // new steps to get final states are computed, until 0 movements in every element are debt\n afterTable[element] += 1;\n afterTable[initialState[currentElementLocation-1]] -=1;\n // because element change its location with left element in initialState\n currentElementLocation -= 1;\n ++steps;\n }\n }\n }\n }\n return steps;\n // hacker test purpose\n //if(!chaoticMsg) console.log(steps);\n}", "title": "" }, { "docid": "8661fc3b47b7601b465b062037619762", "score": "0.5564588", "text": "function solve(words) {\n // create map of words\n // create arr of arrs grouped by word length\n const map = {};\n const wordList = [];\n for (let word of words) {\n let len = word.length;\n if (!wordList[len]) {\n wordList[len] = [];\n }\n\n wordList[len].push(word);\n map[word] = 1;\n }\n\n let max = 1;\n // word list at most consist of 17 + 1 *(words[0] = 0 length words) groups\n // max length of word = 17\n for (let len = 1; len < 17; len++) {\n if (!wordList[len]) continue;\n // check words of \"len\" length\n for (let word of wordList[len]) {\n let preLen = len - 1;\n if (!wordList[preLen]) continue;\n // check len - 1 words\n for (let preWord of wordList[preLen]) {\n // if the preWord is a predecessor of the current word\n if (isPre(preWord, word)) {\n // set val of current word to max(current word val, corresponding preword + 1 *(+1 to add the current word to the chain))\n map[word] = Math.max(map[word], map[preWord] + 1);\n max = Math.max(max, map[word]);\n }\n }\n }\n }\n\n return max;\n\n function isPre(preWord, word) {\n let p1 = 0;\n let p2 = 0;\n let foundBadChar = false;\n while (p1 < preWord.length && p2 < word.length) {\n if (preWord[p1] === word[p2]) {\n p1++;\n p2++;\n } else if (foundBadChar) {\n return false;\n } else {\n // chars dont match\n // move forward one and check again\n foundBadChar = true;\n p2++;\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "2583b9b99e179987583f5dcf9e13cce7", "score": "0.55625623", "text": "function minimumBribes(q) {\n let answer = 0;\n let arr = Array(100001);\n let arrCnt = Array(100001);\n for (let i = 0; i < arr.length; ++i) {\n arr[i] = i + 1;\n }\n for (let i = 0; i < q.length - 1; ++i) {\n let originValue = q[i];\n if (arr[i] !== originValue) {\n if (arr[i + 1] !== originValue) {\n if (arr[i + 2] !== originValue) {\n return 'Too chaotic';\n }\n let temp = arr[i + 2];\n arr[i + 2] = arr[i + 1];\n arr[i + 1] = temp;\n answer++;\n }\n let temp = arr[i + 1];\n arr[i + 1] = arr[i];\n arr[i] = temp;\n answer++;\n }\n }\n return answer;\n}", "title": "" }, { "docid": "1594113e0addac70435f3879b7570c67", "score": "0.5536095", "text": "function u(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;/* guard */\nfor(/* min repeat count */\n0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;c>=d;d++)e=g,g=b[2*(d+1)+1],++h<i&&e===g||(j>h?a.bl_tree[2*e]+=h:0!==e?(e!==f&&a.bl_tree[2*e]++,a.bl_tree[2*Y]++):10>=h?a.bl_tree[2*Z]++:a.bl_tree[2*$]++,h=0,f=e,0===g?(i=138,j=3):e===g?(i=6,j=3):(i=7,j=4))}", "title": "" }, { "docid": "4feef287effaeadfd0687f6e9b013e6e", "score": "0.5534486", "text": "function f(){for(var f=-1*l;f<=l;f+=2){var g=/*istanbul ignore start*/void 0,h=n[f-1],m=n[f+1],o=(m?m.newPos:0)-f;h&&(\n// No one else is going to attempt to use this value, clear it\nn[f-1]=void 0);var p=h&&h.newPos+1<j,q=m&&0<=o&&o<k;if(p||q){\n// If we have hit the end of both strings, then we are done\nif(\n// Select the diagonal that we want to branch from. We select the prior\n// path whose position in the new string is the farthest from the origin\n// and does not pass the bounds of the diff graph\n!p||q&&h.newPos<m.newPos?(g=e(m),i.pushComponent(g.components,void 0,!0)):(g=h,// No need to clone, we've pulled it from the list\ng.newPos++,i.pushComponent(g.components,!0,void 0)),o=i.extractCommon(g,b,a,f),g.newPos+1>=j&&o+1>=k)return c(d(i,g.components,b,a,i.useLongestToken));\n// Otherwise track this path as a potential candidate and continue.\nn[f]=g}else\n// If this path is a terminal then prune\nn[f]=void 0}l++}", "title": "" }, { "docid": "04cee903ab58088497fc1cfb32a35205", "score": "0.55280596", "text": "function m(a){var b,c,d,e,f,g=a.w_size;\n//Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\ndo{\n// JS ints have 32 bit, block below not needed\n/* Deal with !@#$% 64K limit: */\n//if (sizeof(int) <= 2) {\n// if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n// more = wsize;\n//\n// } else if (more == (unsigned)(-1)) {\n// /* Very unlikely, but possible on 16 bit machine if\n// * strstart == 0 && lookahead == 1 (input done a byte at time)\n// */\n// more--;\n// }\n//}\n/* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\nif(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-ja)){C.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,/* we now have strstart >= MAX_DIST */\na.block_start-=g,/* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\nc=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;/* Initialize the hash value now that we have some input: */\nif(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=ha)\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\nfor(f=a.strstart-a.insert,a.ins_h=a.window[f],/* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\na.ins_h=(a.ins_h<<a.hash_shift^a.window[f+1])&a.hash_mask;a.insert&&(/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\na.ins_h=(a.ins_h<<a.hash_shift^a.window[f+ha-1])&a.hash_mask,a.prev[f&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=f,f++,a.insert--,!(a.lookahead+a.insert<ha)););}while(a.lookahead<ja&&0!==a.strm.avail_in)}", "title": "" }, { "docid": "68f7cb626c13b333668116a742db8178", "score": "0.55114347", "text": "function v(a,b,c){var d,e,f=-1,i=b[1],j=0,k=7,l=4;for(/* min repeat count */\n/* tree[max_code+1].Len = -1; */\n/* guard already set */\n0===i&&(k=138,l=3),d=0;c>=d;d++)if(e=i,i=b[2*(d+1)+1],!(++j<k&&e===i)){if(l>j){do h(a,e,a.bl_tree);while(0!==--j)}else 0!==e?(e!==f&&(h(a,e,a.bl_tree),j--),\n//Assert(count >= 3 && count <= 6, \" 3_6?\");\nh(a,Y,a.bl_tree),g(a,j-3,2)):10>=j?(h(a,Z,a.bl_tree),g(a,j-3,3)):(h(a,$,a.bl_tree),g(a,j-11,7));j=0,f=e,0===i?(k=138,l=3):e===i?(k=6,l=3):(k=7,l=4)}}", "title": "" }, { "docid": "0125bfddb7760bf608ce8b51dd9a0cc4", "score": "0.55056345", "text": "function computeProbabilities() {\n // try not to recompute\n if (possibilities != \"?\") return;\n \n possibilities = [];\n\n startTime = new Date();\n foundSafe = 0;\n foundMine = 0;\n loadBoard();\n groupings = getGroupings();\n var groupingsByClue = getGroupingsByClue(groupings);\n nodesVisited = 0;\n \n // start with no clues\n var cluesUsed = [];\n for (var i=0; i<clues.length; i++) cluesUsed[i] = 0;\n var groupingsUsed = new Array(groupings.length).fill(0);\n var cluesUsedCount = 0;\n // possibility: [total mines, # cases, map of grouping ID -> # of mines]\n possibilities = [[0, 1, new Array(groupings.length).fill(0)]];\n \n // apply fixed points and mark each as already used so we don't try to put more mines in\n for (var i=0; i<fixedPoints.length; i++) {\n var fixedGrouping = whichGrouping(fixedPoints[i][1], fixedPoints[i][0]);\n possibilities[0][2][fixedGrouping] = fixedPoints[i][2];\n possibilities[0][0] += fixedPoints[i][2];\n groupingsUsed[fixedGrouping] = 1;\n }\n \n // add clues one at a time and keep track of possibilities\n while (cluesUsedCount < clues.length) {\n // find the best clue - the one with the smallest supergroup boundary\n var bestClue = -1;\n var bestClueBoundary = groupings.length+1; // change in # of boundary groups\n \n for (var tryClue=0; tryClue<clues.length; tryClue++) {\n if (cluesUsed[tryClue] == 1) continue;\n cluesUsed[tryClue] = 1;\n var newBoundary = getBoundary(groupings, cluesUsed);\n var newSupergroups = getBoundarySupergroups(groupings, cluesUsed, newBoundary);\n cluesUsed[tryClue] = 0;\n var boundaryChange = newSupergroups.length;\n if (boundaryChange < bestClueBoundary) {\n bestClue = tryClue;\n\tbestClueBoundary = boundaryChange;\n }\n }\n \n // add this clue\n cluesUsed[bestClue] = 1;\n cluesUsedCount++;\n var newBoundary = getBoundary(groupings, cluesUsed);\n var supergroups = getBoundarySupergroups(groupings, cluesUsed, newBoundary);\n \n // groupings we are going to be adding\n var relevantGroupings = [];\n for (var rg=0; rg<groupingsByClue[bestClue].length; rg++) {\n var grouping_id = groupingsByClue[bestClue][rg];\n if (groupingsUsed[grouping_id] == 0) {\n relevantGroupings.push(grouping_id);\n\tgroupingsUsed[grouping_id] = 1;\n }\n }\n \n // construct new possibilities\n var newPossibilities = {};\n for (var p=0; p<possibilities.length; p++) {\n var possibilityVal = possibilities[p];\n \n // compute extraMines: number of mines that we need to add to satisfy the clue\n var extraMines = clues[bestClue][2];\n var removedTotalMines = 0;\n for (var i = 0; i < groupingsByClue[bestClue].length; i++) {\n var relevantGrouping = groupingsByClue[bestClue][i];\n\tremovedTotalMines += possibilityVal[2][relevantGrouping];\n }\n extraMines -= Math.trunc(removedTotalMines / possibilityVal[1]);\n \n // determine all possible ways to extend this possibility to cover the rest of the clue, and add them to newPossibilities\n extendPossibilities(possibilityVal, extraMines, relevantGroupings, newPossibilities, supergroups, relevantGroupings.length - 1);\n }\n \n // put the merged possibilities into an array, ignoring any with too many mines\n var newPossibilitiesArray = [];\n for (var key in newPossibilities) {\n if (!newPossibilities.hasOwnProperty(key)) continue;\n if (newPossibilities[key][0] > m) continue;\n newPossibilitiesArray.push(newPossibilities[key]);\n }\n nodesVisited += newPossibilitiesArray.length;\n possibilities = newPossibilitiesArray;\n }\n \n // log some useful stuff\n console.log(\"Time: \" + ((new Date()).getTime() - startTime.getTime()));\n \n // count total solutions by adding across the possibilities\n totalSolutions = 0;\n for (var i=0; i<possibilities.length; i++) {\n totalSolutions += possibilities[i][1];\n }\n \n // display data below the board, and draw it\n draw();\n displayProbability(-1, -1);\n}", "title": "" }, { "docid": "56fdc6685da257f16b2b911d70ab60a2", "score": "0.5500678", "text": "function arrayManipulation(n, queries) {\n //var a = new Array(n);\n //for (var i = 0; i < n; i++) { a[i] = 0;}\n var len = queries.length;\n var temp = new Array(3); \n var tempNext = new Array(3);\n var pushed = new Array(3);\n var ind = 0;\n\n function sortem(arr) {\n var len = arr.length;\n for (var i = 0; i < len; i++) {\n var small = 10 ** 7;\n for (var j = i; j < len; j++) {\n temp = arr[j];\n if (temp[0] < small) { small = temp[0]; ind = j; }\n }\n [arr[i], arr[ind]] = [arr[ind], arr[i]];\n\n }\n return arr;\n }\n\n\n for (var i = 0; i < queries.length; i++){\n queries = sortem(queries);\n temp = queries[i];\n\n if (temp[0] === temp[1]) { continue;}\n var j = i + 1; \n tempNext = queries[j];\n if (tempNext[0] > temp[1]) {\n continue;\n }\n //if (tempNext[0] == temp[0] && tempNext[1] == temp[1]) { continue; }\n if (temp[1] < tempNext[1]) {\n queries[j] = [tempNext[0],temp[1],tempNext[2]+temp[2]];\n pushed = [temp[1] + 1, tempNext[1], tempNext[2]];\n queries.push(pushed);\n queries.splice(i, 1);\n i--;\n continue;\n\n } else if (tempNext[1] === temp[1]) {\n queries[j] = [tempNext[0], tempNext[1], tempNext[2] + temp[2]];\n queries.splice(i, 1);\n i--;\n continue;\n } else if (temp[1] > tempNext[1]) {\n queries[j] = [tempNext[0], tempNext[1], tempNext[2] + temp[2]];\n pushed = [tempNext[1]+1, temp[1], temp[2] ];\n queries.push(pushed);\n queries.splice(i, 1);\n i--;\n continue;\n }\n \n \n\n }\n\n queries = sortem(queries);\n //console.log(queries.length);\n //console.log(queries);\n var len = queries.length;\n var b = new Array(len);\n for (var k = 0; k < len; k++){ \n b[k] = queries[k][2];\n }\n return Math.max(...b);\n\n /* First Solution - Slow\n for (var j = 1; j < len; j++){\n temp = queries[j];\n var s = temp[0]-1 ;\n var e = temp[1]-1 ;\n var v = temp[2]; \n\n for (var k = s; k <= e; k++){\n a[k] += v;\n }\n }\n\n //a = a.filter(Boolean);\n return Math.max(...a);\n*/\n\n}", "title": "" }, { "docid": "711962d59b7b9ad4d5cef7637dbba3fb", "score": "0.5476804", "text": "function get2x2optscramble(mn) {\n var e=[15,16,16,21,21,15,13,9,9,17,17,13,14,20,20,4,4,14,12,5,5,8,8,12,3,23,23,18,18,3,1,19,19,11,11,1,2,6,6,22,22,2,0,10,10,7,7,0],d=[[],[],[],[],[],[]],v=[[0,2,3,1,23,19,10,6,22,18,11,7],[4,6,7,5,12,20,2,10,14,22,0,8],[8,10,11,9,12,7,1,17,13,5,0,19],[12,13,15,14,8,17,21,4,9,16,20,5],[16,17,19,18,15,9,1,23,13,11,3,21],[20,21,23,22,14,16,3,6,15,18,2,4]],r=[],a=[],b=[],c=[],f=[],s=[];function t(){s=[1,1,1,1,2,2,2,2,5,5,5,5,4,4,4,4,3,3,3,3,0,0,0,0]}t();function mx(){t();for(var i=0;i<500;i++)dm(Math.floor(Math.random()*3+3)+16*Math.floor(Math.random()*3))}function cj(){var i,j;for(i=0;i<6;i++)for(j=0;j<6;j++)d[i][j]=0;for(i=0;i<48;i+=2)if(s[e[i]]<=5&&s[e[i+1]]<=5)d[s[e[i]]][s[e[i+1]]]++}function dm(m){var j=1+(m>>4),k=m&15,i;while(j){for(i=0;i<v[k].length;i+=4)y(s,v[k][i],v[k][i+3],v[k][i+2],v[k][i+1]);j--}}function sv(){cj();var h=[],w=[],i=0,j,k,m;for(j=0;j<7;j++){m=0;for(k=i;k<i+6;k+=2){if(s[e[k]]==s[e[42]])m+=4;if(s[e[k]]==s[e[44]])m+=1;if(s[e[k]]==s[e[46]])m+=2}h[j]=m;if(s[e[i]]==s[e[42]]||s[e[i]]==5-s[e[42]])w[j]=0;else if(s[e[i+2]]==s[e[42]]||s[e[i+2]]==5-s[e[42]])w[j]=1;else w[j]=2;i+=6}m=0;for(i=0;i<7;i++){j=0;for(k=0;k<7;k++){if(h[k]==i)break;if(h[k]>i)j++}m=m*(7-i)+j}j=0;for(i=5;i>=0;i--)j=j*3+w[i]-3*Math.floor(w[i]/3);if(m!=0||j!=0){r.length=0;for(k=mn;k<99;k++)if(se(0,m,j,k,-1))break;j=\"\";for(m=0;m<r.length;m++)j=\"URF\".charAt(r[m]/10)+\"\\'2 \".charAt(r[m]%10)+\" \"+j;return j}}function se(i,j,k,l,m){if(l!=0){if(a[j]>l||b[k]>l)return false;var o,p,q,n;for(n=0;n<3;n++)if(n!=m){o=j;p=k;for(q=0;q<3;q++){o=c[o][n];p=f[p][n];r[i]=10*n+q;if(se(i+1,o,p,l-1,n))return true}}}else if(j==0&&k==0)return true;return false}function z(){var i,j,k,m,n;for(i=0;i<5040;i++){a[i]=-1;c[i]=[];for(j=0;j<3;j++)c[i][j]=g(i,j)}a[0]=0;for(i=0;i<=6;i++)for(j=0;j<5040;j++)if(a[j]==i)for(k=0;k<3;k++){m=j;for(n=0;n<3;n++){var m=c[m][k];if(a[m]==-1)a[m]=i+1}}for(i=0;i<729;i++){b[i]=-1;f[i]=[];for(j=0;j<3;j++)f[i][j]=w(i,j)}b[0]=0;for(i=0;i<=5;i++)for(j=0;j<729;j++)if(b[j]==i)for(k=0;k<3;k++){m=j;for(n=0;n<3;n++){var m=f[m][k];if(b[m]==-1)b[m]=i+1}}}function g(i,j){var k,m,n,o=i,h=[];for(k=1;k<=7;k++){m=o%k;o=(o-m)/k;for(n=k-1;n>=m;n--)h[n+1]=h[n];h[m]=7-k}if(j==0)y(h,0,1,3,2);else if(j==1)y(h,0,4,5,1);else if(j==2)y(h,0,2,6,4);o=0;for(k=0;k<7;k++){m=0;for(n=0;n<7;n++){if(h[n]==k)break;if(h[n]>k)m++}o=o*(7-k)+m}return o}function w(i,j){var k,m,n,o=0,p=i,h=[];for(k=0;k<=5;k++){n=Math.floor(p/3);m=p-3*n;p=n;h[k]=m;o-=m;if(o<0)o+=3}h[6]=o;if(j==0)y(h,0,1,3,2);else if(j==1){y(h,0,4,5,1);h[0]+=2;h[1]++;h[5]+=2;h[4]++}else if(j==2){y(h,0,2,6,4);h[2]+=2;h[0]++;h[4]+=2;h[6]++}p=0;for(k=5;k>=0;k--)p=p*3+(h[k]%3);return p}function y(i,j,k,m,n){var o=i[j];i[j]=i[k];i[k]=i[m];i[m]=i[n];i[n]=o}z();\n for (var i=0;i<num;i++) {\n mx();\n ss[i]+=sv();\n }\n}", "title": "" }, { "docid": "711962d59b7b9ad4d5cef7637dbba3fb", "score": "0.5476804", "text": "function get2x2optscramble(mn) {\n var e=[15,16,16,21,21,15,13,9,9,17,17,13,14,20,20,4,4,14,12,5,5,8,8,12,3,23,23,18,18,3,1,19,19,11,11,1,2,6,6,22,22,2,0,10,10,7,7,0],d=[[],[],[],[],[],[]],v=[[0,2,3,1,23,19,10,6,22,18,11,7],[4,6,7,5,12,20,2,10,14,22,0,8],[8,10,11,9,12,7,1,17,13,5,0,19],[12,13,15,14,8,17,21,4,9,16,20,5],[16,17,19,18,15,9,1,23,13,11,3,21],[20,21,23,22,14,16,3,6,15,18,2,4]],r=[],a=[],b=[],c=[],f=[],s=[];function t(){s=[1,1,1,1,2,2,2,2,5,5,5,5,4,4,4,4,3,3,3,3,0,0,0,0]}t();function mx(){t();for(var i=0;i<500;i++)dm(Math.floor(Math.random()*3+3)+16*Math.floor(Math.random()*3))}function cj(){var i,j;for(i=0;i<6;i++)for(j=0;j<6;j++)d[i][j]=0;for(i=0;i<48;i+=2)if(s[e[i]]<=5&&s[e[i+1]]<=5)d[s[e[i]]][s[e[i+1]]]++}function dm(m){var j=1+(m>>4),k=m&15,i;while(j){for(i=0;i<v[k].length;i+=4)y(s,v[k][i],v[k][i+3],v[k][i+2],v[k][i+1]);j--}}function sv(){cj();var h=[],w=[],i=0,j,k,m;for(j=0;j<7;j++){m=0;for(k=i;k<i+6;k+=2){if(s[e[k]]==s[e[42]])m+=4;if(s[e[k]]==s[e[44]])m+=1;if(s[e[k]]==s[e[46]])m+=2}h[j]=m;if(s[e[i]]==s[e[42]]||s[e[i]]==5-s[e[42]])w[j]=0;else if(s[e[i+2]]==s[e[42]]||s[e[i+2]]==5-s[e[42]])w[j]=1;else w[j]=2;i+=6}m=0;for(i=0;i<7;i++){j=0;for(k=0;k<7;k++){if(h[k]==i)break;if(h[k]>i)j++}m=m*(7-i)+j}j=0;for(i=5;i>=0;i--)j=j*3+w[i]-3*Math.floor(w[i]/3);if(m!=0||j!=0){r.length=0;for(k=mn;k<99;k++)if(se(0,m,j,k,-1))break;j=\"\";for(m=0;m<r.length;m++)j=\"URF\".charAt(r[m]/10)+\"\\'2 \".charAt(r[m]%10)+\" \"+j;return j}}function se(i,j,k,l,m){if(l!=0){if(a[j]>l||b[k]>l)return false;var o,p,q,n;for(n=0;n<3;n++)if(n!=m){o=j;p=k;for(q=0;q<3;q++){o=c[o][n];p=f[p][n];r[i]=10*n+q;if(se(i+1,o,p,l-1,n))return true}}}else if(j==0&&k==0)return true;return false}function z(){var i,j,k,m,n;for(i=0;i<5040;i++){a[i]=-1;c[i]=[];for(j=0;j<3;j++)c[i][j]=g(i,j)}a[0]=0;for(i=0;i<=6;i++)for(j=0;j<5040;j++)if(a[j]==i)for(k=0;k<3;k++){m=j;for(n=0;n<3;n++){var m=c[m][k];if(a[m]==-1)a[m]=i+1}}for(i=0;i<729;i++){b[i]=-1;f[i]=[];for(j=0;j<3;j++)f[i][j]=w(i,j)}b[0]=0;for(i=0;i<=5;i++)for(j=0;j<729;j++)if(b[j]==i)for(k=0;k<3;k++){m=j;for(n=0;n<3;n++){var m=f[m][k];if(b[m]==-1)b[m]=i+1}}}function g(i,j){var k,m,n,o=i,h=[];for(k=1;k<=7;k++){m=o%k;o=(o-m)/k;for(n=k-1;n>=m;n--)h[n+1]=h[n];h[m]=7-k}if(j==0)y(h,0,1,3,2);else if(j==1)y(h,0,4,5,1);else if(j==2)y(h,0,2,6,4);o=0;for(k=0;k<7;k++){m=0;for(n=0;n<7;n++){if(h[n]==k)break;if(h[n]>k)m++}o=o*(7-k)+m}return o}function w(i,j){var k,m,n,o=0,p=i,h=[];for(k=0;k<=5;k++){n=Math.floor(p/3);m=p-3*n;p=n;h[k]=m;o-=m;if(o<0)o+=3}h[6]=o;if(j==0)y(h,0,1,3,2);else if(j==1){y(h,0,4,5,1);h[0]+=2;h[1]++;h[5]+=2;h[4]++}else if(j==2){y(h,0,2,6,4);h[2]+=2;h[0]++;h[4]+=2;h[6]++}p=0;for(k=5;k>=0;k--)p=p*3+(h[k]%3);return p}function y(i,j,k,m,n){var o=i[j];i[j]=i[k];i[k]=i[m];i[m]=i[n];i[n]=o}z();\n for (var i=0;i<num;i++) {\n mx();\n ss[i]+=sv();\n }\n}", "title": "" }, { "docid": "0a994ee1ec696edd1398430ab72dce0e", "score": "0.5476654", "text": "function migratoryBirds(arr) {\n// let cache = {}\n\n// for (let id of arr) {\n// if (cache[id]) {\n// cache[id]++\n// } else {\n// cache[id] = 1\n// }\n// }\n\n// let array = []\n// for (let id in cache) {\n// array.push([id, cache[id]])\n// }\n\n// array.sort((a, b) => {\n// return a[1] - b[1]\n// }) \n// if (array[array.length - 1][1] === array[array.length - 2][1]) {\n// return array[array.length - 2][0]\n// }\n// return array[array.length - 1][0]\n\nlet array = [0, 0, 0, 0, 0]\n for (let i = 0; i < arr.length; i++) {\n array[arr[i]-1]++\n }\n let qty = array[0]\n let index = 0\n for (let i = 0; i < array.length; i++) {\n if (array[i] > qty) {\n qty = array[i]\n index = i\n }\n }\n return index+1\n\n}", "title": "" }, { "docid": "b181d32d18f2322c2bba9e2d363b50da", "score": "0.54701954", "text": "jaro(s, t) {\n // Good luck!\n let m = 0;\n let transpositions = 0;\n let maxDistance = Math.max(s.length, t.length) / 2 - 1;\n let s_matches = [...Array(s.length)];\n let t_matches = [...Array(t.length)];\n for (let i = 0; i < s.length; i++) {\n let start = Math.max(0, i - maxDistance);\n let end = Math.min(i + maxDistance + 1, t.length);\n for (let j = start; j < end; j++) {\n if (t_matches[j]) continue;\n if (s.charAt(i) !== t.charAt(j)) continue;\n m++;\n\n s_matches[i] = true;\n t_matches[j] = true;\n break;\n }\n }\n\n if (m == 0) return 0;\n let k = 0;\n for (let i = 0; i < s.length; i++) {\n if (!s_matches[i]) continue;\n while (!t_matches[k]) k++;\n if (s.charAt(i) != t.charAt(k)) transpositions++;\n k++;\n }\n transpositions = transpositions / 2;\n return (m / s.length + m / t.length + (m - transpositions) / m) / 3;\n }", "title": "" }, { "docid": "10dcd6014d6f58ae7c9d65db040f5f3d", "score": "0.5466734", "text": "function part1(){\n \n // let stepsGone = 0;\n // let getBotLim = function() { if(stepsGone >= 25){botLim = 25;}else{botLim=stepsGone;} return botLim;}\n // for(i=0;i<inputInt.length;i++){\n // if(i)\n // stepsGone++;\n \n // checkSum(i, stepsGone-1,stepsGone - 1 - getBotLim);\n // }\n \n \n function checkSum(preamble) {\n for(let i = preamble - 25; i < preamble - 1; i++) {\n console.log(i)\n for(let j = preamble - 24; j < preamble; j++) {\n if(+inputInt[i] + +inputInt[j] === +inputInt[preamble] && +inputInt[i] !== +inputInt[preamble] && +inputInt[j] !== +inputInt[preamble]) {\n return true;\n }\n }\n }\n return false;\n }\n console.log(preamble);\n \n while(keepGoing) {\n if (!checkSum(preamble)) {\n keepGoing = false;\n console.log('found it !' +inputInt[preamble]);// 1124361034 \n foundIt = true;\n \n } else {\n preamble++;\n };\n }\n \n if(foundIt){return inputInt[preamble]; }\n }", "title": "" }, { "docid": "dd22b30e72f57bc492831954cb80a40e", "score": "0.5460667", "text": "function distribute_over(input, what_to_do)\n{\n\tif (input == null)\n\t\treturn;\n\tif (!isExpression(input))\n\t\treturn;\n\t// can't simplify only one token\n\tif (input.get_children_length() < 2)\n\t\treturn;\n\tif (what_to_do != BF.DISTRIBUTE_AND && \n\t\twhat_to_do != BF.DISTRIBUTE_ROT)\n\t\treturn;\n\t\n\tif (what_to_do == BF.DISTRIBUTE_ROT)\n\t\treturn m_distribute_rot(input, what_to_do);\n\n\tvar i = -1, num_children = 0, num_grandchildren = 0;\n\tvar distribute_to = 0, op_count = 0;\n\tvar append_phrase = \"\";\n\tvar new_value = \"\";\n\t\n\tnum_children = input.get_children_length();\n\t\n\t// find the first node with children\n\tfor (i=0; i<num_children; i++)\n\t{\n\t\tif (input.get_child(i).get_children_length() > 0)\n\t\t{\n\t\t\tvar op_comp = op_order_compare_1_to_2(what_to_do.OP[0], input.get_child(i).get_operator());\n\t\t\tif (op_comp == OP_ORDER.HIGHER || op_comp == OP_ORDER.EQUAL)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t// if none are found, return\n\tif (i == -1 || i >= num_children)\n\t\treturn;\n\t\t\n\tdistribute_to = i;\n\n\t// otherwise, there are three posibilities\n\t// 1) the first node has children. All following nodes will form one string to fold into the first\n\t// 2) the last node has children. All previous nodes will form one string to fold into the first\n\t// 3) a node in the middle has children. All nodes before and all nodes after will form one string to fold into the first\n\t\n\t// -2 since we're down one child\n\top_count = num_children - 2;\n\tfor (i=0; i<num_children; i++)\n\t{\n\t\tif (i == distribute_to)\n\t\t\tcontinue;\n\t\tappend_phrase += input.get_child(i).get_my_value();\n\t\tif (op_count)\n\t\t{\n\t\t\tappend_phrase += input.get_operator();\n\t\t\top_count--;\n\t\t}\n\t}\n\t\n\t// now create the new phrase by adding append_phrase to each of distribute_to's children\n\tnum_grandchildren = input.get_child(distribute_to).get_children_length();\n\top_count = num_grandchildren - 1;\n\tfor (i=0; i<num_grandchildren; i++)\n\t{\n\t\tnew_value += \"(\";\n\t\tnew_value += input.get_child(distribute_to).get_child(i).get_my_value();\n\t\tnew_value += input.get_operator();\n\t\tnew_value += append_phrase;\n\t\tnew_value += \")\";\n\t\tif (op_count)\n\t\t{\n\t\t\tnew_value += input.get_child(distribute_to).get_operator();\n\t\t\top_count--;\n\t\t}\n\t\t\t\n\t}\n\t// hey, we're done.\n\tinput.set_my_value(new_value);\n\tinput.set_operator(\"\");\n\tinput.build_tree();\n}", "title": "" }, { "docid": "cbcb0b4970e4c2abc7bc9b145da590f7", "score": "0.54390776", "text": "function s(nums) {\n const res = [];\n helper(0, []);\n return res;\n\n function helper(i, list = []) {\n res.push(list.slice());\n for (let j = i; j < nums.length; j++) {\n if (j > i && nums[i - 1] === nums[i]) contineu;\n list.push(nums[j]);\n helper(j + 1, list);\n list.pop();\n }\n }\n}", "title": "" }, { "docid": "c445be440a186dde2ab7eee0adec0d8e", "score": "0.54063714", "text": "function rs(a) {\n a = parse(a);\n let ca = a.length; // count of possible towers for a\n let m = log2(ca); // height of a\n let s = []; // to construct (b -> a)\n let i = -1;\n for (let u = 0; u < 2; ++u) {\n for (let t = 0; t < ca; ++t) {\n if (u == 0 && t == ca - 1) {\n s[++i] = m;\n } else {\n s[++i] = a[t];\n }\n }\n }\n return s;\n}", "title": "" }, { "docid": "5e89e34a4eab3ea383a6e15ea42221ef", "score": "0.5405588", "text": "function triathlon(array) {\n\tvar str = array[0],\n\t\toffset = +array[1],\n\t\tletterCounter = 1,\n\t\tcurrentLetter = \"\",\n\t\tsegment = str[0],\n\t\tsegmentList = [],\n\t\toccurencies = [],\n\t\talphabet = 'abcdefghijklmnopqrstuvwxyz',\n\t\tcypher = \"\",\n\t\tcurrentASCII = 0,\n\t\tresult = \"\",\n\t\tencodingCouple,\n\t\tsum = 0,\n\t\tproduct = 1;\n\t\n\t\t\n\tfunction getASCIICouple(letter) {\n\t\tvar replacement = 0;\n\t\tfor (var i = 0, len = alphabet.length; i < len; i += 1) {\n\t\t\tif (letter === alphabet[i]) {\n\t\t\t\treplacement = cypher[i].charCodeAt();\n\t\t\t\treturn [letter.charCodeAt(), replacement]\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\tfor (var i = 0, len = alphabet.length; i < len; i += 1) {\n\t\tcurrentASCII = alphabet[i].charCodeAt() + 26 - offset;\n\t\tif (currentASCII <= 122) {\t\n\t\t\tcypher += String.fromCharCode(currentASCII);\n\t\t} else {\n\t\t\tcypher += String.fromCharCode(alphabet[i].charCodeAt() - offset);\n\t\t}\n\t}\n\t\t\n\tfor (var i = 0, len = str.length; i < len; i += 1) {\n\t\tcurrentLetter = str[i];\n\t\tif (str[i + 1] === currentLetter) {\n\t\t\tsegment += currentLetter;\n\t\t\tletterCounter += 1;\n\t\t} else {\n\t\t\tsegmentList.push(segment);\n\t\t\toccurencies.push(letterCounter);\n\t\t\tsegment = str[i + 1];\n\t\t\tletterCounter = 1;\n\t\t}\n\t}\n\t\n\tfor (var i = 0, len = segmentList.length; i < len; i += 1) {\n\t\tif (occurencies[i] > 2) {\n\t\t\tstr = str.replace(segmentList[i], occurencies[i] + segmentList[i][0]);\n\t\t}\n\t}\n\t\n\tfor (var i = 0, len = str.length; i < len; i += 1) {\n\t\tif (+str[i] / 1 === +str[i]) {\n\t\t\tresult += str[i];\n\t\t} else {\n\t\t\tencodingCouple = getASCIICouple(str[i]);\n\t\t\tresult += encodingCouple[0] ^ encodingCouple[1];\n\t\t}\n\t}\n\t\n\tfor (var i = 0, len = result.length; i < len; i += 1) {\n\t\tif (+result[i]%2===0) {\n\t\t\tsum += +result[i];\n\t\t} else if (+result[i]%2===1) {\n\t\t\tproduct *= +result[i]\n\t\t}\n\t}\n\tconsole.log(sum);\n\tconsole.log(product);\n}", "title": "" }, { "docid": "25c3fc6a92836d236162d1ef829535e1", "score": "0.5403083", "text": "function chak(){\n for(var i=0; i<9;i++)\n {\n for(var j=0;j<9;j++)\n {\n if (i>0 && Mine[i-1][j]=='*' && Mine[i][j]!==Mine[i-1][j]){\n Mine[i][j]+=1\n }\n if (i<8 && Mine[i+1][j]=='*' && Mine[i][j]!==Mine[i+1][j]){\n Mine[i][j]+=1\n } \n if (j<8 && Mine[i][j+1]=='*' && Mine[i][j]!==Mine[i][j+1]){\n Mine[i][j]+=1\n }\n if (j>0 && Mine[i][j-1]=='*' && Mine[i][j]!==Mine[i][j-1]){\n Mine[i][j]+=1\n }\n if (i<8 && j<8 && Mine[i+1][j+1]=='*' && Mine[i][j]!==Mine[i+1][j+1]){\n Mine[i][j]+=1\n }\n if (j>0 && i>0 && Mine[i-1][j-1]=='*' && Mine[i][j]!==Mine[i-1][j-1]){\n Mine[i][j]+=1\n }\n if (i>0 && i<8 && Mine[i+1][j-1]=='*' && Mine[i][j]!==Mine[i+1][j-1]){\n Mine[i][j]+=1\n }\n if (i>0 && j<8 && Mine[i-1][j+1]=='*' && Mine[i][j]!==Mine[i-1][j+1]){\n Mine[i][j]+=1\n } \n }\n }\n }", "title": "" }, { "docid": "9285d55b6d52df565bf800bea12e517b", "score": "0.54025024", "text": "hailstoneSequence() {\n let res = [];\n let res27;\n // Good luck!\n\n res27 = calculate(27);\n\n let number,\n max = 0;\n for (let i = 1; i <= 100000; i++) {\n let l = calculate(i);\n if (l.length > max) {\n max = l.length;\n number = i;\n }\n }\n\n function calculate(n) {\n let sequence = [];\n //let index\n while (n > 1) {\n sequence.push(n);\n if (n % 2 === 0) {\n n = n / 2;\n } else {\n n = 3 * n + 1;\n }\n }\n sequence.push(1);\n return sequence;\n }\n return [[...res27.slice(0, 4).concat([8, 4, 2, 1])], [max, number]];\n }", "title": "" }, { "docid": "7116e18dc2225fb372d390748f26cfd7", "score": "0.538498", "text": "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "title": "" }, { "docid": "7116e18dc2225fb372d390748f26cfd7", "score": "0.538498", "text": "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "title": "" }, { "docid": "612f00bac340409866d5c34e357054b5", "score": "0.5369392", "text": "function solvePart2(board) {\n // Keep track of the boards I've seen and when I saw them\n // This may need to be an actual hashmap for efficiency reasons\n let seen = {};\n let cycleLength = 0;\n for (var i = 0; cycleLength === 0; i++) {\n let flatBoard = flatten(board);\n if (seen.hasOwnProperty(flatBoard)) {\n cycleLength = i - seen[flatBoard]\n }\n seen[flatBoard] = i;\n //console.log(seen);\n board = nextBoard(board);\n }\n\n const remainingIterations = (1000000000 - i) % cycleLength;\n console.log(`remaing iterations: ${remainingIterations}`);\n\n // Now that we've shortcutted, look return the final answer\n return iterate(board, remainingIterations);\n}", "title": "" }, { "docid": "5e053984a791fdf4ee1f64a05fc1a734", "score": "0.5368796", "text": "function solution(board) {\n const dx = [-1, 0, 1, 0];\n const dy = [0, -1, 0, 1];\n\n var answer = 0;\n const n = board.length;\n let q = [];\n let visit = [];\n\n for (let i = 0; i < n; i++) {\n let temp2 = [];\n for (let j = 0; j < n; j++) {\n let temp = [];\n for (let k = 0; k < 4; k++) {\n temp.push(Infinity);\n }\n temp2.push(temp);\n }\n visit.push(temp2);\n }\n\n for (let i = 0; i < 4; i++) {\n q.push([0, 0, i, 0]);\n }\n\n while (q.length) {\n let [x, y, dir, cost] = q.shift();\n for (let i = 0; i < 4; i++) {\n const nx = x + dx[i];\n const ny = y + dy[i];\n if (Math.abs(dir - i) === 2) continue;\n if (!check(nx, ny, board, n)) continue;\n let nCost = dir === i ? 100 : 600;\n nCost += cost;\n if (visit[nx][ny][i] > nCost) {\n visit[nx][ny][i] = nCost;\n q.push([nx, ny, i, visit[nx][ny][i]]);\n q.sort((a, b) => a[2] - b[2]);\n }\n }\n }\n visit[n - 1][n - 1].sort((a, b) => a - b);\n answer = visit[n - 1][n - 1][0];\n // console.log(answer);\n return answer;\n}", "title": "" }, { "docid": "5d0e02c90b0d8844432cd1160620e874", "score": "0.5354748", "text": "function doThing(nums) {\n nums.sort()\n let result = []\n for (var i = 0; i < nums.length - 2; i++) {\n if (nums[i] > 0) {\n break\n }\n if (i > 0 && nums[i] === nums[i - 1]) {\n continue\n }\n let flagBegin = i\n let flagEnd = nums.length - 1\n while (flagBegin < flagEnd) {\n if (nums[i] === -(nums[flagBegin] + nums[flagEnd])) {\n let list = [nums[i], nums[flagBegin], nums[flagEnd]]\n result.push(list)\n flagBegin++\n flagEnd--\n } else if (nums[i] < -(nums[flagBegin] + nums[flagEnd])) {\n flagBegin++\n } else {\n flagEnd--\n }\n }\n\n }\n return result\n}", "title": "" }, { "docid": "cc97ed70976f579d4288433a85b8c8d3", "score": "0.53538364", "text": "function mineSwipper(array, row, col) {\n var result = [];\n for (let i = 0; i < row; i++) {\n let row = [];\n result[i] = row;\n for (let j = 0; j < col; j++) {\n result[i][j] = 0;\n }\n }\n for (bomb of array) {\n let row_id = bomb[0];\n let col_id = bomb[1];\n result[row_id][col_id] = -1;\n for (let i = row_id - 1; i <= row_id + 1; i++) {\n for (let j = col_id - 1; j <= col_id + 1; j++) {\n if (0 <= i && i < row && 0 <= j && j < col) {\n if (result[i][j] !== -1) {\n result[i][j] += 1;\n }\n }\n }\n\n }\n }\n console.log(result);\n}", "title": "" }, { "docid": "847fe622f07a2af1420aaf0d7fdefcba", "score": "0.5351346", "text": "function transform(state){\n\n let i;\n let j;\n let k;\n\n let ArrNewStates = [];\n let newState = {};\n let buffFinalState = {};\n\n // Premièrement, on bouge 2 bateaux vers la destination\n for(i=0; i < state[0].length; i++){\n // On ne déplace pas 2 fois le même bateau, et on ne déplace pas 2 fois le même set de bateaux\n for(j=i+1; j < state[0].length; j++){\n\n newState = clone(state);\n newState.previous = state;\n\n //Le coût du déplacement est conditionné par le bateau le plus lent, et on le rajoute au coût total.\n newState.cost = Math.max(newState[0][i].speed, newState[0][j].speed) + state.cost;\n\n newState[1].push(newState[0][i]);\n newState[1].push(newState[0][j]);\n\n // On s'assure que on bouge toujours l'indice le plus haut en premier,\n newState[0].splice(j, 1);\n newState[0].splice(i, 1);\n\n // Puis, si on a pas l'état final, on ramène 1 bateau afin de servir d'escorte pour les prochains\n if(!(isTarget(newState))){\n for(k=0; k < newState[1].length; k++){\n\n buffFinalState = clone(newState);\n\n // On récupère le nom du bateau qui a été ramené avec l'escorte et on ajoute son coût au coût total\n buffFinalState.movedBack = \"(\" + buffFinalState[1][k].speed + \")\";\n buffFinalState.cost += buffFinalState[1][k].speed;\n\n //On le fait revenir au port de départ\n buffFinalState[0].push(buffFinalState[1][k]);\n buffFinalState[1].splice(k, 1);\n\n // On vérifie si il existe deja un chemin plus rapide ou aussi rapide dans visited avant de l'y ajouter\n if(!(isVisited(buffFinalState))){\n ArrNewStates.push(clone(buffFinalState));\n }\n }\n }\n // Si on a l'état final, on le retourne et il sera traité par l'algorithme\n else{\n newState.movedBack = \"\";\n ArrNewStates.push(clone(newState));\n\n }\n\n }\n }\n return ArrNewStates;\n}", "title": "" }, { "docid": "f70e9512f7b2c4a3bcd60b08e8f949f8", "score": "0.5331107", "text": "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10; //O(1)\n let c = 50; //O(1)\n for (let i = 0; i < input; i++) { //O(n)\n let x = i + 1; //O(n)\n let y = i + 2; //O(n)\n let z = i + 3; //O(n)\n \n }\n for (let j = 0; j < input; j++) { //O(n)\n let p = j * 2; //O(n)\n let q = j * 2; //O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n }", "title": "" }, { "docid": "63aa37a1cbc7cab36d8569d538015294", "score": "0.5327202", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n/* Task Description\n An array A consisting of N different integers is given. The array contains integers in the range [1..(N + 1)],\n which means that exactly one element is missing. Your goal is to find that missing element. \n/* Assumptions:\n - N is an integer within the range [0..100,000];\n - the elements of A are all distinct;\n - each element of array A is an integer within the range [1..(N + 1)].\n*/\n // declaring (i)initial and (f)inal index and (m)edian\n let i, f, m;\n // sort the array \n A.sort((a, b)=>a - b);\n //check if the first element is not 1 and then return 1\n if (A[0] !== 1) {\n return 1;\n };\n //check if the length of array A is 1, since it passed the previous if, the element is the number 1\n if (A.length === 1) {\n return 2\n } else {\n i = 0;\n f = A.length - 1;\n m = Math.ceil((f - i) / 2);\n while (f - i > 0 && f < A.length) {\n if (A[m] - A[m-1] === 2 && A[m] - m ===2) {\n // found it \n return A[m-1] + 1;\n } else if (A[m] - A[m-1] === 1 && A[m] - m === 1) {\n // cut to the right\n i = m + 1;\n m = Math.ceil((f - i) / 2) + i;\n } else {\n // cut to the left\n f = m - 1;\n m = Math.ceil((f - i) / 2) + i;\n }\n };\n if (i > f && m < A.length) {\n return A[A.length-1] + 1;\n } else if (m >= A.length - 1) {\n if (A[m] - A[m-1] === 2 && A[m] - m === 2) {\n // found it \n return A[m-1] + 1;\n } else {\n return A[A.length-1] + 1;\n }\n } else {\n return A[m] - 1;\n }\n }\n}", "title": "" }, { "docid": "fb5b260305bde4584a87011eea602122", "score": "0.53171533", "text": "function minimumBribes(q) {\n let globalBribe = 0;\n let isChaotic = false;\n let orderingQueue = q;\n for (let i = q.length - 1; i >= 0; i--) {\n if (q[i] != i + 1) {\n let spaceAhead = 0;\n for (let j = i; j >= 0; j--) {\n if (q[j] != i + 1) spaceAhead++;\n else break;\n }\n\n if (spaceAhead > 2) {\n isChaotic = true;\n break;\n }\n\n globalBribe += spaceAhead;\n\n while(spaceAhead != 0) {\n const actualNumber = orderingQueue[i-spaceAhead];\n orderingQueue[i-spaceAhead] = orderingQueue[i-(spaceAhead - 1)];\n orderingQueue[i-(spaceAhead - 1)] = actualNumber;\n spaceAhead--;\n }\n }\n }\n\n console.log(isChaotic ? 'Too chaotic' : globalBribe);\n}", "title": "" }, { "docid": "0b422606003ffa2eed2d0df5dce1c2a5", "score": "0.5315979", "text": "function longestZigZag(seq){\n var longestUntil = [1];\n var increase = undefined;\n for(let i = 1; i < seq.length; i++){ // current index to find max length\n var final = [seq[0]];\n // Set initial flag\n if(increase === undefined){\n longestUntil[0] < seq[i] ? increase = true : increase = false; // if same, still undefined\n }\n for(let j = 0; j < i; j++){ // prev values in sequence\n // console.log('set flag:', increase)\n // console.log('increase flag:',increase,longestUntil);\n console.log('curr:',i,'prev:',j,'increase:',increase,'prev:',seq[j],'curr:',seq[i],'longestUntil:',longestUntil)\n // if(i===1) longestUntil[i] = 1; //do i need this?\n if(!longestUntil[i]) longestUntil[i] = longestUntil[i-1]\n if(increase && seq[j] < seq[i]){ // prev < curr\n console.log('increase',longestUntil, longestUntil[i], '<=',longestUntil[j]+1);\n if(longestUntil[i] <= longestUntil[j] + 1){\n longestUntil[i] = longestUntil[j] + 1;\n console.log('increased:', longestUntil)\n final.push(seq[j]);\n increase = !increase;\n }\n console.log('set flag:', increase)\n // break;\n }else if(!increase && seq[j] > seq[i]){\n console.log('decrease', longestUntil);\n if(longestUntil[i] <= longestUntil[j] + 1){\n longestUntil[i] = longestUntil[j] + 1;\n console.log('decreased:', longestUntil);\n final.push(seq[j]);\n increase = !increase;\n }\n console.log('set flag:', increase);\n // break;\n }else{\n // console.log('before why', longestUntil,longestUntil[i],longestUntil[i-1],i,i-1, increase,seq[j], seq[i])\n longestUntil[i] = longestUntil[i-1];\n // console.log('why',longestUntil)\n }\n // console.log('=====curr:',i,'prev:',j,'prev:',seq[j],'curr:',seq[i],'longestUntil:',longestUntil);\n }\n console.log('********final:', final);\n }\n console.log(longestUntil)\n return longestUntil[seq.length-1];\n}", "title": "" }, { "docid": "7e6d0c1a7daa506cff97108be2cd4557", "score": "0.53148127", "text": "function i$2(n,r,i,o){if(1===o.length){if(Z$2(o[0]))return l$2(n,o[0],-1);if(E$6(o[0]))return l$2(n,o[0].toArray(),-1)}return l$2(n,o,-1)}", "title": "" }, { "docid": "d172384588209ecb3cedc77f8a84e11c", "score": "0.53099954", "text": "e77() {\n // from problem 76, i = 30 was sufficient to generate > 5000 partitions\n // in order to minimize space and time, we will use 46 primes as an upper bound, and increase if necessary\n const PRIMES = Object.keys(utils.generatePrimesTable(200)).map(Number);\n let answer = 0;\n let I = 2;\n\n // each key is of the form a|b, and the value is the number of partitions of a using primes smaller or equal to b\n const MEM = { };\n while (!answer) {\n for (let i = 2; i <= I; i++) {\n for (let j = 0; j < PRIMES.length; j++) {\n const prime = PRIMES[j];\n if (prime > i) {\n MEM[`${i}|${prime}`] = MEM[`${i}|${PRIMES[j - 1]}`];\n continue;\n }\n if (j === 0) {\n MEM[`${i}|${prime}`] = utils.isEven(i) ? 1 : 0;\n continue;\n }\n const usingPrime = MEM[`${i - prime}|${prime}`] || (i === prime ? 1 : 0);\n const notUsing = MEM[`${i}|${PRIMES[j - 1]}`] || 0;\n if (notUsing + usingPrime > 5000) {\n MEM[`${i}|${prime}`] = notUsing + usingPrime;\n answer = i;\n break;\n }\n MEM[`${i}|${prime}`] = notUsing + usingPrime;\n }\n if (answer) {\n break;\n }\n }\n I++;\n }\n return answer;\n }", "title": "" }, { "docid": "8cbcc249587116c6c1dd5de58e62b525", "score": "0.5308395", "text": "function p(a,b){/* Process the input block. */\nfor(var c,d,e;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\nif(a.lookahead<ja){if(m(a),a.lookahead<ja&&b===H)return sa;if(0===a.lookahead)break}/* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\nif(c=0,a.lookahead>=ha&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ha-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=ha-1,0!==c&&a.prev_length<a.max_lazy_match&&a.strstart-c<=a.w_size-ja&&(a.match_length=l(a,c),a.match_length<=5&&(a.strategy===S||a.match_length===ha&&a.strstart-a.match_start>4096)&&(a.match_length=ha-1)),a.prev_length>=ha&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-ha,/* Do not insert strings in hash table beyond this. */\n//check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n/***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\nd=D._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-ha),/* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\na.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(/*** INSERT_STRING(s, s.strstart, hash_head); ***/\na.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ha-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);if(a.match_available=0,a.match_length=ha-1,a.strstart++,d&&(/*** FLUSH_BLOCK(s, 0); ***/\nh(a,!1),0===a.strm.avail_out))return sa}else if(a.match_available){if(d=D._tr_tally(a,0,a.window[a.strstart-1]),d&&h(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return sa}else/* There is no previous match to compare with, wait for\n * the next step to decide.\n */\na.match_available=1,a.strstart++,a.lookahead--}\n//Assert (flush != Z_NO_FLUSH, \"no flush?\");\n//Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n/*** FLUSH_BLOCK(s, 1); ***/\n/*** FLUSH_BLOCK(s, 0); ***/\nreturn a.match_available&&(d=D._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<ha-1?a.strstart:ha-1,b===K?(h(a,!0),0===a.strm.avail_out?ua:va):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sa:ta}", "title": "" }, { "docid": "7aab0f97e7bdf944c43041d517f5ba65", "score": "0.53041846", "text": "function anotherFunChallenge(input) {\n let a = 5;// O(1)\n let b = 10;// O(1)\n let c = 50;// O(1)\n for (let i = 0; i < input; i++) {//O(n)\n let x = i + 1;//O(n)\n let y = i + 2;//O(n)\n let z = i + 3;//O(n)\n \n }\n for (let j = 0; j < input; j++) {//O(n)\n let p = j * 2;//O(n)\n let q = j * 2;//O(n)\n }\n let whoAmI = \"I don't know\";//O(1)\n }", "title": "" }, { "docid": "86e3396d1e619485bea692901225657c", "score": "0.5299341", "text": "function buildLookAheadIndex()\n\n{ console.time(\"concatenation\");\n\n var nfa= nfaForMatching;\n //Index = {};\n var FinalIndex ={};\n if(checkCount==0)\n {\n for(var i=0; i<nfa.trans.length; i++)\n {\n var s=nfa.trans[i].src;\n if(s in Index==false)\n {\n Index[s]={};\n // FinalIndex[s]={};\n }\n\n for(var j=0; j<alphabet.length; j++)\n {\n var char1=alphabet[j];\n Index[s][char1]={};\n // FinalIndex[s][char1]=[];\n\n for(var k=0; k<alphabet.length; k++)\n {\n var char2 = alphabet[k];\n Index[s][char1][char2]=[];\n\n }\n }\n\n }\n\n for(var l=0; l<nfa.trans.length; l++)\n {\n for(var m=0; m<nfa.trans[l].dest.length; m++)\n {\n for(var n=0; n<nfa.trans.length; n++)\n {\n if(nfa.trans[n].src==nfa.trans[l].dest[m])\n {\nIndex[nfa.trans[l].src][nfa.trans[l].ch][nfa.trans[n].ch]=\n_.union(Index[nfa.trans[l].src][nfa.trans[l].ch][nfa.trans[n].ch], [nfa.trans[l].dest[m]]);\n }\n }\n }\n \n }\n\n}\nmyCombineIndex.myIndex=Index;\n//myCombineIndex.myFinalIndex=FinalIndex;\n//lookAheadCount(nfa, myCombineIndex);\n//console.timeEnd(\"concatenation\");\n\n}", "title": "" }, { "docid": "00c6d91bc7240f64728daa173b7b58a7", "score": "0.5290377", "text": "function B(a){g(a,K<<1,3),h(a,X,ea),j(a)}", "title": "" }, { "docid": "c74a56d0c5b437dd3245d47d6a23b5f5", "score": "0.5287908", "text": "function am1(i,x,w,j,c,n) {\r\nwhile(--n >= 0) {\r\n var v = x*this[i++]+w[j]+c;\r\n c = Math.floor(v/0x4000000);\r\n w[j++] = v&0x3ffffff;\r\n}\r\nreturn c;\r\n}", "title": "" }, { "docid": "5c08c899fa9faac114b177c508ed8787", "score": "0.52830285", "text": "function codeBreaker(arr){\n var dict = {1: \"a\", 2 : \"b\", 3: \"c\", 4: \"d\", 5: \"e\", 6: \"f\", 7: \"g\", 8: \"h\", 9: \"i\", 10: \"j\", 11: \"k\", 12: \"l\", 13: \"m\", 14: \"n\", 15: \"o\", 16: \"p\", 17: \"q\", 18: \"r\", 19: \"s\", 20: \"t\", 21: \"u\", 22: \"v\", 23: \"w\", 24: \"x\", 25: \"y\" , 26: \"z\"};\n var output = [];\n var count = 0;\n for(var i = 0; i <arr.length - 1; i++){\n if(arr[i] === 0){\n continue;\n }\n if(arr[i] == 1 || arr[i] == 2){\n count ++;\n console.log(output.length);\n if(output.length === 0){\n output.push(dict[arr[i]]);\n console.log(output, \"current output\");\n } \n else{\n output[output.length - count] += dict[arr[i]];\n }\n }\n // else{\n // if(output.length === 0){\n // output.push(dict[arr[i]]);\n // } \n // else {\n // output[output.length - count] += dict[arr[i]];\n // }\n // }\n }\n output[output.length - count] += dict[arr[arr.length - 1]];\n return output;\n}", "title": "" }, { "docid": "5b5a13d390d22ea254c90828de16df6a", "score": "0.52803093", "text": "function k(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;/* number of elements with bit length too large */\nfor(f=0;U>=f;f++)a.bl_count[f]=0;/* root of the heap */\nfor(/* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\ni[2*a.heap[a.heap_max]+1]=0,c=a.heap_max+1;T>c;c++)d=a.heap[c],f=i[2*i[2*d+1]+1]+1,f>o&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){\n// Trace((stderr,\"\\nbit length overflow\\n\"));\n/* This happens for example on obj2 and pic of the Calgary corpus */\n/* Find the first bit length which could increase: */\ndo{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,/* move one leaf down the tree */\na.bl_count[f+1]+=2,/* move one overflow item as its brother */\na.bl_count[o]--,/* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\np-=2}while(p>0);/* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\nfor(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}", "title": "" }, { "docid": "025afcdf1b49b749a4ad1ffa40aa3075", "score": "0.528008", "text": "function solve21(iterations_int)\n{\n var startingPattern_ArrArr = getArrArrRepresentation(\".#./..#/###\");\n var enhancementRules2_MapStrStr = getEnhancementRulesMap(input21.split(\"\\n\").filter(element => { return element.indexOf(\"/\") == 2; }));\n var enhancementRules3_MapStrStr = getEnhancementRulesMap(input21.split(\"\\n\").filter(element => { return element.indexOf(\"/\") == 3; }));\n var pattern_ArrArr = startingPattern_ArrArr.slice();\n \n for(let i = 0; i < iterations_int; i++)\n {\n if(pattern_ArrArr.length % 2 == 0)\n {\n pattern_ArrArr = getEnhancedPattern(pattern_ArrArr, enhancementRules2_MapStrStr, 2);\n }\n else if(pattern_ArrArr.length % 3 == 0)\n {\n pattern_ArrArr = getEnhancedPattern(pattern_ArrArr, enhancementRules3_MapStrStr, 3);\n }\n \n console.log(pattern_ArrArr);\n }\n var pattern_Str = getStringRepresentation(pattern_ArrArr);\n var count_Int = 0;\n for(let i = 0, iLimit = pattern_Str.length; i < iLimit; i++)\n {\n if(pattern_Str[i] == \"#\")\n {\n count_Int++;\n }\n }\n return count_Int;\n}", "title": "" }, { "docid": "99aeae32a372cfbfefaa6d234881efdd", "score": "0.52796865", "text": "function solution(nums, numOfGroups) {\n // console.log(nums, numOfGroups);\n let lengthOfNums = nums.length;\n // console.log(lengthOfNums)\n let prefixSum = Array(nums.length + 1);\n prefixSum[0] = 0;\n for (let i = 0; i < lengthOfNums; i++) {\n\n prefixSum[i + 1] = prefixSum[i] + nums[i];\n }\n\n // console.log('prefix sum ', prefixSum)\n let resultMatrix = Array(nums.length + 1);\n // resultMatrix = resultMatrix.map(() =>\n // Array(nums.length + 1).fill(0)\n // )\n\n for (let i = 0; i <= lengthOfNums; i++) {\n // for (let j = i; j < lengthOfNums + 1; j++) {\n // console.log(i, j, prefixSum[j] - prefixSum[i], resultMatrix)\n resultMatrix[i] = prefixSum[lengthOfNums] - prefixSum[i];\n // }\n }\n // console.log(resultMatrix)\n // printMatrix(resultMatrix);\n // console.time('cal')\n // let count = 0;\n for (let n = 2; n <= numOfGroups; n++) {\n // console.log('\\n------------------------')\n // console.log('n = ', n);\n // count = 0;\n let boundary = lengthOfNums - n + 1;\n for (let i = 0; i < boundary; i++) {\n // console.log('i=', i);\n // console.log(resultMatrix[0][lengthOfNums]);\n // for (let j = i + 1; j <= lengthOfNums; j++) {\n // for (let j = lengthOfNums; j <= lengthOfNums; j++) {\n // console.log('j=', j);\n for (let k = i + 1; k < lengthOfNums; k++\n ) {\n // console.log('k=', k);\n // console.log('====================')\n // console.log('prefixsum:', prefixSum)\n // console.log('i j k:', i, j, k)\n // console.log('result:', resultMatrix[i][j])\n // console.log('mik:', prefixSum[k] - prefixSum[i])\n // console.log('mkj:', resultMatrix[k][j]);\n let sumOfi2k = prefixSum[k] - prefixSum[i];\n if (sumOfi2k >= resultMatrix[i]) break;\n resultMatrix[i] = Math.min(resultMatrix[i], Math.max(sumOfi2k, resultMatrix[k]))\n if (sumOfi2k > resultMatrix[k]) break;\n // printMatrix(resultMatrix);\n // console.log(resultMatrix)\n // count++\n }\n if (n === numOfGroups) break;\n\n\n // }\n\n }\n // console.log(resultMatrix)\n // console.log(count)\n // printMatrix('for n = ', n, resultMatrix);\n }\n // console.log(count);\n // console.timeEnd('cal')\n // console.log('count', count)\n return resultMatrix[0]\n}", "title": "" }, { "docid": "a0d1f12b8dba5fe5725b61970319f082", "score": "0.52795327", "text": "swim (k) {\n let parent = Math.floor(k/2);\n // for 1 index there is no parent\n while (k !== 1 && this.less(parent, k)) {\n this.exchange(parent, k);\n k = parent;\n parent = Math.floor(k/2);\n }\n }", "title": "" }, { "docid": "3f6957cece0122187f8d6e42ffb16b32", "score": "0.5277984", "text": "function pa(a){var b,c,d,e,f;for(b=0;b<a.length;b++)for(c=a[b],d=0;d<c.length;d++)for(e=c[d],e.forwardSegs=[],f=b+1;f<a.length;f++)sa(e,a[f],e.forwardSegs)}", "title": "" }, { "docid": "2192fe1a2f688733630bfa95013878c4", "score": "0.52722687", "text": "function dynamicProgramming(str) {\n if (str.length < 1) return 0\n if (isPalindrome(str)) return 0\n\n const table = [...Array(str.length)].map(e => Array(str.length).fill(0))\n // when indexes i == j, there's only 1 char. 1 char needs 0 partitions \n for (let i = 0; i < str.length; i++) {\n table[i][i] = 0\n }\n // the gap is the difference between end of left side partition and start of right side partition\n for (let gap = 1; gap < str.length; gap++) {\n for (let i = 0; i + gap < str.length; i++) {\n let j = i + gap\n // FUTURE improvements:\n // Since we repeatedly check if a substring is a palindrome\n // we can improve runtime performance by using 2d array to store isPalindrome\n // result and use later on when needed\n if (isPalindrome(str.slice(i, j + 1))) {\n table[i][j] = 0\n } else {\n table[i][j] = Number.POSITIVE_INFINITY\n for (let k = i; k < j; k++) {\n table[i][j] = Math.min(\n table[i][j],\n 1 + table[i][k] + table[k+1][j]\n )\n }\n }\n }\n }\n console.log(table)\n return table[0][str.length-1]\n}", "title": "" }, { "docid": "d9297265d4979243bfcfdce09f2fb495", "score": "0.5269765", "text": "function sol(s) {\n const n = s.length;\n const dp = [];\n for (let i = 0; i <= n; i++) {\n const row = [];\n for (let j = 0; j <= n; j++) {\n row.push(0);\n }\n dp.push(row);\n }\n computeAllPals();\n const minPals = Array(n + 2).fill(Infinity);\n minPals[n + 1] = 0;\n\n for (let k = n; k >= 1; k--) {\n for (let l = k; l <= n; l++) {\n if (dp[k][l]) {\n minPals[k] = Math.min(minPals[k], 1 + minPals[l + 1]);\n }\n }\n }\n\n console.log({ dp, minPals });\n return minPals[1] - 1;\n\n function computeAllPals() {\n for (let i = n; i >= 1; i--) {\n // fill to the left of the char, used to get correct index on line 43\n dp[i][i - 1] = true;\n // char by itself is a pal\n dp[i][i] = true;\n for (let j = i + 1; j <= n; j++) {\n if (s[i - 1] === s[j - 1]) {\n dp[i][j] = dp[i + 1][j - 1];\n } else {\n dp[i][j] = false;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "d9f37e8c5f66286a52c269e368c9dec8", "score": "0.526682", "text": "function s(nums, target) {\n let l = 0;\n let r = nums.length - 1;\n while (l <= r) {\n let m = Math.floor((l + r) / 2);\n console.log({ l, m, r });\n if (nums[m] === target) {\n let n = m;\n while (nums[m - 1] === target) m--;\n while (nums[n + 1] === target) n++;\n return [m, n];\n }\n if (nums[m] < target) {\n l = m + 1;\n } else {\n r = m - 1;\n }\n }\n return [-1, -1];\n}", "title": "" }, { "docid": "43e3345f4ab91f748bc91d2b1f3a6202", "score": "0.5264642", "text": "function right_Element_Structure(structure)\n{\n var bulge, loop;\n\n var i, lp, p, l;\n var k;\n var string, Shapiro, temp, tt[10];\n\n var loop_size[MAX_LOOPS]; /* contains loop sizes of a structure */\n var helix_size[MAX_LOOPS]; /* contains helix sizes of a structure */\n var loop_degree[MAX_LOOPS]; /* contains loop degrees of a structure */\n var loops; /* n of loops and stacks in a structure */\n var unpaired, pairs; /* n of unpaired digits and pairs */\n\n bulge = (short *) malloc(sizeof(short)*(strlen(structure)/3+1));\n loop = (short *) malloc(sizeof(short)*(strlen(structure)/3+1));\n temp = (char *) malloc(4*strlen(structure)+1);\n\n for (i = 0; i < MAX_LOOPS; i++)\n loop_size[i] = helix_size[i] = 0;\n\n loop_degree[0]=0; /* open structure has degree 0 */\n pairs = unpaired = loops = lp = 0;\n loop[0]=0;\n\n string = aux_struct( structure );\n\n i=p=l=0;\n while (string[i])\n {\n switch(string[i])\n {\n case '.':\n unpaired++;\n loop_size[loop[lp]]++;\n break;\n case '[':\n temp[l++]='(';\n temp[l++]='(';\n if ((i>0)&&(string[i-1]=='('))\n bulge[lp]=1;\n lp++;\n loop_degree[++loops]=1;\n loop[lp]=loops;\n bulge[lp]=0;\n break;\n case ')':\n if (string[i-1]==']')\n bulge[lp]=1;\n p++;\n break;\n case ']':\n if (string[i-1]==']')\n bulge[lp]=1;\n switch (loop_degree[loop[lp]])\n {\n case 1: temp[l++]='H';\n break; /* hairpin */\n case 2:\n if (bulge[lp]==1)\n temp[l++] = 'B'; /* bulge */\n else\n temp[l++] = 'I'; /* internal loop */\n break;\n default: temp[l++] = 'M'; /* multiloop */\n }\n helix_size[loop[lp]]=p+1;\n\n sprintf(tt, \"%d)\" , loop_size[loop[lp]]);\n for(k=0; k<strlen(tt); k++)\n temp[l++] = tt[k];\n sprintf(tt, \"S%d)\" , helix_size[loop[lp]]);\n for(k=0; k<strlen(tt); k++)\n temp[l++] = tt[k];\n\n pairs+=p+1;\n p=0;\n loop_degree[loop[--lp]]++;\n break;\n }\n i++;\n }\n\n *tt = '\\0';\n if (loop_size[0])\n sprintf(tt, \"E%d)\" , loop_size[0]);\n\n for(k=0; k<strlen(tt); k++)\n temp[l++] = tt[k];\n temp[l]='\\0';\n\n if (loop_size[0])\n l++;\n\n Shapiro = (char *) malloc(sizeof(char)*(l+1));\n if (loop_size[0])\n {\n Shapiro[0]='(';\n strcpy(Shapiro+1, temp);\n }\n else\n strcpy(Shapiro, temp);\n\n free(string);\n free(temp);\n free(loop); free(bulge);\n\n return Shapiro;\n}", "title": "" }, { "docid": "f1f964336edc7a1e2976912b12c48585", "score": "0.52572113", "text": "function makePerms(arr) {\n var newArr = [];\n \n for (var j in arr) {\n var array = test.slice(0);\n \n var toJoin = remains(arr[j], array);\n \n for (var k = 0; k < toJoin.length; k++) {\n newArr.push(arr[j] + toJoin[k]);\n }\n }\n\n return newArr;\n}", "title": "" }, { "docid": "edd8680391cea9b70babb65ef3848eef", "score": "0.5254924", "text": "function two(input) {\n \nvar i, ch;\nfor (i = 0; i < input.length; i++) {\n ch = input.splice(i, 1)[0];\n usedChars.push(ch);\n if (input.length == 0) {\n permArr.push(usedChars.slice());\n }\n two(input);\n input.splice(i, 0, ch);\n usedChars.pop();\n}\nreturn permArr\n}", "title": "" }, { "docid": "4e9ffba1676adc2973f3d7eb68b7fe61", "score": "0.52508104", "text": "function solve(nums,goal){\n fullSolutions = {}\n for(let z=0; z<=6; z++){\n fullSolutions[z]={}\n }\n // console.log(goal)\n var ordering=[-1,-1,-1,-1,-1,-1]\n for(let n0=0; n0<6; n0++){\n ordering[0]=n0\n for(let n1=0; n1<6; n1++){\n ordering[1]=n1\n for(let n2=0; n2<6; n2++){\n ordering[2]=n2\n for(let n3=0; n3<6; n3++){\n ordering[3]=n3\n for(let n4=0; n4<6; n4++){\n ordering[4]=n4\n for(let n5=0; n5<6; n5++){\n ordering[5]=n5\n let good=true\n for(let n_check_1 = 0; n_check_1<6; n_check_1++)\n for(let n_check_2 = n_check_1+1; n_check_2<6; n_check_2++)\n if(ordering[n_check_1]==ordering[n_check_2])\n good = false\n if (good)\n find(nums, ordering, goal)\n }\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "5bf0b1ef802db64fd7bef6ef96bd1eb0", "score": "0.525081", "text": "function gemstones(arr) {\n let limpio = [];\n let contador = 0;\n let aux=0;\n let a='abcdefghijklmnopqrstuvwxyz';\n let al = a.split(\"\");\n \n arr.forEach(e=>{\n limpio.push([...new Set(e)]);\n \n });\n al.forEach(e=>{\n if(arr.every(el=>el.includes(e))){\n contador++\n }\n });\n console.log(limpio)\n /*al.forEach(e=>{\n limpio.forEach((element)=>{\n \n if(element.find((f)=>f==e)){\n\n if(aux==3){\n contador++;\n\n }\n }\n });\n });\n /*al.forEach(e=>{\n limpio.forEach(element=>{\n if(element.find(f=>f==e)){\n aux++;\n if(aux==3){\n contador++;\n aux=0;\n }\n })\n \n });*/\n \n return contador;\n /*limpio.forEach((e,i)=>{\n e.forEach(e2=>{\n i++;\n if(e.find(f=>f==e2)){\n contador++;\n }\n });\n });*/\n \n\n /*/let limpio = [...new Set(arr)]\n let a='abcdefghijklmnopqrstuvwxyz';\n let al = a.split(\"\");\n console.log(limpio);\n al.forEach(e=>{\n \n });\n\n /* for(let i=0; i<arr.length; i++){\n let arr\n }\n let arr1 = arr.slice(0,1).toString().split(\"\");\n let arr2 = arr.slice(1,2).toString().split(\"\");\n let arr3 = arr.slice(2).toString().split(\"\");\n arr1 = [...new Set(arr1)];\n arr2 = [...new Set(arr2)];\n arr3 = [...new Set(arr3)];\n let cont = 0\n arr1.forEach((e,i)=>{\n if(arr2.find(f=> f==e) && arr3.find(f2=> f2==e)){\n cont++;\n i++;\n }\n \n });\n console.log(arr1);\n return cont;*/\n}", "title": "" }, { "docid": "6a0bb044080725e7e6324e99650b9501", "score": "0.525018", "text": "function solve(input){\n let count = input.pop();\n for(let i = 0; i < count % input.length ; i++) {\n input.unshift(input.pop());\n }\n console.log(input.join(' '));\n}", "title": "" }, { "docid": "64e8c79eaedefa295224a9be7cbea64c", "score": "0.52460694", "text": "function bubbleAlgoPrivate( xs, ys, b = range( xs.length )) {\n\n\tconst n = xs.length;\n\tvar G = { V : range( n ), E : Array( n ).fill( 0 ).map( x => Array( n ).fill( 0 ))};\n\tconst E = G.E;\n\n\tfor( var i = 0; i < n; ++ i ) {\n\t\tfor( var j = 0; j < n; ++ j ) {\n\n\t\t\tif( i != j && isCloserThan( CONFIG( ).distance, xs[ i ], ys[ i ], xs[ j ], ys[ j ])) {\n\n\t\t\t\tE[ i ][ j ] = 1;\n\t\t\t\tE[ j ][ i ] = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction traverse(Edges, visited, ids, id, at) {\n\t\tvisited[at] = true;\n\t\tids[at] = id;\n\t\tfor(i = 0; i < n; i++) {\n\t\t\tif(Edges[at][i] == 1 && !visited[i]) {\n\t\t\t\ttraverse(Edges, visited, ids, id, i);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet visited = new Array(n);\n\tlet ids = new Array(n);\n\tlet currentId = 0;\n\tvisited.fill(false);\n\n\tfor(j = 0; j < n; j++) {\n\t\tif(!visited[j]) {\n\t\t\ttraverse(E, visited, ids, currentId, j);\n\t\t\tcurrentId = currentId + 1;\n\t\t}\n\t}\n\n\tlet groups = {};\n\tfor(j = 0; j < n; j++) {\n\t\tif(groups[ids[j]] != null) {\n\t\t\tgroups[ids[j]].push(j);\n\t\t}\n\t\telse {\n\t\t\tgroups[ids[j]] = [j];\n\t\t}\n\t}\n\n\tfor(group in Object.values(groups)) {\n\t\tfor(x in group) {\n\t\t\tfor(y in group) {\n\t\t\t\tE[x][y] = 1;\n\t\t\t}\n\t\t}\n\t}\n\n/*\n\tvar changed = true;\n\n\twhile( changed ) {\n\n\t\tchanged = false;\n\t\tvar updates = [ ];\n\n\t\tfor( var i = 0; i < n; ++ i ) {\n\t\t\tfor( var j = 0; j < n; ++ j ) {\n\n\t\t\t\tif( i != j && E[ i ][ j ] == 1 ) {\n\n\t\t\t\t\tfor( var k = 0; k < n; ++ k ) {\n\n\t\t\t\t\t\tif( E[ j ][ k ] == 1 && k != i && j != k && E[ i ][ k ] == 0 ) {\n\n\t\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\t\tupdates.push({ u : i, v : k });\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\n\t\tupdates.forEach((item, index) => {\n E[ item.u ][ item.v ] = 1;\n E[ item.v ][ item.u ] = 1;\n });\n\t}\n*/\n\n\n\tvar b_prime = range( n ).map( i => b[ i ]);\n\t//if disconnected users argue about the bubble id, the more popular one gets to keep it\n\tfor( var i = 0; i < n; ++ i ) {\n\t\tfor( var j = 0; j < n; ++ j ) {\n\n\t\t\tif( i != j && E[ i ][ j ] == 0 && b_prime[ i ] == b_prime[ j ] ) {\n\n\t\t\t\tconst deg_i = degree( i, G );\n\t\t\t\tconst deg_j = degree( j, G );\n\t\t\t\tconst looser = deg_i < deg_j || ( deg_i == deg_j && i > j ) ? i : j;\n\t\t\t\tconst new_bubble_id = Math.max( ...b_prime ) + 1;\n\t\t\t\tb_prime[ looser ] = new_bubble_id;\n\t\t\t}\n\t\t}\n\t}\n\n\t//if connected users have different bubble ids, the more common id is kept\n\tfor( var i = 0; i < n; ++ i ) {\n\t\tfor( var j = 0; j < n; ++ j ) {\n\n\t\t\tif( E[ i ][ j ] == 1 && b_prime[ i ] != b_prime[ j ]) {\n\n\t\t\t\tconst count_i = count( b_prime[ i ], b_prime );\n\t\t\t\tconst count_j = count( b_prime[ j ], b_prime )\n\t\t\t\tconst winner_id = count_i > count_j || ( count_i == count_j && b_prime[ i ] < b_prime[ j ]) ? b_prime[ i ] : b_prime[ j ];\n\t\t\t\tb_prime[ i ] = b_prime[ j ] = winner_id;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { graph: G, bubbles: b_prime };\n}", "title": "" }, { "docid": "2983f4d76ad6d2c61c50e5e762d98b6c", "score": "0.5240447", "text": "function solution(S) {\n for(let i = 0; i < S.length; i ++) {\n if((S[i] == \"A\" && S[i+1] == \"A\") || (S[i] == \"B\" && S[i+1] == \"B\") || (S[i] == \"C\" && S[i+1] == \"C\")) {\n S = S.slice(0, i) + S.slice(i + 1);\n S = S.slice(0, i) + S.slice(i + 1);\n i = 0;\n }\n }\n for(let i = 0; i < S.length; i ++) {\n if((S[i] == \"A\" && S[i+1] == \"A\") || (S[i] == \"B\" && S[i+1] == \"B\") || (S[i] == \"C\" && S[i+1] == \"C\")) {\n S = S.slice(0, i) + S.slice(i + 1);\n S = S.slice(0, i) + S.slice(i + 1);\n i = 0;\n }\n }\n\n return S;\n}", "title": "" }, { "docid": "26b6c972c9c56941aa332e9a3565ebbb", "score": "0.5234564", "text": "function getpyraoptscramble(mn) {\n var j=1,b=[],g=[],f=[],d=[],e=[],k=[],h=[],i=[];function u(){var c,p,q,l,m;for(p=0;p<720;p++){g[p]=-1;d[p]=[];for(m=0;m<4;m++)d[p][m]=w(p,m)}g[0]=0;for(l=0;l<=6;l++)for(p=0;p<720;p++)if(g[p]==l)for(m=0;m<4;m++){q=p;for(c=0;c<2;c++){q=d[q][m];if(g[q]==-1)g[q]=l+1}}for(p=0;p<2592;p++){f[p]=-1;e[p]=[];for(m=0;m<4;m++)e[p][m]=x(p,m)}f[0]=0;for(l=0;l<=5;l++)for(p=0;p<2592;p++)if(f[p]==l)for(m=0;m<4;m++){q=p;for(c=0;c<2;c++){q=e[q][m];if(f[q]==-1)f[q]=l+1}}for(c=0;c<j;c++){k=[];var t=0,s=0;q=0;h=[0,1,2,3,4,5];for(m=0;m<4;m++){p=m+n(6-m);l=h[m];h[m]=h[p];h[p]=l;if(m!=p)s++}if(s%2==1){l=h[4];h[4]=h[5];h[5]=l}s=0;i=[];for(m=0;m<5;m++){i[m]=n(2);s+=i[m]}i[5]=s%2;for(m=6;m<10;m++){i[m]=n(3)}for(m=0;m<6;m++){l=0;for(p=0;p<6;p++){if(h[p]==m)break;if(h[p]>m)l++}q=q*(6-m)+l}for(m=9;m>=6;m--)t=t*3+i[m];for(m=4;m>=0;m--)t=t*2+i[m];if(q!=0||t!=0)for(m=mn;m<99;m++)if(v(q,t,m,-1))break;b[c]=\"\";for(p=0;p<k.length;p++)b[c]+=[\"U\",\"L\",\"R\",\"B\"][k[p]&7]+[\"\",\"'\"][(k[p]&8)/8]+\" \";var a=[\"l\",\"r\",\"b\",\"u\"];for(p=0;p<4;p++){q=n(3);if(q<2)b[c]+=a[p]+[\"\",\"'\"][q]+\" \"}}}function v(q,t,l,c){if(l==0){if(q==0&&t==0)return true}else{if(g[q]>l||f[t]>l)return false;var p,s,a,m;for(m=0;m<4;m++)if(m!=c){p=q;s=t;for(a=0;a<2;a++){p=d[p][m];s=e[s][m];k[k.length]=m+8*a;if(v(p,s,l-1,m))return true;k.length--}}}return false}function w(p,m){var a,l,c,s=[],q=p;for(a=1;a<=6;a++){c=Math.floor(q/a);l=q-a*c;q=c;for(c=a-1;c>=l;c--)s[c+1]=s[c];s[l]=6-a}if(m==0)y(s,0,3,1);if(m==1)y(s,1,5,2);if(m==2)y(s,0,2,4);if(m==3)y(s,3,4,5);q=0;for(a=0;a<6;a++){l=0;for(c=0;c<6;c++){if(s[c]==a)break;if(s[c]>a)l++}q=q*(6-a)+l}return q}function x(p,m){var a,l,c,t=0,s=[],q=p;for(a=0;a<=4;a++){s[a]=q&1;q>>=1;t^=s[a]}s[5]=t;for(a=6;a<=9;a++){c=Math.floor(q/3);l=q-3*c;q=c;s[a]=l}if(m==0){s[6]++;if(s[6]==3)s[6]=0;y(s,0,3,1);s[1]^=1;s[3]^=1}if(m==1){s[7]++;if(s[7]==3)s[7]=0;y(s,1,5,2);s[2]^=1;s[5]^=1}if(m==2){s[8]++;if(s[8]==3)s[8]=0;y(s,0,2,4);s[0]^=1;s[2]^=1}if(m==3){s[9]++;if(s[9]==3)s[9]=0;y(s,3,4,5);s[3]^=1;s[4]^=1}q=0;for(a=9;a>=6;a--)q=q*3+s[a];for(a=4;a>=0;a--)q=q*2+s[a];return q}function y(p,a,c,t){var s=p[a];p[a]=p[c];p[c]=p[t];p[t]=s}function n(c){return Math.floor(Math.random()*c)}\n u();\n ss[0]+=b[0];\n}", "title": "" }, { "docid": "26b6c972c9c56941aa332e9a3565ebbb", "score": "0.5234564", "text": "function getpyraoptscramble(mn) {\n var j=1,b=[],g=[],f=[],d=[],e=[],k=[],h=[],i=[];function u(){var c,p,q,l,m;for(p=0;p<720;p++){g[p]=-1;d[p]=[];for(m=0;m<4;m++)d[p][m]=w(p,m)}g[0]=0;for(l=0;l<=6;l++)for(p=0;p<720;p++)if(g[p]==l)for(m=0;m<4;m++){q=p;for(c=0;c<2;c++){q=d[q][m];if(g[q]==-1)g[q]=l+1}}for(p=0;p<2592;p++){f[p]=-1;e[p]=[];for(m=0;m<4;m++)e[p][m]=x(p,m)}f[0]=0;for(l=0;l<=5;l++)for(p=0;p<2592;p++)if(f[p]==l)for(m=0;m<4;m++){q=p;for(c=0;c<2;c++){q=e[q][m];if(f[q]==-1)f[q]=l+1}}for(c=0;c<j;c++){k=[];var t=0,s=0;q=0;h=[0,1,2,3,4,5];for(m=0;m<4;m++){p=m+n(6-m);l=h[m];h[m]=h[p];h[p]=l;if(m!=p)s++}if(s%2==1){l=h[4];h[4]=h[5];h[5]=l}s=0;i=[];for(m=0;m<5;m++){i[m]=n(2);s+=i[m]}i[5]=s%2;for(m=6;m<10;m++){i[m]=n(3)}for(m=0;m<6;m++){l=0;for(p=0;p<6;p++){if(h[p]==m)break;if(h[p]>m)l++}q=q*(6-m)+l}for(m=9;m>=6;m--)t=t*3+i[m];for(m=4;m>=0;m--)t=t*2+i[m];if(q!=0||t!=0)for(m=mn;m<99;m++)if(v(q,t,m,-1))break;b[c]=\"\";for(p=0;p<k.length;p++)b[c]+=[\"U\",\"L\",\"R\",\"B\"][k[p]&7]+[\"\",\"'\"][(k[p]&8)/8]+\" \";var a=[\"l\",\"r\",\"b\",\"u\"];for(p=0;p<4;p++){q=n(3);if(q<2)b[c]+=a[p]+[\"\",\"'\"][q]+\" \"}}}function v(q,t,l,c){if(l==0){if(q==0&&t==0)return true}else{if(g[q]>l||f[t]>l)return false;var p,s,a,m;for(m=0;m<4;m++)if(m!=c){p=q;s=t;for(a=0;a<2;a++){p=d[p][m];s=e[s][m];k[k.length]=m+8*a;if(v(p,s,l-1,m))return true;k.length--}}}return false}function w(p,m){var a,l,c,s=[],q=p;for(a=1;a<=6;a++){c=Math.floor(q/a);l=q-a*c;q=c;for(c=a-1;c>=l;c--)s[c+1]=s[c];s[l]=6-a}if(m==0)y(s,0,3,1);if(m==1)y(s,1,5,2);if(m==2)y(s,0,2,4);if(m==3)y(s,3,4,5);q=0;for(a=0;a<6;a++){l=0;for(c=0;c<6;c++){if(s[c]==a)break;if(s[c]>a)l++}q=q*(6-a)+l}return q}function x(p,m){var a,l,c,t=0,s=[],q=p;for(a=0;a<=4;a++){s[a]=q&1;q>>=1;t^=s[a]}s[5]=t;for(a=6;a<=9;a++){c=Math.floor(q/3);l=q-3*c;q=c;s[a]=l}if(m==0){s[6]++;if(s[6]==3)s[6]=0;y(s,0,3,1);s[1]^=1;s[3]^=1}if(m==1){s[7]++;if(s[7]==3)s[7]=0;y(s,1,5,2);s[2]^=1;s[5]^=1}if(m==2){s[8]++;if(s[8]==3)s[8]=0;y(s,0,2,4);s[0]^=1;s[2]^=1}if(m==3){s[9]++;if(s[9]==3)s[9]=0;y(s,3,4,5);s[3]^=1;s[4]^=1}q=0;for(a=9;a>=6;a--)q=q*3+s[a];for(a=4;a>=0;a--)q=q*2+s[a];return q}function y(p,a,c,t){var s=p[a];p[a]=p[c];p[c]=p[t];p[t]=s}function n(c){return Math.floor(Math.random()*c)}\n u();\n ss[0]+=b[0];\n}", "title": "" }, { "docid": "6abf4f93a4ec3eb1136aa3199a0493fe", "score": "0.5228134", "text": "function PetrickMethod() {\r\n this.problem;\r\n this.maxProblemSize = 100;\r\n this.solution;\r\n this.log = \"\";\r\n var that = this;\r\n\r\n this.test = function() {\r\n var andArray = new Array();\r\n var orArray;\r\n var monomA;\r\n var monomB;\r\n orArray = new Array();\r\n monomA = new Object(); // using objects ensures that (x and x) = x\r\n monomA[1] = 1;\r\n orArray.push(monomA);\r\n monomB = new Object();\r\n monomB[2] = 2;\r\n orArray.push(monomB);\r\n andArray.push(orArray);\r\n orArray = new Array();\r\n monomA = new Object();\r\n monomA[3] = 3;\r\n orArray.push(monomA);\r\n monomB = new Object();\r\n monomB[4] = 4;\r\n orArray.push(monomB);\r\n andArray.push(orArray);\r\n orArray = new Array();\r\n monomA = new Object();\r\n monomA[1] = 1;\r\n orArray.push(monomA);\r\n monomB = new Object();\r\n monomB[3] = 3;\r\n orArray.push(monomB);\r\n andArray.push(orArray);\r\n orArray = new Array();\r\n monomA = new Object();\r\n monomA[5] = 5;\r\n orArray.push(monomA);\r\n monomB = new Object();\r\n monomB[6] = 6;\r\n orArray.push(monomB);\r\n andArray.push(orArray);\r\n orArray = new Array();\r\n monomA = new Object();\r\n monomA[2] = 2;\r\n orArray.push(monomA);\r\n monomB = new Object();\r\n monomB[5] = 5;\r\n orArray.push(monomB);\r\n andArray.push(orArray);\r\n orArray = new Array();\r\n monomA = new Object();\r\n monomA[4] = 4;\r\n orArray.push(monomA);\r\n monomB = new Object();\r\n monomB[6] = 6;\r\n orArray.push(monomB);\r\n andArray.push(orArray);\r\n /*orArray = new Array();\r\n monomA = new Object(); \r\n monomA[4] = 4;\r\n orArray.push(monomA);\r\n monomB = new Object();\r\n monomB[4] = 4;\r\n orArray.push(monomB);\r\n andArray.push(orArray);*/\r\n\r\n this.solve(andArray);\r\n };\r\n\r\n this.solve = function(eq) {\r\n this.problem = eq;\r\n this.log = \"\";\r\n\r\n //printEqnArray(eq);\r\n printEqnArrayFancy(eq);\r\n\r\n // multiply out\r\n var andArray = eq;\r\n var loopCounter = 0;\r\n while (andArray.length > 1) {\r\n var newAndArray = new Array();\r\n for (var i = 1; i < andArray.length; i += 2) {\r\n var orTermA = andArray[i - 1];\r\n var orTermB = andArray[i];\r\n var newOrArray = new Array();\r\n for (var a = 0; a < orTermA.length; a++) {\r\n for (var b = 0; b < orTermB.length; b++) {\r\n var monom1 = orTermA[a];\r\n var monom2 = orTermB[b];\r\n var resultingMonom = new Object();\r\n for (var m in monom1) {\r\n resultingMonom[monom1[m]] = monom1[m];\r\n }\r\n for (var n in monom2) {\r\n resultingMonom[monom2[n]] = monom2[n];\r\n }\r\n newOrArray.push(resultingMonom);\r\n }\r\n }\r\n\r\n newAndArray.push(newOrArray);\r\n }\r\n // if uneven copy last and-term\r\n if (andArray.length % 2 === 1) {\r\n newAndArray.push(andArray[andArray.length - 1]);\r\n }\r\n //printEqnArray(newAndArray);\r\n printEqnArrayFancy(newAndArray);\r\n\r\n andArray.length = 0;\r\n // simplify or-term\r\n for (var i = 0; i < newAndArray.length; i++) {\r\n var orTerm = newAndArray[i];\r\n var newOrTerm = simplifyOrTerm(orTerm);\r\n if (newOrTerm.length > 0) {\r\n andArray.push(newOrTerm);\r\n }\r\n }\r\n\r\n var problemSize = eqnArrayProblemSize(andArray);\r\n if (problemSize > this.maxProblemSize) {\r\n console.log(\r\n \"Error: The cyclic covering problem is too large to be solved with Petrick's method (increase maxProblemSize). Size=\" +\r\n problemSize\r\n );\r\n return false;\r\n }\r\n\r\n //printEqnArray(andArray);\r\n printEqnArrayFancy(andArray);\r\n loopCounter++;\r\n }\r\n this.solution = andArray;\r\n return true;\r\n };\r\n\r\n function simplifyOrTerm(orTerm) {\r\n // find a monom that is the same or simpler than another one\r\n var newOrTerm = new Array();\r\n var markedForDeletion = new Object();\r\n for (var a = 0; a < orTerm.length; a++) {\r\n var keepA = true;\r\n var monomA = orTerm[a];\r\n for (var b = a + 1; b < orTerm.length && keepA; b++) {\r\n var monomB = orTerm[b];\r\n var overlapBoverA = 0;\r\n var lengthA = 0;\r\n for (var m in monomA) {\r\n if (monomB[m] in monomA) {\r\n overlapBoverA++;\r\n }\r\n lengthA++;\r\n }\r\n\r\n var overlapAoverB = 0;\r\n var lengthB = 0;\r\n for (var m in monomB) {\r\n if (monomA[m] in monomB) {\r\n overlapAoverB++;\r\n }\r\n lengthB++;\r\n }\r\n\r\n if (overlapBoverA === lengthB) {\r\n keepA = false;\r\n }\r\n\r\n if (lengthA < lengthB && overlapAoverB === lengthA) {\r\n markedForDeletion[b] = b;\r\n }\r\n }\r\n if (keepA) {\r\n if (a in markedForDeletion) {\r\n // do nothing\r\n } else newOrTerm.push(orTerm[a]);\r\n }\r\n }\r\n return newOrTerm;\r\n }\r\n\r\n function printEqnArrayFancy(andArray) {\r\n var str = \"\";\r\n for (var i = 0; i < andArray.length; i++) {\r\n var first = true;\r\n str += \"(\";\r\n var orArray = andArray[i];\r\n for (var j = 0; j < orArray.length; j++) {\r\n if (!first) str += \" &or; \";\r\n var monom = orArray[j];\r\n for (var k in monom) {\r\n str += \"<i>p</i><sub><small>\" + monom[k] + \"</small></sub>\";\r\n }\r\n first = false;\r\n }\r\n str += \")\";\r\n }\r\n if (that.log.length > 0) {\r\n that.log += \"<p>&hArr;&nbsp;\" + str + \"</p>\";\r\n } else {\r\n that.log += \"<p>\" + str + \"</p>\";\r\n }\r\n }\r\n\r\n function eqnArrayProblemSize(andArray) {\r\n var monomCounter = 0;\r\n for (var i = 0; i < andArray.length; i++) {\r\n var orArray = andArray[i];\r\n monomCounter += orArray.length;\r\n }\r\n return monomCounter;\r\n }\r\n\r\n function printEqnArray(andArray) {\r\n var str = \"\";\r\n for (var i = 0; i < andArray.length; i++) {\r\n var first = true;\r\n str += \"(\";\r\n var orArray = andArray[i];\r\n for (var j = 0; j < orArray.length; j++) {\r\n if (!first) str += \" or \";\r\n var monom = orArray[j];\r\n for (var k in monom) {\r\n str += monom[k];\r\n }\r\n first = false;\r\n }\r\n str += \")\";\r\n }\r\n console.log(str);\r\n }\r\n}", "title": "" }, { "docid": "82642b4b804336a72752576508ed042e", "score": "0.52171075", "text": "function spoj_tagy()\r\n{\r\n var zhoda = 0;\r\n var i, j, p;\r\n for (i = 0; i < hlbka; i++)\r\n {\r\n for (j = 0; j < html.length; j++)\r\n {\r\n if (html[j][1] == i)\r\n {\r\n html[j].push(orez_cislo(zhoda));\r\n zhoda++;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "e72cb96cf7e6860db35d429d8c2cbb3e", "score": "0.52121264", "text": "function am1(i,x,w,j,c,n){for(;--n>=0;){var v=x*this[i++]+w[j]+c;c=Math.floor(v/67108864),w[j++]=67108863&v}return c}", "title": "" }, { "docid": "e62c3ed602abc2425e98d258dca7add3", "score": "0.521046", "text": "function runProgram(input){\n let input_arr = input.trim().split(\" \").map(Number)\n let harry = Math.max(...input_arr)\n let ron = Math.min(...input_arr)\n\n let tiles_touched = {\n [harry] : 1,\n [ron] : 1\n }\n\n let meeting_tile = -1\n while(harry > ron){\n harry = next_tile(harry)\n ron = next_tile(ron)\n tiles_touched[harry] = 1 \n if(tiles_touched[ron] != undefined){\n meeting_tile = ron\n break\n }\n }\n\n console.log(meeting_tile)\n\n function next_tile(prev){\n let to_add = prev.toString().split(\"\").map(Number).reduce((acc, ele) => acc + ele)\n let next = prev + to_add\n return next\n }\n}", "title": "" }, { "docid": "afde11d2d2fc3194f972c1217efe09d7", "score": "0.52060694", "text": "recursive_better(x, y) {\n if (y == 0) return 1;\n if (y == 1) return x;\n var tmp = this.recursive_better(x, y / 2);\n if (y % 2 == 0)\n return tmp * tmp;\n return x * tmp * tmp;\n }", "title": "" }, { "docid": "12047366fa2c4c2053134d55f75c4521", "score": "0.5202388", "text": "function solve092()\n{\n return countGarbage(input);\n}", "title": "" }, { "docid": "86e2a8085b0d2a7786a3c366b83d5db8", "score": "0.5202308", "text": "function solution(A) {\r\n //create 2 variables to track starting with 0 and starting with 1\r\n let zeroCount = 0;\r\n let oneCount = 0;\r\n let zeroArr = A.slice();\r\n let oneArr = A.slice();\r\n\r\n //start with 0 and make a new array with changes\r\n if(zeroArr[0] === 1) {\r\n zeroArr[0] = 0;\r\n zeroCount += 1;\r\n }\r\n for(let i = 1; i < zeroArr.length; i++) {\r\n if(zeroArr[i-1] === 0 && zeroArr[i] === 1) {\r\n continue;\r\n } else if(zeroArr[i-1] === 1 && zeroArr[i] === 0) {\r\n continue;\r\n } else if(zeroArr[i-1] === 0 && zeroArr[i] === 0) {\r\n zeroArr[i] = 1;\r\n zeroCount += 1;\r\n } else {\r\n zeroArr[i] = 0;\r\n zeroCount += 1;\r\n }\r\n }\r\n\r\n\r\n\r\n\r\n //start with 1 and make a new array with changes\r\n if(oneArr[0] === 0) {\r\n oneArr[0] = 1;\r\n oneCount++;\r\n }\r\n for(let i = 1; i < oneArr.length; i++) {\r\n if(oneArr[i-1] === 1 && oneArr[i] === 0) {\r\n continue;\r\n } else if(oneArr[i-1] === 0 && oneArr[i] === 1) {\r\n continue;\r\n } else if(oneArr[i-1] === 1 && oneArr[i] === 1) {\r\n oneArr[i] = 0;\r\n oneCount += 1;\r\n } else {\r\n oneArr[i] = 0;\r\n oneCount += 1;\r\n }\r\n }\r\n\r\n //compare the variables\r\n const finalAnswer = (oneCount < zeroCount) ? oneCount : zeroCount;\r\n\r\n //return final variable\r\n return finalAnswer; \r\n\r\n}", "title": "" }, { "docid": "f56ea0c0e7d252fd3c4951c01aa7b28b", "score": "0.5198839", "text": "function solution(A) {\n var len = A.length;\n var value;\n var size = 0;\n var count = 0;\n var numLeaders = 0;\n var cntLeaders = 0;\n\n for(var i = 0; i < len; i++) {\n if(size === 0) {\n size ++;\n value = A[i];\n } else {\n if(A[i] === value) {\n size ++;\n } else {\n size --;\n }\n }\n }\n\n for(var ii = 0; ii < len; ii++) {\n if(A[ii] === value) {\n count++;\n }\n }\n\n value = count > (len / 2) ? value : -1;\n\n if(value === -1) {\n return numLeaders;\n }\n\n for(var iii = 0; iii < len; iii++) {\n if(A[iii] === value) {\n cntLeaders++;\n }\n\n if(cntLeaders > (iii + 1) / 2 && count - cntLeaders > (len - (iii + 1)) / 2) {\n numLeaders++;\n }\n }\n\n return numLeaders;\n}", "title": "" }, { "docid": "1a490a425124f2ac1036912906640da6", "score": "0.51950294", "text": "function quadcombo(arr, S) {\n\n}", "title": "" }, { "docid": "020392e0c8a2d03d93249014c9aba7c2", "score": "0.5194691", "text": "function eU(gg){\n\n return fi(function(gh){\n\n gh = +gh;\n return fi(function(gk, gi){\n\n var j,gj = gg([], gk.length, gh),i = gj.length;\n // Match elements found at the specified indexes\n while(i--){\n\n if(gk[(j = gj[i])]){\n\n gk[j] = !(gi[j] = gk[j]);\n };\n };\n });\n });\n }", "title": "" }, { "docid": "71bec1c8bd24b3b02a0040ebec32bc6d", "score": "0.51925814", "text": "function getbumps(arrin) {\n /* find elements with bump on*/\n var arr = arrin.filter(bump);\n /* sort by row and xpos for not mixin up the different rows*/\n arr.sort(function (a, b) {\n return a.row * 2 * game.width + a.xpos - (b.row * 2 * game.width + b.xpos);\n });\n\n /*loop through bumpable elements*/\n for (var i = 0; i < arr.length; i++) {\n var eni = arr[i];\n /* has elment hit a rock?*/\n var arrb = allItems.filter(blocked, eni);\n if (arrb.length > 0) {\n /* relocate element outside rock an turn direction*/\n if (eni.direction > 0) {\n eni.xpos = arrb[0].xpos - (eni.rightb - eni.leftb) - (eni.rightb - arrb[0].leftb);\n } else {\n eni.xpos = arrb[0].rightb + (arrb[0].rightb - eni.leftb);\n }\n eni.direction = eni.direction * -1;\n }\n\n\n if (i === arr.length - 1) break;\n var enj = arr[i + 1];\n /* has element overlaying bound with \"right\" neighbour?*/\n if (enj.row === eni.row && eni.leftb < enj.leftb && eni.rightb > enj.leftb) {\n /* same or different direction for turn on not*/\n if (eni.direction != enj.direction) {\n eni.direction = eni.direction * -1;\n enj.direction = enj.direction * -1;\n }\n /* exchange elements speed and relocate \"right\" neighbour outside element*/\n var tempspeed = eni.speed;\n eni.speed = enj.speed;\n enj.speed = tempspeed;\n enj.xpos = eni.rightb + (eni.rightb - enj.leftb);\n }\n }\n }", "title": "" }, { "docid": "e36e331f57cb22659d60045aae12978c", "score": "0.5182657", "text": "function anotherFunChallenge(input) {\n let a = 5;//O(1)\n let b = 10;//O(1)\n let c = 50;//O(1)\n for (let i = 0; i < input; i++) {//O(n)\n let x = i + 1;//O(n)\n let y = i + 2;//O(n)\n let z = i + 3;//O(n)\n\n }\n for (let j = 0; j < input; j++) {//O(n)\n let p = j * 2;//O(n)\n let q = j * 2;//O(n)\n }\n let whoAmI = \"I don't know\";//O(1)\n}//BigO O(n) or O(4 + 7n)", "title": "" }, { "docid": "f4f8ee918a59808cb93c88db8edd643a", "score": "0.51777506", "text": "buildHeap(array) {\n // Write your code here.\n //find the first parent idx\n let parentIdx = Math.floor((array.length - 1 - 1) / 2);\n //start calling sifting down on the first potential parent\n for (let idx = parentIdx; idx >= 0; idx--) {\n this.siftDown(idx, array.length - 1, array);\n //every time we call sift down it compares the parent with its left and right children\n //then switched the position if necessary\n //and then idx-- =>goest to the next (previous) parent\n }\n return array;\n }", "title": "" }, { "docid": "69c961fa18334bdd28b9585260e607f6", "score": "0.5177219", "text": "function fOp(first, second) { // the group operation.\n var out1array = [];\n var out2array = [];\n var hold1array = [];\n var hold2array = [];\n\n var out1 = copyNode(first.a);\n var out2 = copyNode(second.b);\n\n generatePreorder(out1, out1array);\n generatePreorder(out2, out2array);\n\n var hold1 = copyNode(first.b);\n var hold2 = copyNode(second.a);\n\n generatePreorder(hold1, hold1array);\n generatePreorder(hold2, hold2array);\n\n var tempArray = [];\n var index = 0;\n\n while (findFirst(hold1, hold2)!=null) {\n \n tempArray = findFirst(hold1, hold2); \n // find the next node in the left element to be 'superimposed'\n index = hold1array.indexOf(tempArray[0]);\n // get index of hold1's node to be replaced\n tempArray[0].left = copyNode(tempArray[1].left); \n tempArray[0].right = copyNode(tempArray[1].right);\n tempArray[0].left.parent = tempArray[0];\n tempArray[0].right.parent = tempArray[0];\n // make hold1 into hold2 as usual\n out1array[index].left = copyNode(tempArray[1].left);\n out1array[index].right = copyNode(tempArray[1].right);\n out1array[index].left.parent = out1array[index];\n out1array[index].right.parent = out1array[index];\n // add to the partner tree\n out1array = [];\n hold1array = []; // reset preorder\n generatePreorder(out1, out1array);\n generatePreorder(hold1, hold1array);\n tempArray = []; // cleanup\n }\n\n while (findFirst(hold2, hold1)!=null) { \n tempArray = findFirst(hold2, hold1); \n // find the next node in the right element to be 'superimposed'\n index = hold2array.indexOf(tempArray[0]);\n // get index of hold2's node to be replaced\n tempArray[0].left = copyNode(tempArray[1].left); // NEEDS TO COPY PARENT\n tempArray[0].right = copyNode(tempArray[1].right); \n tempArray[0].left.parent = tempArray[0];\n tempArray[0].right.parent = tempArray[0];\n // make hold1 into hold2 as usual\n out2array[index].left = copyNode(tempArray[1].left); // NEEDS TO COPY PARENT\n out2array[index].right = copyNode(tempArray[1].right);\n out2array[index].left.parent = out2array[index];\n out2array[index].right.parent = out2array[index];\n // add to the partner tree\n out2array = [];\n hold2array = []; // reset preorder\n generatePreorder(out2, out2array);\n generatePreorder(hold2, hold2array);\n tempArray = []; // cleanup\n }\n \n var output = new eltF(out1, out2);\n output.leafA = out1array;\n output.leafB = out2array;\n return output;\n \n}", "title": "" }, { "docid": "a38460d0b77332094d40c5904094d4b3", "score": "0.5174792", "text": "e49() {\n // we generate all primes under 10000,\n // for each prime generated we sort their digits from lower to higher, and classify them in a table\n\n // Equivalence Class table, the key represents the equivalence class number (e.g 1478)\n // And the value will be the list of primes in that equivalence class, ie. the list of primes which also uses those 4 digits.\n // e.g. for 1478, the value will be [ '1487', '1847', '4817', '4871', '7481', '7841', '8147', '8741' ]\n const permutationClassTable = {};\n const fourDigitPrimes = Object.keys(utils.generatePrimesTable(10000)).filter(x => x >= 1000);\n for (let i = 0; i < fourDigitPrimes.length; i++) {\n const sortedDigits = fourDigitPrimes[i].toString().split('').sort().join('');\n const permutations = permutationClassTable[sortedDigits];\n if (permutations) {\n permutationClassTable[sortedDigits].push(fourDigitPrimes[i]);\n } else {\n permutationClassTable[sortedDigits] = [fourDigitPrimes[i]];\n }\n }\n\n // now that we have our equivalence class table\n // we loop over the keys and for each key, we check the list of corresponding primes\n // for whether or not one number is the average of 2 other numbers\n const keys = Object.keys(permutationClassTable);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (key !== '1478') { // this answer is given in problem statement\n const primes = permutationClassTable[key];\n if (primes.length >= 3) {\n for (let j = 0; j < primes.length - 2; j++) {\n for (let k = j + 2; k < primes.length; k++) {\n const avg = (+primes[j] + +primes[k]) / 2;\n if (primes.includes(avg.toString())) {\n return `${primes[j]}${avg}${primes[k]}`;\n }\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "17f1e99e10a8b91314a60d72af8b591d", "score": "0.5173909", "text": "function solution(A) {\n\n}", "title": "" }, { "docid": "7937d4fbab641e0c3285302e6be263ac", "score": "0.5173196", "text": "function forceBrute() {\n\tnumChecks = 0;\n\t// Brute force O(n^2) comparisons\n\tfor (var i=0;i<bods.N;i++) {\n\t\tfor (var j=i+1;j<bods.N;j++) {\n\t\t\tsetAccel(i,j);\n\t\t\tnumChecks += 1;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ae4bc4a89a007a8258aa13b3c2935e3c", "score": "0.51722443", "text": "combinations(word) {\n if (word.length === 1) {\n return [word];\n } else {\n let previous = this.combinations(word.slice(0,word.length-1));\n let lastLetter = word[word.length-1];\n return previous.concat(this.partialCombos(previous, lastLetter))\n .concat([lastLetter]);\n }\n }", "title": "" }, { "docid": "57743fd9c39cacc644242420da3ae905", "score": "0.5164255", "text": "function multiBjork(index,pulses,steps)\n{\n //returing if steps or pulses are 0 or if pulses it biggern than steps to avoid errors\n\n if(pulses > steps || pulses == 0 || steps == 0)\n {\n return;\n }\n\n\n //rounding values to whole numbers\n steps = Math.round(steps);\n pulses = Math.round(pulses);\n\n //array for patern, pulses, remainders, divisors and level of iteration\n var pattern = [];\n var counts = [];\n var remainders = [];\n var divisor = steps - pulses;\n var level = 0;\n\n //pusing the remainders to pulses\n remainders.push(pulses);\n\n //getting an array of remainder values\n while (true) {\n counts.push(Math.floor(divisor / remainders[level]));\n remainders.push(divisor % remainders[level]);\n divisor = remainders[level];\n level++;\n if (remainders[level] <= 1) {\n break;\n }\n };\n\n //function for creating the sequence\n counts.push(divisor);\n var r = 0;\n var build = function(level) {\n r++;\n if (level > -1) {\n for (var i = 0; i < counts[level]; i++) {\n build(level - 1);\n }\n if (remainders[level] != 0) {\n build(level - 2);\n }\n } else if (level == -1) {\n pattern.push(0);\n } else if (level == -2) {\n pattern.push(1);\n }\n };\n\n build(level);\n\n //set correct order\n\n\n //storing the steps for this sequence in my bjorklund step array with the chosen index\n\n bjorkSteps[index] = steps;\n\n //reverse pattern to complete algorithm and storing it to the correct array with chosen index\n bjorklundArray[index] = pattern.reverse();\n \n outlet(0,bjorklundArray[index]);\n\n //redrwaing graphics to represent new sequence\n\n mgraphics.redraw();\n\n}", "title": "" }, { "docid": "6ecd57e1bd2983c97c833acbf22e5389", "score": "0.51546997", "text": "evaluate(b, newBoard, eat, newEat, tileA,tileB)\n {\n Array.prototype.differences = function(arr2) {//find differences between two arrays\n var ret = [];\n this.sort();\n arr2.sort();\n for(var i = 0; i < this.length; i += 1) {\n if(arr2.indexOf(this[i]) > -1){\n ret.push(this[i]);\n }\n }\n return ret;\n };\n //let haeMovedTHeLast = 10, haveEat = 5, haveOpenTilesInTheHouse = -5/* check if realy et someone */, HaveOpenTilesThatAtGreatRisk = 0, closedHouse;\n let enemyColor = this.color == \"black\" ? \"white\" : \"black\";\n let opens = findAllOpen(b, this.color);\n let closed = findAllClosed(newBoard, this.color);\n let houseOpen = findHouseOpen(newBoard, this.color);\n let fartest = findFartest(b, this.color);\n let newFartest = findFartest(newBoard, this.color);\n\n let haveClosed = opens.differences(closed).length > 0;\n let haveEat = eat[enemyColor].length < newEat[enemyColor].length;\n \n let finaleValue = 0;\n\n let check = false;\n \n if(haveEat)//אכל ויש בבית מקומות פתוחים\n {\n //evaluate\n finaleValue += 3;\n if(houseOpen.length > 0)\n finaleValue = finaleValue - (3 * (houseOpen.length/6.0));\n check = true;\n }\n if(haveClosed)//סגר בית\n {\n //evaluate\n finaleValue += 5;\n check = true;\n }\n if(fartest != newFartest)//קידם את האחרון\n {\n //evaluate\n finaleValue += 2\n check = true;\n }\n let c = 0;\n if(tileB)\n c += this.risk(newBoard, newEat, tileB);\n c += this.risk(newBoard, newEat, tileA)\n console.log(c);\n return c;\n if(!check)\n return Math.random()\n return finaleValue;\n\n }", "title": "" }, { "docid": "1e0fb2dbef9a1cd8e61ef533595f9ac2", "score": "0.51509196", "text": "function solution(d){\n // Сделаем из числа массив\n var arr = (d+'').split('');\n //console.log('Вот массив цифр');\n // console.log(arr);\n var arrStorage = [];\n var arrTmp = [];\n\n // Запустим цикл, начнем с девяток. Будем искать числа\n outer: for (var n=9;n>0; n--) {\n if (arr.indexOf(n + '') === -1) break;\n for (;;) {\n if (arr.indexOf(n + '') >= 0) { // Понеслась\n for (var j = 0; j < 5; j++) { //Делаем цикл из 5 итераций - берем n и 4 следующих цифры, делаем из них число\n arrTmp.push(arr[arr.indexOf(n + '') + j]); // Закинули 5 цифр во временный массив\n }\n arrStorage.push(+(arrTmp.join('')));\n arrTmp = [];\n delete arr[arr.indexOf(n + '')];\n if (arr.indexOf(n + '') === -1) break outer;\n } else break;\n }\n }\n console.log(arrStorage);\n // Теперь найдем максимальное из чисел в arrStorage\n return Math.max.apply(null, arrStorage);\n\n\n\n}", "title": "" }, { "docid": "cc24423315e1885ae5091983f626afff", "score": "0.5147974", "text": "function solution(n) {\n\n}", "title": "" }, { "docid": "28a3b04e124471532fc7867502b496b1", "score": "0.5147364", "text": "function r(a,b,c){/* left son of k */\nfor(var d=a.heap[c],e=c<<1;e<=a.heap_len&&(e<a.heap_len&&q(b,a.heap[e+1],a.heap[e],a.depth)&&e++,!q(b,d,a.heap[e],a.depth));)/* Exchange v with the smallest son */\na.heap[c]=a.heap[e],c=e,e<<=1;a.heap[c]=d}", "title": "" }, { "docid": "1d9d0d2e4e63943bea46d23ba185ce17", "score": "0.5145146", "text": "function J(i) {\n /* Cause a branch to build(?) */\n if (i % 3)\n [1,2,3]\n}", "title": "" }, { "docid": "8775c9f58bb2c707cdca4cabff99c999", "score": "0.51435685", "text": "step3b(word) {\n var result = word;\n\n // end ing => delete if in R2; if preceded by ig, delete if in R2 and not preceded by e, otherwise undouble the ending\n var suf = \"\";\n if (suf = result.endsinArr([\"end\", \"ing\"])) {\n if ((result.length - 3) >= this.r2) {\n // Delete suffix\n result = result.removeSuffix(3);\n //this.regions(result);\n if (result.endsin(\"ig\") && (result.length - 2 >= this.r2) && result[result.length - 3] != \"e\") {\n // Delete suffix\n result = result.removeSuffix(2);\n }\n else {\n result = result.undoubleEnding();\n }\n }\n }\n \n // ig => delete if in R2 and not preceded by e\n if (result.endsin(\"ig\") && this.r2 <= result.length - 2 && result[result.length - 3] != \"e\") {\n result = result.removeSuffix(2);\n }\n \n // lijk => delete if in R2, and then repeat step 2\n if (result.endsin(\"lijk\") && this.r2 <= result.length - 4) {\n result = result.removeSuffix(4);\n // repeat step 2\n result = this.step2(result);\n }\n\n // baar => delete if in R2\n if (result.endsin(\"baar\") && this.r2 <= result.length - 4) {\n result = result.removeSuffix(4);\n } \n\n // bar => delete if in R2 and if step 2 actually removed an e\n if (result.endsin(\"bar\") && this.r2 <= result.length - 3 && this.suffixeRemoved) {\n result = result.removeSuffix(3);\n } \n \n if (DEBUG) {\n console.log(\"step 3b: \" + result);\n }\n return result;\n }", "title": "" }, { "docid": "b4b5e8df617c0002b41f7b2f4d252228", "score": "0.51431704", "text": "function barrettReduce(x){for(x.drShiftTo(this.m.t-1,this.r2),x.t>this.m.t+1&&(x.t=this.m.t+1,x.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);x.compareTo(this.r2)<0;)x.dAddOffset(1,this.m.t+1);for(x.subTo(this.r2,x);x.compareTo(this.m)>=0;)x.subTo(this.m,x)}", "title": "" }, { "docid": "458b6de5ff66d9e06a9adce4f51ba57e", "score": "0.51368284", "text": "function possibleCombo(vertex, size){\n var combinations = [];\n\n for (var i = 0; i < vertex.length; i++) {\n var comb = [];\n if ((vertex[i][1] - vertex[i][0]) / (size + 1) === 1) {\n var top = vertex[i][0];\n\n comb.push([top, top + 1]);\n\n comb.push([top + 1, top + 1 + size]);\n\n comb.push([top + size, top + 1 + size]);\n\n comb.push([top, top + size]);\n } else if ((vertex[i][1] - vertex[i][0]) / (size + 1) === 2) {\n comb.push([top, top + 1]);\n comb.push([top + 1, top + 2]);\n\n comb.push([top + 2, top + 2 + size]);\n comb.push([top + 2 + size, top + 2 + size + size]);\n\n comb.push([top + 1 + size + size, top + 2 + size + size]);\n comb.push([top + size + size, top + 1 + size + size]);\n\n comb.push([top, top + size]);\n comb.push([top + size, top + size + size]);\n } else if ((vertex[i][1] - vertex[i][0]) / (size + 1) === 3) {\n comb.push([top, top + 1]);\n comb.push([top + 1, top + 2]);\n comb.push([top + 2, top + 3]);\n\n comb.push([top + 3, top + 3 + size]);\n comb.push([top + 3 + size, top + 3 + size + size]);\n comb.push([top + 3 + size + size, top + 3 + size + size + size]);\n\n comb.push([top + 2 + size + size + size, top + 3 + size + size + size]);\n comb.push([top + 1 + size + size + size, top + 2 + size + size + size]);\n comb.push([top + size + size + size, top + 1 + size + size + size]);\n\n comb.push([top, top + size]);\n comb.push([top + size, top + size + size]);\n comb.push([top + size + size, top + size + size + size]);\n } else if ((vertex[i][1] - vertex[i][0]) / (size + 1) === 4) {\n comb.push([top, top + 1]);\n comb.push([top + 1, top + 2]);\n comb.push([top + 2, top + 3]);\n comb.push([top + 3, top + 4]);\n\n comb.push([top + 4, top + 4 + size]);\n comb.push([top + 4 + size, top + 4 + size + size]);\n comb.push([top + 4 + size + size, top + 4 + size + size + size]);\n comb.push([top + 4 + size + size, top + 4 + size + size + size]);\n comb.push([top + 4 + size + size + size, top + 4 + size + size + size + size]);\n\n comb.push([top + 3 + size + size + size + size, top + 4 + size + size + size + size]);\n comb.push([top + 2 + size + size + size + size, top + 3 + size + size + size + size]);\n comb.push([top + 1 + size + size + size + size, top + 2 + size + size + size + size]);\n comb.push([top + size + size + size + size, top + 1 + size + size + size + size]);\n\n comb.push([top, top + size]);\n comb.push([top + size, top + size + size]);\n comb.push([top + size + size, top + size + size + size]);\n comb.push([top + size + size + size, top + size + size + size + size]);\n }\n combinations.push(comb);\n }\n return combinations;\n}", "title": "" }, { "docid": "336081493b39e8c2fee125f4f4bda5f7", "score": "0.5127636", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n if (A.length <= 5) {\n return false;\n };\n let pos1 = 1; \n let pos2;\n if (A.length % 2 !== 0) {\n pos2 = (A.length - 1) / 2;\n } else {\n pos2 = A.length / 2;\n };\n let server1 = A.slice(0, pos1);\n console.log(server1);\n let server2 = A.slice(pos1 + 1, pos2);\n console.log(server2);\n let server3 = A.slice(pos2 + 1);\n console.log(server3);\n console.log('------------');\n let sumServer1 = server1.reduce((acc, currVal) => acc + currVal, 0);\n let sumServer2 = server2.reduce((acc, currVal) => acc + currVal, 0);\n let sumServer3 = server3.reduce((acc, currVal) => acc + currVal, 0);\n while (pos2 !== A.length - 2 && sumServer1 !== sumServer2 && sumServer1 !== sumServer3) {\n pos1 = pos1 + 1;\n if (pos2 - pos1 === 1) {\n pos2 = pos2 + 1;\n pos1 = 1;\n }\n server1 = A.slice(0, pos1);\n server2 = A.slice(pos1 + 1, pos2);\n server3 = A.slice(pos2 + 1);\n sumServer1 = server1.reduce((acc, currVal) => acc + currVal, 0);\n sumServer2 = server2.reduce((acc, currVal) => acc + currVal, 0);\n sumServer3 = server3.reduce((acc, currVal) => acc + currVal, 0);\n console.log(A);\n console.log(server1);\n console.log(server2);\n console.log(server3);\n console.log('------------');\n };\n console.log('pos1 = ' + pos1 + ' pos2 = ' + pos2);\n return (sumServer1 === sumServer2 && sumServer1 === sumServer3);\n}", "title": "" }, { "docid": "e20d8375ecf17cf2e149f858d0985f92", "score": "0.51245", "text": "function transform(currentState) {\n\n let i;\n let j;\n let k;\n\n let ArrNewStates = [];\n\n let newState = {};\n let buffFinalState = {};\n\n // Premièrement, on bouge 2 bateaux vers la destination\n for (i = 0; i < currentState[0].length; i++) {\n // On ne déplace pas 2 fois le même bateau, et on ne déplace pas 2 fois le même set de bateaux\n for (j = i + 1; j < currentState[0].length; j++) {\n newState = clone(currentState);\n newState.previous = currentState;\n\n // Calcul du coût réel\n newState.cost = Math.max(newState[0][i].speed, newState[0][j].speed) + currentState.cost;\n\n newState[1].push(newState[0][i]);\n newState[1].push(newState[0][j]);\n\n // On s'assure que on bouge toujours l'indice le plus haut en premier,\n newState[0].splice(j, 1);\n newState[0].splice(i, 1);\n\n newState.cost+= h_cost(newState);\n\n // Puis, si on a pas l'état final, on ramène 1 bateau afin de servir d'escorte pour les prochains\n if (!(isTarget(newState))) {\n for (k = 0; k < newState[1].length; k++) {\n\n buffFinalState = clone(newState);\n\n buffFinalState.cost += buffFinalState[1][k].speed;\n\n buffFinalState[0].push(buffFinalState[1][k]);\n buffFinalState[1].splice(k, 1);\n buffFinalState.name = represent(buffFinalState, 1);\n\n // On ne cherche pas le chemin le plus court, on stocke ici tous les voisins de l'état actuel.\n ArrNewStates.push(clone(buffFinalState));\n\n }\n }\n // Si on a l'état final, on le retourne et il sera traité par l'algorithme\n else {\n newState.name = \"final\";\n ArrNewStates.push(clone(newState));\n }\n }\n }\n return ArrNewStates;\n}", "title": "" }, { "docid": "65bf82ea371e44d3a28a64b7ce1d24a4", "score": "0.5119065", "text": "function pass1(elem) {\n\t xs[elem] = blockG.inEdges(elem).reduce(function(acc, e) {\n\t return Math.max(acc, xs[e.v] + blockG.edge(e));\n\t }, 0);\n\t }", "title": "" }, { "docid": "c95de2b4854b60e005193aec4cea1b4e", "score": "0.5117099", "text": "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "title": "" }, { "docid": "c95de2b4854b60e005193aec4cea1b4e", "score": "0.5117099", "text": "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "title": "" }, { "docid": "c95de2b4854b60e005193aec4cea1b4e", "score": "0.5117099", "text": "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "title": "" }, { "docid": "c95de2b4854b60e005193aec4cea1b4e", "score": "0.5117099", "text": "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "title": "" }, { "docid": "c95de2b4854b60e005193aec4cea1b4e", "score": "0.5117099", "text": "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "title": "" }, { "docid": "c95de2b4854b60e005193aec4cea1b4e", "score": "0.5117099", "text": "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "title": "" }, { "docid": "c95de2b4854b60e005193aec4cea1b4e", "score": "0.5117099", "text": "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "title": "" }, { "docid": "c95de2b4854b60e005193aec4cea1b4e", "score": "0.5117099", "text": "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "title": "" }, { "docid": "c95de2b4854b60e005193aec4cea1b4e", "score": "0.5117099", "text": "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "title": "" } ]
0e000d00035c0268b49321181f9bc7d3
Emphasizes blood brotherhood beneath two trees.
[ { "docid": "5f53fbdc2fbd72736533a26c0dcf9e1a", "score": "0.0", "text": "function siblise(a, b) {\n\tvar list = [a, b];\n\tlist.height = a.height + 1;\n\tlist.sizes = [length(a), length(a) + length(b)];\n\treturn list;\n}", "title": "" } ]
[ { "docid": "b277a881ca2127ce6b430750c061ff5e", "score": "0.6090561", "text": "function drawSmallTreeBranchTwo() {\n turnRight(90);\n moveForward(10);\n turnAround();\n moveForward(10);\n turnRight(90);\n}", "title": "" }, { "docid": "d12c959178ec2bcd6ba220a6a22bc156", "score": "0.5529139", "text": "function drawSmallTreeBranchOne() {\n turnLeft(90);\n moveForward(10);\n turnAround();\n moveForward(10);\n turnLeft(90);\n}", "title": "" }, { "docid": "821276d2ccee8dcb51764091a227422d", "score": "0.53554064", "text": "function bougebosss() {\n for (var boss = 0; boss < bosss.length; boss++) {\n bosss[boss].top = bosss[boss].top + 0.2;\n }\n}", "title": "" }, { "docid": "6a1fc278806758b42ea722f4a531aa58", "score": "0.528751", "text": "function main(){\n function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right)\n}\n\n let BT = new BinarySearchTree\n BT.insert(3)\n BT.insert(2)\n BT.insert(1)\n BT.insert(5)\n BT.insert(0)\n BT.insert(6)\n BT.insert(7)\n BT.insert(8)\n\n\n //console.log(tree(BT))\n\nlet leftCount = 0\nlet rightCount = 0\nlet count = 0\n function findHeight(T){\n \n if (!T){\n if (leftCount > rightCount){\n return leftCount \n } else {\n return rightCount\n }\n }\n \n if(T.right !== null && T.left !== null){\n findHeight(T.right) \n rightCount ++\n findHeight(T.left)\n leftCount ++ \n } else if (T.left !== null) {\n findHeight(T.left)\n leftCount ++ \n } else if (T.right !== null) {\n findHeight(T.right)\n rightCount ++\n }\n \n if (leftCount > rightCount){\n return leftCount \n } else {\n return rightCount\n }\n \n }\n //console.log(findHeight(BT))\n //console.log(BT)\n\n// 6. BST checker \nlet badBST = [5,1,4,null,null,3,6] // assume 1st root = 5,1L,4R,nullL,nullR,3L,6R\nlet goodBST = [2,1,3]\n\nfunction isBST(nodes){\n\nfor (let i=1;i<nodes.length;i++){\n if (i % 2 === 0){ // meaning 1%2 no so 5 < 1 \n\n if (nodes[0] > nodes[i]){\n return false\n } \n } else {\n\n if(nodes[0] < nodes[i]){ // if 5 is less than 1,4,null,null,3,6 - one \n return false\n }\n } \n}\nreturn true\n\n}\n//console.log(isBST(goodBST))\n\n//7. 3rd Largest Node \nlet results = []\nfunction whatIs3rdLargest(T){\n\n results.push(T.key)\n\n if (T === null){\n return \n }\n if (T.right !== null && T.left !== null){ // ROOT START \n whatIs3rdLargest(T.right)\n whatIs3rdLargest(T.left)\n }\n else if (T.left !== null) { // LEFT SIDE \n\n return whatIs3rdLargest(T.left)\n\n } else if (T.right !== null){ // RIGHT SIDE\n\n return whatIs3rdLargest(T.right)\n\n }\n return results.sort().reverse()[2]\n}\n\n//console.log(whatIs3rdLargest(BT))\n\n// 8. Balanced BST \nlet leftH = 0\nlet rightH = 0\nfunction isBalanced(T){\n\nif (T === null){\n return \n}\nif (T.right !== null && T.left !== null){\n leftH++ \n rightH++\n isBalanced(T.right)\n isBalanced(T.left)\n} else if (T.left !== null){\n leftH++\n isBalanced(T.left)\n} else if (T.right !== null){\n rightH++\n isBalanced(T.right)\n}\nif (Math.abs(leftH - rightH) === 1 || Math.abs(leftH - rightH) === 0){\n return true\n} else {\nreturn false\n}\n}\n//console.log(isBalanced(BT))\n\n\n//9. Same BSTs --- R L R \n\nlet left = []\nlet leftR = []\nlet left2 = []\nlet right =[]\nlet right2=[]\n\nfunction isSame(T1,T2){\n let index = 0\n let indexR = 0\nif(T1.length !== T2.length){ // SAME SIZE? \n return false\n}\nfor (let i=1; i<T1.length;i++){ \n if(T1[0] < T1[i]){\n right.push(T1[i]) \n if (right.length > 3){\n indexR ++ \n }\n } else {\n left.push(T1[i])\n if (left.length > 3){\n index ++ \n }\n }\n if(T2[0] > T2[i]){\n left2.push(T2[i])\n } else {\n right2.push(T2[i])\n }\n}\nconsole.log(indexR)\nconsole.log(left,left2,right,right2)\nif(left[0] !== left2[0] || right[0] !== right2[0]){ // IF FIRST CHILD NOT SAME \n return false\n} else if (left.length !== left2.length || right.length !== right2.length){ // IF BRANCHES DIFFER IN LENGTH\nreturn false\n} \nif (index > 0 ){\n\n console.log('left',index)\n // IF LEFT SIDE HAS MORE THAN 3 - 2nd NODE MUST BE SAME\n for (let l=0;l<index;l++){\n console.log(l)\n if (left[l] !== left2[l]){\n \n return false\n }\n }\n} else if (indexR > 0) {\n // IF RIGHT SIDE HAS MORE THAN 3 - 2ND,3RD,4TH etc NODE MUST BE SAME\n\n for (let r=0;r<indexR;r++){\n\n\n if (right[r] !== right2[r]){\n return false\n }\n }\n}\n\nreturn true\n \n }\n let BTree1r = [3,5,4,6,1,0,2,7]\n let BTree2r = [3,1,5,2,4,6,0,7]\n // TRUE \n let B = [1,2,3,4,5,6]\n let B2 = [1,2,4,3,5,6]\n // FALSE\n let b10 = [10,5,2,4,6,1,0,11]\n let b102 = [10,5,2,4,1,6,0,11]\n // TRUE\n let treeArray = [1,0,2,3,4]\n let tree2Array = [1,0,2,4,3]\n // FALSE \n console.log(isSame(BTree1r,BTree2r))\n\n\n\n\n\n\n}", "title": "" }, { "docid": "cfa6af49b2d1e440332f038b5f72b19f", "score": "0.5247956", "text": "function pass() {\n var a, i, j, l, n, n1, n2, q, e, w, g;\n\n var barnesHutNodes = [],\n rootRegion,\n outboundAttCompensation,\n coefficient,\n xDist,\n yDist,\n ewc,\n distance,\n factor;\n\n\n // 1) Initializing layout data\n //-----------------------------\n\n // Resetting positions & computing max values\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n W.nodeMatrix[np(n, 'old_dx')] = W.nodeMatrix[np(n, 'dx')];\n W.nodeMatrix[np(n, 'old_dy')] = W.nodeMatrix[np(n, 'dy')];\n W.nodeMatrix[np(n, 'dx')] = 0;\n W.nodeMatrix[np(n, 'dy')] = 0;\n }\n\n // If outbound attraction distribution, compensate\n if (W.settings.outboundAttractionDistribution) {\n outboundAttCompensation = 0;\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n outboundAttCompensation += W.nodeMatrix[np(n, 'mass')];\n }\n\n outboundAttCompensation /= W.nodesLength;\n }\n\n\n // 1.bis) Barnes-Hut computation\n //------------------------------\n if (W.settings.barnesHutOptimize) {\n\n // Necessary variables\n // UInt16 should be enough, if not, switch to UInt32\n var quadNb = Math.pow(2, 2 * W.settings.barnesHutDepthLimit),\n quadRowNb = Math.pow(2, W.settings.barnesHutDepthLimit),\n quads = new UInt16Array(quadNb),\n quadsProperties = new Float32Array(quadNb * W.ppq),\n quadsSteps = new UInt16Array(quadNb),\n quadsAcc = new UInt16Array(quadNb),\n nodesQuads = new UInt16Array(W.nodesLength),\n quadsNodes = new UInt16Array(W.nodesLength),\n maxX = 0,\n maxY = 0,\n minX = 0,\n minY = 0,\n xIndex,\n yIndex;\n\n // Retrieving max values\n // OPTIMIZE: this could be computed on the n loop preceding this one\n // but at the cost of doing it even when Barnes-Hut is disabled\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n maxX = Math.max(maxX, W.nodeMatrix[np(n, 'x')]);\n minX = Math.min(minX, W.nodeMatrix[np(n, 'x')]);\n maxY = Math.max(maxY, W.nodeMatrix[np(n, 'y')]);\n minY = Math.min(minY, W.nodeMatrix[np(n, 'y')]);\n }\n\n // Adding epsilon to max values\n maxX += 0.0001 * (maxX - minX);\n maxY += 0.0001 * (maxY - minY);\n\n // Assigning nodes to quads\n for (n = 0, i = 0; n < W.nodesLength; n += W.ppn, i++) {\n xIndex = ((W.nodeMatrix[np(n, 'x')] - minX) / (maxX - minX) *\n Math.pow(2, W.settings.barnesHutDepthLimit)) | 0;\n\n yIndex = ((W.nodeMatrix[np(n, 'y')] - minY) / (maxY - minY) *\n Math.pow(2, W.settings.barnesHutDepthLimit)) | 0;\n\n // OPTIMIZE: possible to gain some really little time here\n quads[xIndex * quadRowNb + yIndex] += 1;\n nodesQuads[i] = xIndex * quadRowNb + yIndex;\n }\n\n // Computing quad steps\n // ALEXIS: here we need to build the second array containing nodes ids\n // in order for the quads iteration in force applications later.\n for (a = 0, i = 0; i < quadNb; i++) {\n a += quads[i];\n quadsSteps[i] = a;\n }\n }\n\n\n // 2) Repulsion\n //--------------\n // NOTES: adjustSize = antiCollision & scalingRatio = coefficient\n\n if (W.settings.barnesHutOptimize) {\n\n // Applying forces through Barnes-Hut\n // TODO\n }\n else {\n\n // Square iteration\n // TODO: don't apply forces when n1 === n2\n for (n1 = 0; n1 < W.nodesLength; n1 += W.ppn) {\n for (n2 = 0; n2 < W.nodesLength; n2 += W.ppn) {\n\n // Common to both methods\n xDist = W.nodeMatrix[np(n1, 'x')] - W.nodeMatrix[np(n2, 'x')];\n yDist = W.nodeMatrix[np(n1, 'y')] - W.nodeMatrix[np(n2, 'y')];\n\n if (W.settings.adjustSize) {\n\n //-- Anticollision Linear Repulsion\n distance = Math.sqrt(xDist * xDist + yDist * yDist) -\n W.nodeMatrix[np(n1, 'size')] -\n W.nodeMatrix[np(n2, 'size')];\n\n if (distance > 0) {\n factor = W.settings.scalingRatio *\n W.nodeMatrix[np(n1, 'mass')] *\n W.nodeMatrix[np(n2, 'mass')] /\n distance / distance;\n\n // Updating nodes' dx and dy\n W.nodeMatrix[np(n1, 'dx')] += xDist * factor;\n W.nodeMatrix[np(n1, 'dy')] += yDist * factor;\n\n W.nodeMatrix[np(n2, 'dx')] += xDist * factor;\n W.nodeMatrix[np(n2, 'dy')] += yDist * factor;\n }\n else if (distance < 0) {\n factor = 100 * W.settings.scalingRatio *\n W.nodeMatrix[np(n1, 'mass')] *\n W.nodeMatrix[np(n2, 'mass')];\n\n // Updating nodes' dx and dy\n W.nodeMatrix[np(n1, 'dx')] += xDist * factor;\n W.nodeMatrix[np(n1, 'dy')] += yDist * factor;\n\n W.nodeMatrix[np(n2, 'dx')] -= xDist * factor;\n W.nodeMatrix[np(n2, 'dy')] -= yDist * factor;\n }\n }\n else {\n\n //-- Linear Repulsion\n distance = Math.sqrt(xDist * xDist + yDist * yDist);\n\n if (distance > 0) {\n factor = W.settings.scalingRatio *\n W.nodeMatrix[np(n1, 'mass')] *\n W.nodeMatrix[np(n2, 'mass')] /\n distance / distance;\n\n // Updating nodes' dx and dy\n W.nodeMatrix[np(n1, 'dx')] += xDist * factor;\n W.nodeMatrix[np(n1, 'dy')] += yDist * factor;\n\n W.nodeMatrix[np(n2, 'dx')] -= xDist * factor;\n W.nodeMatrix[np(n2, 'dy')] -= yDist * factor;\n }\n }\n }\n }\n }\n\n\n // 3) Gravity\n //------------\n g = W.settings.gravity / W.settings.scalingRatio;\n coefficient = W.settings.scalingRatio;\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n factor = 0;\n\n // Common to both methods\n xDist = W.nodeMatrix[np(n, 'x')];\n yDist = W.nodeMatrix[np(n, 'y')];\n distance = Math.sqrt(\n Math.pow(xDist, 2) + Math.pow(yDist, 2)\n );\n\n if (W.settings.strongGravityMode) {\n\n //-- Strong gravity\n if (distance > 0)\n factor = coefficient * W.nodeMatrix[np(n, 'mass')] * g;\n }\n else {\n\n //-- Linear Anti-collision Repulsion n\n if (distance > 0)\n factor = coefficient * W.nodeMatrix[np(n, 'mass')] * g / distance;\n }\n\n // Updating node's dx and dy\n W.nodeMatrix[np(n, 'dx')] -= xDist * factor;\n W.nodeMatrix[np(n, 'dy')] -= yDist * factor;\n }\n\n\n\n // 4) Attraction\n //---------------\n coefficient = 1 *\n (W.settings.outboundAttractionDistribution ?\n outboundAttCompensation :\n 1);\n\n // TODO: simplify distance\n // TODO: coefficient is always used as -c --> optimize?\n for (e = 0; e < W.edgesLength; e += W.ppe) {\n n1 = W.edgeMatrix[ep(e, 'source')];\n n2 = W.edgeMatrix[ep(e, 'target')];\n w = W.edgeMatrix[ep(e, 'weight')];\n\n // Edge weight influence\n if (W.settings.edgeWeightInfluence === 0)\n ewc = 1\n else if (W.settings.edgeWeightInfluence === 1)\n ewc = w;\n else\n ewc = Math.pow(w, W.settings.edgeWeightInfluence);\n\n // Common measures\n xDist = W.nodeMatrix[np(n1, 'x')] - W.nodeMatrix[np(n2, 'x')];\n yDist = W.nodeMatrix[np(n1, 'y')] - W.nodeMatrix[np(n2, 'y')];\n\n // Applying attraction to nodes\n if (W.settings.adjustSizes) {\n\n distance = Math.sqrt(\n (Math.pow(xDist, 2) + Math.pow(yDist, 2)) -\n W.nodeMatrix[np(n1, 'size')] -\n W.nodeMatrix[np(n2, 'size')]\n );\n\n if (W.settings.linLogMode) {\n if (W.settings.outboundAttractionDistribution) {\n\n //-- LinLog Degree Distributed Anti-collision Attraction\n if (distance > 0) {\n factor = -coefficient * ewc * Math.log(1 + distance) /\n distance /\n W.nodeMatrix[np(n1, 'mass')];\n }\n }\n else {\n\n //-- LinLog Anti-collision Attraction\n if (distance > 0) {\n factor = -coefficient * ewc * Math.log(1 + distance) / distance;\n }\n }\n }\n else {\n if (W.settings.outboundAttractionDistribution) {\n\n //-- Linear Degree Distributed Anti-collision Attraction\n if (distance > 0) {\n factor = -coefficient * ewc / W.nodeMatrix[np(n1, 'mass')];\n }\n }\n else {\n\n //-- Linear Anti-collision Attraction\n if (distance > 0) {\n factor = -coefficient * ewc;\n }\n }\n }\n }\n else {\n\n distance = Math.sqrt(\n Math.pow(xDist, 2) + Math.pow(yDist, 2)\n );\n\n if (W.settings.linLogMode) {\n if (W.settings.outboundAttractionDistribution) {\n\n //-- LinLog Degree Distributed Attraction\n if (distance > 0) {\n factor = -coefficient * ewc * Math.log(1 + distance) /\n distance /\n W.nodeMatrix[np(n1, 'mass')];\n }\n }\n else {\n\n //-- LinLog Attraction\n if (distance > 0)\n factor = -coefficient * ewc * Math.log(1 + distance) / distance;\n }\n }\n else {\n if (W.settings.outboundAttractionDistribution) {\n\n //-- Linear Attraction Mass Distributed\n // NOTE: Distance is set to 1 to override next condition\n distance = 1;\n factor = -coefficient * ewc / W.nodeMatrix[np(n1, 'mass')];\n }\n else {\n\n //-- Linear Attraction\n // NOTE: Distance is set to 1 to override next condition\n distance = 1;\n factor = -coefficient * ewc;\n }\n }\n }\n\n // Updating nodes' dx and dy\n // TODO: if condition or factor = 1?\n if (distance > 0) {\n\n // Updating nodes' dx and dy\n W.nodeMatrix[np(n1, 'dx')] += xDist * factor;\n W.nodeMatrix[np(n1, 'dy')] += yDist * factor;\n\n W.nodeMatrix[np(n2, 'dx')] -= xDist * factor;\n W.nodeMatrix[np(n2, 'dy')] -= yDist * factor;\n }\n }\n\n\n // 5) Apply Forces\n //-----------------\n var force,\n swinging,\n traction,\n nodespeed;\n\n // MATH: sqrt and square distances\n if (W.settings.adjustSizes) {\n\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n if (!W.nodeMatrix[np(n, 'fixed')]) {\n force = Math.sqrt(\n Math.pow(W.nodeMatrix[np(n, 'dx')], 2) +\n Math.pow(W.nodeMatrix[np(n, 'dy')], 2)\n );\n\n if (force > W.maxForce) {\n W.nodeMatrix[np(n, 'dx')] =\n W.nodeMatrix[np(n, 'dx')] * W.maxForce / force;\n W.nodeMatrix[np(n, 'dy')] =\n W.nodeMatrix[np(n, 'dy')] * W.maxForce / force;\n }\n\n swinging = W.nodeMatrix[np(n, 'mass')] *\n Math.sqrt(\n (W.nodeMatrix[np(n, 'old_dx')] - W.nodeMatrix[np(n, 'dx')]) *\n (W.nodeMatrix[np(n, 'old_dx')] - W.nodeMatrix[np(n, 'dx')]) +\n (W.nodeMatrix[np(n, 'old_dy')] - W.nodeMatrix[np(n, 'dy')]) *\n (W.nodeMatrix[np(n, 'old_dy')] - W.nodeMatrix[np(n, 'dy')])\n );\n\n traction = Math.sqrt(\n (W.nodeMatrix[np(n, 'old_dx')] + W.nodeMatrix[np(n, 'dx')]) *\n (W.nodeMatrix[np(n, 'old_dx')] + W.nodeMatrix[np(n, 'dx')]) +\n (W.nodeMatrix[np(n, 'old_dy')] + W.nodeMatrix[np(n, 'dy')]) *\n (W.nodeMatrix[np(n, 'old_dy')] + W.nodeMatrix[np(n, 'dy')])\n ) / 2;\n\n nodespeed =\n 0.1 * Math.log(1 + traction) / (1 + Math.sqrt(swinging));\n\n // Updating node's positon\n W.nodeMatrix[np(n, 'x')] =\n W.nodeMatrix[np(n, 'x')] + W.nodeMatrix[np(n, 'dx')] *\n (nodespeed / W.settings.slowDown);\n W.nodeMatrix[np(n, 'y')] =\n W.nodeMatrix[np(n, 'y')] + W.nodeMatrix[np(n, 'dy')] *\n (nodespeed / W.settings.slowDown);\n }\n }\n }\n else {\n\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n if (!W.nodeMatrix[np(n, 'fixed')]) {\n\n swinging = W.nodeMatrix[np(n, 'mass')] *\n Math.sqrt(\n (W.nodeMatrix[np(n, 'old_dx')] - W.nodeMatrix[np(n, 'dx')]) *\n (W.nodeMatrix[np(n, 'old_dx')] - W.nodeMatrix[np(n, 'dx')]) +\n (W.nodeMatrix[np(n, 'old_dy')] - W.nodeMatrix[np(n, 'dy')]) *\n (W.nodeMatrix[np(n, 'old_dy')] - W.nodeMatrix[np(n, 'dy')])\n );\n\n traction = Math.sqrt(\n (W.nodeMatrix[np(n, 'old_dx')] + W.nodeMatrix[np(n, 'dx')]) *\n (W.nodeMatrix[np(n, 'old_dx')] + W.nodeMatrix[np(n, 'dx')]) +\n (W.nodeMatrix[np(n, 'old_dy')] + W.nodeMatrix[np(n, 'dy')]) *\n (W.nodeMatrix[np(n, 'old_dy')] + W.nodeMatrix[np(n, 'dy')])\n ) / 2;\n\n nodespeed = W.nodeMatrix[np(n, 'convergence')] *\n Math.log(1 + traction) / (1 + Math.sqrt(swinging));\n\n // Updating node convergence\n W.nodeMatrix[np(n, 'convergence')] =\n Math.min(1, Math.sqrt(\n nodespeed *\n (Math.pow(W.nodeMatrix[np(n, 'dx')], 2) +\n Math.pow(W.nodeMatrix[np(n, 'dy')], 2)) /\n (1 + Math.sqrt(swinging))\n ));\n\n // Updating node's positon\n W.nodeMatrix[np(n, 'x')] =\n W.nodeMatrix[np(n, 'x')] + W.nodeMatrix[np(n, 'dx')] *\n (nodespeed / W.settings.slowDown);\n W.nodeMatrix[np(n, 'y')] =\n W.nodeMatrix[np(n, 'y')] + W.nodeMatrix[np(n, 'dy')] *\n (nodespeed / W.settings.slowDown);\n }\n }\n }\n\n // Counting one more iteration\n W.iterations++;\n }", "title": "" }, { "docid": "cd138d24d50472863ddff33ab3dce920", "score": "0.523967", "text": "prepare() {\n const birdList = []\n //Normalize fitness values to 0-1\n let min = null\n let max = null\n this.birds.forEach(bird => {\n birdList.push(bird)\n if (bird.fitness > max || max === null) max = bird.fitness\n if (bird.fitness < min || min === null) min = bird.fitness\n });\n //Use normal js array to store birds so we can use normal js operations\n birdList.forEach(bird => {\n bird.fitness = (bird.fitness - min) / (max - min)\n })\n birdList.sort((a, b) => {\n return a.fitness - b.fitness\n })\n this.birds = birdList\n\n //Pass on 3 best directly\n let bestThree = []\n for (let i = this.birds.length - 1; i > this.birds.length - 4; i--) {\n bestThree.push(this.birds[i])\n }\n\n //Generate offsprings for the rest\n this.parentPool = this.pool(this.birds)\n for (let i = 0; i < 3; i++) {\n this.parentPool[i] = bestThree.pop()\n }\n\n console.log(this.parentPool)\n }", "title": "" }, { "docid": "926379623cada807073abdbc58543164", "score": "0.5237186", "text": "function drawTopLeaves(){\n ctx.lineWidth = 2;\n if (treeId==1)\n {\n l1x=center_x;\n l1y=tree_h;\n\n nodes.push(new node(l1x+1,l1y+4,8,4,2,\"left\"));\n leaves.push(new leaf(n2x,n2y,24,8,50,\"small\",\"left\"));\n\n nodes.push(new node(l1x,l1y+4,10,4,2,\"right\"));\n leaves.push(new leaf(n2x,n2y,30,8,-40,\"small\",\"right\"));\n }\n\n else if (treeId<6)\n {l1x=center_x;\n l1y=tree_h;\n\n nodes.push(new node(l1x+1,l1y+4,8,4,2,\"left\"));\n leaves.push(new leaf(n2x,n2y,26,8,30,\"small\",\"left\"));\n\n nodes.push(new node(l1x+1,l1y+4,12,1,2,\"right\"));\n leaves.push(new leaf(n2x,n2y,24,6,-90,\"small\",\"right\"));\n\n nodes.push(new node(l1x,l1y+4,10,6,2,\"right\"));\n leaves.push(new leaf(n2x,n2y,34,10,-25,\"small\",\"right\"));\n\n n1x=center_x+1;\n n1y=b_h[2];\n\n nodes.push(new node(n1x,n1y,8,8,2,\"right\"));\n leaves.push(new leaf(n2x,n2y,38,12,-40,\"curved\",\"right\"));\n\n n1x=center_x+1;\n n1y=b_h[3];\n\n nodes.push(new node(n1x,n1y,8,8,2,\"left\"));\n leaves.push(new leaf(n2x,n2y,32,10,30,\"curved\",\"left\"));\n\n }\n\n\n else if (treeId==6)\n {l1x=center_x-64;l1y=tree_h-98;\n\n nodes.push(new node(l1x,l1y,0,0,2,\"lefttop\"));\n leaves.push(new leaf(n2x,n2y,34,10,-150,\"regular\",\"right\"));\n\n nodes.push(new node(l1x+24,l1y+14,20,10,2,\"lefttop_c\"));\n leaves.push(new leaf(n2x,n2y,24,8,80,\"regular\",\"left\"));\n\n leaves.push(new leaf(n2x+20,n2y+27,34,10,100,\"regular\",\"left\"));\n\n nodes.push(new node(l1x+48,l1y+38,6,40,2,\"leftdown_u\"));\n leaves.push(new leaf(n2x,n2y,30,8,-160,\"regular\",\"right\"));\n\n\n nodes.push(new node(l1x+58,l1y+60,60,12,3,\"righttop_c\"));\n leaves.push(new leaf(n2x,n2y,30,8,-80,\"regular\",\"right\"));\n\n nodes.push(new node(l1x+59,l1y+40,22,20,2,\"right\"));\n leaves.push(new leaf(n2x,n2y,30,10,-30,\"regular\",\"right\"));\n }\n }", "title": "" }, { "docid": "33545c15cd6a80fc3340ae83bba8ec33", "score": "0.5235412", "text": "union(a, b) {\n let parentA = this.findRep(a)\n let parentB = this.findRep(b)\n \n if (parentA === parentB) return\n \n // union by size, point the representative of the smaller group to the larger\n if (this.size[parentA] >= this.size[parentB]) {\n this.size[parentA] += this.size[parentB]\n this.parent[parentB] = parentA\n } else {\n this.size[parentB] += this.size[parentA]\n this.parent[parentA] = parentB\n }\n }", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "1275095053a9545a887dbfae649bb728", "score": "0.5235156", "text": "function append_(a, b)\n{\n\tif (a.height === 0 && b.height === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tif (a.height !== 1 || b.height !== 1)\n\t{\n\t\tif (a.height === b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\n\t\t\tinsertRight(a, appended[1]);\n\t\t\tinsertLeft(b, appended[0]);\n\t\t}\n\t\telse if (a.height > b.height)\n\t\t{\n\t\t\ta = nodeCopy(a);\n\t\t\tvar appended = append_(botRight(a), b);\n\n\t\t\tinsertRight(a, appended[0]);\n\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb = nodeCopy(b);\n\t\t\tvar appended = append_(a, botLeft(b));\n\n\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\tinsertLeft(b, appended[left]);\n\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t}\n\t}\n\n\t// Check if balancing is needed and return based on that.\n\tif (a.table.length === 0 || b.table.length === 0)\n\t{\n\t\treturn [a, b];\n\t}\n\n\tvar toRemove = calcToRemove(a, b);\n\tif (toRemove <= E)\n\t{\n\t\treturn [a, b];\n\t}\n\treturn shuffle(a, b, toRemove);\n}", "title": "" }, { "docid": "53b720711049a6fb40468de7bc0e71b3", "score": "0.5211393", "text": "function draw_branch(context, x1, y1, angle, depth)\n{\n\tvar max_length = +(document.getElementById(\"tree_seg_length\").value);\n\tvar BRANCH_LENGTH = random(0, max_length);\n\n\tif (depth != 0)\n\t{\n\t\tvar x2 = x1 + (cos(angle) * depth * BRANCH_LENGTH);\n\t\tvar y2 = y1 + (sin(angle) * depth * BRANCH_LENGTH);\n\t\tdrawLine(context, x1, y1, x2, y2, depth);\n\t\tdraw_branch(context, x2, y2, angle - random(15, 20), depth - 1);\n\t\tdraw_branch(context, x2, y2, angle + random(15, 20), depth - 1);\n\n\t\tif (depth < 6 && depth > 1)\n\t\t{\n\t\t\tif (draw_apples && random(1, 30) == 1)\n\t\t\t{\n\t\t\t\tdraw_circle(context, x1, y1, 6, apple_color);\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (draw_flowers)\n\t\t{\n\t\t\tdraw_circle(context, x1, y1, 3, flower_color);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "acec365a58bf7ad0b68e72c12bcc0390", "score": "0.51973546", "text": "mateGenomes(genomeA, genomeB, fitnessA, fitnessB) {\n\t\tvar newGenome = new Genome();\n\t\tgenomeA.nodeGenes.forEach(function(node) {\n\t\t\tnewGenome.addNodeGene(node);\n\t\t});\n\t\tgenomeB.nodeGenes.forEach(function(node) {\n\t\t\tnewGenome.addNodeGene(node);\n\t\t});\n\n\t\tif (fitnessA == fitnessB) {\n\t\t\t// Add all disjoint and excess genes.\n\t\t\tvar connGenes = {};\n\t\t\tgenomeA.connectionGenes.forEach(function(connection) {\n\t\t\t\tif (genomeB.innovNums[connection.innovNum] != undefined) {\n\t\t\t\t\tconnGenes[connection.innovNum] = connection;\n\t\t\t\t} else if (Math.random() > geneConstants.mate.crossover) {\n\t\t\t\t\tconnGenes[connection.innovNum] = connection;\n\t\t\t\t}\n\t\t\t});\n\t\t\tgenomeB.connectionGenes.forEach(function(connection) {\n\t\t\t\tif (connGenes[connection.innovNum] != undefined) {\n\t\t\t\t\tif (Math.random() > geneConstants.mate.crossover) {\n\t\t\t\t\t\tconnGenes[connection.innovNum] = connection;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (Math.random() > geneConstants.mate.crossover) {\n\t\t\t\t\tconnGenes[connection.innovNum] = connection;\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.keys(connGenes).forEach(function(innovNum) {\n\t\t\t\tnewGenome.addConnectionGene(connGenes[innovNum]);\n\t\t\t});\n\t\t} else {\n\t\t\t// Add disjoint and excess genes from fitter genome only.\n\t\t\tvar strongGenome = fitnessA > fitnessB ? genomeA : genomeB;\n\t\t\tvar weakGenome = fitnessA < fitnessB ? genomeA : genomeB;\n\t\t\tvar connGenes = {};\n\t\t\tweakGenome.connectionGenes.forEach(function(connection) {\n\t\t\t\tconnGenes[connection.innovNum] = connection;\n\t\t\t});\n\t\t\tstrongGenome.connectionGenes.forEach(function(connection) {\n\t\t\t\tif (connGenes[connection.innovNum] != undefined) {\n\t\t\t\t\tnewGenome.addConnectionGene(Math.random() > 0.5 ? connGenes[connection.innovNum] : connection);\n\t\t\t\t} else {\n\t\t\t\t\tnewGenome.addConnectionGene(connection);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn newGenome;\n\t}", "title": "" }, { "docid": "094120bf3f949fd558375a14d6b1bd3b", "score": "0.5177417", "text": "function append_(a, b)\n\t{\n\t\tif (a.height === 0 && b.height === 0)\n\t\t{\n\t\t\treturn [a, b];\n\t\t}\n\t\n\t\tif (a.height !== 1 || b.height !== 1)\n\t\t{\n\t\t\tif (a.height === b.height)\n\t\t\t{\n\t\t\t\ta = nodeCopy(a);\n\t\t\t\tb = nodeCopy(b);\n\t\t\t\tvar appended = append_(botRight(a), botLeft(b));\n\t\n\t\t\t\tinsertRight(a, appended[1]);\n\t\t\t\tinsertLeft(b, appended[0]);\n\t\t\t}\n\t\t\telse if (a.height > b.height)\n\t\t\t{\n\t\t\t\ta = nodeCopy(a);\n\t\t\t\tvar appended = append_(botRight(a), b);\n\t\n\t\t\t\tinsertRight(a, appended[0]);\n\t\t\t\tb = parentise(appended[1], appended[1].height + 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = nodeCopy(b);\n\t\t\t\tvar appended = append_(a, botLeft(b));\n\t\n\t\t\t\tvar left = appended[0].table.length === 0 ? 0 : 1;\n\t\t\t\tvar right = left === 0 ? 1 : 0;\n\t\t\t\tinsertLeft(b, appended[left]);\n\t\t\t\ta = parentise(appended[right], appended[right].height + 1);\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if balancing is needed and return based on that.\n\t\tif (a.table.length === 0 || b.table.length === 0)\n\t\t{\n\t\t\treturn [a, b];\n\t\t}\n\t\n\t\tvar toRemove = calcToRemove(a, b);\n\t\tif (toRemove <= E)\n\t\t{\n\t\t\treturn [a, b];\n\t\t}\n\t\treturn shuffle(a, b, toRemove);\n\t}", "title": "" }, { "docid": "f2f04887a4c9fe2d8354430f5eda6477", "score": "0.5175593", "text": "function grow_net_v1(net, tree_size)\n\t{\n\n\t\twhile(net.length<tree_size-1){\n\t\t\t// if(true){\n\t\t\t\tlet n = random_int(0, net.length);\n\t\t\t\tlet node = net[n];\n\t\t\t\t\n\t\t\t\tlet neighbours = check_for_neighbours(net,node);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(neighbours.length<4)\n\t\t\t\t{\n\t\t\t\t\t// * chose from free spots\n\t\t\t\t\tlet chose_from = 'udlr'.split('');\n\t\t\t\t\tneighbours.forEach((nbr)=>{\n\t\t\t\t\t\tlet i = chose_from.indexOf(nbr.dir);\n\t\t\t\t\t\tif(i!=-1){\n\t\t\t\t\t\t\tchose_from.splice(i,1);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tlet sprout_dir = chose_from[ random_int(0,chose_from.length) ];\n\t\n\t\t\t\t\t// * a few special cases\n\t\t\t\t\tif(sprout_dir=='u' || sprout_dir=='d'){\n\t\t\t\t\t\tadd_node(net, node, sprout_dir );\n\t\t\t\t\t\t// * only grow pair vertical if not in center\n\t\t\t\t\t\tif(node.index[0]!=0){\n\t\t\t\t\t\t\tlet pair = get_index_pair(net, node.index);\n\t\t\t\t\t\t\tadd_node(net, pair, sprout_dir );\n\t\t\t\t\t\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\t// * sprout L and R\n\t\t\t\t\t\tif(node.index[0]==0){\n\t\t\t\t\t\t\t// * center, grow L and R on same node\n\t\t\t\t\t\t\tadd_node(net, node, 'l' );\n\t\t\t\t\t\t\tadd_node(net, node, 'r' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t// * grow in opposite directions\n\t\n\t\t\t\t\t\t\t// * catch case when both grow inward\n\t\t\t\t\t\t\tif( (node.index[0]==1 && sprout_dir=='l') || (node.index[0]==-1 && sprout_dir=='r') ) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlet mid = add_node(net, node, sprout_dir );\n\t\t\t\t\t\t\t\tlet pair = get_index_pair(net, node.index);\n\t\t\t\t\t\t\t\tlet opp = opposite_dir(sprout_dir);\n\t\t\t\t\t\t\t\t// then connect to other side\n\t\t\t\t\t\t\t\tmid.connections.push(sprout_dir);\n\t\t\t\t\t\t\t\tpair.connections.push(opp);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// grow both outward\n\t\t\t\t\t\t\t\tadd_node(net, node, sprout_dir );\n\t\t\t\t\t\t\t\tlet pair = get_index_pair(net, node.index);\n\t\t\t\t\t\t\t\tlet opp = opposite_dir(sprout_dir);\n\t\t\t\t\t\t\t\tadd_node(net, pair, opp );\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Eo if <4 neighbours\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Eo loop\n\t\t\t}\n\t}", "title": "" }, { "docid": "5e567d5b72e7db95f246e83ecede3246", "score": "0.51652384", "text": "function growTree(height) {\n\tvar treeWidth = height.treeCharacter;\n\tvar treeHeight = height.numHeight;\n\tvar emptySpace = \" \";\n\tvar centered = Math.ceil(height.numHeight / 2);\n\tconsole.log(emptySpace.repeat(centered + parseInt(height.numHeight)/2 - 1),treeWidth);\n\t\n\t\n\tfor (var i = 0; i <= height.numHeight - 2; i++) {\n\t\ttreeWidth = treeWidth + height.treeCharacter + height.treeCharacter;// + height.numHeight;\n\t\tconsole.log(emptySpace.repeat((centered - i) + parseInt(height.numHeight) / 2 - 1) + treeWidth);\n\n\t\t}\n}", "title": "" }, { "docid": "cd32c896efab67d2f9bd5ef9f2d38138", "score": "0.51598984", "text": "function drawTreeBranch() {\n penColor(rgb(117,65,9));\n penDown();\n penWidth(4);\n turnRight(45);\n moveForward(40);\n turnAround();\n moveForward(7);\n drawSmallTreeBranchOne();\n moveForward(7);\n drawSmallTreeBranchTwo();\n moveForward(7);\n drawSmallTreeBranchOne();\n moveForward(20);\n turnRight(45);\n}", "title": "" }, { "docid": "7ac9518058d48858fb931c5e6f306926", "score": "0.5147119", "text": "function tightTree(t,g){function dfs(v){_.each(g.nodeEdges(v),function(e){var edgeV=e.v,w=v===edgeV?e.w:edgeV;if(!t.hasNode(w)&&!slack(g,e)){t.setNode(w,{});t.setEdge(v,w,{});dfs(w);}});}_.each(t.nodes(),dfs);return t.nodeCount();}", "title": "" }, { "docid": "b6154e66cc63a523cfa1072e4e58ed8d", "score": "0.512795", "text": "function tightTree(t,g){function dfs(v){_.forEach(g.nodeEdges(v),function(e){var edgeV=e.v,w=v===edgeV?e.w:edgeV;if(!t.hasNode(w)&&!slack(g,e)){t.setNode(w,{});t.setEdge(v,w,{});dfs(w)}})}_.forEach(t.nodes(),dfs);return t.nodeCount()}", "title": "" }, { "docid": "b6154e66cc63a523cfa1072e4e58ed8d", "score": "0.512795", "text": "function tightTree(t,g){function dfs(v){_.forEach(g.nodeEdges(v),function(e){var edgeV=e.v,w=v===edgeV?e.w:edgeV;if(!t.hasNode(w)&&!slack(g,e)){t.setNode(w,{});t.setEdge(v,w,{});dfs(w)}})}_.forEach(t.nodes(),dfs);return t.nodeCount()}", "title": "" }, { "docid": "0e9471ae8726d1ba3ede7752e31db9a0", "score": "0.5119558", "text": "nextMerge(){\n if (this.finished){\n if(!this.complete){\n if (this.last_drawn < this.branches.length-1){\n let i = this.last_drawn + 1;\n // Bottom branches are thicker\n let b = this.branches[i];\n let width;\n if (i < 80){\n width = mapRange(i, 0, 80, 0.8, 0.25);\n }\n else{\n width = mapRange(i, 0, this.branches.length, 0.5, 0)**2+0.02;\n }\n \n\n let meshes = b.show(width)\n if (meshes){\n for (let mesh of meshes[0]){\n this.geom.mergeMesh(mesh);\n }\n for (let outline_mesh of meshes[1]){\n this.outline_geom.mergeMesh(outline_mesh);\n }\n }\n this.last_drawn++;\n }\n else{\n if(planted){\n scene.add(treeMesh);\n scene.add(treeOutlineMesh);\n this.complete = true;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "8faef1b91e2e6cef3279b8f1730ad7b8", "score": "0.51140916", "text": "union(x, y) {\n let xRoot = this.findRoot(x);\n let yRoot = this.findRoot(y);\n if (xRoot === yRoot) return 0;\n if (this.rank[xRoot] > this.rank[yRoot]) {\n this.parent[xRoot] = yRoot;\n }\n else if(this.rank[xRoot] < this.rank[yRoot]) {\n this.parent[yRoot] = xRoot;\n }\n else {\n this.parent[xRoot] = yRoot;\n this.rank[yRoot]++;\n }\n return 1;\n }", "title": "" }, { "docid": "4581e11a8c1ce16d9c2be921b19d728f", "score": "0.51087236", "text": "branch() {\n const { classAttribute } = this;\n\n const bestFit = this.attributeList.reduce((prev, attribute) => {\n if (attribute === classAttribute) {\n return prev;\n }\n const children = this.createChildrenFromAttribute(attribute);\n const stats = this.findIgOfChildren(children);\n if (prev === undefined) {\n return { stats, children, attribute };\n } else {\n const prevIg = prev.stats.informationGain;\n return stats.informationGain > prevIg ? { stats, children, attribute } : prev;\n }\n }, undefined);\n\n const { entropy, conditionalEntropy, informationGain } = bestFit.stats;\n\n if (informationGain === 0 || informationGain === null) {\n this.children = []; // don't branch if there is no info to be gained\n } else {\n this.entropy = entropy;\n this.conditionalEntropy = conditionalEntropy;\n this.informationGain = informationGain;\n this.children = bestFit.children;\n this.branchesOn = bestFit.attribute;\n const logInfo = { informationGain, branchesOn: this.branchesOn };\n logger.trace(`DecisionTreeNode: branch - found ${JSON.stringify(logInfo)}`);\n }\n\n return this.children;\n }", "title": "" }, { "docid": "101b984aa410e8571d5aa450ef680ad3", "score": "0.51012385", "text": "function square_collaps(node){\n\t// recursion exit conditions\n\t// ensure this node has at least two levels of depth\n\tvar first = node.children[0];\n\tvar second = node.children[1];\n\tif (first === undefined && second === undefined){\n\t\treturn node;\n\t}\n\tif (first === undefined || second === undefined){\n\t\tthrow {status: \"error\", reason: \"Tree is not Binary\"};\n\t}\n\tvar first_first = first.children[0];\n\tvar first_second = first.children[1];\n\tvar second_first = second.children[0];\n\tvar second_second = second.children[1];\n\n\tif (first_first === undefined || first_second === undefined || \n\t\tsecond_first === undefined || second_second === undefined){\n\t\t\n\t\tvar first_collapsed = square_collaps(first);\n\t\tvar second_collapsed = square_collaps(second);\n\t\treturn {name: node.name, children:[first_collapsed, second_collapsed]};\n\t}\n\n\t// ensure child nodes are already collapsed\n\tvar first_collapsed = square_collaps(first);\n\tvar second_collapsed = square_collaps(second);\n\n\t//collaps current node\n\t//check formula operators \n\tif (node.name != \"*\"){\n\t\treturn {name:node.name, children:[first_collapsed,second_collapsed]};\n\t}\n\tif (first_collapsed.name==\"-\" && second_collapsed.name==\"+\"){\n\t\tvar minus = first_collapsed;\n\t\tvar plus = second_collapsed;\n\t} else if (first_collapsed.name==\"+\" && second_collapsed.name==\"-\"){\n\t\tvar minus = second_collapsed;\n\t\tvar plus = first_collapsed;\n\t} else {\n\t\treturn {name:node.name, children:[first_collapsed,second_collapsed]};\n\t}\n\tvar minus_first = minus.children[0];\n\tvar minus_second = minus.children[1];\n\tvar plus_first = plus.children[0];\n\tvar plus_second = plus.children[1];\n\n\t// check formula operands\n\tif ((node_is_equal(minus_first, plus_first) && node_is_equal(minus_second, plus_second))\n\t\t||(node_is_equal(minus_first, plus_second) && node_is_equal(minus_second, plus_first))){\n\t\t//collapsing itself\n\n\t\t//double existing pow\n\t\tif (minus_first.name==\"^\"){\n\t\t\tif (is_number(minus_first.children[1].name)){\n\t\t\t\tvar new_first = {\n\t\t\t\t\tname:\"^\", \n\t\t\t\t\tchildren: [\n\t\t\t\t\t\tminus_first.children[0],\n\t\t\t\t\t\t{name: (parseInt(minus_first.children[1].name)*2).toString(), children: []}\n\t\t\t\t\t\t]\n\t\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tvar new_first = {\n\t\t\t\t\tname:\"^\", \n\t\t\t\t\tchildren:[minus_first, {name:\"2\",children:[]} ]\n\t\t\t\t};\n\t\t\t}\n\t\t} else {\n\t\t\tvar new_first = {\n\t\t\t\tname:\"^\", \n\t\t\t\tchildren:[minus_first, {name:\"2\",children:[]} ]\n\t\t\t};\n\t\t}\n\t\tif (minus_second.name==\"^\"){\n\t\t\tif (is_number(minus_second.children[1].name)){\n\t\t\t\tvar new_second = {\n\t\t\t\t\tname:\"^\", \n\t\t\t\t\tchildren: [\n\t\t\t\t\t\tminus_second.children[0],\n\t\t\t\t\t\t{name: (parseInt(minus_second.children[1].name)*2).toString(), children: []}\n\t\t\t\t\t\t]\n\t\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tvar new_second = {\n\t\t\t\t\tname:\"^\", \n\t\t\t\t\tchildren:[minus_second, {name:\"2\",children:[]} ]\n\t\t\t\t};\n\t\t\t}\n\t\t} else {\n\t\t\tvar new_second = {\n\t\t\t\tname:\"^\", \n\t\t\t\tchildren:[minus_second, {name:\"2\",children:[]} ]\n\t\t\t};\n\t\t}\n\t\treturn {name:\"-\", children:[new_first, new_second]};\n\n\t} else {\n\t\treturn {name:node.name, children:[first_collapsed,second_collapsed]};\n\t}\n\n\t\n}", "title": "" }, { "docid": "1fd6102669cf708277d38a07cfb333ed", "score": "0.5080494", "text": "function growTrees(){\n\tfor (var counter = 0; counter < 30; counter++) {\n\t\tsetTimeout(function(){\n\t\tPearTree.grow(5);\n\t\tOakTree.grow(7);\n\t\tconsole.log(\"check\", counter, PearTree.height);\n\t\tif ((counter % 10) === 0){\n\t\t\tPearTree.trim(3);\n\t\t\tOakTree.trim(5);}\n\t\tvar Pear = `<div>The pear tree is now ${PearTree.height}cm tall and has ${PearTree.branches} branches</div>`;\n\t\tvar Oak = `<div>The oak Tree is now ${OakTree.height}cm tall and has ${OakTree.branches} branches</div>`;\n\t\tdomTree.appendChild(Pear);\n\t\tdomTree.appendChild(Oak);\n\n\t}, 1000);\n\t\t}\n}", "title": "" }, { "docid": "09f63b7a069256b5c45e4dd8af5396b9", "score": "0.50743705", "text": "wquUnion(p, q) {\r\n var root1 = this.find(p, this.state.wquParents);\r\n var root2 = this.find(q, this.state.wquParents);\r\n\r\n // return if same root\r\n if (root1 === root2) return;\r\n\r\n // make root1 the root of smaller tree\r\n if (this.state.size[root1] >= this.state.size[root2]) {\r\n const temp = root1;\r\n root1 = root2;\r\n root2 = temp;\r\n }\r\n\r\n // link root of smaller tree to root of larger tree\r\n var wquParentsCopy = this.state.wquParents.slice();\r\n wquParentsCopy[root1] = root2;\r\n var sizeCopy = this.state.size.slice();\r\n sizeCopy[root2] += sizeCopy[root1];\r\n\r\n this.setState({\r\n wquParents: wquParentsCopy,\r\n size: sizeCopy\r\n });\r\n }", "title": "" }, { "docid": "003da32c11932f5c105334ed74cc2bab", "score": "0.50679815", "text": "subdivide () {\n // Algoritmo\n // 1: Crear 4 hijos: qt_northeast , qt_northwest , qt_southeast ,\n\n // 2: Asignar los QuadTree creados a cada hijo\n// this.northeast = qt_northeast;\n// this.northwest = qt_northwest;\n// this.southeast = qt_southeast;\n// this.southwest = qt_southwest;\n\n// 3.- Hacer: this.divided <- true\n let x = this.boundary.x;\n let y = this.boundary.y;\n let w = this.boundary.w;\n let h = this.boundary.h;\n let ne = new Rectangle(x + w / 2, y - h / 2, w / 2, h / 2);\n this.northeast = new QuadTree(ne, this.capacity);\n let nw = new Rectangle(x - w / 2, y - h / 2, w / 2, h / 2);\n this.northwest = new QuadTree(nw, this.capacity);\n let se = new Rectangle(x + w / 2, y + h / 2, w / 2, h / 2);\n this.southeast = new QuadTree(se, this.capacity);\n let sw = new Rectangle(x - w / 2, y + h / 2, w / 2, h / 2);\n this.southwest = new QuadTree(sw, this.capacity);\n this.divided = true;\n\n\n\n}", "title": "" }, { "docid": "5dbcd9473439c0c6ef3ac7642493bc61", "score": "0.5060006", "text": "function height(bst) {\n let leftSide = 0;\n let rightSide = 0;\n if (!bst.left && !bst.right) {\n return 1;\n }\n if (bst.left) {\n leftSide = 1 + height(bst.left);\n // console.log(leftSide, 'left');\n }\n if (bst.right) {\n rightSide = 1 + height(bst.right);\n // console.log(rightSide, 'right');\n }\n\n return leftSide > rightSide ? leftSide : rightSide;\n}", "title": "" }, { "docid": "8a812ec2a0d2ecd84bb1855daa2274e4", "score": "0.5058629", "text": "function calculate(nodes, edges) {\n\n var wnodeCount1 = document.getElementById('wnodeCount1').value;\n var bnodeCount1 = document.getElementById('bnodeCount1').value;\n var wnodeCount2 = document.getElementById('wnodeCount2').value;\n var bnodeCount2 = document.getElementById('bnodeCount2').value;\n var wparentCount = document.getElementById('wparentCount').value;\n var bparentCount = document.getElementById('bparentCount').value;\n\n //Total Number of Ancestors and Descendants\n var n_a = Number(wnodeCount1) + Number(bnodeCount1);\n var n_d = Number(wnodeCount2) + Number(bnodeCount2);\n\n var connTotal = edges.length;\n\n ////////////////////////////////////////////////////////////\n //Cbar_a calculations\n ////////////////////////////////////////////////////////////\n var connPerAncestor = connTotal/n_a;\n var Cbar_a = [];\n\n //This works because white nodes are always added before black nodes\n //To do: make this calculation work no matter what order the array of nodes is created in\n\n //Connections per ancestor (White)\n for(var j = 0; j < wnodeCount1; j++) {\n Cbar_a.push(0);\n for(i in edges) {\n if(edges[i].from == ('aw' + j.toString()) ) Cbar_a[j]++;\n }\n }\n //Connections per ancestor (Black)\n for(var j = 0; j < bnodeCount1; j++) {\n Cbar_a.push(0);\n for(i in edges) {\n if(edges[i].from == ('ab' + j.toString()) ) Cbar_a[Number(wnodeCount1) + j]++;\n }\n }\n //Ratio of Connections per ancestor for a specific ancestor to Overall Connections per ancestor\n Cbar_a = Cbar_a.map(function(x) {return x / connPerAncestor; });\n\n //Character (White or black / 0 or 1) of each ancestor\n var X_a =[];\n var j = 0;\n for(i in nodes) {\n if(nodes[i].level == 0) {\n if(nodes[i].color.background == 'black') X_a[j] = 1;\n else X_a[j] = 0;\n j++;\n }\n }\n\n //Average of ratios of connections per ancestor for sepcific ancestor to Overall connections per ancestor\n var sum = 0;\n for(var i = 0; i < Cbar_a.length; i++) sum = sum + Cbar_a[i];\n var meanCbar_a = sum / Cbar_a.length;\n\n\n //Average character of ancestors\n var meanX_a = Number(bnodeCount1) / X_a.length;\n\n //Covariance of Cbar_a and X_a\n sum = 0;\n for(var i = 0; i < Cbar_a.length; i++)\n sum += (Cbar_a[i] - meanCbar_a) * (X_a[i] - meanX_a);\n var term1 = sum / Cbar_a.length;\n\n ///////////////////////////////////////////////////////////////\n //Cbar_d calculations\n //////////////////////////////////////////////////////////////\n\n var Cbar_d = [];\n for(var j = 1; j <= Number(wnodeCount2); j++) {\n Cbar_d.push(0);\n for(i in edges) {\n if(edges[i].to == ('dw' + j.toString()) ) Cbar_d[j-1]++;\n }\n }\n\n for(var j = 1; j <= Number(bnodeCount2); j++) {\n Cbar_d.push(0);\n for(i in edges) {\n if(edges[i].to == ('db' + j.toString()) ) Cbar_d[Number(wnodeCount2) + j-1]++;\n }\n }\n var connPerDescendant = connTotal/n_d;\n Cbar_d = Cbar_d.map(function(x) {return x / connPerDescendant; });\n\n var X_d =[];\n var j = 0;\n for(i in nodes) {\n if(nodes[i].level == 1) {\n if(nodes[i].color.background == 'black') X_d[j] = 1;\n else X_d[j] = 0;\n j++;\n }\n }\n\n //Average of ratios of connections per descendant for specific ancestor to Overall connections per descendant\n sum = 0;\n for(var i = 0; i < Cbar_d.length; i++) sum = sum + Cbar_d[i];\n var meanCbar_d = sum / Cbar_d.length;\n\n\n //Average character of ancestors\n var meanX_d = Number(bnodeCount2) / X_d.length;\n\n //Covariance of Cbar_d and X_d\n sum = 0;\n for(var i = 0; i < Cbar_d.length; i++) sum += (Cbar_d[i] - meanCbar_d) * (X_d[i] - meanX_d);\n var term3 = sum / Cbar_d.length;\n\n /////////////////////////////////////////////////////////////////\n //Delta Xbar\n /////////////////////////////////////////////////////////////////\n var Xbar_a = bnodeCount1 / n_a;\n var Xbar_d = bnodeCount2 / n_d;\n var deltaXbar = Xbar_d-Xbar_a;\n\n\n /////////////////////////////////////////////////////////////////\n //Term 2 (Calculated from Terms 1, 3 and Delta Xbar)\n /////////////////////////////////////////////////////////////////\n //Calculate term 2 and round to zero if its less than 3 sig figs\n var term2 = deltaXbar - term1 + term3;\n if(Math.abs(term2) < .001) term2 = 0;\n\n //truncate all terms to 3 sig figs\n term1 = term1.toFixedDown(3);\n term2 = term2.toFixedDown(3);\n term3 = term3.toFixedDown(3);\n deltaXbar = deltaXbar.toFixedDown(3);\n\n //Display terms\n document.getElementById('1stTerm').innerHTML = term1;\n document.getElementById('2ndTerm').innerHTML = term2;\n document.getElementById('3rdTerm').innerHTML = term3;\n document.getElementById('deltaXbar').innerHTML = deltaXbar;\n document.getElementById('xbard').innerHTML = Xbar_d;\n document.getElementById('xbara').innerHTML = Xbar_a;\n\n\n}", "title": "" }, { "docid": "936c832d35b8a92922708260e69fd1c6", "score": "0.5056454", "text": "__orderByBarycenter(tree) {\n let numLeaves = 0;\n let traverse = (node) => {\n if (!node.children) node.bcMatrixPosition = numLeaves++;\n else {\n node.barycenter = 0; // hierarchy nodes get the average of their childrens' barycenter\n let numInvolvedChildren = 0;\n node.children.forEach((child, i) => {\n traverse(child);\n // child.index = i; // store previous child index\n if (!Number.isNaN(child.barycenter)) {\n node.barycenter += child.barycenter;\n numInvolvedChildren++;\n }\n });\n if (numInvolvedChildren > 0) node.barycenter /= numInvolvedChildren;\n\n node.children.sort((a, b) => {\n if (Number.isNaN(a.barycenter) || Number.isNaN(b.barycenter))\n return 0;\n if (a.barycenter == b.barycenter) return 0;\n else return a.barycenter > b.barycenter ? 1 : -1;\n });\n }\n };\n\n traverse(tree);\n }", "title": "" }, { "docid": "42465a5c46f5cb79d33e3426782e7f4a", "score": "0.50466233", "text": "function mergeTree(tree1, tree2) {\n var conflicts = false;\n for (var i = 0; i < tree2[1].length; i++) {\n if (!tree1[1][0]) {\n conflicts = 'new_leaf';\n tree1[1][0] = tree2[1][i];\n }\n if (tree1[1][0].indexOf(tree2[1][i][0]) === -1) {\n conflicts = 'new_branch';\n tree1[1].push(tree2[1][i]);\n tree1[1].sort();\n } else {\n var result = mergeTree(tree1[1][0], tree2[1][i]);\n conflicts = result.conflicts || conflicts;\n tree1[1][0] = result.tree;\n }\n }\n return {conflicts: conflicts, tree: tree1};\n }", "title": "" }, { "docid": "fd840ad0f426c9fa372ee3f69abed2d1", "score": "0.502839", "text": "function anteUp() {\n smallBlind();\n bigBlind();\n console.log('posting the small/big blinds');\n}", "title": "" }, { "docid": "7460f750fbb6ffd0cf9d4a940cff1071", "score": "0.5022215", "text": "function rightTree() {\n let tree1 = new Tree({ x: -9, z: 18 });\n tree1.setScale(3);\n world.add(tree1);\n let tree2 = new Tree2({ x: -6, z: 18 });\n tree2.setScale(3);\n world.add(tree2);\n let tree3 = new Tree({ x: -3, z: 18 });\n tree3.setScale(3);\n world.add(tree3);\n let tree4 = new Tree2({ x: -9, z: 15 });\n tree4.setScale(3);\n world.add(tree4);\n }", "title": "" }, { "docid": "35d2f553de660b7840ed29b67c50ef47", "score": "0.5013751", "text": "function growObstaclesPass() {\n \t// grow obstacles\n \tfor (var i = 0; i < userObstacles.length; i++)\n \t\tuserObstacles[i].growVertices();\n\n \t// go through paths and test segments\n \tfor (var i = 0; i < workingPaths.length; i++) {\n \t\tvar path = workingPaths[i]; // Path\n\n \t\tfor (var e in path.excludedObstacles)\n \t\t\tpath.excludedObstacles[e].exclude = true;\n\n \t\tif (path.grownSegments.length == 0) {\n \t\t\tfor (var s in path.segments)\n \t\t\t\ttestOffsetSegmentForIntersections(path.segments[s], -1, path);\n \t\t} else {\n \t\t\tvar counter = 0;\n \t\t\tvar currentSegments = path.grownSegments.slice();\n \t\t\tfor (var s = 0; s < currentSegments.length; s++)\n \t\t\t\tcounter += testOffsetSegmentForIntersections(currentSegments[s], s + counter, path);\n \t\t}\n\n \t\tfor (var e in path.excludedObstacles)\n \t\t\tpath.excludedObstacles[e].exclude = false;\n\n \t}\n\n \t// revert obstacles\n \tfor (var i = 0; i < userObstacles.length; i++)\n \t\tuserObstacles[i].shrinkVertices();\n }", "title": "" }, { "docid": "43edaa935196e6c5a00e495f7a2bb4d3", "score": "0.50112647", "text": "function canonify() {\n\n // Set golden rectangle (horizontal) height\n var h = document.getElementsByClassName(\"golden-rect-horiz\");\n var i = h.length;\n while (i--) {\n h[i].style.height = Math.floor(h[i].clientWidth / 1.618) + \"px\";\n }\n\n // Set golden rectangle (vertical) height\n var v = document.getElementsByClassName(\"golden-rect-vert\");\n i = v.length;\n while (i--) {\n v[i].style.height = Math.floor(v[i].clientWidth * 1.618) + \"px\";\n }\n\n // Process elements of the Van de Graaf canon.\n var vdg = document.getElementsByClassName(\"vandegraaf\");\n i = vdg.length;\n var windowHeight = window.innerHeight;\n var blockHeight, blockWidth, topPadding, bottomPadding;\n\n while (i--) {\n\n blockHeight = vdg[i].clientHeight;\n topPadding = 0.11 * ((blockHeight < windowHeight) ? blockHeight : windowHeight);\n bottomPadding = 2 * topPadding;\n vdg[i].style.paddingTop = Math.floor(topPadding) + \"px\";\n if (vdg[i].classList.contains('multicolumn')) {\n blockWidth = vdg[i].clientWidth;\n vdg[i].style.MozColumnGap = vdg[i].style.webkitColumnGap = vdg[i].style.columnGap = Math.floor(0.11 * blockWidth) + \"px\";\n }\n\n // collapse bottom padding for stacked VDGs\n if (vdg[i].classList.contains(\"nofooter\")) {\n vdg[i].style.paddingBottom = 0;\n } else {\n vdg[i].style.paddingBottom = Math.floor(bottomPadding) + \"px\";\n }\n }\n\n // Process elements of the Tschichold canon\n var tsc = document.getElementsByClassName(\"tschichold\");\n i = tsc.length;\n while (i--) {\n if (tsc[i].classList.contains('multicolumn')) {\n blockWidth = tsc[i].clientWidth;\n tsc[i].style.MozColumnGap = tsc[i].style.webkitColumnGap = tsc[i].style.columnGap = Math.floor(0.11 * blockWidth) + \"px\";\n }\n\n // collapse bottom padding for stacked Tschicholds\n if (tsc[i].classList.contains(\"nofooter\")) {\n tsc[i].style.paddingBottom = 0;\n }\n if (tsc[i].classList.contains(\"noheader\")) {\n tsc[i].style.paddingTop = 0;\n }\n // TODO. DRYify, just use CSS to collapse anything with nofooter.\n }\n\n /* *\n var gdm = document.getElementsByClassName('golden-margins');\n i = gdm.length;\n while (i--) {\n blockHeight = gdm[i].clientHeight;\n topPadding = Math.floor(((blockHeight < windowHeight) ? blockHeight : windowHeight) / 1.618);\n if (!gdm[i].classList.contains('noheader')) {\n gdm[i].style.paddingTop = topPadding + \"px\";\n }\n if (!gdm[i].classList.contains('nofooter')) {\n gdm[i].style.paddingBottom = topPadding + \"px\";\n }\n }\n /* */\n}", "title": "" }, { "docid": "53f4fc4fb5ac67aa13c4c63ceca7182f", "score": "0.50073063", "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": "645fca78f30f03e2bd8b1d21d3ca6110", "score": "0.5000231", "text": "subdivide(){\n // obtenemos los valores de nuestro primer rectangulo o nuestro primer marco o la Raiz.\n let x = this.boundary.x;\n let y = this.boundary.y;\n let w = this.boundary.w;\n let h = this.boundary.h;\n // Procedemos dividir en 4 partes dicho rectangulo\n let ne = new Rectangle(x + w/2, y - h/2, w/2, h/2 );\n // Creamos para cada uno de estos su nuevo sub arbol.\n this.northeast = new QuadTree(ne, this.capacity);\n let nw = new Rectangle(x - w/2, y - h/2, w/2, h/2 );\n this.northwest = new QuadTree(nw , this.capacity);\n let se = new Rectangle(x + w/2, y + h/2, w/2, h/2 );\n this.southeast = new QuadTree(se, this.capacity); \n let sw = new Rectangle(x - w/2, y + h/2, w/2, h/2 );\n this.southwest = new QuadTree(sw , this.capacity);\n // Cuando hacemos la division del arbol, necesitamos no dejar a un hijo como padre\n // se debe reordenar para que el punto medio sea el padre y se agregue los puntos unicamente en las hojase\n // recorremos todos los indices que de nuestra lista que tiene como maximo a capacity \n for(let i = 0 ; i < this.points.length;i++){\n let p = this.points[i];\n // comprobamos si tanto este punto como el que vamos a ingresar pertenecen a dicho lado del rectangulo\n // si es si, se elimina dicho nodo que tomara la posicion a nuevo padre y colocamos en su lugar al punto medio\n // una vez verificado agregamos ese nodo eliminado como nuevo hijo y termina la division.\n if(ne.contains(p)){\n //let punto_medio = new Point(x + w/2,y - h/2);\n this.points.splice(i,1);\n this.northeast.insert(p);\n } else if(nw.contains(p)){\n //let punto_medio = new Point(x - w/2,y - h/2);\n this.points.splice(i,1);\n this.northwest.insert(p);\n } else if(se.contains(p)){\n //let punto_medio = new Point(x + w/2,y + h/2);\n this.points.splice(i,1);\n this.southeast.insert(p);\n } else if(sw.contains(p)){\n //let punto_medio = new Point(x - w/2, y + h/2);\n this.points.splice(i,1);\n this.southwest.insert(p);\n }\n }\n this.divided = true;\n }", "title": "" }, { "docid": "50c367690832cdc956c10aa889100e64", "score": "0.4999007", "text": "function findShortestPathWithLevels(width,height,goals,badSnakes,ownBody,thingsThatWillDisappear,health,fullSnakes){\n var graph = [];\n var nextPoint = [];\n var pathLength = 1000;\n var goalPath = [];\n var spotsThatMightBeInATunnel = [];\n var head = [ownBody[0][0],ownBody[0][1]];\n var endGoal = 0;\n var closestSnake = [];\n var closestSnakeDistance = 100;\n ownBody.splice(0,1);\n\n var priority = {\"empty\": 2, \"full\": 0, \"nearSelf\": 1, \"nearOthers\": 15, \"nearWalls\": 9, \"ownBody\": 0, \"tunnel\": -2, \"danger\": -1, \"food\": 1, \"foodTrap\": 30, \"snakeHeads\": -4};\n for(var x = 0; x < width; x++){\n var row = [];\n for (var y = 0; y < height; y++){\n if (x == 0 || x == width-1 || y == 0 || y == height-1){\n row.push(priority.nearWalls)\n }\n else {\n row.push(priority.empty);\n }\n }\n graph.push(row);\n }\n\n var ownTail = ownBody[ownBody.length - 1];\n\n var areaAroundOtherSnakes = findAreasAroundCoorArray(badSnakes,height,width);\n var areaAroundSelf = findAreasAroundCoorArray(ownBody,height,width);\n var areaAroundWalls = findAreasAroundWalls(graph,priority.nearWalls);\n var areaAroundFood = findAreasAroundCoorArray(goals,height,width);\n\n graph = addArrayToGraph(graph,areaAroundSelf,priority.nearSelf);\n graph = addArrayToGraph(graph,areaAroundFood,priority.food);\n graph = addArrayToGraph(graph,areaAroundOtherSnakes,priority.nearOthers);\n graph = addArrayToGraph(graph,goals,priority.food);\n graph = addArrayToGraph(graph,ownBody,priority.ownBody);\n graph = addArrayToGraph(graph,badSnakes,priority.full);\n\n //graph = addArrayToGraph(graph,thingsThatWillDisappear,priority.empty);\n\n var dangerPoints = findTunnelsAndDangerPoints(graph);\n var tunnels = findTunnelsAndDangerPoints(graph,true,head);\n\n graph = addArrayToGraph(graph,dangerPoints,priority.danger);\n\n if (checkIfPointInTunnel(head,graph) || health < 50){\n console.log(\"--IN TUNNEL--\");\n }\n else {\n graph = addArrayToGraph(graph,tunnels,priority.tunnel);\n }\n for(var i = 0; i < fullSnakes.length; i++){\n var areaAroundSnakeHeads = findAreasAroundCoorArray([fullSnakes[i][0]],height,width);\n graph = addArrayToGraph(graph,areaAroundSnakeHeads,priority.full);\n }\n\n // Opens a tunnel for wrapped food\n\n for (var i = 0; i<goals.length; i++){\n if ((isFoodWrapped(goals[i],graph,head) >2 || isFoodInCorner(goals[i],graph)) && health > 10 && ownBody.length>8){\n graph[goals[i][0]][goals[i][1]] = 0;\n\n var direction = \"\";\n\n if (!isItAWall([goals[i][0] + 1,goals[i][1]],graph)){\n direction = \"right\";\n }\n else if (!isItAWall([goals[i][0] - 1,goals[i][1]],graph)){\n direction = \"left\";\n }\n else if (!isItAWall([goals[i][0],goals[i][1] + 1],graph)){\n direction = \"down\";\n }\n else if (!isItAWall([goals[i][0],goals[i][1] - 1],graph)){\n direction = \"up\";\n }\n\n for(var z = 0; z < 3; z++){\n switch(direction){\n case \"up\":\n if (!isItAWall([goals[i][0],goals[i][1] - z],graph)){\n graph[goals[i][0]][goals[i][1]-z] = priority.foodTrap;\n }\n break;\n case \"down\":\n if (!isItAWall([goals[i][0],goals[i][1] + z],graph)){\n graph[goals[i][0]][goals[i][1]+z] = priority.foodTrap;\n }\n break;\n case \"left\":\n if (!isItAWall([goals[i][0]-z,goals[i][1]],graph)){\n graph[goals[i][0]-z][goals[i][1]] = priority.foodTrap;\n }\n break;\n case \"right\":\n if (!isItAWall([goals[i][0]+z,goals[i][1]],graph)){\n graph[goals[i][0]+z][goals[i][1]] = priority.foodTrap;\n }\n break;\n }\n }\n\n }\n }\n\n //Go on the offensive\n //First find nearest enemy that isn't moving away.\n var enemyDistance = 25;\n var closestEnemySnake = -1;\n\n for(var i = 0; i<fullSnakes.length; i++){\n\n var enemyHeadDistance = getDistance(head,fullSnakes[i][0]);\n var enemyNeckDistance = getDistance(head,fullSnakes[i][1]);\n\n if (enemyHeadDistance < enemyDistance && enemyHeadDistance < enemyNeckDistance){\n closestEnemySnake = i;\n }\n }\n\n if (closestEnemySnake != -1){\n\n var potentialPoint = [];\n var killPointOne = [];\n var killPointTwo = [];\n var killPointThree = [];\n\n potentialPoint.push(fullSnakes[closestEnemySnake][0][0] - fullSnakes[closestEnemySnake][1][0]);\n potentialPoint.push(fullSnakes[closestEnemySnake][0][1] - fullSnakes[closestEnemySnake][1][1]);\n\n killPointThree.push(fullSnakes[closestEnemySnake][0][0] + potentialPoint[0]);\n killPointThree.push(fullSnakes[closestEnemySnake][0][1] + potentialPoint[1]);\n\n if (!isItAWall(killPointThree,graph) && fullSnakes[closestEnemySnake].length < ownBody.length + 1){\n goals.unshift(killPointThree);\n }\n else if (!isItAWall(killPointThree,graph)) {\n graph[killPointThree[0]][killPointThree[1]] = 0;\n }\n\n potentialPoint[0] = fullSnakes[closestEnemySnake][0][0] + (potentialPoint[0] * 2);\n potentialPoint[1] = fullSnakes[closestEnemySnake][0][1] + (potentialPoint[1] * 2);\n\n if (potentialPoint[0] != fullSnakes[closestEnemySnake][0][0]){\n killPointOne = [potentialPoint[0],potentialPoint[1]+1];\n killPointTwo = [potentialPoint[0],potentialPoint[1]-1];\n }\n else {\n killPointOne = [potentialPoint[0]+1,potentialPoint[1]];\n killPointTwo = [potentialPoint[0]-1,potentialPoint[1]];\n }\n\n if (health > 75 && ownBody.length + 1 > 6){\n if (!isItAWall(killPointTwo,graph) && (isItAWall(killPointOne,graph) || getDistance(head,killPointTwo) < 2)){\n console.log(\"going in for the kill!\");\n goals.unshift(killPointTwo);\n }\n else if (!isItAWall(killPointOne,graph) && (isItAWall(killPointTwo,graph) || getDistance(head,killPointOne) < 2)){\n console.log(\"going in for the kill!\");\n goals.unshift(killPointOne);\n }\n }\n }\n\n var graphObject = new Graph(graph);\n\n var start = graphObject.grid[head[0]][head[1]];\n //Pick which food to go after\n\n for (var i = 0; i<goals.length;i++){\n\n var end = graphObject.grid[goals[i][0]][goals[i][1]];\n var result = astar.search(graphObject,start,end);\n\n if (isItAWall(goals[i],graph)){\n continue;\n }\n \n if (result.length < pathLength && result.length > 0 && (findHowManyFreeNodesV2([result[0].x,result[0].y],head,graph) > ownBody.length || health < 50)){\n goalPath = result;\n nextPoint = [result[0].x,result[0].y];\n pathLength = result.length;\n endGoal = i;\n console.log(goals[endGoal]);\n }\n }\n\n //If we have a valid goal, we want to check to see if we'll still be able to get out once we reach it.\n //Rather naive, but it does help the snake out of a few situations.\n //TODO: Remove tail from graph.\n if(nextPoint.length > 0 && health > 40){\n var newBodyCoords = [];\n\n var newCoordsLength = (ownBody.length < goalPath.length) ? goalPath.length - ownBody.length : goalPath.length;\n\n for(i = goalPath.length - 1; i > goalPath.length - newCoordsLength; i--){\n newBodyCoords.push([goalPath[i].x,goalPath[i].y]);\n }\n\n var futureGraph = [];\n for(i = 0; i < graph.length; i++){\n futureGraph[i] = graph[i].slice();\n }\n futureGraph = addArrayToGraph(futureGraph,newBodyCoords,priority.ownBody);\n futureGraph = addArrayToGraph(futureGraph,[ownTail],priority.empty);\n var futureGraphObject = new Graph(futureGraph);\n var oldGoal = goalPath[goalPath.length-1];\n var goal = futureGraphObject.grid[oldGoal.x][oldGoal.y];\n var tailNode = futureGraphObject.grid[ownTail[0]][ownTail[1]];\n\n\n var futureResult = astar.search(futureGraphObject,goal,tailNode);\n\n if(futureResult.length == 0){\n nextPoint = [];\n }\n\n }\n\n for (var i = 0; i <fullSnakes.length; i++){\n if (getDistance(fullSnakes[i][0],head) < closestSnakeDistance){\n closestSnake = fullSnakes[i][0];\n closestSnakeDistance = getDistance(fullSnakes[i][0],head);\n }\n }\n\n //Attempt to wrap food if health is high enough && enemy won't eat it before we wrap it\n if (health > 50 && getDistance(head,goals[endGoal]) == 1 && ownBody.length>8 && !isFoodCloseToEnemy(goals[endGoal],fullSnakes,head) && graph[goals[endGoal][0]][goals[endGoal][1]] == priority.food){\n\n if (isFoodWrapped(goals[endGoal],graph,head) > 1 && isFoodWrapped(goals[endGoal],graph,head) < 4){\n console.log(\"Continuing wrap\");\n nextPoint=[head[0]-ownBody[0][0]+head[0],head[1]-ownBody[0][1]+head[1]];\n if (isItAWall(nextPoint,graph)){\n nextPoint = [];\n }\n }\n else if (head[0] != nextPoint [0]){\n if ((head[1] < closestSnake[1] || isItAWall([head[0],head[1]-1],graph)) && !isItAWall([head[0],head[1]+1],graph)){\n nextPoint = [head[0],head[1]+1];\n }\n else if (!isItAWall([head[0],head[1]-1],graph)){\n nextPoint = [head[0],head[1]-1];\n }\n }\n else {\n if ((head[0] > closestSnake[0]|| isItAWall([head[0]+1,head[1]],graph)) && !isItAWall([head[0]-1,head[1]],graph)){\n nextPoint = [head[0]-1,head[1]];\n }\n else if (!isItAWall([head[0]+1,head[1]],graph)) {\n nextPoint = [head[0]+1,head[1]];\n }\n\n }\n\n }\n\n\n if(nextPoint.length == 0){\n console.log(\"Stalling!\");\n\n //Get vector total of last 2 moves.\n\n var lastMoveVector = getMoveVector(head,ownBody[0]),\n secondLastMoveVector = getMoveVector(ownBody[0],ownBody[1]),\n vectorTotal = [lastMoveVector[0] + secondLastMoveVector[0], lastMoveVector[1] + secondLastMoveVector[1]],\n sameDirectionMove = [head[0] + lastMoveVector[0],head[1] + lastMoveVector[1]],\n sameDirectionWeight = getWeightByCoordinates(graphObject,sameDirectionMove[0],sameDirectionMove[1],width,height);\n\n // CASE 1: If last two moves were an elbow\n if(vectorTotal[0] != 0 && vectorTotal[1] != 0){\n var doubleBackVector = [secondLastMoveVector[0] * -1, secondLastMoveVector[1] * -1],\n doubleBackMove = [head[0] + doubleBackVector[0], head[1] + doubleBackVector[1]],\n doubleBackWeight = getWeightByCoordinates(graphObject,doubleBackMove[0],doubleBackMove[1],width,height);\n\n //CASE 1.1: Can we double back?\n if(doubleBackWeight > 0){\n console.log('1.1');\n //If our head is against a obstacle, do an area check instead.\n if(sameDirectionWeight == 0){\n var escapeDoubleBack = [head[0] + secondLastMoveVector[0], head[1] + secondLastMoveVector[1]],\n doubleBackArea = findHowManyFreeNodesV2(doubleBackMove,head,graph),\n escapeArea = findHowManyFreeNodesV2(escapeDoubleBack,head,graph);\n\n console.log(escapeDoubleBack,escapeArea);\n console.log(doubleBackMove,doubleBackArea);\n nextPoint = escapeArea > doubleBackArea ? escapeDoubleBack : doubleBackMove;\n\n }else{\n nextPoint = doubleBackMove;\n }\n }\n //CASE 1.2: If not, try to move in same direction\n else if(sameDirectionWeight != 0){\n console.log('1.2');\n nextPoint = sameDirectionMove;\n }\n //CASE 1.3: If we can't move in the same direction, go in the only possible direction.\n else {\n console.log('1.3');\n var nextVector = [(lastMoveVector[0] + (lastMoveVector[0] * -1) + doubleBackVector[0]) * -1,(lastMoveVector[1] + (lastMoveVector[1] * -1) + doubleBackVector[1]) *-1];\n\n nextPoint = [head[0] + nextVector[0],head[1] + nextVector[1]];\n }\n }\n //CASE 2: Last two moves were the same.\n else{\n var wasVertical = lastMoveVector[0] == 0,\n backupVectors = wasVertical ? [[-1,0],[1,0]] : [[0,-1],[0,1]],\n willBlockWholeBoard = false;\n\n //Prevent stalling the whole height/width of the board and blocking off half.\n if(wasVertical){\n if(ownBody.length >= height){\n var heightMoveVector = getMoveVector(sameDirectionMove,ownBody[height - 3]);\n if(heightMoveVector[0] == 0 && (heightMoveVector[1] == height - 1 || heightMoveVector[1] == 1 - height)){\n willBlockWholeBoard = true;\n }\n }\n }else{\n if(ownBody.length >= width){\n var widthMoveVector = getMoveVector(sameDirectionMove,ownBody[width - 3]);\n if((widthMoveVector[0] == width - 1 || widthMoveVector[0] == 1 - width) && widthMoveVector[1] == 0){\n willBlockWholeBoard = true;\n }\n }\n }\n\n //CASE 2.1: Can we go straight?\n if(sameDirectionWeight != 0 && findHowManyFreeNodesV2(sameDirectionMove,head,graph) > ownBody.length/2 && !willBlockWholeBoard){\n console.log('2.1');\n nextPoint = sameDirectionMove;\n }else{\n //CASE 2.2: Backup moves.\n console.log('2.2');\n var backupMove1 = [head[0] + backupVectors[0][0],head[1] + backupVectors[0][1]],\n backupMove2 = [head[0] + backupVectors[1][0],head[1] + backupVectors[1][1]],\n backupArea1 = findHowManyFreeNodesV2(backupMove1,head,graph),\n backupArea2 = findHowManyFreeNodesV2(backupMove2,head,graph),\n firstToCheck = backupArea1 > backupArea2 ? backupMove1 : backupMove2,\n secondToCheck = backupArea1 > backupArea2 ? backupMove2 : backupMove1;\n console.log(backupMove1,backupArea1);\n console.log(backupMove2,backupArea2);\n if(getWeightByCoordinates(graphObject,firstToCheck[0],firstToCheck[1],width,height) != 0){\n nextPoint = firstToCheck;\n } else if(getWeightByCoordinates(graphObject,secondToCheck[0],secondToCheck[1],width,height) != 0){\n nextPoint = secondToCheck;\n } else {\n nextPoint = sameDirectionMove;\n }\n\n }\n\n }\n } else {\n if (isItAWall(nextPoint,graph)){\n nextPoint=[head[0]-1,head[1]];\n }\n if (isItAWall(nextPoint,graph)){\n nextPoint=[head[0]+1,head[1]];\n }\n if (isItAWall(nextPoint,graph)){\n nextPoint=[head[0],head[1]-1];\n }\n if (isItAWall(nextPoint,graph)){\n nextPoint=[head[0],head[1]+1];\n }\n }\n console.log(graph[nextPoint[0]][nextPoint[1]],nextPoint);\n return nextPoint;\n\n\n}", "title": "" }, { "docid": "b43d44213a23497cd321811aefd7cbef", "score": "0.4975507", "text": "function apportion(node, level) {\n var leftmost = firstChild(node)\n var neighbour = leftmost.leftNeighbour\n var compareDepth = 1\n var depthToStop = maxDepth - level\n\n while (leftmost && neighbour && compareDepth < depthToStop) {\n /* Compute the location of Leftmost and 11here it should */\n /* be with respect to Neighbor. */\n var leftModSum = 0\n var rightModSum = 0\n var ancestorLeftmost = leftmost\n var ancestorNeighbor = neighbor\n for (var i=0; i < compareDepth; i++) {\n ancestorLeftmost = parent(ancestorLeftmost)\n ancestorNeighbor = parent(ancestorNeighbor)\n rightModSum = rightModSum + ancestorLeftmost.modifier\n leftModSum = leftModSum + ancestorNeighbor.modifier\n\n }\n /* Find the floveDistance, and apply it to Node's subtree. */\n /*Add appropriate portions to smaller interior subtrees. */\n var moveDistance = neighbour.prelim +\n leftModSum + subtreeSeparation + meanNodeSize(leftmost, neighbour) -\n (leftmost.prelim + rightModSum)\n if (moveDistance > 0) {\n /*Count interior sibling subtrees in LeftSiblings*/\n var tempPtr = node\n var leftSiblings = 0\n while (tempPtr && tempPtr !== ancestorNeighbor) {\n leftSiblings = leftSiblings + 1\n tempPtr = leftSibling(tempPtr)\n }\n if (tempPtr) {\n /*Apply portions to appropriate leftsibling */\n /* subtrees. */\n var portion = moveDistance / leftSiblings\n tempPtr = node\n while (tempPtr === ancestorNeighbor) {\n tempPtr.prelim += moveDistance\n tempPtr.modifier += moveDistance\n moveDistance -= portion\n tempPtr = leftSibling(tempPtr)\n }\n } else {\n /* Don't need to move anything--it needs to */\n /* be done by an ancestor because */\n /* AncestorNeighbor and AncestorLeftmost are */\n /* not siblings of each other. */\n return\n }\n }\n /* Determine the leftmost descendant of Node at the next */\n /* lower level to compare its positioning against that of*/\n /* its Neighbour */\n compareDepth++\n if (isLeaf(leftmost)) {\n leftmost = getLeftmost(node, 0, compareDepth)\n } else {\n leftmost = firstChild(leftmost)\n }\n\n }\n\n }", "title": "" }, { "docid": "e244cde9d24c9aa211477cc4687c800e", "score": "0.49447453", "text": "function drawTrees()\n{\n var x_pos;\n var y_pos;\n \n // Draw trees.\n for (var i = 2; i < trees.length; i++)\n {\n x_pos = trees[i].x_pos;\n y_pos = trees[i].y_pos;\n \n // Don't draw trees on various platforms\n if (i % 3 == 0 || i % 4 == 0)\n {\n continue;\n }\n \n // Alternate between two different trees\n if (i % 2)\n {\n // Trunk and branches\n fill(0, 0, 90); //NavyBlue\n triangle(x_pos-25,\n y_pos,\n x_pos,\n y_pos-125,\n x_pos+25,\n y_pos);\n stroke(0, 0, 90);\n strokeWeight(3);\n line(x_pos,\n y_pos-112,\n x_pos-35,\n y_pos-140);\n line(x_pos,\n y_pos-110,\n x_pos+35,\n y_pos-135);\n line(x_pos,\n y_pos-119,\n x_pos-17,\n y_pos-160);\n\n // Treetop\n noStroke();\n\n fill(255, 20, 147); //DeepPink\n ellipse(x_pos+42, y_pos-182, 36, 36)\n\n fill(255, 20, 147); //DeepPink\n rect(x_pos-55, y_pos-180, 35, 35, 7);\n\n fill(255, 90, 180); //HotPink\n rect(x_pos-65, y_pos-160, 45, 45, 7);\n rect(x_pos+32, y_pos-167, 55, 50, 7);\n\n fill(255, 170, 193); //LightPink\n rect(x_pos-32, y_pos-208, 58, 80, 7);\n rect(x_pos+50, y_pos-185, 42, 38, 7);\n\n fill(255, 90, 180); //HotPink\n rect(x_pos+45, y_pos-188, 24, 24, 7);\n\n fill(219, 112, 147) //PaleVioletRed\n rect(x_pos+18, y_pos-180, 35, 35, 7);\n }\n else\n {\n //Trunk\n fill(196, 161, 196);\n strokeJoin(ROUND);\n beginShape();\n vertex(x_pos, y_pos);\n bezierVertex(x_pos-40, y_pos-11,\n x_pos-32, y_pos-55,\n x_pos, y_pos-120);\n endShape();\n \n beginShape();\n vertex(x_pos, y_pos);\n bezierVertex(x_pos+40, y_pos-11,\n x_pos+32, y_pos-55,\n x_pos, y_pos-120);\n endShape();\n \n //Bottom line\n push();\n noStroke();\n fill(50, 40, 100);\n rect(x_pos-22, y_pos-8, 44, 8, 3);\n stroke(32, 31, 69);\n strokeWeight(3);\n strokeCap(ROUND);\n line(x_pos-22, y_pos-8, x_pos+22, y_pos-8);\n pop();\n \n //Treetop\n noStroke();\n fill(218, 112, 214);\n ellipse(x_pos-5, y_pos-184, 50, 54);\n \n fill(106, 90, 205);\n ellipse(x_pos+26, y_pos-175, 62, 54);\n \n fill(75, 0, 130);\n ellipse(x_pos-24, y_pos-174, 51, 44);\n \n fill(218, 112, 214);\n ellipse(x_pos+18, y_pos-160, 43, 43);\n \n fill(128, 0, 128);\n ellipse(x_pos-18, y_pos-129, 54, 63);\n \n fill(128, 0, 128);\n ellipse(x_pos+41, y_pos-145, 43, 38);\n \n fill(106, 90, 205);\n ellipse(x_pos+24, y_pos-124, 62, 54);\n \n //White points\n fill(230, 230, 250);\n ellipse(x_pos+32, y_pos-124, 6, 6);\n ellipse(x_pos+61, y_pos-147, 7, 7);\n ellipse(x_pos+53, y_pos-162, 7, 7);\n ellipse(x_pos+26, y_pos-159, 6, 6);\n ellipse(x_pos+7, y_pos-147, 5, 5);\n ellipse(x_pos-6, y_pos-159, 6, 6);\n ellipse(x_pos-46, y_pos-185, 7, 7);\n ellipse(x_pos-33, y_pos-104, 8, 8);\n ellipse(x_pos-36, y_pos-155, 7, 7);\n ellipse(x_pos-41, y_pos-147, 2, 2);\n ellipse(x_pos+48, y_pos-185, 5, 5);\n ellipse(x_pos+34, y_pos-200, 5, 5);\n ellipse(x_pos+2, y_pos-178, 6, 6);\n ellipse(x_pos-22, y_pos-125, 3, 3);\n ellipse(x_pos+22, y_pos-173, 4, 4);\n ellipse(x_pos-19, y_pos-180, 3, 3);\n ellipse(x_pos-10, y_pos-205, 4, 4);\n }\n }\n}", "title": "" }, { "docid": "da0209043e1274473d1cfa75e1b3efe2", "score": "0.4930975", "text": "addMoreHunters(segment1, segment2) {\n while (segment1.emptyCellIndices.length && segment2.emptyCellIndices.length) {\n this.addHunter(segment2)\n this.addHunter(segment1)\n }\n }", "title": "" }, { "docid": "d2ca689ae64f54a7d8d13e5f0e476e50", "score": "0.49293673", "text": "union(index1, index2) {\n let parent1 = this.findParent(index1);\n let parent2 = this.findParent(index2);\n\n //the bigger set should always win, so that we can avoid flickering when visualising the sets\n if (this.setSizes[parent1] >= this.setSizes[parent2]) {\n this.sets[parent2] = parent1;\n this.setSizes[parent1] += this.setSizes[parent2];\n } else {\n this.sets[parent1] = parent2;\n this.setSizes[parent2] += this.setSizes[parent1];\n }\n }", "title": "" }, { "docid": "bb4a25f8b3a3705af17a5a0dbac00b3f", "score": "0.49276528", "text": "function cleanCoast(h, iters) {\n\tfor (var iter = 0; iter < iters; iter++) {\n\t\tvar changed = 0;\n\t\tvar newh = zero(h.mesh);\n\t\tfor (var i = 0; i < h.length; i++) {\n\t\t\tnewh[i] = h[i];\n\t\t\tvar nbs = neighbours(h.mesh, i);\n\t\t\tif (h[i] <= 0 || nbs.length !== 3) continue;\n\t\t\tvar count = 0;\n\t\t\tvar best = -999999;\n\t\t\tfor (var j = 0; j < nbs.length; j++) {\n\t\t\t\tif (h[nbs[j]] > 0) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else if (h[nbs[j]] > best) {\n\t\t\t\t\tbest = h[nbs[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count > 1) continue;\n\t\t\tnewh[i] = best / 2;\n\t\t\tchanged++;\n\t\t}\n\t\th = newh;\n\t\tnewh = zero(h.mesh);\n\t\tfor (var i = 0; i < h.length; i++) {\n\t\t\tnewh[i] = h[i];\n\t\t\tvar nbs = neighbours(h.mesh, i);\n\t\t\tif (h[i] > 0 || nbs.length !== 3) continue;\n\t\t\tvar count = 0;\n\t\t\tvar best = 999999;\n\t\t\tfor (var j = 0; j < nbs.length; j++) {\n\t\t\t\tif (h[nbs[j]] <= 0) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else if (h[nbs[j]] < best) {\n\t\t\t\t\tbest = h[nbs[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count > 1) continue;\n\t\t\tnewh[i] = best / 2;\n\t\t\tchanged++;\n\t\t}\n\t\th = newh;\n\t}\n\treturn h;\n}", "title": "" }, { "docid": "4b3a712e35dd0a2cb0f8fc70a7b018b1", "score": "0.49260443", "text": "height(tree){\n if(!tree)\n return -1;\n return Math.max(this.height(tree.left),this.height(tree.right)) + 1;\n }", "title": "" }, { "docid": "9321da84f95577824c9dc1c96d7803e1", "score": "0.49176195", "text": "balanced() {\n // require the nodes to be sorted\n let nodes = this.sortedItems()\n let tree = new Tree()\n tree.root = balance(nodes)\n return tree;\n }", "title": "" }, { "docid": "87c1008ea3a915b88ea57fd2189152be", "score": "0.49098867", "text": "function _branchProb(joint){return (joint == 1)? 1.0:0.6}", "title": "" }, { "docid": "24f24ec6a808bb1d262bcdd29ebf8ccd", "score": "0.4908899", "text": "function tightTree(t, g) {\n\t function dfs(v) {\n\t _.each(g.nodeEdges(v), function(e) {\n\t var edgeV = e.v,\n\t w = (v === edgeV) ? e.w : edgeV;\n\t if (!t.hasNode(w) && !slack(g, e)) {\n\t t.setNode(w, {});\n\t t.setEdge(v, w, {});\n\t dfs(w);\n\t }\n\t });\n\t }\n\t\n\t _.each(t.nodes(), dfs);\n\t return t.nodeCount();\n\t}", "title": "" }, { "docid": "2a45abd80fa4b48dcbf8802eb7e6eaab", "score": "0.4901403", "text": "function currentCongLogic() {\n\n // Logic for House\n if (bodyCount == 0) {\n\n // Setup variables first time we pass through the first body\n if (count < 1 && count1 < 1 && count2 < 1) {\n test = 0;\n print('bodyCount = ')\n print(bodyCount);\n background(color(bColor));\n\n //maps stress index onto percentage effecting yay/nay vote.\n stressMap = map(stress, stressLow, stressHigh, 0, 2);\n print('Voter Stress = ' + stressMap);\n\n stressPlanetMap = map(stressPlanet, stressPlanetLow, stressPlanetHigh, 0, 2);\n print('Planet Stress = ' + stressPlanetMap)\n\n //create a stress offset that will effect congress' likelyhood of passing legislation to create change\n stressOffset = (stressPlanetMap + stressMap) / 2;\n\n // Set number of voting memebers\n numCon = numHouse;\n bodyLabel = 'HOUSE OF REPRESENTATIVES';\n\n //Set Demographics for each body\n numDem = round(numCon * perDemHouse);\n numRep = round(numCon * perRepHouse);\n numWild = round(numCon * perIndHouse);\n\n\n offSet = dWidth / (numBodies - 1);\n\n //Figure out how big to draw the circles and how far to space them out\n skip = floor(.97 * (sqrt((offSet) * dHeight / numCon)));\n print('Skip = ' + skip); //testing\n x = skip / 2;\n y = skip / 2;\n }\n }\n\n //Logic for Senate\n if (bodyCount == 1) {\n\n push(); // Start a new drawing state\n strokeWeight(10);\n translate(offSet * bodyCount - 1, 0);\n\n if (endBody == 1) {\n resetCount();\n endBody = 0;\n }\n\n // Setup variables first time we pass through a new body\n if (count < 1 && count1 < 1 && count2 < 1) {\n test = 0;\n print('bodyCount = ')\n print(bodyCount);\n\n ///Set number of voting memebers\n numCon = numSenate;\n bodyLabel = 'SENATE';\n\n //Set Demographics for each body\n numDem = round(numCon * perDemSenate);\n numRep = round(numCon * perRepSenate);\n numWild = round(numCon * perIndSenate);\n\n\n //Figure out how big to draw the circles and how far to space them out\n skip = floor(.97 * (sqrt(offSet * dHeight / numCon)));\n print('Skip = ' + skip); //testing\n x = skip / 2;\n y = skip / 2;\n\n print('Count = ' + count); //fortesting\n print('Count1 = ' + count1); //fortesting\n print('Count2 = ' + count2); //fortesting\n }\n\n }\n\n //AB logic for VP if Senate needs a tiebreaker\n if (bodyCount == 2) {\n print(\"votingBodyCounts[1][0]= \" + votingBodyCounts[1][0] + \"votingBodyCounts[0][1] = \" + votingBodyCounts[1][1]);\n\n if (votingBodyCounts[1][0] == votingBodyCounts[1][1] && vpVote == false) {\n vpVote = true;\n } else {\n vpVote = false;\n }\n\n push(); // Start a new drawing state\n strokeWeight(10);\n translate(offSet * bodyCount - 1, 0);\n\n if (endBody == 1) {\n resetCount();\n endBody = 0;\n }\n // Setup variables first time we pass through a new body\n if (count < 1 && count1 < 1 && count2 < 1) {\n test = 0;\n print('bodyCount = ')\n print(bodyCount);\n\n ///Set number of voting memebers\n numCon = numVP;\n bodyLabel = 'VICE PRESIDENT';\n\n //Set Demographics for each body\n numDem = round(numCon * perDemPres);\n numRep = round(numCon * perRepPres);\n numWild = round(numCon * perIndPres);\n\n //Figure out how big to draw the circles and how far to space them out\n skip = floor(.65 * (sqrt(offSet * dHeight / numCon)));\n print('Skip = ' + skip); //testing\n x = skip / 2;\n y = skip / 2;\n }\n }\n\n //Logic for President\n if (bodyCount == 3) {\n\n push(); // Start a new drawing state\n strokeWeight(10);\n translate(offSet * bodyCount - 2, 0);\n\n if (endBody == 1) {\n resetCount();\n endBody = 0;\n }\n\n // Setup variables first time we pass through a new body\n if (count < 1 && count1 < 1 && count2 < 1) {\n test = 0;\n print('bodyCount = ')\n print(bodyCount);\n\n // Set number of voting memebers\n numCon = numPres;\n bodyLabel = 'PRESIDENT';\n\n //Set Demographics for each body\n numDem = round(numCon * perDemPres);\n numRep = round(numCon * perRepPres);\n numWild = round(numCon * perIndPres);\n\n\n //Figure out how big to draw the circles and how far to space them out\n skip = floor(.65 * (sqrt(offSet * dHeight / numCon)));\n print('Skip = ' + skip); //testing\n x = skip / 2;\n y = skip / 2;\n }\n }\n\n // Need to make sure we are not over our number of congressional body numCon and readjusts skip if too big\n\n if (count < numCon - 1 && count1 < 1) {\n\n rotLoadImage();\n\n testSize();\n count++;\n // print('Count = ' + count); //fortesting\n } else if (count >= numCon - 1) {\n bodyVote();\n count1++;\n //print ('Count1 = ' + count1); //fortesting\n //print ('skip * Y = ' + (yCountT * skip));\n }\n}", "title": "" }, { "docid": "d520dd09db91e131d74a2f37e7a05240", "score": "0.48941192", "text": "balanceSegments(seg1, seg2) {\n if (seg1.hunters === seg2.hunters) {\n return true\n }\n\n return seg1.hunters > seg2.hunters ?\n this.addHuntersToSegment(seg1.hunters - seg2.hunters, seg2)\n :\n this.addHuntersToSegment(seg2.hunters - seg1.hunters, seg1)\n }", "title": "" }, { "docid": "2ff8d3b3533e597be7ec6d9ba5f4cc34", "score": "0.4890285", "text": "merge(blackhole){\n //İf blackhole is not merged before\n if(this.var == false){\n \n //if blackholes same position\n if(this.pos.x <= blackhole.pos.x + 10 && this.pos.x >= blackhole.pos.x - 10 ){\n if((this.pos.y <= blackhole.pos.y + 10 && this.pos.y >= blackhole.pos.y - 10 )){\n\n //Add blackholes mass to merged blackholes\n this.mass += blackhole.mass ;\n //Update radius after changing mass\n this.rs = (2 * G * this.mass/1.5) / (c*c);\n this.var = true;\n \n }\n\n \n }\n\n }\n \n \n\n }", "title": "" }, { "docid": "16ee02fd2c4d4c909eb22a7d2797c794", "score": "0.487545", "text": "function areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight) {}", "title": "" }, { "docid": "56e3d650ebf30076297296d315a3c4b8", "score": "0.4875188", "text": "winter() { \n let fprom = 0\n for(const specimen of this.population)\n fprom += fprom.fitness\n fprom = fprom / this.population.length\n for(const specie of this.species){\n specie.specimens.sort((a,b)=>b.fitness-a.fitness)\n if(specie.specimens.length>1){\n let newLen = Math.ceil(specie.specimens.length*0.2)\n specie.specimens.length = newLen\n }\n }\n\n }", "title": "" }, { "docid": "56e3d650ebf30076297296d315a3c4b8", "score": "0.4875188", "text": "winter() { \n let fprom = 0\n for(const specimen of this.population)\n fprom += fprom.fitness\n fprom = fprom / this.population.length\n for(const specie of this.species){\n specie.specimens.sort((a,b)=>b.fitness-a.fitness)\n if(specie.specimens.length>1){\n let newLen = Math.ceil(specie.specimens.length*0.2)\n specie.specimens.length = newLen\n }\n }\n\n }", "title": "" }, { "docid": "6be0508a608fb95ff6113847e31c8777", "score": "0.4875016", "text": "function height(tree){\n\n if (!tree){\n return 0\n } \n \n return Math.max(height(tree.left),height(tree.right)) + 1\n \n }", "title": "" }, { "docid": "2a1badea40325439d77d8dd5b7599583", "score": "0.4874206", "text": "function drawRightTreeBranch() {\n turnAround();\n drawTreeBranch();\n turnLeft(90);\n moveForward(15);\n}", "title": "" }, { "docid": "f68157e4b2276a5500cd0c6ec29a1353", "score": "0.48740837", "text": "function drawTrees(){\n trees.forEach((tree, index) =>{\n tree.draw( treeSpeed);\n if(tree.y < -canvas.height){\n trees.splice(index,1)\n };\n if(skiman.collision(tree)){\n gameOver()\n }\n })\n}", "title": "" }, { "docid": "74088366143f4b6aef0646b6b1b96755", "score": "0.48678446", "text": "function partTwo() {\n let treesEncountered = [];\n\n console.log('\\n\\nPart 2:\\n');\n\n slopes.forEach((slope) => {\n treesEncountered.push(\n findNumberOfTreesEncountered(slope.right, slope.down)\n );\n });\n\n let answer = treesEncountered.reduce((acc, val) => acc * val);\n console.log(`\\n\\nAnswer: ${answer}`);\n}", "title": "" }, { "docid": "f6cb9de5fd5531614a02d4ff7ac87290", "score": "0.48664126", "text": "function createTree(top_person_id, top_person_pos_x, top_person_pos_y, person_array)\r\n{\r\n\r\n $.each(person_array, function (item, value)\r\n {\r\n if (value.ID == top_person_id) {\r\n createPerson(top_person_pos_x, top_person_pos_y, value);\r\n AddFamilyMembers(value, person_array);\r\n }\r\n\r\n });\r\n\r\n\r\n function AddFamilyMembers(person, person_array)\r\n {\r\n var motherid = \"NONE\";\r\n var fatherid = \"NONE\";\r\n\r\n if (person.Gender == \"M\")\r\n fatherid = person.ID;\r\n if (person.Gender == \"F\")\r\n motherid = person.ID;\r\n\r\n $.each(person.Relatives, function (item, value)\r\n {\r\n if (value.Type == 'WIFE') {\r\n motherid = value.ID;\r\n var wife = findPersonByID(value.ID, person_array);\r\n createPartner(wife, person.ID);\r\n }\r\n if (value.Type == 'HUSB') {\r\n fatherid = value.ID;\r\n var husb = findPersonByID(value.ID, person_array);\r\n createPartner(husb, person.ID);\r\n }\r\n });\r\n\r\n\r\n $.each(person.Relatives, function (item, value) {\r\n if (value.Type == 'CHILD') {\r\n var child = findPersonByID(value.ID, person_array);\r\n\r\n if (motherid == \"NONE\" && fatherid == \"NONE\")\r\n return true; //continue\r\n\r\n if (motherid == \"NONE\" && fatherid != \"NONE\") {\r\n createChild(child, null, fatherid);\r\n }\r\n else if (motherid != \"NONE\" && fatherid == \"NONE\") {\r\n\r\n createChild(child, motherid, null);\r\n }\r\n else {\r\n createChild(child, motherid, fatherid);\r\n }\r\n\r\n AddFamilyMembers(child, person_array);\r\n }\r\n });\r\n\r\n }\r\n\r\n \r\n\r\n}", "title": "" }, { "docid": "80954f80bb4bd2287e71d0308effab09", "score": "0.4865281", "text": "function square_expand(node){\n\tvar first = node.children[0];\n\tvar second = node.children[1];\n\tvar name = node.name;\n\tif (first === undefined && second === undefined){\n\t\treturn node;\n\t}\n\tif (first === undefined || second === undefined){\n\t\tthrow {status: \"error\", reason: \"Tree is not Binary\"};\n\t}\n\tvar first_first = first.children[0];\n\tvar first_second = first.children[1];\n\tvar second_first = second.children[0];\n\tvar second_second = second.children[1];\n\n\tif (first_first === undefined || first_second === undefined || \n\t\tsecond_first === undefined || second_second === undefined){\n\n\t\tvar expanded_first = square_expand(first);\n\t\tvar expanded_second = square_expand(second);\n\t\treturn {name: name, children:[expanded_first, expanded_second]}\n\t}\n\n\tif (name == \"-\" && first.name == \"^\" && second.name == \"^\"){\n\t\tif (is_number(first_second.name) && is_number(second_second.name)){\n\t\t\tif (parseInt(first_second.name)%2==0 && parseInt(second_second.name)%2==0){\n\t\t\t\tname = \"*\";\n\n\t\t\t\tvar new_first_first\n\t\t\t\tvar new_second_first\n\t\t\t\tvar new_first_second\n\t\t\t\tvar new_second_second\n\t\t\t\tif (first_second.name == \"0\"){\n\t\t\t\t\tnew_first_first = {name: \"1\", children: []};\n\t\t\t\t\tnew_second_first = {name: \"1\", children: []};\n\t\t\t\t} else if (first_second.name == \"2\"){\n\t\t\t\t\tnew_first_first = first_first;\n\t\t\t\t\tnew_second_first = node_clone(new_first_first);\n\t\t\t\t} else {\n\t\t\t\t\tnew_first_first = {\n\t\t\t\t\t\tname: \"^\", \n\t\t\t\t\t\tchildren: [first_first, {name: (parseInt(first_second.name)/2).toString(), children:[]}]\n\t\t\t\t\t}\n\t\t\t\t\tnew_second_first = node_clone(new_first_first)\n\t\t\t\t}\n\t\t\t\tif (second_second.name == \"0\"){\n\t\t\t\t\tnew_first_second = {name: \"1\", children: []};\n\t\t\t\t\tnew_second_second = {name: \"1\", children: []};\n\t\t\t\t} else if (second_second.name == \"2\"){\n\t\t\t\t\tnew_first_second = second_first;\n\t\t\t\t\tnew_second_second = node_clone(new_first_second);\n\t\t\t\t} else {\n\t\t\t\t\tnew_first_second = {\n\t\t\t\t\t\tname: \"^\", \n\t\t\t\t\t\tchildren: [second_first, {name: (parseInt(second_second.name)/2).toString(), children:[]}]\n\t\t\t\t\t}\n\t\t\t\t\tnew_second_second = node_clone(new_first_second)\n\t\t\t\t}\n\t\t\t\tfirst = {name: \"-\", children: [new_first_first, new_first_second]};\n\t\t\t\tsecond = {name: \"+\", children: [new_second_first, new_second_second]};\n\t\t\t}\n\t\t}\n\t}\n\tvar expanded_first = square_expand(first);\n\tvar expanded_second = square_expand(second);\n\treturn {name: name, children:[expanded_first, expanded_second]}\n}", "title": "" }, { "docid": "f6ad30f847b5dd4d34c3f3750e597657", "score": "0.48608968", "text": "function sharedDNA(ancestor, sharedDNAFromMother, sharedDNAFromFather)\n {\n if (ancestor.name == \"Pauwels van Haverbeke\")\n {\n return 1;\n }\n else\n {\n \treturn (sharedDNAFromMother + sharedDNAFromFather) / 2;\n }\n }", "title": "" }, { "docid": "b5a9bd7fcf4d6bd684a5af4717c1a43f", "score": "0.4858009", "text": "function updateTree(row) {\nconsole.log(row);\nvar x=row;\nconsole.log(x);\nif (x.value.type==\"aggregate\"){\nvar nodes_to_stay=d3.select(\"#tree\").selectAll(\"g\").filter(function(){\nreturn d3.select(this).text()==x.key\n})\nconsole.log(nodes_to_stay);\nnodes_to_stay.selectAll(\"text\").classed(\"selectedLabel\",true)\n\nd3.select(\"#tree\").selectAll(\"path\").filter(function(d){\nif (d[\"id\"].indexOf(x.key)>=0 && d.data[\"Wins\"]==1 && d.data[\"Team\"]== x.key)\n {return true}\n})\n.classed(\"selected\",true)\n\n\n}\n\nelse {\na=x.key; // name of first team//\nb=x.value.Opponent; // name of the second team //\nconsole.log(a)\nconsole.log(b)\na_b=String(a)+String(b);\nconsole.log(a_b);\nb_a=String(b)+String(a);\nconsole.log(b_a);\n\nvar nodes_to_stay=d3.select(\"#tree\").selectAll(\"g\").filter(function(){\nvar y=d3.select(this).attr('id');\nconsole.log(y);\nfor (j=0;j<2;j++){\n if (typeof(y[-j])==\"number\"){y.pop}\n}\nconsole.log(y)\nconsole.log(a_b)\nreturn y==a_b;\n})\n\nconsole.log(nodes_to_stay);\nnodes_to_stay.selectAll(\"text\").classed(\"selectedLabel\",true)\n\n\n\n}\n\n\n\n}", "title": "" }, { "docid": "80efc33d8e5b54ea882db5e751f789ec", "score": "0.48498908", "text": "function draw() {\n\n\tbackground('#ffffff');\n\n\t// Start population\n for (var i = 0; i < rabbits.length; i++) {\n\n rabbits[i].run(rabbits); // move\n rabbits[i].eat(grass); // eat\n rabbits[i].flee(wolves, 100, 2.5); // run away from wolves\n rabbits[i].flock(grass, 2.0); // chase grass\n // reproduce with random member of mating pool\n\t\tvar partner = floor(random(0, rabbits.length-1))\n potentialChild = rabbits[i].reproduce(rabbits[partner]);\n if (potentialChild != null){\n // change color of child\n col = rabbits[i].color;\n potentialChild.color = [col[0], col[1]+4, col[2]+15] // the color change\n rabbits.push(potentialChild);\n }\n // death after health causes size to decrease\n if (rabbits[i].creatureSize < 0) {\n rabbits.splice(i,1)\n }\n }\n\n for (var i = 0; i < wolves.length; i++) {\n wolves[i].run(wolves);\n wolves[i].eat(rabbits);\n wolves[i].flock(rabbits, 20.0); // chase rabbits\n\t\tvar partner = floor(random(0, wolves.length-1));\n potentialChild = wolves[i].reproduce(wolves[partner]);\n if (potentialChild != null){\n // change color of child\n col = wolves[i].color;\n potentialChild.color = [col[0]+20, col[1]+2, col[2]+1]\n wolves.push(potentialChild);\n }\n if (wolves[i].creatureSize < 0) {\n wolves.splice(i,1)\n }\n }\n\n for (var i = 0; i < grass.length; i++) {\n grass[i].render(grass);\n /*\n //reproduce sexually\n var partner = floor(random(0, grass.length-1));\n potentialChild = grass[i].reproduce(grass[partner]);\n if (potentialChild != null){\n // change color of child\n col = grass[i].color;\n potentialChild.color = [col[0], col[1]+15, col[2]]\n grass.push(potentialChild);\n }\n */\n }\n // randomly sprout more grass (asexually)\n if (random(1) < 0.075) {\n grass.push(new Creature(createVector(random(width),random(height)), worldDNA[2]));\n }\n\n\t// stats in text form to canvas\n\tfill(0);\n\ttextSize(18);\n\tvar wolfPop = wolves.length;\n\tvar rabbitPop = rabbits.length;\n\tvar grassPop = grass.length;\n\t//display to HTML page\n\ttext(\"Wolf Population: \" + wolfPop + \"\\nRabbit Population: \" + rabbitPop + \"\\nGrass Population: \" + grassPop, 20, 40)\n\n\t// when prey/predator population dies, restart world\n /*\n //this adds the initial count of EACH creature to the current world\n if (rabbits.length == 0 || wolves.length == 0) {\n\t\tsetup();\n\t}\n */\n //this only adds the initial count of the DECEASED creature to the current world\n if (rabbits.length == 0) {\n for (var i = 0; i < initPop*3; i++) {\n position2 = createVector(random(width),random(height))\n rabbits.push(new Creature(position2, worldDNA[1]));\n }\n\t} else if (wolves.length == 0) {\n for (var i = 0; i < initPop; i++) {\n position1 = createVector(random(width),random(height))\n wolves.push(new Creature(position1, worldDNA[0]));\n }\n }\n \n}", "title": "" }, { "docid": "fc167b324b8b487b71e3ad64afd8e109", "score": "0.48466012", "text": "function moreTrees() {\n var m = Math.floor(Math.random() * 3) + 1;\n if(forester[0].active){\n prestigepoints+=0.2;\n updateText();\n }\n \n if (m === 1) {\n trees++;\n } else if (m === 2) {\n money++;\n } else if(m===3){\n trunks++;\n } \n}", "title": "" }, { "docid": "51438521ed9b91f976ca2f6dce0de7b7", "score": "0.48415437", "text": "checkNeighbor(){\n this.bombnearby += this.TopLeft(IsBomb);\n this.bombnearby += this.TopMiddle(IsBomb);\n this.bombnearby += this.TopRight(IsBomb);\n this.bombnearby += this.Left(IsBomb);\n this.bombnearby += this.Right(IsBomb);\n this.bombnearby += this.BottomLeft(IsBomb);\n this.bombnearby += this.BottomMiddle(IsBomb);\n this.bombnearby += this.BottomRight(IsBomb);\n }", "title": "" }, { "docid": "c6aeee2f43a16a88768e8942a9320b08", "score": "0.4840718", "text": "function bisect(orientation, x1, x2, y1, y2) {\n //Can't bisect further\n if (abs(x1 - x2) <= 1 || abs(y1 - y2) <= 1) {\n return;\n }\n\n //Bisect horizontally\n if (orientation) {\n //Finds an odd coordinate to bisect between\n var bisectPt = floor(random(x1 + 1, x2) / 2) * 2;\n\n //Creates a wall at bisection point\n for (var j = y1; j < y2 + 1; j++) {\n grid[bisectPt][j].wall = true;\n }\n\n //Creates an even coordinate entrance on the wall\n var entrance = floor(random(y1, y2 + 1) / 2) * 2 + 1;\n grid[bisectPt][entrance].wall = false;\n\n //Recurse on both sides\n bisect(!orientation, x1, bisectPt - 1, y1, y2);\n bisect(!orientation, bisectPt + 1, x2, y1 , y2);\n\n } else {\n //Finds an odd coordinate to bisect between\n var bisectPt = floor(random(y1 + 1, y2) / 2) * 2;\n\n //Creates a wall at bisection point\n for (var i = x1; i < x2 + 1; i++) {\n grid[i][bisectPt].wall = true;\n }\n\n //Creates an even coordinate entrance on the wall\n var entrance = floor(random(x1, x2 + 1) / 2) * 2 + 1;\n grid[entrance][bisectPt].wall = false;\n\n //Recurse on both sides\n bisect(!orientation, x1, x2, y1, bisectPt - 1);\n bisect(!orientation, x1, x2, bisectPt + 1 , y2);\n }\n}", "title": "" }, { "docid": "0e23322fc22edcb4c83a367873bcf682", "score": "0.48360503", "text": "static combineTree(TREE0, TREE1)\n {\n // Local variable dictionary\n let tree = null; // The combine tree\n let rootWeight = TREE0.#rootNode.weight() + TREE1.#rootNode.weight();\n\n // Combine the tree\n if (TREE0.compareTo(TREE1) === -1 || TREE0.compareTo(TREE1) === 0)\n {\n tree = new HuffmanTree(null, rootWeight, TREE0.#rootNode, TREE1.#rootNode);\n }\n else if (TREE0.compareTo(TREE1) === 1)\n {\n tree = new HuffmanTree(null, rootWeight, TREE1.#rootNode, TREE0.#rootNode);\n }\n\n // Return the combined tree\n return tree;\n }", "title": "" }, { "docid": "fc7e2f5211fca07134aa2068def796fd", "score": "0.48323506", "text": "function Sleigh() {}", "title": "" }, { "docid": "edd32e8c02f6372726b3e1b2853a13c7", "score": "0.48271498", "text": "function circleBack(tree) {\n // creates new tree on the right when one exits on the left\n tree.img = random(treeTypes)\n tree.w = tree.img.width\n tree.h = tree.img.height\n tree.onFire = false\n tree.x = width + tree.w/2\n tree.y = random(height)\n tree.watered = false\n}", "title": "" }, { "docid": "555de502aa897a8d3dec3de36d3108f8", "score": "0.48269364", "text": "union(p, q) {\n const pRoot = this._findRoot(p);\n const qRoot = this._findRoot(q);\n\n console.log(this._sizes);\n\n if (pRoot === qRoot) return;\n\n // here we put smaller trees under larger ones to minimize\n // the average size of trees so that the find operation\n // is as short as possible.\n if (this._sizes[pRoot] < this._sizes[qRoot]) {\n this._map[pRoot] = qRoot;\n this._sizes[qRoot] += this._sizes[pRoot];\n } else {\n this._map[qRoot] = pRoot;\n this._sizes[pRoot] += this._sizes[qRoot];\n }\n }", "title": "" }, { "docid": "671b0c1453fc378f552287b17aeea2a4", "score": "0.48263144", "text": "function equaliseDIVs() {\n if ( $(\"#proteinview\").height() > $(\"#splomContainer\").height() ) {\n d3.select(\"#splomContainer\").style(\"height\", $(\"#proteinview\").height() + \"px\");\n } else {\n d3.select(\"#proteinview\").style(\"height\", $(\"#splomContainer\").height() + \"px\");\n }\n}", "title": "" }, { "docid": "4011ec658f8433d971796465231b3654", "score": "0.4825459", "text": "isBalanced() {\n // if min height and max height differ by only one, tree is balanced\n // minHeight >= maxHeight - 1; same as maxHeight - minHeight <= 1\n return (this.findMinHeight() >= this.findMaxHeight() - 1);\n }", "title": "" }, { "docid": "8b531a5efa6eee40a19cf9863fa8821f", "score": "0.48205212", "text": "function balanced(node) {\n let rheight = 0\n let lheight = 0\n if (node == null) {\n return true\n } else {\n if (node.right) {\n rheight = height(node.right)\n }\n if (node.left) {\n lheight = height(node.left)\n }\n if (Math.abs(rheight - lheight) <= 2) {\n return true\n } else return false\n }\n }", "title": "" }, { "docid": "68748227c94a827029e3de7acc00f558", "score": "0.480688", "text": "updateGameArea() {\n\t\tthis.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n\t\t// Determine which node (if any) was clicked on.\n\t\tif (this.clicks.length > 0) {\n\t\t\tlet clickPos = this.clicks.shift(); // yes I know this is O(n); n is likely very small.\n\t\t\tlet minNode = null;\n\t\t\tlet min = Infinity;\n\t\t\t// TODO: Do something better than a linear search of all nodes.\n\t\t\tthis.nodes.forEach((node) => {\n\t\t\t\tlet d1 = node.x - clickPos[0];\n\t\t\t\tlet d2 = node.y - clickPos[1];\n\t\t\t\tlet dist = Math.sqrt(d1 * d1 + d2 * d2);\n\t\t\t\tif (dist < min) {\n\t\t\t\t\tminNode = node;\n\t\t\t\t\tmin = dist;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (minNode !== null) {\n\t\t\t\tminNode.makeHot();\n\t\t\t}\n\t\t}\n\t\tthis.nodes.forEach((node) =>\n\t\t\tnode.update()\n\t\t);\n\t\tthis.edges.forEach((edge) =>\n\t\t\tedge.draw(this.context, this.maxWidth)\n\t\t);\n\t\t// Step 1 of \"two-phase\" infect\n\t\tthis.nodes.forEach((node) =>\n\t\t\tnode.heatNeighbors()\n\t\t);\n\t\t// St2p 2 of \"two-phase\" infect\n\t\tthis.nodes.forEach((node) => {\n\t\t\tif (node.tagged) {\n\t\t\t\tnode.tagged = false;\n\t\t\t\tnode.makeHot();\n\t\t\t}\n\t\t});\n\t\tthis.nodes.forEach((node) =>\n\t\t\tnode.draw(this.context)\n\t\t);\n\t}", "title": "" }, { "docid": "27235e15176f984f905777e60a43c73d", "score": "0.48035422", "text": "function fixUp(h) {\n if (isRed(h[RIGHT])) {\n h = tree_rotate(LEFT, h);\n }\n if (isRed(h[LEFT]) && isRed(h[LEFT][LEFT])) {\n h = tree_rotate(RIGHT, h);\n }\n // Split 4-nodes.\n if (isRed(h[LEFT]) && isRed(h[RIGHT])) {\n flipColors(h);\n }\n return h;\n}", "title": "" }, { "docid": "1df03533f26f12f7d28591c8cd3de832", "score": "0.4803246", "text": "function secondWalk(v) {\n\t\t\tvar adj = 1;\n\t\t\tif (compactify && v._._compact /*&& v._._compact.isLeaf*/) {\n\t\t\t\tadj = 2;\n\n\t\t\t\t//if (v._._compact.side == \"left\") {\n\t\t\t\t//\tadj = -.25;\n\t\t\t\t//} else if (v._._compact.side == \"right\") {\n\t\t\t\t//\tadj = .25;\n\t\t\t\t//}\n\t\t\t}\n\n\n\t\t\tv._.x = v.z + v.parent.m;\n\t\t\tv.m += v.parent.m ;\n\t\t}", "title": "" }, { "docid": "d474071ca9d6af36020aea4ba9669128", "score": "0.47998238", "text": "function promote_growth(ctx, gc) {\n if (is_flagged(gc)) {\n // Don't accidentally reveal a flagged spot\n return;\n }\n // Reveal and seed growth\n reveal_cell(ctx, gc);\n // Queue for growth for force further growth\n let surroundings = fetch_neighborhood(gc);\n if (surroundings == undefined || surroundings[4][\"growth\"] == 0) {\n GROWTH_QUEUE.push([MAX_AUTO_GROWTH, gc]); // queue for future growth\n } else {\n grow_at(gc); // force growth\n }\n}", "title": "" }, { "docid": "35d3821f7f18d7bd35e22db8d2ed4cba", "score": "0.4795488", "text": "function areaCalc() {\n\t\t\t\t//var random = new Radnom(); // create instance of random library\n\t\t\t\t// method to calculate dor sizes (and place?) according to equal area for both groups\n\t\t\t\tvar rand = getRandomArbitrary(-35,35)/100 +1;\n\t\t\t\t// the lesser number area = basesize * number of dots.\n\t\t\t\tvar lessSum = 0;\n\t\t\t\tfor (i=0;i<lessDot-1;i++) {\n\t\t\t\t\trand = getRandomArbitrary(-35,35)/100 + 1; \n\t\t\t\t\tvar x = baseSize * rand;\n\t\t\t\t\tlessDotSize[i]=x;\n\t\t\t\t\tlessSum += x;\n\t\t\t\t\t}\n\t\t\t\tlessDotSize[lessDot-1] = (baseSize * lessDot) - lessSum; \n\t\t\t\t// larger no. area = less area / number of dots (which will become the new basesize)\n\t\t\t\t// in area condition the base size of dot is the average size of the lessdot\n\t\t\t\tvar moreSum = 0;\n\t\t\t\tvar moreArea = baseSize * lessDot;\n\t\t\t\tfor (i=0;i<moreDot-1;i++) {\n\t\t\t\t\trand = getRandomArbitrary(-35,35)/100 +1;\n\t\t\t\t\tvar x = (moreArea / moreDot) * rand;\n\t\t\t\t\tmoreDotSize[i] = x;\n\t\t\t\t\tmoreSum+=x; \n\t\t\t\t}\n\t\t\t\tmoreDotSize[moreDot-1] = moreArea - moreSum;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "5af8bfe30ebef26af89c736fc757f4e3", "score": "0.47924322", "text": "function checkTree(tree){\n\n\t//if odd number of probabilities the tree is not bidirected\n\tif(tree.edgeProbs.length%2 ===1){\n\t\treturn \"The edges must be bidirected\";\n\t}\n\n\t//if any pair of nodes a b has a probability\n\t//from a to b it must have a probability from b to a\n\t//if not return false\n\tfor(var i = 0; i < tree.edgeProbs.length; i++){\n\n\t\t//the starting and ending nodes\n\t\t//whose reverse we are looking for\n\t\tvar startNode = tree.edgeProbs[i][0];\n\t\tvar endNode = tree.edgeProbs[i][1];\n\t\tvar pairExists = false;\n\n\t\t//loop through all the probabilities and find\n\t\t//the set that goes the other way\n\t\tfor(var j = 0; j < tree.edgeProbs.length; j++){\n\t\t\tvar otherStart = tree.edgeProbs[j][0];\n\t\t\tvar otherEnd = tree.edgeProbs[j][1];\n\n\t\t\t//if we find the other direction the pair exists\n\t\t\tif(startNode === otherEnd && endNode === otherStart){\n\t\t\t\tpairExists = true;\n\t\t\t}\n\t\t}\n\n\t\t//if the pair does not exist the tree is not valid\n\t\tif(!pairExists){\n\t\t\treturn \"The edges must be bidirected\";\n\t\t}\n\t}\n\n\t//make sure numNodes is correct\n\tif(tree.numNodes != tree.nodeList.length){\n\t\treturn \"numNodes must match the number of nodes in the nodeLabels array\";\n\t}\n\n\t//make sure every node has at least 1 neighbor\n\tfor(var n = 0; n<tree.numNodes; n++){\n\t\tif(tree.nodeList[n].neighbors.length===0){\n\t\t\treturn \"Every node must have at least 1 neighbor\";\n\t\t}\n\t}\n\n\t//make sure all probabilities are between 0 and 1\n\tfor(var m = 0; m<tree.edgeProbs.length; m++){\n\t\tif(tree.edgeProbs[m][2]>1 || tree.edgeProbs[m][2]<0){\n\t\t\t\treturn \"The edge probabilities must be between 0 and 1\";\n\t\t}\n\t}\n\n\t//make sure all nodes have coordinates\n\tfor(var f = 0; f < tree.nodeList.length; f++){\n\t\tif(tree.nodeList[f].coordinates === null ||\n\t\t\ttree.nodeList[f].coordinates === undefined){\n\t\t\treturn \"All nodes must have coordinates listed\";\n\t\t}\n\t}\n\n\t//check for loops\n\t//breadth first search should never see\n\t//the same node twice\n\tvar visitedNodes = [];\n\n\t//queue holds an array of number pairs\n\t//the first number is the node id\n\t//the second is the id of the parent\n\tvar queue = [ [tree.nodeList[0].nodeId, -2] ];\n\twhile(visitedNodes.length < tree.nodeList.length){\n\n\t\t//get the first node in the queue\n\t\tvar curNodeInfo = queue.pop();\n\t\tvar curNode = curNodeInfo[0];\n\t\tvar curNodeParent = curNodeInfo[1];\n\n\t\t//mark this node as visited\n\t\tvisitedNodes.push(curNode);\n\n\t\t//for all the neighbors of this node\n\t\t//check if any neighbors who are not the parent\n\t\t//of this node have already been visited\n\t\t//if a neighbor other than the parent has been visited\n\t\t//there is a cycle\n\t\tfor(var l = 0; l < tree.getNodeById(curNode).neighbors.length; l++){\n\t\t\t\n\t\t\t//get a neighbor of the node\n\t\t\tvar curNeighbor = tree.getNodeIdByLabel(tree.getNodeById(curNode).neighbors[l]);\n\n\t\t\t//if the neighbor is not the parent and has been visited\n\t\t\t//the tree is not valid\n\t\t\tif(curNeighbor !== curNodeParent){\n\t\t\t\tfor(var p = 0; p < visitedNodes.length; p++){\n\t\t\t\t\tif(curNeighbor === visitedNodes[p]){\n\t\t\t\t\t\treturn \"There cannot be any cycles in the tree\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//if the node has not been visited add the neighbor\n\t\t\t\t//to the queue\n\t\t\t\tqueue.push([curNeighbor, curNode]);\n\t\t\t}\n\t\t}\n\t}\n\n\t//if no cycles or 1 way edges are found\n\t//the tree is valid\n\treturn \"true\";\n}", "title": "" }, { "docid": "ec1f41605b08d1e7df719d17436a8ca7", "score": "0.4782817", "text": "static goBroom(nodesToClean, broom) {\n _Broom.node = broom || _Broom.node || document.querySelector('.floor__broom');\n\n const examineFloor = () => {\n _Broom.interval = setTimeout(function () {\n //timeout will automatically expire if not recreated YAY!\n const dustBunnies = Trash.#getDustBunnies(nodesToClean);\n if (!dustBunnies.length) {\n //flip\n _Broom.animationP.then(() => {\n const animation = anime.timeline({\n targets : _Broom.node,\n direction: 'alternate',\n loop: 1\n }).add({\n rotateY : 180,\n duration: 500\n });\n _Broom.animationP = animation.finished;\n examineFloor();\n });\n } else {\n //1. look at the XY location of the nodesToClean\n\n _Broom.animationP.then(() => {\n Trash.forceBroom(_Broom.node, dustBunnies);\n examineFloor();\n });\n } // if\n\n }, 20000); //interval\n } // fn\n examineFloor();\n }", "title": "" }, { "docid": "07c06766a2440539817ed45443e125af", "score": "0.47809187", "text": "function convertBranch(branch, tree) {\n var b = { }\n if(tree[branch]) {\n b = tree[branch]; \n delete(tree[branch]);\n } else {\n b.children = [convertBranch(branch*2, tree), convertBranch(branch*2+1, tree)]\n var middleChild = b.children[0];\n while(middleChild.children) {\n middleChild = middleChild.children[1];\n }\n// b.value = middleChild.value;\n b.size = b.children[0].size + b.children[1].size\n }\n return(b);\n}", "title": "" }, { "docid": "361ddf7104b14337053bafe8ecf61581", "score": "0.47738093", "text": "function astar() {\n\n //1. Initialize the open list\n var openList = [];\n\n //2. Initialize the closed list\n //put the starting node on the open \n //list (you can leave its f at zero)\n var closedList = [];\n startpoint.f = 0;\n startpoint.g = 0;\n openList.push(startpoint); \n //3. while the open list is not empty\n\n var branch = setInterval(searchTree, 50);\n \n function searchTree()\n {\n if (openList.length == 0)\n {\n clearInterval(branch);\n astar2();\n return;\n }\n //a) find the node with the least f on \n //the open list, call it \"min\"\n var min = openList[0];\n for (var i = 0; i < openList.length; i ++)\n {\n if (openList[i].h < min.h)\n {\n min = openList[i];\n }\n }\n\n //div for coloring gradient\n var div = grid[min.col][min.row];\n\n //b) pop min off the open list\n openList.splice(openList.indexOf(min), 1);\n\n //c) generate min's 8 successors\n var paths = min.surrounding();\n if (paths.indexOf(startpoint) != -1)\n {\n paths.splice(paths.indexOf(startpoint), 1);\n }\n for (var i = 0; i < paths.length; i++)\n {\n //and set their parents to min\n var successor = paths[i];\n\n // i) if successor is the goal, stop search\n if (successor.type == \"end\")\n {\n if (div.style.backgroundColor == \"white\")\n {\n div.style.backgroundColor = getColorCode(min.counter + 1, startpoint.counter);\n }\n successor.parent = min;\n clearInterval(branch);\n astar2();\n return;\n }\n\n // successor.g = q.g + distance between successor and q\n var dist = min.g + 1;\n\n // successor.h = distance from goal to successor\n // For the heuristic value we will be using Manhattan distance rather than Euclidean or Diagonal\n var heur = Math.abs(successor.col - endpoint.col) + Math.abs(successor.row - endpoint.row);\n\n //calculate potential f cost for successor\n var totalCost = dist + heur;\n\n //if a node with the same position as \n //successor is in the OPEN list which has a \n //lower f than successor, skip this successor\n var inOpen = false;\n for (var j = 0; j < openList.length; j++)\n {\n if (openList.length != 0 && successor.col == openList[j].col && successor.row == openList[j].row && totalCost > openList[j].f)\n {\n inOpen = true;\n }\n }\n\n //if a node with the same position as \n //successor is in the CLOSED list which has\n //a lower f than successor, skip this successor\n var inClosed = false;\n for (var k = closedList.length - 1; k >= 0; k--)\n {\n if (closedList.length != 0 && successor.col == closedList[k].col && successor.row == closedList[k].row && totalCost > closedList[k].f)\n {\n inClosed = true;\n }\n }\n if (!inOpen && !inClosed)\n {\n successor.parent = min;\n successor.g = dist;\n successor.h = heur;\n successor.f = totalCost;\n openList.push(successor);\n\n }\n }\n closedList.push(min)\n if (div.style.backgroundColor == \"white\")\n {\n div.style.backgroundColor = getColorCode(min.counter + 1, startpoint.counter);\n }\n div.onmouseover = null;\n div.onmouseout = null;\n }\n\n function astar2()\n {\n var cur = endpoint;\n var path = [];\n while (cur.type != \"start\")\n {\n path.push(cur);\n cur = cur.parent;\n }\n\n var iterator = path.length - 1;\n var displayAlgo = setInterval(displayAstar, 150);\n function displayAstar()\n {\n if (iterator < 0)\n {\n clearInterval(displayAlgo);\n createConsoleMsg(\"Visualization completed successfully\");\n }\n else\n {\n path[iterator].markVisited();\n iterator --;\n }\n }\n }\n }", "title": "" }, { "docid": "f9b749faccd27947e473b335effd1ae4", "score": "0.4772073", "text": "function visit_balloon( bal_id, level )\n{\n //1 marks a node as in the fringe\n //2 marks a node as in the tree\n //find balloon by given id\n bal = get_balloon_by_id(bal_id);\n\n if (bal.level != level)\n {\n //function will not remove a node from the tree or fringe, only allows increases\n bal.visit = max(bal.visit, level);\n\n //check if current balloon is already at visit level of 2, ie first time being reached by\n if ( level == 2)\n {\n //recalculate the matrix with the new shortest distances now that a new nodes been reached\n generate_shortest_path_matrix();\n }\n }\n\n if ( level == 2 )\n {\n //add all children to the fringe when added to the tree\n bal.children.forEach((element, index, array) => {\n visit_balloon(element, 1);\n });\n }\n\n \n}", "title": "" }, { "docid": "fa5ba14abf6c3c72855334ea7feebc23", "score": "0.4771814", "text": "function splitLeaf (newItem) {\n \n // Make four new leaf nodes (quads), that become \"leaves\" of the current quad in the quad tree\n leaves = [\n quad(x1, y1, halfWidth, halfHeight),\n quad(halfWidth, y1, x2, halfHeight),\n quad(x1, halfHeight, halfWidth, y2),\n quad(halfWidth, halfHeight, x2, y2)\n ];\n\n console.log('new leaves:', leaves, items);\n\n // Place each existing item in the best leaf\n // =========================================\n\n // Step through each of the four items in the current leaf...\n items.forEach(function(existingItem){\n\n // Step through each of the sub-leaves/sub-quads of this leaf/quad\n leaves.forEach(function(leaf, i){\n\n // If bounds of new leaf/quad: cover new item... add item to new leaf/quad\n if (leaf.covers(existingItem)){\n leaf.add(existingItem);\n // items.length=i;\n }\n\n // leaf.covers(newItem) && leaf.add(newItem);\n \n });\n\n });\n\n items=[];\n\n leaves.forEach(function(leaf, i){\n\n leaf.covers(newItem) && leaf.add(newItem);\n \n });\n\n }", "title": "" }, { "docid": "8560dfbb339e80f94e674e68e72b19a2", "score": "0.4770744", "text": "getHeightAvg(trees, treeNames) {\n let totalHeight = 0;\n for(let i=0; i<treeNames.length; i++) {\n totalHeight += parseInt(trees[treeNames[i]]['height']);\n }\n let avgHeight = totalHeight/treeNames.length;\n return avgHeight;\n }", "title": "" }, { "docid": "fede726fc922e33b99728f93506b9b7e", "score": "0.4770686", "text": "function drawTree(tree){\n\n\t//get the canvas\n\tvar c=document.getElementById(\"myCanvas\");\n\tvar ctx=c.getContext(\"2d\");\n\n\t//draw all the edges\n\tfor(var j = 0; j < tree.edgeProbs.length; j++){\n\n\t\t//get the nodes that belong to the edge\n\t\tvar startNode = tree.getNodeByLabel(tree.edgeProbs[j][0]);\n\t\tvar startNodeId = startNode.nodeId;\n\t\tvar endNode = tree.getNodeByLabel(tree.edgeProbs[j][1]);\n\t\tvar endNodeId = endNode.nodeId;\n\n\t\t//determine how the shift the edge so that\n\t\t//both directed edges are seen\n\t\tvar shift = startNodeId > endNodeId ? 10 : -10;\n\n\t\t//draw a path from the starting node to the ending node\n\t\tctx.beginPath();\n\t\tctx.moveTo(startNode.coordinates[0]*75 + shift, startNode.coordinates[1]*75);\n\t\tctx.lineTo(endNode.coordinates[0]*75 + shift, endNode.coordinates[1]*75);\n\t\tctx.stroke();\n\n\t\t//find the distance between the nodes in the x and y directions\n\t\tvar distX = startNode.coordinates[0]*75 - endNode.coordinates[0]*75;\n\t\tvar distY = startNode.coordinates[1]*75 - endNode.coordinates[1]*75;\n\n\t\tvar shift2 = startNode.coordinates[0] > endNode.coordinates[0] ? 12 : -12;\n\n\t\t//write the probability next to the edge\n\t\tctx.fillStyle = \"#000000\";\n\t\tctx.font = \"20px Georgia\";\n\t\tctx.fillText(\"\" + tree.edgeProbs[j][2], \n\t\t\tstartNode.coordinates[0]*75 - distX/2 + shift*2 + shift2, \n\t\t\tstartNode.coordinates[1]*75 - distY/2 + shift*2);\n\t}\n\n\t//draw the nodes on the screen\n\tfor(var i = 0; i < tree.numNodes; i++){\n\n\t\tctx.fillStyle = \"#7FFF00\";\n\n\t\t//draw a circle for the node based on the coordinates given\n\t\tctx.beginPath();\n\t\tctx.arc(75*tree.nodeList[i].coordinates[0],\n\t\t\t75*tree.nodeList[i].coordinates[1],30,0,2*Math.PI);\n\t\tctx.fill();\n\n\t\t//write the value of the node in the center\n\t\tctx.fillStyle = \"#000000\";\n\t\tctx.font = \"20px Georgia\";\n\t\tctx.fillText(\"\" + tree.nodeList[i].val, \n\t\t\t75*tree.nodeList[i].coordinates[0]-5, \n\t\t\t75*tree.nodeList[i].coordinates[1]);\n\t}\n\n}", "title": "" }, { "docid": "1454ab7dba2f7b7fb6cc8da05ff28e0d", "score": "0.47697625", "text": "function identifyTree(){\n if (totalProblems<=treeGrow[0]){ treeId=1;}\n else if (totalProblems>treeGrow[0] && totalProblems<=treeGrow[1] ){treeId=2;}\n else if (totalProblems>treeGrow[1] && totalProblems<=treeGrow[2] ){treeId=3;}\n else if (totalProblems>treeGrow[2] && totalProblems<=treeGrow[3] ){treeId=4;}\n else if (totalProblems>treeGrow[3] && totalProblems<=treeGrow[4] ){treeId=5;}\n else if (totalProblems>treeGrow[4] ){treeId=6;}\n\n}", "title": "" }, { "docid": "218eb032cb92c6c0ec4f3e1f9860969d", "score": "0.47665557", "text": "function applyOperation(tempState) {\n if(tempState.visited === true) {\n killedState.push(state[state.length - 1]);\n state.splice(state.length - 1, 1);\n }else {\n tempState.visited = true;\n boatPosition = tempState.value[2];\n // If Boat is at the left bank\n if(boatPosition === 1) { \n // console.log(\"boat is going from Left to Right\"); \n \n // 2 Missionaries\n if(tempState.value[0] >= 2) {\n addState(tempState, [tempState.value[0] - 2, tempState.value[1] - 0, 0]);\n } \n // 1 Missionary\n if(tempState.value[0] >= 1) {\n addState(tempState, [tempState.value[0] - 1, tempState.value[1] - 0, 0]);\n } \n // 2 Cannibals\n if(tempState.value[1] >= 2) {\n addState(tempState, [tempState.value[0] - 0, tempState.value[1] - 2, 0]);\n } \n // 1 Missionary and 1 Cannibal\n if(tempState.value[0] >= 1 && tempState.value[1] >= 1) {\n addState(tempState, [tempState.value[0] - 1, tempState.value[1] - 1, 0]);\n }\n // 1 Cannibal\n if(tempState.value[1] >= 1) {\n addState(tempState, [tempState.value[0] - 0, tempState.value[1] - 1, 0]);\n } \n } else if(boatPosition === 0) {\n // If Boat is at the right bank.\n // 1 Missionary and 1 Cannibal\n if(initialState[0] - tempState.value[0] > 0) {\n addState(tempState, [tempState.value[0] + 1, tempState.value[1] + 0, 1]);\n }\n // 1 Cannibal\n if(initialState[1] - tempState.value[1] > 0) {\n addState(tempState, [tempState.value[0] + 0, tempState.value[1] + 1, 1]);\n }\n // 2 Missionary\n if(initialState[0] - tempState.value[0] > 2) {\n addState(tempState, [tempState.value[0] + 2, tempState.value[1] + 0, 1]);\n }\n // 2 Cannibals\n if(initialState[1] - tempState.value[1] > 2) {\n addState(tempState, [tempState.value[0] + 0, tempState.value[1] + 2, 1]);\n }\n // 1 Missionary and 1 Cannibal\n if((initialState[0] - tempState.value[0] > 0) && (initialState[1] - tempState.value[1] > 0)) {\n addState(tempState, [tempState.value[0] + 1, tempState.value[1] + 1, 1]);\n } \n }\n }\n}", "title": "" }, { "docid": "b0eb0ab2d9bd9c78db742e73f07b05b7", "score": "0.47656554", "text": "function partTwo() {\n if (isParent(puzzleTree, 'SAN', 'YOU')) {\n return depth(tree, 'YOU','SAN')\n } else if (isParent(puzzleTree, 'YOU', 'SAN')) {\n return depth(tree, 'SAN','YOU')\n }\n\n const ancestor = findCommonAncestor(puzzleTree, 'SAN', 'YOU')\n const d1 = depth(puzzleTree, 'SAN', ancestor)\n const d2 = depth(puzzleTree, 'YOU', ancestor)\n console.log(`Part Two Answer = ${d2 + d1 - 2}`)\n}", "title": "" } ]
6d3bf918cdd742beed86a09a7bde9264
Add unit to numeric values.
[ { "docid": "b2c90ee67cf83d3b9f1ea1cf4b81682c", "score": "0.0", "text": "function defaultUnit() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var camelCasedOptions = addCamelCasedVersion(options);\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n for (var prop in style) {\n style[prop] = iterate(prop, style[prop], camelCasedOptions);\n }\n\n return style;\n }\n\n function onChangeValue(value, prop) {\n return iterate(prop, value, camelCasedOptions);\n }\n\n return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue };\n}", "title": "" } ]
[ { "docid": "4ecd8b10eb0d8abfc00376841a6de043", "score": "0.683009", "text": "function YArithmeticSensor_set_unit(newval)\n { var rest_val;\n rest_val = newval;\n return this._setAttr('unit',rest_val);\n }", "title": "" }, { "docid": "1aada9c2010fdbff9006dea08b54344f", "score": "0.6671787", "text": "addUnit(x, y, unit) {\n this._slots.addUnit(unit, this._svg.layers.units)\n }", "title": "" }, { "docid": "db93b5b9e0ff1d720d450f74a45fdc70", "score": "0.6637004", "text": "function unit(i, units) {\r\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n return i;\r\n } else {\r\n return \"\" + i + units;\r\n }\r\n }", "title": "" }, { "docid": "db93b5b9e0ff1d720d450f74a45fdc70", "score": "0.6637004", "text": "function unit(i, units) {\r\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n return i;\r\n } else {\r\n return \"\" + i + units;\r\n }\r\n }", "title": "" }, { "docid": "db93b5b9e0ff1d720d450f74a45fdc70", "score": "0.6637004", "text": "function unit(i, units) {\r\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n return i;\r\n } else {\r\n return \"\" + i + units;\r\n }\r\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.6577886", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "0dda8e4b7b36e627789552e136c9d12d", "score": "0.6471545", "text": "function setUpCustomUnits() {\n for (var i = 0 ; i < Converter.customUnits.length ; i++) {\n math.createUnit(\n Converter.customUnits[i].name,\n Converter.customUnits[i].factor\n )\n };\n}", "title": "" }, { "docid": "e673cfcc8f89c324f2cda418e5871847", "score": "0.6428003", "text": "function YMultiCellWeighScale_set_unit(newval)\n { var rest_val;\n rest_val = newval;\n return this._setAttr('unit',rest_val);\n }", "title": "" }, { "docid": "414876baf6b171cea227489f37bc3a93", "score": "0.6344688", "text": "function makeUnitVal(v) {\n if (typeof v == \"string\")\n return UnitValue(stripUnits(v), v.replace(/[0-9.-]+/g, \"\"));\n if (typeof v == \"number\")\n return UnitValue(v, DOMunitToCSS[app.preferences.rulerUnits]);\n}", "title": "" }, { "docid": "1cccedcdb2350b8ea0cc1250a7daa416", "score": "0.630095", "text": "function makeUnitVal(v) {\n if (typeof v == 'string')\n return UnitValue(stripUnits(v), v.replace(/[0-9.-]+/g, ''));\n if (typeof v == 'number')\n return UnitValue(v, DOMunitToCSS[app.preferences.rulerUnits]);\n}", "title": "" }, { "docid": "9364f3a8bbae2baecd1f72b007fc6321", "score": "0.6298258", "text": "function YTemperature_set_unit(newval)\n { var rest_val;\n rest_val = newval;\n return this._setAttr('unit',rest_val);\n }", "title": "" }, { "docid": "659f30d6234003d7d77c2ada9aa391bd", "score": "0.627604", "text": "set unit(u) {\n this._unit = u;\n this.emit(\"unit\", u);\n }", "title": "" }, { "docid": "a6956422b84a6630e89d04878d0ddfe2", "score": "0.6264935", "text": "function setUnit(unit, input) {\n CUSTOM_LENGTH.from(unit, input);\n return {\n toFeet: CUSTOM_LENGTH.to(FEET),\n toMeters: CUSTOM_LENGTH.to(METERS),\n toInches: CUSTOM_LENGTH.to(INCHES)\n };\n }", "title": "" }, { "docid": "5ed2bbf4a496ed20de1591be13f66b98", "score": "0.62461436", "text": "function replaceUnit(exp) {\n switch (exp) {\n case 'minute':\n case 'min':\n case 'hour':\n case 'h':\n case 'day':\n case 'd':\n return \"s\";\n case 'degree':\n case '°':\n case \"'\":\n case 'second':\n case '\"':\n return \"rad\";\n case 'hectare':\n case 'ha':\n return \"m\" + \"2\".sup();\n case 'litre':\n case 'l':\n return \"m\" + \"3\".sup();\n case 'tonne':\n case 't':\n return \"kg\";\n default:\n return exp;\n }\n}", "title": "" }, { "docid": "32c0ef4e6f8ae0a9343286a0aeab4b2e", "score": "0.6199664", "text": "function YGenericSensor_set_unit(newval)\n { var rest_val;\n rest_val = newval;\n return this._setAttr('unit',rest_val);\n }", "title": "" }, { "docid": "62f09f1febebeb18475e9925cfc59259", "score": "0.61918557", "text": "function units(num) {\n\treturn num*CELL_SIZE + UNIT_NAME;\n}", "title": "" }, { "docid": "a489da61c49109e86aadc043305005d0", "score": "0.6186236", "text": "function unit(value) {\n return [value];\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.6071476", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.6071476", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.6071476", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.6071476", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.6071476", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "ca877e51c8e5ee746092a66dfdbf5cd6", "score": "0.60694873", "text": "function metricUnits(){\n\tvar element = document.getElementsByClassName(\"input-group-addon\");\n\tif (element[1].textContent.includes(\"ft\")){\n\t\tk.value = (k.value/3.28084).toPrecision(3);\n\t\tbedrock.value = (bedrock.value/3.28084).toPrecision(3);\n\t\tiwte.value = (iwte.value/3.28084).toPrecision(3);\n\t\tq.value = (q.value/Math.pow(3.28084,3)).toPrecision(3);\n\t\tdwte.value = (dwte.value/3.28084).toPrecision(3);\n\t\tslurryK.value = (slurryK.value/3.28084).toPrecision(3);\n\t\tslurryT.value = (slurryT.value/3.28084).toPrecision(3);\n\t}\n\tfor (var i=0; i < element.length; i++){\n\t\tif (element[i].textContent.includes(\"ft\")){\n\t\t\telement[i].textContent=element[i].textContent.replace(\"ft\",\"m\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bbc71cf10af6e25e81b6f045b885006f", "score": "0.5970917", "text": "function ensureUnit(val) {\n return val + (Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"l\" /* isNumber */])(val) ? 'px' : '');\n}", "title": "" }, { "docid": "67b4689f3538cd162aa3c0451fd9e969", "score": "0.59696513", "text": "function convertUnits(value, curUnits, newUnits) {\n return UnitValue(value, curUnits).as(newUnits);\n}", "title": "" }, { "docid": "d87ae185cfa32c6574e698337dfe4848", "score": "0.59365225", "text": "function convertUnit (xUnit, mUnit, mVal) {\n\t\t\t\tif (xUnit !== mUnit) {\n\t\t\t\t\tif (mUnit === 'em')\n\t\t\t\t\t\tmVal = options.px_em_ratio * mVal;\n\t\t\t\t\tif (xUnit === 'em')\n\t\t\t\t\t\tmVal = mVal/options.px_em_ratio;\n\t\t\t\t}\n\n\t\t\t\treturn mVal;\n\t\t\t}", "title": "" }, { "docid": "ca78fbfc2e1df343e31faf54d3c3b02f", "score": "0.59047425", "text": "function add(unitName, n, date) {\n if (!isDate(date)) {\n return new Date(NaN);\n } else if (!units[unitName]) {\n throw new Error(\"add(unit, n, date) received unexpected value for 'unit'\");\n }\n var date2 = new Date(date.getTime()),\n partName = parts[units[unitName][0]][0];\n\n n = (Math.round(n) || 0) * units[unitName][1];\n date2[\"set\" + partName](date2[\"get\" + partName]() + n);\n return date2;\n}", "title": "" }, { "docid": "e792d43d6b994e06dde5fd355dfe3916", "score": "0.5855302", "text": "function parseUnit(str, out) {\n if (!out) out = [ 0, '' ];\n str = String(str)\n var num = parseFloat(str, 10)\n out[0] = num\n out[1] = str.match(/[\\d.\\-\\+]*\\s*(.*)/)[1] || ''\n return out\n}", "title": "" }, { "docid": "d99868b591085cb2b3e69ce8b36d9716", "score": "0.5854306", "text": "function setUnits(unit) {\n var label = document.getElementById(\"label\");\n label.innerHTML = unit;\n}", "title": "" }, { "docid": "bec74c2ceda7ebce4c4dc1f9636ba9d7", "score": "0.58274347", "text": "function adaptUnit(value, unit) {\n var adapted = false;\n value = Math.abs(value);\n do {\n adapted = false;\n switch (unit) {\n // handle metric units\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Kilometer:\n if (value < 0.01) {\n value *= 1000;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Meter;\n adapted = true;\n }\n break;\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Meter:\n if (value < 0.1) {\n value *= 100;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Centimeter;\n adapted = true;\n }\n if (value >= 1000) {\n value *= 0.001;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Kilometer;\n adapted = true;\n }\n break;\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Centimeter:\n if (value < 1) {\n value *= 10;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Millimeter;\n adapted = true;\n }\n if (value >= 100) {\n value *= 0.01;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Meter;\n adapted = true;\n }\n break;\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Millimeter:\n if (value >= 10) {\n value *= 0.1;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Centimeter;\n adapted = true;\n }\n break;\n // handle imperial (international) units\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].IInch:\n if (value >= 12) {\n value *= 0.0833333333;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].IFoot;\n adapted = true;\n }\n break;\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].IFoot:\n if (value < 1) {\n value *= 12;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].IInch;\n adapted = true;\n }\n if (value >= 528) {\n value *= 0.0001893939394;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].IMile;\n adapted = true;\n }\n break;\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].IMile:\n if (value < 0.1) {\n value *= 5280.0;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].IFoot;\n adapted = true;\n }\n break;\n // handle imperail (US) units\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Inch:\n if (value >= 12) {\n value *= 0.0833333333;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Foot;\n adapted = true;\n }\n break;\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Foot:\n if (value < 1) {\n value *= 12;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Inch;\n adapted = true;\n }\n if (value >= 528) {\n value *= 0.00018939393339207;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Mile;\n adapted = true;\n }\n break;\n case _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Mile:\n if (value < 0.1) {\n value *= 5280.0;\n unit = _CoreDefinitions__WEBPACK_IMPORTED_MODULE_0__[\"Units\"].Foot;\n adapted = true;\n }\n break;\n default:\n return unit;\n }\n } while (adapted);\n return unit;\n}", "title": "" }, { "docid": "d2150102ce296a7b5fff3aafbd28a321", "score": "0.5741717", "text": "static formatUnit(unit) {\n return unit === 1 ? 'Lbs' : 'Kg';\n }", "title": "" }, { "docid": "6ae8b18a9ed7c3dd15edccd67bc39841", "score": "0.57327086", "text": "add_unit(new_unit) {\n // Model Dafny preconditions\n if (this.units.length === 100000 || !(new_unit instanceof Unit)) {\n return;\n }\n // Add the unit if it is not in the bank\n let unit_in_bank = false;\n for (let i = 0; i < this.units.length; i++) {\n if (new_unit === this.units[i]) {\n unit_in_bank = true;\n }\n }\n if (!unit_in_bank) {\n this.units.push(new_unit);\n }\n }", "title": "" }, { "docid": "c294bbe3c63f486ee731ff0e939a21be", "score": "0.57265145", "text": "function changeUnit(element) {\n unit = element.value;\n convertToFarenheit()\n}", "title": "" }, { "docid": "5d27ece6db206c3800a2a59762bd02ed", "score": "0.57137114", "text": "function parseUnit( vVal, $node, sValFn ){\n\t\tvar aVal = /(-?\\d+)(.*)/.exec( vVal )\n\t\t , fUnit = parseFloat( aVal[ 1 ] )\n\t\t , sUnit = aVal[ 2 ]\n\t\t ;\n\n\t\tswitch( sUnit ){\n\t\t\tcase '':\n\t\t\tcase 'px':\n\t\t\t\treturn fUnit;\n\n\t\t\tcase '%':\n\t\t\t\treturn $node[ sValFn ]() * fUnit / 100;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'Unexpected unit type: ' + sUnit );\n\t\t\t\treturn;\n\t\t}\n\t}", "title": "" }, { "docid": "e798fdca7c69aad653cc9ffb8225d7d5", "score": "0.57022357", "text": "get units () {\n return 48;\n }", "title": "" }, { "docid": "f97ace577c7a82331668953c1e5e53bc", "score": "0.5691641", "text": "function getUnitMultiplier(val, unit) {\n \n switch (unit.toLowerCase()) {\n case \"uv\":\n case \"us\":\n return 0.000001 * val;\n break;\n \n case \"mv\":\n case \"ms\":\n return 0.001 * val;\n break;\n \n case \"v\":\n case \"hz\":\n case \"s\":\n return 1 * val;\n break;\n \n case \"kv\":\n case \"khz\":\n return 1000 * val;\n break;\n \n case \"mhz\":\n return 1000000 * val;\n break;\n \n default:\n return (null);\n break; \n }\n}", "title": "" }, { "docid": "f2154f010697c6412983cb0e44565380", "score": "0.5668002", "text": "function registerUnit(unit) {\n lookupTbl.set(unit.toString(), unit);\n}", "title": "" }, { "docid": "8a4b2727333606b5e70baf39af35690c", "score": "0.56498784", "text": "function baseUnit(units){\n return units * siaConversionFactor;\n }", "title": "" }, { "docid": "8f84f40c7310fb0883a86b60a7b7f6de", "score": "0.56320584", "text": "get units() {\n return this._units;\n }", "title": "" }, { "docid": "8f84f40c7310fb0883a86b60a7b7f6de", "score": "0.56320584", "text": "get units() {\n return this._units;\n }", "title": "" }, { "docid": "30403a74acb59db44ea2a1b98bfe72bb", "score": "0.56237274", "text": "function getValue(units) {\n var tempString = units.toString().replace(/[.,\\/\",()]/g,\"\");\n return tempString;\n }", "title": "" }, { "docid": "70166a6506b485fb565036caaffbdc9f", "score": "0.5620795", "text": "function convertTo(units, num) {\n\tif(units===\"cm\")return (num*=2.54)+\" inches\";\n\telse return (num/=2.54)+\" cm\";\n // write your code here\n}", "title": "" }, { "docid": "7788be58d0723dbda8fb5aec5623d364", "score": "0.5617559", "text": "function clacTotalPrice(units, price) {\n if (parseInt(units) > 50) {\n units = 50;\n $(\".unit-item\").val(\"50\");\n } else if (parseInt(units) < 1) {\n units = 1;\n $(\".unit-item\").val(\"1\");\n }\n unitsItem = units // updates the global var for the end cases\n var totalPrice = (units * price).toFixed(2);\n $(\".total-price span\").text(totalPrice);\n}", "title": "" }, { "docid": "4778f099e44aac1bd6c00eeb3ee7dcbe", "score": "0.5605319", "text": "addUnit(unit) { addElement(unit, this._unitBank); }", "title": "" }, { "docid": "e73d38be486e7b768876c53be30c3f0e", "score": "0.56009233", "text": "get units() {\n return [\n {'label':'Pounds','value':'LBS'},\n {'label':'Kilograms','value':'KGS'}\n ];\n }", "title": "" }, { "docid": "c68cdc2597471db154a9a585de9674fa", "score": "0.5543734", "text": "addActiveUnit(unit) { addElement(unit, this._activeUnits); }", "title": "" }, { "docid": "6bf33929f6875905af652bfff0cab6d7", "score": "0.5530526", "text": "normalizeUnit(str, full) {\n let num = parseFloat(str);\n let deg = (num / full) * 360;\n return `${deg}deg`\n }", "title": "" }, { "docid": "3cc71a49ef0c1c080b52143eacbe24a9", "score": "0.5518403", "text": "get unit () {\r\n\t\treturn this._unit;\r\n\t}", "title": "" }, { "docid": "bc371b1d4db61dc076745d1db12095e0", "score": "0.55060494", "text": "function normalizeUnits(value){return value.match(/px|em|rem/)?value:value+'px';}", "title": "" }, { "docid": "a655bf27ecb88043aa1b3cd045bb9cbf", "score": "0.54997903", "text": "function units(root, env) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"units\",\n exponential: function (node) {\n var uu = units(node.args[0], env);\n if (uu.length > 0) {\n return [node];\n }\n return [];\n },\n multiplicative: function (node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n },\n additive: function (node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n },\n unary: function(node) {\n return [];\n },\n numeric: function(node) {\n return [];\n },\n variable: function(node) {\n var val, env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n if (env && (val = env[node.args[0]])) {\n if (val.type === \"unit\") {\n return [node];\n }\n }\n return [];\n },\n comma: function(node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n },\n equals: function(node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n }\n });\n }", "title": "" }, { "docid": "0e3cdcedfe23ef7dedfda380bcbe34a8", "score": "0.5447455", "text": "function UnitConverter() {\n const unit = document.getElementById(\"units\").value;\n\n switch (unit) {\n // Unit switch for Length\n case \"inch\":\n document.getElementById(\"metricUnit\").innerText = \"Centimetre(s):\";\n break;\n case \"foot\":\n case \"yard\":\n document.getElementById(\"metricUnit\").innerText = \"Metre(s):\";\n break;\n case \"mile\":\n document.getElementById(\"metricUnit\").innerText = \"Kilometre(s):\";\n break;\n\n //Unit switch for Area\n case \"sqinch\":\n document.getElementById(\"metricUnit\").innerText = \"Square Centimetre(s):\";\n break;\n case \"sqfoot\":\n case \"sqyard\":\n document.getElementById(\"metricUnit\").innerText = \"Square Metre(s):\";\n break;\n case \"sqmile\":\n document.getElementById(\"metricUnit\").innerText = \"Square Kilometre(s):\";\n break;\n\n //Unit switch for Volume\n case \"cuinch\":\n document.getElementById(\"metricUnit\").innerText = \"Cubic Centimetre(s):\";\n break;\n case \"cufoot\":\n document.getElementById(\"metricUnit\").innerText = \"Cubic Metre(s):\";\n break;\n case \"flounce\":\n document.getElementById(\"metricUnit\").innerText = \"Millilitre(s):\";\n break;\n case \"gallon\":\n document.getElementById(\"metricUnit\").innerText = \"Litre(s):\";\n break;\n\n //Unit switch for Weigth\n case \"ounce\":\n document.getElementById(\"metricUnit\").innerText = \"Gram(s):\";\n break;\n case \"pound\":\n case \"stone\":\n document.getElementById(\"metricUnit\").innerText = \"Kilogram(s):\";\n break;\n case \"ton\":\n document.getElementById(\"metricUnit\").innerText = \"Tonne(s):\";\n break;\n }\n\n ValueConverter();\n\n return;\n}", "title": "" }, { "docid": "de8cdadb481320fd771fb335d41a2f45", "score": "0.54219335", "text": "changeUnit(newUnit) {\n this.setState({\n units: newUnit\n }, () => this.setWeightInKgs(this.state.weight));\n }", "title": "" }, { "docid": "de8cdadb481320fd771fb335d41a2f45", "score": "0.54219335", "text": "changeUnit(newUnit) {\n this.setState({\n units: newUnit\n }, () => this.setWeightInKgs(this.state.weight));\n }", "title": "" }, { "docid": "f965a88887ea65cc8d530c216ff7cc2f", "score": "0.5411257", "text": "function convertTo(units, num) {\n // write your code here\n}", "title": "" }, { "docid": "160dbfb0d74c8c5586f02d0a2003224f", "score": "0.53976345", "text": "function metric_units(number)\n{\n var unit = [\"\", \"k\", \"M\", \"G\", \"T\", \"P\", \"E\"];\n var mag = Math.ceil((1+Math.log(number)/Math.log(10))/3);\n return \"\" + (number/Math.pow(10, 3*(mag-1))).toFixed(2) + unit[mag];\n}", "title": "" }, { "docid": "160dbfb0d74c8c5586f02d0a2003224f", "score": "0.53976345", "text": "function metric_units(number)\n{\n var unit = [\"\", \"k\", \"M\", \"G\", \"T\", \"P\", \"E\"];\n var mag = Math.ceil((1+Math.log(number)/Math.log(10))/3);\n return \"\" + (number/Math.pow(10, 3*(mag-1))).toFixed(2) + unit[mag];\n}", "title": "" }, { "docid": "e888e51f6a6142ba64f7055c11424bee", "score": "0.5395766", "text": "function em(value) {\n return unit * value;\n}", "title": "" }, { "docid": "07adef483c50a213f94331e24ce9c140", "score": "0.53903097", "text": "function convertNodeUnits(numN)\n{\n\tvar temp = parseFloat(convert(nodeValue[numN]).from(nodeUnits[numN]).to(primaryUnit));\n\tconNodeValue[numN] = temp.toFixed(2);\n\tdocument.getElementById('convertedNodeUnits'+String(numN)).value = conNodeValue[numN] +\" \"+ primaryUnit;\n}", "title": "" }, { "docid": "41f03f2b4700366ec36ae89063a2b3f9", "score": "0.5388186", "text": "function updateProperty() {\n // [START apps_script_property_service_modify_data]\n try {\n // Change the unit type in the user property 'DISPLAY_UNITS'.\n const userProperties = PropertiesService.getUserProperties();\n let units = userProperties.getProperty('DISPLAY_UNITS');\n units = 'imperial'; // Only changes local value, not stored value.\n userProperties.setProperty('DISPLAY_UNITS', units); // Updates stored value.\n } catch (err) {\n // TODO (developer) - Handle exception\n console.log('Failed with error %s', err.message);\n }\n // [END apps_script_property_service_modify_data]\n}", "title": "" }, { "docid": "fee405f172b9b52a1cc3d8d7fa5f5d97", "score": "0.535179", "text": "function normalizeUnits(value) {\n\t return (value.match(/px|em|rem/)) ? value : value + 'px';\n\t}", "title": "" }, { "docid": "00bd1f06b014b6f4a67fa6629977039e", "score": "0.5326413", "text": "_normalizeTagAttrUnit(attr, ratio) {\n let stringValue = attr.nodeValue.toLowerCase()\n let floatValue = parseFloat(stringValue)\n\n if (isNaN(floatValue)) {\n return this.parser._skipTagAttr(this.tag, attr, 'only numeric value allowed')\n }\n\n if (stringValue.indexOf('mm') !== -1) {\n return floatValue * 3.5433070869\n }\n\n if (stringValue.indexOf('cm') !== -1) {\n return floatValue * 35.433070869\n }\n\n if (stringValue.indexOf('in') !== -1) {\n return floatValue * 90.0\n }\n\n if (stringValue.indexOf('pt') !== -1) {\n return floatValue * 1.25\n }\n\n if (stringValue.indexOf('pc') !== -1) {\n return floatValue * 15.0\n }\n\n if (stringValue.indexOf('%') !== -1) {\n let viewBox = this.tag.getAttr('viewBox', this.tag.parent && this.tag.parent.getAttr('viewBox'))\n\n switch (attr.nodeName) {\n case 'x':\n case 'width':\n floatValue *= viewBox[2] / 100\n break\n case 'y':\n case 'height':\n floatValue *= viewBox[3] / 100\n break\n }\n }\n\n if (stringValue.indexOf('em') !== -1) {\n let fontSize = this.tag.getAttr('font-size', 16)\n\n switch (attr.nodeName) {\n case 'x':\n case 'y':\n case 'width':\n case 'height':\n floatValue *= fontSize\n break\n }\n }\n\n return floatValue\n }", "title": "" }, { "docid": "041e618b12dd228f44266a1fbaddde4a", "score": "0.5324759", "text": "get unit() {\n return this._unit;\n }", "title": "" }, { "docid": "d573dca796a415e3193ecdb733a20554", "score": "0.5304387", "text": "function setUnits(unit)\r\n{\r\n\r\n// Declare the variable to store user input\r\nvar label = document.getElementByld(\"label\");\r\nlabel.innerHTML = \" \" + unit\r\n}", "title": "" }, { "docid": "9e1e26cce07ce3c0ad28f09cc8a6f308", "score": "0.53032637", "text": "function parse(val) {\n\t if (!isString(val)) {\n\t val = val.toString();\n\t }\n\t val = val.trim();\n\t\n\t var result = QTY_STRING_REGEX.exec(val);\n\t if (!result) {\n\t throw new QtyError(val + \": Quantity not recognized\");\n\t }\n\t\n\t var scalarMatch = result[1];\n\t if (scalarMatch) {\n\t // Allow whitespaces between sign and scalar for loose parsing\n\t scalarMatch = scalarMatch.replace(/\\s/g, \"\");\n\t this.scalar = parseFloat(scalarMatch);\n\t }\n\t else {\n\t this.scalar = 1;\n\t }\n\t var top = result[2];\n\t var bottom = result[3];\n\t\n\t var n, x, nx;\n\t // TODO DRY me\n\t while ((result = TOP_REGEX.exec(top))) {\n\t n = parseFloat(result[2]);\n\t if (isNaN(n)) {\n\t // Prevents infinite loops\n\t throw new QtyError(\"Unit exponent is not a number\");\n\t }\n\t // Disallow unrecognized unit even if exponent is 0\n\t if (n === 0 && !UNIT_TEST_REGEX.test(result[1])) {\n\t throw new QtyError(\"Unit not recognized\");\n\t }\n\t x = result[1] + \" \";\n\t nx = \"\";\n\t for (var i = 0; i < Math.abs(n) ; i++) {\n\t nx += x;\n\t }\n\t if (n >= 0) {\n\t top = top.replace(result[0], nx);\n\t }\n\t else {\n\t bottom = bottom ? bottom + nx : nx;\n\t top = top.replace(result[0], \"\");\n\t }\n\t }\n\t\n\t while ((result = BOTTOM_REGEX.exec(bottom))) {\n\t n = parseFloat(result[2]);\n\t if (isNaN(n)) {\n\t // Prevents infinite loops\n\t throw new QtyError(\"Unit exponent is not a number\");\n\t }\n\t // Disallow unrecognized unit even if exponent is 0\n\t if (n === 0 && !UNIT_TEST_REGEX.test(result[1])) {\n\t throw new QtyError(\"Unit not recognized\");\n\t }\n\t x = result[1] + \" \";\n\t nx = \"\";\n\t for (var j = 0; j < n ; j++) {\n\t nx += x;\n\t }\n\t\n\t bottom = bottom.replace(result[0], nx);\n\t }\n\t\n\t if (top) {\n\t this.numerator = parseUnits(top.trim());\n\t }\n\t if (bottom) {\n\t this.denominator = parseUnits(bottom.trim());\n\t }\n\t}", "title": "" }, { "docid": "ae9483b3dd61d651e5af7777c4bf2809", "score": "0.5297128", "text": "function newNodeUnit(numN)\n{\n\tnodeUnits[numN]=document.getElementById(\"nodeUnits\"+String(numN)).value;\n\tnewLabel(numN);\n\tconvertNodeUnits(numN);\n}", "title": "" }, { "docid": "f4a976538ee6874faae4dc89883efa57", "score": "0.52913564", "text": "function normalizeUnits(value) {\n return (value.match(/px|em|rem/)) ? value : value + 'px';\n}", "title": "" }, { "docid": "ae43a21a2fd4a6c7ffa3aa81dbcfb230", "score": "0.5290649", "text": "function setNutritionValue(key, value) {\n $(\"#id_nutrition_table_\" + key + \"_quantity\").text(\n // Display with 2 decimal points\n value.quantity.toFixed(2) + value.unit\n );\n}", "title": "" }, { "docid": "11ae98c55408588412b2c255941df624", "score": "0.52874476", "text": "function setUnits() {\n\n if (ibu.units.value == \"metric\") {\n // update displayed units\n if (document.getElementById('boilTempUnits')) {\n document.getElementById('boilTempUnits').innerHTML = \"&deg;C\";\n }\n if (document.getElementById('wortVolumeUnits')) {\n document.getElementById('wortVolumeUnits').innerHTML = \"liters\";\n }\n if (document.getElementById('weightUnits')) {\n document.getElementById('weightUnits').innerHTML = \"g\";\n }\n if (document.getElementById('tempUnits')) {\n document.getElementById('tempUnits').innerHTML = \"&deg;C\";\n }\n if (document.getElementById('rateUnits')) {\n document.getElementById('rateUnits').innerHTML = \"liters/min\";\n }\n if (document.getElementById('wortLossUnits')) {\n document.getElementById('wortLossUnits').innerHTML = \"liters\";\n }\n if (document.getElementById('evaporationUnits')) {\n document.getElementById('evaporationUnits').innerHTML = \"liters/hr\";\n }\n if (document.getElementById('topoffUnits')) {\n document.getElementById('topoffUnits').innerHTML = \"liters\";\n }\n if (document.getElementById('kettleDiameterUnits')) {\n document.getElementById('kettleDiameterUnits').innerHTML = \"cm\";\n }\n if (document.getElementById('kettleOpeningUnits')) {\n document.getElementById('kettleOpeningUnits').innerHTML = \"cm\";\n }\n if (document.getElementById('holdTempUnits')) {\n document.getElementById('holdTempUnits').innerHTML = \"&deg;C\";\n }\n\n // update variables\n common.set(ibu.boilTemp, 0);\n common.set(ibu.kettleDiameter, 0);\n common.set(ibu.kettleOpening, 0);\n common.set(ibu.evaporationRate, 0);\n common.set(ibu.wortVolume, 0);\n common.set(ibu.wortLossVolume, 0);\n common.set(ibu.topoffVolume, 0);\n common.set(ibu.tempLinParamA, 0);\n common.set(ibu.tempLinParamB, 0);\n common.set(ibu.tempExpParamA, 0);\n common.set(ibu.tempExpParamB, 0);\n common.set(ibu.tempExpParamC, 0);\n common.set(ibu.holdTemp, 0);\n common.set(ibu.counterflowRate, 0);\n for (idx = 0; idx < ibu.add.length; idx++) {\n common.set(ibu.add[idx].weight, 0);\n }\n } else {\n // update displayed units\n if (document.getElementById('boilTempUnits')) {\n document.getElementById('boilTempUnits').innerHTML = \"&deg;F\";\n }\n if (document.getElementById('wortVolumeUnits')) {\n document.getElementById('wortVolumeUnits').innerHTML = \"G\";\n }\n if (document.getElementById('weightUnits')) {\n document.getElementById('weightUnits').innerHTML = \"oz\";\n }\n if (document.getElementById('tempUnits')) {\n document.getElementById('tempUnits').innerHTML = \"&deg;F\";\n }\n if (document.getElementById('rateUnits')) {\n document.getElementById('rateUnits').innerHTML = \"gallons/min\";\n }\n if (document.getElementById('wortLossUnits')) {\n document.getElementById('wortLossUnits').innerHTML = \"G\";\n }\n if (document.getElementById('evaporationUnits')) {\n document.getElementById('evaporationUnits').innerHTML = \"G/hr\";\n }\n if (document.getElementById('topoffUnits')) {\n document.getElementById('topoffUnits').innerHTML = \"G\";\n }\n if (document.getElementById('kettleDiameterUnits')) {\n document.getElementById('kettleDiameterUnits').innerHTML = \"inches\";\n }\n if (document.getElementById('kettleOpeningUnits')) {\n document.getElementById('kettleOpeningUnits').innerHTML = \"inches\";\n }\n if (document.getElementById('holdTempUnits')) {\n document.getElementById('holdTempUnits').innerHTML = \"&deg;F\";\n }\n\n // update variables\n common.set(ibu.boilTemp, 0);\n common.set(ibu.kettleDiameter, 0);\n common.set(ibu.kettleOpening, 0);\n common.set(ibu.evaporationRate, 0);\n common.set(ibu.wortVolume, 0);\n common.set(ibu.wortLossVolume, 0);\n common.set(ibu.topoffVolume, 0);\n common.set(ibu.tempLinParamA, 0);\n common.set(ibu.tempLinParamB, 0);\n common.set(ibu.tempExpParamA, 0);\n common.set(ibu.tempExpParamB, 0);\n common.set(ibu.tempExpParamC, 0);\n common.set(ibu.holdTemp, 0);\n common.set(ibu.counterflowRate, 0);\n for (idx = 0; idx < ibu.add.length; idx++) {\n common.set(ibu.add[idx].weight, 0);\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "c25584e8918b88e070faa07a6a73561a", "score": "0.52756435", "text": "static number(value) {\n return new css_unit_value_1.CSSUnitValue(value, CSSUnit.number);\n }", "title": "" }, { "docid": "698867100fe549bef0cf796105a1dee1", "score": "0.5267134", "text": "function getUnits() {\n if (!documents.length) return '';\n var key = activeDocument.rulerUnits.toString().replace('RulerUnits.', '');\n switch (key) {\n case 'Pixels': return 'px';\n case 'Points': return 'pt';\n case 'Picas': return 'pc';\n case 'Inches': return 'in';\n case 'Millimeters': return 'mm';\n case 'Centimeters': return 'cm';\n // Added in CC 2023 v27.1.1\n case 'Meters': return 'm';\n case 'Feet': return 'ft';\n case 'FeetInches': return 'ft';\n case 'Yards': return 'yd';\n // Parse new units in CC 2020-2023 if a document is saved\n case 'Unknown':\n var xmp = activeDocument.XMPString;\n if (/stDim:unit/i.test(xmp)) {\n var units = /<stDim:unit>(.*?)<\\/stDim:unit>/g.exec(xmp)[1];\n if (units == 'Meters') return 'm';\n if (units == 'Feet') return 'ft';\n if (units == 'FeetInches') return 'ft';\n if (units == 'Yards') return 'yd';\n return 'px';\n }\n break;\n default: return 'px';\n }\n}", "title": "" }, { "docid": "b196519b323ecf4c591309afa50fc039", "score": "0.5265013", "text": "function withUnit (unit, count) {\n return `${count} ${pluralize(unit, count)}`;\n}", "title": "" }, { "docid": "08ba583f2850a377fb4348d026058550", "score": "0.52596015", "text": "function multiplyAccordingToUnit(eleArray){\n\tif($productUnitTypeLength.find(':selected').data('abbr') == 'INCHES'){\n\t\t$.each(eleArray, (index, $item) => {\n\t\t\tmultiplyByFactor($item, 2.54);\n\t\t});\n\t}else if($productUnitTypeLength.find(':selected').data('abbr') == 'MILLIMETER'){\n\t\t$.each(eleArray, (index, $item) => {\n\t\t\tmultiplyByFactor($item, 0.1);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "3e09efbc43be6ac6075ce1dfe142c948", "score": "0.52549404", "text": "function getUnit(input){\nreturn String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1]||'';\n}// Emulate the sass function \"unitless\"", "title": "" }, { "docid": "47fe7f1031631f81e39a2b5f40576b84", "score": "0.5250813", "text": "function em(value) {\n\treturn unit * value;\n}", "title": "" }, { "docid": "a2f288bacee130eb2770b14aafea64be", "score": "0.5247232", "text": "get units() {\n return this.cell.units;\n }", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.52256185", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "5ed751e55ad3bf37da6a29c5677da30c", "score": "0.521702", "text": "function unitToString (valueSI, measurement, displayUnit=true){\n if (displayUnit){\n if (measurement === \"distance\"){\n return math.format(math.unit(valueSI,\"m\").to(p.isSIunits ? \"m\" : \"ft\"),3);\n };\n if (measurement === \"flowrate\"){\n return math.format(math.unit(valueSI,\"m^3/s\").to(p.isSIunits ? \"m^3/s\" : \"cfm\"),3);\n };\n if (measurement === \"speed\"){\n return math.format(math.unit(valueSI,\"m/s\").to(p.isSIunits ? \"m/s\" : \"fpm\"),3);\n };\n if (measurement === \"deltaT\"){\n return p.isSIunits ? valueSI.toFixed(1) + \" °C\" : (valueSI * 1.8).toFixed(1) + \" °F\" ;\n };\n } else {\n if (measurement === \"distance\"){\n return math.unit(valueSI,\"m\").to(p.isSIunits ? \"m\" : \"ft\").toNumber().toFixed(1);\n };\n if (measurement === \"flowrate\"){\n return math.unit(valueSI,\"m^3/s\").to(p.isSIunits ? \"m^3/s\" : \"cfm\").toNumber().toFixed(1);\n };\n if (measurement === \"speed\"){\n return math.unit(valueSI,\"m/s\").to(p.isSIunits ? \"m/s\" : \"fpm\").toNumber().toFixed(p.isSIunits ? 2 : 0);\n };\n if (measurement === \"deltaT\"){\n return p.isSIunits ? valueSI.toFixed(1) : (valueSI * 1.8).toFixed(1);\n };\n }\n}", "title": "" }, { "docid": "d84e9f9762858069f7781286f7cf549e", "score": "0.52149856", "text": "function normalizeUnit(unit) {\n var normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n} // this is a dumbed down version of fromObject() that runs about 60% faster", "title": "" }, { "docid": "d84e9f9762858069f7781286f7cf549e", "score": "0.52149856", "text": "function normalizeUnit(unit) {\n var normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n} // this is a dumbed down version of fromObject() that runs about 60% faster", "title": "" }, { "docid": "d84e9f9762858069f7781286f7cf549e", "score": "0.52149856", "text": "function normalizeUnit(unit) {\n var normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n} // this is a dumbed down version of fromObject() that runs about 60% faster", "title": "" } ]
c1a8de077d4018e05c5df4c9427a4a4f
this is a function declaration and it is visible everywhere
[ { "docid": "3f2f69f563464bac908da52b04518533", "score": "0.0", "text": "function sayHello() {\r\n console.log('hello me');\r\n}", "title": "" } ]
[ { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.75050324", "text": "function miFuncion(){}", "title": "" }, { "docid": "7682bd4a09e257c76f7e64925ff63e9a", "score": "0.73636115", "text": "function declaration () {\n // Code goes here\n}", "title": "" }, { "docid": "b64bf3a9bd9809a14f0ddab5208cc0d8", "score": "0.7316523", "text": "function Funky() {\n\n\n}", "title": "" }, { "docid": "69bd595e2a0e49d4380dc91029c88bfd", "score": "0.7176638", "text": "function HelperFunctions (){}", "title": "" }, { "docid": "cf0e8c3cadb65602323c4187184bcf27", "score": "0.7154947", "text": "function fc(){}", "title": "" }, { "docid": "b4d4200845858c9e383030edd031b05e", "score": "0.7138035", "text": "function myPublicFunction() {\n\t\n}", "title": "" }, { "docid": "10d5627078b78749ec09d72a3aae1520", "score": "0.7102487", "text": "function() {\n\t\t//...\n\t}", "title": "" }, { "docid": "53cb5b11086809c484e61c5692161780", "score": "0.70721", "text": "function Func_s() {\n}", "title": "" }, { "docid": "15adc7e8e4e81c39d0a4aa4bec2eb4cd", "score": "0.7053981", "text": "function _foo() {\n}", "title": "" }, { "docid": "ca3192d5da5fdf3e89cbad14464a7f7e", "score": "0.7029446", "text": "function private_function()\r\n {\r\n\r\n }", "title": "" }, { "docid": "c344f3044be8491c5171dda20e226e9d", "score": "0.69853747", "text": "function dummy(){\n\n}", "title": "" }, { "docid": "f6eed244ead64bbe2615decb85f47a2a", "score": "0.6974106", "text": "function funcionPorDefinicion() //<-- Por definicion\n{\n //Cuerpo de la Funcion \n}", "title": "" }, { "docid": "2abf445a17d992ed965654da90d2c03a", "score": "0.6936437", "text": "function dummyFunction(){}", "title": "" }, { "docid": "12798e8b7b766ce9ef47608a1f18de95", "score": "0.6919463", "text": "function func()\n{\n}", "title": "" }, { "docid": "d63516842aad315eaa65e2966af6ba86", "score": "0.6917708", "text": "function worthless(){\n\n}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.6906565", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.6906565", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.6906565", "text": "function ba(){}", "title": "" }, { "docid": "7536592c5edd345903a749d8391a0abd", "score": "0.6904722", "text": "function foo(){\n\n}", "title": "" }, { "docid": "74ca80dab535168aeb92469f9c4391e4", "score": "0.6875597", "text": "function Helper(){}", "title": "" }, { "docid": "87fc1b21d7167a50e4735488793f9eae", "score": "0.68699414", "text": "function foo(){}", "title": "" }, { "docid": "7bba19ab72d7b0fba2c9fe8526915822", "score": "0.6849332", "text": "function foo() { }", "title": "" }, { "docid": "7bba19ab72d7b0fba2c9fe8526915822", "score": "0.6849332", "text": "function foo() { }", "title": "" }, { "docid": "966606887e425c5ce620b27ab207c123", "score": "0.6838233", "text": "function foo () { }", "title": "" }, { "docid": "6be59eae870cdc29b243f104756edbac", "score": "0.68070215", "text": "function someFunctionName(){} // this is the standard nomenclature", "title": "" }, { "docid": "1e88e47cfe1e655554ec592a0b05d5c6", "score": "0.68039584", "text": "methodName() {\n // TODO...\n // function definition goes here\n }", "title": "" }, { "docid": "5518f5c4c98695b2435a6d236cf292bb", "score": "0.6795955", "text": "function s(){}", "title": "" }, { "docid": "5518f5c4c98695b2435a6d236cf292bb", "score": "0.6795955", "text": "function s(){}", "title": "" }, { "docid": "63ee91916af8f9b75e93f58e8f954bf8", "score": "0.679405", "text": "static fun () { \n console.log(\"this is function\")\n }", "title": "" }, { "docid": "119f2619b285c207d9f745951d41892c", "score": "0.67798305", "text": "function funcao1(){}", "title": "" }, { "docid": "76e42fa31ae95cef127e809c7eea9f66", "score": "0.6772518", "text": "function foo() {\n // code\n}", "title": "" }, { "docid": "f0b2fe5191eca6981aedfd422df4bb61", "score": "0.6762904", "text": "function Helper() {\n\n}", "title": "" }, { "docid": "aec5a85413feb106f7e40a0738fc6495", "score": "0.67588735", "text": "function funcionPorDefinicion() {\n // cuerpo de la funcion\n}", "title": "" }, { "docid": "bbd3f0859db3330ca2657a5ef016b81e", "score": "0.6719934", "text": "function fun() {\n}", "title": "" }, { "docid": "3aebd98f9e4590985fc8ee500b625ac0", "score": "0.668702", "text": "function worthless(){}", "title": "" }, { "docid": "3cefac5d61157041d1b944fe72d0e143", "score": "0.668617", "text": "function exampled () {}", "title": "" }, { "docid": "1eeb852bd6757e33074b8354b860ce03", "score": "0.66772044", "text": "function foo( ) {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.66754895", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.66754895", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.66754895", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.66754895", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.66754895", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.66754895", "text": "function foo() {}", "title": "" }, { "docid": "30a766d4ad9c30caa41cbc0072ff6c25", "score": "0.6668205", "text": "function fn(){\n\n}", "title": "" }, { "docid": "e10393b6512e5c603c57720b8e03167f", "score": "0.66204196", "text": "function nada() { }", "title": "" }, { "docid": "f7bea7835647caec6beba0ebc04dd4dd", "score": "0.6616803", "text": "function PublicWrapper() {\n}", "title": "" }, { "docid": "238eb383435aca5b2c7456639f5e056c", "score": "0.6603319", "text": "function funcionDeclarada(){\n console.log(\"Esto es una prueba de la funcion declarada, puede invocarse en cualquier parte del codigo incluso antes de la funcion sea declarada\")\n}", "title": "" }, { "docid": "a811f387d44eefcfb5aab991df1bc426", "score": "0.65926236", "text": "function MyFunction(){}", "title": "" }, { "docid": "e7b25bd71da894d26e16b4ef4c28e8cc", "score": "0.6588597", "text": "function __f_9() {}", "title": "" }, { "docid": "c53b20e2710583cdad1543e358421213", "score": "0.6587571", "text": "function a(){}", "title": "" }, { "docid": "c53b20e2710583cdad1543e358421213", "score": "0.6587571", "text": "function a(){}", "title": "" }, { "docid": "c53b20e2710583cdad1543e358421213", "score": "0.6587571", "text": "function a(){}", "title": "" }, { "docid": "c53b20e2710583cdad1543e358421213", "score": "0.6587571", "text": "function a(){}", "title": "" }, { "docid": "843f3ed94e10af3ebe7fff2ebcbd4501", "score": "0.65832573", "text": "function funcDeclaration() {\n console.log('Function declaration');\n}", "title": "" }, { "docid": "843f3ed94e10af3ebe7fff2ebcbd4501", "score": "0.65832573", "text": "function funcDeclaration() {\n console.log('Function declaration');\n}", "title": "" }, { "docid": "66d66aa4ccf165edf7a4620e3f3526ff", "score": "0.6578651", "text": "function dummyFunction() {}", "title": "" }, { "docid": "b6e812c21d652271d72daf30023defe7", "score": "0.6576187", "text": "function SEA () {}", "title": "" }, { "docid": "3c6ce6b5b17f56242a5275a7c4ca6995", "score": "0.6567217", "text": "function c(){}", "title": "" }, { "docid": "f1d499c1a872547b56dc00db54317804", "score": "0.65515816", "text": "function modbusCommon(){\n\n}", "title": "" }, { "docid": "3d15a9d280658dc933deac68c00e5213", "score": "0.65503246", "text": "function Patrat() {\n\n}", "title": "" }, { "docid": "4015fe0fb08e78295ec1fcfdc105b78c", "score": "0.6549904", "text": "function da(){}", "title": "" }, { "docid": "73f6ca84cc758e55b78456c0283e3a52", "score": "0.6545925", "text": "function Common() {\n}", "title": "" }, { "docid": "a95450b24e1f66f68d9a09d8bc6e4028", "score": "0.65358037", "text": "function Bevy() {\n ;\n}", "title": "" }, { "docid": "be0a5d5f340f591fcadd892d67cb0677", "score": "0.65309834", "text": "function x(){}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.6530224", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.6530224", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.6530224", "text": "function dummy() {}", "title": "" }, { "docid": "1eb0d0b83347dd3d2857e0db9b2f34c9", "score": "0.6522484", "text": "function ourReusableFunction() {\n console.log(\"Heyya , world\");\n}", "title": "" }, { "docid": "7b1ce414e5a1ffbc7d48b327ac99f4cb", "score": "0.65220815", "text": "function funcionDeclarada (){ \n console.log('Declarada');\n}", "title": "" }, { "docid": "4dbd0eef4333323c0a042264c7b2317e", "score": "0.65201485", "text": "function soma() {\n\n}", "title": "" }, { "docid": "41d6de93688285fb80e7ac85974cf58b", "score": "0.6506076", "text": "function f() { } // Declare a global function", "title": "" }, { "docid": "70209601aa27aed28eae72cd7e384eea", "score": "0.6498499", "text": "function myFunction(){\n\n}", "title": "" }, { "docid": "7329d51f69a2f07434737efa0c1af6b2", "score": "0.6498086", "text": "function ae(){}", "title": "" }, { "docid": "c3a1ed765500109d41b016a023e93590", "score": "0.6491496", "text": "function a() {}", "title": "" }, { "docid": "c3a1ed765500109d41b016a023e93590", "score": "0.6491496", "text": "function a() {}", "title": "" }, { "docid": "27df09c3c6108695c18205c0efa483c5", "score": "0.6490874", "text": "function thisIsNamed() {\n // ..\n}", "title": "" }, { "docid": "e49940cbad60ff9b63113eab2dcc12ae", "score": "0.6463003", "text": "function Vaildator() {\n}", "title": "" }, { "docid": "af656100a480c209c9b4fcee36e93924", "score": "0.6462245", "text": "function myFunction() {\n\n}", "title": "" }, { "docid": "eb38c915051536b656dc76d729530684", "score": "0.64462715", "text": "function x() {}", "title": "" }, { "docid": "027074f8cf52cf4f83ac31c8429f0999", "score": "0.6444455", "text": "function myDeclaredFunction() {\n return 'this is a greeting from declared function';\n}", "title": "" }, { "docid": "e6214debdaa9bb97912a4308f193e001", "score": "0.6438896", "text": "function ordinary() {\n ;\n }", "title": "" }, { "docid": "94e84648274de64ca024f709b0eb5412", "score": "0.64077157", "text": "function f() {\n\n}", "title": "" }, { "docid": "56da1c11e294a7c6e3542f83d14eb917", "score": "0.64076716", "text": "function aDeclaredFunction() {\n console.log('hello');\n}", "title": "" }, { "docid": "e5bb187c254587ce46684e8177bf9483", "score": "0.64064676", "text": "function x(){\n console.log('function declaration')\n}", "title": "" }, { "docid": "0bb583ba916f5cd4c36589f29a68ac89", "score": "0.640287", "text": "static kd(){\n console.log(\"this is staic function\")\n}", "title": "" }, { "docid": "8820fb1d538650e3ef2635517d38ab24", "score": "0.63936156", "text": "function f(){}", "title": "" }, { "docid": "8820fb1d538650e3ef2635517d38ab24", "score": "0.63936156", "text": "function f(){}", "title": "" }, { "docid": "8820fb1d538650e3ef2635517d38ab24", "score": "0.63936156", "text": "function f(){}", "title": "" }, { "docid": "95c83684d25f58b42d65a98ed25551cd", "score": "0.63924074", "text": "function c() {}", "title": "" }, { "docid": "95c83684d25f58b42d65a98ed25551cd", "score": "0.63924074", "text": "function c() {}", "title": "" }, { "docid": "d68b136b95a6026b12e4d5e0e3386f68", "score": "0.63792473", "text": "foo() {}", "title": "" }, { "docid": "54bc66ece2be1da4b7ab03549f3e1f94", "score": "0.6378184", "text": "function Kutility() {\n\n}", "title": "" }, { "docid": "54bc66ece2be1da4b7ab03549f3e1f94", "score": "0.6378184", "text": "function Kutility() {\n\n}", "title": "" }, { "docid": "836c93262fcca57202682141f67ce051", "score": "0.6377162", "text": "function Foo() {\n// Code here\n}", "title": "" }, { "docid": "febff74e425045a602e10dd14f3f43e2", "score": "0.6375085", "text": "function anotherFunction() {}", "title": "" }, { "docid": "77ff8110cfcddb2cbffad04f9640382d", "score": "0.63741434", "text": "function ej_8() {}", "title": "" }, { "docid": "9abd915cedbcbe044d1faceb3ace9090", "score": "0.6370954", "text": "function legos() {\n\n}", "title": "" }, { "docid": "49f37949aca1fdb245c9eba2c1488558", "score": "0.6367119", "text": "function foo() {\r\n foo()\r\n}", "title": "" }, { "docid": "38e42c17834d282de77ac21b5f27803b", "score": "0.63665915", "text": "function functionName() {\r\n //code\r\n}", "title": "" }, { "docid": "d63eebac7f97c9060132540337aa40a0", "score": "0.63660747", "text": "function func_call_before_declaration(){\r\n console.log('hello there - before declaration ');\r\n}", "title": "" }, { "docid": "6ea2b33a083dca15d6880a28d0192423", "score": "0.63652587", "text": "function abc(param) {\n}", "title": "" } ]
4e9c1833279353f27f22157ffecc748e
if the forecast codes are about snow, then translate them to the correct weather icon.
[ { "docid": "d75a35361bcffe1a3e5c7cef026b683e", "score": "0.81268024", "text": "function snow(codes) {\n var icon;\n if ([600, 620].includes(codes.weather)) {\n icon = 'meteo_14.png';\n } else if ([601, 621].includes(codes.weather)) {\n icon = 'meteo_13.png';\n } else if ([602, 622].includes(codes.weather)) {\n icon = 'meteo_16.png';\n } else if ([611, 612].includes(codes.weather)) {\n icon = 'meteo_5.png';\n } else if ([615, 616].includes(codes.weather)) {\n icon = 'meteo_6.png';\n } else if (codes.weather > 600 && codes.weather < 700) {\n icon = 'meteo_7.png';\n console.log('Weather code unknown:', codes.weather);\n }\n return icon;\n }", "title": "" } ]
[ { "docid": "be9b35d5e051cbb59efea0c259b3806c", "score": "0.7331547", "text": "function thunderstorm(codes) {\n var icon;\n if (codes.weather >= 200 && codes.weather <= 211) {\n icon = 'meteo_4.png';\n } else if (codes.weather >= 212 && codes.weather <= 232) {\n icon = 'meteo_3.png';\n } else if (codes.weather > 232 && codes.weather < 300) {\n icon = 'meteo_3.png';\n console.log('Weather code unknown:', codes.weather);\n }\n return icon;\n }", "title": "" }, { "docid": "568ad75b6856b7c8a228b57b2133ab33", "score": "0.71632844", "text": "function weatherIcon(weather) {\n if (weather > 800) {\n icon = String.fromCodePoint(0x1F325);\n }\n else if (weather == 800) {\n icon = String.fromCodePoint(0x2600);\n }\n else if (weather > 299 && weather < 600) {\n icon = String.fromCodePoint(0x1F327);\n }\n else if (weather < 300) {\n icon = String.fromCodePoint(0x26C8);\n }\n else if (weather > 599 && weather < 700) {\n icon = String.fromCodePoint(0x1F328);\n }\n else {\n icon = String.fromCodePoint(0x1F32B);\n }\n}", "title": "" }, { "docid": "ab1f1aa0545333d8368f9fe69c83f5f9", "score": "0.6952612", "text": "function iconWorldWideWeather(code) {\n \n switch(code) {\n case '0': var icon = '<i class=\"wi wi-tornado\"></i>';\n break;\n case '1': var icon = '<i class=\"wi wi-storm-showers\"></i>';\n break;\n case '2': var icon = '<i class=\"wi wi-tornado\"></i>';\n break;\n case '3': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '4': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '5': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '6': var icon = '<i class=\"wi wi-rain-mix\"></i>';\n break;\n case '7': var icon = '<i class=\"wi wi-rain-mix\"></i>';\n break;\n case '8': var icon = '<i class=\"wi wi-sprinkle\"></i>';\n break;\n case '9': var icon = '<i class=\"wi wi-sprinkle\"></i>';\n break;\n case '10': var icon = '<i class=\"wi wi-hail\"></i>';\n break;\n case '11': var icon = '<i class=\"wi wi-showers\"></i>';\n break;\n case '12': var icon = '<i class=\"wi wi-showers\"></i>';\n break;\n case '13': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '14': var icon = '<i class=\"wi wi-storm-showers\"></i>';\n break;\n case '15': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '16': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '17': var icon = '<i class=\"wi wi-hail\"></i>';\n break;\n case '18': var icon = '<i class=\"wi wi-hail\"></i>';\n break;\n case '19': var icon = '<i class=\"wi wi-cloudy-gusts\"></i>';\n break;\n case '20': var icon = '<i class=\"wi wi-fog\"></i>';\n break;\n case '21': var icon = '<i class=\"wi wi-fog\"></i>';\n break;\n case '22': var icon = '<i class=\"wi wi-fog\"></i>';\n break;\n case '23': var icon = '<i class=\"wi wi-cloudy-gusts\"></i>';\n break;\n case '24': var icon = '<i class=\"wi wi-cloudy-windy\"></i>';\n break;\n case '25': var icon = '<i class=\"wi wi-thermometer\"></i>';\n break;\n case '26': var icon = '<i class=\"wi wi-cloudy\"></i>';\n break;\n case '27': var icon = '<i class=\"wi wi-night-cloudy\"></i>';\n break;\n case '28': var icon = '<i class=\"wi wi-day-cloudy\"></i>';\n break;\n case '29': var icon = '<i class=\"wi wi-night-cloudy\"></i>';\n break;\n case '30': var icon = '<i class=\"wi wi-day-cloudy\"></i>';\n break;\n case '31': var icon = '<i class=\"wi wi-night-clear\"></i>';\n break;\n case '32': var icon = '<i class=\"wi wi-day-sunny\"></i>';\n break;\n case '33': var icon = '<i class=\"wi wi-night-clear\"></i>';\n break;\n case '34': var icon = '<i class=\"wi wi-day-sunny-overcast\"></i>';\n break;\n case '35': var icon = '<i class=\"wi wi-hail\"></i>';\n break;\n case '36': var icon = '<i class=\"wi wi-day-sunny\"></i>';\n break;\n case '37': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '38': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '39': var icon = '<i class=\"wi wi wi-thunderstorm\"></i>';\n break;\n case '40': var icon = '<i class=\"wi wi-storm-showers\"></i>';\n break;\n case '41': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '42': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '43': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '44': var icon = '<i class=\"wi wi-cloudy\"></i>';\n break;\n case '45': var icon = '<i class=\"wi wi-lightning\"></i>';\n break;\n case '46': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '47': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '3200': var icon = '<i class=\"wi wi-cloud\"></i>';\n break;\n default: var icon = '<i class=\"wi wi-cloud\"></i>';\n break;\n }\n return icon;\n }", "title": "" }, { "docid": "d0ba87b4829592c736c638d38d07b80d", "score": "0.69425696", "text": "function atmosphere(codes) {\n var icon;\n if ([701, 711, 721].includes(codes.weather)) {\n icon = 'meteo_21.png';\n } else if ([741, 751, 761, 762].includes(codes.weather)) {\n icon = 'meteo_20.png'\n } else if (codes.weather === 731) {\n icon = 'meteo_0.png';\n } else if (codes.weather === 771) {\n icon = 'meteo_24.png';\n } else if (codes.weather === 781) {\n icon = 'meteo_2.png'\n } else if (codes.weather >= 700 && codes.weather < 800) {\n icon = 'meteo_21.png';\n console.log('Weather code unknown:', codes.weather);\n }\n return icon;\n }", "title": "" }, { "docid": "c22c1c3f1a24bc6501bc09242cf3f270", "score": "0.6929718", "text": "function clouds(codes) {\n var icon;\n if (codes.weather === 801) {\n icon = codes.icon.endsWith('d') ? 'meteo_30.png' : 'meteo_29.png';\n } else if (codes.weather === 802 || codes.weather === 803) {\n icon = codes.icon.endsWith('d') ? 'meteo_28.png' : 'meteo_27.png';\n } else if (codes.weather === 804) {\n icon = 'meteo_26.png';\n } else if (codes.weather > 800) {\n icon = 'meteo_26.png';\n console.log('Weather code unknown:', codes.weather);\n }\n return icon;\n }", "title": "" }, { "docid": "0deef85d57720f6e95596f41e046baaf", "score": "0.6859004", "text": "function rain(codes) {\n var icon;\n if ([500, 501, 520].includes(codes.weather)) {\n icon = 'meteo_9.png';\n } else if ([502, 503, 504, 521, 522, 531].includes(codes.weather)) {\n icon = 'meteo_11.png';\n } else if (codes.weather === 511) {\n icon = 'meteo_10.png';\n } else if (codes.weather > 500 && codes.weather < 600) {\n icon = 'meteo_11.png';\n console.log('Weather code unknown:', codes.weather);\n }\n return icon;\n }", "title": "" }, { "docid": "3de3c68a9750c988cbe67ec343183136", "score": "0.67277735", "text": "static async updateIcons() {\n let weatherData = await Weather.getWeather();\n let icons = Array.from(document.querySelectorAll(\".forecast-icon\"));\n icons.forEach(icon => {\n let desc = weatherData[icons.indexOf(icon)].weather[0].id;\n switch(desc) {\n case 800: \n icon.innerHTML = `<img src=\"images/icons/icon-2.svg\" alt=\"Clear Sky\" height=50>`;\n break;\n case 801: \n icon.innerHTML = `<img src=\"images/icons/icon-3.svg\" alt=\"Few Clouds\" height=50>`;\n break;\n case 802:\n icon.innerHTML = `<img src=\"images/icons/icon-5.svg\" alt=\"Scattered Clouds Sky\" height=50>`;\n break;\n case 803: \n icon.innerHTML = `<img src=\"images/icons/icon-6.svg\" alt=\"broken clouds\" height=50>`;\n break;\n case 500: case 501: case 502: case 503: case 504: \n icon.innerHTML = `<img src=\"images/icons/icon-9.svg\" alt=\"shower rain\" height=50>`;\n break;\n case 520: case 521:case 522: case 531: \n icon.innerHTML = `<img src=\"images/icons/icon-10.svg\" alt=\"rain\" height=50>`;\n break;\n case 200: case 201: case 202: case 210: case 211: case 212: case 221:\n case 230: case 231: case 232:\n icon.innerHTML = `<img src=\"images/icons/icon-12.svg\" alt=\"thunderstorm\" height=50>`;\n break;\n case 600: case 601: case 602: case 611: case 612: case 613: case 615:\n case 616: case 620: case 621: case 622: case 511: \n icon.innerHTML = `<img src=\"images/icons/icon-13.svg\" alt=\"snow\" height=50>`;\n break;\n default: \n icon.innerHTML = `<img src=\"images/icons/icon-3.svg\" alt=\"mist\" height=50>`;\n break;\n }\n })\n }", "title": "" }, { "docid": "99305a4b2aa20b1aceac7b528f932389", "score": "0.65259314", "text": "function drizzle(codes) {\n var icon;\n if (codes.weather >= 300 && codes.weather <= 310) {\n icon = 'meteo_9.png';\n } else if (codes.weather >= 311 && codes.weather <= 321) {\n icon = 'meteo_11.png';\n } else if (codes.weather > 300 && codes.weather < 400) {\n icon = 'meteo_11.png';\n console.log('Weather code unknown:', codes.weather);\n }\n return icon;\n }", "title": "" }, { "docid": "81cdd5bac02fbe9b23ffcde5231b0a32", "score": "0.6407482", "text": "function getIcon(weather) {\n switch (weather.current.condition.code){\n case 1063:\n case 1180:\n case 1183:\n case 1186:\n case 1189:\n case 1198:\n case 1204:\n case 1249:\n case 1255:\n case 1261:\n case 1273:\n return \"weather-showers-scattered.png\";\n case 1087:\n case 1192:\n case 1195:\n case 1201:\n case 1207:\n case 1240:\n case 1243:\n case 1246:\n case 1252:\n case 1258:\n case 1264:\n case 1276:\n return \"weather-showers.png\";\n case 1066:\n case 1069:\n case 1072:\n case 1114:\n case 1117:\n case 1147:\n case 1150:\n case 1153:\n case 1168:\n case 1171:\n case 1210:\n case 1213:\n case 1216:\n case 1219:\n case 1222:\n case 1225:\n case 1237:\n case 1279:\n case 1282:\n return \"weather-snow.png\";\n case 1003:\n case 1006:\n return \"weather-few-clouds.png\";\n case 1000:\n return \"weather-clear.png\"\n case 1009:\n\n return \"weather-overcast.png\";\n }\n return \"weather-fog.png\";\n}", "title": "" }, { "docid": "f50feb78d5d7cf53aa72fe68e7e4ba64", "score": "0.63196546", "text": "function checkForSnow(weather){\n if(weather === \"snowing\"){\n return(\"It's snowing\");\n }else{\n return(\"Check back later for updates\");\n }\n}", "title": "" }, { "docid": "38b04ed6da46a7a237a6e316c1aed542", "score": "0.6251133", "text": "function getIcon(myJson) {\r\n if (myJson[0].WeatherText.toLowerCase in [\"partly sunny\", \"intermittent clouds\"]) {\r\n return \"partlycloudy\"\r\n }\r\n else if (myJson[0].WeatherText.toLowerCase == \"mostly cloudy\") {\r\n return \"mostlycloudy\"\r\n }\r\n else if (myJson[0].WeatherText.toLowerCase in [\"cloudy\", \"dreary\"]) {\r\n return \"cloudy\"\r\n }\r\n else if (myJson[0].WeatherText.toLowerCase in [\"sunny\", \"mostly Sunny\", \"clear\", \"mostly clear\"]) {\r\n return \"clear\"\r\n }\r\n else if (myJson[0].WeatherText.toLowerCase in [\"T-Storms\", \"mostly cloudy w/ t-storms\", \"partly sunny w/ t-storms\"]) {\r\n return \"tstorms\"\r\n }\r\n else if (myJson[0].WeatherText in [\"snow\", \"mostly cloudy w/snow\"]) {\r\n return \"snow\"\r\n }\r\n else if (myJson[0].WeatherText in [\"sleet\", \"freezing rain\", \"ice\", \"rain and snow\"]) {\r\n return \"sleet\"\r\n }\r\n else if (myJson[0].WeatherText in [\"flurries\", \"mostly cloudy w/ flurries\", \"partly sunny w/ flurries\"]) {\r\n return \"flurries\"\r\n }\r\n else if (myJson[0].WeatherText in [\"fog\", \"hazy sunshine\"]) {\r\n return \"fog\"\r\n }\r\n else if (myJson[0].WeatherText in [\"showers\", \"mostly cloudy w/ showers\", \"partly sunny w/ showers\", \"rain\"]) {\r\n return \"rain\"\r\n }\r\n}", "title": "" }, { "docid": "ea23e105be19821a80555a84b093dd7d", "score": "0.6223379", "text": "function getWeatherIcon(title) {\n switch(title) {\n case 'clear': return sunIcon\n case 'snow': return snowIcon\n case 'rain': return rainIcon\n case 'wind': return windIcon\n case 'clouds': return cloudIcon\n default: return cloudIcon\n }\n}", "title": "" }, { "docid": "c1bb00c84f838f5940f51de900e892d6", "score": "0.62073344", "text": "function weatherIcon(params) {\n var icon = \"wi-day-sunny\";\n switch (params[0]) {\n case \"Clouds\":\n icon = 'wi-day-cloudy';\n break;\n case \"Rain\":\n icon = 'wi-day-rain';\n break;\n case \"Snow\":\n icon = 'wi-day-snow';\n break;\n case \"Extreme\":\n icon = 'wi-day-thunderstorm';\n break;\n case \"Clouds\":\n icon = 'wi-day-cloudy';\n break;\n // And more - I couldn't find a list of them on openweathermap.org\n default:\n icon = \"wi-day-sunny\";\n break;\n }\n return icon;\n }", "title": "" }, { "docid": "6dfcd1c9c3f37634e2afdf7740974763", "score": "0.62070185", "text": "function findIcon(iconName) {\n switch (iconName.toLowerCase()) {\n case \"clear-day\":\n case \"clear\":\n case \"mostlysunny\":\n case \"partlysunny\":\n case \"sunny\":\n $scope.weatherIcon = \"wi wi-day-sunny\";\n break;\n case \"clear-night\":\n $scope.weatherIcon = \"wi wi-night-clear\";\n break;\n case \"rain\":\n case \"chancerain\":\n case \"freezing rain\":\n $scope.weatherIcon = \"wi wi-rain\";\n break;\n case \"snow\":\n case \"chanceflurries\":\n case \"chancesnow\":\n case \"flurries\":\n $scope.weatherIcon = \"wi wi-snow\";\n break;\n case \"sleet\":\n case \"chancesleet\":\n $scope.weatherIcon = \"wi wi-sleet\";\n break;\n case \"wind\":\n $scope.weatherIcon = \"wi wi-strong-wind\";\n break;\n case \"fog\":\n case \"hazy\":\n $scope.weatherIcon = \"wi wi-fog\";\n break;\n case \"partly-cloudy-day\":\n case \"partlycloudy\":\n $scope.weatherIcon = \"wi wi-day-cloudy\";\n break;\n case \"partly-cloudy-night\":\n $scope.weatherIcon = \"wi wi-night-cloudy\";\n break;\n case \"hail\":\n $scope.weatherIcon = \"wi wi-hail\";\n break;\n case \"thunderstorm\":\n case \"chancetstorms\":\n case \"tstorms\":\n $scope.weatherIcon = \"wi wi-thunderstorm\";\n break;\n case \"tornado\":\n $scope.weatherIcon = \"wi wi-tornado\";\n break;\n case \"cloudy\":\n case \"mostlycloudy\":\n case \"overcast\":\n $scope.weatherIcon = \"wi wi-cloudy\";\n break;\n }\n }", "title": "" }, { "docid": "bf6d9b5208f99e982a418165fc4e29e3", "score": "0.61422974", "text": "function displayWeather(description) {\n //dictionary to store weather icons\n let image_dict = {\n Clear: \"/static/images/weather/Sun.png\",\n Clouds: \"/static/images/weather/Cloud.png\",\n Rain: \"/static/images/weather/Rain.png\",\n Snow: \"/static/images/weather/Snow.png\",\n Thunderstorm: \"/static/images/weather/Storm.png\",\n fog: \"/static/images/weather/Haze.png\",\n Mist: \"/static/images/weather/Haze.png\",\n Smoke: \"/static/images/weather/Haze.png\",\n Haze: \"/static/images/weather/Haze.png\",\n Dust: \"/static/images/weather/Haze.png\",\n Fog: \"/static/images/weather/Haze.png\",\n Sand: \"/static/images/weather/Haze.png\",\n Ash: \"/static/images/weather/Haze.png\",\n Squall: \"/static/images/weather/Haze.png\",\n };\n\n return description in image_dict ? image_dict[description] : image_dict.Clouds;\n}", "title": "" }, { "docid": "3e8075d97ac7675e59ce8f5c75c69956", "score": "0.6141089", "text": "function iconDisplay(data) {\n\tvar dayOrNight;\n\tvar time = Date.now().toString();\n\tvar curTimeStr = time.slice(0, time.length - 3);\n\tvar curTime = parseFloat(curTimeStr);\n\tvar sunset = data.sys.sunset;\n\tvar sunrise = data.sys.sunrise;\n\tif (curTime >= sunrise && curTime <= sunset) {\n\t\tdayOrNight = true;\n\t} else {\n\t\tdayOrNight = false;\n\t}\n\n\tif (dayOrNight && data.weather[0].id === 800) {\n\t\tclearSky.style.display = \"inline\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (!dayOrNight && data.weather[0].id === 800) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"inline\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (!dayOrNight && data.weather[0].id >= 801 &&data.weather[0].id <= 804) {\n\t clearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"inline\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 300 && data.weather[0].id <= 531) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"inline\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 200 && data.weather[0].id <= 232 || data.weather[0].id === 901 || data.weather[0].id === 900 || data.weather[0].id === 960 || data.weather[0].id === 961 || data.weather[0].id === 962 ) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"inline\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 600 && data.weather[0].id <= 622) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"inline\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 802 && data.weather[0].id <= 804) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"inline\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id === 801) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"inline\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id === 905 || data.weather[0].id === 902 || (data.weather[0].id >= 952 && data.weather[0].id <= 959)) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"inline\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 700 && data.weather[0].id <= 781) {\n clearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"inline\";\n\t} else {\n\t\tconsole.log(\"other\");\n\t}\n}", "title": "" }, { "docid": "acd157a1a07374c3be27e4b803583ed8", "score": "0.61314243", "text": "function getWeatherIcon(wData){\n var weatherIcon = '';\n switch(wData.icon){\n case 'clear-day' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/clear.png\" />';\n break;\n case 'clear-night' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/clear.png\" />';\n break;\n case 'rain' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/rain.png\" />';\n break;\n case 'snow' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/snow.png\" />';\n break;\n case 'sleet' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/sleet.png\" />';\n break;\n case 'wind' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/wind.png\" />';\n break;\n case 'fog' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/fog.png\" />';\n break;\n case 'cloudy' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/cloudy.png\" />';\n break;\n case 'partly-cloudy-day' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/partly_cloudy.png\" />';\n break;\n case 'partly-cloudy-night' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/partly_cloudy.png\" />';\n break;\n default :\n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/clear.png\" />';\n break;\n }\n return weatherIcon;\n\n }", "title": "" }, { "docid": "224fcab544a8fa84a0b03e1503500ce3", "score": "0.6122369", "text": "function getWeatherIcon(city) {\n}", "title": "" }, { "docid": "57949400b0b6bcacdba4ea0bb743264c", "score": "0.6089178", "text": "function switchIcon(val){\n\tvar weather = \"\";\n\tswitch (val){\n\t\tcase '01d':\n\t\t\t//clear sky - day\n\t\t\tweather = '<img style=\"top:1.75px\" id = \"sunIcon\" src=\"graphics/sun.png\">'\n\t\t\tbreak;\n\t\tcase '02d':\n\t\t\t// few clouds - day\n\t\t\tweather = '<img style=\"top:6px;\" src=\"graphics/cloud.png\">'\n\t\t\tbreak;\n\t\tcase '03d':\n\t\t\t// scattered clouds - day\n\t\t\tweather = '<img style=\"top:6px;\" src=\"graphics/cloud.png\">'\n\t\t\tbreak; \n\t\tcase '04d':\n\t\t\t// broken clouds - day\n\t\t\tweather = '<img style=\"top:6px;\" src=\"graphics/cloud.png\">'\n\t\t\tbreak; \n\t\tcase '09d':\n\t\t\t// shower rain - day\n\t\t\tweather = '<img src=\"graphics/rain.png\">'\n\t\t\tbreak; \n\t\tcase '10d':\n\t\t\t// rain - day\n\t\t\tweather = '<img src=\"graphics/rain.png\">'\n\t\t\tbreak; \n\t\tcase '11d':\n\t\t\t// thunderstorm - day\n\t\t\tweather = '<img style=\"top:3px;\" src=\"graphics/lightning.png\">'\n\t\t\tbreak;\n\t\tcase '13d':\n\t\t\t// snow - day\n\t\t\tweather = '<img style=\"top:3px;\" src=\"graphics/snow\">'\n\t\t\tbreak;\n\t\tcase '50d':\n\t\t\t//mist - day\n\t\t\tweather = '<img style=\"top:6px;\" src=\"graphics/cloud.png\">'\n\t\t\tbreak;\n\t}\t\t\n\treturn weather;\n}", "title": "" }, { "docid": "1a3c53a2f6e95234677ea1fc37d8f16f", "score": "0.6070816", "text": "function renderIcon(currentWeather) {\n var i = $(\"<i>\").addClass(\"fas\");\n if(currentWeather === \"Clouds\"){\n i.addClass(\"fa-cloud\");\n }\n else if(currentWeather === \"Rain\" || currentWeather === \"Drizzle\"){\n i.addClass(\"fa-tint\");\n }\n else if(currentWeather === \"Snow\"){\n i.addClass(\"fa-snowflake\");\n }\n else if (currentWeather === \"Sunny\" || currentWeather === \"Clear\"){\n i.addClass(\"fa-sun\");\n }\n return i;\n\n}", "title": "" }, { "docid": "c8098fa83f99c6e5dc4b80735a21d325", "score": "0.6055166", "text": "getWeatherIconClass(data) {\n if (!data) {\n return this.weatherIconClassMapping['unknown'];\n }\n if (data.icon.indexOf('cloudy') > -1) {\n if (data.cloudCover < 0.25) {\n return this.weatherIconClassMapping[\"clear-day\"];\n } else if (data.cloudCover < 0.5) {\n return this.weatherIconClassMapping[\"mostly-clear-day\"];\n } else if (data.cloudCover < 0.75) {\n return this.weatherIconClassMapping[\"partly-cloudy-day\"];\n } else {\n return this.weatherIconClassMapping[\"cloudy\"];\n }\n } else {\n return this.weatherIconClassMapping[data.icon];\n }\n }", "title": "" }, { "docid": "d32bf6062e667581a0e9b65d735afafa", "score": "0.6043007", "text": "showWeather(weather) {\n this.weatherIcon.src = weather.isRaining ? Raining : Sun;\n this.textNode.nodeValue = weather.temperature + ' ' + Celsius.normalize(); // celsius unicode\n }", "title": "" }, { "docid": "c5858bb5e35b70682e3af556d3cd6f21", "score": "0.60327995", "text": "function weatherCodeToText(code, tense) {\r\n\t// figure out the tense (\"present\" uses \"it's -ing\" and \"there's\", \"future\" uses indefinite tense and \"there will be\"\r\n\tif (tense=\"p\") {\r\n\t\tvar prefixIs = \"it's\";\r\n\t\tvar prefixThere = \"there's\";\r\n\t\tvar suffixIng = \"ing\";\r\n\t}\r\n\tif (tense=\"f\") {\r\n\t\tvar prefixIs = \"it will\";\r\n\t\tvar prefixThere = \"there will be\";\r\n\t\tvar suffixIng = \"\";\r\n\t}\r\n\t\r\n\tswitch (code) {\r\n\t\tcase (200):\r\n\t\t\treturn \"with a thunderstorm with light rain\";\r\n\t\tbreak;\r\n\t\tcase (201):\r\n\t\t\treturn \"with a thunderstorm with rain\";\r\n\t\tbreak;\r\n\t\tcase (202):\r\n\t\t\treturn \"and \" + prefixThere + \" a thunderstorm with heavy rain\";\r\n\t\tbreak;\r\n\t\tcase (210):\r\n\t\t\treturn \"with a light thunderstorm\";\r\n\t\tbreak;\r\n\t\tcase (211):\r\n\t\t\treturn \"and \" + prefixIs + \" thunderstorm\" + varIng + \"\";\r\n\t\tbreak;\r\n\t\tcase (212):\r\n\t\t\treturn \"and \" + prefixThere + \" a heavy thunderstorm\";\r\n\t\tbreak;\r\n\t\tcase (221):\r\n\t\t\treturn \"with a ragged thunderstorm\";\r\n\t\tbreak;\r\n\t\tcase (230):\r\n\t\t\treturn \"and \" + prefixThere + \" a thunderstorm with light drizzle\";\r\n\t\tbreak;\r\n\t\tcase (231):\r\n\t\t\treturn \"and \" + prefixThere + \" a thunderstorm with drizzle\";\r\n\t\tbreak;\r\n\t\tcase (232):\r\n\t\t\treturn \"and \" + prefixThere + \" a thunderstorm with heavy drizzle\";\r\n\t\tbreak;\r\n\t\tcase (300):\r\n\t\t\treturn \"with light intensity drizzle\";\r\n\t\tbreak;\r\n\t\tcase (301):\r\n\t\t\treturn \"with drizzle\";\r\n\t\tbreak;\r\n\t\tcase (302):\r\n\t\t\treturn \"with some heavy intensity drizzle\";\r\n\t\tbreak;\r\n\t\tcase (310):\r\n\t\t\treturn \"with some light intensity drizzle rain\";\r\n\t\tbreak;\r\n\t\tcase (311):\r\n\t\t\treturn \"with some drizzle rain\";\r\n\t\tbreak;\r\n\t\tcase (312):\r\n\t\t\treturn \"with heavy intensity drizzle rain\";\r\n\t\tbreak;\r\n\t\tcase (313):\r\n\t\t\treturn \"with shower rain and drizzle\";\r\n\t\tbreak;\r\n\t\tcase (314):\r\n\t\t\treturn \"with heavy shower rain and drizzle\";\r\n\t\tbreak;\r\n\t\tcase (321):\r\n\t\t\treturn \"with shower drizzle\";\r\n\t\tbreak;\r\n\t\tcase (500):\r\n\t\t\treturn \"with some light rain\";\r\n\t\tbreak;\r\n\t\tcase (501):\r\n\t\t\treturn \"with moderate rain\";\r\n\t\tbreak;\r\n\t\tcase (502):\r\n\t\t\treturn \"with some heavy intensity rain\";\r\n\t\tbreak;\r\n\t\tcase (503):\r\n\t\t\treturn \"with very heavy rain\";\r\n\t\tbreak;\r\n\t\tcase (504):\r\n\t\t\treturn \"with extreme rain\";\r\n\t\tbreak;\r\n\t\tcase (511):\r\n\t\t\treturn \"with freezing rain\";\r\n\t\tbreak;\r\n\t\tcase (520):\r\n\t\t\treturn \"with light intensity shower rain\";\r\n\t\tbreak;\r\n\t\tcase (521):\r\n\t\t\treturn \"with some shower rain\";\r\n\t\tbreak;\r\n\t\tcase (522):\r\n\t\t\treturn \"with some heavy intensity shower rain\";\r\n\t\tbreak;\r\n\t\tcase (531):\r\n\t\t\treturn \"with some ragged shower rain\";\r\n\t\tbreak;\r\n\t\tcase (600):\r\n\t\t\treturn \"with light snow\";\r\n\t\tbreak;\r\n\t\tcase (601):\r\n\t\t\treturn \"and \" + prefixIs + \" snow\" + varIng + \"\";\r\n\t\tbreak;\r\n\t\tcase (602):\r\n\t\t\treturn \"and \" + prefixThere + \" heavy snow\";\r\n\t\tbreak;\r\n\t\tcase (611):\r\n\t\t\treturn \"and \" + prefixIs + \" sleet\" + varIng + \"\";\r\n\t\tbreak;\r\n\t\tcase (612):\r\n\t\t\treturn \"and \" + prefixThere + \" shower sleet\";\r\n\t\tbreak;\r\n\t\tcase (615):\r\n\t\t\treturn \"with some light rain and snow\";\r\n\t\tbreak;\r\n\t\tcase (616):\r\n\t\t\treturn \"with rain and snow\";\r\n\t\tbreak;\r\n\t\tcase (620):\r\n\t\t\treturn \"with light shower snow\";\r\n\t\tbreak;\r\n\t\tcase (621):\r\n\t\t\treturn \"with some shower snow\";\r\n\t\tbreak;\r\n\t\tcase (622):\r\n\t\t\treturn \"with some heavy shower snow\";\r\n\t\tbreak;\r\n\t\tcase (701):\r\n\t\t\treturn \"and \" + prefixIs + \" mist\" + varIng + \"\";\r\n\t\tbreak;\r\n\t\tcase (711):\r\n\t\t\treturn \"and \" + prefixThere + \" smoke\";\r\n\t\tbreak;\r\n\t\tcase (721):\r\n\t\t\treturn \"and \" + prefixIs + \" hazy\";\r\n\t\tbreak;\r\n\t\tcase (731):\r\n\t\t\treturn \"with sand and dust whirls\";\r\n\t\tbreak;\r\n\t\tcase (741):\r\n\t\t\treturn \"and \" + prefixIs + \" foggy\";\r\n\t\tbreak;\r\n\t\tcase (751):\r\n\t\t\treturn \"with sand\";\r\n\t\tbreak;\r\n\t\tcase (761):\r\n\t\t\treturn \"with dust\";\r\n\t\tbreak;\r\n\t\tcase (762):\r\n\t\t\treturn \"with volcanic ash\";\r\n\t\tbreak;\r\n\t\tcase (771):\r\n\t\t\treturn \"with some squalls\";\r\n\t\tbreak;\r\n\t\tcase (781):\r\n\t\t\treturn \"and \" + prefixThere + \" a tornado\";\r\n\t\tbreak;\r\n\t\tcase (800):\r\n\t\t\treturn \"and clear\";\r\n\t\tbreak;\r\n\t\tcase (801):\r\n\t\t\treturn \"and \" + prefixThere + \" a few clouds\";\r\n\t\tbreak;\r\n\t\tcase (802):\r\n\t\t\treturn \"with some scattered clouds\";\r\n\t\tbreak;\r\n\t\tcase (803):\r\n\t\t\treturn \"with some broken clouds\";\r\n\t\tbreak;\r\n\t\tcase (804):\r\n\t\t\treturn \"with some overcast clouds\";\r\n\t\tbreak;\r\n\t\tcase (900):\r\n\t\t\treturn \"and \" + prefixThere + \" a tornado\";\r\n\t\tbreak;\r\n\t\tcase (901):\r\n\t\t\treturn \"and \" + prefixThere + \" a tropical storm\";\r\n\t\tbreak;\r\n\t\tcase (902):\r\n\t\t\treturn \"and \" + prefixThere + \" a hurricane\";\r\n\t\tbreak;\r\n\t\tcase (903):\r\n\t\t\treturn \"and \" + prefixIs + \" cold\";\r\n\t\tbreak;\r\n\t\tcase (904):\r\n\t\t\treturn \"and \" + prefixIs + \" hot\";\r\n\t\tbreak;\r\n\t\tcase (905):\r\n\t\t\treturn \"and \" + prefixIs + \" windy\";\r\n\t\tbreak;\r\n\t\tcase (906):\r\n\t\t\treturn \"and \" + prefixThere + \" hail\";\r\n\t\tbreak;\r\n\t\tcase (951):\r\n\t\t\treturn \"and \" + prefixIs + \" calm out\";\r\n\t\tbreak;\r\n\t\tcase (952):\r\n\t\t\treturn \"and \" + prefixThere + \" a light breeze\";\r\n\t\tbreak;\r\n\t\tcase (953):\r\n\t\t\treturn \"and \" + prefixThere + \" agentle breeze\";\r\n\t\tbreak;\r\n\t\tcase (954):\r\n\t\t\treturn \"and \" + prefixThere + \" a moderate breeze\";\r\n\t\tbreak;\r\n\t\tcase (955):\r\n\t\t\treturn \"with a fresh breeze\";\r\n\t\tbreak;\r\n\t\tcase (956):\r\n\t\t\treturn \"with a strong breeze\";\r\n\t\tbreak;\r\n\t\tcase (957):\r\n\t\t\treturn \"with high wind, near gale\";\r\n\t\tbreak;\r\n\t\tcase (958):\r\n\t\t\treturn \"with a gale\";\r\n\t\tbreak;\r\n\t\tcase (959):\r\n\t\t\treturn \"and \" + prefixThere + \" a severe gale\";\r\n\t\tbreak;\r\n\t\tcase (960):\r\n\t\t\treturn \"and \" + prefixIs + \" storm\" + varIng + \"\";\r\n\t\tbreak;\r\n\t\tcase (961):\r\n\t\t\treturn \"with violent storms go\" + varIng + \" on\";\r\n\t\tbreak;\r\n\t\tcase (962):\r\n\t\t\treturn \"and \" + prefixThere + \" a hurricane\";\r\n\t\tbreak;\r\n\r\n\t}\r\n}", "title": "" }, { "docid": "bd10e9d5fa8bb5412a9bbf08401ab804", "score": "0.60305846", "text": "checkWeatherText() {\n\n if ( this.state.description === \"Sunny\" || this.state.description === \"Clear\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, rgb(249, 245, 148) 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 1');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 0');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 0');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 0');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'display: none');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'display: none');\n } else if ( this.state.description === \"Partly cloudy\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, rgb(249, 245, 148) 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 1');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 1');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 0');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'display: none');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'display: none');\n } else if ( this.state.description === \"Cloudy\" || this.state.description === \"Overcast\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, #ebebeb 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 0');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 1');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 1');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'display: none');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'display: none');\n } else if ( this.state.description === \"Patchy rain possible\" || this.state.description === \"Patchy light drizzle\"\n || this.state.description === \"Light drizzle\" || this.state.description === \"Patchy light rain\"\n || this.state.description === \"Light rain\" || this.state.description === \"Patchy light drizzle\"\n || this.state.description === \"Moderate rain at times\" || this.state.description === \"Moderate rain\"\n || this.state.description === \"Heavy rain at times\" || this.state.description === \"Heavy rain\"\n || this.state.description === \"Torrential rain shower\" || this.state.description === \"Patchy light rain with thunder\"\n || this.state.description === \"Moderate or heavy rain with thunder\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, lightblue 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 0');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 1');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 1');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'display: none');\n document.documentElement.style.setProperty('--precipitation', 'lightblue');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'opacity: 1');\n } else if ( this.state.description === \"Patchy snow possible\" || this.state.description === \"Blowing snow\"\n || this.state.description === \"Blizzard\" || this.state.description === \"Patchy light snow\"\n || this.state.description === \"Light snow\" || this.state.description === \"Patchy moderate snow\"\n || this.state.description === \"Moderate snow\" || this.state.description === \"Patchy heavy snow\"\n || this.state.description === \"Heavy snow\" || this.state.description === \"Light snow showers\"\n || this.state.description === \"Moderate or heavy snow showers\" || this.state.description === \"atchy light snow with thunder\"\n || this.state.description === \"Moderate or heavy snow with thunder\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, \t#E8E8E8 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 0');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 1');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 1');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'display: none');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'opacity: 1');\n document.documentElement.style.setProperty('--precipitation', '\t#DCDCDC');\n }\n }", "title": "" }, { "docid": "4e1a93aa4680106c49991eef750ba48f", "score": "0.59813154", "text": "function getIcon(condition) {\n switch (condition) {\n case \"Rain\":\n return \"fas fa-cloud-showers-heavy\";\n case \"Clouds\":\n return \"fas fa-cloud\";\n case \"Clear\":\n return \"fas fa-sun\";\n case \"Drizzle\":\n return \"fas fa-cloud-rain\";\n case \"Snow\":\n return \"fas fa-snowflake\";\n case \"Mist\":\n return \"fas fa-smog\";\n case \"Fog\":\n return \"fas fa-smog\";\n default:\n return \"fas fa-cloud-sun\";\n }\n}", "title": "" }, { "docid": "aafc99e6c19cdd244f827eeb00655ead", "score": "0.5955883", "text": "function currentWeather() {\r\n\r\n $('#fullAddress').text(fullAddress);\r\n switch (weatherData.currently.icon) {\r\n case 'clear-night':\r\n skycons.add(\"icon\", Skycons.CLEAR_NIGHT);\r\n break;\r\n case 'clear-day':\r\n skycons.add(\"icon\", Skycons.CLEAR_DAY);\r\n break;\r\n case 'partly-cloudy-day':\r\n skycons.add(\"icon\", Skycons.PARTLY_CLOUDY_DAY);\r\n break;\r\n case 'partly-cloudy-night':\r\n skycons.add(\"icon\", Skycons.PARTLY_CLOUDY_NIGHT);\r\n break;\r\n case 'cloudy':\r\n skycons.add(\"icon\", Skycons.CLOUDY);\r\n break;\r\n case 'rain':\r\n skycons.add(\"icon\", Skycons.RAIN);\r\n break;\r\n case 'sleet':\r\n skycons.add(\"icon\", Skycons.SLEET);\r\n break;\r\n case 'snow':\r\n skycons.add(\"icon\", Skycons.SNOW);\r\n break;\r\n case 'wind':\r\n skycons.add(\"icon\", Skycons.WIND);\r\n break;\r\n case 'fog':\r\n skycons.add(\"icon\", Skycons.FOG);\r\n break;\r\n }\r\n skycons.play();\r\n\r\n $('#temp').text(round(weatherData.currently.temperature, 0));\r\n\r\n if (weatherData.flags.units == 'si')\r\n $('#unit').html('&#8451;');\r\n\r\n else if (weatherData.flags.units == 'us')\r\n $('#unit').html('&#8457;');\r\n\r\n $('#sum').text(weatherData.currently.summary);\r\n}", "title": "" }, { "docid": "eab74181bc930a545925dd03bf71c4d5", "score": "0.5950951", "text": "getIcon(code) {\n let prefix = 'wi wi-';\n let icon = code\n\n let now = new Date()\n let sunrise = new Date(this.sunrise * 1000)\n let sunset = new Date(this.sunset * 1000)\n\n let tod = \"night-\"\n //determine if it is day or night\n if (now >= sunrise && now <= sunset) {\n tod = \"day-\"\n }\n //ids between 700-799 and 900-999 do not have day prefixes\n if (!(code > 699 && code < 800) && !(code > 899)) {\n icon = tod + icon\n }\n\n //add prefix\n icon = prefix + \"owm-\" + icon\n\n return icon\n }", "title": "" }, { "docid": "9130332fe7d84462cf923d9a3b03d8ed", "score": "0.59072757", "text": "function clear(codes) {\n var icon;\n if (codes.weather === 800) {\n icon = codes.icon.endsWith('d') ? 'meteo_32.png' : 'meteo_33.png';\n }\n return icon;\n }", "title": "" }, { "docid": "8014933504c8157d68d0b85f27352852", "score": "0.59051067", "text": "function getIcon(code) {\n if (code === '01d') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"3 3 26 26\">\n <title>sun</title>\n <path d=\"M16 9c-3.859 0-7 3.141-7 7s3.141 7 7 7 7-3.141 7-7c0-3.859-3.141-7-7-7zM16 21c-2.762 0-5-2.238-5-5s2.238-5 5-5 5 2.238 5 5-2.238 5-5 5zM16 7c0.552 0 1-0.448 1-1v-2c0-0.552-0.448-1-1-1s-1 0.448-1 1v2c0 0.552 0.448 1 1 1zM16 25c-0.552 0-1 0.448-1 1v2c0 0.552 0.448 1 1 1s1-0.448 1-1v-2c0-0.552-0.448-1-1-1zM23.777 9.635l1.414-1.414c0.391-0.391 0.391-1.023 0-1.414s-1.023-0.391-1.414 0l-1.414 1.414c-0.391 0.391-0.391 1.023 0 1.414s1.023 0.391 1.414 0zM8.223 22.365l-1.414 1.414c-0.391 0.391-0.391 1.023 0 1.414s1.023 0.391 1.414 0l1.414-1.414c0.391-0.392 0.391-1.023 0-1.414s-1.023-0.392-1.414 0zM7 16c0-0.552-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1s0.448 1 1 1h2c0.552 0 1-0.448 1-1zM28 15h-2c-0.552 0-1 0.448-1 1s0.448 1 1 1h2c0.552 0 1-0.448 1-1s-0.448-1-1-1zM8.221 9.635c0.391 0.391 1.024 0.391 1.414 0s0.391-1.023 0-1.414l-1.414-1.414c-0.391-0.391-1.023-0.391-1.414 0s-0.391 1.023 0 1.414l1.414 1.414zM23.779 22.363c-0.392-0.391-1.023-0.391-1.414 0s-0.392 1.023 0 1.414l1.414 1.414c0.391 0.391 1.023 0.391 1.414 0s0.391-1.023 0-1.414l-1.414-1.414z\"/>\n </svg>`;\n }\n\n if (code === '01n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"8.21 8.21 15.57 15.57\">\n <title>moon</title>\n <path d=\"M21.866 21.447c-3.117 3.12-8.193 3.12-11.313 0s-3.12-8.195 0-11.314c0.826-0.824 1.832-1.453 2.989-1.863 0.365-0.128 0.768-0.035 1.039 0.237 0.274 0.273 0.366 0.677 0.237 1.039-0.784 2.211-0.25 4.604 1.391 6.245 1.638 1.639 4.031 2.172 6.245 1.391 0.362-0.129 0.767-0.036 1.039 0.237 0.273 0.271 0.365 0.676 0.236 1.039-0.408 1.157-1.038 2.164-1.863 2.989zM11.967 11.547c-2.34 2.34-2.34 6.147 0 8.486 2.5 2.501 6.758 2.276 8.937-0.51-2.247 0.141-4.461-0.671-6.109-2.318s-2.458-3.861-2.318-6.108c-0.18 0.141-0.35 0.29-0.51 0.451z\"/>\n </svg>`;\n }\n if (code === '02d') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 0 32 32\">\n <title>cloudy-day</title>\n <path d=\"M13 4c0.552 0 1-0.448 1-1v-2c0-0.552-0.448-1-1-1s-1 0.448-1 1v2c0 0.552 0.448 1 1 1zM20.777 6.635l1.414-1.414c0.391-0.391 0.391-1.023 0-1.414s-1.023-0.391-1.414 0l-1.414 1.414c-0.391 0.391-0.391 1.023 0 1.414s1.023 0.391 1.414 0zM1 14h2c0.552 0 1-0.448 1-1s-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1s0.448 1 1 1zM22 13c0 0.552 0.448 1 1 1h2c0.552 0 1-0.448 1-1s-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1zM5.221 6.635c0.391 0.391 1.024 0.391 1.414 0s0.391-1.023 0-1.414l-1.414-1.414c-0.391-0.391-1.023-0.391-1.414 0s-0.391 1.023 0 1.414l1.414 1.414zM25 16c-0.332 0-0.66 0.023-0.987 0.070-1.048-1.43-2.445-2.521-4.029-3.219-0.081-3.789-3.176-6.852-6.984-6.852-3.859 0-7 3.141-7 7 0 1.090 0.271 2.109 0.719 3.027-3.727 0.152-6.719 3.211-6.719 6.973 0 3.859 3.141 7 7 7 0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7s-3.141-7-7-7zM13 8c2.488 0 4.535 1.823 4.919 4.203-0.626-0.125-1.266-0.203-1.919-0.203-2.871 0-5.531 1.238-7.398 3.328-0.371-0.698-0.602-1.482-0.602-2.328 0-2.762 2.238-5 5-5zM25 28c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.484 0 0.941 0.091 1.383 0.221 0.176 0.049 0.354 0.089 0.52 0.158 0.273-0.535 0.617-1.025 0.999-1.484 1.461-1.758 3.634-2.895 6.099-2.895 0.633 0 1.24 0.091 1.828 0.232 0.66 0.156 1.284 0.393 1.865 0.706 1.456 0.773 2.651 1.971 3.404 3.441 0.587-0.242 1.229-0.379 1.904-0.379 2.762 0 5 2.238 5 5s-2.238 5-5 5z\"/>\n </svg>`;\n }\n if (code === '02n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 2.42 32 29.57\">\n <title>cloudy-night</title>\n <path d=\"M27.191 16.385c0.305-0.227 0.613-0.449 0.889-0.725 0.826-0.827 1.454-1.833 1.862-2.991 0.13-0.362 0.038-0.768-0.236-1.039-0.272-0.273-0.676-0.366-1.039-0.237-2.212 0.781-4.605 0.25-6.244-1.391-1.641-1.641-2.174-4.033-1.391-6.244 0.128-0.363 0.036-0.767-0.237-1.040-0.271-0.271-0.676-0.365-1.039-0.237-1.159 0.411-2.164 1.039-2.99 1.864-2.096 2.094-2.749 5.063-2.030 7.737-2.703 0.345-5.133 1.781-6.751 3.987-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7 0-3.090-2.026-5.689-4.809-6.615zM18.182 5.76c0.159-0.161 0.329-0.311 0.509-0.452-0.141 2.249 0.671 4.461 2.319 6.108 1.648 1.648 3.861 2.458 6.109 2.319-0.862 1.099-2.050 1.783-3.32 2.074-1.711-2.172-4.225-3.539-6.997-3.762-0.767-2.122-0.318-4.59 1.38-6.288zM25 28c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.676 0 1.316 0.137 1.902 0.379 1.262-2.46 3.734-4.181 6.645-4.346 0.152-0.009 0.301-0.033 0.453-0.033 0.807 0 1.582 0.126 2.313 0.349 0.987 0.302 1.887 0.794 2.668 1.428 0.746 0.605 1.371 1.348 1.863 2.181 0.083 0.141 0.177 0.273 0.253 0.421 0.587-0.242 1.229-0.379 1.904-0.379 2.762 0 5 2.238 5 5s-2.238 5-5 5z\"/>\n </svg>`;\n }\n if (code === '03d' || code === '03n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 6 32 20\">\n <title>cloud</title>\n <path d=\"M25 10c-0.332 0-0.66 0.023-0.987 0.070-1.867-2.544-4.814-4.070-8.013-4.070s-6.145 1.526-8.013 4.070c-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7s-3.141-7-7-7zM25 22c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.676 0 1.316 0.138 1.902 0.38 1.327-2.588 3.991-4.38 7.098-4.38s5.771 1.792 7.096 4.38c0.587-0.242 1.229-0.38 1.904-0.38 2.762 0 5 2.238 5 5s-2.238 5-5 5z\"/>\n </svg>`;\n }\n if (code === '04d' || code === '04n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 6.57 32 25.43\">\n <title>cloudy</title>\n <path d=\"M32 15c0-3.073-2.5-5.572-5.573-5.572-0.15 0-0.298 0.007-0.447 0.018-1.445-1.803-3.624-2.874-5.98-2.874-2.355 0-4.535 1.070-5.98 2.874-0.148-0.012-0.298-0.018-0.449-0.018-3.070-0-5.57 2.499-5.57 5.572 0 0.322 0.043 0.631 0.094 0.94-0.034 0.044-0.074 0.085-0.107 0.13-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7 0-1.605-0.565-3.068-1.479-4.25 0.911-0.994 1.479-2.302 1.479-3.75zM25 28c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.676 0 1.316 0.137 1.902 0.379 0.035-0.066 0.078-0.125 0.113-0.189 0.352-0.642 0.785-1.23 1.292-1.753 1.443-1.495 3.448-2.438 5.693-2.438 3.107 0 5.771 1.792 7.096 4.379 0.353-0.145 0.729-0.238 1.117-0.301l0.787-0.078c0.771 0 1.492 0.19 2.145 0.5 0.707 0.338 1.314 0.836 1.79 1.449 0.656 0.845 1.065 1.897 1.065 3.051 0 2.762-2.238 5-5 5zM29.098 17.352c-1.155-0.841-2.563-1.352-4.098-1.352-0.332 0-0.66 0.023-0.987 0.070-1.867-2.544-4.814-4.070-8.013-4.070-2.133 0-4.145 0.69-5.809 1.896 0.467-1.428 1.796-2.467 3.379-2.467 0.484 0 0.941 0.098 1.359 0.271 0.949-1.848 2.852-3.126 5.070-3.126s4.122 1.279 5.068 3.126c0.421-0.173 0.88-0.271 1.359-0.271 1.974 0 3.573 1.599 3.573 3.572 0 0.905-0.348 1.721-0.902 2.351z\"/>\n </svg>`;\n }\n if (code === '09d' || code === '09n' || code === '10d' || code === '10n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 0 32 32\">\n <title>rainy</title>\n <path d=\"M25 4c-0.332 0-0.66 0.023-0.987 0.070-1.867-2.544-4.814-4.070-8.013-4.070s-6.145 1.526-8.013 4.070c-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7s-3.141-7-7-7zM25 16c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.676 0 1.316 0.138 1.902 0.38 1.327-2.588 3.991-4.38 7.098-4.38s5.771 1.792 7.096 4.38c0.587-0.242 1.229-0.38 1.904-0.38 2.762 0 5 2.238 5 5s-2.238 5-5 5zM14.063 30c0 1.105 0.895 2 2 2s2-0.895 2-2-2-4-2-4-2 2.895-2 4zM22 28c0 1.105 0.895 2 2 2s2-0.895 2-2-2-4-2-4-2 2.895-2 4zM6 24c0 1.105 0.894 2 2 2s2-0.895 2-2-2-4-2-4-2 2.895-2 4z\"/>\n </svg>`;\n }\n if (code === '11d' || code === '11n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 0 32 32\">\n <title>lightning</title>\n <path d=\"M12 24l2 2-2 6 6-6-2-2 2-4-6 4zM32 8.427c0-3.072-2.5-5.57-5.573-5.57-0.15 0-0.298 0.005-0.447 0.017-1.445-1.802-3.624-2.874-5.98-2.874-2.355 0-4.535 1.072-5.98 2.874-0.148-0.012-0.298-0.017-0.449-0.017-3.070 0-5.57 2.499-5.57 5.57 0 0.322 0.043 0.633 0.094 0.94-0.034 0.044-0.074 0.085-0.107 0.13-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 0.069 0.060 0.151 0.102 0.221 0.16l1.77-1.18c-0.59-0.418-1.141-0.883-1.602-1.438-0.813 0.572-1.801 0.915-2.871 0.915-2.762 0-5-2.237-5-5 0-2.76 2.238-5 5-5 0.676 0 1.316 0.138 1.902 0.38 0.035-0.068 0.078-0.125 0.113-0.19 0.352-0.642 0.785-1.229 1.292-1.753 1.443-1.493 3.448-2.438 5.693-2.438 3.107 0 5.771 1.792 7.096 4.38 0.353-0.146 0.729-0.24 1.117-0.302l0.787-0.078c0.771 0 1.492 0.19 2.145 0.5 0.707 0.339 1.314 0.836 1.79 1.45 0.656 0.845 1.065 1.896 1.065 3.050 0 2.763-2.238 5-5 5-1.070 0-2.057-0.344-2.871-0.915-0.875 1.055-2.027 1.848-3.322 2.348l-0.374 0.746 1.141 1.141c1.066-0.415 2.064-1.012 2.944-1.777 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7 0-1.604-0.565-3.068-1.479-4.25 0.911-0.992 1.479-2.301 1.479-3.75zM29.098 10.779c-1.155-0.84-2.563-1.352-4.098-1.352-0.332 0-0.66 0.023-0.987 0.070-1.867-2.543-4.814-4.070-8.013-4.070-2.133 0-4.145 0.691-5.809 1.897 0.467-1.428 1.796-2.467 3.379-2.467 0.484 0 0.941 0.098 1.359 0.271 0.949-1.849 2.852-3.128 5.070-3.128s4.122 1.279 5.068 3.128c0.421-0.173 0.88-0.271 1.359-0.271 1.974 0 3.573 1.599 3.573 3.57 0 0.906-0.348 1.723-0.902 2.352z\"/>\n </svg>`;\n }\n if (code === '13d' || code === '13n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0.5 1 47.01 47.01\">\n <title>snow</title>\n <path d=\"M14.5 24.502c0 1 0.16 1.97 0.44 2.871l-4.080 2.35-7.26-1.94c-1.31-0.35-2.66 0.43-3.020 1.729-0.35 1.311 0.43 2.65 1.75 3l5.87 1.57-1.58 5.84c-0.35 1.301 0.43 2.65 1.74 3 1.32 0.35 2.67-0.43 3.020-1.738l1.94-7.221 4.27-2.451c1.11 1.010 2.46 1.771 3.95 2.172v5.5l-5.32 4.488c-0.96 0.99-0.96 2.59 0 3.59 0.96 0.99 2.52 0.99 3.48 0l4.3-4.439 4.3 4.439c0.96 0.99 2.52 0.99 3.479 0 0.961-1 0.961-2.6 0-3.59l-5.319-4.488v-5.5c1.49-0.4 2.84-1.162 3.95-2.172l4.27 2.451 1.94 7.221c0.35 1.309 1.699 2.088 3.020 1.738 1.311-0.35 2.091-1.699 1.74-3l-1.58-5.84 5.87-1.57c1.32-0.35 2.1-1.689 1.75-3-0.359-1.299-1.71-2.078-3.020-1.729l-7.261 1.939-4.079-2.35c0.279-0.9 0.439-1.871 0.439-2.871s-0.16-1.97-0.439-2.88l4.079-2.34 7.261 1.94c1.31 0.35 2.66-0.431 3.020-1.73 0.35-1.31-0.43-2.65-1.75-3l-5.87-1.57 1.58-5.84c0.351-1.3-0.43-2.649-1.74-3-1.32-0.35-2.67 0.43-3.020 1.74l-1.94 7.22-4.27 2.45c-1.11-1.010-2.46-1.77-3.95-2.17v-4.5l5.319-5.49c0.961-0.99 0.961-2.59 0-3.59-0.96-0.99-2.52-0.99-3.479 0l-4.3 4.442-4.3-4.44c-0.96-0.99-2.52-0.99-3.48 0-0.96 1-0.96 2.6 0 3.59l5.32 5.49v4.5c-1.49 0.4-2.84 1.16-3.95 2.17l-4.27-2.45-1.94-7.22c-0.35-1.311-1.7-2.090-3.020-1.74-1.31 0.351-2.090 1.7-1.74 3l1.58 5.84-5.87 1.57c-1.32 0.35-2.1 1.69-1.75 3 0.36 1.3 1.71 2.080 3.020 1.73l7.26-1.94 4.080 2.34c-0.28 0.91-0.44 1.879-0.44 2.879zM24 29.002c-2.49 0-4.5-2.010-4.5-4.5s2.010-4.5 4.5-4.5 4.5 2.010 4.5 4.5c0 2.49-2.010 4.5-4.5 4.5z\"/>\n </svg>`;\n }\n if (code === '50d' || code === '50n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"1.94 5.94 30 18\">\n <title>mist</title>\n <path d=\"M30.938 13.938h-5.102c-0.504-4.487-4.277-8-8.898-8-3.113 0-5.859 1.591-7.477 4h-6.523c-0.552 0-1 0.448-1 1s0.448 1 1 1h5.552c-0.226 0.638-0.374 1.306-0.45 2h-3.102c-0.552 0-1 0.448-1 1s0.448 1 1 1h3.102c0.077 0.693 0.224 1.363 0.45 2h-5.37c-0.654 0-1.182 0.448-1.182 1s0.529 1 1.182 1h6.341c1.617 2.41 4.363 4 7.477 4s5.859-1.59 7.477-4h2.341c0.654 0 1.182-0.448 1.182-1s-0.529-1-1.182-1h-1.37c0.227-0.637 0.372-1.307 0.451-2h5.102c0.552 0 1-0.448 1-1s-0.448-1-1-1zM10.639 11.938h6.298c0.552 0 1-0.448 1-1s-0.448-1-1-1h-4.884c1.263-1.233 2.983-2 4.884-2 3.518 0 6.409 2.617 6.898 6h-13.797c0.102-0.707 0.302-1.378 0.6-2zM16.938 21.938c-1.901 0-3.621-0.768-4.884-2h9.767c-1.262 1.232-2.982 2-4.883 2zM23.234 17.938h-12.595c-0.298-0.622-0.499-1.293-0.6-2h13.797c-0.102 0.707-0.302 1.378-0.602 2z\"/>\n </svg>`;\n }\n\n return '';\n}", "title": "" }, { "docid": "a15ad240671b9e87a2b447bf3b240268", "score": "0.5877018", "text": "function replaceWeatherText(weather) {\n var weather = weather['forecast'];\n $('#weather-info').html(weather);\n}", "title": "" }, { "docid": "c4dfab5918ca73c50d2e45f36a92b391", "score": "0.58724546", "text": "static mainToIcon(weatherMain){\n\n let icon = `clear`;\n\n switch (weatherMain){\n case `Thunderstorm`:\n icon = `thunderstorm`;\n break;\n case `Drizzle`:\n icon = `few`;\n break;\n case `Rain`:\n icon = `rain`;\n break;\n case `Snow`:\n icon = `snow`;\n break;\n case `Clear`:\n icon = `clear`;\n break;\n case `Clouds`:\n icon = `scattered`;\n break;\n default:\n icon = `mist`;\n }\n\n return icon;\n }", "title": "" }, { "docid": "1aaebc4adc2c17b7cb1bd7b2311888aa", "score": "0.5869571", "text": "function iconFromWeatherId(weatherId) {\n switch (weatherId) {\n case '31': //clear (night)\n case '32': //sunny\n case '33': //fair (night)\n case '34': //fair (day)\n return 1; //Sunny\n case '29': //partly cloudy (night)\n case '30': //partly cloudy (day)\n case '44': //partly cloudy\n return 2; //Partly Cloudy\n case '26': //cloudy\n case '27': //mostly cloudy (night)\n case '28': //mostly cloudy (day)\n return 3; //Cloudy\n case '23': //blustery\n case '24': //windy\n return 4; //Windy\n case '19': //dust\n case '20': //foggy\n case '21': //haze\n case '22': //smoky\n return 5; //Low Visility\n case '4': //thunderstorms\n case '37': //isolated thunderstorms\n return 6; //Isolated Thunderstorms\n case '3': //severe thunderstorms\n case '38': //scattered thunderstorms\n case '39': //scattered thunderstorms\n return 7; //Scattered Thunderstorms\n case '9': //drizzle\n return 8; //Drizzle\n case '11': //showers\n case '12': //showers\n case '40': //scattered showers\n return 9; //Rain\n case '8': //freezing drizzle\n case '10': //freezing rain\n case '17': //hail\n case '35': //mixed rain and hail\n return 10; //Hail\n case '15': //blowing snow\n case '16': //snow\n case '18': //sleet\n case '41': //heavy snow\n case '43': //heavy snow\n case '46': //snow showers\n return 11; //Snow\n case '5': //mixed rain and snow\n case '6': //mixed rain and sleet\n case '7': //mixed snow and sleet\n return 12; //Mixed Snow\n case '25': //cold\n return 13; //Cold\n case '0': //tornado\n return 14; //Tornado\n case '1': //tropical storm\n return 15; //Storm\n case '13': //snow flurries\n case '14': //light snow showers\n case '42': //scattered snow showers\n return 16; //Light Snow\n case '36': //hot\n return 17; //Hot\n case '2': //hurricane\n return 18; //Hurricane\n case '45': //thundershowers\n case '47': //isolated thundershowers\n return 19; // Thundershowers\n default:\n return 0; // N/A\n }\n}", "title": "" }, { "docid": "45b6eb5c37e5c13a98cfac74286709a5", "score": "0.58053255", "text": "function satIcons(object, icon) {\n // Iterates through all satellites pulled from N2YO\n object.above.forEach(sat => {\n // Creates marker for each satellite with custom icon\n const satMarker = new google.maps.Marker({\n // Sets icon position per N2YO data\n position: new google.maps.LatLng(sat.satlat, sat.satlng),\n icon: icon,\n map: map\n })\n\n const launchDate = new Date(sat.launchDate);\n\n // Conversions\n const launchYear = launchDate.getFullYear().toString();\n\n let launchDay = (launchDate.getDate() + 1).toString();\n launchDay = launchDay.length > 1 ? launchDay : `0${launchDay}`;\n\n let launchMonth = (launchDate.getMonth() + 1).toString();\n launchMonth = launchMonth.length > 1 ? launchMonth : `0${launchMonth}`;\n\n\n // Sets data to display in infowindow for each satellite\n const contentString = `\n <h5 class=\"satname\">Satellite: ${sat.satname}</h5>\n <ul class=\"satfacts\">\n <li>Launch Date: ${launchMonth}/${launchDay}/${launchYear}</li>\n <li>Altitude: ${(Math.round(((sat.satalt * 0.621371) + Number.EPSILON) * 100) / 100).toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,')} miles / \n ${(Math.round((((sat.satalt * 0.621371) * 5280) + Number.EPSILON) * 100) / 100).toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,')} feet</li>\n <li>Latitude: ${sat.satlat}</li>\n <li>Longitude: ${sat.satlng}</li>\n </ul>`;\n\n // Creates new infowindow for each satellite\n const infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n\n // Adds listener to open when satellite icon is clicked\n satMarker.addListener(\"click\", () => {\n infowindow.open(map, satMarker);\n openInfoWindows.push(infowindow);\n })\n\n // Pushes satMarker variables to array for later removal on next search\n satMarkerArray.push(satMarker);\n infoWindowArray.push(infowindow);\n })\n }", "title": "" }, { "docid": "fef4a577d5496218397452e70b35770a", "score": "0.57749015", "text": "function conditionsIcon(response) {\n var weatherIcon = \"\";\n var clouds = response.current.clouds;\n var conditions = response.current.weather.main\n\n if (clouds < 30) {\n weatherIcon = $(\"<img class='icon' src='assets/images/iconfinder_weather_sun_sunny_hot_5719151.png'>\");\n } else if (clouds >= 30 && clouds <= 70) {\n weatherIcon = $(\"<img class='icon' src='assets/images/iconfinder_weather_sun_sunny_cloud_5719152.png'>\");\n } else if (clouds > 70) {\n weatherIcon = $(\"<img class='icon' src='assets/images/iconfinder_weather_cloud_cloudy_5719165.png'>\");\n } else if (conditions === \"Drizzle\" || conditions === \"Rain\") {\n weatherIcon = $(\"<img class='icon' src='iconfinder_weather_heavy_rain_cloud_5719160.png'>\");\n } else if (conditions === \"Snow\") {\n weatherIcon = $(\"<img class='icon' src='iconfinder_weather_winter_cold_5719150.png'>\");\n } else if (conditions === \"Thunderstorm\") {\n weatherIcon = $(\"<img class='icon' src='iconfinder_weather_heavy_rain_thunder_storm_5719159.png'>\");\n };\n //appends icon to page after weather is determined\n $(\"#cityName\").append(weatherIcon);\n}", "title": "" }, { "docid": "4ec684ff754a38197e1c8fce6cc35b35", "score": "0.5754695", "text": "function setIcon (ID) {\n switch(ID) {\n case 800:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='clear-day.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='clear-night.png'/>\");\n }\n break;\n case 801:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='cloudy-day.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='cloudy-night.png'/>\");\n }\n break;\n case 802:\n case 803:\n case 804:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='cloudy.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='cloudy-night.png'/>\");\n }\n break;\n case 300:\n case 301:\n case 302:\n case 310:\n case 311:\n case 312:\n case 313:\n case 314:\n case 321: \n case 500:\n case 501:\n case 502:\n case 503:\n case 504:\n case 511:\n case 520:\n case 521:\n case 522:\n case 531:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='rainy-day.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='rainy-night.png'/>\");\n }\n break;\n case 600:\n case 601:\n case 602:\n case 611:\n case 612:\n case 615:\n case 616:\n case 620:\n case 621:\n case 622:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='snowy-day.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='snowy-night.png'/>\");\n }\n break;\n case 200:\n case 201:\n case 202:\n case 210:\n case 211:\n case 212:\n case 221:\n case 230:\n case 231:\n case 232:\n $('#weatherIcon').html(\"<img src='tstorms.png'/>\");\n break;\n }\n}", "title": "" }, { "docid": "d809fa169789a055a27d90467e585e01", "score": "0.5751818", "text": "function addWeatherIcon(setWeatherCondition){\n let iconURL; \n switch(setWeatherCondition){\n case 'Clear':\n iconURL = \"http://openweathermap.org/img/wn/[email protected]\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Clouds':\n iconURL = \"http://openweathermap.org/img/wn/[email protected]\";\n weatherConditionIcon.attr('src', iconURL)\n break; \n case 'Drizzle':\n iconURL = \"http://openweathermap.org/img/wn/[email protected]\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Rain':\n iconURL = \"http://openweathermap.org/img/wn/[email protected]\";\n weatherConditionIcon.attr('src', iconURL)\n break; \n case 'Thunderstorm':\n iconURL = \"http://openweathermap.org/img/wn/[email protected]\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Snow':\n iconURL = \"http://openweathermap.org/img/wn/[email protected]\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Mist':\n case 'Smoke':\n case 'Haze':\n case 'Dust':\n case 'Fog':\n case 'sand':\n case 'Ash':\n case 'Squall':\n case 'Tornado':\n iconURL = \"http://openweathermap.org/img/wn/[email protected]\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n default: \n console.log(\"Issue with the icons\");\n console.log(setWeatherCondition);\n };\n }", "title": "" }, { "docid": "072c86f98aa5ff062506ebb8d1edc417", "score": "0.5749641", "text": "function day3() {\n $('#day-3').addClass('forecasted-days');\n $('#next-day3').text(response.list[20].dt_txt.split(' ')[0]);\n var nextDayIcon3 = $('#icon-next-day3');\n renderNextDayIcon3();\n var tempF3 = (response.list[20].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp3').text(\"Temp: \" + tempF3.toFixed() + '°F');\n $('#next-day-humidity3').text('Humidity: ' + response.list[20].main.humidity + '%');\n function renderNextDayIcon3() {\n if (response.list[20].weather[0].main === \"Clouds\") {\n nextDayIcon3.text(' ☁️');\n } else if (response.list[20].weather[0].main === \"Clear\") {\n nextDayIcon3.text(' ☀️');\n } else if (response.list[20].weather[0].main === \"Rain\") {\n nextDayIcon3.text(' 🌧');\n } else if (response.list[20].weather[0].main === \"Snow\") {\n nextDayIcon3.text(' 🌨');\n };\n }\n }", "title": "" }, { "docid": "062611b71337eb4ca190212d4c7b5d52", "score": "0.5743596", "text": "function weeklyForecast() {\n\t\t\tfor (let i = 0; i < (data.cities[city].weekly.length); i++) {\n\t\t\t\tif (i >= 2 && i <= 8) {\n\t\t\t\t\tlet li = document.createElement('li');\n\t\t\t\t\tlet text, img;\n\t\t\t\t\tlet day = data.cities[city].weekly[i].weekday;\n\t\t\t\t\tlet d = new Date();\n\t\t\t\t let current = d.getDay()\n\t\t\t\t\tcurrent = (current + 2);\n\t\t\t\t\tlet high = data.cities[city].weekly[i].high;\n\t\t\t\t\tlet low = data.cities[city].weekly[i].low;\n\t\t\t\t\tlet condition = data.cities[city].weekly[i].daycondition;\n\t\t\t\t\tlet awicon = data.cities[city].weekly[i].awdayicon;\n\n\t\t\t\t\tfor (var j=0; j<=obj.weather.length; j++) {\n\t\t\t\t\t\tlet x = 6;\n\t\t\t\t\t\tlet urlSetup = obj.weather[j].id;\n\t\t\t\t\t\tif (awicon == urlSetup && j <= x) {\n\t\t\t\t\t\t\timg = '<img src=\\\"svg/' + urlSetup + '.svg\\\" alt=\\\"' + awicon + '\\\" />';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (j >= x) {\n\t\t\t\t\t\t\tconsole.log('Else ' + awicon);\n\t\t\t\t\t\t\timg = '<img src=\\\"svg/cloudy.svg\\\" alt=\\\"' + awicon + '\\\" />';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (current == i) {\n\t\t\t\t\t\ttext = img + '<p><strong><i>Today</i> / ' + day + ' &middot</strong>' + ' High of ' + high + ' / Low of ' + low + '<span>' + condition + '</span>' + '</p>';\n\t\t\t\t\t\tli.classList.add(\"current-day\");\n\t\t\t\t\t\tli.innerHTML = text;\n\t\t\t\t\t\tweeklyList.appendChild(li);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext = img + '<p><strong>' + day + ' &middot</strong>' + ' High of ' + high + ' / Low of ' + low + '<span>' + condition + '</span>' + '</p>';\n\t\t\t\t\t\tli.innerHTML = text;\n\t\t\t\t\t\tweeklyList.appendChild(li);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "271bce550eee7ff03a11b9d76fc071fc", "score": "0.57199967", "text": "function getWeather(){\n $.getJSON(api, function(data){\n var windDirectionData = data.current.wind_dir;\n var weatherIcon = data.current.condition.icon;\n var WindDirection = \"\";\n switch (windDirectionData){\n case \"N\":\n WindDirection = \"North\";\n break;\n case \"NbE\":\n WindDirection = \"North by East\";\n break;\n case \"NNE\":\n WindDirection = \"North-northeast\";\n break;\n case \"NEbN\":\n WindDirection = \"Northeast by north\";\n break;\n case \"NE\":\n WindDirection = \"Northeast\";\n break;\n case \"NEbE\":\n WindDirection = \"North\";\n break;\n case \"ENE\":\n WindDirection = \"East-northeast\";\n break;\n case \"EbN\":\n WindDirection = \"East by north\";\n break;\n case \"E\":\n WindDirection = \"East\";\n break;\n case \"EbS\":\n WindDirection = \"East by south\";\n break;\n case \"ESE\":\n WindDirection = \"East-southeast\";\n break;\n case \"SEbE\":\n WindDirection = \"Southeast by east\";\n break;\n case \"SE\":\n WindDirection = \"Southeast\";\n break;\n case \"SEbS\":\n WindDirection = \"Southeast by south\";\n break;\n case \"SSE\":\n WindDirection = \"South-southeast\";\n break;\n case \"SbE\":\n WindDirection = \"Sout by east\";\n break;\n case \"S\":\n WindDirection = \"South\";\n break;\n case \"SbW\":\n WindDirection = \"South by West\";\n break;\n case \"SSW\":\n WindDirection = \"South-southwest\";\n break;\n case \"SWbS\":\n WindDirection = \"Southwest by south\";\n break;\n case \"SW\":\n WindDirection = \"Soutwest\";\n break;\n case \"SWbW\":\n WindDirection = \"Southwest by west\";\n break;\n case \"WSW\":\n WindDirection = \"West-southwest\";\n break;\n case \"WbS\":\n WindDirection = \"West by south\";\n break;\n case \"W\":\n WindDirection = \"West\";\n break;\n case \"WbN\":\n WindDirection = \"West by North\";\n break;\n case \"WNW\":\n WindDirection = \"West-northwest\";\n break;\n case \"NWbW\":\n WindDirection = \"Northwest by west\";\n break;\n case \"NW\":\n WindDirection = \"Nortwest\";\n break;\n case \"NWbN\":\n WindDirection = \"Northwest by north\";\n break;\n case \"NNW\":\n WindDirection = \"North-northwest\";\n break;\n case \"NbW\":\n WindDirection = \"North by west\";\n break;\n }\n\n\n\n document.getElementById(\"pHumidity\").innerHTML = data.current.humidity + \" %\";\n document.getElementById(\"pWindDirection\").innerHTML = WindDirection;\n document.getElementById(\"iWeatherIcon\").src= data.current.condition.icon;\n document.getElementById(\"conditionText\").innerHTML = data.current.condition.text;\n });\n }", "title": "" }, { "docid": "f8a0c35af5dee3af4bbbb6e43702bc56", "score": "0.5699954", "text": "function forecastWeather(ForecastArray,domforecast){\n for(var iterator=0;iterator<ForecastArray.length;iterator++){\n var fdate=ForecastArray[iterator].date.split(\"-\");\n domforecast[iterator].children[0].textContent=fdate[2]+\"/\"+fdate[1];\n domForecast[iterator].children[1].children[0].src=ForecastArray[iterator].day.condition.icon;\n domforecast[iterator].children[2].textContent=ForecastArray[iterator].day.maxtemp_c+String.fromCharCode(176)+'C';\n }\n}", "title": "" }, { "docid": "32a18c7464a6e371b8bbc88d78f3d8a0", "score": "0.5681937", "text": "function update_virusicons(week_text) {\n setVirusIconScaleByCases(week_text, \"Bayern\", bayern_virus);\n setVirusIconScaleByCases(week_text, \"Baden-Wurttemberg\", baden_virus);\n setVirusIconScaleByCases(week_text, \"Nordrhein-Westfalen\", nrw_virus);\n setVirusIconScaleByCases(week_text, \"Hessen\", hessen_virus);\n setVirusIconScaleByCases(week_text, \"Niedersachsen\", niedersachsen_virus);\n setVirusIconScaleByCases(week_text, \"Schleswig-Holstein\", schleswigholst_virus);\n setVirusIconScaleByCases(week_text, \"Mecklenburg-Vorpommern\", mecklvorp_virus);\n setVirusIconScaleByCases(week_text, \"Saarland\", saarland_virus);\n setVirusIconScaleByCases(week_text, \"Rheinland-Pfalz\", rheinlandpfalz_virus);\n setVirusIconScaleByCases(week_text, \"Thuringen\", thueringen_virus);\n setVirusIconScaleByCases(week_text, \"Sachsen\", sachsen_virus);\n setVirusIconScaleByCases(week_text, \"Hamburg\", hamburg_virus);\n setVirusIconScaleByCases(week_text, \"Bremen\", bremen_virus);\n setVirusIconScaleByCases(week_text, \"Berlin\", berlin_virus);\n setVirusIconScaleByCases(week_text, \"Brandenburg\", brandenburg_virus);\n setVirusIconScaleByCases(week_text, \"Sachsen-Anhalt\", sachsenanhalt_virus);\n}", "title": "" }, { "docid": "7be57f4284c23964fffa400e83a300e8", "score": "0.5669447", "text": "function displayForecast(forecast){\n var day;\n var dayId;\n var icon;\n var iconId;\n var iconSrc;\n var high;\n var highId;\n var low;\n var lowId;\n\n\n //loop to diaplay date, weather icon, high, and low temp in cards for 5 day forecast\n for(var i = 0; i < 5; i++){\n\n day = returnTime(forecast[i].dt);\n dayId = '#day' + i;\n $(dayId).text(day);\n\n icon = forecast[i].weather[0].icon;\n iconSrc = 'https://openweathermap.org/img/wn/' + icon + '@2x.png';\n iconId = '#weatherIcon' + i;\n $(iconId).attr('src', iconSrc);\n\n high = 'High: ' + forecast[i].temp.max;\n highId = '#high' + i;\n $(highId).text(high);\n $(highId).append(' &#8457;');\n\n low = 'Low: ' + forecast[i].temp.min;\n lowId = '#low' + i;\n $(lowId).text(low);\n $(lowId).append(' &#8457;');\n\n }//end for loop\n\n //display weather\n $('.cityWeather').css('visibility', 'visible');\n\n} //end function displayForecast", "title": "" }, { "docid": "60ee2bbf418a901624c81b306aca4224", "score": "0.5649561", "text": "function createWeatherIcon(iconCode){\n clearIconCode = iconCode.slice(1, -1);\n let iconURL = \"https://openweathermap.org/img/wn/\"+clearIconCode+\"@2x.png\";\n return iconURL;\n }", "title": "" }, { "docid": "980215cd4aee50b6493568d077102d38", "score": "0.56356525", "text": "function getWeatherData(data) {\n let date = new Date();\n let currentTime = date.getHours();\n if (data.clouds == undefined) {\n TEMPERATURE.textContent = \"-\";\n TEMP_MIN.textContent = \"-\";\n TEMP_MAX.textContent = \"-\";\n PRESSURE.textContent = \"---\";\n HUMIDITY.textContent = \"---\";\n WIND.textContent = \"---\";\n CLOUDS.textContent = \"---\";\n WIND_DIR.textContent = \"---\";\n CITY.textContent = \"Nie znaleziono miasta!\";\n RAIN.textContent = \"---\";\n MAIN_ICON.classList.add(\"wi-na\");\n } else if (currentTime >= 6 && currentTime <= 18 && data.clouds.all < \"25\") {;\n MAIN_ICON.classList.add(\"wi-day-sunny\");\n } else if (currentTime >= 18 && currentTime <= 6 && data.clouds.all < \"25\") {\n MAIN_ICON.classList.add(\"wi-night-clear\");\n } else if (currentTime >= 6 && currentTime <= 18 && data.clouds.all >= \"25\" && data.clouds.all < \"50\") {\n MAIN_ICON.classList.add(\"wi-day-cloudy\");\n } else if (currentTime >= 18 && currentTime <= 6 && data.clouds.all >= \"25\" && data.clouds.all < \"50\") {\n MAIN_ICON.classList.add(\"wi-night-alt-cloudy\");\n } else if (currentTime >= 6 && currentTime <= 18 && data.clouds.all >= \"50\" && data.clouds.all < \"75\") {\n MAIN_ICON.classList.add(\"wi-day-cloudy-high\");\n } else if (currentTime >= 18 && currentTime <= 6 && data.clouds.all >= \"50\" && data.clouds.all < \"75\") {\n MAIN_ICON.classList.add(\"wi-night-alt-cloudy-high\");\n } else if (data.clouds.all >= \"75\") {\n MAIN_ICON.classList.add(\"wi-cloudy\");\n }\n TEMPERATURE.textContent = data.main.temp;\n TEMP_MIN.textContent = data.main.temp_min;\n TEMP_MAX.textContent = data.main.temp_max;\n PRESSURE.textContent = data.main.pressure + \" hPa\";\n HUMIDITY.textContent = data.main.humidity + \" %\";\n WIND.textContent = data.wind.speed + \" m/s\";\n CLOUDS.textContent = data.clouds.all + \" %\";\n WIND_DIR.textContent = data.wind.deg;\n CITY.textContent = data.name;\n if (data.rain !== undefined) {\n RAIN.textContent = data.rain + \" %\";\n } else {\n RAIN.textContent = \"b/d\";\n }\n }", "title": "" }, { "docid": "730f3d35ffa2eefbae1120cdbaf9eb02", "score": "0.5632104", "text": "function getWeatherForecast(strReason) {\n weather.fetchWeather2(strReason,\"getWeatherForcast\",\"app::index\");\n}", "title": "" }, { "docid": "ed9479e90d32bf7bf59711facfd03876", "score": "0.56316596", "text": "function displayForecast(times) {\n ++count;\n var temp = times[i].main.temp;\n $('.temp' + j).text(temp);\n\n var current = times[i].weather[0].description;\n $('.info' + j + ' h3').text(current);\n\n var wind = times[i].wind.speed;\n $('.info' + j + ' .wind span[data-wind]').text(wind);\n\n var humidity = times[i].main.humidity;\n $('.info' + j + ' span[data-humidity]').text(humidity);\n\n var weatherIconId = times[i].weather[0].icon;\n var weatherURL = \"http://openweathermap.org/img/w/\" +\n weatherIconId + \".png\";\n\n var weatherImg = \"<img src='\" + weatherURL + \"' class='icon-img'>\";\n $('.icon' + j).html(weatherImg);\n\n j++;\n }", "title": "" }, { "docid": "bdad8a8a95594054acdebdb8d094dcf2", "score": "0.5631192", "text": "function displayCurrentWeather(data) {\n //Current Weather\n const currentWeather = Math.round(data.main.temp).toString() + \" \\xB0 F\";\n $(\".current-weather\").prepend(currentWeather);\n\n //Weather Icon\n let iconCode = data.weather[0].icon;\n let iconURL = \"http://openweathermap.org/img/wn/\" + iconCode + \"@2x.png\";\n $(\".wicon\").attr(\"src\", iconURL);\n\n //feels like\n let feelsLike = Math.round(data.main.feels_like).toString() + \" \\xB0 F\";\n $(\".feels-like\").append(\" \" + feelsLike);\n\n //Weather Description\n let weatherDescription = data.weather[0].description;\n $(\".weather-description\").text(weatherDescription);\n\n //Humidity\n let humidity = data.main.humidity;\n $(\".humidity\").append(\" \" + humidity + \"%\");\n\n //Wind\n let wind = data.wind.speed;\n $(\".wind\").append(\" \" + wind + \" mph\");\n\n //Sunrise/Sunset\n let timeZone;\n timeZone = data.timezone;\n\n let sunrise = data.sys.sunrise + timeZone;\n sunrise = convertTimestamptoTime(sunrise);\n sunrise = sunrise.split(\":\").slice(0, 2);\n sunrise = formatTime(sunrise[0], parseInt(sunrise[1]));\n $(\".sunrise\").append(\" \" + sunrise);\n\n let sunset = data.sys.sunset + timeZone;\n sunset = convertTimestamptoTime(sunset);\n sunset = sunset.split(\":\").slice(0, 2);\n sunset = formatTime(sunset[0], parseInt(sunset[1]));\n $(\".sunset\").append(\" \" + sunset);\n}", "title": "" }, { "docid": "529e271e45ef0c375210efeddc85630c", "score": "0.56216425", "text": "function approximateIcons(currIcon) {\n console.log('currIcon', currIcon);\n if (currIcon === 'clear-day') {\n return 'sun';\n } else if (currIcon === 'fog') {\n return 'visibility';\n } else if (isDay(currIcon)) {\n return 'weather';\n }\n for (var i = 0, length = iconStrs.length; i < length; i++) {\n if (iconStrs[i] === currIcon) {\n return currIcon;\n }\n }\n return 'weather';\n }", "title": "" }, { "docid": "0a77873708b00a005ca901efb7156dd8", "score": "0.56163913", "text": "function displayWeather(data) {\n changeHero(loc.data.name);\n $('#cityName').text(`${loc.data.name}`)\n $('#cityTemp').text(`${parseInt(data.data.current.temp)}`);\n if (unit == \"imperial\") {\n $('#cityUnit').attr('class', 'icofont-fahrenheit');\n } else {\n $('#cityUnit').attr('class', 'icofont-celsius');\n }\n\n $('.high').each(function(ind, el) {\n $(el).text(`${parseInt(data.data.daily[ind].temp.max)}`);\n });\n\n $('.low').each(function(ind, el) {\n $(el).text(`${parseInt(data.data.daily[ind].temp.min)}`);\n });\n\n $('.day').each(function(ind, el) {\n let newDate = new Date(data.data.daily[ind].dt * 1000);\n let day = newDate.toDateString().slice(0, 3);\n $(el).text(`${day} ${newDate.getDate()}`);\n });\n\n $('.mainWeather').each(function(ind, el) {\n switch (data.data.daily[ind].weather[0].main.trim()) {\n case \"Clouds\":\n $(this).text('Cloudy');\n break;\n case \"Rain\":\n $(this).text('Rainy');\n break;\n case \"Clear\":\n $(this).text('Clear');\n break;\n case \"Snow\":\n $(this).text('Snow');\n break;\n case \"Drizzle\":\n $(this).text('Light Rain');\n break;\n case \"Thunderstorm\":\n $(this).text('Thunderstorms');\n break;\n default:\n $(this).text('Cloudy');\n break;\n }\n });\n\n $('.weatherIcon').each(function(ind, el) {\n switch (data.data.daily[ind].weather[0].main.trim()) {\n case \"Clouds\":\n $(this).attr('class', 'weatherIcon icofont-cloudy');\n break;\n case \"Rain\":\n $(this).attr('class', 'weatherIcon icofont-rainy');\n break;\n case \"Clear\":\n $(this).attr('class', 'weatherIcon icofont-sun');\n break;\n case \"Snow\":\n $(this).attr('class', 'weatherIcon icofont-snow');\n break;\n case \"Drizzle\":\n $(this).attr('class', 'weatherIcon icofont-rainy-sunny');\n break;\n case \"Thunderstorm\":\n $(this).attr('class', 'weatherIcon icofont-rainy-thunder');\n break;\n default:\n $(this).attr('class', 'weatherIcon icofont-clouds');\n break;\n }\n });\n\n $('.desc').each(function(ind, el) {\n $(el).text(`${data.data.daily[ind].weather[0].description.trim()}`);\n });\n\n\n $('.humid').each(function(ind, el) {\n $(el).text(` ${data.data.daily[ind].humidity} %`);\n });\n\n\n $('.uvi').each(function(ind, el) {\n $(el).text(` ${data.data.daily[ind].uvi}`);\n let uv = parseInt(data.data.daily[ind].uvi);\n switch (uv) {\n case 11:\n $(this).parent().attr('class', 'ui label image violet');\n case 8:\n case 9:\n case 10:\n $(this).parent().attr('class', 'ui label image red');\n break;\n case 6:\n case 7:\n $(this).parent().attr('class', 'ui label image orange');\n break;\n case 3:\n case 4:\n case 5:\n $(this).parent().attr('class', 'ui label image yellow');\n break;\n case 0:\n case 1:\n case 2:\n $(this).parent().attr('class', 'ui label image green');\n break;\n }\n });\n\n\n $('.wind').each(function(ind, el) {\n $(el).text(` ${data.data.daily[ind].wind_speed} MPH`);\n });\n\n animateWeather(data.data.current.weather[0].main.trim())\n\n setTimeout(() => {\n $('.segment').dimmer('hide');\n }, 250);\n\n}", "title": "" }, { "docid": "4be62a842ce31a8147f4661a285d4f2b", "score": "0.5600368", "text": "function showWeather(position){\n console.log(position);\n\n $.ajax(\n \"https://api.darksky.net/forecast/\" + _APIkey + \n \"/\" +\n position.coords.latitude +\n \",\" +\n position.coords.longitude,\n\n { \n \"method\" : \"GET\",\n \"data\": \"json\",\n \"dataType\" : \"jsonp\",\n \"success\" : data => {\n console.log(data);\n \n $tempUnit.text(data.currently.temperature);\n $tempIcon.html(\"&deg;F\");\n $status.text(data.currently.summary);\n $location.text(data.timezone);\n\n // create weather icon\n\n const skycon = new Skycons({\"color\":\"#0085aa\", \"resizeClear\":true});\n let iconType = data.currently.icon.replace(/-/g, \"_\").toUpperCase();\n console.log(iconType);\n skycon.add(\"icon\", Skycons[iconType] || Skycons['DEFAULT']);\n skycon.play();\n\n // forgive me for i have sinned,\n // i will be back to write better code\n const tempUnitFahrenheit = $tempUnit.text();\n const tempUnitCelsius = convertToCelsius($tempUnit.text());\n\n $(\".switch\").show();\n\n $tempButton.on(\"click\", () => {\n if (!$tempButton.is(\":checked\")) {\n $tempUnit.text(tempUnitFahrenheit);\n $tempIcon.html(\"&deg;F\");\n }\n else {\n $tempUnit.text(tempUnitCelsius);\n $tempIcon.html(\"&deg;C\");\n \n } \n });\n\n }\n\n }\n );\n }", "title": "" }, { "docid": "c3248f98a2cf852e54bddf293fd93898", "score": "0.5598771", "text": "function extractWeather(data){\r\n\tvar tempCels = Math.round(parseFloat(data.main.temp));\r\n\tvar feelsCels = Math.round(parseFloat(data.main.feels_like));\r\n\tvar description = data.weather[0].description;\r\n\tvar icon = data.weather[0].icon;\r\n\tchangeHTML(tempCels, feelsCels, description, icon);\r\n}", "title": "" }, { "docid": "158b61716683290109b87a2a5a6f3053", "score": "0.55967313", "text": "function setForecast(forecast){\n\t\tfor(i = 0; i < forecast.length; i++){\n\t\t\t// Set the respective box for either tomorrow or the three days after tomorrow\n\t\t\tvar box = i == 0 ? $('.forecast-box.tomorrow') : $('.forecast-boxes > div:nth-child(' + i + ')');\n\n\t\t\tbox.find('.date').text(forecast[i].date);\n\t\t\t\n\t\t\tbox.find('.conditions .condition').text(forecast[i].text);\n\t\t\tbox.find('.conditions .temp-high span:first-child').text(forecast[i].high);\n\t\t\tbox.find('.conditions .temp-low span:first-child').text(forecast[i].low);\n\n\t\t\tsetIcon(box.find('.forecast-icon'), forecast[i].code);\n\t\t}\n\t}", "title": "" }, { "docid": "8b96e9fd9fbbd09c62022a0963323fcd", "score": "0.55861896", "text": "function forecastWorldWideWeather (array) {\n var tempStr ='';\n for (var index = 0; index < 3; index++) {\n var element = array[index];\n tempStr += `\n <div class=\"col s4 center-align card__icon card__icon--small\">\n <p>${element.day}</p>\n ${iconWorldWideWeather(element.code)}\n <p><strong>${element.high}°</strong> - ${element.low}°</p>\n </div>`\n console.log(element);\n }\n return tempStr;\n }", "title": "" }, { "docid": "20d8b0649dc1b8823b7fba43ce0f59fc", "score": "0.5578635", "text": "function calculateCondition(weatherCode, windSpeed, cloudCover, sunTimes) {\n // Calculate if its currently day or night\n let currentTime = new Date();\n currentTime = Math.floor(currentTime.getTime() / 1000);\n if(currentTime >= sunTimes.rise && currentTime < sunTimes.set) {\n var dayTime = 'Day';\n } else {\n var dayTime = 'Night';\n }\n // First narrow possibilities of conditions via weather code\n if(weatherCode >= 200 && weatherCode <= 299) {\n // Thunder type\n if(weatherCode !== 210 && weatherCode !== 211 && weatherCode !== 212 && weatherCode !== 221) {\n // Thunderstorm with rain\n return \"Rainy Thunderstorm\";\n } else {\n // Thunderstorm no rain\n return \"Thunderstorm\";\n }\n }\n\n if(weatherCode >= 700 && weatherCode <= 799) {\n // Atmospheric\n if(weatherCode == 781) {\n // Tornado\n return \"Tornado\";\n }\n if(weatherCode >= 701 && weatherCode <= 710) {\n // Mist\n return \"Mist\";\n }\n if(weatherCode >= 711 && weatherCode <= 720) {\n // Smoke\n return \"Smoke\";\n }\n if(weatherCode >= 721 && weatherCode <= 730) {\n // Haze\n return \"Haze\";\n }\n if(weatherCode >= 731 && weatherCode <= 740) {\n // Dust\n return \"Dust\";\n }\n if(weatherCode >= 741 && weatherCode <= 750) {\n // Fog\n return \"Fog\";\n }\n if(weatherCode >= 751 && weatherCode <= 760) {\n // Sand\n return \"Sand\";\n }\n if(weatherCode == 761) {\n // Dust\n return \"Dust\";\n }\n if(weatherCode >= 762 && weatherCode <= 770) {\n // Ash\n return \"Ash\";\n }\n if(weatherCode >= 771 && weatherCode <= 780) {\n // Squall\n return \"Squall\";\n }\n }\n\n if(weatherCode == 800) {\n // Clear\n if(dayTime == 'Night') {\n // Clear Night\n return \"Clear Night\";\n } else {\n // Clear Day\n if(windSpeed >= 11.176) {\n // Clear Day\n return \"Clear Day\";\n } else {\n // Windy Clear Day\n return \"Windy Clear Day\";\n }\n }\n }\n\n if(weatherCode >= 801 && weatherCode <= 850) {\n // Clouds\n if(weatherCode == 801) {\n // Few Clouds\n return \"Few Clouds\";\n } else {\n // Cloudy\n if(windSpeed >= 11.176) {\n // Cloudy Day\n return \"Cloudy\";\n } else {\n // Windy Cloudy Day\n return \"Windy Clouds\";\n }\n }\n }\n\n if(weatherCode >= 300 && weatherCode <= 350) {\n // Drizzle\n if(cloudCover > 25) {\n // Partly Sunny Drizzle\n return \"Partly Sunny Drizzle\";\n } else {\n // Drizzle\n return \"Drizzle\";\n }\n }\n\n if(weatherCode >= 600 && weatherCode <= 650) {\n // Snow\n if(cloudCover > 25) {\n // Partly Sunny Snow\n return \"Partly Sunny Snow\";\n } else {\n // Snow\n return \"Snow\";\n }\n }\n\n if(weatherCode >= 500 && weatherCode <= 550) {\n // Rain\n if(cloudCover > 25) {\n // Partly Sunny Rain\n return \"Partly Sunny Rain\";\n } else {\n // Rain\n return \"Rain\";\n }\n }\n}", "title": "" }, { "docid": "06aa53a047cd7bd38ac932fdb25a2423", "score": "0.5577029", "text": "function getWeatherData(currentLocation) {\n \n var key = '0a6009db83bbd52d398c4469e8b12292'; // my DarkSky API key\n \n // Canberra is the default location\n var defaultLocation = '-35.28346,149.12807';\n \n var weatherUrl = 'https://api.darksky.net/forecast/' + key + '/' + defaultLocation + '?units=auto';\n \n $.getJSON(weatherUrl, function(data) {\n \n // get current temperature data, round to nearest whole number and append to HTML\n var currentTemp = Math.round(data.currently.temperature);\n var temp = $('<h1>').html(currentTemp + '&deg;c');\n $('#current-temp').append(temp);\n \n // get 'feels like' temperature data, round to nearest whole number and append to HTML\n var feelsLike = Math.round(data.currently.apparentTemperature);\n var feels = $('<h2>').html('Feels like ' + feelsLike + '&deg;');\n $('#feels-like').append(feels);\n \n // get the icon and append to HTML\n var icon = data.currently.icon;\n var iconImage = ''; // to input icon weather image\n \n if (icon === 'clear-day') {\n iconImage = 'class=\"xl-icon\" src=\"images/clear-day.svg\"';\n addIcon();}\n if (icon === 'clear-night') {\n iconImage = 'class=\"m-icon\" src=\"images/clear-night.svg\"';\n addIcon();}\n if (icon === 'rain' || icon === 'sleet') {\n iconImage = 'class=\"l-icon\" src=\"images/rain.svg\"';\n addIcon();}\n if (icon === 'snow') {\n iconImage = 'class=\"l-icon\" src=\"images/snow.svg\"';\n addIcon();}\n if (icon === 'wind') {\n iconImage = 'class=\"s-icon\" src=\"images/wind.svg\"';\n addIcon();}\n if (icon === 'fog') {\n iconImage = 'class=\"l-icon\" src=\"images/fog.svg\"';\n addIcon();}\n if (icon === 'cloudy') {\n iconImage = 'class=\"m-icon\" src=\"images/cloud.svg\"';\n addIcon();}\n if (icon === 'partly-cloudy-day') {\n iconImage = 'class=\"m-icon\" src=\"images/partly-cloudy-day.svg\"';\n addIcon();}\n if (icon === 'partly-cloudy-night') {\n iconImage = 'class=\"s-icon\" src=\"images/partly-cloudy-night.svg\"';\n addIcon();}\n \n function addIcon() {\n $('#icon').html('<img ' + iconImage + 'alt=\"\">');\n };\n \n // get the current summary (string) and append to HTML\n var currentSummary = data.currently.summary;\n var summary = $('<p>').text(currentSummary);\n $('#icon').append(summary);\n \n // get the current time and change marker on the clock\n var time = new Date(data.currently.time*1000);\n var timeInHours = time.getHours(); // to get only the hours (accuracy not needed for the marker)\n \n var timeMarker = $('#time-container');\n \n // for 6am (to 6.59am)\n if (timeInHours == 6) {rotateTime(0);}\n // for 7am (to 7.59am)\n if (timeInHours == 7) {rotateTime(15);}\n // for 8am (to 8.59am)\n if (timeInHours == 8) {rotateTime(30);}\n // for 9am (to 9.59am)\n if (timeInHours == 9) {rotateTime(45);}\n // for 10am (to 10.59am)\n if (timeInHours == 10) {rotateTime(60);}\n // for 11am (to 11.59am)\n if (timeInHours == 11) {rotateTime(75);}\n // for 12pm (to 12.59pm)\n if (timeInHours == 12) {rotateTime(90);}\n // for 1pm (to 1.59pm)\n if (timeInHours == 13) {rotateTime(105);}\n // for 2pm (to 2.59pm)\n if (timeInHours == 14) {rotateTime(120);}\n // for 3pm (to 3.59pm)\n if (timeInHours == 15) {rotateTime(135);}\n // for 4pm (to 4.59pm)\n if (timeInHours == 16) {rotateTime(150);}\n // for 5pm (to 5.59pm)\n if (timeInHours == 17) {rotateTime(165);}\n // for 6pm (to 6.59pm)\n if (timeInHours == 18) {rotateTime(180);}\n // for 7pm (to 7.59pm)\n if (timeInHours == 19) {rotateTime(195);}\n // for 8pm (to 8.59pm)\n if (timeInHours == 20) {rotateTime(210);}\n // for 9pm (to 9.59pm)\n if (timeInHours == 21) {rotateTime(225);}\n // for 10pm (to 10.59pm)\n if (timeInHours == 22) {rotateTime(240);}\n // for 11pm (to 11.59pm)\n if (timeInHours == 23) {rotateTime(255);}\n // for 12am (to 12.59am)\n if (timeInHours == 0) {rotateTime(270);}\n // for 1am (to 1.59am)\n if (timeInHours == 1) {rotateTime(285);}\n // for 2am (to 2.59am)\n if (timeInHours == 2) {rotateTime(300);}\n // for 3am (to 3.59am)\n if (timeInHours == 3) {rotateTime(315);}\n // for 4am (to 4.59am)\n if (timeInHours == 4) {rotateTime(330);}\n // for 5am (to 5.59am)\n if (timeInHours == 5) {rotateTime(345);}\n \n // function for rotating the timeMarker based on the time\n function rotateTime(t) {\n timeMarker.css({'transform':'rotate(' + t + 'deg)'});\n }\n \n // get max temp and append to HTML\n var maxTemp = Math.round(data.daily.data[0].temperatureHigh);\n var max = $('<p>').html(maxTemp + '&deg;');\n $('#max-temp').append(max);\n \n // get the time the max temp occurs and change marker on clock\n var maxTempTime = new Date(data.daily.data[0].temperatureHighTime*1000);\n var highTime = maxTempTime.getHours(); // to get only the hours\n \n var maxMarker = $('#max-temp-container'); // to position the marker on the clock\n var maxStraighten = $('#max-temp'); // to straighten the square marker\n \n // for max temp at 10am (to 10.59am)\n if (highTime == 10) {rotateMaxTemp(60);}\n // for max temp at 11am (to 11.59am)\n if (highTime == 11) {rotateMaxTemp(75);}\n // for max temp at 12pm (to 12.59pm)\n if (highTime == 12) {rotateMaxTemp(90);}\n // for max temp at 1pm (to 1.59pm)\n if (highTime == 13) {rotateMaxTemp(105);}\n // for max temp at 2pm (to 2.59pm)\n if (highTime == 14) {rotateMaxTemp(120);}\n // for max temp at 3pm (to 3.59pm)\n if (highTime == 15) {rotateMaxTemp(135);}\n // for max temp at 4pm (to 4.59pm)\n if (highTime == 16) {rotateMaxTemp(150);}\n // for max temp at 5pm (to 5.59pm)\n if (highTime == 17) {rotateMaxTemp(165);}\n // for max temp at 6pm (to 6.59pm)\n if (highTime == 18) {rotateMaxTemp(180);}\n // for max temp at 7pm (to 7.59pm)\n if (highTime == 19) {rotateMaxTemp(195);}\n // for max temp at 8pm (to 8.59pm)\n if (highTime == 20) {rotateMaxTemp(210);}\n // for max temp at 9pm (to 9.59pm)\n if (highTime == 21) {rotateMaxTemp(225);}\n \n // function for rotating the maxMarker and maxStraighten based on the time it occurs\n function rotateMaxTemp(x) {\n maxMarker.css({'transform':'rotate(' + x + 'deg)'});\n maxStraighten.css({'transform':'rotate(' + (360-x) + 'deg)'});\n }\n \n // get min temp and append to HTML\n var minTemp = Math.round(data.daily.data[0].temperatureLow);\n var min = $('<p>').html(minTemp + '&deg;');\n $('#min-temp').append(min);\n \n // get the time the min temp occurs and change marker on clock\n var minTempTime = new Date(data.daily.data[0].temperatureLowTime*1000);\n var lowTime = minTempTime.getHours(); // to get only the hours\n \n var minMarker = $('#min-temp-container'); // to position the marker on the clock\n var minStraighten = $('#min-temp'); // to straighten the square marker\n \n // for min temp at 10pm (to 10.59pm)\n if (lowTime == 22) {rotateMinTemp(240);}\n // for min temp at 11pm (to 11.59pm)\n if (lowTime == 23) {rotateMinTemp(255);}\n // for min temp at 12am (to 12.59am)\n if (lowTime == 0) {rotateMinTemp(270);}\n // for min temp at 1am (to 1.59am)\n if (lowTime == 1) {rotateMinTemp(285);}\n // for min temp at 2am (to 2.59am)\n if (lowTime == 2) {rotateMinTemp(300);}\n // for min temp at 3am (to 3.59am)\n if (lowTime == 3) {rotateMinTemp(315);}\n // for min temp at 4am (to 4.59am)\n if (lowTime == 4) {rotateMinTemp(330);}\n // for min temp at 5am (to 5.59am)\n if (lowTime == 5) {rotateMinTemp(345);}\n // for min temp at 6am (to 6.59am)\n if (lowTime == 6) {rotateMinTemp(0);}\n // for min temp at 7am (to 7.59am)\n if (lowTime == 7) {rotateMinTemp(15);}\n // for min temp at 8am (to 8.59am)\n if (lowTime == 8) {rotateMinTemp(30);}\n // for min temp at 9am (to 9.59am)\n if (lowTime == 9) {rotateMinTemp(45);}\n \n // function for rotating the minMarker and minStraighten based on the time it occurs\n function rotateMinTemp(y) {\n minMarker.css({'transform':'rotate(' + y + 'deg)'});\n minStraighten.css({'transform':'rotate(' + (360-y) + 'deg)'});\n }\n \n // get sunrise time and change fill indicator behind clock\n var sunriseTime = new Date(data.daily.data[0].sunriseTime*1000);\n var sunrise = sunriseTime.getHours(); // to get only the hours\n\n var sunriseMarker = $('#sunrise-fill, #sunrise-fill-extend');\n \n // for sunrise at 3am (to 3.59am)\n if (sunrise == 3) {\n $('#remainder-fill').css({'background-size': '50% 10%'});\n $('#sunrise-fill-extend').css({'height':'0em'});\n rotateSunrise(-45);}\n // for sunrise at 4am (to 4.59am)\n if (sunrise == 4) {\n $('#sunrise-fill-extend').css({'height':'5em'});\n $('#sunrise-fill').addClass('no-after-element');\n rotateSunrise(-30);}\n // for sunrise at 5am (to 5.59am)\n if (sunrise == 5) {rotateSunrise(-15);}\n // for sunrise at 6am (to 6.59am)\n if (sunrise == 6) {rotateSunrise(0);}\n // for sunrise at 7am (to 7.59am)\n if (sunrise == 7) {rotateSunrise(15);}\n // for sunrise at 8am (to 8.59am)\n if (sunrise == 8) {\n $('#sunrise-fill-extend').css({'height':'15em'});\n rotateSunrise(30);}\n // for sunrise at 9am (to 9.59am)\n if (sunrise == 9) {\n $('#remainder-fill').css({'background-size':'100% 50%'});\n $('#sunrise-fill-extend').css({'height':'15em'});\n rotateSunrise(45);}\n // for sunrise at 10am (to 10.59am)\n if (sunrise == 10) {\n $('#remainder-fill').css({'background-size':'100% 50%'});\n $('#sunrise-fill-extend').css({'height':'20em'});\n rotateSunrise(60);}\n \n function rotateSunrise(sr) {\n sunriseMarker.css({'transform':'rotate(' + sr + 'deg)'});\n }\n \n // get sunset time and change fill indicator behind clock\n var sunsetTime = new Date(data.daily.data[0].sunsetTime*1000);\n var sunset = sunsetTime.getHours(); // to get only the hours\n \n var sunsetMarker = $('#sunset-fill, #sunset-fill-extend');\n \n // for sunset at 3pm (to 3.59pm)\n if (sunset == 15) {\n $('#remainder-fill').css({'background-size':'50% 60%'});\n $('#sunset-fill-extend').css({'height':'20em'});\n rotateSunset(-45);}\n // for sunset at 4pm (to 4.59pm)\n if (sunset == 16) {\n $('#sunset-fill-extend').css({'height':'15em'});\n rotateSunset(-30);}\n // for sunset at 5pm (to 5.59pm)\n if (sunset == 17) {rotateSunset(-15);}\n // for sunset at 6pm (to 6.59pm)\n if (sunset == 18) {rotateSunset(0);}\n // for sunset at 7pm (to 7.59pm)\n if (sunset == 19) {rotateSunset(15);}\n // for sunset at 8pm (to 8.59pm)\n if (sunset == 20) {\n $('#sunset-fill-extend').css({'height':'5em'});\n rotateSunset(30);}\n // for sunset at 9pm (to 9.59pm)\n if (sunset == 21) {\n $('#sunset-fill-extend').css({'height':'1em'});\n rotateSunset(45);}\n // for sunset at 10pm (to 10.59pm)\n if (sunset == 22) {\n $('#remainder-fill').css({'background-size':'50% 10%'});\n $('#sunset-fill-extend').css({'height':'0em'});\n $('#sunset-fill').css({'background-size':'37% 50%'}).addClass('no-after-element');\n rotateSunset(60);}\n \n function rotateSunset(st) {\n sunsetMarker.css({'transform':'rotate(' + st + 'deg)'});\n }\n \n // counting for ALL POSSIBILITIES within sunrise times of 3am to 10am (10.59am) and sunset times of 3pm to 10pm (10.59pm) and adjusting so dark blue 'night time' fill works\n if (sunrise == 3 && sunset == 22) {\n $('#sunrise-fill').css({'background-size': '37% 50%'}).addClass('no-after-element');\n $('div#ring > p').addClass('adjust-left-05em-after');}\n if (sunrise == 8 && sunset == 22) {\n $('#sunset-fill').removeClass('no-after-element');\n $('#remainder-fill').css({'background-size':'100% 33%'});}\n if (sunrise == 9 && sunset == 15) {\n $('#remainder-fill').css({'background-size':'60% 60%'});}\n if (sunrise == 9 && sunset == 22) {\n $('#sunset-fill').removeClass('no-after-element');\n $('#remainder-fill').css({'background-size':'100% 34%'});}\n if (sunrise == 10 && sunset == 15) {\n $('#remainder-fill').css({'background-size':'70% 60%'});\n $('#sunset-fill-extend').addClass('no-before-element');\n $('div#bottom').css({'z-index':'-1'});}\n if (sunrise == 10 && sunset == 16 || 17 || 18 || 19) {\n $('div#bottom').css({'z-index':'-1','height':'52%'});}\n if (sunrise == 10 && sunset == 20) {\n $('#sunrise-fill-extend').addClass('adjust-width30em');\n $('div#bottom').css({'z-index':'-2'})}\n if (sunrise == 10 && sunset == 21) {\n $('#sunrise-fill-extend').addClass('adjust-width20em');\n $('div#bottom').css({'z-index':'-2'});}\n if (sunrise == 10 && sunset == 22) {\n $('#sunrise-fill-extend').addClass('adjust-width20em');\n $('div#bottom').css({'z-index':'-2'});\n $('#remainder-fill').css({'background-size':'90% 37%'});}\n if (sunset == 15 && sunrise == 3 || 4) {\n $('div#bottom').css({'z-index':'-2'});}\n if (sunset == 15 && sunrise == 9 || 10) {\n $('div#bottom').css({'z-index':'-1'});}\n if (sunset == 16 && sunrise == 3 || 4) {\n $('div#bottom').css({'z-index':'-2'});}\n if (sunset == 16 && sunrise == 10) {\n $('div#bottom').css({'z-index':'-1'});}\n if (sunset == 17 && sunrise == 9 || 10) {\n $('div#bottom').css({'z-index':'-1'});}\n if (sunset == 18 && sunrise == 3 || 4) {\n $('div#bottom').css({'z-index':'-2'});}\n if (sunset == 18 && sunrise == 10) {\n $('div#bottom').css({'z-index':'-1'});}\n if (sunset == 19 && sunrise == 10) {\n $('div#bottom').css({'z-index':'-1','height':'49%'});}\n if (sunset == 21 && sunrise == 3) {\n $('div.blue-fill').addClass('no-after-element');}\n \n // make time marker yellow for daytime and dark blue for night time\n if (timeInHours < sunset && timeInHours >= sunrise) {\n $('div#time').addClass('daytime');\n } else {\n $('div#time').addClass('nightime');\n }\n \n // get wind speed and append to HTML\n var windSpeed = data.currently.windSpeed;\n var windRounded = parseFloat(Math.round(windSpeed*100)/100).toFixed(1); // round to nearest single decimal, but must show one decimal, so 3 = 3.0\n \n var wind = $('<p>').html(windRounded + '<span><br>km/h</span>');\n $('#wind').append(wind);\n \n // get current rain probabability and append to HTML\n var rainChance = data.currently.precipProbability;\n var rainPercentage = Math.round(rainChance*100);\n \n // for mobile rain (positioned as middle list item)\n var rain = $('<p>').text(rainPercentage + '%');\n $('#rain').append(rain);\n \n // for desktop (positioned as last list item)\n var desktopRain =$('<p>').html(rainPercentage + '%' + '<img id=\"rain-down\" src=\"images/down-arrow.svg\" alt=\"\">');\n $('#rain-desktop').append(desktopRain);\n \n // get humidity and append to HTML\n var humidityDecimal = data.currently.humidity;\n var humidityPercentage = Math.round(humidityDecimal*100);\n \n var humidity = $('<p>').text(humidityPercentage + '%');\n $('#humidity').append(humidity);\n \n // get hourly rain probability (so 12 hours including current shown in total) and append to HTML\n for (var i = 1; i < 12; i++) {\n var rainHourly = moment.unix(data.hourly.data[i].time).format('ha');\n var rainChanceHr = data.hourly.data[i].precipProbability;\n var rainPercentageHr = Math.round(rainChanceHr*100);\n var rainPrediction = $('<li>').html('<img class=\"mobile\" src=\"images/white-rain-drop.svg\" alt=\"rain\">' + '<br>' + '<span>' + rainHourly + '</span>' + '<br>' + rainPercentageHr + '%');\n $('#inner-rain ul').append(rainPrediction);\n }\n \n // get daily weather forecast for the next 7 days - day, icon, min temp & max temp\n for (var i = 1; i <= 7; i++) {\n var day = moment.unix(data.daily.data[i].time).format('dddd'),\n dailyIcon = data.daily.data[i].icon,\n dailyLow = Math.round(data.daily.data[i].temperatureMin),\n dailyHigh = Math.round(data.daily.data[i].temperatureMax);\n \n displayWeekly(day, dailyIcon, dailyLow, dailyHigh);\n };\n \n \n function displayWeekly(day, dailyIcon, dailyLow, dailyHigh) {\n var iconDaily, iconDailyDesktop; // get white icons (mobile) and blue icons (desktop)\n if (dailyIcon === 'clear-day') {iconDaily = 'images/white-clear-day.svg'; iconDailyDesktop = 'images/blue-clear-day.svg';}\n if (dailyIcon === 'rain' || dailyIcon === 'sleet') {iconDaily = 'images/white-rain.svg'; iconDailyDesktop = 'images/blue-rain.svg';}\n if (dailyIcon === 'snow') {iconDaily = 'images/white-snow.svg'; iconDailyDesktop = 'images/blue-snow.svg';}\n if (dailyIcon === 'wind') {iconDaily = 'images/white-wind.svg'; iconDailyDesktop = 'images/blue-wind.svg';}\n if (dailyIcon === 'fog') {iconDaily = 'images/white-fog.svg'; iconDailyDesktop = 'images/blue-fog.svg';}\n if (dailyIcon === 'cloudy') {iconDaily = 'images/white-cloud.svg'; iconDailyDesktop = 'images/blue-cloud.svg';}\n if (dailyIcon === 'partly-cloudy-day' || dailyIcon === 'partly-cloudy-night') {iconDaily = 'images/white-partly-cloudy-day.svg'; iconDailyDesktop = 'images/blue-partly-cloudy-day.svg';}\n // append the values to each cell of a row\n var row = $('<tr>');\n row.append('<td>' + day + '</td>');\n row.append('<td class=\"centre\">' + '<img class=\"mobile\" src=\"' + iconDaily + '\">' + '<img class=\"desktop\" src=\"' + iconDailyDesktop + '\">' + '</td>');\n row.append('<td class=\"right\">' + dailyLow + '&nbsp;</td>');\n row.append('<td class=\"right\">' + '/ ' + dailyHigh + '&deg;</td>');\n\n // append the tr info to the table\n $('#daily-forecast').append(row);\n };\n\n });\n}", "title": "" }, { "docid": "47ca5d8edc7e22ec2fd54d80318dde23", "score": "0.5563731", "text": "function iconDisplay ($serviceText) {\n var iconCode = 'nocost'\n if ($serviceText == 'instrumento') {\n iconCode = 'bags'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'bike'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'instrument'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'pet'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'secure'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'car'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'parking'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'hotel'\n return iconCode\n }else {\n return iconCode\n }\n }", "title": "" }, { "docid": "80810ae480ab923a1908a1256955bc26", "score": "0.55577517", "text": "function showTemperature(response) {\n let temperatureElement = document.querySelector(\".current-temperature\");\n let cityElement = document.querySelector(\".current-city\");\n let descriptionElement = document.querySelector(\".description\");\n let minimumTemperature = document.querySelector(\".min-temp\");\n let maximumTemperature = document.querySelector(\".max-temp\");\n let humidityElement = document.querySelector(\".humidity-percent\");\n let windElement = document.querySelector(\".wind-speed\");\n let currentEmoji = document.querySelector(\".currentemoji\");\n let img = document.querySelector(\"#artwork\");\n let textElement = document.querySelector(\"#cartel\");\n\n celsiusTemperature = response.data.main.temp;\n\n let emojiElement = response.data.weather[0].icon;\n if (emojiElement === \"01d\" || emojiElement === \"01n\") {\n currentEmoji.innerHTML = \"☀️\";\n img.setAttribute(\"src\", \"img/tarsila-doamaral.jpg\");\n textElement.innerHTML = `<div> Tarsila do Amaral, <i>Abaporu</i>, 1928 </br>© Tarsila do Amaral </div>`;\n }\n\n if (emojiElement === \"02d\" || emojiElement === \"02n\") {\n currentEmoji.innerHTML = \"🌤\";\n img.setAttribute(\"src\", \"img/swynnerton-landscape.jpg\");\n textElement.innerHTML = `<div>Annie Louisa Swynnerton, <i>Italian Landscape</i>, 1920 </br>© Manchester Art Gallery </div>`;\n }\n\n if (emojiElement === \"03d\" || emojiElement === \"03n\") {\n currentEmoji.innerHTML = \"🌥\";\n img.setAttribute(\"src\", \"img/etel-adnan.jpg\");\n textElement.innerHTML = `<div>Etel Adnan, <i>Untitled</i>, 2010</br>© Rémi Villaggi / Mudam Luxembourg</div>`;\n }\n\n if (emojiElement === \"04d\" || emojiElement === \"04n\") {\n currentEmoji.innerHTML = \" ☁️\";\n img.setAttribute(\"src\", \"img/georgia-okeefe-clouds.jpg\");\n textElement.innerHTML = `<div> Georgia O’Keeffe, <i>Sky Above Clouds IV</i>, 1965</div>`;\n }\n if (emojiElement === \"09d\" || emojiElement === \"09n\") {\n currentEmoji.innerHTML = \"🌧\";\n img.setAttribute(\"src\", \"img/vangogh-rain.jpg\");\n textElement.innerHTML = `<div>Vincent Van Gogh, <i>Auvers in the Rain</i>, 1890</div>`;\n }\n if (emojiElement === \"10d\" || emojiElement === \"10n\") {\n currentEmoji.innerHTML = \"🌦\";\n img.setAttribute(\"src\", \"img/munch-lecri.jpg\");\n textElement.innerHTML = `<div>Edvard Munch, <i>Le Cri</i>, 1893 </br>© National Gallery of Norway</div>`;\n }\n if (emojiElement === \"11d\" || emojiElement === \"11n\") {\n currentEmoji.innerHTML = \"🌩\";\n img.setAttribute(\"src\", \"img/william-turner.jpg\");\n textElement.innerHTML = `<div>William Turner, <i>Fishermen at Sea</i>, 1796</div>`;\n }\n if (emojiElement === \"13d\" || emojiElement === \"13n\") {\n currentEmoji.innerHTML = \"❄️\";\n img.setAttribute(\"src\", \"img/monet-snow.jpg\");\n textElement.innerHTML = `<div>Claude Monet, <i>Wheatstacks, Snow Effect, Morning</i>, 1891</div>`;\n }\n if (emojiElement === \"50d\" || emojiElement === \"50n\") {\n currentEmoji.innerHTML = \"🌫\";\n img.setAttribute(\"src\", \"img/friedrich-seafog.jpg\");\n textElement.innerHTML = `<div>Caspar David Friedrich, </br><i>Wanderer above the Sea of Fog</i>, 1818</div>`;\n }\n\n let parisTemperature = Math.round(celsiusTemperature);\n temperatureElement.innerHTML = `• ${parisTemperature}°C`;\n cityElement.innerHTML = response.data.name;\n descriptionElement.innerHTML = response.data.weather[0].description;\n minimumTemperature.innerHTML = Math.round(response.data.main.temp_min) + \"°C\";\n maximumTemperature.innerHTML = Math.round(response.data.main.temp_max) + \"°C\";\n humidityElement.innerHTML = response.data.main.humidity + \"%\";\n windElement.innerHTML = Math.round(response.data.wind.speed) + \" km/h\";\n\n getForecast(response.data.coord);\n}", "title": "" }, { "docid": "913dcc1d500cd60d90e4e6d7de31ca9d", "score": "0.55473703", "text": "function setdata(data) {\n const date = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];\n document.getElementById('about').innerHTML = data.currently.summary;\n myicon.set(document.querySelector('.img'), data.currently.icon);\n document.getElementById('location').innerHTML = data.timezone;\n document.getElementById('temperature').innerHTML = data.currently.temperature + \"˚\";\n document.getElementById('humidity').innerHTML = data.currently.humidity + \"%\";\n document.getElementById('wind').innerHTML = data.currently.windSpeed + \"mph\";\n document.getElementById('uvindex').innerHTML = data.currently.uvIndex;\n for (let i = 0, j = new Date().getDay(); i < 5; i++) {\n j = (j + 1) % 7;\n let arr = [];\n let d = '';\n document.querySelectorAll('#day')[i].innerHTML = date[j];\n icon.set(document.querySelectorAll('#skyconicon')[i], data.daily.data[i].icon);\n document.querySelectorAll('#dailytemp')[i].innerHTML = round((data.daily.data[i].temperatureHigh + data.daily.data[i].temperatureLow) / 2, 1) + \"˚\";\n arr = data.daily.data[i].icon.split('-');\n for (let k = 0; k < arr.length; k++) { if (arr[k] != 'partly') d = d + \" \" + arr[k]; }\n document.querySelectorAll('#status')[i].innerHTML = d.slice(1);\n \n }\n icon.play();\n}", "title": "" }, { "docid": "7a018a843301329de5c0be95ff61fc91", "score": "0.55361277", "text": "function day2() {\n $('#day-2').addClass('forecasted-days');\n $('#next-day2').text(response.list[12].dt_txt.split(' ')[0]);\n var nextDayIcon2 = $('#icon-next-day2');\n renderNextDayIcon2();\n var tempF2 = (response.list[12].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp2').text(\"Temp: \" + tempF2.toFixed() + '°F');\n $('#next-day-humidity2').text('Humidity: ' + response.list[12].main.humidity + '%');\n function renderNextDayIcon2() {\n if (response.list[12].weather[0].main === \"Clouds\") {\n nextDayIcon2.text(' ☁️');\n } else if (response.list[12].weather[0].main === \"Clear\") {\n nextDayIcon2.text(' ☀️');\n } else if (response.list[12].weather[0].main === \"Rain\") {\n nextDayIcon2.text(' 🌧');\n } else if (response.list[12].weather[0].main === \"Snow\") {\n nextDayIcon2.text(' 🌨');\n };\n }\n }", "title": "" }, { "docid": "2719d19c6a9dd1f10c61e4cbf464c653", "score": "0.55360687", "text": "function setIcon() {\n if (dark) {\n nightSwitch.innerHTML = sun;\n } else {\n nightSwitch.innerHTML = moon;\n }\n}", "title": "" }, { "docid": "4b58ccca914d2dcdd5b8733432037cbe", "score": "0.5522065", "text": "function renderForecast(data) {\n // Add city and timestamp to elements\n document.querySelector('#city')\n .textContent = `Weather forecast for ${data.location.name}, ${data.location.country} on ${getDay()}`;\n document.querySelector('#updated')\n .textContent = `Last updated on ${getDay()} ${data.current.last_updated}`;\n\n // Add specific current weather data\n document.querySelector(`#day-1 .feels-like`)\n .textContent = `Feels like ${Math.round(data.current.feelslike_c)} °C`;\n document.querySelector(`#day-1 .pressure`)\n .textContent = `Pres. ${(data.current.pressure_mb / 1000).toFixed(3)} bar`;\n\n // Add weather data to elements\n let counter = 1;\n data.forecast.forecastday.forEach(forecastday => {\n if (counter === 2)\n document.querySelector(`#day-${counter} .day`).textContent = 'Tomorrow';\n else\n document.querySelector(`#day-${counter} .day`).textContent = getDay(counter - 1);\n\n document.querySelector(`#day-${counter} .icon`)\n .setAttribute('src', `https:${forecastday.day.condition.icon}`);\n document.querySelector(`#day-${counter} .temp`)\n .textContent = Math.round(forecastday.day.avgtemp_c) + ' °C';\n document.querySelector(`#day-${counter} .conditions`)\n .textContent = forecastday.day.condition.text;\n document.querySelector(`#day-${counter} .diff-temp`)\n .textContent = `Temps ${Math.round(forecastday.day.mintemp_c)} to ${Math.round(forecastday.day.maxtemp_c)} °C`;\n document.querySelector(`#day-${counter} .humidity`)\n .textContent = `Humidity ${forecastday.day.avghumidity}%`;\n document.querySelector(`#day-${counter} .rain`)\n .textContent = `Rain ${forecastday.day.totalprecip_mm} mm`;\n document.querySelector(`#day-${counter} .max-wind`)\n .textContent = `Wind ${(forecastday.day.maxwind_kph / 3.6).toFixed(2)} m/s`;\n document.querySelector(`#day-${counter} .sunrise`)\n .textContent = forecastday.astro.sunrise;\n document.querySelector(`#day-${counter} .sunset`)\n .textContent = forecastday.astro.sunset;\n counter++;\n });\n\n // Add location to search field\n document.getElementById('city-input').placeholder = data.location.name;\n document.getElementById('city-input').value = '';\n\n // Unhide forecast\n document.getElementById('forecast').classList.remove('hide');\n document.getElementById('day-1').classList.remove('hide');\n}", "title": "" }, { "docid": "46f6cc3c9897a3b8fd79673936d003c3", "score": "0.5521033", "text": "function getWeatherIcon(weather) {\n return 'https://openweathermap.org/img/wn/' + weather.weather[0].icon + '.png'\n }", "title": "" }, { "docid": "0fa73de7c890c204f60a1926ae6d9674", "score": "0.5511653", "text": "function sentinel2SnowMask(img, dilatePixels){\r\n \r\n // calculate ndsi\r\n var ndsi = img.normalizedDifference(['green', 'swir1']);\r\n \r\n // IF NDSI > 0.40 AND ρ(NIR) > 0.11 THEN snow in open land\r\n // IF 0.1 < NDSI < 0.4 THEN snow in forest\r\n var snowOpenLand = ndsi.gt(0.4).and(img.select(['nir']).gt(0.11));\r\n var snowForest = ndsi.gt(0.1).and(ndsi.lt(0.4));\r\n \r\n // Fractional snow cover (FSC, 0 % - 100% snow) can be detected by the approach of Salomonson\r\n // and Appel (2004, 2006), which was originally developed for MODIS data:\r\n // FSC = –0.01 + 1.45 * NDSI\r\n var fsc = ndsi.multiply(1.45).subtract(0.01);\r\n \r\n // final snow mask\r\n if(dilatePixels === undefined || dilatePixels === null){dilatePixels = 3.5}\r\n \r\n var snowMask = ((snowOpenLand.or(snowForest)).not()).focal_min(dilatePixels);\r\n return img.updateMask(snowMask);\r\n}", "title": "" }, { "docid": "3e2e260eb8b480f2ddef9cb59d784e36", "score": "0.5497493", "text": "function displayWeather(weatherKey, weatherValue) {\n if(weatherKey == \"main\") {\n var weatherStatus = weatherValue.toLowerCase();\n\n $(\".status\").html(weatherValue);\n switch(weatherStatus) {\n case \"clouds\":\n $(\".weatherImage\").html('<i class=\"wi wi-cloudy\"></i>');\n break;\n case \"thunderstorm\":\n $(\".weatherImage\").html('<i class=\"wi wi-thunderstorm\"></i>');\n break;\n case \"drizzle\":\n case \"rain\":\n $(\".weatherImage\").html('<i class=\"wi wi-rain\"></i>');\n break;\n case \"snow\":\n $(\".weatherImage\").html('<i class=\"wi wi-snow\"></i>');\n break;\n case \"extreme\":\n $(\".weatherImage\").html('<i class=\"wi wi-meteor\"></i>');\n break;\n case \"smoke\":\n $(\".weatherImage\").html('<i class=\"wi wi-smoke\"></i>');\n break;\n default:\n $(\".weatherImage\").html('<i class=\"wi wi-day-sunny\"></i>');\n }\n }\n}", "title": "" }, { "docid": "d4622c834b319f218d56ae10e020e160", "score": "0.5490831", "text": "function day4() {\n $('#day-4').addClass('forecasted-days');\n $('#next-day4').text(response.list[28].dt_txt.split(' ')[0]);\n var nextDayIcon4 = $('#icon-next-day4');\n renderNextDayIcon4();\n var tempF4 = (response.list[28].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp4').text(\"Temp: \" + tempF4.toFixed() + '°F');\n $('#next-day-humidity4').text('Humidity: ' + response.list[28].main.humidity + '%');\n function renderNextDayIcon4() {\n if (response.list[28].weather[0].main === \"Clouds\") {\n nextDayIcon4.text(' ☁️');\n } else if (response.list[28].weather[0].main === \"Clear\") {\n nextDayIcon4.text(' ☀️');\n } else if (response.list[28].weather[0].main === \"Rain\") {\n nextDayIcon4.text(' 🌧');\n } else if (response.list[28].weather[0].main === \"Snow\") {\n nextDayIcon4.text(' 🌨');\n }\n }\n }", "title": "" }, { "docid": "4481ab32b9cb769ded46502183323c3e", "score": "0.5488976", "text": "function forecast() {\n\n var cityName = \"Denver\";\n var queryURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + cityName + \"&units=imperial&appid=b4e24afa7b1b97b59d4ac32e97c8b68d\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n\n var iconTomorrow = $(`<img src=\"http://openweathermap.org/img/w/${response.list[6].weather[0].icon}.png\">`);\n var icon2Days = $(`<img src=\"http://openweathermap.org/img/w/${response.list[14].weather[0].icon}.png\">`);\n var icon3Days = $(`<img src=\"http://openweathermap.org/img/w/${response.list[22].weather[0].icon}.png\">`);\n var icon4Days = $(`<img src=\"http://openweathermap.org/img/w/${response.list[30].weather[0].icon}.png\">`);\n var icon5Days = $(`<img src=\"http://openweathermap.org/img/w/${response.list[38].weather[0].icon}.png\">`);\n\n \n $(`#temp1`).text(\"Temp: \" + Math.ceil(response.list[6].main.temp) + \"°F\");\n $(`#humid1`).text(\"Humid: \" + response.list[6].main.humidity + \"%\");\n $(`#temp2`).text(\"Temp: \" + Math.ceil(response.list[14].main.temp) + \"°F\");\n $(`#humid2`).text(\"Humid: \" + response.list[14].main.humidity + \"%\");\n $(`#temp3`).text(\"Temp: \" + Math.ceil(response.list[22].main.temp) + \"°F\");\n $(`#humid3`).text(\"Humid: \" + response.list[22].main.humidity + \"%\");\n $(`#temp4`).text(\"Temp: \" + Math.ceil(response.list[30].main.temp) + \"°F\");\n $(`#humid4`).text(\"Humid: \" + response.list[30].main.humidity + \"%\");\n $(`#temp5`).text(\"Temp: \" + Math.ceil(response.list[38].main.temp) + \"°F\");\n $(`#humid5`).text(\"Humid: \" + response.list[38].main.humidity + \"%\");\n \n $(`#icon1`).append(iconTomorrow[0]);\n $(`#icon2`).append(icon2Days[0]);\n $(`#icon3`).append(icon3Days[0]);\n $(`#icon4`).append(icon4Days[0]);\n $(`#icon5`).append(icon5Days[0]);\n })\n}", "title": "" }, { "docid": "4c331b5c1d1c77cc947ea2d9198f0644", "score": "0.54848063", "text": "function displayWeather(weatherData) {\n\n //Get City Name and Date\n var cityName = weatherData.city_name;\n var countryID = weatherData.country_code;\n var currentDate = (weatherData.data[0].datetime);\n var cityCountrySrc = cityName + \", \" + countryID\n $(\"#cityMain\").text(cityCountrySrc + \" (\" + currentDate + \")\");\n\n //Weather Icon - Icons stored in repo as \"weatherbit.io\" did not have URL links.\n var iconID = weatherData.data[0].weather.icon;\n var weatherIcon = \"./assets/icons/\" + iconID + \".png\";\n $(\"#iconMain\").attr(\"src\", weatherIcon);\n\n //Current day main display\n $(\"#tempMain\").text(\"Temperature: \" + weatherData.data[0].max_temp + \"\\u2103\");\n $(\"#humdMain\").text(\"Humidity: \" + weatherData.data[0].rh + \"%\");\n $(\"#wsMain\").text(\"Wind Speed: \" + Math.ceil(weatherData.data[0].wind_spd * 3.6) + \" km/h\");\n\n //UV Index Color coding\n var uvIndex = Math.ceil(weatherData.data[0].uv);\n var uvMain = $(\"#uvMain\");\n uvMain.text(\" UV Index: \" + uvIndex + \" \");\n var bgColor = \"background-color\"\n\n if (uvIndex <= 2) {\n uvMain.css(bgColor, \"Green\");\n };\n if ((uvIndex >= 3) && (uvIndex <= 5)) {\n uvMain.css(bgColor, \"gold\");\n };\n if ((uvIndex >= 6) && (uvIndex <= 7)) {\n uvMain.css(bgColor, \"orange\");\n };\n if ((uvIndex >= 8) && (uvIndex <= 10)) {\n uvMain.css(bgColor, \"red\");\n };\n if (uvIndex > 10) {\n uvMain.css(bgColor, \"purple\");\n };\n\n //Weather Data that will populate the 5 day forecast cards run through a for loop.\n for (var i = 1; i < 6; i++) {\n $(\"#date\" + i).text(weatherData.data[i].datetime);\n $(\"#icon\" + i).attr(\"src\", \"./assets/icons/\" + weatherData.data[i].weather.icon + \".png\");\n $(\"#temp\" + i).text(\"Temp: \" + weatherData.data[i].max_temp + \"\\u2103\");\n $(\"#humd\" + i).text(\"Humidity: \" + weatherData.data[i].rh + \"%\");\n }\n }", "title": "" }, { "docid": "8de382fd44aa5279e4f7505641b9b000", "score": "0.54730976", "text": "function mapWxToIconAndDescr(wxAPIreturn) {\n // note we are not handling day vs. night (wrt icons)\n var descr = wxAPIreturn.weather[0].description;\n var iconUrl = \"\";\n var coarseWeatherCode = Math.floor(wxAPIreturn.weather[0].id / 100);\n \n switch (coarseWeatherCode) {\n case 2:\n iconUrl = './weatherIcons/thunderstorm.png';\n break;\n case 3: // drizzle\n case 5: // rain\n iconUrl = './weatherIcons/rain.png';\n break;\n case 6:\n iconUrl = './weatherIcons/snow.png';\n break;\n case 7:\n iconUrl = './weatherIcons/fog.png';\n break;\n case 8: // clear or cloudy - no precip or fog\n var subID = wxAPIreturn.weather[0].id % 100;\n if (subID == 0) {\n iconUrl = './weatherIcons/sunny.png';\n }\n else if (subID == 4) {\n iconUrl = './weatherIcons/overcast.png';\n }\n else {\n iconUrl = './weatherIcons/partly_cloudy.png';\n }\n // alert(\"clear or cloudy - icon is \" + iconUrl);\n break;\n case 9: // breezy to extreme weather, hurricane\n default:\n iconUrl = './weatherIcons/questionmark.png';\n break;\n }\n // console.log(\"in mapWxToIconAndDescr - imageURL =\", iconUrl);\n \n var result = {\n description: descr,\n imageUrl: iconUrl\n };\n return result;\n}", "title": "" }, { "docid": "3990ab2533c7e2edee5a15e5815e1310", "score": "0.54730284", "text": "function populateWeatherForecast(response){\n let index = 1;\n for (i = 8; i < 40; i = i + 8){\n $(\".temp\"+index).text(JSON.stringify(response.list[i].main.temp)+\"\\xB0C\");\n $(\".humidity\"+index).text(JSON.stringify(response.list[i].main.humidity)+\"%\");\n let iconCode = JSON.stringify(response.list[i].weather[0].icon);\n let iconURL = createWeatherIcon(iconCode);\n $(\".card-img\"+index).attr(\"src\", iconURL);\n index ++;\n } \n }", "title": "" }, { "docid": "8119c14d848867961e1c4c5955e993ce", "score": "0.5470656", "text": "function nextDay() {\n $('#day-1').addClass('forecasted-days');\n $('#next-day').text(response.list[4].dt_txt.split(' ')[0]);\n var nextDayIcon = $('#icon-next-day');\n renderNextDayIcon();\n var tempF1 = (response.list[4].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp').text(\"Temp: \" + tempF1.toFixed() + '°F');\n $('#next-day-humidity').text('Humidity: ' + response.list[4].main.humidity + '%');\n function renderNextDayIcon() {\n if (response.list[4].weather[0].main === \"Clouds\") {\n nextDayIcon.text('☁️');\n } else if (response.list[4].weather[0].main === \"Clear\") {\n nextDayIcon.text(' ☀️');\n } else if (response.list[4].weather[0].main === \"Rain\") {\n nextDayIcon.text(' 🌧');\n } else if (response.list[4].weather[0].main === \"Snow\") {\n nextDayIcon.text(' 🌨');\n }\n }\n }", "title": "" }, { "docid": "88928b999ed533f200e599682b35b265", "score": "0.5470601", "text": "function renderFutureWeather() {\n for (var i = 0; i < 5; i++) {\n $(\"#day-\" + i).text(futureWeather.daysOutlook[i].date);\n $(\"#day-\" + i + \"-icon\").attr(\"src\", \"http://openweathermap.org/img/wn/\" + futureWeather.daysOutlook[i].weatherIcon + \"@2x.png\");\n $(\"#day-\" + i + \"-temp\").text(futureWeather.daysOutlook[i].temperature);\n $(\"#day-\" + i + \"-humidity\").text(futureWeather.daysOutlook[i].humidity);\n }\n}", "title": "" }, { "docid": "7507448d6fe8588de789580df11ce663", "score": "0.54668087", "text": "function changeTodaysTempC(data) {\n const todaysTemp = get(\".weather-info-temperature\");\n todaysTemp.textContent = data.main.temp + \" °C\";\n createTodaysIcon(data)\n}", "title": "" }, { "docid": "f425f4a9df974593fbe09c6008fe1b84", "score": "0.5465821", "text": "function displayWeeklyForecast() {\n\n for (let day = 0; day < 7; day++) {\n let weatherIcon = thisWeekWeather[day]['icon'];\n document.getElementById(day).src = '../../images/' + weatherIcon + '.png';\n }\n for (let day = 2; day < 7; day ++) {\n \n let dayNumber = new Date(thisWeekWeather[day]['time'] * 1000)\n document.getElementById('day' + day).innerHTML = weekday[dayNumber.getDay()];\n }\n \n}", "title": "" }, { "docid": "c63c69d48767a4e1e1ad16f2dc0f3be9", "score": "0.5462789", "text": "function showWeather() {\n document.getElementById(\"summary\").innerHTML = summary;\n document.getElementById(\"temp\").innerHTML = `Temperature ${tempF} F`;\n document.getElementById(\"tempConvert\").classList.add(\"fahrenheit\");\n document.getElementById(\"humidT\").innerHTML = `Humidity: ${humidT.toFixed(0)}%`\n document.getElementById(\"windS\").innerHTML = `Wind Speed: ${windS} mi/h`\n skycons.set(\"icon\", icon)\n skycons.play();\n document.getElementById(\"tempConvert\").classList.remove(\"hidden\")\n}", "title": "" }, { "docid": "f065dca64c6ccc7d016e3bb19aec83ff", "score": "0.5455742", "text": "function day5() {\n $('#day-5').addClass('forecasted-days');\n $('#next-day5').text(response.list[36].dt_txt.split(' ')[0]);\n var nextDayIcon5 = $('#icon-next-day5');\n renderNextDayIcon5()\n var tempF5 = (response.list[36].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp5').text(\"Temp: \" + tempF5.toFixed() + '°F');\n $('#next-day-humidity5').text('Humidity: ' + response.list[36].main.humidity + '%');\n function renderNextDayIcon5() {\n if (response.list[36].weather[0].main === \"Clouds\") {\n nextDayIcon5.text(' ☁️');\n } else if (response.list[36].weather[0].main === \"Clear\") {\n nextDayIcon5.text(' ☀️');\n } else if (response.list[36].weather[0].main === \"Rain\") {\n nextDayIcon5.text(' 🌧');\n } else if (response.list[36].weather[0].main === \"Snow\") {\n nextDayIcon4.text(' 🌨');\n };\n }\n }", "title": "" }, { "docid": "06a7228468cbe6497db5c775623dbac9", "score": "0.54412526", "text": "function updateForecast(data) {\n // Get UV index and adds the appropriate class highlight\n var uvIndexReturn = data.current.uvi;\n uvIndex.innerHTML = uvIndexReturn;\n if (uvIndexReturn <= 2) {\n $(uvIndex).attr(\"class\", \"weatherInfo singleLine highlightGreen\");\n }\n else if (2 < uvIndexReturn && uvIndexReturn <= 5) {\n $(uvIndex).attr(\"class\", \"weatherInfo singleLine highlightYellow\");\n }\n else if (5 < uvIndexReturn && uvIndexReturn <= 7) {\n $(uvIndex).attr(\"class\", \"weatherInfo singleLine highlightOrange\");\n }\n else {\n $(uvIndex).attr(\"class\", \"weatherInfo singleLine highlightRed\");\n }\n\n // Clear the forecast panel of previous data\n $(forecastPanel).empty();\n // Update the forecast panel\n for (i = 1; i < 6; i++) {\n // Get the forecast date\n var forecastData = data.daily[i];\n // Calculate the time after the timezone offset\n var timeWithZone = parseInt(forecastData.dt) + parseInt(data.timezone_offset);\n // Parse the Unix into readable time\n var forecastTime = DateTime.fromSeconds(timeWithZone);\n // Append main card container\n $(forecastPanel).append('<section class=\"forecastCard flexCol col-md-2 bordered centered\" id=\"card' + i + '\"></section>');\n // Append the details to the card container\n $(\"#card\" + i).append('<h3 class=\"forecastTitle\">' + forecastTime.month + \"/\" + forecastTime.day + \"/\" + forecastTime.year + '</h3>')\n // Append the weather image\n .append('<img class=\"weatherIcon forecastIcon\" src=\"http://openweathermap.org/img/wn/' + forecastData.weather[0].icon + '.png\" alt=\"' + forecastData.weather[0].description + ' weather icon\"/>')\n // Append the temperature information\n .append('<article class=\"weatherInfo cardTemperature\">Temp: ' + forecastData.temp.day + ' F°</article>')\n // Append the humidity information\n .append('<article class=\"weatherInfo cardHumidity\">Humidity: ' + forecastData.humidity + '%</article>');\n }\n }", "title": "" }, { "docid": "0474aba934806c920687f51b11174e47", "score": "0.5435064", "text": "function displayWeather(data, cityInputText){\n if(data.length === 0){\n currentDate.textContent = \"No data for that city :(\";\n return;\n }\n else{\n currentDate.textContent = cityInputText + moment().format(\" MM/DD/YY\");\n var iconUrl = \"http://openweathermap.org/img/wn/\" +data.current.weather[0].icon +\"@2x.png\";\n //http://openweathermap.org/img/wn/[email protected]\n //only need link for img icon\n //console.log(data.current.weather[0].icon);\n var cityTemp = data.current.temp;\n var cityHumidity = data.current.humidity;\n var cityWind = data.current.wind_speed;\n var cityUV = data.current.uvi;\n //clear out previous classname\n currentUVIndex.className = \"\";\n //var uvi = parseInt($(this).attr(\"\"))\n if(cityUV < 3.0){\n //cityUV.innerHTML = (\"class = 'low'\")\n currentUVIndex.className += \"low\";\n }\n if(cityUV > 3 && cityUV < 7){\n currentUVIndex.className += \"moderate\";\n }\n else if(cityUV > 7){\n currentUVIndex.className += \"danger\";\n }\n //console.log(cityTemp);\n \n var currentIcon = document.getElementById(\"icon\");\n currentIcon.src = iconUrl;\n currentTemp.textContent= \"Temp: \" + cityTemp + \" °F\";\n currentHumidity.textContent = \"Humidity \" + cityHumidity + \" %\";\n currentWindSpeed.textContent = \"Wind Speed: \" + cityWind + \" mph\";\n currentUVIndex.textContent = \"UV Index: \" + cityUV;\n }\n}", "title": "" }, { "docid": "6f6f3cd426311d766041891ed1cebc62", "score": "0.5432304", "text": "function weatherForcast(weather){\n if(weather == \"snowing\"){\n alert(\"It's snowing!\")\n }else{\n alert(\"Check back later for more details!\")\n }\n}", "title": "" }, { "docid": "29779c47218143c38bbb449b3ef948b3", "score": "0.5428276", "text": "function createWeather(datae){\r\n window.current.innerHTML = '';\r\n window.forecast.innerHTML = '';\r\n\r\n let element = document.createElement('div');\r\n element.id = 'weathericon';\r\n let globalData = document.createElement('img');\r\n globalData.src = datae.current.condition.icon;\r\n element.appendChild(globalData);\r\n\r\n window.current.appendChild(element);\r\n\r\n\r\n element = document.createElement('div');\r\n element.id = 'weathertemp';\r\n globalData = document.createElement('p');\r\n globalData.textContent = datae.current.temp_c + '' + '\\u2103';\r\n globalData.classList.add('tempFont');\r\n element.appendChild(globalData);\r\n\r\n globalData = document.createElement('i');\r\n globalData.textContent = datae.location.name + ',' + datae.location.country;\r\n element.appendChild(globalData);\r\n\r\n globalData = document.createElement('p');\r\n globalData.textContent = datae.current.condition.text + ', feels like... ' + datae.current.feelslike_c + '\\u2103';\r\n element.appendChild(globalData);\r\n window.current.appendChild(element);\r\n\r\n\r\n\r\n let forecastData = datae.forecast.forecastday;\r\n forecastData.splice(0, 1);\r\n forecastData.forEach(function(weather){\r\n\r\n let element = document.createElement('div');\r\n element.id = 'dayfore';\r\n window.forecast.appendChild(element);\r\n\r\n let datae = document.createElement('img');\r\n datae.src = weather.day.condition.icon;\r\n element.appendChild(datae);\r\n\r\n datae = document.createElement('p');\r\n let date = new Date(weather.date)\r\n datae.textContent = days[date.getDay() - 0] + '\t ' + weather.date;\r\n if(datae.textContent === ''){\r\n datae.textContent = 'Sunday';\r\n }\r\n element.appendChild(datae);\r\n\r\n datae = document.createElement('p');\r\n datae.textContent = weather.day.avgtemp_c + '\\u2103' + ' ' + weather.day.mintemp_c + '\\u2103' + '/' + weather.day.maxtemp_c + '\\u2103';\r\n element.appendChild(datae);\r\n\r\n });\r\n}", "title": "" }, { "docid": "cecd8f7b08ed2e04ba9e8fe01f72b734", "score": "0.5408167", "text": "function displayWeather() {\n // iconElement.innerHTML = `<i class=\"wi wi-owm-${weather.iconId}\"></i>`;\n state.innerHTML = `<i id=\"icon-desc\" class=\"wi wi-owm-${weather.iconId}\" style=\"width:150px;\"></i>\n <p style=\"font-size: 17px;width:150px;display:flex;justify-content:center;align-items: center;\">${translatePT}</p>`;\n tempElement.innerHTML = `${weather.temperature.value}<i class=\"wi wi-celsius\"></i>`;\n}", "title": "" }, { "docid": "8674a3e08a13bf77cac5e48c111cae6d", "score": "0.5406641", "text": "function showWeather() {\ngiveCity()\npreForecast()\nfutureFore() \n}", "title": "" }, { "docid": "29c68e9f5cfa8db0af513d60a6f58ffe", "score": "0.5401341", "text": "function renderData(allData){\n let avr = getForecast(allData);\n // Display the city name and temperatures for all days\n let cityName = document.getElementById('current-city-name');\n cityName.innerText = allData.city.name.toUpperCase() + ', '+ allData.city.country;\n let iconElement = document.createElement(\"i\");\n iconElement.setAttribute(\"class\",\"far fa-plus-square plus addremove\");\n iconElement.addEventListener('click',plusOnClick,false);\n cityName.appendChild(iconElement);\n document.getElementById('temp').innerHTML = avr[0].temp.toString()+'<span>&deg;C</span>';\n document.getElementById('day2').innerHTML = avr[1].temp.toString()+'<span>&deg;C</span>';\n document.getElementById('day3').innerHTML = avr[2].temp.toString()+'<span>&deg;C</span>';\n document.getElementById('day4').innerHTML = avr[3].temp.toString()+'<span>&deg;C</span>';\n document.getElementById('day5').innerHTML = avr[4].temp.toString()+'<span>&deg;C</span>';\n\n // Loop the loop through which we will display appropriate icons. Icons depend on the weather. Icons come from FontAwesome\n for (let i = 0 ; i < avr.length ; i++){\n let x = document.getElementsByClassName('icon')[i];\n x.className = \"\";\n switch(avr[i].weather.icon.toString()) {\n case '01':\n x.classList.add(\"icon\",\"fa-sun\",\"fas\"); //sun\n break;\n case '02':\n x.classList.add(\"icon\",\"fa-cloud-sun\",\"fas\"); //few clouds\n break;\n case '03':\n x.classList.add(\"icon\",\"fa-cloud\",\"fas\"); //scattered clouds\n break;\n case '04':\n x.classList.add(\"icon\",\"fa-cloud\",\"fas\"); //broken clouds\n break;\n case '09':\n x.classList.add(\"icon\",\"fa-cloud-rain\",\"fas\"); //shower rain\n break;\n case '10':\n x.classList.add(\"icon\",\"fa-cloud-sun-rain\",\"fas\"); //rain\n break;\n case '11':\n x.classList.add(\"icon\",\"fa-bolt\",\"fas\"); //thunderstorm\n break;\n case '13':\n x.classList.add(\"icon\",\"fa-snowflake\",\"fas\"); //snow\n break;\n case '50':\n x.classList.add(\"icon\",\"fa-smog\",\"fas\"); //mist\n break;\n }\n }\n\n //Display maximum and minimum temperature in first day and the humidity.\n document.getElementById('max').innerHTML = 'Max:<br>' + avr[0].temp_max +'<span>&deg;C</span>';\n document.getElementById('min').innerHTML = 'Min:<br> ' + avr[0].temp_min +'<span>&deg;C</span>';\n document.getElementById('humidity').innerText = 'Wilgotność:' + \"\\r\\n\" + avr[0].humidity + '%';\n setVideoBg(avr)\n}", "title": "" }, { "docid": "1b957777bacd62dcaa491ce5d70e2272", "score": "0.53994894", "text": "function processWeatherData(response) {\n $(\".city\").text(response.city.name + \"'s Current Weather\");\n $(\".temp3\").text(\"Current Temperature (F): \" + response.list[0].main.temp);\n $(\".conditions\").text(\"Current Conditions: \" + response.list[0].weather[0].description);\n\n $(\".temp6\").text(\"Forecasted Temperature (Next 6 hrs): \" + response.list[1].main.temp);\n $(\".conditions\").text(\"Forecasted Conditions: \" + response.list[1].weather[0].description);\n\n\n //-----------------------------------------------------------------\n\n var suggestionDay = response.list[0].main.temp;\n\n if (suggestionDay >= 60) {\n $(\".suggestDay\").text(\"Woot! Jen's kids can wear SHORTS today!\");\n $(\"#topsIcon\").attr(\"src\", \"assets/images/tshirt.png\");\n $(\"#bottomsIcon\").attr(\"src\", \"assets/images/shorts.png\");}\n else {\n $(\".suggestDay\").text(\"No shorts today, looks like you should bring a jacket also.. bummer.\");\n $(\"#topsIcon\").attr(\"src\", \"assets/images/jacket.png\");\n $(\"#bottomsIcon\").attr(\"src\", \"assets/images/pants.png\");\n }\n\n var suggestionNight = response.list[0].main.temp;\n\n if (suggestionNight >= 60)\n $(\".suggestNight\").text(\"Keep those shorts for later!\");\n else\n $(\".suggestNight\").text(\"Most likely you'll need a jacket or sweater later, looks a little chilly.\");\n\n //-----------------------------------------------------------------\n // 3-hour / Current Weather\n var cloudCover = response.list[0].clouds.all;\n rainChance = response.list[0].weather[0].main;//update global \n // 6-hour / Forecasted Weather\n var cloudCover6 = response.list[1].clouds.all;\n var rainChance6 = response.list[1].weather[0].main;\n\n\n\n if (rainChance == \"Rain\") {\n $(\"#welcomeWeather\").attr(\"src\", \"assets/images/rainy.png\");\n }\n else if (cloudCover >= 75) {\n $(\"#welcomeWeather\").attr(\"src\", \"assets/images/cloudy.png\");\n }\n else if (cloudCover >= 50) {\n $(\"#welcomeWeather\").attr(\"src\", \"assets/images/partly-cloudy.png\");\n }\n else {\n $(\"#welcomeWeather\").attr(\"src\", \"assets/images/sunny.jpg\");\n }\n\n if (rainChance6 == \"Rain\") {\n $(\"#forecastWeather\").attr(\"src\", \"assets/images/rainy.png\");\n }\n else if (cloudCover6 >= 75) {\n $(\"#forecastWeather\").attr(\"src\", \"assets/images/cloudy.png\");\n }\n else if (cloudCover6 >= 50) {\n $(\"#forecastWeather\").attr(\"src\", \"assets/images/partly-cloudy.png\");\n }\n else {\n $(\"#forecastWeather\").attr(\"src\", \"assets/images/sunny.jpg\");\n }\n }", "title": "" }, { "docid": "41e0eb2a85e61dc6595c257ace191e37", "score": "0.53992665", "text": "onInsideGoodWeather() {\n throw new NotImplementedException();\n }", "title": "" }, { "docid": "34b61b6ccc21724792a7a8fcd89a644b", "score": "0.53950876", "text": "function dateitypiconermittlung(dateiendung) {\n dateiendung = dateiendung.toLowerCase(); \n switch (dateiendung) {\n // Archive\n case \"7z\": icon = 'Archive/7zip'; break;\n case \"rar\": icon = 'Archive/rar'; break;\n case \"zip\": icon = 'Archive/zip'; break;\n // Audio\n case \"mp3\": icon = 'Audio/mp3'; break;\n case \"mid\": icon = 'Audio/mid'; break;\n case \"ogg\": icon = 'Audio/ogg'; break;\n case \"wav\": icon = 'Audio/wav'; break;\n case \"wma\": icon = 'Audio/wma'; break;\n case \"flac\": icon = 'Audio/flac'; break;\n case \"m4a\": icon = 'Audio/m4a'; break;\n // Bilder\n case \"bmp\": icon = 'Image/bmp'; break;\n case \"gif\": icon = 'Image/gif'; break;\n case \"jpg\": icon = 'Image/jpg'; break;\n case \"jpeg\": icon = 'Image/jpeg'; break;\n case \"png\": icon = 'Image/png'; break;\n case \"tif\": icon = 'Image/tif'; break;\n case \"eps\": icon = 'Image/eps'; break;\n case \"raw\": icon = 'Image/raw'; break;\n case \"psd\": icon = 'Image/psd'; break;\n // Office\n case \"csv\": icon = 'Office/csv'; break;\n case \"doc\": icon = 'Office/doc'; break;\n case \"docx\": icon = 'Office/docx'; break;\n case \"mdb\": icon = 'Office/mdb'; break;\n case \"mdbx\": icon = 'Office/mdbx'; break;\n case \"pdf\": icon = 'Office/pdf'; break;\n case \"ppt\": icon = 'Office/ppt'; break;\n case \"pptx\": icon = 'Office/pptx'; break;\n case \"vsd\": icon = 'Office/vsd'; break;\n case \"xls\": icon = 'Office/xls'; break;\n case \"xlsm\": icon = 'Office/xlsx'; break;\n case \"xlsx\": icon = 'Office/xlsx'; break;\n // Videos \n case \"avi\": icon = 'Video/avi'; break;\n case \"divx\": icon = 'Video/divx'; break;\n case \"flv\": icon = 'Video/flv'; break;\n case \"mkv\": icon = 'Video/mkv'; break;\n case \"mp4\": icon = 'Video/mp4'; break;\n case \"mpg\": icon = 'Video/mpg'; break;\n case \"mpeg\": icon = 'Video/mpeg'; break;\n case \"mov\": icon = 'Video/mov'; break;\n case \"wmv\": icon = 'Video/wmv'; break;\n // System\n case \"asp\": icon = 'System/asp'; break;\n case \"bat\": icon = 'System/bat'; break;\n case \"bin\": icon = 'System/bin'; break;\n case \"css\": icon = 'System/css'; break;\n case \"cue\": icon = 'System/cue'; break;\n case \"exe\": icon = 'System/exe'; break;\n case \"htm\": icon = 'System/htm'; break;\n case \"html\": icon = 'System/html'; break;\n case \"ini\": icon = 'System/ini'; break;\n case \"iso\": icon = 'System/iso'; break;\n case \"nfo\": icon = 'System/nfo'; break;\n case \"txt\": icon = 'System/txt'; break;\n case \"xml\": icon = 'System/xml'; break;\n case \"sln\": icon = 'System/sln'; break;\n case \"vcproj\": icon = 'System/vcproj'; break;\n case \"dll\": icon = 'System/dll'; break;\n default: icon = 'System/default'; break;\n }\n \n return icon;\n }", "title": "" }, { "docid": "a841a09281c2aaff6fcf9aca28b84ba8", "score": "0.5387456", "text": "function darkSky(latitude, longitude) {\n url = url + latitude + \",\" + longitude + \"?exclude=minutely,hourly,alerts\";\n \n // make the ajax call to Dark Sky for weather info\n $.ajax({\n type: 'GET',\n url: url,\n dataType: 'jsonp',\n success: function(response) {\n // include Skycons\n var skycons = new Skycons({\"color\": \"black\"});\n var icon = response.currently.icon;\n skycons.add(\"iconBig\", icon);\n skycons.play();\n \n // get current conditions\n var farenheit = Math.round(response.currently.temperature);\n $currentTemp.append(farenheit + \" F\");\n $currentCond.append(response.currently.summary);\n $currentWind.append(Math.round(response.currently.windSpeed) + \" mph\");\n \n // get weekly forecast\n var result = response.daily.data;\n \n for(var i = 0; i < 5; i++) {\n var uniqueid = 'iconForecast' + i;\n $forecast.append(\n \"<div class='box'><canvas id=\" + uniqueid + \" width='28' height='28'></canvas><br>\" + Math.round(result[i].temperatureMax) \n + \"<br>\" + Math.round(result[i].temperatureMin) \n + \"</div>\"\n );\n skycons.add(uniqueid, result[i].icon);\n skycons.play();\n }\n \n //change F and C\n var units = response.flags.units;\n \n $(document).on(\"click\", \".btn\", function() {\n if (units === \"us\") {\n $currentTemp.html(\"\");\n var celsius = Math.round((farenheit - 32)/1.8);\n $currentTemp.append(celsius + \" C\");\n units = \"si\";\n } else {\n $currentTemp.html(\"\");\n $currentTemp.append(farenheit + \" F\");\n units = \"us\";\n }\n });\n }\n });\n }", "title": "" }, { "docid": "e0151f809ee1eb0455d44f0cc6a2f782", "score": "0.5381216", "text": "function displayWeatherCondition(response) {\n document.querySelector(\"#city\").innerHTML = response.data.name;\n document.querySelector(\"#country\").innerHTML = response.data.sys.country;\n document.querySelector(\"#temperature\").innerHTML = Math.round(\n response.data.main.temp\n );\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#description\").innerHTML =\n response.data.weather[0].main;\n\n\ndocument.querySelector(\"#sunrise\").innerHTML = formatTime(\n response.data.sys.sunrise * 1000\n );\n document.querySelector(\"#sunset\").innerHTML = formatTime(\n response.data.sys.sunset * 1000\n );\n let iconElement = document.querySelector(\"#icon\");\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n celsiusTemperature = response.data.main.temp;\n searchForecast(response);\n}", "title": "" }, { "docid": "9c2b8b88953f2943fe3b2febf4255685", "score": "0.5376684", "text": "function displayCurrentWeather(data, citySearched){\n //display city name using citySearched variable\n var cityName = $('.card-title');\n //add icon to end of city name \n cityName.html(citySearched + '<img src = https://openweathermap.org/img/w/' + data.current.weather[0].icon + '.png></img>' );\n //translate unixcode given from api display as date\n unixCode= data.current.dt\n var date= (moment.unix(unixCode.toString()).format('LL'));\n var dateDisplay = $('.card-subtitle');\n dateDisplay.html(date);\n \n //add current temp, humidity, wind speed, uvi to page\n var description = $('.card-text')\n var output = '<span class= \"current-temp\">' + data.current.temp.toFixed(0) + '&#8457' + '</span>';\n output += '<br> Humidity ' + data.current.humidity + '%.';\n output += '<br> Wind Speed: ' + data.current.wind_speed.toFixed(0) + 'mph.'\n //change uvi text color based on good, moderate, and severe uvi index\n if (data.current.uvi <= 2){\n output += '<br> <span class= \"good-uv\">UV index: ' + data.current.uvi.toFixed(0) + '</span>'\n } else if (data.current.uvi <= 7){\n output += '<br> <span class= \"moderate-uv\">UV index: ' + data.current.uvi.toFixed(0) + '</span>'\n } else {\n output += '<br> <span class= \"high-uv\">UV index: ' + data.current.uvi.toFixed(0) + '</span>'\n }\n //display data in description.\n description.html(output);\n}", "title": "" }, { "docid": "88526974bfce44515bf1296ea4fb081e", "score": "0.5375283", "text": "function updateWeatherBox(data) {\n\tdomStrings.location.textContent = data.name;\n\tdomStrings.description.textContent = data.weather[0].main;\n\tdomStrings.temperature.textContent = `${data.main.temp} F`;\n\t// Set icon and bg image based on weather\n\tif (data.weather[0].id >= 500 && data.weather[0].id <= 531) {\n\t\tdomStrings.icon.className = '';\n\t\tdomStrings.icon.classList.add('fa', 'fa-tint');\n\n\t\tdocument.body.style.backgroundImage = \"url('img/rain.jpg')\";\n\t} else if (data.weather[0].id >= 701 && data.weather[0].id <= 781) {\n\t\tdomStrings.icon.className = '';\n\t\tdomStrings.icon.classList.add('fa', 'fa-cloud');\n\n\t\tdocument.body.style.backgroundImage = \"url('img/clouds.jpeg')\";\n\n\t} else if (data.weather[0].id === 800) {\n\t\tdomStrings.icon.className = '';\n\t\tdomStrings.icon.classList.add('fa', 'fa-sun-o');\n\n\t\tdocument.body.style.backgroundImage = \"url('img/sun.jpg')\";\n\t} else {\n\t\tdomStrings.icon.className = '';\n\t\tdomStrings.icon.classList.add('fa', 'fa-sun-o');\n\t\tdomStrings.description.textContent = 'Weather is unclear';\n\n\t\tdocument.body.style.backgroundImage = \"url('img/unclear.jpeg')\";\n\t}\n}", "title": "" }, { "docid": "23cf8b79a6b4f81c3d66af97730bfdd8", "score": "0.53709227", "text": "function displayWeather(){\n iconElement.innerHTML = `<img src=\"weather/icons/${weather.iconId}.png\"/>`;\n tempElement.innerHTML = `${weather.temperature.value}°<span>C</span>`;\n descElement.innerHTML = weather.description;\n if(weather.description==\"overcast clouds\"){\n // iconElement.innerHTML = `<img src=\"weather/icons/04d.png\"/>`;\n notification2Element.innerHTML=`All fishermen should leave the lake because a heavy rain with heavy storms is expected`;\n }\n else if(weather.description==\"broken clouds\"){\n notification2Element.innerHTML=`its ok to go for fishing provided you leave the lake at 5:00pm`;\n }\n else if(weather.description==\"scattered clouds\"){\n notification2Element.innerHTML=`its ok to go for fishing provided you leave the lake at 5:00pm`;\n }\n else if(weather.description==\"light rain\"){\n notification2Element.innerHTML=`its ok to go for fishing,but be conscious incase of any heavy rain symptoms `;\n }\n else if(weather.description==\"shower rain\"){\n notification2Element.innerHTML=`Bad weather,get off the lake because usually rain comes with strong winds\n and poor visibility. `;\n }\n else if(weather.description==\"few clouds\"){\n notification2Element.innerHTML=` go fishing but be conscious incase of any change in weather.`;\n }\n else if(weather.description==\"clear sky\"){\n notification2Element.innerHTML=`its ok, go fishing provided you don't exceed 5:00pm \n to avoid attack by most o dangerous acquatic animals towards the night `;\n }\n else if(weather.description==\"rain\"){\n notification2Element.innerHTML=`Bad weather,get off the lake because usually rain comes with strong winds\n and poor visibility.` ;\n }\n else if(weather.description==\"thunderstorm\"){\n notification2Element.innerHTML=` Bad weather, immediately get off the lake to avoid accidents \n like drowning due to heavy winds.`;\n }\n else if(weather.description ==\"haze\"){\n notification2Element.innerHTML=` Bad weather, immediately get off the lake to avoid accidents \n like drowning due to heavy winds.`;\n }\n else if(weather.description ==\"moderate rain\"){\n notification2Element.innerHTML=` Bad weather, immediately get off the lake to avoid accidents \n like drowning due to heavy winds.`;\n }\n \n locationElement.innerHTML = `${weather.city}, ${weather.country}`;\n notification4Element.innerHTML =`${weather.Pressurevalue }Pa`;\n notification3Element.innerHTML = `${weather.windspeed}m/s`;\n}", "title": "" }, { "docid": "c55ab6172dacb5fe80d7b119d9c5f058", "score": "0.53662354", "text": "function renderForecast() {\n // url for 5 day forecast api\n var queryURLForecast = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + inputCity + apiKey;\n // calling api (5 day forecast)\n $.ajax({\n url: queryURLForecast,\n method: 'GET'\n }).then(function (response) {\n console.dir(response);\n //titels: 5-Day Forecast\n $('#forecast-text').text('5-Day Forecast:');\n //funciotn executions\n nextDay();\n day2();\n day3();\n day4();\n day5();\n //funcitn assignments:\n // forecast: next day\n function nextDay() {\n $('#day-1').addClass('forecasted-days');\n $('#next-day').text(response.list[4].dt_txt.split(' ')[0]);\n var nextDayIcon = $('#icon-next-day');\n renderNextDayIcon();\n var tempF1 = (response.list[4].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp').text(\"Temp: \" + tempF1.toFixed() + '°F');\n $('#next-day-humidity').text('Humidity: ' + response.list[4].main.humidity + '%');\n function renderNextDayIcon() {\n if (response.list[4].weather[0].main === \"Clouds\") {\n nextDayIcon.text('☁️');\n } else if (response.list[4].weather[0].main === \"Clear\") {\n nextDayIcon.text(' ☀️');\n } else if (response.list[4].weather[0].main === \"Rain\") {\n nextDayIcon.text(' 🌧');\n } else if (response.list[4].weather[0].main === \"Snow\") {\n nextDayIcon.text(' 🌨');\n }\n }\n }\n // forecast: 2 days out\n function day2() {\n $('#day-2').addClass('forecasted-days');\n $('#next-day2').text(response.list[12].dt_txt.split(' ')[0]);\n var nextDayIcon2 = $('#icon-next-day2');\n renderNextDayIcon2();\n var tempF2 = (response.list[12].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp2').text(\"Temp: \" + tempF2.toFixed() + '°F');\n $('#next-day-humidity2').text('Humidity: ' + response.list[12].main.humidity + '%');\n function renderNextDayIcon2() {\n if (response.list[12].weather[0].main === \"Clouds\") {\n nextDayIcon2.text(' ☁️');\n } else if (response.list[12].weather[0].main === \"Clear\") {\n nextDayIcon2.text(' ☀️');\n } else if (response.list[12].weather[0].main === \"Rain\") {\n nextDayIcon2.text(' 🌧');\n } else if (response.list[12].weather[0].main === \"Snow\") {\n nextDayIcon2.text(' 🌨');\n };\n }\n }\n // forecast: 3 days out\n function day3() {\n $('#day-3').addClass('forecasted-days');\n $('#next-day3').text(response.list[20].dt_txt.split(' ')[0]);\n var nextDayIcon3 = $('#icon-next-day3');\n renderNextDayIcon3();\n var tempF3 = (response.list[20].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp3').text(\"Temp: \" + tempF3.toFixed() + '°F');\n $('#next-day-humidity3').text('Humidity: ' + response.list[20].main.humidity + '%');\n function renderNextDayIcon3() {\n if (response.list[20].weather[0].main === \"Clouds\") {\n nextDayIcon3.text(' ☁️');\n } else if (response.list[20].weather[0].main === \"Clear\") {\n nextDayIcon3.text(' ☀️');\n } else if (response.list[20].weather[0].main === \"Rain\") {\n nextDayIcon3.text(' 🌧');\n } else if (response.list[20].weather[0].main === \"Snow\") {\n nextDayIcon3.text(' 🌨');\n };\n }\n }\n // forecast: 4 days out\n function day4() {\n $('#day-4').addClass('forecasted-days');\n $('#next-day4').text(response.list[28].dt_txt.split(' ')[0]);\n var nextDayIcon4 = $('#icon-next-day4');\n renderNextDayIcon4();\n var tempF4 = (response.list[28].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp4').text(\"Temp: \" + tempF4.toFixed() + '°F');\n $('#next-day-humidity4').text('Humidity: ' + response.list[28].main.humidity + '%');\n function renderNextDayIcon4() {\n if (response.list[28].weather[0].main === \"Clouds\") {\n nextDayIcon4.text(' ☁️');\n } else if (response.list[28].weather[0].main === \"Clear\") {\n nextDayIcon4.text(' ☀️');\n } else if (response.list[28].weather[0].main === \"Rain\") {\n nextDayIcon4.text(' 🌧');\n } else if (response.list[28].weather[0].main === \"Snow\") {\n nextDayIcon4.text(' 🌨');\n }\n }\n }\n // forecast: 5 days out\n function day5() {\n $('#day-5').addClass('forecasted-days');\n $('#next-day5').text(response.list[36].dt_txt.split(' ')[0]);\n var nextDayIcon5 = $('#icon-next-day5');\n renderNextDayIcon5()\n var tempF5 = (response.list[36].main.temp - 273.15) * 1.80 + 32;\n $('#next-day-temp5').text(\"Temp: \" + tempF5.toFixed() + '°F');\n $('#next-day-humidity5').text('Humidity: ' + response.list[36].main.humidity + '%');\n function renderNextDayIcon5() {\n if (response.list[36].weather[0].main === \"Clouds\") {\n nextDayIcon5.text(' ☁️');\n } else if (response.list[36].weather[0].main === \"Clear\") {\n nextDayIcon5.text(' ☀️');\n } else if (response.list[36].weather[0].main === \"Rain\") {\n nextDayIcon5.text(' 🌧');\n } else if (response.list[36].weather[0].main === \"Snow\") {\n nextDayIcon4.text(' 🌨');\n };\n }\n }\n });\n }", "title": "" }, { "docid": "52a04a9309c63b67ae08939234b8cac1", "score": "0.5356095", "text": "function dayOfTheWeek(forecast){\n \n \n var daysWeekArray = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n \n var days = forecast.map(function(day){\n var unix = new Date(day.date *1000);\n //conver date to unix by multiply by 1000, milliseconds is what JS likes\n unix = unix.getDay();\n //get the day of the week using the getDay method\n //getDay returns a number 0-6 that represents Sun-Sat respectively\n return unix;\n //return our new array\n \n }).reduce(function(array, dayofWeek, idx){\n //we need to put names to our numbers\n if(idx === 0){\n array.push(\"Today\");\n return array;\n //our current day is today which will always be first\n }\n else if(idx === 1){\n array.push(\"Tomorrow\");\n return array;\n //tomorrow will always be one more than today, second\n }\n else{\n array.push(daysWeekArray[dayofWeek]);\n return array;\n //all other days are named using their values in the daysWeekArray\n //the daysWeekArray has all days in chronologically order\n //Sunday will always be daysWeekArray[0]\n //meaning if we have Sunday's value, zero, we can access\n //the string in daysWeekArray by imputting zero\n }\n }, []);\n // end of map/reduce methods\n \n var wordyForecast = forecast.reduce(function(array, day, idx){\n day[\"date\"] = days[idx];\n array.push(day);\n if(day.icon.indexOf(\"cloudy\") >= 0){\n day[\"icon\"] = emoji.get('cloud');\n return array\n }\n else if(day.icon.indexOf(\"sun\") >= 0){\n day[\"icon\"] = emoji.get('sunny');\n return array\n }\n else if(day.icon.indexOf(\"rain\") >= 0){\n day[\"icon\"] = emoji.get('umbrella');\n return array\n }\n else if(day.icon.indexOf(\"clear\") >= 0){\n day[\"icon\"] = emoji.get(\"large_blue_circle\");\n return array\n }\n \n else{\n return array;\n }\n }, []).map(function(day){\n return [day.date, day.icon, day.summary, \"High of \" + day.tempHigh + \" degrees Fahrenheit\", \"Low of \" + day.tempLow + \" degrees Fahrenheit\"].join(\"\\n\");\n });\n //end of reduce function \n //this function replaces the date data, which is in unix, \n //with the names of the week\n var prettyForecast = wordyForecast.join('\\n');\n // console.log(\"blue\");\n console.log(prettyForecast);\n}", "title": "" }, { "docid": "a8d1de0df3dca606b2434e56cec09f3c", "score": "0.5354372", "text": "function weatherDataFahrenheit() {\r\n navigator.geolocation.getCurrentPosition(locationHandler);\r\n function locationHandler(position){\r\n placelat = position.coords.latitude;\r\n placelon = position.coords.longitude;\r\n $.getJSON(\"http://api.openweathermap.org/data/2.5/weather?APPID=c87ae1ce207b86d32f1ac31b319e04ad&lat=\"+placelat+\"&lon=\"+placelon+\"&units=imperial\", function(dataTwo){\r\n placeName = dataTwo.name;\r\n placeTemp = dataTwo.main.temp;\r\n $( \".weather_Location\" ).html( placeName );\r\n $( \".temp_deg\" ).html( Math.round(placeTemp) + \"&nbsp;&deg;F\" );\r\n weatherIcon = dataTwo.weather[0].icon;\r\n switch (weatherIcon) {\r\n case '01d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/1_ee8m7x.png';\r\n backgroundColor = '#ffffcc';\r\n break;\r\n case '02d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/2_snkyrl.png';\r\n backgroundColor = '#ffffcc';\r\n break;\r\n case '03d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/3_wvvsmq.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '04d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/3_wvvsmq.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '09d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/4_vveyub.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '10d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/5_we8jwt.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '11d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/6_hkoodr.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '13d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/7_ikf9r1.png';\r\n backgroundColor = '#80ccff';\r\n break;\r\n case '50d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/8_pwltiz.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '01n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/9_fiq6zz.png';\r\n backgroundColor = '#ffffcc';\r\n break;\r\n case '02n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/10_idcsnl.png';\r\n backgroundColor = '#ffffcc';\r\n break;\r\n case '03n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/3_wvvsmq.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '04n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/3_wvvsmq.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '09n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/4_vveyub.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '10n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/5_we8jwt.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '11n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/6_hkoodr.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '13n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/7_ikf9r1.png';\r\n backgroundColor = '#80ccff';\r\n break;\r\n case '50n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/8_pwltiz.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n }\r\n $(\".icon\").html(\"<img src='\" + iconUrl + \"'>\");\r\n $(\".main_body\").css(\"background-color\", backgroundColor );\r\n });\r\n }\r\n }", "title": "" }, { "docid": "a97f9bcc02782b1a3024cb5e71c5e3ff", "score": "0.535113", "text": "function getIcons(text) {\n switch (text) {\n case 'Frigate':\n case 'Galleon':\n case 'Skiff':\n case 'Pinnace':\n case 'Flute':\n return 'fas fa-ship';\n case 'Tax increase':\n return 'fas fa-balance-scale';\n case 'Expedition':\n return 'fas fa-map-signs';\n case 'Trader':\n return 'fas fa-exchange-alt';\n case 'Governor':\n return 'fas fa-landmark';\n case 'Jester':\n return 'far fa-smile-wink';\n case 'Admiral':\n return 'fas fa-binoculars';\n case 'Sailor':\n case 'Pirate':\n return 'fas fa-skull-crossbones';\n case 'Priest':\n return 'fas fa-cross';\n case 'Captain':\n return 'fas fa-anchor';\n case 'Settler':\n return 'fas fa-home';\n case 'Madamoiselle':\n return 'fas fa-percent';\n case 'Jack of all Trades':\n return 'fas fa-asterisk';\n }\n}", "title": "" }, { "docid": "c263618d61e639ec4ce412f69ab7075a", "score": "0.53487056", "text": "function skycons() {\n var i,\n icons = new Skycons({\n \"color\" : \"#FFFFFF\",\n \"resizeClear\": true // nasty android hack\n }),\n list = [ // listing of all possible icons\n \"clear-day\",\n \"clear-night\",\n \"partly-cloudy-day\",\n \"partly-cloudy-night\",\n \"cloudy\",\n \"rain\",\n \"sleet\",\n \"snow\",\n \"wind\",\n \"fog\"\n ];\n\n // loop thru icon list array\n for(i = list.length; i--;) {\n var weatherType = list[i], // select each icon from list array\n // icons will have the name in the array above attached to the\n // canvas element as a class so let's hook into them.\n elements = document.getElementsByClassName( weatherType );\n\n // loop thru the elements now and set them up\n for (e = elements.length; e--;) {\n icons.set(elements[e], weatherType);\n }\n }\n\n // animate the icons\n icons.play();\n }", "title": "" }, { "docid": "777c8be1c27454918bce999910520ecc", "score": "0.5346977", "text": "function showWeather(response) {\n document.querySelector(\n \"#city-display\"\n ).innerHTML = `${response.data.name}, ${response.data.sys.country}`;\n\n celsiusTemperature = response.data.main.temp;\n feelsLikeTemperature = response.data.main.feels_like;\n\n let temp = document.querySelector(\"#current-temp\");\n let currentTemp = Math.floor(celsiusTemperature);\n\n let description = document.querySelector(\"#description\");\n let weatherDescription = response.data.weather[0].description;\n\n console.log(weatherDescription);\n\n if (\n weatherDescription === \"scattered clouds\" ||\n \"few clouds\" ||\n \"broken clouds\" ||\n \"overcast clouds\"\n ) {\n document.body.style.backgroundImage = `url(\"images/cloudy.jpg\")`;\n }\n if (weatherDescription === \"clear sky\") {\n document.body.style.backgroundImage = `url(\"images/sunnyday.jpg\")`;\n }\n if (weatherDescription === \"shower rain\" || \"rain\") {\n document.body.style.backgroundImage === `url(\"images/rainy1.jpg\")`;\n }\n if (weatherDescription === \"snow\") {\n document.body.style.backgroundImage = `url(\"images/snowy.jpg\")`;\n }\n if (weatherDescription === \"thunderstorm\") {\n document.body.style.backgroundImage === `url(\"images/stormy.jpg\")`;\n }\n if (weatherDescription === \"mist\") {\n document.body.style.backgroundImage = `url(\"images/misty.jpg\")`;\n }\n\n let feelsLike = document.querySelector(\"#feels-like\");\n let feelsLikeTemp = Math.floor(feelsLikeTemperature);\n\n // let humidity = document.querySelector(\"#humidity\");\n // let showHumidity = response.data.main.humidity;\n\n // let windSpeed = document.querySelector(\"#wind-speed\");\n // let showWindSpeed = Math.floor(response.data.wind.speed);\n\n let max = document.querySelector(\"#high\");\n let min = document.querySelector(\"#low\");\n let high = Math.floor(response.data.main.temp_max);\n let low = Math.floor(response.data.main.temp_min);\n\n temp.innerHTML = `${currentTemp}`;\n description.innerHTML = `${weatherDescription}`;\n feelsLike.innerHTML = `Feels like ${feelsLikeTemp}`;\n // humidity.innerHTML = `Humidity: ${showHumidity}`;\n // windSpeed.innerHTML = `Windspeed: ${showWindSpeed}`;\n max.innerHTML = `${high}`;\n min.innerHTML = ` ${low}`;\n\n let iconElement = document.querySelector(\"#icon\");\n iconElement.innerHTML = response.data.weather[0].icon;\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n\n getForecast(response.data.coord);\n}", "title": "" }, { "docid": "71aaf15bbf741d4e28371ab42ec1b4cd", "score": "0.53398824", "text": "function addWeatherToPage(data,data1,data2,data3) {\r\n const temp = Math.floor(data.main.temp-273.15);\r\n const tem=document.querySelectorAll(\".temp\");\r\n const locode=data1[0].Key;\r\n tem[0].innerHTML=temp+\"°C\";\r\n tem[1].innerHTML=temp+\"°C\";\r\n tem[2].innerHTML=temp+\"°C\";\r\n const loci=document.querySelectorAll(\".info\");\r\n const loc=document.querySelectorAll(\".icon\");\r\n const con=document.querySelectorAll(\".cond\");\r\n\r\n for(var i=0;i<3;i++){loc[i].innerHTML = `\r\n <img src=\"https://openweathermap.org/img/wn/${data.weather[0].icon}@2x.png\" />\r\n `;\r\n con[i].innerHTML=`\r\n <small>${data.weather[0].main}</small>\r\n `; \r\n loci[i].innerHTML=`\r\n ${data1[0].EnglishName},${data1[0].AdministrativeArea.EnglishName}\r\n `; \r\n }\r\n////////////////////////////////////////////////\r\n const wind=document.querySelector('#wind');\r\n wind.innerHTML=`\r\n Wind Speed:<br> ${data2[0].Wind.Speed.Metric.Value} ${data2[0].Wind.Speed.Metric.Unit}\r\n ` ;\r\n const feel=document.querySelector('#feel');\r\n feel.innerHTML=`\r\n Feels Like: ${data2[0].RealFeelTemperature.Metric.Value} °${data2[0].RealFeelTemperature.Metric.Unit}\r\n `;\r\n const humid=document.querySelector('#humidity');\r\n humid.innerHTML=`\r\n Relative Humidity:${data2[0].RelativeHumidity}\r\n ` ;\r\n const vis=document.querySelector('#vis');\r\n vis.innerHTML=`\r\n Visibility:${data2[0].Visibility.Metric.Value} ${data2[0].Visibility.Metric.Unit}\r\n ` ;\r\n////////////////////////////////////////\r\n const element=document.querySelectorAll(\".nico\");\r\n for(var i=0;i<3;i++){\r\n if(data3.DailyForecasts[i+2].Day.Icon<10){element[i].innerHTML=`\r\n <img src=\"https://developer.accuweather.com/sites/default/files/0${data3.DailyForecasts[i+2].Day.Icon}-s.png\" />\r\n `;}\r\n else{\r\n element[i].innerHTML=`\r\n <img src=\"https://developer.accuweather.com/sites/default/files/${data3.DailyForecasts[i+2].Day.Icon}-s.png\" />\r\n `;\r\n }\r\n}\r\n\r\nconst ntemp=document.querySelectorAll(\".ntemp\");\r\nfor(var i=0;i<3;i++){\r\n ntemp[i].innerHTML=`\r\n ${parseInt(((data3.DailyForecasts[i+2].Temperature.Maximum.Value)-32)*5/9)}° C\r\n `;\r\n\r\n}\r\n\r\n\r\n \r\n // cleanup\r\n \r\n }", "title": "" }, { "docid": "3cb1dc87f61f014a4522967a9c4106a6", "score": "0.5319368", "text": "function getWeatherIconClassByText(text)\n{\n\tif (!text)\n\t{\n\t\taddDebugLog('[error] text not found.');\n\t\treturn '';\n\t}\n\t\n var classMap = {\n d0 : '晴',\n d1 : '多云',\n d2 : '阴',\n d3 : '阵雨',\n d4 : '雷阵雨',\n d5 : '雷阵雨并伴有冰雹',\n d6 : '雨夹雪',\n d7 : '小雨',\n d8 : '中雨',\n d9 : '大雨',\n d10 : '暴雨',\n d11 : '大暴雨',\n d12 : '特大暴雨',\n d13 : '阵雪',\n d14 : '小雪',\n d15 : '中雪',\n d16 : '大雪',\n d17 : '暴雪',\n d18 : '雾',\n d19 : '台风',\n d20 : '沙尘暴',\n d29 : '浮沉',\n d30 : '扬尘'\n };\n\n // complete match (priority)\n for (var key in classMap)\n {\n if (classMap[key] === text)\n {\n return key;\n }\n }\n\n // part match\n for (var key in classMap)\n {\n if (text.indexOf(classMap[key]) >= 0)\n {\n return key;\n }\n }\n\n return '';\n}", "title": "" }, { "docid": "668492e7ba73558955a7fd7ab9071961", "score": "0.5319059", "text": "function updateColors(){\n var current_weather = $('#current-weather').text().trim();\n current_weather = current_weather.toLowerCase();\n\n if(current_weather === 'partly-cloudy-day' ){\n var colors = new Array(\n [117, 174, 244],\n [21,114,148],\n [81, 112, 123],\n [186, 220, 220]\n );\n }\n else if(current_weather === 'partly-cloudy-night' || current_weather === 'clear-night' ){\n var colors = new Array(\n [31, 41, 64],\n [21, 42, 90],\n [2, 11, 32],\n [20, 27, 34]\n );\n }\n else if(current_weather === 'rain' ){\n var colors = new Array(\n [0, 105, 128],\n [77, 100, 118],\n [49, 152, 232],\n [5, 31, 36]\n );\n }\n else if(current_weather === 'snow' || current_weather === 'sleet' || current_weather === 'fog' || current_weather === 'cloudy'){\n var colors = new Array(\n [31, 41, 64],\n [21, 42, 90],\n [2, 11, 32],\n [20, 27, 34]\n );\n }\n else{\n var colors = new Array(\n [255,196,0],\n [169,135,34],\n [255,111,0],\n [224, 197, 48]\n );\n }\n\n return colors;\n}", "title": "" }, { "docid": "408226b92acc65f14ff18c4a422e05fc", "score": "0.5316999", "text": "function getWeatherIcon(data, weatherObjects, i) {\n\n\n let weatherCondition = \"\";\n\n let weatherIcon = data.daily.data[i].icon;\n\n weatherObjects.forEach(function(element) {\n if(weatherIcon === element.condition) {\n weatherCondition += element.url;\n }\n\n\n });\n\n return weatherCondition;\n}", "title": "" } ]
386cb561966766d0564ca47c6a625cf8
b1 += b2 :: BigNat > BigNat > Int returns new size of b1
[ { "docid": "fffe27e6da6dd62d8afd596d4596837c", "score": "0.62481964", "text": "function h$ghcjsbn_addTo_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"addTo_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"addTo_bb b2\");\n var i, c = 0, l1 = b1[0], l2 = b2[0];\n if(l2 > l1) {\n for(i = l1 + 1; i <= l2; i++) {\n b1[i] = 0;\n }\n l1 = l2;\n }\n for(i = 1; i <= l2; i++) {\n c += b1[i] + b2[i];\n b1[i] = c & 0xfffffff;\n c >>= 28;\n }\n // propagate carry as long as needed\n for(i = l2 + 1; c !== 0 && i <= l1; i++) {\n c += b1[i];\n b1[i] = c & 0xfffffff;\n c >>= 28;\n }\n if(c !== 0) {\n b1[l1] = c;\n b1[0] = l1+1;\n } else {\n b1[0] = l1;\n }\n h$ghcjsbn_assertValid_b(b1, \"addTo_bb result\");\n}", "title": "" } ]
[ { "docid": "c6c839049e582b1e64d60a174d9c9250", "score": "0.6139016", "text": "function Add(a, b) {\r\n return (new Int64()).assignAdd(a, b);\r\n}", "title": "" }, { "docid": "1ba1348b53f32c766d7c5d7b948963a1", "score": "0.60901886", "text": "function ADD64AA(v, a, b) {\n var o0 = v[a] + v[b];\n var o1 = v[a + 1] + v[b + 1];\n\n if (o0 >= 0x100000000) {\n o1++;\n }\n\n v[a] = o0;\n v[a + 1] = o1;\n} // 64-bit unsigned addition", "title": "" }, { "docid": "1ba1348b53f32c766d7c5d7b948963a1", "score": "0.60901886", "text": "function ADD64AA(v, a, b) {\n var o0 = v[a] + v[b];\n var o1 = v[a + 1] + v[b + 1];\n\n if (o0 >= 0x100000000) {\n o1++;\n }\n\n v[a] = o0;\n v[a + 1] = o1;\n} // 64-bit unsigned addition", "title": "" }, { "docid": "445904e7e44b3e7f0c5a0f842f9915a7", "score": "0.6086238", "text": "function Add(a, b) {\n return (new Int64()).assignAdd(a, b);\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.60509247", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.60509247", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.60509247", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.60509247", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "bb92638bb4385ddde39a443a2a179066", "score": "0.6020348", "text": "function ADD64AA(v, a, b) {\n var o0 = v[a] + v[b];\n var o1 = v[a + 1] + v[b + 1];\n if (o0 >= 0x100000000) {\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n}", "title": "" }, { "docid": "e9fea7af4d8af1a6977486745b714607", "score": "0.6018913", "text": "assignAdd(a, b) {\n let carry = 0;\n for (let i = 0; i < 8; i++) {\n let cur = a.byteAt(i) + b.byteAt(i) + carry;\n carry = cur > 0xff | 0;\n this._bytes[i] = cur;\n }\n return this;\n }", "title": "" }, { "docid": "e9fea7af4d8af1a6977486745b714607", "score": "0.6018913", "text": "assignAdd(a, b) {\n let carry = 0;\n for (let i = 0; i < 8; i++) {\n let cur = a.byteAt(i) + b.byteAt(i) + carry;\n carry = cur > 0xff | 0;\n this._bytes[i] = cur;\n }\n return this;\n }", "title": "" }, { "docid": "b537bda08f044faf32404ea7ae9f69f0", "score": "0.60090655", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b];\n var o1 = v[a + 1] + v[b + 1];\n if (o0 >= 0x100000000) {\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n}", "title": "" }, { "docid": "02d4d783438fa7e4b1657c11a85b7c48", "score": "0.59836656", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b];\n var o1 = v[a + 1] + v[b + 1];\n if (o0 >= 0x100000000) {\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n }", "title": "" }, { "docid": "dd83c12c085a50975d5bfa75b7eaa4b6", "score": "0.59561634", "text": "function bnAdd(a) {\n var r = new BigInteger()\n this.addTo(a, r)\n return r\n}", "title": "" }, { "docid": "dd83c12c085a50975d5bfa75b7eaa4b6", "score": "0.59561634", "text": "function bnAdd(a) {\n var r = new BigInteger()\n this.addTo(a, r)\n return r\n}", "title": "" }, { "docid": "dd83c12c085a50975d5bfa75b7eaa4b6", "score": "0.59561634", "text": "function bnAdd(a) {\n var r = new BigInteger()\n this.addTo(a, r)\n return r\n}", "title": "" }, { "docid": "dd83c12c085a50975d5bfa75b7eaa4b6", "score": "0.59561634", "text": "function bnAdd(a) {\n var r = new BigInteger()\n this.addTo(a, r)\n return r\n}", "title": "" }, { "docid": "dd83c12c085a50975d5bfa75b7eaa4b6", "score": "0.59561634", "text": "function bnAdd(a) {\n var r = new BigInteger()\n this.addTo(a, r)\n return r\n}", "title": "" }, { "docid": "dd83c12c085a50975d5bfa75b7eaa4b6", "score": "0.59561634", "text": "function bnAdd(a) {\n var r = new BigInteger()\n this.addTo(a, r)\n return r\n}", "title": "" }, { "docid": "dd83c12c085a50975d5bfa75b7eaa4b6", "score": "0.59561634", "text": "function bnAdd(a) {\n var r = new BigInteger()\n this.addTo(a, r)\n return r\n}", "title": "" }, { "docid": "dd83c12c085a50975d5bfa75b7eaa4b6", "score": "0.59561634", "text": "function bnAdd(a) {\n var r = new BigInteger()\n this.addTo(a, r)\n return r\n}", "title": "" }, { "docid": "dd83c12c085a50975d5bfa75b7eaa4b6", "score": "0.59561634", "text": "function bnAdd(a) {\n var r = new BigInteger()\n this.addTo(a, r)\n return r\n}", "title": "" }, { "docid": "fdd29a9c7627a8666f8d47e5e69e8cdd", "score": "0.5824816", "text": "function ADD64AC (v, a, b0, b1) {\n var o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n var o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "fdd29a9c7627a8666f8d47e5e69e8cdd", "score": "0.5824816", "text": "function ADD64AC (v, a, b0, b1) {\n var o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n var o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "fdd29a9c7627a8666f8d47e5e69e8cdd", "score": "0.5824816", "text": "function ADD64AC (v, a, b0, b1) {\n var o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n var o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "fdd29a9c7627a8666f8d47e5e69e8cdd", "score": "0.5824816", "text": "function ADD64AC (v, a, b0, b1) {\n var o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n var o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "fdd29a9c7627a8666f8d47e5e69e8cdd", "score": "0.5824816", "text": "function ADD64AC (v, a, b0, b1) {\n var o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n var o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "46acbd0fb7157ac1b34b104fd17b0500", "score": "0.58161855", "text": "function ADD64AC (v, a, b0, b1) {\n var o0 = v[a] + b0;\n if (b0 < 0) {\n o0 += 0x100000000;\n }\n var o1 = v[a + 1] + b1;\n if (o0 >= 0x100000000) {\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n}", "title": "" }, { "docid": "2b4c1180e721f2985e3ad2ccfb50d680", "score": "0.58011425", "text": "function ADD64AC(v, a, b0, b1) {\n var o0 = v[a] + b0;\n if (b0 < 0) {\n o0 += 0x100000000;\n }\n var o1 = v[a + 1] + b1;\n if (o0 >= 0x100000000) {\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n}", "title": "" }, { "docid": "249abfd1f488f8f0716adbd3d21fb4ff", "score": "0.57970244", "text": "function ADD64AC (v, a, b0, b1) {\n var o0 = v[a] + b0;\n if (b0 < 0) {\n o0 += 0x100000000;\n }\n var o1 = v[a + 1] + b1;\n if (o0 >= 0x100000000) {\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n }", "title": "" }, { "docid": "e8cd4ec2cc30f54badb318348648209f", "score": "0.57787687", "text": "function ADD64AC(v, a, b0, b1) {\n var o0 = v[a] + b0;\n\n if (b0 < 0) {\n o0 += 0x100000000;\n }\n\n var o1 = v[a + 1] + b1;\n\n if (o0 >= 0x100000000) {\n o1++;\n }\n\n v[a] = o0;\n v[a + 1] = o1;\n} // Little-endian byte access", "title": "" }, { "docid": "e8cd4ec2cc30f54badb318348648209f", "score": "0.57787687", "text": "function ADD64AC(v, a, b0, b1) {\n var o0 = v[a] + b0;\n\n if (b0 < 0) {\n o0 += 0x100000000;\n }\n\n var o1 = v[a + 1] + b1;\n\n if (o0 >= 0x100000000) {\n o1++;\n }\n\n v[a] = o0;\n v[a + 1] = o1;\n} // Little-endian byte access", "title": "" }, { "docid": "6ed393be70e81ff4914b2902cf19098c", "score": "0.5707487", "text": "function bnAdd(a) {\n var r = new BigInteger();\n this.addTo(a, r);\n return r;\n }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "ce14d98e9012f68665b0235b29f9d29e", "score": "0.5704739", "text": "function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }", "title": "" }, { "docid": "9caef6ce1ae40fdea95d96904121a664", "score": "0.5663427", "text": "function bnAdd(a) {\n var r = nbi();\n this.addTo(a, r);\n return r;\n}", "title": "" }, { "docid": "300b5a819dcdd3ba5eae87d2787e5c91", "score": "0.5653075", "text": "function bnAdd(a)\n{\n var r = nbi();\n this.addTo(a, r);\n return r;\n}", "title": "" }, { "docid": "85beb2cb68b8cb52b53e6f31eb0d58e2", "score": "0.5646134", "text": "function add_(x, y) {var i, c, k, kk;k = x.length < y.length ? x.length : y.length;for (c = 0, i = 0; i < k; i++) {c += x[i] + y[i];x[i] = c & mask;c >>= bpe;}for (i = k; c && i < x.length; i++) {c += x[i];x[i] = c & mask;c >>= bpe;}} //do x=x*y for bigInts x and y. This is faster when y<x.", "title": "" }, { "docid": "16bc54209e60b18e08943377b31080ed", "score": "0.5628264", "text": "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this.data[i] + a.data[i];\n r.data[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this.data[i];\n r.data[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a.data[i];\n r.data[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r.data[i++] = c;else if (c < -1) r.data[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "5846ce58b9b40ff413ff032349d31c77", "score": "0.56261146", "text": "function h$ghcjsbn_add_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"add_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"add_bb b2\");\n var i, c = 0, l1 = b1[0], l2 = b2[0], t = [0];\n var bl, lmin, lmax;\n if(l1 <= l2) {\n lmin = l1;\n lmax = l2;\n bl = b2;\n } else {\n lmin = l2;\n lmax = l1;\n bl = b1;\n }\n for(i=1;i<=lmin;i++) {\n c += b1[i] + b2[i];\n t[i] = c & 0xfffffff;\n c >>= 28;\n }\n for(i=lmin+1;i<=lmax;i++) {\n c += bl[i];\n t[i] = c & 0xfffffff;\n c >>= 28;\n }\n if(c !== 0) t[++lmax] = c;\n t[0] = lmax;\n h$ghcjsbn_assertValid_b(t, \"add_bb result\");\n return t;\n}", "title": "" } ]
7c33e7e760a25981381a53753e4cc7a5
Nearest 'green' square without a worker
[ { "docid": "0ebd904eafcf7944ae930fc0ee9aac85", "score": "0.7006273", "text": "findNearestEmpty(x, y) {\n let worker_at = [];\n this.workers.forEach(function (worker) {\n let x = worker.x;\n let y = worker.y;\n if (worker.moving) {\n x = worker.dest_x;\n y = worker.dest_y;\n }\n worker_at[x] = worker_at[x] || [];\n worker_at[x][y] = true;\n });\n let board = this;\n function test(x, y, only_hp) {\n if (board.mapGet(x, y, 'state') !== 'green') {\n return;\n }\n if (only_hp && !board.mapGet(x, y, 'hp')) {\n return;\n }\n if (!worker_at[x] || !worker_at[x][y]) {\n return [x, y];\n }\n }\n let d = 1;\n while (true) {\n let r;\n let vvs = [\n [-1, -1],\n [-1, 1],\n [1, -1],\n [1, 1],\n ];\n for (let ii = 0; ii <= d; ++ii) {\n for (let kk = 0; kk < 2; ++kk) {\n for (let jj = 0; jj < vvs.length; ++jj) {\n if ((r = test(x + vvs[jj][0] * ii, y + vvs[jj][1] * d, !kk))) {\n return r;\n }\n if ((r = test(x + vvs[jj][0] * d, y + vvs[jj][1] * ii, !kk))) {\n return r;\n }\n }\n }\n }\n ++d;\n }\n }", "title": "" } ]
[ { "docid": "def59e933faa51371e6481b26e99aa57", "score": "0.5988116", "text": "updateConnectivity() {\n\t\tlet connectivity = this.duplicate2dArray(this.connectivity);\n\t\tconst size = this.props.size;\n\t\tconst colors = this.duplicate2dArray(this.tempColors);\n\t\tconst activeColor = colors[0][0];\n\n\t\t// keep track of which squares have already been checked\n\t\tlet checked = Array(size);\n\t\tfor (let x = 0; x < size; x++) {\n\t\t\tchecked[x] = Array(size)\n\t\t\tfor (let y = 0; y < size; y++) {\n\t\t\t\tchecked[x][y] = false;\n\t\t\t}\n\t\t}\n\n\t\t// starting from the top left, see which squares are connected and the same color\n\t\tlet square;\n\t\tlet queue = [{x: 0, y: 0}];\n\t\twhile (queue.length > 0) {\n\t\t\t// get the next connected square from the queue\n\t\t\tsquare = queue.pop();\n\n\t\t\t// see if it's the same color as top left\n\t\t\tif (colors[square.x][square.y] === activeColor) {\n\t\t\t\tconnectivity[square.x][square.y] = true;\n\n\t\t\t\t// add adjacent squares to queue\n\t\t\t\t// if they haven't already been checked\n\t\t\t\tif (square.x > 0 && !checked[square.x - 1][square.y]) { queue.push({x: (square.x - 1), y: square.y}); }\n\t\t\t\tif (square.x < size - 1 && !checked[square.x + 1][square.y]) { queue.push({x: (square.x + 1), y: square.y}); }\n\t\t\t\tif (square.y > 0 && !checked[square.x][square.y - 1]) { queue.push({x: square.x, y: (square.y - 1)}); }\n\t\t\t\tif (square.y < size - 1 && !checked[square.x][square.y + 1]) { queue.push({x: square.x, y: (square.y + 1)}); }\n\t\t\t}\n\n\t\t\t// mark square as checked\n\t\t\tchecked[square.x][square.y] = true;\n\t\t}\n\n\t\tthis.connectivity = this.duplicate2dArray(connectivity);\n\t}", "title": "" }, { "docid": "ce48d71123c66f7241a11014dadc7c3d", "score": "0.58813727", "text": "function setNearestNeighbour(context,flag){\n context.imageSmoothingEnabled = flag;\n return context;\n }", "title": "" }, { "docid": "22b7f43f3018d9bbe345172315e271d4", "score": "0.58141375", "text": "get ToNearest() {}", "title": "" }, { "docid": "deaf078ada24edf5d370c9f476411afe", "score": "0.57963926", "text": "grabNearestTrooper(state){\n const startArr = [0, 1, 1, 1, 2, 2, 1, 0];\n const step = this.back;\n const startPos = this.start + startArr[this.state] * step;\n let trooperArr;\n //searches this.map for nearest occupied position\n for (let i = startPos; i < 100 && i > -1; i += step) {\n trooperArr = this.map[i];\n if(trooperArr){break;}\n }\n //gets trooper with greatest height (least Y)\n let trooper = trooperArr[0];\n for (let i = 1; i < trooperArr.length; i++) {\n if(trooperArr[i].y < trooper.y){trooper = trooperArr[i];}\n }\n return trooper;\n }", "title": "" }, { "docid": "0f05c56880ed49174a38adf6bd1a6b8f", "score": "0.57085955", "text": "function nearestSquare (limit) {\n let mult = 0\n let i = 0\n while (mult <= limit) {\n mult = i * i\n i += 1\n }\n i -= 2\n return i * i\n}", "title": "" }, { "docid": "0bd195b9b1585e38a416f2a38792d192", "score": "0.55226004", "text": "function _findNearestNode(xy){\n\t\treturn force.find(xy[0]-W/2, xy[1]-H/2, r*5);\n\t}", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "804b798b9693075e701168502688db44", "score": "0.552156", "text": "function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" }, { "docid": "32b1d2b0ac91203999dae9ad2c1ce56c", "score": "0.55024815", "text": "function drawRndsqr(){\n background('orange');\n fill('orange');\n stroke('blue');\n strokeWeight(10);\n square(width/2-height/6, height/2-height/6, height/3, 30);\n}", "title": "" }, { "docid": "1580acd3aea1f38be8cc793d1bb87837", "score": "0.54787755", "text": "getNearest(pixels) {\n const candidates = [{\n char : '\\u0020',\n fg : {\n distance : this.getTransparentDistance(pixels),\n value : null\n },\n bg : {\n distance : 0,\n value : null\n }\n }\n ];\n\n for (let i = 0x40; i <= 0xFF; i++) {\n var cand;\n const offset = 0x2800 + i;\n const fgPixels = this.decodeBrailleOffset(pixels, i, false);\n const bgPixels = this.decodeBrailleOffset(pixels, i, true);\n candidates.push(cand = {\n char : String.fromCharCode(offset),\n fg : this.getNearestColor(fgPixels),\n bg : this.getNearestColor(bgPixels)\n });\n }\n\n\n const best = _.min(candidates, c => c.fg.distance + c.bg.distance);\n return {\n fg : (best.fg.value != null ? best.fg.value.fg : undefined),\n bg : (best.bg.value != null ? best.bg.value.bg : undefined),\n char : best.char\n };\n }", "title": "" }, { "docid": "5f510375b7b1f76d9f782a52634da136", "score": "0.54773235", "text": "static simplify(points, tolerance, highestQuality) {\n if (points.length <= 2) {\n return points;\n }\n\n const sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality\n ? points\n : this.simplifyRadialDist(points, sqTolerance);\n points = this.simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n }", "title": "" }, { "docid": "25e4fb8899c20ed05a3a8ad0b039e058", "score": "0.5456918", "text": "function pickSquareIndex() {\r\n //easy mode - index rang 0 - numOfSquares-1\r\n //harde mode - index rang 0 - squaresArr.length-1\r\n //Math.random() * (max - min) + min;\r\n return Math.round(Math.random() * (numOfSquares-1));\r\n}", "title": "" }, { "docid": "4e8106dbdf41e01661275b721999036e", "score": "0.54441303", "text": "step(corners = false) { // corners boolean determines if corners are accepted\n let neighbors = (x, y, value) => {\n if (y >= 1 && buffer[y - 1][x] === value) {\n return true;\n } \n // if (y + 1 < this.height && buffer[y + 1][x] === value) {\n // return true;\n // }\n if (x >= 1 && buffer[y][x - 1] === value) {\n return true;\n }\n if (x + 1 < this.width && buffer[y][x + 1] === value) {\n return true;\n }\n return false\n }\n\n let buffer = this.buffer[this.currentBuf];\n let buffer2 = this.buffer[(this.currentBuf === 0 ? 1 : 0)];\n\n for (let y = 0; y < buffer.length; y++) {\n for (let x = 0; x < buffer[y].length; x++) { \n let value = buffer[y][x]\n let compare = (value + 1) % MODULO\n \n if (!corners) {\n if (neighbors.call(this, x, y, compare)) {\n value = compare\n }\n } else {\n if (this.getNeighbors(x, y, compare)) {\n value = compare\n }\n }\n buffer2[y][x] = value;\n }\n }\n this.currentBuf = (this.currentBuf === 0 ? 1 : 0)\n }", "title": "" }, { "docid": "89e877307914893a882e876ef220dede", "score": "0.54424274", "text": "function simplify(points, tolerance, highestQuality) {\n\n\t var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n\t points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n\t points = simplifyDouglasPeucker(points, sqTolerance);\n\n\t return points;\n\t}", "title": "" }, { "docid": "dea0ea5444087a1fcfe1030e7589f604", "score": "0.5431633", "text": "function getColorsNeighbor(i) {\n //data of the current square you're working with\n let screen = screens[square.screen]\n let nbOfRows = screen.grid.length\n let nbOfCols = screen.grid[0].length\n // possible angles\n const angles = [\n { x: 1, y: -1 }, { x: 1, y: 1 },\n { x: -1, y: 1 }, { x: -1, y: -1 }\n ]\n // get row and column from i\n let rowI = square.row + angles[i].y\n let colI = square.col + angles[i].x\n // check if are col or row is out of bounds\n let rowInRange = ((0 <= rowI) && (rowI < nbOfRows))\n let colInRange = ((0 <= colI) && (colI < nbOfCols))\n // visual representation of edge cases (literal edge cases)\n // __________________________\n // \\\\\\\\\\\\\\\\\\\\\\side \\\\\\\\\\\\| |\n //\t\\\\\\\\\\\\\\\\\\\\\\border\\\\\\\\\\\\|cornBorder|\n //\t\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|__________|\n //\t | |\\\\\\\\\\\\\\\\\\\\|\n //\t | |\\\\\\\\\\\\\\\\\\\\|\n //\t 2 | 1 |\\\\\\\\\\\\\\\\\\\\|\n //\t | |\\\\\\\\\\\\\\\\\\\\|\n //\t__________|____________|\\\\side \\\\|\n //\t | |\\\\border\\\\|\n //\t | 3 |\\\\\\\\\\\\\\\\\\\\|\n\n // 1) if both are not in range take corner border and side border color\n if (!rowInRange && !colInRange) {\n return [\n\t\t\t\t\tscreen.sideBorder,\n\t\t\t\t\tscreen.sideBorder,\n\t\t\t\t\tscreen.cornBorder\n\t\t\t\t]\n }\n // 2) if only row is not in range return sideBorder and the horizontal side neigbor\n if (!rowInRange) {\n return [\n screen.sideBorder,\n screen.grid[rowI - angles[i].y][colI],\n\t\t\t\t\tscreen.sideBorder\n ]\n }\n // 3) if only col is not in range return sideBorder and the vertical side neigbor\n if (!colInRange) {\n return [\n\t\t\t\t\tscreen.grid[rowI][colI - angles[i].x],\n screen.sideBorder,\n\t\t\t\t\tscreen.sideBorder\n ]\n }\n return [\n\t\t\tscreen.grid[rowI][colI - angles[i].x],\n\t\t\tscreen.grid[rowI - angles[i].y][colI],\n\t\t\tscreen.grid[rowI][colI]\n\t\t];\n }", "title": "" }, { "docid": "414540860ce153ba411c89cdff50ec96", "score": "0.543046", "text": "deterministicX() {\n const rgbArray = this.colorFromWork.rgb().array();\n const ratio = (rgbArray[0] + rgbArray[2]) / (255 + 255);\n\n return this.radius + Math.trunc((ratio * document.body.clientWidth) - this.diameter);\n }", "title": "" }, { "docid": "40106653017af253596ca188128fe698", "score": "0.5414251", "text": "function shrinkSquare () {\n// set fill to current colorValue for red and green\n fill(colorValue, colorValue, 0);\n// first time square is drawn its top, right and bottom edges are at the \n// edges of the canvas. Throughout the loop, only the top of the square \n// will stay aligned with the edge of the canvas.\n square(246, 0, 564);\n// scale next iteration of square to 90% of previous iteration\n scale(.9);\n// reduce color values of red and green by 5 for next iteration\n colorValue = colorValue - 5;\n}", "title": "" }, { "docid": "65318c18b1457b664576872184ac82e1", "score": "0.53954965", "text": "function currentSimilarity(xCoord, yCoord, cellColorLetter) \r\n{\r\n var cellsChecked = 0\r\n var sameColorCells = 0\r\n for (var rowNum = xCoord - 1; rowNum <= xCoord + 1; rowNum++) \r\n {\r\n for (var colNum = yCoord - 1; colNum <= yCoord + 1; colNum++) \r\n {\r\n if (rowNum >= 0 && rowNum < gridSize && colNum >= 0 && colNum < gridSize) {\r\n if (board[rowNum][colNum] != \" \") \r\n {\r\n cellsChecked++\r\n if (board[rowNum][colNum] == cellColorLetter) \r\n {\r\n sameColorCells++\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return (cellsChecked == 0) ? 100 : (sameColorCells / cellsChecked) * 100\r\n}", "title": "" }, { "docid": "590262728526f0f3746d55ca7fa13f0f", "score": "0.5394558", "text": "function simplify(points, tolerance, highestQuality) {\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}", "title": "" }, { "docid": "5e54250f46d7ac7daf5f2fdf5c23f9ad", "score": "0.5374645", "text": "function findClosestColor(color) {\n if (color < 0.5) {\n return 0\n } else {\n return 1\n }\n }", "title": "" }, { "docid": "4dad8db4906dca85d864d05dad0ae70f", "score": "0.5334272", "text": "convPixel(noyau, copie) {\n for (let i = 1; i <= this.hauteur ; i++) {\n for (let j = 1; j <= this.largeur; j++) {\n let res = 0;\n let couleur = [0, 0, 0];\n for (let p = -1; p < 2; p++) {\n for (let m = -1; m < 2; m++) {\n let coords = [i + p, j + m];\n if (coords[0] > 0 && coords[0] < this.hauteur && coords[1] > 0 && coords[1] < this.largeur) {\n couleur[0] += copie.get(coords[0], coords[1]).r.value * noyau[1 + p][1 + m];\n couleur[1] += copie.get(coords[0], coords[1]).g.value * noyau[1 + p][1 + m];\n couleur[2] += copie.get(coords[0], coords[1]).b.value * noyau[1 + p][1 + m];\n }\n }\n }\n let coul_res = new Couleur(couleur[0], couleur[1], couleur[2], 255);\n this.set(i, j, coul_res);\n }\n }\n }", "title": "" }, { "docid": "2eb6550cebf2a7214bc18227dbc0b1d1", "score": "0.5324599", "text": "function simplify(points, tolerance, highestQuality) {\n\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}", "title": "" }, { "docid": "3882d395d3383b6d1de7ed6ec0249010", "score": "0.5305911", "text": "function barrettSqrTo(x, r)\n{\n x.squareTo(r);\n this.reduce(r);\n}", "title": "" }, { "docid": "ba63cf0389c3fc2eaaed421e477a51a0", "score": "0.52808416", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r)\n this.reduce(r)\n}", "title": "" }, { "docid": "ba63cf0389c3fc2eaaed421e477a51a0", "score": "0.52808416", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r)\n this.reduce(r)\n}", "title": "" }, { "docid": "ba63cf0389c3fc2eaaed421e477a51a0", "score": "0.52808416", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r)\n this.reduce(r)\n}", "title": "" }, { "docid": "ba63cf0389c3fc2eaaed421e477a51a0", "score": "0.52808416", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r)\n this.reduce(r)\n}", "title": "" }, { "docid": "ba63cf0389c3fc2eaaed421e477a51a0", "score": "0.52808416", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r)\n this.reduce(r)\n}", "title": "" }, { "docid": "ba63cf0389c3fc2eaaed421e477a51a0", "score": "0.52808416", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r)\n this.reduce(r)\n}", "title": "" }, { "docid": "ba63cf0389c3fc2eaaed421e477a51a0", "score": "0.52808416", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r)\n this.reduce(r)\n}", "title": "" }, { "docid": "ba63cf0389c3fc2eaaed421e477a51a0", "score": "0.52808416", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r)\n this.reduce(r)\n}", "title": "" }, { "docid": "ba63cf0389c3fc2eaaed421e477a51a0", "score": "0.52808416", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r)\n this.reduce(r)\n}", "title": "" }, { "docid": "bdf44436463d6cf41a79a4c9e84778d2", "score": "0.52773064", "text": "numberNeighbors(color){\n\t\tvar neighbors = 0;\n\t\tfor(var i = 0; i < 32; i++){\n\t\t\tif(color == 1){\n\t\t\t\tif(this.listOfSquares[i].isOccupied() > 0){\n\t\t\t\t\tif(i % 8 < 4){\n\t\t\t\t\t\tif(i -4 > -1 && this.listOfSquares[i-4].isOccupied() > 0){\n\t\t\t\t\t\t\tneighbors += 1;\n\t\t\t\t\t\t} \n\t\t\t\t\t\tif(i % 8 != 0){\n\t\t\t\t\t\t\tif(i-5 > -1 && this.listOfSquares[i-5].isOccupied() > 0){\n\t\t\t\t\t\t\t\tneighbors += 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\telse{\n\t\t\t\t\t\tif(i-4 > -1 && this.listOfSquares[i-4].isOccupied() > 0){\n\t\t\t\t\t\t\tneighbors += 1;\n\t\t\t\t\t\t} \n\t\t\t\t\t\tif(i % 8 != 7){\n\t\t\t\t\t\t\tif(i-4 > -1 && this.listOfSquares[i-3].isOccupied() > 0){\n\t\t\t\t\t\t\t\tneighbors += 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}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(this.listOfSquares[i].isOccupied() < 0){\n\t\t\t\t\tif(i % 8 < 4){\n\t\t\t\t\t\tif(i+4 < 32 && this.listOfSquares[i+4].isOccupied() < 0){\n\t\t\t\t\t\t\tneighbors += 1;\n\t\t\t\t\t\t} \n\t\t\t\t\t\tif(i % 8 != 0){\n\t\t\t\t\t\t\tif(i+3 < 32 && this.listOfSquares[i+3].isOccupied() < 0){\n\t\t\t\t\t\t\t\tneighbors += 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\telse{\n\t\t\t\t\t\tif(i+4 < 32 && this.listOfSquares[i+4].isOccupied() < 0){\n\t\t\t\t\t\t\tneighbors += 2;\n\t\t\t\t\t\t} \n\t\t\t\t\t\tif(i % 8 != 7){\n\t\t\t\t\t\t\tif(i+5 < 32 && this.listOfSquares[i+5].isOccupied() < 0){\n\t\t\t\t\t\t\t\tneighbors += 2;\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}\n\t\t}\n\t\treturn neighbors;\n\t}", "title": "" }, { "docid": "8f2b8be8423a57221f7c04419244d7be", "score": "0.5271523", "text": "function square(x, y, sz, width, height, callback) {\n for (let i = x; i < x + sz; i++) {\n if (i < 0 || i >= width) continue\n for (let j = y; j < y + sz; j++) {\n if (j < 0 || j >= height) continue\n callback(~~i, ~~j)\n }\n }\n}", "title": "" }, { "docid": "45082cbf010c56c60803805eb7f6d439", "score": "0.5265857", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r);\n this.reduce(r);\n}", "title": "" }, { "docid": "45082cbf010c56c60803805eb7f6d439", "score": "0.5265857", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r);\n this.reduce(r);\n}", "title": "" }, { "docid": "a87065d04f6ae36e1115e2d1df654d22", "score": "0.5265686", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r);\n this.reduce(r);\n}", "title": "" }, { "docid": "e4e3e573ee7d70f6b3b22656b44ae159", "score": "0.52598876", "text": "function step() {\n\t\tdoForAll(function(i,j){\n\t\t\tvar key = [i,j];\n\t\t\tvar square = squares[key];\n\t\t\tvar neighbors = square.neighbors();\n\t\t\tsquare.reset_counts();\n\t\t\tfor(var n = 0;n < neighbors.length;n++){\n\t\t\t\tvar neighbor = squares[neighbors[n]];\n\t\t\t\tif (neighbor.color != white){\n\t\t\t\t\tsquare.counts[neighbor.color.name] ++;\n\t\t\t\t\tsquare.num_neighbors ++;\n\t\t\t\t}\n\t\t}\n\t\t});\n\n\t\tdoForAll(function(i,j){\n\t\t\tsquares[[i,j]].update()\n\t\t});\n\t\t\t\t\n\t}", "title": "" }, { "docid": "d65280189779d73b30c5790642b89fb4", "score": "0.5257687", "text": "function simplify(points, tolerance, highestQuality) {\n\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n }", "title": "" }, { "docid": "3c3cf8474df8e329d47e1afb254b30a1", "score": "0.52233833", "text": "random_board_method_2(size_x, size_y) {\r\n var loud = 0;\r\n\r\n // Twiddle me:\r\n var polarity_ratio = 1;\r\n var static_count = 10;\r\n var crawler_life = 8;\r\n var crawler_count = 3;\r\n var fix_full_empty_row = 80; // (i.e. 80%)\r\n var fix_near_full_empty_row = 40; // (i.e. 40%)\r\n\r\n // Please don't twiddle me.\r\n var new_board = [];\r\n var temp_row;\r\n var rando;\r\n var x = 0;\r\n var y = 0;\r\n var stamp_x = 0;\r\n var stamp_y = 0;\r\n\r\n var board_stamps = [\r\n [[1, 1, 1], [1, 1, 1], [1, 1, 1]],\r\n\r\n [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]],\r\n\r\n [\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [1, 1, 1, 1, 1, 1, 1]\r\n ],\r\n\r\n [[0, 0, 1, 0, 0], [0, 1, 1, 1, 0], [1, 1, 1, 1, 1], [0, 1, 1, 1, 0], [0, 0, 1, 0, 0]],\r\n\r\n [\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [1, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 1],\r\n [1, 1, 1, 1, 1, 1, 1]\r\n ],\r\n\r\n [[1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1]],\r\n\r\n [[1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1]],\r\n\r\n [[1, 1, 1, 1, 1], [0, 0, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 0, 0], [1, 1, 1, 1, 1]],\r\n\r\n [[1, 0, 1, 0, 1], [1, 0, 1, 0, 1], [1, 0, 1, 0, 1], [1, 0, 1, 0, 1], [1, 0, 1, 0, 1]],\r\n\r\n [\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [0, 0, 0, 0, 0, 0, 0],\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [0, 0, 0, 0, 0, 0, 0],\r\n [1, 1, 1, 1, 1, 1, 1],\r\n [0, 0, 0, 0, 0, 0, 0],\r\n [1, 1, 1, 1, 1, 1, 1]\r\n ],\r\n\r\n [\r\n [1, 0, 1, 0, 1, 0, 1],\r\n [1, 0, 1, 0, 1, 0, 1],\r\n [1, 0, 1, 0, 1, 0, 1],\r\n [1, 0, 1, 0, 1, 0, 1],\r\n [1, 0, 1, 0, 1, 0, 1],\r\n [1, 0, 1, 0, 1, 0, 1],\r\n [1, 0, 1, 0, 1, 0, 1]\r\n ]\r\n ];\r\n\r\n // 0: Create a blank board.\r\n for (y = 0; y < size_y; y++) {\r\n temp_row = [];\r\n for (x = 0; x < size_x; x++) {\r\n temp_row.push(0);\r\n }\r\n new_board.push(temp_row);\r\n }\r\n\r\n if (loud >= 1) {\r\n console.log(\"Our method2 blank board\");\r\n console.log(new_board);\r\n }\r\n\r\n // 1: Select a number of stamps to use. This will probably be near a common average.\r\n // We are (mostly arbitrarily) using a distribution of 3/5/13/5/3 for 3/4/5/6/7 stamps respectively.\r\n\r\n var number_of_stamps = randint(1, 29);\r\n if (number_of_stamps <= 3) {\r\n number_of_stamps = 6;\r\n } else if (number_of_stamps <= 8) {\r\n number_of_stamps = 8;\r\n } else if (number_of_stamps <= 21) {\r\n number_of_stamps = 10;\r\n } else if (number_of_stamps <= 26) {\r\n number_of_stamps = 12;\r\n } else {\r\n number_of_stamps = 14;\r\n }\r\n\r\n // First stamp is always positive, every other stamp is 50/50.\r\n var stamp_in_use = 0;\r\n var stamp_position = [0, 0];\r\n var polarity = 1;\r\n for (x = 0; x < number_of_stamps; x++) {\r\n // Pick a stamp:\r\n stamp_in_use = board_stamps[randint(0, board_stamps.length - 1)];\r\n // Position that stamp.\r\n stamp_position[0] = randint(0, size_x - stamp_in_use[0].length);\r\n stamp_position[1] = randint(0, size_y - stamp_in_use.length);\r\n if (loud >= 1) {\r\n console.log(\"Stamp position is\", stamp_position.slice(0));\r\n console.log(\"Stamp in use is\", stamp_in_use);\r\n }\r\n // Choose polarity (Mostly positive)\r\n // '0's in stamps never change the board regardless of polarity.\r\n polarity = 1;\r\n if (x != 0) {\r\n polarity = randint(0, polarity_ratio);\r\n if (polarity > 0) {\r\n polarity = 1;\r\n }\r\n }\r\n // Stamp that shit.\r\n for (stamp_y = 0; stamp_y < stamp_in_use.length; stamp_y++) {\r\n for (stamp_x = 0; stamp_x < stamp_in_use[0].length; stamp_x++) {\r\n if (stamp_in_use[stamp_y][stamp_x] == 1) {\r\n new_board[stamp_position[1] + stamp_y][stamp_position[0] + stamp_x] = polarity;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Line-ify each edge. Each edge has a 33% chance of getting edge-ified.\r\n // Each edge has a number of cells filled in by between 1/4 and 3/4 of its length.\r\n\r\n var edge_fill_start = Math.floor(size_x / 4);\r\n var edge_fill_end = Math.ceil(size_x * (3 / 4));\r\n\r\n // Top edge.\r\n if (randint(0, 2) == 0) {\r\n var edge_length = randint(edge_fill_start, edge_fill_end);\r\n var edge_offset = randint(0, size_x - edge_length);\r\n\r\n for (x = 0; x < edge_length; x++) {\r\n new_board[0][edge_offset + x] = 1;\r\n }\r\n }\r\n\r\n // Bottom edge.\r\n if (randint(0, 2) == 0) {\r\n var edge_length = randint(edge_fill_start, edge_fill_end);\r\n var edge_offset = randint(0, size_x - edge_length);\r\n\r\n for (x = 0; x < edge_length; x++) {\r\n new_board[size_y - 1][edge_offset + x] = 1;\r\n }\r\n }\r\n\r\n // Left edge.\r\n if (randint(0, 2) == 0) {\r\n var edge_length = randint(edge_fill_start, edge_fill_end);\r\n var edge_offset = randint(0, size_x - edge_length);\r\n\r\n for (x = 0; x < edge_length; x++) {\r\n new_board[x + edge_offset][0] = 1;\r\n }\r\n }\r\n\r\n // right edge.\r\n if (randint(0, 2) == 0) {\r\n var edge_length = randint(edge_fill_start, edge_fill_end);\r\n var edge_offset = randint(0, size_x - edge_length);\r\n\r\n for (x = 0; x < edge_length; x++) {\r\n new_board[x + edge_offset][size_x - 1] = 1;\r\n }\r\n }\r\n\r\n // Do some crawlers.\r\n // These start at a random position and move around the board swapping tiles.\r\n for (x = 0; x < crawler_count; x++) {\r\n var crawler_pos_x = randint(0, size_x - 1);\r\n var crawler_pos_y = randint(0, size_y - 1);\r\n this.do_a_crawler(crawler_pos_x, crawler_pos_y, crawler_life, new_board);\r\n }\r\n\r\n // Add some noise. Twiddle static_count (above).\r\n for (x = 0; x < static_count; x++) {\r\n if (new_board[randint(0, size_y - 1)][randint(0, size_x - 1)] == 1) {\r\n new_board[randint(0, size_y - 1)][randint(0, size_x - 1)] = 0;\r\n } else {\r\n new_board[randint(0, size_y - 1)][randint(0, size_x - 1)] = 1;\r\n }\r\n }\r\n\r\n // Check for empty/full lines.\r\n var row_sum = 0;\r\n // rows first.\r\n for (y = 0; y < size_y; y++) {\r\n row_sum = sum_array(new_board[y]);\r\n if (row_sum == size_x || row_sum == 0) {\r\n if (randint(1, 100) < fix_full_empty_row) {\r\n console.log(\"Doin' a crawler at row\", y);\r\n this.do_a_crawler(randint(0, size_x - 1), y, crawler_life, new_board);\r\n }\r\n } else if (row_sum == size_x - 1) {\r\n if (randint(1, 100) < fix_near_full_empty_row) {\r\n console.log(\"Doin' a crawler at not quite full row\", y);\r\n this.do_a_crawler(randint(0, size_x - 1), y, crawler_life, new_board);\r\n }\r\n }\r\n }\r\n\r\n // columns next.\r\n for (x = 0; x < size_x; x++) {\r\n row_sum = 0;\r\n for (y = 0; y < size_y; y++) {\r\n row_sum += new_board[y][x];\r\n }\r\n if (row_sum == size_y || row_sum == 0) {\r\n if (randint(1, 100) < fix_full_empty_row) {\r\n console.log(\"Doin' a crawler at column\", x);\r\n this.do_a_crawler(x, randint(0, size_y - 1), crawler_life, new_board);\r\n }\r\n } else if (row_sum == size_y - 1) {\r\n if (randint(1, 100) < fix_near_full_empty_row) {\r\n console.log(\"Doin' a crawler at not quite full column\", x);\r\n this.do_a_crawler(x, randint(0, size_y - 1), crawler_life, new_board);\r\n }\r\n }\r\n }\r\n\r\n // Report\r\n if (loud >= 1) {\r\n console.log(\"New board:\");\r\n for (x = 0; x < new_board.length; x++) {\r\n console.log(new_board[x]);\r\n }\r\n }\r\n return new_board;\r\n }", "title": "" }, { "docid": "4f370ad2377d891bb503fa180c8a1003", "score": "0.5208017", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r);this.reduce(r);\n }", "title": "" }, { "docid": "f7941efeddf1635163562d4b90f3a188", "score": "0.518939", "text": "function colorEachPixelUsingStochasticSupersampling(){\n var n = 4;\n var nSquared = Math.pow(n, 2);\n console.log(\"stochastic sampling\");\n for(var x = 0; x < canvas.width; x++){\n\t for(var y = 0; y < canvas.height; y++){\n\t var color = vec3.create();\n\n\t for(var p = 0; p < 4; p++){\n\t\t for(var q = 0; q < 4; q++){\n\t\t var random = Math.random();\n\t\t var x2 = x + (p + random)/n;\n\t\t var y2 = y + (q + random)/n;\n\t\t curRay = camera.castRay(x2, y2);\n\t\t vec3.add(color, color, getSinglePixelColor(curRay, -1));\n\t\t }\n\t }\n\t color[0] = color[0]/nSquared;\n\t color[1] = color[1]/nSquared;\n\t color[2] = color[2]/nSquared;\n\t setPixel(x, y, color);\n\t }\n }\n\n }", "title": "" }, { "docid": "f85ccfd57ccc4045316b31c6acc01053", "score": "0.5176286", "text": "function getSquareNo(x, y){\n if (x < SQUARE_SIZE && y < SQUARE_SIZE){\n return ONE;\n }\n else if(x < (SQUARE_SIZE*TWO) && x > SQUARE_SIZE && y < SQUARE_SIZE){\n return TWO;\n }\n else if(x < BOARD_SIZE && x > (SQUARE_SIZE*TWO) && y < SQUARE_SIZE){\n return THREE;\n }\n else if(x < SQUARE_SIZE && y > SQUARE_SIZE && y < (SQUARE_SIZE*TWO)){\n return FOUR;\n }\n else if(x > SQUARE_SIZE && x < (SQUARE_SIZE*TWO) && y > SQUARE_SIZE && y < (SQUARE_SIZE*TWO)){\n return FIVE;\n }\n else if(x > (SQUARE_SIZE*TWO) && x < BOARD_SIZE && y > SQUARE_SIZE && y < (SQUARE_SIZE*TWO)){\n return SIX;\n }\n else if(x > ZERO && x < SQUARE_SIZE && y > (SQUARE_SIZE*TWO) && y < BOARD_SIZE){\n return SEVEN;\n }\n else if(x > SQUARE_SIZE && x < (SQUARE_SIZE*TWO) && y > (SQUARE_SIZE*TWO) && y < BOARD_SIZE){\n return EIGHT;\n }\n else if(x > (SQUARE_SIZE*TWO) && x < BOARD_SIZE && y > (SQUARE_SIZE*TWO) && y < BOARD_SIZE){\n return NINE;\n }\n else{\n return -1;\n }\n}", "title": "" }, { "docid": "edab207c607288b7fb42ff04128127c9", "score": "0.51687896", "text": "function barrettSqrTo(x, r) {\n x.squareTo(r);this.reduce(r);\n }", "title": "" }, { "docid": "0966baa1eb5118fe7290235b45001b42", "score": "0.5156352", "text": "step() {\n const otherBufferIndex = 1 - this.currentBufferIndex;\n const currentBuffer = this.cells[this.currentBufferIndex];\n const otherBuffer = this.cells[otherBufferIndex];\n console.log('currentBuffer is', currentBuffer);\n // implement rules\n const rowsToBeChecked = [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]];\n for (let row = 0; row < this.height; row++) {\n for (let col = 0; col < this.width; col++) {\n let neighbors = {\n red: 0,\n green: 0,\n blue: 0\n };\n // let alive = 0;\n for (let i = 0; i < rowsToBeChecked.length; i++) {\n const offset = rowsToBeChecked[i];\n const offsetRow = row + offset[0];\n const offsetCol = col + offset[1];\n if (offsetRow < 0 || offsetCol < 0 || offsetRow >= this.height || offsetCol >= this.width) continue;\n switch (currentBuffer[offsetRow][offsetCol]){\n case 0: \n break;\n case 1: \n neighbors.red++;\n break;\n case 2: \n neighbors.green++;\n break;\n case 3:\n neighbors.blue++;\n break;\n default:\n console.log(\"error, invalid number\");\n break;\n }\n }\n const totalNeighbors = Object.values(neighbors).reduce((t, n) => t + n);\n\n let dominantColor = currentBuffer[row][col];\n if(neighbors.red > neighbors.blue && neighbors.red > neighbors.green){\n dominantColor = 1;\n }\n if(neighbors.green > neighbors.red && neighbors.green > neighbors.blue){\n dominantColor = 2;\n }\n if(neighbors.blue > neighbors.red && neighbors.blue > neighbors.green){\n dominantColor = 3;\n }\n \n // If living\n if (currentBuffer[row][col]){\n // do alive rules\n if(totalNeighbors < 2 || totalNeighbors > 3){\n otherBuffer[row][col] = 0;\n } else {\n otherBuffer[row][col] = dominantColor;\n }\n } else {\n // do dead rules\n if(totalNeighbors === 3){\n otherBuffer[row][col] = dominantColor;\n } else {\n otherBuffer[row][col] = currentBuffer[row][col];\n }\n }\n }\n }\n this.currentBufferIndex = otherBufferIndex;\n }", "title": "" }, { "docid": "c57201a409745a5db809ee608cb28d14", "score": "0.5155921", "text": "nearest(grid)\n {\n // code here\n if (grid.length < 1) return grid\n const result = [...Array(grid.length)].map(e => Array(grid[0].length).fill(0))\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid[i].length; j++) {\n if (grid[i][j] === 0) {\n result[i][j] = this.bfs(grid, i, j)\n }\n }\n }\n return result\n\t}", "title": "" }, { "docid": "a3029395fb6e6c226974c267aab6a892", "score": "0.515221", "text": "defaultGradiant(min, max){\n let d = max - min;\n\n if(min > 255)\n throw 'did you forget to scale ? Min should be under 255';\n\n //everything undex min is white\n let i = 0;\n for(; i < min; i++)\n this.appendPalette(255, 255, 255);\n\n const pts =[\n {val: 0, r: 255, g: 255, b: 255},\n {val: 0.13, r: 72, g: 142, b: 202},\n {val: 0.23, r: 72, g: 187, b: 70},\n {val: 0.345, r: 250, g: 232, b: 92},\n {val: 0.537, r: 240, g: 120, b: 41},\n {val: 0.69, r: 210, g: 31, b: 40},\n {val: 1.0, r: 165, g: 47, b: 90},\n ];\n\n let index = 0;\n for(; i <= max && i < 256; i++){\n let a = (i - min) / (d);//prop dans le degrade\n\n while(pts[index + 1].val < a)\n index ++;\n\n //interpolate bw pts[index] et pts[index+1]. mix = 0 : full pts[index]\n let mix = (a - pts[index].val) / (pts[index + 1].val - pts[index].val);\n\n\n\n this.appendPalette(\n pts[index+1].r *mix + pts[index].r *(1-mix),\n pts[index+1].g *mix + pts[index].g *(1-mix),\n pts[index+1].b *mix + pts[index].b *(1-mix),\n );\n\n }\n\n\n }", "title": "" }, { "docid": "3adc194cc42f3ce43283f455707e3fea", "score": "0.5141318", "text": "do_square(pt, step_size, rand) {\r\n // first find all the nodes step size away horizontally and vertically\r\n if (!this.in_bounds(pt)) return;\r\n var total = 0;\r\n var count = 0;\r\n var ret_pt = [];\r\n var check_pt = [pt[0] + step_size, pt[1]];\r\n if (this.in_bounds(check_pt)) {\r\n this.getVertex(ret_pt, check_pt[1], check_pt[0]);\r\n total += ret_pt[2]; // add the z value to the total\r\n count += 1;\r\n }\r\n check_pt = [pt[0] - step_size, pt[1]];\r\n if (this.in_bounds(check_pt)) {\r\n this.getVertex(ret_pt, check_pt[1], check_pt[0]);\r\n total += ret_pt[2];\r\n count += 1;\r\n }\r\n check_pt = [pt[0], pt[1] + step_size];\r\n if (this.in_bounds(check_pt)) {\r\n this.getVertex(ret_pt, check_pt[1], check_pt[0]);\r\n total += ret_pt[2];\r\n count += 1;\r\n }\r\n check_pt = [pt[0], pt[1] - step_size];\r\n if (this.in_bounds(check_pt)) {\r\n this.getVertex(ret_pt, check_pt[1], check_pt[0]);\r\n total += ret_pt[2];\r\n count += 1;\r\n }\r\n\r\n if (count != 0) {\r\n var new_pt_val = [];\r\n this.getVertex(new_pt_val, pt[1], pt[0]);\r\n var new_height = (total / count) + rand;\r\n this.setVertex([new_pt_val[0], new_pt_val[1], new_height], pt[1], pt[0]);\r\n }\r\n\r\n }", "title": "" }, { "docid": "079ee9ccf9f7c1f5303c79dd07d1f25c", "score": "0.51381505", "text": "function findNearestInScale(semitone) {\n //find basic semitone from 0 to 11\n let baseSemitone = (semitone % 12);\n //get rid of the negative notes issue\n if (baseSemitone < 0) baseSemitone += 12;\n\n //does the semitone exist in the scale ?\n if (config.scale[baseSemitone]) return semitone;\n else {\n let found = false;\n let i = 0;\n let distance = 0;\n let toLeft = true;\n\n //SEARCH: find the nearest semitone in [A,G#] range WITHOUT quitting the range.\n //look to left, if not ok look to right, if not ok increment distance and repeat\n while (!found && distance < 12) { //max reachable distance from an index is 11 (when at start/end)\n let offset;\n \n toLeft = (i%2 == 0);\n if (toLeft) {\n //look to left\n distance++;\n offset = -distance;\n \n } else {\n //look to right\n offset = distance;\n }\n\n //does the new semitone exist in the scale ?\n let newSemitone = baseSemitone + offset;\n if (newSemitone >= 0 && newSemitone <= 11 && config.scale[newSemitone]) {\n found = true;\n }\n\n i++;\n }\n //convert back to the full range\n let nearestSemitone = (toLeft)? (semitone - distance) : (semitone + distance);\n return (found)? nearestSemitone : semitone;\n }\n}", "title": "" } ]
593a9f811c78d9daa7184ad41b5dfb18
Draw column heading bar for sort list table
[ { "docid": "ae7dd9814041bd3ff63474c998fc97e7", "score": "0.6448584", "text": "function SortHdr (tab, j) {\r\n var tr = AddRow (tab, j, listhdr, '', true, 1, C_BG);\r\n for (var i = j = 0; i < S_MAX; ++i) {\t// Color column headings\r\n\tif (viscol[i]) {\r\n\t SetBg (GetCells (tr)[j++], i === defsort ?\r\n\t (sortdir < 0 ? C_COL_BACK : C_COL_SORT) : C_COL_NORMAL);\r\n\t}\r\n }\r\n}", "title": "" } ]
[ { "docid": "1a5a705aec92c33950fc7f5f161a51b2", "score": "0.6757422", "text": "function StyleSortColumns() {\n jQuery('.sortColHdr').css('text-decoration', 'underline');\n}", "title": "" }, { "docid": "cecbdd42d8c1399a0111c188bce0ba6f", "score": "0.6660977", "text": "function FP_RLIST_PRIVATE_CreateColumnHeadings ( thisObject, argobjOuterMostContainer )\n//#else\n//# function FP_RLIST_PRIVATE_CreateColumnHeadings ( thisObject:FP_RLIST_Object, argobjOuterMostContainer )\n//#endif \n{\n var thisDocument = thisObject.objDocument;\n var intColumnCount = thisObject.intColumnCount;\n var objAppendedColHdg = null;\n var objAppendedSeparator = null;\n var objColHdg = null;\n var intColumn = 0; \n \n /* Create an array of Column Header DIV objects to access the column clicked using the uSortColumn number */\n thisObject.arrayColumnHeaders = new Array();\n\n /* Create and append the first column and column sep */\n\n objColHdg = FP_RLIST_PRIVATE_SetDhtmlPtys(thisObject, 1, 1);\n \n\tobjColHdg.style.borderLeft = \"1px solid Highlight\";\n\n objAppendedColHdg = argobjOuterMostContainer.appendChild(objColHdg);\n \n /* Add the column header DIV to the array */\n thisObject.arrayColumnHeaders[thisObject.arrayColumnHeaders.length] = objAppendedColHdg;\n\n if ( thisObject.flagItemSmallImage ) objAppendedColHdg.style.width = FP_RLIST_PRIVATE_AdjustConvertWidth(objAppendedColHdg.style.width, 16);\n\n for (intColumn = 2; intColumn <= intColumnCount; intColumn++ )\n {\n objAppendedSeparator = argobjOuterMostContainer.appendChild(FP_RLIST_PRIVATE_CreateColHdgSeparator(thisDocument, thisObject.strColumnHeaderHeight, \"FP_RLIST_ColDivider\")); \n objColHdg = FP_RLIST_PRIVATE_SetDhtmlPtys(thisObject, intColumn, intColumnCount);\n objAppendedColHdg = argobjOuterMostContainer.appendChild(objColHdg);\n thisObject.arrayColumnHeaders[thisObject.arrayColumnHeaders.length] = objAppendedColHdg;\n }\n \n\tobjAppendedColHdg.style.borderRight = \"1px solid Highlight\";\n\n}", "title": "" }, { "docid": "64d4a8c3167dd9f4e7dd4c055c933e26", "score": "0.6590696", "text": "_createHeaders() {\n try {\n if (this._columns && Array.isArray(this._columns) && this._tableNode) {\n let tableHeader = this._createTHead();\n let row = tableHeader.insertRow(0);\n\n this._columns.forEach(function (column, index) {\n if (column && column.hasOwnProperty(\"displayName\")) {\n let cell = row.insertCell(index);\n cell.innerHTML = \"<b>\" + column.displayName + \"</b>\";\n }\n });\n }\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "bf05f6220bbbbecc666e0a1b6851e8cc", "score": "0.6548912", "text": "function createColumnHeader() {\n // build column header with links to re-sort\n var tr = document.createElement('tr');\n var sCol, th;\n\n th = document.createElement('th');\n th.innerHTML = \"<button id='sortAge' class='btn'>Age</button>\";\n th.addEventListener('click', function(e) { doSort(AdminCommentObject.SortAge, e.ctrlKey); return false; }, false);\n tr.appendChild(th);\n\n th = document.createElement('th');\n th.innerHTML = \"<button id='sortEntryId' class='btn'>Entry</button>&nbsp;<input class='btn' type='checkbox' id='groupEntries' name='groupEntries'>\";\n // the EntryID label\n th.firstChild.addEventListener('click', function(e) { doSort(AdminCommentObject.SortEntryId, e.ctrlKey); return false; }, false);\n // the EntryID checkbox\n var cbEntryId = th.lastChild;\n cbEntryId.checked = AdminCommentObject.groupEntries;\n cbEntryId.addEventListener('click', function(e) { doSort(-1, e.ctrlKey); return false; }, false);\n tr.appendChild(th);\n\n th = document.createElement('th');\n th.innerHTML += \"<button id='sortAlias' class='btn'>Alias</button>\";\n th.addEventListener('click', function(e) { doSort(AdminCommentObject.SortAlias, e.ctrlKey); return false; }, false);\n tr.appendChild(th);\n\n th = document.createElement('th');\n th.innerHTML += \"<button id='sortUserId' class='btn'>UserID</button>\";\n th.addEventListener('click', function(e) { doSort(AdminCommentObject.SortUserId, e.ctrlKey); return false; }, false);\n tr.appendChild(th);\n\n th = document.createElement('th');\n th.innerHTML += \"<button id='sortSnippet' class='btn'>Preview</button>\";\n th.addEventListener('click', function(e) { doSort(AdminCommentObject.SortSnippet, e.ctrlKey); return false; }, false);\n tr.appendChild(th);\n\n return tr;\n}", "title": "" }, { "docid": "460417c16f27703b4b26a4c0a2b3f89c", "score": "0.6522166", "text": "function applyHeaderStyling (headers) {\r\n var title = headers.select(\"svg\").select(\"title\");\r\n if (title.empty()) {\r\n title = headers.select(\"svg\").append(\"title\");\r\n }\r\n title.text(function(d) { return \"Sort table by \"+columnSettings[d.key].columnName; });\r\n\r\n headers\r\n .filter (function(d) { return cellStyles[d.key]; })\r\n .each (function(d) {\r\n d3.select(this).classed (cellStyles[d.key], true);\r\n })\r\n ;\r\n headers\r\n .filter (function(d) { return cellHeaderOnlyStyles[d.key]; })\r\n .each (function(d) {\r\n d3.select(this).classed (cellHeaderOnlyStyles[d.key], true);\r\n })\r\n ;\r\n headers\r\n .filter (function(d) { return cellWidths[d.key]; })\r\n .each (function(d) {\r\n d3.select(this).style(\"width\", cellWidths[d.key]);\r\n })\r\n ;\r\n }", "title": "" }, { "docid": "7e99e946a18b39c22cb14dc1efc12a4c", "score": "0.64805", "text": "function appendth(tr, headItem) {\n\t\tvar th = document.createElement('th');\n\t\tvar div1 = document.createElement('div');\n\t\tdiv1.style.position = 'relative';\n\t\tvar span = document.createElement('span');\n\t\tspan.innerText = headItem.title;\n\t\tdiv1.appendChild(span);\n\t\tth.appendChild(div1);\n\n\t\tif (headItem.enable) {\n\t\t\taddSortUI(headItem, div1);\n\n\t\t\tvar div2 = document.createElement('div');\n\t\t\taddFilterUI(headItem, div2);\n\t\t\tth.appendChild(div2);\n\t\t}\n\n\t\ttr.appendChild(th);\n\t}", "title": "" }, { "docid": "44420fd05d988ef7db9f40a0bd01f0f3", "score": "0.6479627", "text": "function createColumnHeader(num, pianoRollObject){\n var newHeader = document.createElement('div');\n newHeader.id = \"col_\" + (num-1);\n newHeader.style.margin = \"0 auto\";\n newHeader.style.display = 'inline-block';\n newHeader.style.textAlign = \"center\";\n newHeader.style.width = '40px';\n newHeader.style.height = '12px';\n newHeader.style.fontSize = '10px';\n newHeader.setAttribute(\"data-num-notes\", 0); // keep track of whether this column has notes or not\n \n var subdiv = (num % pianoRollObject.subdivision) === 0 ? pianoRollObject.subdivision : (num % pianoRollObject.subdivision);\n \n if(num > 0){\n newHeader.className = \"thinBorder\"; \n if(subdiv === 1){\n // mark the measure number (first column of measure)\n var measureNumber = document.createElement(\"h2\");\n measureNumber.innerHTML = (Math.floor(num / pianoRollObject.subdivision)+1);\n measureNumber.style.margin = '0 0 0 0';\n measureNumber.style.color = pianoRollObject.measureNumberColor;\n newHeader.appendChild(measureNumber);\n newHeader.className = \"\"\n }else{\n if(pianoRollObject.subdivision === subdiv){\n newHeader.className = \"thickBorder\";\n }\n newHeader.textContent = subdiv; \n }\n }\n \n // attach highlightHeader function to allow user to specify playing to start at this column \n newHeader.addEventListener(\"click\", function(){highlightHeader(this.id, pianoRollObject)});\n \n return newHeader;\n}", "title": "" }, { "docid": "8e56090d4518beb38b00f42cdd44bccb", "score": "0.6392354", "text": "function writeHead(row,arr){var ii=arr.length;while(ii--){tab.setText (row,ii,arr[ii] ) // Write header row\r\n .setStyleAttribute(row,ii,\"backgroundColor\",\"red\" )\r\n .setStyleAttribute(row,ii,\"color\" ,\"white\" )\r\n .setStyleAttribute(row,ii,\"fontWeight\" ,\"bold\" );}}", "title": "" }, { "docid": "8e56090d4518beb38b00f42cdd44bccb", "score": "0.6392354", "text": "function writeHead(row,arr){var ii=arr.length;while(ii--){tab.setText (row,ii,arr[ii] ) // Write header row\r\n .setStyleAttribute(row,ii,\"backgroundColor\",\"red\" )\r\n .setStyleAttribute(row,ii,\"color\" ,\"white\" )\r\n .setStyleAttribute(row,ii,\"fontWeight\" ,\"bold\" );}}", "title": "" }, { "docid": "8e2b1227fb6ae9b986c7a52716b9dffb", "score": "0.63389367", "text": "function load_table_headers(tblhd) {\r\n for (var i =0; i < COL_NAMES.length; ++i) {\r\n // Append a node _after_ the one we're updating ...\r\n tblhd.appendChild(tblhd.cells[0].cloneNode(true));\r\n var c = tblhd.cells[i]\r\n c.className = \"column-header\";\r\n c.align = \"center\";\r\n c.innerHTML = COL_NAMES[i];\r\n }\r\n // Give that extra node something to do\r\n c = tblhd.cells[i]\r\n c.className = \"column-spacing\";\r\n c.innerHTML = '&nbsp;';\r\n}", "title": "" }, { "docid": "2fb00fde3a4bd3c56b4ffa4bf663145d", "score": "0.6337436", "text": "function adjustColumnHeader(sortEntryFirst) {\n var sList = AdminCommentObject.sortCols.join(\" \");\n var sCol, sArrow, colHead;\n sCol = AdminCommentObject.SortAge;\n sArrow = (sList.indexOf(sCol) > -1)? (sortDirs[sCol]? upArr : dnArr) : \"\";\n colHead = document.getElementById('sortAge');\n colHead.innerHTML = \"Age \" + sArrow;\n\n sCol = AdminCommentObject.SortEntryId;\n sArrow = (sList.indexOf(sCol) > -1)? (sortDirs[sCol]? upArr : dnArr) : \"\";\n colHead = document.getElementById('sortEntryId');\n colHead.innerHTML = \"Entry \" + sArrow;\n\n sCol = AdminCommentObject.SortAlias;\n sArrow = (sList.indexOf(sCol) > -1)? (sortDirs[sCol]? upArr : dnArr) : \"\";\n colHead = document.getElementById('sortAlias');\n colHead.innerHTML = \"Alias \" + sArrow;\n\n sCol = AdminCommentObject.SortUserId;\n sArrow = (sList.indexOf(sCol) > -1)? (sortDirs[sCol]? upArr : dnArr) : \"\";\n colHead = document.getElementById('sortUserId');\n colHead.innerHTML = \"UserID \" + sArrow;\n\n sCol = AdminCommentObject.SortSnippet;\n sArrow = (sList.indexOf(sCol) > -1)? (sortDirs[sCol]? upArr : dnArr) : \"\";\n colHead = document.getElementById('sortSnippet');\n colHead.innerHTML = \"Preview \" + sArrow;\n}", "title": "" }, { "docid": "09dece679366e374ff703b5536f9d9e7", "score": "0.6301929", "text": "function renderHeaders(arg_rowData){\n // Init 3 levels of strings with appropriate border\n let top_string = boxChars.boldCorner_topLeft;\n let bottom_string = boxChars.boldVert_boldRight;\n let middle_string = boxChars.boldVert;\n \n // Get the fields returned by the database\n fields = Object.keys(arg_rowData[0]);\n\n // Render the box for each column header\n for(let i = 0; i < fields.length; i++){\n \n // Add the width of the columns\n let t_width = arg_rowData.reduce( (arg_total, arg_value) => {\n if(arg_value[fields[i]] == null){\n return arg_total;\n }\n else{\n return arg_total >= arg_value[fields[i]].toString().length ? arg_total : arg_value[fields[i]].toString().length;\n }\n }, fields[i].length);\n columnWidths.push(t_width);\n\n // Place enough -- characters to fit the largest entry in the column\n let t_length = fields[i].length;\n top_string += boxChars.boldFlat.repeat(2 + t_width);\n bottom_string += boxChars.boldFlat.repeat(2 + t_width);\n \n // Generator header\n let t_middle = [\" \".repeat(Math.floor((t_width - t_length) / 2)), renderHeaderText(fields[i]).tableHeaders, \" \".repeat(Math.ceil((t_width - t_length) / 2))].join(\" \");\n middle_string += t_middle;\n \n // Append connecting character\n if(i === fields.length - 1){\n top_string += boxChars.boldCorner_topRight;\n bottom_string += boxChars.boldVert_boldLeft;\n middle_string += boxChars.boldVert;\n }\n else{\n top_string += boxChars.boldFlat_thinVertDown;\n bottom_string += boxChars.boldFlat_thinVert;\n //middle_string += boxChars.thinVert;\n middle_string += \"\\u2502\";\n } \n }\n\n // Combine the 3 layers\n return_string = [top_string, middle_string, bottom_string].join(\"\\n\");\n return return_string;\n}", "title": "" }, { "docid": "eb42a1bd3b97eee4d02119ad5031caf1", "score": "0.6278592", "text": "updateHeader() {\n\n const { sorting } = this.state;\n const tHeadRow = this.rootElement.querySelector('table thead tr');\n\n // iterate over each column\n this.columns.forEach((item, i) => {\n\n // check if current column can be sorted\n if (item.sortable || item.sortable === undefined) {\n\n tHeadRow.children[i].className = classnames('sortable', {\n sorted: item.key === sorting.key\n });\n\n // set the icon class depending on how the column will be sorted\n tHeadRow.children[i].querySelector('.icon').className = classnames('icon', {\n 'icon-sort': item.key !== sorting.key,\n 'icon-sort-asc': item.key === sorting.key && sorting.order === 'asc',\n 'icon-sort-desc': item.key === sorting.key && sorting.order === 'desc'\n });\n\n }\n\n });\n\n }", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.6272526", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "abf0abf8982b4d98bbad492bd628fc36", "score": "0.62669516", "text": "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 7;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "title": "" }, { "docid": "abf0abf8982b4d98bbad492bd628fc36", "score": "0.62669516", "text": "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 7;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "title": "" }, { "docid": "abf0abf8982b4d98bbad492bd628fc36", "score": "0.62669516", "text": "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 7;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.62478596", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.62459993", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "b4db6dd4197597d03bc4870c8fa1bd1a", "score": "0.6241089", "text": "function paintHeader(){\n\t\tthis.header.innerHTML=this.monthsTitles[this.options.lan][this.currentDate.getMonth()]+\" \"+this.currentDate.getFullYear();\n\t}", "title": "" }, { "docid": "ed80359ae60bf7ce1c385715e545c477", "score": "0.6222718", "text": "function defaultHeaderRenderer(_ref) {\n var dataKey = (_ref.columnData, _ref.dataKey), label = (_ref.disableSort, _ref.label), sortBy = _ref.sortBy, sortDirection = _ref.sortDirection, showSortIndicator = sortBy === dataKey, children = [ _react2[\"default\"].createElement(\"span\", {\n className: \"ReactVirtualized__Table__headerTruncatedText\",\n key: \"label\",\n title: label\n }, label) ];\n return showSortIndicator && children.push(_react2[\"default\"].createElement(_SortIndicator2[\"default\"], {\n key: \"SortIndicator\",\n sortDirection: sortDirection\n })), children;\n }", "title": "" }, { "docid": "7fa4e3d60efdccad6518ac4cef8c63ac", "score": "0.61588156", "text": "function mktTblHeader(){\n var header = marketTable.createTHead();\n th = header.insertRow(0);\n id_th = th.insertCell(0);\n id_th.innerHTML = 'ID';\n name_th = th.insertCell(1);\n name_th.innerHTML = 'Name';\n dist_th = th.insertCell(2);\n dist_th.innerHTML = 'Dist. in Miles';\n find_h = th.insertCell(3);\n find_h.innerHTML = 'Get Directions';\n marketTable.appendChild(th);\n}", "title": "" }, { "docid": "2d727e6ac429cff66c1056b48390d7d3", "score": "0.6150729", "text": "function setChartHeaders() {\n\tvar first_point = plot[0].pointOffset({\n\t\tx : 0,\n\t\ty : 0\n\t});\n\tvar second_point = plot[0].pointOffset({\n\t\tx : 1,\n\t\ty : 0\n\t});\n\tvar header_td_width = second_point.left - first_point.left;\n\t\n\t$('.header_chart table tr td:first-child').css(\"width\",\n\t\t\t(first_point.left + 30) + 'px');\n\t$('.header_chart table tr td:not(:first-child)').css(\"width\",\n\t\t\t(header_td_width - 1) + 'px');\n}", "title": "" }, { "docid": "f78cae6291cc776081b2ce57a6f65da7", "score": "0.6138652", "text": "function headClicked() {\n var reverse;\n if (this.classList.contains('asc')) {\n this.classList.add('desc');\n this.classList.remove('asc');\n reverse = 'desc';\n }\n else if (this.classList.contains('desc')) {\n this.classList.add('asc');\n this.classList.remove('desc');\n reverse = 'asc';\n }\n // Sort new column\n else {\n reverse = 'asc';\n deleteArrows();\n this.classList.add('asc');\n }\n sortedColumn = this.cellIndex;\n sortTable(sortedColumn, reverse);\n }", "title": "" }, { "docid": "423bde722834f0800ba108c35aad6812", "score": "0.6121575", "text": "function defaultHeaderRenderer(_ref) {\n\t var columnData = _ref.columnData;\n\t var dataKey = _ref.dataKey;\n\t var disableSort = _ref.disableSort;\n\t var label = _ref.label;\n\t var sortBy = _ref.sortBy;\n\t var sortDirection = _ref.sortDirection;\n\n\t var showSortIndicator = sortBy === dataKey;\n\t var children = [_react2.default.createElement(\n\t 'span',\n\t {\n\t className: 'FlexTable__headerTruncatedText',\n\t key: 'label',\n\t title: label\n\t },\n\t label\n\t )];\n\n\t if (showSortIndicator) {\n\t children.push(_react2.default.createElement(_SortIndicator2.default, {\n\t key: 'SortIndicator',\n\t sortDirection: sortDirection\n\t }));\n\t }\n\n\t return children;\n\t}", "title": "" }, { "docid": "423bde722834f0800ba108c35aad6812", "score": "0.6121575", "text": "function defaultHeaderRenderer(_ref) {\n\t var columnData = _ref.columnData;\n\t var dataKey = _ref.dataKey;\n\t var disableSort = _ref.disableSort;\n\t var label = _ref.label;\n\t var sortBy = _ref.sortBy;\n\t var sortDirection = _ref.sortDirection;\n\n\t var showSortIndicator = sortBy === dataKey;\n\t var children = [_react2.default.createElement(\n\t 'span',\n\t {\n\t className: 'FlexTable__headerTruncatedText',\n\t key: 'label',\n\t title: label\n\t },\n\t label\n\t )];\n\n\t if (showSortIndicator) {\n\t children.push(_react2.default.createElement(_SortIndicator2.default, {\n\t key: 'SortIndicator',\n\t sortDirection: sortDirection\n\t }));\n\t }\n\n\t return children;\n\t}", "title": "" }, { "docid": "fd1d1b8ceaae43cf08190e836f13e81f", "score": "0.6105566", "text": "render_list_view_table_header(){\n return(\n <table className=\"table list-table list-table-groupby\">\n <thead>\n <tr>\n <th style={{'width':'10%'}}>&nbsp;</th>\n {\n this.state.list_view_table_header.map((team, i) => {\n return (<th key={'_th_'+i} style={{'width':'10%'}}>{team}</th>)\n })\n }\n <th>Action</th>\n </tr>\n </thead>\n { this.render_by_view_by_sales_person() }\n { this.render_total_list_revenue() }\n\n </table>\n );\n }", "title": "" }, { "docid": "1c00c4e28bafeb146d5d770887a45e99", "score": "0.6103125", "text": "function createTablesHeader() {\n var items = [];\n\n var columns = ['Table&nbsp;Name&nbsp;', 'State&nbsp;', '#&nbsp;Tablets&nbsp;',\n '#&nbsp;Offline<br>Tablets&nbsp;', 'Entries&nbsp;',\n 'Entries<br>In&nbsp;Memory&nbsp;', 'Ingest&nbsp;',\n 'Entries<br>Read&nbsp;', 'Entries<br>Returned&nbsp;',\n 'Hold&nbsp;Time&nbsp;', 'Running<br>Scans&nbsp;',\n 'Minor<br>Compactions&nbsp;', 'Major<br>Compactions&nbsp;'];\n\n var titles = ['', '', descriptions['# Tablets'],\n descriptions['# Offline Tablets'], descriptions['Entries'],\n descriptions['Entries in Memory'], descriptions['Ingest'],\n descriptions['Entries Read'], descriptions['Entries Returned'],\n descriptions['Hold Time'], descriptions['Running Scans'],\n descriptions['Minor Compactions'], descriptions['Major Compactions']];\n\n for (i = 0; i < columns.length; i++) {\n var first = i == 0 ? true : false;\n items.push(createHeaderCell(first, 'sortTable(' + i + ')',\n titles[i], columns[i]));\n }\n\n $('<tr/>', {\n html: items.join('')\n }).appendTo('#tableList');\n}", "title": "" }, { "docid": "d408145f5e1dc0c8b0a3c9d74144f639", "score": "0.60977536", "text": "renderHeaders() {\n this.element.querySelector('thead tr').innerHTML = '';\n\n if (this.options.activeTableButtons == true) {\n this.headers.push('Options')\n }\n\n this.headers.forEach(header => {\n this.element.querySelector('thead tr').innerHTML +=\n `<th style=\"background-color: ${this.options.tableHeaderBackground}\n !important; color: ${this.options.tableHeaderTextColor}\n !important\">${header}</th>`\n })\n }", "title": "" }, { "docid": "dfc99770a142bdf7940bb45ae67b5000", "score": "0.60866034", "text": "function updateSortDisplay(id) {\r\n let headers = document.querySelectorAll('metaTableHeader');\r\n //remove all borders\r\n headers.forEach(element =>{\r\n if(headers.classList.contains('sortBorderBottom')){\r\n headers.classList.remove('sortBorderBottom');\r\n }\r\n if(headers.classList.contains('sortBorderTop')){\r\n headers.classList.remove('sortBorderTop');\r\n }\r\n });\r\n //add specific border\r\n let header = document.getElementsByClassName('metaTableHeader')[id];\r\n (direction[id] === 'ASC' ? header.classList.add('sortBorderTop') : header.classList.add('sortBorderBottom'));\r\n}", "title": "" }, { "docid": "a13b093d943f8ba090dff4fdf3519226", "score": "0.60775256", "text": "function addAllColumnHeaders(myList, selector) {\n // $(selector).append($('<caption>'+\"Events\"+'</caption>'));\n var columnSet = [];\n var headerTr$ = $('<tr/>');\n var ifEmpty = [\"Type\", \"Title\", \"Distance\", \"Time\", \"Owner\"];\n if (myList.length == 0) {\n for (var i = 0; i < ifEmpty.length; i++) {\n if (ifEmpty[i] !== \"Distance\"){\n columnSet.push(ifEmpty[i]);\n headerTr$.append($('<th/>').html(ifEmpty[i]));\n }\n else if (ifEmpty[i] == \"Distance\"){\n headerTr$.append($('<th>' + '<button onclick=\"displayarrange()\" class=\"mybutton\" ><span>Distance</span></button>' + '</th>' ));\n }\n }\n }\n\n for (var i = 0; i < myList.length; i++) {\n var rowHash = myList[i];\n for (var key in rowHash) {\n if ($.inArray(key, columnSet) == -1 && key !== \"Event Id\" && key !== \"Distance\"){\n columnSet.push(key);\n headerTr$.append($('<th/>').html(key));\n }\n else if ($.inArray(key, columnSet) == -1 && key == \"Distance\"){\n columnSet.push(key);\n headerTr$.append($('<th>' + '<button onclick=\"displayarrange()\" class=\"mybutton\" ><span>Distance</span></button>' + '</th>' ));\n }\n }\n }\n $(selector).append(headerTr$);\n\n return columnSet;\n}", "title": "" }, { "docid": "d3d91542797907443eeb8f3f6ae8ab98", "score": "0.6067374", "text": "function buildGridHeader(columnHeaderRowId, pianoRollObject){\n var columnHeaderRow = document.getElementById(columnHeaderRowId);\n\n // this will provide the headers for each column in the grid (i.e. number for each beat/subbeat) \n for(var i = 0; i < pianoRollObject.numberOfMeasures * pianoRollObject.subdivision + 1; i++){\n var columnHeader = createColumnHeader(i, pianoRollObject);\n\n // the very first column header is special :)\n if(i === 0){\n columnHeader.style.width = '50px';\n columnHeader.style.border = '1px solid #000'\n }\n \n columnHeaderRow.append(columnHeader);\n }\n}", "title": "" }, { "docid": "11da159217027578343f2a1bf63d1ff0", "score": "0.6054345", "text": "createTHs(items) {\n let cols = [];\n for (var i = 0; i < items.length; i++) {\n cols.push(\n <th key={i} className=\"text-center \">\n {items[i]}\n </th>\n );\n }\n return cols;\n }", "title": "" }, { "docid": "34762170b7ba3f08358a517ef0a9f6cd", "score": "0.60404384", "text": "createHeaders() {\n const arr = [];\n let orderEl;\n for (let i = 0; i < this.headers.length; i++) {\n if (this.headers[i].order === '1') {\n orderEl = <span>▲</span>;\n } else if (this.headers[i].order === '-1') {\n orderEl = <span>▼</span>\n } else {\n orderEl = <span></span>\n }\n arr.push(\n <th style={this.headers[i].style} onClick={() => { this.onHeaderClick(this.headers[i], this.makePostsRequest) }} key={i} scope=\"col\">\n {this.headers[i].name}\n {orderEl}\n </th>);\n }\n return arr;\n }", "title": "" }, { "docid": "3db4f34cea73383edd0fbd5d97a531a0", "score": "0.60165185", "text": "function setSortHeaderStyle($col, ascending) {\n $headers.children().removeClass(\"slick-header-column-sorted\");\n $headers.find(\".slick-sort-indicator\").removeClass(\"slick-sort-indicator-asc slick-sort-indicator-desc\");\n if ($col) {\n $col.addClass(\"slick-header-column-sorted\");\n $col.find(\".slick-sort-indicator\").addClass(ascending ? \"slick-sort-indicator-asc\" : \"slick-sort-indicator-desc\");\n }\n }", "title": "" }, { "docid": "c9619dca1e72ba4b80b31d70adf1c5a8", "score": "0.6014329", "text": "EnhancedTableHead() {\n return (\n <TableHead>\n <TableRow>\n {this.state.headCells.map(headCell => \n <TableCell\n key={headCell.id}\n align={headCell.numeric ? 'right' : 'left'}\n padding={headCell.disablePadding ? 'none' : 'default'}\n sortDirection={false}\n >\n <TableSortLabel\n active={this.state.sortBy === headCell.id}\n direction={this.state.sortDirection}\n onClick={() => this.sortBy(headCell.id)}\n >\n <b>{headCell.label}</b>\n\n </TableSortLabel>\n </TableCell>)}\n </TableRow>\n </TableHead>\n )\n }", "title": "" }, { "docid": "3dc32f6d6ebdd5cf98d5a3e4105ac573", "score": "0.6014128", "text": "function renderStoreTableHeader(){\n\t//Get parent element\n\tvar storeTable = getStoreTable();\n\tvar headerRow = document.createElement('tr');\n\t\n\tvar blankCell = document.createElement('td');\n\theaderRow.appendChild(blankCell);\n\t\n\tfor(var i=0; i<HOURS_OF_OPERATION.length; i++){\n\t\tvar hourCell = document.createElement('td');\n\t\thourCell.textContent = HOURS_OF_OPERATION[i];\n\t\theaderRow.appendChild(hourCell);\n\t}\n\tstoreTable.appendChild(headerRow);\n}", "title": "" }, { "docid": "5025b3a5d747593e3959fda18eca9ffe", "score": "0.60080445", "text": "function tableHeader(content, idTable = \"uploadStatusTable\") {\n // NOTE: Use first, before any other addRow call\n let table = document.getElementById(idTable);\n let r = document.createElement(\"div\");\n r.style.display = \"table-row\";\n content.map(c => {\n let h = document.createElement(\"div\");\n h.style.display = \"table-cell\";\n h.style.paddingLeft = \"6px\";\n h.style.fontWeight = \"bold\";\n h.innerHTML = c;\n r.appendChild(h);\n })\n table.appendChild(r);\n}", "title": "" }, { "docid": "36aa9658ae1fb82ee412ce9fadb2927a", "score": "0.60029536", "text": "function createTableHeader() {\n\n let trEl = document.createElement('tr');\n tableEl.appendChild(trEl);\n let thEl = document.createElement('th');\n trEl.appendChild(thEl);\n thEl.textContent = ' ';\n for(let i=0;i<ArrHour.length; i++)\n {\n let thEl = document.createElement('th');\n trEl.appendChild(thEl);\n thEl.textContent = `${ArrHour[i]} `;\n }\n // let thEl = document.createElement('th');\n // trEl.appendChild(thEl);\n let thEll = document.createElement('th');\n trEl.appendChild(thEll);\n thEll.textContent = 'Daily Location Total';\n}", "title": "" }, { "docid": "f6ffa6d6615f979bcadff70396d4cbb2", "score": "0.5992382", "text": "buildTableHeader() {\r\n var row, cell, head, titles;\r\n\r\n titles = [\r\n \"Experience\",\r\n \"Comment\",\r\n \"Name\",\r\n \"Email\",\r\n \"Register Date\",\r\n \"Delete\",\r\n ];\r\n\r\n //Creates a new row, appends that row to the table\r\n head = document.createElement(\"thead\");\r\n row = document.createElement(\"tr\");\r\n document.getElementById(\"dataTable\").appendChild(head);\r\n head.appendChild(row);\r\n\r\n //Loops through the values in the above array, and populates the header\r\n titles.forEach((title) => {\r\n cell = document.createElement(\"th\");\r\n cell.appendChild(document.createTextNode(title));\r\n row.appendChild(cell);\r\n });\r\n }", "title": "" }, { "docid": "dddb980eefd3a2b5d695d362cd598bce", "score": "0.5983753", "text": "function addSubmissionColumnHeader() {\n let tableRow = document.querySelector('#question-app > div > div:nth-child(2) > div.question-list-base > div.table-responsive.question-list-table > table > thead > tr');\n\n let tableHead = document.createElement('th');\n\n tableHead.setAttribute('class', 'reactable-th-status reactable-header-sortable');\n\n tableHead.setAttribute('role', 'button');\n\n tableHead.setAttribute('tabindex', '0');\n\n let strongTag = document.createElement('strong');\n\n strongTag.innerText = 'Submissions';\n\n tableHead.appendChild(strongTag);\n\n\n tableRow.appendChild(tableHead);\n}", "title": "" }, { "docid": "b069424de23789fa2d839b593d212dae", "score": "0.5982433", "text": "function header(){\n let headerRow = null;\n headerRow = document.createElement('th');\n firstRow.appendChild(headerRow);\n headerRow.textContent;\n for (let i=0; i<time.length; i++){\n headerRow = document.createElement('th');\n firstRow.appendChild(headerRow);\n headerRow.textContent = time[i];\n }\n headerRow = document.createElement('th');\n firstRow.appendChild(headerRow);\n headerRow.textContent = 'Daily Location Total';\n}", "title": "" }, { "docid": "7b03d464f92eb595ae672544575b294a", "score": "0.597812", "text": "function drawBarsTable() {\n apiData.states.forEach(() => {\n $('#bars-table tbody').append(`\n <tr class=\"state-row\">\n <td class=\"state-name\"></td>\n <td></td>\n <td class=\"total\"></td>\n </tr>\n `);\n });\n updateBars();\n \n $('a[data-sort]').click(function () {\n let $a = $(this); \n const direction = $a.hasClass('asc') ? 'desc' : 'asc';\n $('a[data-sort]').removeClass('sort asc desc');\n\n $a.addClass('sort').addClass(direction);\n filter.sort_type = $a.attr('data-sort');\n filter.sort_order = direction;\n\n updateBars();\n });\n}", "title": "" }, { "docid": "72dabf3194e7905bd517d31f0e32d120", "score": "0.5977763", "text": "show_header(thead) {\r\n //\r\n //Header should look like this\r\n //The primary key column will also serve as the multi line selector\r\n //<tr>\r\n // <th id=\"todo\" onclick=\"select_column(this)\">Todo</th>\r\n // ...\r\n //</tr>\r\n //Construct the th and attach it to the thead.\r\n const tr = document.createElement(\"tr\");\r\n thead.appendChild(tr);\r\n //\r\n //2. Loop through all the columns to create the table headers\r\n //matching the example above.\r\n this.col_names.forEach(col_name => {\r\n //\r\n //Create the th element using this panel's document and attach to \r\n //the current tr.\r\n const th = this.document.createElement(\"th\");\r\n tr.appendChild(th);\r\n //\r\n //Add the id attribute to the th using the column name.\r\n th.id = `'${col_name}'`;\r\n //\r\n //Add the column name as the text content of the th.\r\n th.textContent = col_name;\r\n //\r\n //Add the column th column selector listener.\r\n th.onclick = (evt) => this.select_column(evt);\r\n });\r\n }", "title": "" }, { "docid": "e22ea51f632d4d3f4e31e94c98872a49", "score": "0.5971493", "text": "function renderFixedHeaders(type, viewRange, w, h, tx, ty) {\n const { draw, data } = this;\n const sumHeight = viewRange.h; // rows.sumHeight(viewRange.sri, viewRange.eri + 1);\n const sumWidth = viewRange.w; // cols.sumWidth(viewRange.sci, viewRange.eci + 1);\n const nty = ty + h;\n const ntx = tx + w;\n\n draw.save();\n // draw rect background\n draw.attr(tableFixedHeaderCleanStyle);\n if (type === 'all' || type === 'left') draw.fillRect(0, nty, w, sumHeight);\n if (type === 'all' || type === 'top') draw.fillRect(ntx, 0, sumWidth, h);\n\n const {\n sri, sci, eri, eci,\n } = data.selector.range;\n // console.log(data.selectIndexes);\n // draw text\n // text font, align...\n draw.attr(tableFixedHeaderStyle());\n // y-header-text\n if (type === 'all' || type === 'left') {\n data.rowEach(viewRange.sri, viewRange.eri, (i, y1, rowHeight) => {\n const y = nty + y1;\n const ii = i;\n draw.line([0, y], [w, y]);\n if (sri <= ii && ii < eri + 1) {\n renderSelectedHeaderCell.call(this, 0, y, w, rowHeight);\n }\n draw.fillText(ii + 1, w / 2, y + (rowHeight / 2));\n });\n draw.line([0, sumHeight + nty], [w, sumHeight + nty]);\n draw.line([w, nty], [w, sumHeight + nty]);\n }\n // x-header-text\n if (type === 'all' || type === 'top') {\n data.colEach(viewRange.sci, viewRange.eci, (i, x1, colWidth) => {\n const x = ntx + x1;\n const ii = i;\n draw.line([x, 0], [x, h]);\n if (sci <= ii && ii < eci + 1) {\n renderSelectedHeaderCell.call(this, x, 0, colWidth, h);\n }\n draw.fillText(Object(_core_alphabet__WEBPACK_IMPORTED_MODULE_0__[\"stringAt\"])(ii), x + (colWidth / 2), h / 2);\n });\n draw.line([sumWidth + ntx, 0], [sumWidth + ntx, h]);\n draw.line([0, h], [sumWidth + ntx, h]);\n }\n draw.restore();\n}", "title": "" }, { "docid": "3c7c56c8a954038d3f8d4773a25e31f6", "score": "0.5970729", "text": "renderHeader() {\n this.syncHeaderSortState();\n }", "title": "" }, { "docid": "50af1a1606ef3f0924a4518db3d4e71b", "score": "0.59626853", "text": "function columnNum(){\n var count;\n var $headerColumns = $header.find(opts.headerCellSelector);\n if(existingColGroup){\n count = $tableColGroup.find('col').length;\n } else {\n count = 0;\n $headerColumns.each(function () {\n count += parseInt(($(this).attr('colspan') || 1), 10);\n });\n }\n if(count != lastColumnCount){\n lastColumnCount = count;\n var cells = [], cols = [], psuedo = [], content;\n for(var x = 0; x < count; x++){\n if (opts.enableAria && (content = $headerColumns.eq(x).text()) ) {\n cells.push('<th scope=\"col\" class=\"floatThead-col\">' + content + '</th>');\n } else {\n cells.push('<th class=\"floatThead-col\"/>');\n }\n cols.push('<col/>');\n psuedo.push(\"<fthtd style='display:table-cell;height:0;width:auto;'/>\");\n }\n\n cols = cols.join('');\n cells = cells.join('');\n\n if(createElements){\n psuedo = psuedo.join('');\n $fthRow.html(psuedo);\n $fthCells = $fthRow.find('fthtd');\n }\n\n $sizerRow.html(cells);\n $sizerCells = $sizerRow.find(\"th\");\n if(!existingColGroup){\n $tableColGroup.html(cols);\n }\n $tableCells = $tableColGroup.find('col');\n $floatColGroup.html(cols);\n $headerCells = $floatColGroup.find(\"col\");\n\n }\n return count;\n }", "title": "" }, { "docid": "c3c83e54c202c373482fa8ceb776ece6", "score": "0.59623027", "text": "renderTableHeader() {\n const headers = [\"date\", \"nickname\", \"name\"];\n return headers.map((key, index) => {\n return <th key={index}>{key.toUpperCase()}</th>;\n });\n }", "title": "" }, { "docid": "d6562af16a9588b020db07ae5760c29f", "score": "0.59459496", "text": "clearColumnHeaders(){\n\t\tthis.table.columnManager.getRealColumns().forEach((column) => {\n\t\t\tif(column.modules.sort){\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\n\t\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "eed8a7eab788001ba3352af835209743", "score": "0.59400815", "text": "function findColumnHeadings() {\r\n var i;\r\n for (i = 0; i < 6; i += 1) {\r\n if (findHit(file_lines[i]) === 3) {\r\n row_index = i;\r\n break;\r\n }\r\n }\r\n \r\n var cells = file_lines[row_index].split(',');\r\n var found_headings_count = 0;\r\n $.each(cells, function (key, value) {\r\n value = value.toLowerCase().trim();\r\n value = value.replace(\"_\", \"\");\r\n value=value.replace(/\\\"/g,'');\r\n if (value === \"length\") {\r\n length_index = key;\r\n } else if (value === \"breadth\") {\r\n breadth_index = key;\r\n } else if (value === \"dragheight\") {\r\n drag_height_index = key;\r\n } else if (value === \"copeheight\") {\r\n cope_height_index = key;\r\n } else if (value === \"avllength\") {\r\n avl_length_index = key;\r\n } else if (value === \"avlbreadth\") {\r\n avl_breadth_index = key;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "0c235a2abb13018b056aec37546a126e", "score": "0.5922167", "text": "function createTable() {\n\ttable = d3.select('#taxi-bookings-table').append('table');\n\theaders = table.append('thead').append('tr')\n\t\t.selectAll('th')\n\t\t.data(titles).enter()\n\t\t.append('th')\n\t\t.text(function (d) {\n\t\t\treturn d;\n\t\t})\n\t\t.on('click', function (d) {\n\t\t\theaders.attr('class', 'header');\n\t\t \t \n\t\t\tif (sortAscending) {\n\t\t\t\trows.sort(function(a, b) { return b[d] < a[d];});\n\t\t\t\tsortAscending = false;\n\t\t\t\tthis.className = 'aes';\n\t\t\t} else {\n\t\t\t\trows.sort(function(a, b) { return b[d] > a[d]; });\n\t\t\t\tsortAscending = true;\n\t\t\t\tthis.className = 'des';\n\t\t\t}\n\t\t \t \n\t\t});\n\n\t\t// Add a tbody element.\n\t\ttbody = table.append('tbody');\n}", "title": "" }, { "docid": "7bdbd2924be1ab58350cf7cfe5cb52c0", "score": "0.59152615", "text": "function addTableHeaders(thead) {\n let tr = thead.insertRow(0)\n\n // Loop through array of header information in \n parkLabels.forEach(function(e) {\n let th = document.createElement(\"th\");\n th.innerHTML = e; //.toUpperCase();\n tr.appendChild(th);\n });\n }", "title": "" }, { "docid": "d7fae0516b535d21b8fbcd40acfe1590", "score": "0.5893764", "text": "function tableHeaderSetup(){\n var tblHeader = document.getElementById('salesTableHeader');\n var headerEl = document.createElement('th');\n tblHeader.appendChild(headerEl);\n\n for (var i = 0; i < operatingHours.length; i++){\n headerEl = document.createElement('th');\n headerEl.textContent = operatingHours[i];\n tblHeader.appendChild(headerEl);\n locationTotals[i] = 0;\n };\n headerEl = document.createElement('th');\n headerEl.textContent = 'Total Daily Sales';\n headerEl.id = 'TotalHeader';\n tblHeader.appendChild(headerEl);\n}", "title": "" }, { "docid": "cdea2f2056e80cf044c8d3634f7fadeb", "score": "0.58755094", "text": "setColumnHeader(column, dir){\n\t\tcolumn.modules.sort.dir = dir;\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\n\t\tthis.setColumnHeaderSortIcon(column, dir);\n\t}", "title": "" }, { "docid": "666eb6ec9b694067ee5a1d610bde54cd", "score": "0.5874959", "text": "function createTableHeader() {\n let parentTable = document.getElementById('storesTable');\n let tblHeader = document.createElement('thead');\n modifyDom(tblHeader, 'th', 'Locations');\n for (let i = 0; i < hoursOfOperation.length; i++) {\n modifyDom(tblHeader, 'th', hoursOfOperation[i]);\n }\n modifyDom(tblHeader, 'th', 'Totals');\n parentTable.appendChild(tblHeader);\n}", "title": "" }, { "docid": "9310acd3dc8c54e8f1f7ba4495d9472f", "score": "0.58693945", "text": "function setHeaderData(column){\n var tempColumnTitle = [];\n var uniqueId = getId();\n for(var i = 0; i < column.length; i++){\n var tempObj = {};\n if(column[i].hasOwnProperty(\"title\")){\n tempObj.value = column[i].title;\n }else{\n tempObj.value = column[i].name;\n }\n if(column[i].hasOwnProperty(\"isVisible\")){\n column[i].isVisible ? tempObj.isVisible = true : tempObj.isVisible = false;\n }else{\n tempObj.isVisible = true;\n }\n tempObj.name = column[i].name;\n tempObj.orderDefaultFlag = true;\n tempObj.ascFlag = false;\n tempObj.descFlag = false;\n tempObj.itemIndex = i;\n tempObj.tdType = \"normal\";\n tempObj.selectFlag = \"all\";\n tempObj.uniqueId = uniqueId;\n tempColumnTitle.push(tempObj);\n }\n if($scope.complexTableDm.hasRadioBtn){\n tempColumnTitle.unshift({tdType:\"radioBtn\",value:\"\",name:\"\",\n orderDefaultFlag:false,ascFlag:false,\n descFlag:false,itemIndex:-1,selectFlag:\"all\",\n uniqueId:uniqueId,isVisible:true});\n }else{\n if($scope.complexTableDm.hasCheckBox){\n tempColumnTitle.unshift({tdType:\"checkBox\",value:\"\",name:\"\",\n orderDefaultFlag:false,ascFlag:false,\n descFlag:false,itemIndex:-1,selectFlag:\"all\",\n uniqueId:uniqueId,isVisible:true});\n }\n }\n return tempColumnTitle;\n }", "title": "" }, { "docid": "e7334389bab4f3fbd3385c99a87031e7", "score": "0.58690745", "text": "render(){\n const header = this.props.header;\n const styleColor = this.typeColor();\n return(\n <th style={styleColor}>\n {header}\n </th>\n );\n }", "title": "" }, { "docid": "4be2c08a3d75b6e5c5a13ef830ac0ce8", "score": "0.5846151", "text": "function buildtable(b,a){$(b).html(a);$(\"#sortableTable\").fixheadertable({colratio:[75,75,\"auto\",125,100,75,200,\"auto\"],height:200,zebra:true,sortable:true,sortedColId:0,sortType:[\"integer\",\"string\",\"string\",\"string\",\"integer\",\"string\",\"string\",\"string\"],dateFormat:\"m/d/Y\",pager:true,rowsPerPage:10})}", "title": "" }, { "docid": "2dd2ed94d19190b11f3ad175ad9d2710", "score": "0.5842261", "text": "function drawHeaderBox(pg, idx, boxX, boxY)\n {\n\t\treturn layout.groupHeights[idx] - barHeight;\t// Move calc. to layout?\n }", "title": "" }, { "docid": "189d1a308f1b3c0b6f9be6dad5329b3c", "score": "0.5839948", "text": "renderHeader() {\n this.syncHeaderSortState();\n }", "title": "" }, { "docid": "36890ca8cbc4be16bf7d6be6b8d6df8c", "score": "0.58371896", "text": "function onColumnHeadClick(){\n var table_head = document.getElementsByTagName(\"thead\")[0];\n table_head.addEventListener('click', function(e) {\n var clicked_column = e.target.id;\n var column = document.getElementById(clicked_column);\n\n sortTableByColumn(column);\n changePage();\n });\n}", "title": "" }, { "docid": "0bd99d099d53268941dc7d30f11beadf", "score": "0.5835072", "text": "function renderHeader() {\n let headerElem = document.createElement('tr');\n tableElem.appendChild(headerElem);\n\n let blankSpace1 = document.createElement('td');\n blankSpace1.textContent = '';\n headerElem.appendChild(blankSpace1);\n\n for (let i = 0; i < hoursOfOperation.length; i++) {\n let hoursElem = document.createElement('td');\n hoursElem.textContent = hoursOfOperation[i];\n headerElem.appendChild(hoursElem); \n }\n\n let locationDailyTotalElem = document.createElement('td');\n locationDailyTotalElem.textContent = 'Total';\n headerElem.appendChild(locationDailyTotalElem);\n}", "title": "" }, { "docid": "46012ee74707543a5dddcfd1900ad6ac", "score": "0.5822862", "text": "function headerClickHandler() {\n 'use strict';\n var property = this.dataset.property;\n\n roster.result.sort(sortRoster(property));\n populateTable(this.parentNode.parentNode.parentNode, 'short');\n}", "title": "" }, { "docid": "7cef4fe20fc091ea9a34aa443c7f16e0", "score": "0.5818777", "text": "function addColumnHeaders() {\n var i = 0;\n do {\n document.getElementsByTagName(\"th\")[i].innerHTML = daysOfWeek[i];\n i++;\n }\n while (i < 7)\n}", "title": "" }, { "docid": "c9e218d4e89e460cc183cece98c8c707", "score": "0.58154845", "text": "renderTable(element) {\n // Play around... change columns order, move the sort attribute...\n // Important: to render a new column,\n // the key attribute must match the received key from /fx/prices data\n this.table.appendHeader([\n { key: 'name', value: 'Name', formatter: this.constructor.nameFormatter, columnClass: 'align-left' },\n // { key: 'openBid', value: 'Open Bid' },\n // { key: 'openAsk', value: 'Open Ask' },\n { key: 'bestBid', value: 'Current Best Bid Price' },\n { key: 'bestAsk', value: 'Current Best Ask Price' },\n { key: 'lastChangeBid', value: 'Amount Best Bid Last Changed', sort: true },\n { key: 'lastChangeAsk', value: 'Amount Best Ask Last Changed' },\n { key: 'midPrice', value: 'Sparkline', formatter: this.sparklineFormatter },\n ]);\n\n this.table.render(element);\n }", "title": "" }, { "docid": "112c0c72dda3a397e3ae9cad7aac830e", "score": "0.5812349", "text": "function MySortingTable(props) {\n function getColumns() {\n return [\n {\n property: 'id',\n header: {\n label: 'ID',\n transforms: [\n label => ({\n onClick: event => {\n event.stopPropagation();\n\n props.sortTable(label, event.altKey || event.ctrlKey);\n },\n }),\n ],\n formatters: [\n label => (\n <FormatColHeader sortingState={props.sorting} label={label} />\n ),\n ],\n },\n },\n {\n property: 'name',\n header: {\n label: 'Name',\n transforms: [\n label => ({\n onClick: event => {\n event.stopPropagation();\n props.sortTable(label, event.altKey || event.ctrlKey);\n },\n }),\n ],\n formatters: [\n label => (\n <FormatColHeader sortingState={props.sorting} label={label} />\n ),\n ],\n },\n },\n {\n property: 'tools',\n header: {\n label: 'Active',\n transforms: [\n label => ({\n onClick: event => {\n event.stopPropagation();\n props.sortTable('tools', event.altKey || event.ctrlKey);\n },\n }),\n ],\n formatters: [\n label => (\n <FormatColHeader\n sortingState={props.sorting}\n property=\"tools\"\n label={label}\n />\n ),\n ],\n },\n cell: {\n formatters: [tools => (tools.hammer ? 'Hammertime' : 'nope')],\n },\n },\n {\n property: 'country',\n header: {\n label: 'Country',\n transforms: [\n label => ({\n onClick: event => {\n event.stopPropagation();\n props.sortTable(label, event.altKey || event.ctrlKey);\n },\n }),\n ],\n formatters: [\n country => (\n <FormatColHeader sortingState={props.sorting} label={country} />\n ),\n ],\n },\n cell: {\n formatters: [country => Countries[country]],\n },\n },\n ];\n }\n\n const { columns } = getColumns();\n const { rows } = props.sorting;\n\n return (\n <div>\n <Table.Provider\n className=\"table table-striped table-bordered\"\n columns={getColumns()}\n >\n <Table.Header />\n <Table.Body rows={rows} rowKey=\"id\" />\n </Table.Provider>\n </div>\n );\n}", "title": "" }, { "docid": "66d9fb03a22466c515a6b0d40cda5601", "score": "0.5809544", "text": "function updateTableHeaders(rawData){\n line = \"<th>\"+Object.keys(rawData.data[0]).join(\"</th><th>\")+\"</th>\";\n console.log(line);\n row = document.getElementById(rawData.elementId + \"-header\");\n // header does not exist\n if (row == null){\n row = document.getElementById(rawData.elementId).insertRow(0);\n row.id = rawData.elementId + \"-header\";\n }\n row.innerHTML=line;\n}", "title": "" }, { "docid": "7252fdf3f48ab43d937ef47b8b847339", "score": "0.5803667", "text": "renderTableHeader() {\n if (this.state.foodList.length > 0) {\n let header = Object.keys(this.state.foodList[0])\n var count = 0; \n let newHeader = header.splice(0, 2); \n return newHeader.map((key, index) => {\n if (count < 2) {\n return <th key={index}>{key.toUpperCase()}</th>\n }\n count++; \n })\n }\n }", "title": "" }, { "docid": "7252fdf3f48ab43d937ef47b8b847339", "score": "0.5803667", "text": "renderTableHeader() {\n if (this.state.foodList.length > 0) {\n let header = Object.keys(this.state.foodList[0])\n var count = 0; \n let newHeader = header.splice(0, 2); \n return newHeader.map((key, index) => {\n if (count < 2) {\n return <th key={index}>{key.toUpperCase()}</th>\n }\n count++; \n })\n }\n }", "title": "" }, { "docid": "0429e6837c5f7a62e82d05d198ad726f", "score": "0.57985413", "text": "function createTableHeader() {\n var table = document.getElementById('locations-list');\n var tableHeader = document.createElement('thead');\n table.appendChild(tableHeader);\n var tableRow = document.createElement('tr');\n tableHeader.appendChild(tableRow);\n var thCell = document.createElement('th');\n thCell.textContent = '';\n tableRow.appendChild(thCell);\n //for loop runs through the hours array to populate hour headings for table\n for (var i = 0; i < hoursArray.length; i++) {\n\n thCell = document.createElement('th');\n thCell.textContent = hoursArray[i];\n tableRow.appendChild(thCell);\n }\n //creates a final daily total heading\n thCell = document.createElement('th');\n thCell.textContent = 'Daily Total';\n tableRow.appendChild(thCell);\n}", "title": "" }, { "docid": "587df8c6ee618822129bab2dd94086fc", "score": "0.5788936", "text": "function createColumnHeaders() {\n function onMouseEnter() {\n $(this).addClass(\"ui-state-hover\");\n }\n\n function onMouseLeave() {\n $(this).removeClass(\"ui-state-hover\");\n }\n\n $headers.find(\".slick-header-column\")\n .each(function h_before_headercell_destroy_f() {\n var columnDef = $(this).data(\"column\");\n assert(columnDef);\n if (columnDef) {\n trigger(self.onBeforeHeaderCellDestroy, {\n node: this,\n column: columnDef\n });\n }\n });\n $headers.empty();\n\n // Get the data for each column in the DOM\n $headerRow.find(\".slick-headerrow-column\")\n .each(function h_before_headerrowcell_destroy_f() {\n var columnDef = $(this).data(\"column\");\n if (columnDef) {\n trigger(self.onBeforeHeaderRowCellDestroy, {\n node: this,\n column: columnDef\n });\n }\n });\n $headerRow.empty();\n\n $footerRow.find(\".slick-footerrow-column\")\n .each(function h_before_footerrowcell_destroy_f() {\n var columnDef = $(this).data(\"column\");\n if (columnDef) {\n trigger(self.onBeforeFooterRowCellDestroy, {\n node: this,\n column: columnDef\n });\n }\n });\n $footerRow.empty();\n\n function createColumnHeader(columnDef, appendTo, cell) {\n var isLeaf = !columnDef.children;\n var cellCss = [\n \"ui-state-default\", \n \"slick-header-column\", \n (!isLeaf ? \"slick-header-is-parent\" : \"slick-header-is-leaf\"),\n \"hl\" + cell, \n \"hr\" + (cell + columnDef.headerColSpan - 1), \n \"hrt\" + columnDef.headerRow, \n \"hrb\" + (columnDef.headerRow + columnDef.headerRowSpan - 1)\n ];\n if (columnDef.headerCssClass) {\n cellCss.push(columnDef.headerCssClass);\n }\n var info = {\n cellCss: cellCss,\n cellStyles: [],\n html: \"\",\n attributes: {},\n toolTip: columnDef.toolTip || null,\n colspan: columnDef.headerColSpan,\n rowspan: columnDef.headerRowSpan,\n //cellHeight: cellHeight,\n //rowMetadata: rowMetadata,\n //columnMetadata: columnMetadata,\n columnHeader: {\n columnDef: columnDef,\n cell: cell\n }\n };\n // I/F: function formatter(row, cell, value, columnDef, rowDataItem, cellMetaInfo)\n info.html = getHeaderFormatter(-2000 + columnDef.headerRow, cell)(-2000 + columnDef.headerRow, cell, columnDef.name, columnDef, null /* rowDataItem */, info);\n var metaData = getAllCustomMetadata(null, null, info) || {};\n patchupCellAttributes(metaData, info, \"columnheader\");\n metaData.id = mkSaneId(columnDef, cell, \"header\" + columnDef.headerRow);\n var stringArray = [\n \"<div\"\n ];\n // I/F: function appendMetadataAttributes(stringArray, row, cell, data, columnDef, rowDataItem, cellMetaInfo)\n appendMetadataAttributes(stringArray, -2000 + columnDef.headerRow, cell, metaData, columnDef, null, info);\n \n stringArray.push(\">\");\n\n stringArray.push(info.html);\n\n stringArray.push(\"</div>\");\n\n var header = $(stringArray.join(\"\"))\n .data(\"column\", columnDef)\n .appendTo(appendTo);\n return header;\n }\n\n function createBaseColumnHeader(columnDef, $appendTo, cell) {\n assert(columnDef.children == null);\n var $header = createColumnHeader(columnDef, $appendTo, cell);\n var i, j, len, llen, column;\n var cellCss, info;\n var headerRowCell;\n var footerRowCell;\n\n if (options.enableColumnReorder || columnDef.sortable) {\n $header\n .on(\"mouseenter\", onMouseEnter)\n .on(\"mouseleave\", onMouseLeave);\n }\n\n if (columnDef.sortable) {\n $header.addClass(\"slick-header-sortable\");\n $header.append(\"<span class='slick-sort-indicator' />\");\n }\n \n if (options.enableColumnReorder && columnDef.reorderable) {\n $header.addClass(\"slick-header-reorderable\");\n }\n\n trigger(self.onHeaderCellRendered, {\n node: $header[0],\n column: columnDef,\n cell: cell\n });\n\n if (options.showHeaderRow) {\n cellCss = [\n \"ui-state-default\", \n \"slick-headerrow-column\", \n \"hl\" + cell, \n \"hr\" + (cell + columnDef.headerColSpan - 1)\n ];\n if (columnDef.headerCssClass) cellCss.push(columnDef.headerCssClass);\n info = {\n cellCss: cellCss,\n cellStyles: [],\n html: \"\",\n attributes: {},\n toolTip: columnDef.headerRowToolTip || null,\n colspan: columnDef.headerColSpan,\n rowspan: 1,\n //cellHeight: cellHeight,\n //rowMetadata: rowMetadata,\n //columnMetadata: columnMetadata,\n columnHeader: {\n columnDef: columnDef,\n cell: cell\n }\n };\n info.html = getHeaderRowFormatter(-1000 + columnDef.headerRow, cell)(-1000 + columnDef.headerRow, cell, columnDef.initialHeaderRowValue, columnDef, null /* rowDataItem */, info);\n var stringArray = [];\n stringArray.push(\"<div\");\n\n var metaData = getAllCustomMetadata(null, null, info) || {};\n patchupCellAttributes(metaData, info, \"columnbaseheader\");\n metaData.id = mkSaneId(columnDef, cell, \"headerrow\" + columnDef.headerRow);\n appendMetadataAttributes(stringArray, -1000 + columnDef.headerRow, cell, metaData, columnDef, null, info);\n\n stringArray.push(\">\");\n\n stringArray.push(info.html);\n\n stringArray.push(\"</div>\");\n\n headerRowCell = $(stringArray.join(\"\"))\n .data(\"column\", columnDef)\n .appendTo($headerRow);\n\n trigger(self.onHeaderRowCellRendered, {\n node: headerRowCell[0],\n column: columnDef,\n cell: cell\n });\n }\n if (options.showFooterRow) {\n cellCss = [\n \"ui-state-default\", \n \"slick-footerrow-column\", \n \"hl\" + cell, \n \"hr\" + (cell + columnDef.headerColSpan - 1)\n ];\n if (columnDef.footerCssClass) {\n cellCss.push(columnDef.footerCssClass);\n }\n info = {\n cellCss: cellCss,\n cellStyles: [],\n html: \"\",\n attributes: {},\n toolTip: columnDef.footerRowToolTip || null,\n colspan: columnDef.headerColSpan,\n rowspan: 1,\n //cellHeight: cellHeight,\n //rowMetadata: rowMetadata,\n //columnMetadata: columnMetadata,\n columnHeader: {\n column: columnDef,\n cell: cell\n }\n };\n info.html = getHeaderRowFormatter(-3000 + columnDef.headerRow, cell)(-3000 + columnDef.headerRow, cell, columnDef.initialFooterRowValue, columnDef, null /* rowDataItem */, info);\n var stringArray = [];\n stringArray.push(\"<div\");\n\n var metaData = getAllCustomMetadata(null, null, info) || {};\n patchupCellAttributes(metaData, info, \"columnfooter\");\n metaData.id = mkSaneId(columnDef, cell, \"footer\" + columnDef.headerRow);\n appendMetadataAttributes(stringArray, -3000 + columnDef.headerRow, cell, metaData, columnDef, null, info);\n\n stringArray.push(\">\");\n\n stringArray.push(info.html);\n\n stringArray.push(\"</div>\");\n\n footerRowCell = $(stringArray.join(\"\"))\n .data(\"column\", columnDef)\n .appendTo($footerRow);\n\n trigger(self.onFooterRowCellRendered, {\n node: footerRowCell[0],\n column: columnDef,\n cell: cell\n });\n }\n }\n\n if (hasNestedColumns) {\n for (i = 0, len = nestedColumns.length; i < len; i++) {\n var cell;\n var layer = nestedColumns[i];\n\n for (j = 0, llen = layer.length; j < llen; j++) {\n column = layer[j];\n if (column.children) {\n cell = column.childrenFirstIndex;\n assert(cell != null);\n assert(i === column.headerRow);\n createColumnHeader(column, $headers, cell);\n } else {\n cell = getColumnIndex(column.id);\n assert(cell != null);\n createBaseColumnHeader(column, $headers, cell);\n }\n }\n }\n\n $headers.addClass(\"slick-nested-headers\");\n } else {\n for (i = 0, len = columns.length; i < len; i++) {\n column = columns[i];\n createBaseColumnHeader(column, $headers, i);\n }\n }\n\n setSortColumns(sortColumns);\n setupColumnResize();\n if (options.enableColumnReorder) {\n setupColumnReorder();\n }\n }", "title": "" }, { "docid": "c133eba621c5667bb7194a3a2e607d74", "score": "0.57868874", "text": "function renderSortOptions(col, status, colname) {\n str = \"\";\n if (status == -1) {\n\n if (col == \"ccode\" || col == \"class\" || col == \"credits\" || col == \"start_period\" || col == \"end_period\" || col == \"study_program\" || col == \"tallocated\") {\n str += \"<span onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",0)'>\" + colname + \"</span>\";\n } else {\n str += \"<span onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",0)'>\" + colname + \"</span>\";\n }\n } else {\n if (col == \"ccode\" || col == \"cname\" || col == \"class\" || col == \"credits\" || col == \"start_period\" || col == \"end_period\" || col == \"study_program\" || col == \"tallocated\") {\n if (status == 0) {\n str += \"<div onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",1)'>\" + colname + \"&#x25b4;</div>\";\n } else {\n str += \"<div onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",0)'>\" + colname + \"&#x25be;</div>\";\n }\n } else {\n if (status == 0) {\n str += \"<div onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",1)'>\" + colname + \"&#x25b4;</div>\";\n } else {\n str += \"<div onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",0)'>\" + colname + \"&#x25be;</div>\";\n }\n }\n }\n\n return str;\n}", "title": "" }, { "docid": "c34fa2dbb42bb933968e7765837e8cd4", "score": "0.5784148", "text": "function createHeader(parentNode, className, text, abbr, anidbSort, colSpan) {\r\n\tvar th = document.createElement('th');\r\n\tif (className != null) th.className = className;\r\n\tif (abbr != null) {\r\n\t\tvar abbreviation = document.createElement('abbr');\r\n\t\tabbreviation.title = abbr;\r\n\t\tif (text != null) abbreviation.appendChild(document.createTextNode(text));\r\n\t\tth.appendChild(abbreviation);\r\n\t} else if (text != null) th.appendChild(document.createTextNode(text));\r\n\tif (colSpan != null && colSpan > 1) th.colSpan = colSpan;\r\n\tif (anidbSort != null) {\r\n\t\tif (th.className) th.className += ' '+anidbSort;\r\n\t\telse th.className = anidbSort;\r\n\t}\r\n\tif (parentNode != null) parentNode.appendChild(th);\r\n\telse return th;\r\n}", "title": "" }, { "docid": "ce728f26a4353ecd5b1182d218e396a7", "score": "0.57738274", "text": "function defaultHeaderRenderer(_ref) {\n var dataKey = _ref.dataKey,\n label = _ref.label,\n sortBy = _ref.sortBy,\n sortDirection = _ref.sortDirection;\n\n var showSortIndicator = sortBy === dataKey;\n var children = [react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\n 'span',\n {\n className: 'ReactVirtualized__Table__headerTruncatedText',\n key: 'label',\n title: label },\n label\n )];\n\n if (showSortIndicator) {\n children.push(react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_SortIndicator__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { key: 'SortIndicator', sortDirection: sortDirection }));\n }\n\n return children;\n}", "title": "" }, { "docid": "a3e98646b28cd08620791cf9ec92a963", "score": "0.5768343", "text": "function setHeaderData1(column){\n var tempColumnTitle = [];\n for(var i = 0; i < column.length; i++){\n var tempObj = {};\n if(column[i].hasOwnProperty(\"title\")){\n tempObj.value = column[i].title;\n }else{\n tempObj.value = column[i].name;\n }\n if(column[i].hasOwnProperty(\"isVisible\")){\n column[i].isVisible ? tempObj.isVisible = true : tempObj.isVisible = false;\n }else{\n tempObj.isVisible = true;\n }\n tempObj.name = column[i].name;\n tempObj.itemIndex = i;\n tempObj.tdType = \"normal\";\n tempObj.selectFlag = \"subAll\";\n tempColumnTitle.push(tempObj);\n }\n if($scope.complexTableDm.hasRadioBtn){\n tempColumnTitle.unshift({tdType:\"readytouse\",value:\"\",name:\"\",\n itemIndex:-1,selectFlag:\"subAll\",\n isVisible:true});\n }else{\n if($scope.complexTableDm.hasCheckBox){\n tempColumnTitle.unshift({tdType:\"readytouse\",value:\"\",name:\"\",\n itemIndex:-1,selectFlag:\"subAll\",\n isVisible:true});\n }\n }\n return tempColumnTitle;\n }", "title": "" }, { "docid": "3c98e5e894258a1de14f20f1bfe8301e", "score": "0.57680726", "text": "function createHeader(){\n\n let hourCells = document.createElement('td');\n hourCells.textContent = 'Store';\n salesHeader.appendChild(hourCells);\n for (let i = 0; i < hours.length; i++){\n let hourCells = document.createElement('td');\n hourCells.textContent = hours[i];\n salesHeader.appendChild(hourCells);\n }\n let td = document.createElement('td');\n td.textContent = 'Daily Location Total';\n salesHeader.appendChild(td);\n}", "title": "" }, { "docid": "6a23eafe23c769807ac5ffba6c78e9c6", "score": "0.5766847", "text": "function createDomainScoresTableHeader()\n{\n\n $(\"#report-table-hdr\").empty();\n\n var hdr = $(\"<tr></tr>\");\n var hdr_row = $(\"<th>Level</th>\" +\n \"<th>Domain</th>\" +\n \"<th>Name</th>\" +\n \"<th>Raw Score</th>\" +\n \"<th>Scaled Score</th>\" +\n \"<th>Scaled Score Std. Error</th>\" +\n \"<th>Domain Band</th>\" +\n \"<th>Proficiency</th>\");\n\n hdr.append(hdr_row);\n $(\"#report-table-hdr\").append(hdr);\n\n}", "title": "" }, { "docid": "0f3e5af638bbffc460924c49559b88e6", "score": "0.5748524", "text": "function defaultHeaderRenderer(_ref) {\n var dataKey = _ref.dataKey,\n label = _ref.label,\n sortBy = _ref.sortBy,\n sortDirection = _ref.sortDirection;\n\n var showSortIndicator = sortBy === dataKey;\n var children = [__WEBPACK_IMPORTED_MODULE_0_react__[\"createElement\"](\n 'span',\n {\n className: 'ReactVirtualized__Table__headerTruncatedText',\n key: 'label',\n title: label },\n label\n )];\n\n if (showSortIndicator) {\n children.push(__WEBPACK_IMPORTED_MODULE_0_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_1__SortIndicator__[\"a\" /* default */], { key: 'SortIndicator', sortDirection: sortDirection }));\n }\n\n return children;\n}", "title": "" } ]
b92ea2226dc0c0f4a348be46facc361f
Iterates through empty level cells and places "more" links inside if need be
[ { "docid": "569f6041b4206e01453cb551f88d5325", "score": "0.71513295", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tcell = { row: row, col: col };\n\t\t\t\tsegsBelow = _this.getCellSegs(cell, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(cell, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" } ]
[ { "docid": "dc5ce6a18434de1af1cf7ec466abcb71", "score": "0.7297766", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dc5ce6a18434de1af1cf7ec466abcb71", "score": "0.7297766", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dc5ce6a18434de1af1cf7ec466abcb71", "score": "0.7297766", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dc5ce6a18434de1af1cf7ec466abcb71", "score": "0.7297766", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dc5ce6a18434de1af1cf7ec466abcb71", "score": "0.7297766", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dc5ce6a18434de1af1cf7ec466abcb71", "score": "0.7297766", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dc5ce6a18434de1af1cf7ec466abcb71", "score": "0.7297766", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dc5ce6a18434de1af1cf7ec466abcb71", "score": "0.7297766", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ff46ac1497fd677360f748ed49e431ea", "score": "0.7290106", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\t\twhile (col < endCol) {\n\t\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t\t}\n\t\t\t\t\tcol++;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "54013c26812c0e53b24c178b59ae6afc", "score": "0.72633666", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tcell = _this.getCell(row, col);\n\t\t\t\tsegsBelow = _this.getCellSegs(cell, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(cell, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "54013c26812c0e53b24c178b59ae6afc", "score": "0.72633666", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tcell = _this.getCell(row, col);\n\t\t\t\tsegsBelow = _this.getCellSegs(cell, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(cell, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "54013c26812c0e53b24c178b59ae6afc", "score": "0.72633666", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tcell = _this.getCell(row, col);\n\t\t\t\tsegsBelow = _this.getCellSegs(cell, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(cell, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5bf1bd8349dd856d6b0c6d110e4c89ef", "score": "0.600744", "text": "function emptyCellsUntil(endCol) {\n\t\t\t\twhile (col < endCol) {\n\t\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\t\tif (td) {\n\t\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\t\ttr.append(td);\n\t\t\t\t\t}\n\t\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\t\tcol++;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dac8f416ae2ae3354d78339e021a93ad", "score": "0.59617025", "text": "function emptyCellsUntil(endCol) {\n\t\t\twhile (col < endCol) {\n\t\t\t\t// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n\t\t\t\ttd = (loneCellMatrix[i - 1] || [])[col];\n\t\t\t\tif (td) {\n\t\t\t\t\ttd.attr(\n\t\t\t\t\t\t'rowspan',\n\t\t\t\t\t\tparseInt(td.attr('rowspan') || 1, 10) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttd = $('<td/>');\n\t\t\t\t\ttr.append(td);\n\t\t\t\t}\n\t\t\t\tcellMatrix[i][col] = td;\n\t\t\t\tloneCellMatrix[i][col] = td;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "840e632cf0b88d4d67b6cce3b5c0a718", "score": "0.58923805", "text": "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.attr('rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1);\n }\n else {\n td = $('<td/>');\n tr.append(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "title": "" }, { "docid": "840e632cf0b88d4d67b6cce3b5c0a718", "score": "0.58923805", "text": "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.attr('rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1);\n }\n else {\n td = $('<td/>');\n tr.append(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "title": "" }, { "docid": "840e632cf0b88d4d67b6cce3b5c0a718", "score": "0.58923805", "text": "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.attr('rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1);\n }\n else {\n td = $('<td/>');\n tr.append(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "title": "" }, { "docid": "840e632cf0b88d4d67b6cce3b5c0a718", "score": "0.58923805", "text": "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.attr('rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1);\n }\n else {\n td = $('<td/>');\n tr.append(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "title": "" }, { "docid": "840e632cf0b88d4d67b6cce3b5c0a718", "score": "0.58923805", "text": "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.attr('rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1);\n }\n else {\n td = $('<td/>');\n tr.append(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "title": "" }, { "docid": "f77864548a4769b0c130fcbaa0056812", "score": "0.58727866", "text": "function emptyCellsUntil(endCol) {\r\n while (col < endCol) {\r\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\r\n td = (loneCellMatrix[i - 1] || [])[col];\r\n if (td) {\r\n td.attr('rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1);\r\n }\r\n else {\r\n td = $('<td/>');\r\n tr.append(td);\r\n }\r\n cellMatrix[i][col] = td;\r\n loneCellMatrix[i][col] = td;\r\n col++;\r\n }\r\n }", "title": "" }, { "docid": "72734d06f0c55b10bd62b898de4150e2", "score": "0.5854958", "text": "function emptyCellsUntil(endCol) {\r\n\t while (col < endCol) {\r\n\t // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\r\n\t td = (loneCellMatrix[i - 1] || [])[col];\r\n\t if (td) {\r\n\t td.attr('rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1);\r\n\t }\r\n\t else {\r\n\t td = $('<td/>');\r\n\t tr.append(td);\r\n\t }\r\n\t cellMatrix[i][col] = td;\r\n\t loneCellMatrix[i][col] = td;\r\n\t col++;\r\n\t }\r\n\t }", "title": "" }, { "docid": "dbded53136507d08f4c261a556f49e72", "score": "0.58440226", "text": "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "title": "" }, { "docid": "8234a5a13cf67c43a8bbc4aafb6a6076", "score": "0.58243287", "text": "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "title": "" }, { "docid": "4166b9e5f4fb89df555e337cc4f6a6fb", "score": "0.5670017", "text": "function linkifyAllLevels() {\n const content = document.querySelector(\".doc-content\");\n [...Array(7).keys()].map(level => {\n linkifyAnchors(level, content);\n });\n}", "title": "" }, { "docid": "1f122e1ab09553b64e77a567663f70ba", "score": "0.5441424", "text": "function walkLinks( nextCode, nextRow, badLink, nameList ) { // Check to make sure row being linked does not reference row adding link.\n let links = Earthdawn.getAttrBN( edParse.charID, Earthdawn.buildPre( nextCode, nextRow) + \"LinksGetValue_max\" );\n if( links ) {\n let alinks = links.split();\n for( let i = 0; i < alinks.length; ++i ) {\n if( alinks[ i ].indexOf( badLink ) !== -1 ) {\n edParse.chat( \"Error! attempted circular reference: \" + nameList + \" to \"\n + Earthdawn.getAttrBN( edParse.charID, Earthdawn.buildPre( nextCode, nextRow) + \"Name\", Earthdawn.whoFrom.apiWarning ));\n return false;\n } else if( alinks[ i ].startsWith( \"repeating_\" ))\n if ( !walkLinks( Earthdawn.repeatSection( 3, alinks[ i ]), Earthdawn.repeatSection( 2, alinks[ i ]), badLink,\n nameList + \" to \" + Earthdawn.getAttrBN( edParse.charID, Earthdawn.buildPre( nextCode, nextRow) + \"Name\", \"\" )))\n return false;\n } }\n return true;\n }", "title": "" }, { "docid": "b9a39d85f4f6f6d580e17055409efa81", "score": "0.54203427", "text": "function drawOthers()\n\t{\n\t\t_.each(that.data.nonLinks, function(item) {\n\t\t\tlastLink = that.add('text', {\n\t\t\t\ttext: item,\n\t\t\t\tcolor: style.refColor,\n\t\t\t\tfont: style.refFont\n\t\t\t}, {\n\t\t\t\twid: (lastLink ? lastLink : title),\n\t\t\t\tmy: 'top left',\n\t\t\t\tat: 'top right',\n\t\t\t\tofs: style.entryGap + ' 0'\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "53ab6e60cd4ab03cb109c92d40af67ff", "score": "0.5302792", "text": "function visitCells($nodes, postVisitor, findNextLevel){\t\t\t\n\t\t\t$nodes.each(function(){\n\t\t\t\titerate(jQuery(this));\n\t\t\t});\n\t\t\t\n\t\t\tfunction iterate($node){\t\t\t\t\t\n\t\t\t\tfindNextLevel($node).each(function(){\n\t\t\t\t\t\titerate(jQuery(this));\n\t\t\t\t\t});\n\t\t\t\tpostVisitor($node);\t\n\t\t\t}\t\t\t\n\t\t}", "title": "" }, { "docid": "bbdb7d25dfcf90b7da7a729ec58da380", "score": "0.5287371", "text": "function cells(node, index, parent) {\n var next = after(parent, index)\n return !next || element(next, tableCell)\n}", "title": "" }, { "docid": "adf309f455cc3b4b5547683ca543526a", "score": "0.5213435", "text": "function set_empty_icons() {\n $.each(grps.data.children, function(n_child_0, child_now_0) {\n $.each(child_now_0.children, function(n_child_1, child_now_1) {\n if (child_now_1.children.length === 0) {\n child_now_1.children.push({\n id: this_top.empty_icn_tag + unique(),\n trg_widg_id: '',\n title: '',\n n_icon: n_empty_icon,\n })\n }\n })\n })\n\n let rm_ind = 1\n while (is_def(rm_ind)) {\n rm_ind = null\n $.each(grps.data.children, function(n_child_0, child_now_0) {\n $.each(child_now_0.children, function(n_child_1, child_now_1) {\n $.each(child_now_1.children, function(n_child_2, child_now_2) {\n if (\n child_now_2.n_icon === n_empty_icon\n && child_now_1.children.length > 1\n ) {\n rm_ind = [ n_child_0, n_child_1, n_child_2 ]\n }\n })\n })\n })\n\n if (is_def(rm_ind)) {\n grps.data.children[rm_ind[0]]\n .children[rm_ind[1]].children.splice(rm_ind[2], 1)\n }\n }\n }", "title": "" }, { "docid": "8c4398f2d948beedb980e257114c1df1", "score": "0.5207475", "text": "function appendMore(element) {\n if(element == null || element == \"null\") {\n element = \"Redacted Link\";\n }\n temp += \"<div class='bigBoy'>\";\n temp += \"<a class='expand' href='\";\n temp += element;\n temp += \"' target='_blank'>\";\n temp += \"Read More\";\n temp += \"</a>\";\n temp += \"</div>\";\n}", "title": "" }, { "docid": "ea8266eeb5ec2e46c9d74428a53f618c", "score": "0.52026755", "text": "function expandEmptyNbrs(row, col, checkedCells) {\n\n\t// Bail if cell already tested ()\n\tif (checkedCells.includes(row + '-' + col)) return;\n\n\t// Add this cell to the list of checked cells\n\tcheckedCells.push(row + '-' + col)\n\n\t// Start checking the neighbors\n\tfor (var i = row - 1; i <= row + 1; i++) {\n\n\t\t// Check if the cell outside the board\n\t\tif (i < 0 || i >= gBoard.length) continue;\n\n\t\tfor (var j = col - 1; j <= col + 1; j++) {\n\n\t\t\t// Check if the cell outside the board\n\t\t\tif (j < 0 || j >= gBoard[0].length) continue;\n\n\t\t\t// Check if its not the cell itself\n\t\t\tif (i === row && j === col) continue;\n\n\t\t\t// Check if the cell is not a mine\n\t\t\tif (gBoard[i][j].isBomb) continue;\n\n\t\t\t// Check if the cell is not marked\n\t\t\tif (gBoard[i][j].isMarked) continue;\n\n\t\t\t// Mark cell as shown\n\t\t\tsetCellAsShown(i, j);\n\n\t\t\tif (isCellValidForNbrsCheck(i, j, checkedCells)) expandEmptyNbrs(i, j, checkedCells);\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "1898ccffb44620004510a1d6b82738cc", "score": "0.51654834", "text": "function buildHyperDOM() {\n\t$(\"#links > \").remove();\n\tfor (var i = 0; i < hyper.length; i++)\n\t\taddHyperDOM(i);\n}", "title": "" }, { "docid": "5c221d7aaca3db4155765442cb71a4bf", "score": "0.5145577", "text": "function rowsInitialize($a) {\n var $firstTR = findFirstDetailRowFromAnchor($a);\n var $currentNode = $firstTR.nextSibling;\n while (($currentNode.nodeName != '#comment') || ($currentNode.nodeValue != 'TEST_STEPS')) {\n if ($currentNode.nodeName == 'TR') {\n $a.innerHTML = '<img alt=\"minus\" src=\"minusb.jpg\">';\n $a.setAttribute('onclick', 'rowsHide(this)');\n }\n $currentNode = $currentNode.nextSibling;\n }\n}", "title": "" }, { "docid": "5f84909863b0d1669daaefe60b883e0e", "score": "0.5133781", "text": "function dropAllHyperlinksNonHTML() {\n\tinnerdropHyperlinks(reportContext.getReportRunnable().designHandle.getBody());\n}", "title": "" }, { "docid": "7fc453ae22dba021e15ede42cfe133a0", "score": "0.51323533", "text": "function hideLeafs()\r\n{\r\n var expr_find = basePath + '/tr[count(td)!=2]';\r\n var xpathResult = document.evaluate(expr_find, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0; i<xpathResult.snapshotLength; i++) {\r\n var nodeToHide = xpathResult.snapshotItem(i);\r\n nodeToHide.style.display='none';\r\n }\r\n}", "title": "" }, { "docid": "3d1dcf0aa304ce1ca816fdc58dee2141", "score": "0.51149666", "text": "uncover() {\n for (let columnNode of this.iterateColumn(true, true)) {\n for (let lineNode of columnNode.iterateRow(true, true)) {\n lineNode.up.down = lineNode;\n lineNode.down.up = lineNode;\n lineNode.header.size += 1;\n }\n }\n this.left.right = this;\n this.right.left = this;\n }", "title": "" }, { "docid": "b859c88df121ab3a66237ba9dda7f761", "score": "0.5091027", "text": "function main() {\r\n\r\n// insert links\r\nvar myTable = xpath(document, '//div[@id=\"messages\"]/descendant::table[@id=\"messages\"]');\r\nif (myTable.snapshotLength != 1) return;\r\nmyTable = myTable.snapshotItem(0);\r\n\r\n// var msgs = xpath(myTable, 'child::tbody/tr[contains(@class, \"entry\") and contains(@class, \"exMachinaParsed\")]');\r\nvar msgs = xpath(myTable, 'tbody/tr[contains(@class, \"entry\")]');\r\nif (msgs.snapshotLength == 0) msgs = xpath(document, '//div[@id=\"messages\"]/descendant::table[@id=\"messages\"]/tbody/tr[contains(@class, \"entry\")]');\r\nfor (var i = 0; i < msgs.snapshotLength; i++) {\r\n\tvar r = msgs.snapshotItem(i);\r\n\tr.cells[1].addEventListener(\"click\", function() { insertLinks (this); }, true);\r\n\tr.cells[2].addEventListener(\"click\", function() { insertLinks (this); }, true);\r\n\tr.cells[3].addEventListener(\"click\", function() { insertLinks (this); }, true);\r\n\tr.cells[5].addEventListener(\"click\", function() { insertLinks (this); }, true);\r\n}\r\n\r\n/*\r\n<tr>\t<td style=\"text-align: left;\" colspan=\"3\">\r\n\t\t<a href=\"?view=diplomacyAdvisor\">1</a>&nbsp;&nbsp;<a href=\"?view=diplomacyAdvisor&amp;start=10\">2</a>&nbsp;&nbsp;<a href=\"?view=diplomacyAdvisor&amp;start=20\">3</a>&nbsp;&nbsp;<a href=\"?view=diplomacyAdvisor&amp;start=30\">4</a>\r\n\t</td>\r\n\t<td colspan=\"3\" class=\"paginator\">\r\n\t\t<a href=\"?view=diplomacyAdvisor&amp;start=0\" title=\"...posledných 10\">...posledných 10</a>\r\n\t\t<a href=\"?view=diplomacyAdvisor&amp;start=0\" title=\"...posledných 10\"><img src=\"skin/img/resource/btn_min.gif\"></a>\r\n\t\t11 - 20\r\n\t\t<a href=\"?view=diplomacyAdvisor&amp;start=20\"><img src=\"skin/img/resource/btn_max.gif\"></a>\r\n\t\t<a href=\"?view=diplomacyAdvisor&amp;start=20\">ďalších 10...</a>\r\n\t</td>\r\n</tr>\r\n*/\r\n\r\n// insert buttons to jump\r\nmsgs = xpath(document, '//td[@class=\"selected\"]/a[@href=\"?view=diplomacyAdvisor\"]');\r\nif (msgs.snapshotLength == 1) {\r\n\t// find out total number of messages\r\n\tvar numPattern = /\\(\\d{1,}\\)/gi;\t\t\t\t// search for (xxx)\r\n\tvar msgsNum = msgs.snapshotItem(0).innerHTML.match(numPattern);\r\n\tif (msgsNum && (msgsNum.length == 1)) msgsNum = parseInt(msgsNum[0].substring(1, msgsNum[0].length-1));\r\n\telse msgsNum = 0;\r\n\r\n\tconst onePage = 10;\r\n\r\n\tmsgs = msgsNum % onePage;\t\t\t\t\t// number of messages on the last page\r\n\tvar pageNum = Math.floor(msgsNum/onePage);\t\t\t// number of pages\r\n\tif (msgs > 0) ++pageNum;\r\n\r\n\tvar myTD = xpath(myTable, 'descendant::td[@class=\"paginator\"]');\r\n\tif (myTD.snapshotLength != 1) {\t\t\t\t\t// no/many \"paginator\" row(s)\r\n\t\t// all messages on this page were deleted recently - skip to previous page\r\n\t\tif (pageNum > 1) window.location.href = \"?view=diplomacyAdvisor&start=\" + ((pageNum-1)*onePage).toString();\r\n\t\telse if (pageNum > 0) window.location.href = \"?view=diplomacyAdvisor\";\r\n\t\telse return;\r\n\t}\r\n\telse if (msgsNum > onePage) {\t\t\t\t\t// we found one \"paginator\" row\r\n\t\tconst numToShow = 25;\t\t\t\t\t// how many pages to show?\r\n\t\tconst halfToShow = Math.floor(numToShow / 2);\r\n\r\n\t\tmyTD = myTD.snapshotItem(0);\r\n\t\tvar myTR = myTD.parentNode;\r\n\r\n\t\t// get START parameter\r\n\t\tvar actPage = paramValue(\"START\", window.location.href.toUpperCase());\r\n\t\tif (actPage != \"\") actPage = Math.floor(parseInt(actPage))/10 + 1;\r\n\t\telse {\t\t\t\t\t\t\t// no START parameter, e.g. after deleting of message\r\n\t\t\tactPage = 1;\r\n\t\t\tnumPattern = /\\d{1,} \\-/gi;\t\t\t// search for \"xxx -\"\r\n\t\t\tvar myTXT = xpath(myTD, 'child::text()');\r\n\t\t\tfor (var i = 0; i < myTXT.snapshotLength; i++) {\r\n\t\t\t\tvar currPage = trimStr(myTXT.snapshotItem(i).data);\r\n\t\t\t\tif (currPage != \"\") {\r\n\t\t\t\t\tcurrPage = currPage.match(numPattern);\r\n\t\t\t\t\tif (currPage && (currPage.length == 1)) {\r\n\t\t\t\t\t\tactPage = Math.floor(parseInt(currPage[0].replace(\" -\", \"\")) / onePage) + 1;\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}\r\n\r\n\t\tmyTR.deleteCell(0);\t\t\t\t\t// remove old cell\r\n\t\tmyTD = myTR.insertCell(0);\t\t\t\t// and insert the new one\r\n\t\tmyTD.style.textAlign = \"left\";\r\n\t\tmyTD.colSpan = 6;\r\n\r\n\t\t// button for moving to beginning\r\n\t\tif (actPage > 1) myTD.innerHTML = '<a href=\"?view=diplomacyAdvisor&amp;start=' + ((actPage-2)*onePage) + '\"><img src=\"skin/img/resource/btn_min.gif\"></a>&nbsp;&nbsp;&nbsp;';\r\n\t\telse myTD.innerHTML = '<img style=\"visibility: hidden\" src=\"skin/img/resource/btn_min.gif\">&nbsp;&nbsp;&nbsp;';\r\n\r\n\t\t// first page\r\n\t\tif (actPage == 1) myTD.innerHTML += '<a href=\"?view=diplomacyAdvisor\"><strong>1</strong</a>';\r\n\t\telse myTD.innerHTML += '<a href=\"?view=diplomacyAdvisor\">1</a>';\r\n\r\n\t\tvar firstToShow = 2;\r\n\t\tvar lastToShow = numToShow + 4;\r\n\t\tif (pageNum > (numToShow+4)) {\r\n\t\t\tlastToShow = actPage + halfToShow;\r\n\t\t\tif (lastToShow < (numToShow+2)) lastToShow = numToShow + 2;\r\n\t\t\tif (lastToShow > (pageNum-3)) {\r\n\t\t\t\tlastToShow = pageNum;\r\n\t\t\t\tfirstToShow = pageNum - numToShow - 1;\r\n\t\t\t}\r\n\t\t\telse firstToShow = actPage - halfToShow;\r\n\r\n\t\t\tif (firstToShow > 3) myTD.innerHTML += '&nbsp;&nbsp;..';\r\n\t\t\telse firstToShow = 2;\r\n\t\t}\r\n\t\telse if (lastToShow > pageNum) lastToShow = pageNum;\r\n\r\n\t\tfor (var i = firstToShow; i <= lastToShow; ++i) {\r\n\t\t\tif (actPage == i) myTD.innerHTML += '&nbsp;&nbsp;<a href=\"?view=diplomacyAdvisor&amp;start=' + ((i-1)*onePage) + '\"><strong>' + i + '</strong></a>';\r\n\t\t\telse myTD.innerHTML += '&nbsp;&nbsp;<a href=\"?view=diplomacyAdvisor&amp;start=' + ((i-1)*onePage) + '\">' + i + '</a>';\r\n\t\t}\r\n\r\n\t\tif (lastToShow < (pageNum-2)) {\r\n\t\t\tmyTD.innerHTML += '&nbsp;&nbsp;..&nbsp;&nbsp;<a href=\"?view=diplomacyAdvisor&amp;start=' + ((pageNum-1)*onePage) + '\">' + pageNum + '</a>';\r\n\t\t}\r\n\r\n\t\t// button for moving to end\r\n\t\tif (actPage < pageNum) myTD.innerHTML += '&nbsp;&nbsp;&nbsp;<a href=\"?view=diplomacyAdvisor&amp;start=' + (actPage*onePage) + '\"><img src=\"skin/img/resource/btn_max.gif\"></a>';\r\n\t\telse myTD.innerHTML += '&nbsp;&nbsp;&nbsp;<img style=\"visibility: hidden\" src=\"skin/img/resource/btn_max.gif\">';\r\n\t}\r\n}\r\nelse {\r\n\tmsgs = xpath(document, '//ul[@class=\"error\"]');\t\t\t// <ul class=\"error\"> - most probably disallowed activity (don't use \"go back\")\r\n\tif (msgs.snapshotLength == 1) window.location.href = \"?view=diplomacyAdvisor\";\r\n}\r\n\r\n} // DO NOT TOUCH!! -> function main() {", "title": "" }, { "docid": "4011d006be44d67f3c897fa334cccd4b", "score": "0.50741804", "text": "function testInfoLinkUnFormatter(cellvalue, options, rowObject) {\n return;\n}", "title": "" }, { "docid": "f5e2093fd8f69bfdead892725701a0bf", "score": "0.50563157", "text": "function emptygroups_off() \n{\n var groups = $(\".comp_grouphead\");\n for (k = 0; k < (groups.size() - 1); k++) {\n var current = $(groups[k]);\n var next = current.next(); //\n //alert(current.text() + \"-\" + next.text() + \">\" + next.is(\":visible\"));\n if (!next.is(\":visible\")) //if next is not visible hidde me\n {\n current.hide(); //is possible add class for tag element\n current.addClass(\"comp_gh\");\n }\n }\n}", "title": "" }, { "docid": "5e76986add63c0a761c02201e7e8def7", "score": "0.50532544", "text": "link(cell){\n if (cell == null ||cell == undefined ) return ;\n if (this.linked(cell)) return ;\n this.linkIds.push(cell.id) ;\n this.links[cell.tag] = cell ;\n cell.link(this) ;\n }", "title": "" }, { "docid": "2adac058738d2cbdf96990a15294b55d", "score": "0.5048407", "text": "function quickLinks(){\r\n\t\tvar menu = find(\"//td[@class='menu']\", XPFirst);\r\n for (var j = 0; j < 2; j++) for (var i = 0; i < menu.childNodes.length; i++) if (menu.childNodes[i].nodeName == 'BR') removeElement(menu.childNodes[i]);\r\n\t\tmenu.innerHTML += '<hr/>';\r\n\t\tmenu.innerHTML += '<a href=\"allianz.php\">' + T('ALIANZA') + '</a>';\r\n\t\tmenu.innerHTML += '<a href=\"a2b.php\">' + T('TROPAS') + '</a>';\r\n\t\tmenu.innerHTML += '<a href=\"warsim.php\">' + T('SIM') + '</a>';\r\n\t\tmenu.innerHTML += '<a href=\"spieler.php?s=1\">' + T('PERFIL') + '</a>';\r\n\t\tmenu.innerHTML += '<hr/>';\r\n\t\tmenu.innerHTML += '<a href=\"http://trcomp.sourceforge.net/?lang=' + idioma + '\" target=\"_blank\">' + T('COMP') + '</a>';\r\n//\t\tmenu.innerHTML += '<a href=\"http://www.denibol.com/~victor/travian_calc/\" target=\"_blank\">' + T('CALC') + '</a>';\r\n\t\tmenu.innerHTML += '<a href=\"http://www.denibol.com/proyectos/travian_beyond/\" target=\"_blank\">Travian Beyond</a>';\r\n\t}", "title": "" }, { "docid": "70aa0923a74f749d6113f480aec8193c", "score": "0.50228065", "text": "function wrapCrumbs(){\n //Drill Up Breadcrumbs\n $('#drillTrack li').on('click', function(){\n var children = $('#drillTrack li').length;\n var i;\n if($(this).attr(\"id\")==='museumCrumb'){\n i=1;\n $('#exhibitContainer').html(\"\");\n reload=true;\n $('#museums').show();\n $('#subTitle').text(\"Select Museum\");\n }\n else if($(this).attr(\"id\")==='exhibitCrumb'){\n i=2;\n dataType = 'exhibit';\n updateTable(false);\n }\n for(i; i<children; i++){\n $('#drillTrack li').remove(':last-child');\n }\n });\n }", "title": "" }, { "docid": "9af6b6359becb4c3f92d5904fd473034", "score": "0.50006205", "text": "function makeMenuExpandable() { 'use strict';\n var tocs = document.getElementsByClassName('toc');\n for (var i = 0; i < tocs.length; i++) {\n var links = tocs[i].getElementsByTagName('a');\n for (var ii = 0; ii < links.length; ii++) {\n if (links[ii].nextSibling) {\n var expand = document.createElement('span');\n expand.classList.add('toctree-expand');\n expand.addEventListener('click', toggleCurrent, true);\n links[ii].prepend(expand);\n }\n }\n }\n}", "title": "" }, { "docid": "da60fc947efd189bfa701ff7887ee8be", "score": "0.49983856", "text": "function applyRules(row, col, emptyThreshold) {\n let numNeighbors = countAllNeighbors(row, col);\n if (isAlive(row, col) && numNeighbors >= emptyThreshold) {\n nextGrid[row][col] = 'L';\n } else if (grid[row][col] === 'L' && numNeighbors === 0) {\n nextGrid[row][col] = '#';\n }\n }", "title": "" }, { "docid": "6de00b5b94d674185af765dc54f0e304", "score": "0.49974602", "text": "function buildNavListFromTableCells(cells, list){\n\t\t\t\t\t// for each cell\n\t\t\t\t\tcells.each(function(i){\n\n\t\t\t\t\t\t\t\t// using the content of the cell, determine the state of the page control\n\t\t\t\t\t\tvar a = $(this).children(\"a\"),\n\t\t\t\t\t\t\t\td = $(this).children(\"div\"),\n\t\t\t\t\t\t\t\timg = $(this).find(\"img\"),\n\t\t\t\t\t\t\t\talt = img.attr(\"alt\"),\n\n\t\t\t\t\t\t\t\t// create a list item and a link\n\t\t\t\t\t\t\t\tli = $(\"<li class='page-item'></li>\"),\n\t\t\t\t\t\t\t\tlink = $(\"<a class='page-link'></a>\"),\n\t\t\t\t\t\t\t\tstring = \"\";\n\n\t\t\t\t\t\t// handle the first, prev, next and last pages\n\t\t\t\t\t\t\t\t if(alt == \"Scroll to the top\")\t\t\tlink.append(\"First\");\t\t// first page\n\t\t\t\t\t\telse if(alt == \"Scroll up one page\") \t\tlink.append(\"&laquo;\");\t// prev page\n\t\t\t\t\t\telse if(alt == \"Scroll down one page\")\tlink.append(\"&raquo;\");\t// next page\n\t\t\t\t\t\telse if(alt == \"Scroll to the bottom\")\tlink.append(\"Last\");\t\t// last page\n\t\t\t\t\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t\tstring = a.text() || d.text();\t// all the numbers inbetween\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(string) link.text(string);\n\n\t\t\t\t\t\t// add the link to the list item\n\t\t\t\t\t\tli.append(link);\n\t\t\t\n\t\t\t\t\t\tif(!a.length) a = false;\n\t\t\t\t\t\tif(!d.length) d = false;\n\t\t\t\n\t\t\t\t\t\t// if there's no link or div, disable the cell\n\t\t\t\t\t\tif(!a && !d) li.addClass(\"disabled\");\n\t\t\t\t\t\t// if there's no link but there is a div, it's the active cell\n\t\t\t\t\t\tif(!a && d)\t li.addClass(\"active\");\n\n\t\t\t\t\t\t// copy the href from the existing anchor\n\t\t\t\t\t\tif(a) link.attr(\"href\", a.attr(\"href\"));\n\n\t\t\t\t\t\t// if this cell had any content, add the list item to the list\n\t\t\t\t\t\tif(a || d || alt) list.append(li);\n\t\t\t\t\t});\n\n\t\t\t\t\treturn list;\n\t\t\t\t}", "title": "" }, { "docid": "cdfcdb7ba867f50a551bf4bd7f737beb", "score": "0.49968177", "text": "function render_cell(outer, defer) {\n // parse markdown\n var text = outer.attr(\"base-text\");\n var html = marktwo.parse(text);\n\n // insert intermediate\n var box = $(html);\n outer.empty();\n outer.append(box);\n\n // ellone render\n ellone.apply_render(box, defer);\n\n // post-render\n box.find(\"a.internal\").each(function() {\n var link = $(this);\n var href = link.attr(\"href\");\n link.removeClass(\"internal\");\n link.addClass(\"card\");\n send_command(\"card\", {\"link\": href});\n });\n}", "title": "" }, { "docid": "dd0a111b5298d7a36267aab93c2ea897", "score": "0.49951756", "text": "static renderParentLinksNaive() {\n for (const [, personsInGeneration] of NacartaChart.generations)\n for (const person of personsInGeneration) {\n if (person.father) {\n NacartaChart.drawPath(jQuery(`#box-${person.father.id}`), jQuery(`#box-${person.id}`));\n }\n if (person.mother) {\n NacartaChart.drawPath(jQuery(`#box-${person.mother.id}`), jQuery(`#box-${person.id}`));\n }\n }\n }", "title": "" }, { "docid": "d9cc43eed62d8ac00dab164ce42eb910", "score": "0.49578145", "text": "function toggleNegsContent(elCell, cellI, cellJ, reveal) {\r\n var SIZE = gLevel.SIZE;\r\n for (var i = cellI - 1; i <= cellI + 1; i++) {\r\n if (i < 0 || i >= SIZE) continue\r\n for (var j = cellJ - 1; j <= cellJ + 1; j++) {\r\n if (j < 0 || j >= SIZE) continue\r\n var cell = gBoard[i][j]\r\n var elCell = document.querySelector(`.cell-${i}-${j}`);\r\n var exposeCell = cell.isShown ? false : true; // only show cell if it is hidden in the hint/safe click\r\n toggleCellContent(cell, elCell, reveal, exposeCell);\r\n }\r\n }\r\n\r\n}", "title": "" }, { "docid": "729f24f8cd387aa8531b375fee5b9534", "score": "0.49519747", "text": "function openAllMarked() {\n while(0 <= markedCount) {\n markedCount--; // Decrement first, in case a matrix is to be open\n with(markedArray[markedCount + 1]) {\n openCell(x,y);\n }\n }\n}", "title": "" }, { "docid": "5abe9e1525436ac2dde3ea17f38cf534", "score": "0.49489573", "text": "function fixRelatedInformation() {\n\t$(\".EXLDetailsContent li:matchField(Related Information)\").each(function() {\n\t\tvar totalItems = $(this).find(\"span\").length;\n\t\tvar totalLinks = $(this).find(\"span a\").length;\n\t\tif (totalItems / totalLinks == 2) {\n\t\t\tfor (var i = 0; i < totalLinks; i++) {\n\t\t\t\t$(this).find(\"span:eq(\" + (totalLinks) + \") a\").text($(this).find(\"span:eq(0)\").text());\n\t\t\t\t$(this).find(\"span:eq(0)\").remove();\n\t\t\t}\n\t\t\t$(this).find(\"br:lt(\" + totalLinks + \")\").remove();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6718b63f75e5c0fe0433f466b0f4f964", "score": "0.49112612", "text": "extendCell(cell) {\n\t\t\n\t}", "title": "" }, { "docid": "6718b63f75e5c0fe0433f466b0f4f964", "score": "0.49112612", "text": "extendCell(cell) {\n\t\t\n\t}", "title": "" }, { "docid": "f9b8b679ba311f163f4c6d9d5d52a785", "score": "0.49076444", "text": "function createTileLinkSections() {\n\n // Exception makes the rule\n if($(document.body).hasClass(\"section-archive\")) {\n return;\n }\n\n applyTileLinks(\".portletItem, .portletFooter, .tileItem\");\n }", "title": "" }, { "docid": "f2e89e9143359daf1f1ee183c9335d0b", "score": "0.49030128", "text": "function ncsuA11yToolAddInternalLinksNotes(fr) {\n fr.find('[href^=\"#\"][href!=\"#\"]').each(function() {\n jQuery(this).addClass('internal-link-highlight')\n jQuery(this).parent().prepend(\"<p class='internal-link-highlight-note'>Internal Link Source: \" + jQuery(this).text() + \"</p>\")\n var missingTabIndex = false;\n if (jQuery(jQuery(this).attr(\"href\") + ',[name=\"' + jQuery(this).attr('href').substring(1, jQuery('[href^=\"#\"][href!=\"#\"]').attr('href').length) + '\"]').attr('tabindex') === undefined) {\n missingTabIndex = true;\n } else {\n missingTabIndex = false;\n }\n\n jQuery(jQuery(this).attr(\"href\") + ',[name=\"' + jQuery(this).attr('href').substring(1, jQuery('[href^=\"#\"][href!=\"#\"]').attr('href').length) + '\"]').prepend(\"<p class='internal-link-highlight-note'>Internal Link Target\" + (missingTabIndex ? ' (missing tabindex)' : '') + \": \" + jQuery(this).text() + \"</p>\")\n\n //jQuery(jQuery(this).attr(\"href\")).prepend(\"<p class='internal-link-highlight-note'>Internal Link Target: \" + jQuery(this).text() + \"</p>\")\n });\n}", "title": "" }, { "docid": "6a2ba56b02ed3177e73926915e0a6f9a", "score": "0.48887727", "text": "function innerdropHyperlinks(/*SlotHandle*/ slotHandle) {\n\ttry {\n\t\t\n\t// search into the slot content for the element corresponding to an 'actionable' element\n\tvar content = slotHandle.getContents();\n\tvar iterator = content.iterator();\n\twhile(iterator.hasNext()) {\n\t\tvar elementHandle = iterator.next();\n\n\t\tif(elementHandle.getActionHandle != null) {\n\t\t\tif(elementHandle.getOnRender() == null) {\n\t\t\t\t// remove hyperlink when rendering on other formats than HTML\n\t\t\t\telementHandle.setOnRender(\"if(reportContext.getOutputFormat() != 'html') this.action = null;\");\n\t\t\t}\n\t\t\t\n\t\t\tvar actionHandle = elementHandle.getActionHandle();\n\t\t\tif(actionHandle!=null) {\n\t\t\t\tif(actionHandle.getLinkType().equals('drill-through')) {\n\t\t\t\t\t// add a parameter __showtitle=false in drillthrough hyperlinks\n\n\t\t\t\t\tvar iterator = actionHandle.paramBindingsIterator();\n\t\t\t\t\tvar already = false;\n\t\t\t\t\twhile(iterator.hasNext()) {\n\t\t\t\t\t\tvar paramBindingHandle = iterator.next();\n\t\t\t\t\t\tvar paramName = paramBindingHandle.getParamName();\n\t\t\t\t\t\tif(paramName.equals('__showtitle')) {\n\t\t\t\t\t\t\talready = true;\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(!already) {\n\t\t\t\t\t\tvar paramBinding = new Packages.org.eclipse.birt.report.model.api.elements.structures.ParamBinding();\n\t\t\t\t\t\tparamBinding.setParamName('__showtitle');\n\t\t\t\t\t\tvar list = new Packages.java.util.ArrayList();\n\t\t\t\t\t\tlist.add('false');\n\t\t\t\t\t\tparamBinding.setExpression(list);\n\t\t\t\t\t\tactionHandle.addParamBinding(paramBinding);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(elementHandle.getDefn().getSlotCount != null) {\n\t\t\tvar elementSlotCount = elementHandle.getDefn().getSlotCount();\n\t\t\tfor (var i = 0; i < elementSlotCount ; i++) {\n\t\t\t\tinnerdropHyperlinks(elementHandle.getSlot(i));\n\t\t\t}\n\t\t}\n\t}\n\t\n\t}catch(e) {\n\t\tlogToDebugWindow(\"innerdropHyperlinks Exception : \"+e);\n\t}\n}", "title": "" }, { "docid": "7af67ef30d670b59d029b85e2ce3e895", "score": "0.4884902", "text": "function expandShown(board, cellI, cellJ) {\r\n for (var i = cellI - 1; i <= cellI + 1; i++) {\r\n if (i < 0 || i >= board.length) continue;\r\n for (var j = cellJ - 1; j <= cellJ + 1; j++) {\r\n if (j < 0 || j >= board[i].length) continue;\r\n if (i === cellI && j === cellJ) continue;\r\n var el = document.querySelector('#' + getIdName({ i: i, j: j }));\r\n if (!board[i][j].isShown) {\r\n if (!board[i][j].minesAroundCount) {\r\n board[i][j].isShown = true\r\n expandShown(gBoard, i, j)\r\n }\r\n openCell(el);\r\n }\r\n board[i][j].isShown = true\r\n }\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "3f54e1e5e64dd3e6e66d5043382b8185", "score": "0.4869455", "text": "function cvjs_clearDrawingHyperlinks()\n{\n\n//console.log(\"clear drawings hyperlinks\");\n\n\tfor (room in vqURLs)\n\t{\n\t\ttry\n\t\t {\n//\t\t\tconsole.log(\"room \"+room+\" lastObjHyperlink[cvjs_active_floorplan_div_nr] \"+lastObjHyperlink[cvjs_active_floorplan_div_nr]+\" popObjHyperlink[cvjs_active_floorplan_div_nr] \"+ popObjHyperlink[cvjs_active_floorplan_div_nr]);\n\n\t\t\t\tif (room != lastObjHyperlink[cvjs_active_floorplan_div_nr] || room != popObjHyperlink[cvjs_active_floorplan_div_nr]){\n\t\t\t\t\tjQuery(vqURLs[room].node).qtip('hide');\n\t\t\t\t}\n// changed so all hyperlinks objects are cleared\n\n\n\t///\t\t\t\t vqRooms[cvjs_active_floorplan_div_nr][room].attr(defaultColor); // 2015-02-01 - moved into conditional statement\n\t\t\t\tif (!cvjs_supressHyperlinkColors){\n\t\t\t\t\tvqURLs[room].attr(defaultColor_Hyperlinks);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tvqURLs[room].attr(defaultColor_Hyperlinks_blank); // set colors ( note: change attribute name to something more applicable\n\t\t\t\t}\n\n\n\t\t }\n\t\tcatch(err)\n\t\t {\n\t\t //Handle errors here\n\t\t }\n\t }\n}", "title": "" }, { "docid": "713a371a51d08e9056ee3078b4e9d6c2", "score": "0.48693317", "text": "rebuild(){\n\t\tif(!this.links[this._active]) return;\n\t\t\n\t\t/** Drop each link */\n\t\tconst el = this.el;\n\t\twhile(el.firstChild)\n\t\t\tel.removeChild(el.firstChild);\n\t\t\n\t\t\n\t\tconst left = this._active - this.activeLength;\n\t\tconst right = this._active + this.activeLength;\n\t\tconst end = this._length - this.endLength;\n\t\tconst children = [];\n\t\t\n\t\t/** Reattach leading range */\n\t\tfor(let i = 0; i < this.startLength; ++i)\n\t\t\tchildren.push(el.appendChild(this.links[i]));\n\t\t\n\t\t\n\t\t/** Should we display a truncation indicator? */\n\t\tif(left > this.startLength)\n\t\t\tel.appendChild(this.leftClip);\n\t\t\n\t\t\n\t\t/** Display the active range */\n\t\tfor(let i = Math.max(this.startLength, left); i <= Math.min(this._length - 1, right); ++i)\n\t\t\tchildren.push(el.appendChild(this.links[i]));\n\t\t\n\t\t\n\t\t/** Check if we should display a truncation indicator for the right-side too */\n\t\tif(right < end)\n\t\t\tel.appendChild(this.rightClip);\n\t\t\n\t\t\n\t\t/** Reattach trailing range */\n\t\tfor(let i = end; i < this._length; ++i)\n\t\t\tchildren.push(el.appendChild(this.links[i]));\n\t\t\n\t\t/** Run through each node that was added and check their classes list */\n\t\tfor(let i = 0, l = children.length; i < l; ++i){\n\t\t\tlet elIndex = +children[i].getAttribute(\"data-index\");\n\t\t\tchildren[i].classList[elIndex === this._active ? \"add\" : \"remove\"](this.activeClass);\n\t\t}\n\t}", "title": "" }, { "docid": "66d993240e0283676f1ffc269c092fbe", "score": "0.48602635", "text": "function datalayerPushHTML(push,index,eachIndex){\n var therow = '<li class=\"eventbreak submenu dlnum'+index+' datalayer\"></li>\\n' + '<li class=\"event submenu dlnum'+index+' datalayer\">'+(dataslayer.options.showArrayIndices&&eachIndex!==undefined?'<span class=\"arrayIndex\">'+eachIndex+'</span>':'')+'<table cols=2>';\n $.each(push,function(k1,x){ //iterate each individual up to 5 levels of keys-- clean this up later\n if(typeof x == 'object'){\n var level1Id = k1.replace(' ','-')+'-'+Math.ceil(Math.random()*10000000);\n therow = therow + '\\n' + '<tr class=\"object-row\" id=\"'+level1Id+'\"><td><em><a href=\"#\" title=\"shift-click to expand all\" data-id=\"'+level1Id+'\">'+(dataslayer.options.collapseNested?'+':'-')+'</a></em><b>'+k1+'</b></td><td><span>'+(x===null?'<i>null</i>':'<i>object</i>')+'</span></td></tr>';\n for (var k2 in x){\n if(typeof x[k2] == 'object'){\n var level2Id = (k1+k2).replace(' ','-')+'-'+Math.ceil(Math.random()*10000000);\n therow = therow + '\\n' + '<tr'+(dataslayer.options.collapseNested?' style=\"display: none;\"':'')+' class=\"object-row child-of-'+level1Id+'\" id=\"'+level2Id+'\"><td><em><a href=\"#\" title=\"shift-click to expand all\" data-id=\"'+level2Id+'\">'+(dataslayer.options.collapseNested?'+':'-')+'</a></em><b>'+addSpaces(k1)+'.'+k2+'</b></td><td><span>'+(x[k2]===null?'<i>null</i>':'<i>object</i>')+'</span></td></tr>';\n for (var k3 in x[k2]) {\n if (typeof x[k2][k3] == 'object'){\n var level3Id = (k1+k2+k3).replace(' ','-')+'-'+Math.ceil(Math.random()*10000000);\n therow = therow + '\\n' + '<tr'+(dataslayer.options.collapseNested?' style=\"display: none;\"':'')+' class=\"object-row child-of-'+level2Id+' child-of-'+level1Id+'\" id=\"'+level3Id+'\"><td><em><a href=\"#\" title=\"shift-click to expand all\" data-id=\"'+level3Id+'\">'+(dataslayer.options.collapseNested?'+':'-')+'</a></em><b>'+addSpaces(k1)+'&nbsp;'+addSpaces(k2)+'.'+k3+'</b></td><td><span>'+(x[k2][k3]===null?'<i>null</i>':'<i>object</i>')+'</span></td></tr>';\n for (var k4 in x[k2][k3]){\n if (typeof x[k2][k3][k4] == 'object'){\n var level4Id = (k1+k2+k3+k4).replace(' ','-')+'-'+Math.ceil(Math.random()*10000000);\n therow = therow + '\\n' + '<tr'+(dataslayer.options.collapseNested?' style=\"display: none;\"':'')+' class=\"object-row child-of-'+level3Id+' child-of-'+level2Id+' child-of-'+level1Id+'\" id=\"'+level4Id+'\"><td><em><a href=\"#\" title=\"shift-click to expand all\" data-id=\"'+level4Id+'\">'+(dataslayer.options.collapseNested?'+':'-')+'</a></em><b>'+addSpaces(k1)+'&nbsp;'+addSpaces(k2)+'&nbsp;'+addSpaces(k3)+'.'+k4+'</b></td><td><span>'+(x[k2][k3][k4]===null?'<i>null</i>':'<i>object</i>')+'</span></td></tr>';\n for (var k5 in x[k2][k3][k4]){\n if (!(dataslayer.options.hideEmpty&&(x[k2][k3][k4][k5]==='')))\n therow = therow + '\\n' + '<tr'+(dataslayer.options.collapseNested?' style=\"display: none;\"':'')+' class=\"child-of-'+level4Id+' child-of-'+level3Id+' child-of-'+level2Id+' child-of-'+level1Id+'\"><td><b>'+addSpaces(k1)+'&nbsp;'+addSpaces(k2)+'&nbsp;'+addSpaces(k3)+'&nbsp;'+addSpaces(k4)+'.'+k5+'</b></td><td><span>'+x[k2][k3][k4][k5]+'</span></td></tr>'; \n }\n }\n else if (!(dataslayer.options.hideEmpty&&(x[k2][k3][k4]==='')))\n therow = therow + '\\n' + '<tr'+(dataslayer.options.collapseNested?' style=\"display: none;\"':'')+' class=\"child-of-'+level3Id+' child-of-'+level2Id+' child-of-'+level1Id+'\"><td><b>'+addSpaces(k1)+'&nbsp;'+addSpaces(k2)+'&nbsp;'+addSpaces(k3)+'.'+k4+'</b></td><td><span>'+x[k2][k3][k4]+'</span></td></tr>'; \n }\n }\n else if (!(dataslayer.options.hideEmpty&&(x[k2][k3]==='')))\n therow = therow + '\\n' + '<tr'+(dataslayer.options.collapseNested?' style=\"display: none;\"':'')+' class=\"child-of-'+level2Id+' child-of-'+level1Id+'\"><td><b>'+addSpaces(k1)+'&nbsp;'+addSpaces(k2)+'.'+k3+'</b></td><td><span>'+x[k2][k3]+'</span></td></tr>';\n }\n }\n else if (!(dataslayer.options.hideEmpty&&(x[k2]==='')))\n therow = therow + '\\n' + '<tr'+(dataslayer.options.collapseNested?' style=\"display: none;\"':'')+' class=\"child-of-'+level1Id+'\"><td><b>'+addSpaces(k1)+'.'+k2+'</b></td><td><span>'+x[k2]+'</span></td></tr>';\n } \n }\n else if (!(dataslayer.options.hideEmpty&&(x==='')))\n therow = therow + '\\n' + '<tr><td><b>'+k1+'</b></td><td><span>'+x+'</span></td></tr>';\n }\n );\n therow = therow + '</table></li>';\n return therow;\n}", "title": "" }, { "docid": "8473b303c2a827c6ad69fb9359096d0c", "score": "0.48595807", "text": "function RP_twoColsHTML(objArr, ariaLabel) {\n var html = '<div class=\"twoCols\">';\n var twoCols = ['<div>','<div>'];\n var count = 1;\n $j.each(objArr, function(i, n) {\n count++;\n var hrefContent = RP_getHrefPath(i, n);\n var linkId = 'link'+ n.label.replace(/\\s+/g,\"\");\n twoCols[count % 2] += '<div class=\"RP_link\"><a id=\"'+linkId+'\" aria-labelledby=\"furtherResearch '+ ariaLabel +' '+linkId+' showInNewWindow\" href=\"' + hrefContent + '\">' + n.label + '</a></div>';\n });\n return html + twoCols.join('</div>') + '</div></div>';\n}", "title": "" }, { "docid": "238fd88f3a06073b2c8d2980f27af12e", "score": "0.4839668", "text": "function blockLevelLinksFix() {\n\t\tvar articleCarousel = jQuery('#article-carousel');\n\t\tvar liTags = articleCarousel.find('li');\n\t\tliTags.each(function() {\n\t\t\tvar liTag = jQuery(this);\n\t\t\tvar headLine = liTag.find('h1');\n\t\t\tvar headlineText = headLine.text();\n\t\t\theadLine = headLine.text('headlineText').remove();\n\t\t\tvar imgTag = liTag.find('img').unwrap().remove();\n\t\t\tvar pTag = liTag.find('p').remove();\n\t\t\tvar article = liTag.find('a > article');\n\t\t\tarticle.append(headLine).append(imgTag).append(pTag);\n\t\t});\n\t}", "title": "" }, { "docid": "f3c5dc710751da2934493173c4f6c674", "score": "0.48297837", "text": "function initOverflows() {\n $(\".natMainContents\").find(\".foswikiTable\")\n .not($(\".foswikiTable .foswikiTable\", this))\n .wrap(\"<div class='overflow foswikiTableOverflow'></div>\");\n }", "title": "" }, { "docid": "dc9b3ee5a590732245082bc6dd4dbee6", "score": "0.4826077", "text": "function walk2(n) {\n\tfor(var i = 0; i < n.children.length; i++) {\n\t\tif(n.children[i].nodeType == 1) {\n\t\t\tif(n.children[i].offsetHeight == 0)\n\t\t\t\tcontinue;\n\t\t\tif(n.children[i].tagName == 'A') {\n\t\t\t\tn.anchorText += n.children[i].innerText.length;\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\twalk2(n.children[i]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "50adce171a562ab2a149b8ed443ef070", "score": "0.48210683", "text": "pushDown(workbook, sheet, tables, currentRow, numRows) {\n var self = this;\n\n var mergeCells = sheet.find(\"mergeCells\");\n\n // Update merged cells below this row\n sheet.findall(\"mergeCells/mergeCell\").forEach(function (mergeCell) {\n var mergeRange = self.splitRange(mergeCell.attrib.ref), mergeStart = self.splitRef(mergeRange.start), mergeEnd = self.splitRef(mergeRange.end);\n\n if (mergeStart.row > currentRow) {\n mergeStart.row += numRows;\n mergeEnd.row += numRows;\n\n mergeCell.attrib.ref = self.joinRange({\n start: self.joinRef(mergeStart),\n end: self.joinRef(mergeEnd),\n });\n\n }\n\n\n //add new merge cell\n if (mergeStart.row == currentRow) {\n for (var i = 1; i <= numRows; i++) {\n var newMergeCell = self.cloneElement(mergeCell);\n mergeStart.row += 1;\n mergeEnd.row += 1;\n newMergeCell.attrib.ref = self.joinRange({\n start: self.joinRef(mergeStart),\n end: self.joinRef(mergeEnd)\n });\n mergeCells.attrib.count += 1;\n mergeCells._children.push(newMergeCell);\n }\n }\n });\n\n // Update named tables below this row\n tables.forEach(function (table) {\n var tableRoot = table.root, tableRange = self.splitRange(tableRoot.attrib.ref), tableStart = self.splitRef(tableRange.start), tableEnd = self.splitRef(tableRange.end);\n\n\n if (tableStart.row > currentRow) {\n tableStart.row += numRows;\n tableEnd.row += numRows;\n\n tableRoot.attrib.ref = self.joinRange({\n start: self.joinRef(tableStart),\n end: self.joinRef(tableEnd),\n });\n\n var autoFilter = tableRoot.find(\"autoFilter\");\n if (autoFilter !== null) {\n // XXX: This is a simplification that may stomp on some configurations\n autoFilter.attrib.ref = tableRoot.attrib.ref;\n }\n }\n });\n\n // Named cells/ranges\n workbook.findall(\"definedNames/definedName\").forEach(function (name) {\n var ref = name.text;\n if (self.isRange(ref)) {\n var namedRange = self.splitRange(ref), //TODO : I think is there a bug, the ref is equal to [sheetName]![startRange]:[endRange]\n namedStart = self.splitRef(namedRange.start), // here, namedRange.start is [sheetName]![startRange] ?\n namedEnd = self.splitRef(namedRange.end);\n if (namedStart) {\n if (namedStart.row > currentRow) {\n namedStart.row += numRows;\n namedEnd.row += numRows;\n\n name.text = self.joinRange({\n start: self.joinRef(namedStart),\n end: self.joinRef(namedEnd),\n });\n\n }\n }\n if (self.option && self.option.pushDownPageBreakOnTableSubstitution) {\n if (self.sheet.name == name.text.split(\"!\")[0].replace(/'/gi, \"\") && namedEnd) {\n if (namedEnd.row > currentRow) {\n namedEnd.row += numRows;\n name.text = self.joinRange({\n start: self.joinRef(namedStart),\n end: self.joinRef(namedEnd),\n });\n }\n }\n }\n } else {\n var namedRef = self.splitRef(ref);\n\n if (namedRef.row > currentRow) {\n namedRef.row += numRows;\n name.text = self.joinRef(namedRef);\n }\n }\n\n });\n }", "title": "" }, { "docid": "d3ca06d10b7b522b3cd4e4a8f6a05c69", "score": "0.4813194", "text": "function expandShow(row, col) {\r\n for (var i = row - 1; i <= (row + 1); i++) {\r\n if (i < 0 || i >= gBoard.length) continue;\r\n for (var j = col - 1; j <= (col + 1); j++) {\r\n if (j < 0 || j >= gBoard[i].length) continue;\r\n if (i === row && j === col) continue;\r\n var ngbCell = gBoard[i][j];\r\n if (ngbCell.isShown) continue;\r\n var elNgbCell = document.querySelector(`.cell-${i}-${j}`);\r\n cellClicked(elNgbCell)\r\n }\r\n }\r\n}", "title": "" }, { "docid": "891ce96aecd90299a9d05581d66a4173", "score": "0.48113477", "text": "function displayChildren() {\n containerComb.selectAll(\"g.node\").each(function (d, i) {\n if (d.depth + 1 == number && !d.children) {\n d.children = d._children;\n d._children = null;\n } else if (d.depth == number) {\n d._children = d.children;\n d.children = null;\n }\n });\n }", "title": "" }, { "docid": "4b62d12d0b7e036b568d674f6718f5bd", "score": "0.48047608", "text": "function condenseTable(el) {\r\n\tvar thisHref = el.attr('href');\r\n\tvar appendTo = el.attr('class');\r\n\r\n\tjQuery('.view-product-model-lists tr').each(function() {\r\n\t\tif(jQuery(this).find('td a').attr('href') == thisHref) {\r\n\t\t\tel.appendTo(jQuery(this).find('td span.' + appendTo + ''));\r\n\t\t}\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "1d0021db9465c0328948ee835271325a", "score": "0.47993743", "text": "function rowsHide($a) {\n $a.innerHTML = '<img alt=\"plus\" src=\"plus3.jpg\">';\n $a.setAttribute('onclick', 'rowsShow(this)');\n\n var $firstTR = findFirstDetailRowFromAnchor($a);\n var $currentNode = $firstTR.nextSibling;\n while (($currentNode.nodeName != '#comment') || ($currentNode.nodeValue != 'TEST_STEPS')) {\n if ($currentNode.nodeName == 'TR') {\n $currentNode.style.display = 'none'; // takes up no space, can't be seen\n }\n $currentNode = $currentNode.nextSibling;\n }\n}", "title": "" }, { "docid": "68e237a2e80ccbf66f4844b9de85b227", "score": "0.4797397", "text": "function fixOrphans() {\n\n\t\t\t// Get a jQuery object for the element\n\t\t\tvar $elm = $(this);\n\n\t\t\t// Get a clone of the original element to store the last state\n\t\t\tvar $_elm = $elm.clone();\n\n\t\t\t// Get the original width of the element\n\t\t\tvar original_width = $elm.width();\n\n\t\t\t// Set the count variable for this element\n\t\t\tvar count = options.limit;\n\n\t\t\t// Set a variable to record the depth\n\t\t\tvar depth = 0;\n\n\t\t\tfunction fix() {\n\n\t\t\t\tif (count > 0) {\n\n\t\t\t\t\t// Get last child node of $elm [the current element being fixed]\n\t\t\t\t\tvar $last_node = this.contents().last();\n\n\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.call($elm);\n\n\t\t}", "title": "" }, { "docid": "88a779003dc69062f169e35c379d89d1", "score": "0.47860584", "text": "function addExpandCollapse()\r\n{\r\n \r\n var expr_find = basePath;\r\n var xpathResult = document.evaluate(expr_find, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0; i<xpathResult.snapshotLength; i++) {\r\n var nodeToProcess = xpathResult.snapshotItem(i);\r\n var newRow = nodeToProcess.insertRow(0);\r\n var newCell0 = newRow.insertCell(0);\r\n newCell0.setAttribute(\"colspan\",\"3\");\r\n newCell0.innerHTML = '<a href=# class=\"x2o\" style=\"text-decoration:none;\" onclick=\"xxv8_expand()\">&nbsp;Expand All</a>&nbsp;|&nbsp;<a href=# class=\"x2o\" style=\"text-decoration:none;\" onclick=\"xxv8_collapse()\">Collapse All</a>';\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "efbc5abb276233e955d5947e9b46719a", "score": "0.47794804", "text": "function addBilanzLinkToCell(cell, gameType, label) {\n const __BILANZLINK = getBilanzLinkFromCell(cell, gameType, label);\n\n if (__BILANZLINK !== \"\") {\n cell.innerHTML += __BILANZLINK;\n }\n}", "title": "" }, { "docid": "a04f2ffb39a95ba995d37672f853e392", "score": "0.47745323", "text": "function firstContactLinkUnFormatter(cellvalue, options, rowObject) {\n\t return;\n\t}", "title": "" }, { "docid": "e9ca83b920dca0917c4f793f736fe3ab", "score": "0.47743678", "text": "function LinkGenerator(value, row, index) {\n\n return value != \"\" ? \"<a href='\" + value + \"' target='_blank'> Link </a>\" : \"\";\n}", "title": "" }, { "docid": "1ca19c92414a1d2b6d4d609c06f683da", "score": "0.47743347", "text": "function TreeUpdate() {\n // alert(\"in TreeUpdate()\");\n\n var doc = this.document;\n\n // traverse the Nodes using depth-first search\n for (var inode = 1; inode < this.opened.length; inode++) {\n var element = doc.getElementById(\"node\"+inode);\n\n // unhide the row\n element.style.display = \"table-row\";\n\n // hide the row if one of its parents has .opened=0\n var jnode = this.parent[inode];\n while (jnode != 0) {\n if (this.opened[jnode] == 0) {\n element.style.display = \"none\";\n break;\n }\n\n jnode = this.parent[jnode];\n }\n\n // if the current Node has children, set up appropriate event handler to expand/collapse\n if (this.child[inode] > 0) {\n if (this.opened[inode] == 0) {\n var myElem = doc.getElementById(\"node\"+inode+\"col1\");\n var This = this;\n\n myElem.className = \"fakelinkexpand\";\n myElem.firstChild.nodeValue = \"+\";\n myElem.title = \"Expand\";\n myElem.onclick = function () {\n var thisNode = this.id.substring(4);\n thisNode = thisNode.substring(0,thisNode.length-4);\n This.expand(thisNode);\n };\n\n } else {\n var myElem = doc.getElementById(\"node\"+inode+\"col1\");\n var This = this;\n\n myElem.className = \"fakelinkexpand\";\n myElem.firstChild.nodeValue = \"-\";\n myElem.title = \"Collapse\";\n myElem.onclick = function () {\n var thisNode = this.id.substring(4);\n thisNode = thisNode.substring(0,thisNode.length-4);\n This.contract(thisNode);\n };\n }\n }\n\n if (this.click[inode] !== null) {\n var myElem = doc.getElementById(\"node\"+inode+\"col2\");\n myElem.onclick = this.click[inode];\n }\n\n // set the class of the properties\n if (this.nprop[inode] >= 1) {\n var myElem = doc.getElementById(\"node\"+inode+\"col3\");\n myElem.onclick = this.cbck1[inode];\n\n if (this.prop1[inode] == \"Viz\") {\n if (this.gprim[inode] != \"\") {\n if ((wv.sceneGraph[this.gprim[inode]].attrs & wv.plotAttrs.ON) == 0) {\n myElem.setAttribute(\"class\", \"fakelinkoff\");\n myElem.title = \"Toggle Viz on\";\n } else {\n myElem.setAttribute(\"class\", \"fakelinkon\");\n myElem.title = \"Toggle Viz off\";\n }\n }\n }\n }\n\n if (this.nprop[inode] >= 2) {\n var myElem = doc.getElementById(\"node\"+inode+\"col4\");\n myElem.onclick = this.cbck2[inode];\n\n if (this.prop2[inode] == \"Grd\") {\n if (this.gprim[inode] != \"\") {\n if ((wv.sceneGraph[this.gprim[inode]].attrs & wv.plotAttrs.LINES) == 0) {\n myElem.setAttribute(\"class\", \"fakelinkoff\");\n myElem.title = \"Toggle Grd on\";\n } else {\n myElem.setAttribute(\"class\", \"fakelinkon\");\n myElem.title = \"Toggle Grd off\";\n }\n }\n }\n }\n\n if (this.nprop[inode] >= 3) {\n var myElem = doc.getElementById(\"node\"+inode+\"col5\");\n myElem.onclick = this.cbck3[inode];\n\n if (this.prop3[inode] == \"Trn\") {\n if (this.gprim[inode] != \"\") {\n if ((wv.sceneGraph[this.gprim[inode]].attrs & wv.plotAttrs.TRANSPARENT) == 0) {\n myElem.setAttribute(\"class\", \"fakelinkoff\");\n myElem.title = \"Toggle Trn on\";\n } else {\n myElem.setAttribute(\"class\", \"fakelinkon\");\n myElem.title = \"Toggle Trn off\";\n }\n }\n } else if (this.prop3[inode] == \"Ori\") {\n if (this.gprim[inode] != \"\") {\n if ((wv.sceneGraph[this.gprim[inode]].attrs & wv.plotAttrs.ORIENTATION) == 0) {\n myElem.setAttribute(\"class\", \"fakelinkoff\");\n myElem.title = \"Toggle Ori on\";\n } else {\n myElem.setAttribute(\"class\", \"fakelinkon\");\n myElem.title = \"Toggle Ori off\";\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "97d560630fbc108ff1b1512c3a37fced", "score": "0.47720897", "text": "function initUI()\r\n{\r\n for(let i = 0; i < visitedCells.length; i++)\r\n {\r\n let {rowId, colId} = visitedCells[i];\r\n let cell = document.querySelector(`div[rowid=\"${rowId}\"][colid=\"${colId}\"]`);\r\n cell.innerHTML = \"\";\r\n }\r\n}", "title": "" }, { "docid": "121f0eafc9f580baa912e7c5369f4f77", "score": "0.47675484", "text": "function DisableKendoGridExpand(context) {\n $(\".k-hierarchy-cell a\", context).css({ opacity: 0.3, cursor: 'default' }).click(function (e) { e.stopImmediatePropagation(); return false; });\n}", "title": "" }, { "docid": "736db4fd9e567b08d4473516ccffc188", "score": "0.47626653", "text": "function rowsShow($a) {\n $a.innerHTML = '<img alt=\"minus\" src=\"minusb.jpg\">';\n $a.setAttribute('onclick', 'rowsHide(this)');\n\n var $firstTR = findFirstDetailRowFromAnchor($a);\n var $currentNode = $firstTR.nextSibling;\n while (($currentNode.nodeName != '#comment') || ($currentNode.nodeValue != 'TEST_STEPS')) {\n if ($currentNode.nodeName == 'TR') {\n $currentNode.style.display = ''; // takes up space, can be seen\n }\n $currentNode = $currentNode.nextSibling;\n }\n}", "title": "" }, { "docid": "8494f052ca5c9a22f88a9c2a188ac760", "score": "0.47377005", "text": "function setLinkOnAllChildren(element, link) {\n if (!element.getNumChildren || element.getNumChildren() == 0) {\n element.setLinkUrl(link);\n return;\n }\n for (var i = 0; i < element.getNumChildren(); i++) {\n var child = element.getChild(i);\n setLinkOnAllChildren(child, link);\n } \n}", "title": "" }, { "docid": "b40934c07295ec9ccc3e20fd18b48e5c", "score": "0.47280237", "text": "function showNgbersOf0(elCell) {\n var i = +elCell.className.charAt(9);\n var j = +elCell.className.charAt(11);\n // console.log('i', i, 'j', j); \n for (var m = i-2 ; m <= i+2; m++) {\n if(m < 0 || m >= gBoard.length ) continue;\n for (var n = j-2 ; n <= j+2; n++){\n if( n < 0 || n >= gBoard.length) continue; \n var elNgber = document.querySelector('.cell' + m + '-' + n); \n // console.log('elNgber: ', elNgber);\n if(elNgber.innerText !== MINE && elNgber.classList[2] !== 'opened'){\n elNgber.classList.add('opened');\n gCellOpen++;\n }\n } \n }\n console.log('countCallOpen: ', gCellOpen); \n}", "title": "" }, { "docid": "072534e386de4a2e5754642021fa3da3", "score": "0.47212872", "text": "function initializeShowMoreButtons()\n{\n $(\".uninitialized.show_more\").click(function()\n {\n /* Query a level down the hierarchy and change to a show less button */\n if ($(this).hasClass(\"show_more\"))\n {\n showMore($(this).attr(\"name\"), $(this).parent());\n $(this).removeClass(\"show_more\").addClass(\"show_less\");\n }\n /* Remove the level down and change back into a show more button */\n else\n {\n $(this).parent().children(\".level_down\").remove();\n $(this).removeClass(\"show_less\").addClass(\"show_more\");\n }\n });\n \n $(\".uninitialized\").removeClass(\"uninitialized\");\n}", "title": "" }, { "docid": "52d6df84dec0d63470b58756dec07c25", "score": "0.47208443", "text": "function expandShown(board, elCell, iLoc, jLoc) {\r\n if (board[iLoc][jLoc].neighborsCount > 0) {\r\n return;\r\n }\r\n var iStart = iLoc === 0 ? iLoc : iLoc - 1;\r\n var iEnd = iLoc === gLevel.SIZE - 1 ? iLoc : iLoc + 1;\r\n var jStart = jLoc === 0 ? jLoc : jLoc - 1;\r\n var jEnd = jLoc === gLevel.SIZE - 1 ? jLoc : jLoc + 1;\r\n for (var i = iStart; i < iEnd + 1; i++) {\r\n for (var j = jStart; j < jEnd + 1; j++) {\r\n if (i == iLoc && j == jLoc) {\r\n continue;\r\n } else {\r\n if (board[i][j].neighborsCount >= 0) {\r\n if (board[i][j].isMine === false) {\r\n if (board[i][j].isRevealed === false) {\r\n board[i][j].isRevealed = true;\r\n gGame.shownCount++;\r\n renderCell(null, i, j);\r\n if (board[i][j].neighborsCount === 0) {\r\n expandShown(board, null, i, j);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "d99e4387eca09dfa54ecbc8e3554243a", "score": "0.47154304", "text": "function genBldgs() {\n var numOfBldgs = 0;\n for (var i = 0; i < rows; i++) {\n for (var j = 0; j < cols; j++) {\n if (arr[i][j] == \"#\") {\n if (!map[i][j]) {\n var nodes = [];\n genBldg(i, j, numOfBldgs, nodes);\n var bldg = { bldg: numOfBldgs++, reachable: [] };\n bldg.reachable.push(bldg);\n bldgs.push(bldg);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "12723a040ed34ed1645df781918f1bda", "score": "0.47124332", "text": "function expandAll()\n\t\t{\n\t\t\tvar treeObj = document.getElementById('dhtmlgoodies_tree');\n\t\t\tvar images = treeObj.getElementsByTagName('IMG');\n\t\t\tfor(var no=0;no<images.length;no++){\n\t\t\t\tif(images[no].className=='tree_plusminus' && images[no].src.indexOf(plusNode)>=0)expandNode(false,images[no]);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1a1e20c6b0cdd72cbd581ed20d7ac23d", "score": "0.47088793", "text": "function EnableKendoGridExpand(context) {\n $(\".k-hierarchy-cell a\", context).removeAttr(\"style\").unbind();\n}", "title": "" }, { "docid": "10fff5022eade0ad22c4d5218fabaa82", "score": "0.47061545", "text": "function adjustForAssociatedData (data, associatedDataColumn) {\n\t\tfor (var i = 0; i < data.length; i += 1) {\n\t\t\tif(data[i].length <= associatedDataColumn) {\n\t\t\t\tdata[i].unshift(\"\");\n\t\t\t} else {\n\t\t\t\tdata[i].unshift(\"<img id='\" + i + \"' class='details-toggle' src='assets/img/details_open.png'></img>\");\t\n\t\t\t}\n\t\t}\n\t\treturn data;\n\t}", "title": "" }, { "docid": "b21aea6a02e78afb1b128e2a76baba07", "score": "0.47010958", "text": "function quickLinks(){\r\n\t\tvar menu = find(\"//td[@class='menu']\", XPFirst);\r\n\t\tfor (var j = 0; j < 2; j++) for (var i = 0; i < menu.childNodes.length; i++) if (menu.childNodes[i].nodeName == 'BR') removeElement(menu.childNodes[i]);\r\n\t\tvar links = [0,\r\n\t\t\t\t[T('LOGIN'), \"login.php\"],\r\n\t\t\t\t[T('ENV_TROPAS'), \"a2b.php\"],\r\n\t\t\t\t[T('SIM'), \"warsim.php\"],\r\n 0,\r\n\t\t\t\t[\"التحالف\", \"allianz.php\"],\r\n\t\t\t\t[\"هجمات التحالف\", \"allianz.php?s=3\"],\r\n\t\t\t\t[\"منتدى التحالف\", \"allianz.php?s=2\"],\r\n\t\t\t\t[\"اخبار التحالف\", \"allianz.php?s=4\"],\r\n 0,\r\n\t\t\t\t[T('COMP'), \"http://trcomp.sourceforge.net/?lang=\" + idioma, \"_blank\"],\r\n\t\t\t\t['Travilog', \"http://travilog.org.ua/\"+idioma+\"/\", \"tr3_travilog\"],\r\n\t\t\t\t['Toolbox', \"http://www.traviantoolbox.com/index.php?lang=\" + idioma, \"tr3_toolbox\"],\r\n\t\t\t\t['World Analyser', \"http://www.travian.ws/analyser.pl\", \"_blank\"],\r\n\t\t\t\t0,\r\n//\t\t\t\t[T('MAPA'), \"http://travmap.shishnet.org/?lang=\" + idioma, \"_blank\"],\r\n//\t\t\t\t[T('RES'), \"http://www.nmprog.hu/travian/buildingsandunitsv39ek.jpg\", \"tr3_buildingtree\"],\r\n//\t\t\t\t[T('UPGRADET'), \"http://www.nmprog.hu/travian/traviantaskqueue.user.js\", \"_blank\"],\r\n\t\t];\r\n\r\n\t\tfor(var i = 0; i < links.length; i++){\r\n\t\t\tif(links[i]){\r\n\t\t\t\tif (((links[i][1] == \"allianz.php\") && (boolShowExtendedIcons != 1)) || (links[i][1] != \"allianz.php\")) {\r\n\t\t\t\t\tvar a = elem(\"A\", links[i][0]);\r\n\t\t\t\t\ta.href = links[i][1];\r\n\t\t\t\t\tif (links[i][2]) a.setAttribute('target', links[i][2]);\r\n\t\t\t\t\tmenu.appendChild(a);\r\n\t\t\t\t}\r\n\t\t\t} else menu.appendChild(document.createElement('HR'));\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e40075e8872716b9d41657a91a0e9de9", "score": "0.4700776", "text": "adjCells() {\n return allDirections.map(dir => this.adjacent(dir))\n .filter(cell => cell !== null);\n }", "title": "" }, { "docid": "57c988ac0932676672ce8f5d5e29858d", "score": "0.46902972", "text": "function buildLargeBranch(node) {\n if (node.depth < 10) {\n YAHOO.log(\"buildRandomTextBranch: \" + node.index, \"info\", \"example\");\n for ( var i = 0; i < 10; i++ ) {\n new YAHOO.widget.TextNode(node.label + \"-\" + i, node, false);\n }\n }\n }", "title": "" }, { "docid": "6bbc30fd656e88c2fae20ffb4977f0b9", "score": "0.4690081", "text": "function processHyperlinks() {\n context.trace(\"Called processHyperlinks\")\n var hyperlinks = context.document.body.getRange().getHyperlinkRanges();\n hyperlinks.load();\n\n return context.sync().then(function () {\n for (var i = 0; i < hyperlinks.items.length; i++) {\n var link = hyperlinks.items[i];\n var mdLink = '[' + link.text + '](' + link.hyperlink + ') ';\n link.hyperlink = \"\";\n link.insertText(mdLink, 'Replace');\n }\n });\n }", "title": "" } ]
b3a3e10029f5651ee9d80fe64773300d
readonly attribute Element? lastElementChild; The lastElementChild attribute must return the last child of the context object that is of type Element or null if there is no such node.
[ { "docid": "09972996bccb29bff7da51765f2c9ebe", "score": "0.81256074", "text": "get lastElementChild() {\n return wrap(unwrap(this).lastElementChild);\n }", "title": "" } ]
[ { "docid": "8983d9d8fa36805d5e44cc8b67cb2167", "score": "0.8492796", "text": "get lastElementChild() {\n const children = this.children;\n return children[children.length - 1] || null;\n }", "title": "" }, { "docid": "0b22c951528f3e000b4f8bd1ca4f0b5b", "score": "0.79835343", "text": "get lastChild() {\n\t\t\treturn this.children.length > 0\n\t\t\t\t? this.children[this.children.length - 1]\n\t\t\t\t: null;\n\t\t}", "title": "" }, { "docid": "194772a51164908fbd8101900f2b483e", "score": "0.7973012", "text": "get lastChild() {\n return this.children.length > 0\n ? this.children[this.children.length - 1]\n : null;\n }", "title": "" }, { "docid": "194772a51164908fbd8101900f2b483e", "score": "0.7973012", "text": "get lastChild() {\n return this.children.length > 0\n ? this.children[this.children.length - 1]\n : null;\n }", "title": "" }, { "docid": "194772a51164908fbd8101900f2b483e", "score": "0.7973012", "text": "get lastChild() {\n return this.children.length > 0\n ? this.children[this.children.length - 1]\n : null;\n }", "title": "" }, { "docid": "babd5923ff68950a8f3c48aa7cb067fc", "score": "0.77766645", "text": "get lastChild() {\n /**\n * The lastChild attribute’s getter must return the context object’s last\n * child.\n */\n return this._lastChild;\n }", "title": "" }, { "docid": "52d295c337027673e63d475caca65603", "score": "0.7362502", "text": "function last_child( par )\n{\n var res=par.lastChild;\n while (res) {\n if (!is_ignorable(res)) return res;\n res = res.previousSibling;\n }\n return null;\n}", "title": "" }, { "docid": "70ff78a3d70e04bb91dda590ef621887", "score": "0.7203471", "text": "lastChild(){\n if (this._right == null)\n return this;\n else\n return this._right.lastChild();\n }", "title": "" }, { "docid": "cf3e0967c48a4877e9d4f847bdcd06b3", "score": "0.7122367", "text": "function getChildrenLastElement() {\r\n return arr[arr.length - 1].children;\r\n }", "title": "" }, { "docid": "af5147a0cbe3e98a74cf4764fa4293ac", "score": "0.7072827", "text": "last() {\n return adopt(this.node.lastChild);\n }", "title": "" }, { "docid": "383ee95c87064c52034070ae961f6b34", "score": "0.6472628", "text": "lastChild() { return this.enterChild(-1, 0, 4 /* Side.DontCare */); }", "title": "" }, { "docid": "9e6d5912525f549a70858d76b6733d7f", "score": "0.64622283", "text": "lastChild() { return this.enterChild(-1, 0, 4 /* DontCare */); }", "title": "" }, { "docid": "e4f81fd96c81457ab07a83d7123fd7a1", "score": "0.636393", "text": "function findLastFocusableElement(element) {\n var children = element.children;\n var length = children.length;\n var child;\n var focusableDescendant;\n\n for (var i = length -1; i >= 0; i -= 1) {\n child = children[i];\n\n focusableDescendant = findLastFocusableElement(child);\n\n if (focusableDescendant) {\n return focusableDescendant;\n }\n }\n\n if (isFocusable(element)) {\n return element;\n }\n\n return null;\n }", "title": "" }, { "docid": "45049b3840e1e50a083ddeec1de475f4", "score": "0.62238127", "text": "function LastElement(last){\n return LastElement\n}", "title": "" }, { "docid": "e3e62eec3df503fd399a7ced2461d3db", "score": "0.62000686", "text": "function findLastFocusableElement(element) {\n\tvar children = element.children;\n\tvar length = children.length;\n\tvar child;\n\tvar focusableDescendant;\n\n\tfor (var i = length -1; i >= 0; i -= 1) {\n\t\tchild = children[i];\n\n\t\tfocusableDescendant = findLastFocusableElement(child);\n\n\t\tif (focusableDescendant) {\n\t\t\treturn focusableDescendant;\n\t\t}\n\t}\n\n\tif (isFocusable(element)) {\n\t\treturn element;\n\t}\n\n\treturn null;\n}", "title": "" }, { "docid": "ac15b26935e416ff89730e8adb159ad5", "score": "0.6197187", "text": "function lastNode(nodeList) {\n\n if (nodeList.length == 0) return null;\n \n return nodeList[ nodeList.length - 1 ];\n}", "title": "" }, { "docid": "c7c7b77a4b2d54ca06d1957c178b819a", "score": "0.61155015", "text": "last() {\n const _ = this;\n _.throwIfDisposed();\n let value = VOID0;\n let found = false;\n _.forEach(x => {\n found = true;\n value = x;\n });\n if (!found)\n throw new Error(\"last:No element satisfies the condition.\");\n return value;\n }", "title": "" }, { "docid": "3e2d9509df9aa11f77bef380c40d1d56", "score": "0.60844016", "text": "function lastElement(arr){\n if (arr.length > 0) {\n return arr[arr.length - 1];\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "a7b2cb818012d63eccff6293ef419054", "score": "0.6074699", "text": "function GetLastTextNodeDescendant(pNode) {\n\tif(pNode.nodeType == 3){\n\t\treturn pNode;\n\t}\n\tfor(var i = pNode.childNodes.length - 1; i >= 0; --i){\n\t\tvar lChild = pNode.childNodes[i];\n\t\tif(lChild.nodeType == 3){\n\t\t\treturn lChild;\n\t\t}\n\t\tif(lChild.nodeType == 1){\n\t\t\tvar lChildLastTextNode = GetLastTextNodeDescendant(lChild);\n\t\t\tif(lChildLastTextNode !== false){\n\t\t\t\treturn lChildLastTextNode;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "c02583d64cf88230f22ee6273c7d19aa", "score": "0.6047642", "text": "function lastElement(array) {\n if (typeof array !== \"undefined\" && array !== null && array.length !== null && array.length > 0) {\n return array[array.length - 1];\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "5b973504f72de0ae05ab67ac50b00b54", "score": "0.6025885", "text": "last() {\n let last = exports.nullVal;\n /* r:for await */ for (const elem of this) {\n last = elem;\n }\n return last;\n }", "title": "" }, { "docid": "14d2d79d602c0302a4ef27d69f084e6d", "score": "0.60247517", "text": "last() {\n return this._last && this._last.value;\n }", "title": "" }, { "docid": "a82a892ca234671e311c00305ab88053", "score": "0.60230654", "text": "function lastBlockOf(element, options, strictDescent) {\n\tif (element == null)\n\t\treturn null;\n\n\tif (strictDescent) {\n\t\treturn terminalBlockOf(element, \"last\", options, true);\n\t} else {\n\t\treturn useLayoutCache(element, \"lastBlock\", options, (element, options) => {\n\t\t\treturn terminalBlockOf(element, \"last\", options);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "1e0c6c8004606b37ba160e5753092822", "score": "0.6011775", "text": "function lastNoneSpaceChild(block) {\n var childNodes = block.childNodes,\n lastIndex = childNodes.length,\n last = childNodes[ lastIndex - 1 ];\n while (last && last.nodeType == 3 && !S.trim(last.nodeValue)) {\n last = childNodes[ --lastIndex ];\n }\n return last;\n }", "title": "" }, { "docid": "3bc257d66c1a71fb8fdfcf3afc65a8ee", "score": "0.5925829", "text": "function last() {\r\n return this._get(this.lastPos);\r\n }", "title": "" }, { "docid": "7d03c76bd48f20c06fdc76284becf30a", "score": "0.5883887", "text": "function lastChild(){/msie [1-8]{1}[^0-9]/.test(navigator.userAgent.toLowerCase())&&$(\"*:last-child\").addClass(\"last-child\")}", "title": "" }, { "docid": "8867de76a8e12f634baceb662df016f9", "score": "0.5875909", "text": "_lastElem(arr) {\n return arr[arr.length - 1];\n }", "title": "" }, { "docid": "1a5b6bc9d27a9f3c925b655cf0e23eb5", "score": "0.58742625", "text": "last() {\n this._activeElement = this._activeElement.closest('[role=\"treeitem\"]').parentElement.lastElementChild;\n }", "title": "" }, { "docid": "3bd53e4e42c1fd8bd58c6f11a6a1d028", "score": "0.58553165", "text": "function getLastElementThatHasText(element) {\n if (!element.hasChildNodes()) {\n throw Error('Must have child node');\n }\n return element.lastChild.nodeType === NODE_TYPE_TEXT\n ? element\n : getLastElementThatHasText(element.lastChild);\n}", "title": "" }, { "docid": "922afd5aceeda8f2ecde2e4ae621e838", "score": "0.5832977", "text": "last() {\n return this.tail;\n }", "title": "" }, { "docid": "2cfbbc1b1b89d599dbab50ec4a51fd29", "score": "0.579711", "text": "getLast() {\n if (!this.head) return null;\n let node = this.head;\n while (node) {\n // IF there is not a next node reference, return the current node--it is the last node.\n if (!node.next) return node;\n node = node.next;\n }\n }", "title": "" }, { "docid": "68379d34c07b2623e188a8ccfb7192c1", "score": "0.5786772", "text": "function lastEle(arr) {\n return arr[arr.length - 1];\n}", "title": "" }, { "docid": "8cc5143bd42d35e3fba65df7d33431e0", "score": "0.57865816", "text": "getLast() {\n if (!this.head) return null;\n\n let node = this.head;\n while (node.next) {\n node = node.next;\n }\n return node;\n }", "title": "" }, { "docid": "9ff37b3fbb7ca749059a8326db564787", "score": "0.5784231", "text": "function last() {\n return this[this.length - 1];\n }", "title": "" }, { "docid": "63906658388889cf39b134415911e69f", "score": "0.5765872", "text": "get rightmostDescendant() {\n return this.right ? this.right.rightmostDescendant : this;\n }", "title": "" }, { "docid": "1e2e968d2ade723d94a7a44d1e9db81e", "score": "0.5747113", "text": "get last() {\n return this.size ? [...this.entries()][this.size - 1] : null;\n }", "title": "" }, { "docid": "c9e9b20b69a9ee8a40dfad5938510cb2", "score": "0.5727652", "text": "function elementEnd() {\n if (isParent) {\n isParent = false;\n }\n else {\n ngDevMode && assertHasParent();\n previousOrParentNode = getParentLNode(previousOrParentNode);\n }\n ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */);\n var queries = previousOrParentNode.queries;\n queries && queries.addNode(previousOrParentNode);\n queueLifecycleHooks(previousOrParentNode.tNode.flags, tView);\n currentElementNode = null;\n}", "title": "" }, { "docid": "c9e9b20b69a9ee8a40dfad5938510cb2", "score": "0.5727652", "text": "function elementEnd() {\n if (isParent) {\n isParent = false;\n }\n else {\n ngDevMode && assertHasParent();\n previousOrParentNode = getParentLNode(previousOrParentNode);\n }\n ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */);\n var queries = previousOrParentNode.queries;\n queries && queries.addNode(previousOrParentNode);\n queueLifecycleHooks(previousOrParentNode.tNode.flags, tView);\n currentElementNode = null;\n}", "title": "" }, { "docid": "c9e9b20b69a9ee8a40dfad5938510cb2", "score": "0.5727652", "text": "function elementEnd() {\n if (isParent) {\n isParent = false;\n }\n else {\n ngDevMode && assertHasParent();\n previousOrParentNode = getParentLNode(previousOrParentNode);\n }\n ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */);\n var queries = previousOrParentNode.queries;\n queries && queries.addNode(previousOrParentNode);\n queueLifecycleHooks(previousOrParentNode.tNode.flags, tView);\n currentElementNode = null;\n}", "title": "" }, { "docid": "c9e9b20b69a9ee8a40dfad5938510cb2", "score": "0.5727652", "text": "function elementEnd() {\n if (isParent) {\n isParent = false;\n }\n else {\n ngDevMode && assertHasParent();\n previousOrParentNode = getParentLNode(previousOrParentNode);\n }\n ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */);\n var queries = previousOrParentNode.queries;\n queries && queries.addNode(previousOrParentNode);\n queueLifecycleHooks(previousOrParentNode.tNode.flags, tView);\n currentElementNode = null;\n}", "title": "" }, { "docid": "c9e9b20b69a9ee8a40dfad5938510cb2", "score": "0.5727652", "text": "function elementEnd() {\n if (isParent) {\n isParent = false;\n }\n else {\n ngDevMode && assertHasParent();\n previousOrParentNode = getParentLNode(previousOrParentNode);\n }\n ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */);\n var queries = previousOrParentNode.queries;\n queries && queries.addNode(previousOrParentNode);\n queueLifecycleHooks(previousOrParentNode.tNode.flags, tView);\n currentElementNode = null;\n}", "title": "" }, { "docid": "91a66bf0f0d2f696f04b5dca9ade552a", "score": "0.5713639", "text": "function lastFormElement(){\n var form_elements = document.getElementsByTagName(\"form\");\n var index = form_elements.length - 1;\n\n if(index >= 0)\n return form_elements[index];\n \n return null;\n}", "title": "" }, { "docid": "9537c015200472ffbcac8c773db617c4", "score": "0.57130426", "text": "function last$1(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n }", "title": "" }, { "docid": "d4998cbe8b1e40aee31cbac809a39c94", "score": "0.5703349", "text": "function lastElement(array) {\n if (!array || !array.length) {\n return undefined;\n }\n return array[array.length - 1];\n}", "title": "" }, { "docid": "f32106c2c039e5085f83db23b6df7cae", "score": "0.56972724", "text": "_getLastTabbableElement(root) {\n if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {\n return root;\n }\n // Iterate in reverse DOM order.\n let children = root.children || root.childNodes;\n for (let i = children.length - 1; i >= 0; i--) {\n let tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ?\n this._getLastTabbableElement(children[i]) :\n null;\n if (tabbableChild) {\n return tabbableChild;\n }\n }\n return null;\n }", "title": "" }, { "docid": "f32106c2c039e5085f83db23b6df7cae", "score": "0.56972724", "text": "_getLastTabbableElement(root) {\n if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {\n return root;\n }\n // Iterate in reverse DOM order.\n let children = root.children || root.childNodes;\n for (let i = children.length - 1; i >= 0; i--) {\n let tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ?\n this._getLastTabbableElement(children[i]) :\n null;\n if (tabbableChild) {\n return tabbableChild;\n }\n }\n return null;\n }", "title": "" }, { "docid": "30176496702ab45b7399138a5be2dd7e", "score": "0.56963784", "text": "function getLastElementDB() {\r\n return arr[arr.length - 1];\r\n }", "title": "" }, { "docid": "4d10583844ea359c3846ca8ea881f9d8", "score": "0.56802434", "text": "function lastElement(someArr) {\n if (someArr == 0) {\n return null;\n } else {\n return someArr.pop(someArr.slice(someArr.lenght, -1));\n } \n}", "title": "" }, { "docid": "3bf38b75660c2f6df7d7a23f052b5963", "score": "0.56724274", "text": "function getLastLeaf(node) {\n while (node.lastChild && (\n // data-blocks has no offset\n node.lastChild instanceof Element && node.lastChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.lastChild))) {\n node = node.lastChild;\n }\n return node;\n}", "title": "" }, { "docid": "3bf38b75660c2f6df7d7a23f052b5963", "score": "0.56724274", "text": "function getLastLeaf(node) {\n while (node.lastChild && (\n // data-blocks has no offset\n node.lastChild instanceof Element && node.lastChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.lastChild))) {\n node = node.lastChild;\n }\n return node;\n}", "title": "" }, { "docid": "3bf38b75660c2f6df7d7a23f052b5963", "score": "0.56724274", "text": "function getLastLeaf(node) {\n while (node.lastChild && (\n // data-blocks has no offset\n node.lastChild instanceof Element && node.lastChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.lastChild))) {\n node = node.lastChild;\n }\n return node;\n}", "title": "" }, { "docid": "341b54b2a932b60ed9dbe99ad203240e", "score": "0.5668119", "text": "lastChild(u) { return this.#sibs.last(this.#c[u]); }", "title": "" }, { "docid": "8cad7466ebe8a8812e00fbbe78343406", "score": "0.5661906", "text": "function getLastLeaf(node) {\n while (node.lastChild && ( // data-blocks has no offset\n isElement(node.lastChild) && node.lastChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.lastChild))) {\n node = node.lastChild;\n }\n\n return node;\n}", "title": "" }, { "docid": "8cad7466ebe8a8812e00fbbe78343406", "score": "0.5661906", "text": "function getLastLeaf(node) {\n while (node.lastChild && ( // data-blocks has no offset\n isElement(node.lastChild) && node.lastChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.lastChild))) {\n node = node.lastChild;\n }\n\n return node;\n}", "title": "" }, { "docid": "8cad7466ebe8a8812e00fbbe78343406", "score": "0.5661906", "text": "function getLastLeaf(node) {\n while (node.lastChild && ( // data-blocks has no offset\n isElement(node.lastChild) && node.lastChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.lastChild))) {\n node = node.lastChild;\n }\n\n return node;\n}", "title": "" }, { "docid": "eb59876c7e161b494196f67582a0c2ad", "score": "0.56580395", "text": "function last(arr) {\n return arr.length > 0 ? arr[arr.length - 1] : null;\n}", "title": "" }, { "docid": "4bc6e011bc9f43d56ddcc8093ceed20a", "score": "0.5657457", "text": "function lastChildContainingText() { var testChild = this.lastChild; var contentCntnr = ['p','li','dd']; while (testChild.nodeType != 1) { testChild = testChild.previousSibling; } var tag = testChild.tagName.toLowerCase(); var tagInArr = inArray.apply(contentCntnr, [tag]); if (!tagInArr && tagInArr!==0) { testChild = lastChildContainingText.apply(testChild); } return testChild; }", "title": "" }, { "docid": "bac0a907ee43e6cd00ca534bc780a0b5", "score": "0.56343687", "text": "function lastElement(list){\n\tvar last;\n\t \n\t//Si la lista no esta vacia...\n \tif (!isEmpty(list)){\n \t\tlast = list[size(list)-1]; //Asignamos a la variable last, el valor del ultimo elemento de la lista\t\n \t} else {\n \t\tthrow \"La lista está vacia.\"; //Lanzamos una excepcion\n \t}\n \treturn last;\n}", "title": "" }, { "docid": "3ab7db130ad2c47324556a366e064d35", "score": "0.56159824", "text": "function getLast()\n\t{\n\t\treturn get(_numberOfElements-1);\n\t}", "title": "" }, { "docid": "77bd9fa5fc26df24a773e6c6cd0621be", "score": "0.5612549", "text": "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "770a412ccbdaf6090123c8e384865efc", "score": "0.5608264", "text": "get child()\n {\n let element = this.firstElementChild;\n // if accessed too early, will render automatically\n if (!element)\n {\n this.render();\n element = this.firstElementChild;\n }\n return element;\n }", "title": "" }, { "docid": "770a412ccbdaf6090123c8e384865efc", "score": "0.5608264", "text": "get child()\n {\n let element = this.firstElementChild;\n // if accessed too early, will render automatically\n if (!element)\n {\n this.render();\n element = this.firstElementChild;\n }\n return element;\n }", "title": "" }, { "docid": "f9127646d695dbfec2013236613874c6", "score": "0.5605882", "text": "getLast () {\n\t\tlet lastNode = this.head;\n\t\t\n\t\tif (lastNode) {\n\t\t\twhile (lastNode.next) {\n\t\t\t\tlastNode = lastNode.next;\n\t\t\t}\n\t\t}\n\n\t\treturn lastNode;\n\t}", "title": "" }, { "docid": "40b6c2a7839db0671b0e490fb4ce5274", "score": "0.5574846", "text": "get rootElement() {\n return this.elements.length > 0 ? this.elements[0] : null;\n }", "title": "" }, { "docid": "610fa43645c16622c92db610e428237d", "score": "0.5566046", "text": "get firstChild() {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n }", "title": "" }, { "docid": "610fa43645c16622c92db610e428237d", "score": "0.5566046", "text": "get firstChild() {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n }", "title": "" }, { "docid": "610fa43645c16622c92db610e428237d", "score": "0.5566046", "text": "get firstChild() {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n }", "title": "" }, { "docid": "16730194ae7105355709773d538ec544", "score": "0.5564683", "text": "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "0ac6440b6183c46ce7a3ce2a7d306d2a", "score": "0.5550939", "text": "getDomRef() {\n\t\tif (!this.shadowRoot || this.shadowRoot.children.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.shadowRoot.children.length === 1\n\t\t\t? this.shadowRoot.children[0] : this.shadowRoot.children[1];\n\t}", "title": "" }, { "docid": "3b8e59ac09c1dcf94f8af940dc8b0c98", "score": "0.552497", "text": "function tail(arr) {\n\t return arr.length && arr[arr.length - 1] || undefined;\n\t}", "title": "" }, { "docid": "001a7f99ba5423e40af1c6f2f2c449fa", "score": "0.55204666", "text": "rightmost(node){\n while(node.right !== null){\n node = node.right;\n }\n return node;\n }", "title": "" }, { "docid": "1e6bf13ef074fa5a8abca7ecebdeb2d0", "score": "0.5513648", "text": "function last(array)\n\t{\n\t\treturn Array.isArray(array) ? array[array.length - 1] : null;\n\t}", "title": "" }, { "docid": "21cc64c4ccb5595d433fcf769f4f0012", "score": "0.5491908", "text": "function getLastLeaf(node) {\n while (node.lastChild && getSelectionOffsetKeyForNode(node.lastChild)) {\n node = node.lastChild;\n }\n return node;\n}", "title": "" }, { "docid": "21cc64c4ccb5595d433fcf769f4f0012", "score": "0.5491908", "text": "function getLastLeaf(node) {\n while (node.lastChild && getSelectionOffsetKeyForNode(node.lastChild)) {\n node = node.lastChild;\n }\n return node;\n}", "title": "" }, { "docid": "21cc64c4ccb5595d433fcf769f4f0012", "score": "0.5491908", "text": "function getLastLeaf(node) {\n while (node.lastChild && getSelectionOffsetKeyForNode(node.lastChild)) {\n node = node.lastChild;\n }\n return node;\n}", "title": "" }, { "docid": "21cc64c4ccb5595d433fcf769f4f0012", "score": "0.5491908", "text": "function getLastLeaf(node) {\n while (node.lastChild && getSelectionOffsetKeyForNode(node.lastChild)) {\n node = node.lastChild;\n }\n return node;\n}", "title": "" }, { "docid": "ba2b087181d25bb8e92b8c6dcf0e1b8f", "score": "0.54874784", "text": "function last$1(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "ba2b087181d25bb8e92b8c6dcf0e1b8f", "score": "0.54874784", "text": "function last$1(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "ba2b087181d25bb8e92b8c6dcf0e1b8f", "score": "0.54874784", "text": "function last$1(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "ba2b087181d25bb8e92b8c6dcf0e1b8f", "score": "0.54874784", "text": "function last$1(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "ba2b087181d25bb8e92b8c6dcf0e1b8f", "score": "0.54874784", "text": "function last$1(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "c0944bd3d143d455fe9121dc73c01500", "score": "0.5471881", "text": "function tail(arr) {\r\n\t\t return arr.length && arr[arr.length - 1] || undefined;\r\n\t\t}", "title": "" }, { "docid": "b9b6fa3a2de9f5332c8d122743c532f8", "score": "0.5458053", "text": "get firstChild() {\n\t\t\tvar _a;\n\t\t\treturn (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n\t\t}", "title": "" }, { "docid": "f88c92d468319d6fa3f40e5eed24db07", "score": "0.54529524", "text": "function last(arr){\n if (arr == null || arr.length < 1) {\n return undefined;\n }\n\n return arr[arr.length - 1];\n }", "title": "" }, { "docid": "56e982d6248cf25506152a29665a42f5", "score": "0.54513717", "text": "function findPreviousLastChild(node) {\n if(node.isParent == false) {\n return node;\n }\n if(node.open == false) {\n return node;\n }\n return findPreviousLastChild(node.children[node.children.length - 1]);\n}", "title": "" }, { "docid": "54f1506f5eaf900632537f938bcfdb53", "score": "0.5448948", "text": "function ɵɵelementEnd() {\n let currentTNode = getCurrentTNode();\n ngDevMode && assertDefined(currentTNode, 'No parent node to close.');\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n }\n else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n const tNode = currentTNode;\n ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);\n decreaseElementDepthCount();\n const tView = getTView();\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries.elementEnd(currentTNode);\n }\n }\n if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);\n }\n if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);\n }\n}", "title": "" }, { "docid": "54f1506f5eaf900632537f938bcfdb53", "score": "0.5448948", "text": "function ɵɵelementEnd() {\n let currentTNode = getCurrentTNode();\n ngDevMode && assertDefined(currentTNode, 'No parent node to close.');\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n }\n else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n const tNode = currentTNode;\n ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);\n decreaseElementDepthCount();\n const tView = getTView();\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries.elementEnd(currentTNode);\n }\n }\n if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);\n }\n if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);\n }\n}", "title": "" }, { "docid": "54f1506f5eaf900632537f938bcfdb53", "score": "0.5448948", "text": "function ɵɵelementEnd() {\n let currentTNode = getCurrentTNode();\n ngDevMode && assertDefined(currentTNode, 'No parent node to close.');\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n }\n else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n const tNode = currentTNode;\n ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);\n decreaseElementDepthCount();\n const tView = getTView();\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries.elementEnd(currentTNode);\n }\n }\n if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);\n }\n if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);\n }\n}", "title": "" }, { "docid": "54f1506f5eaf900632537f938bcfdb53", "score": "0.5448948", "text": "function ɵɵelementEnd() {\n let currentTNode = getCurrentTNode();\n ngDevMode && assertDefined(currentTNode, 'No parent node to close.');\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n }\n else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n const tNode = currentTNode;\n ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);\n decreaseElementDepthCount();\n const tView = getTView();\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries.elementEnd(currentTNode);\n }\n }\n if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);\n }\n if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);\n }\n}", "title": "" }, { "docid": "909b31c9723d95ee6433dc5ddcdc9739", "score": "0.54378825", "text": "function elementEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 3 /* Element */);\n var lView = getLView();\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(getLView()[TVIEW], previousOrParentTNode);\n decreaseElementDepthCount();\n // this is fired at the end of elementEnd because ALL of the stylingBindings code\n // (for directives and the template) have now executed which means the styling\n // context can be instantiated properly.\n if (hasClassInput(previousOrParentTNode)) {\n var stylingContext = getStylingContext(previousOrParentTNode.index, lView);\n setInputsForProperty(lView, previousOrParentTNode.inputs['class'], getInitialClassNameValue(stylingContext));\n }\n}", "title": "" }, { "docid": "909b31c9723d95ee6433dc5ddcdc9739", "score": "0.54378825", "text": "function elementEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 3 /* Element */);\n var lView = getLView();\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(getLView()[TVIEW], previousOrParentTNode);\n decreaseElementDepthCount();\n // this is fired at the end of elementEnd because ALL of the stylingBindings code\n // (for directives and the template) have now executed which means the styling\n // context can be instantiated properly.\n if (hasClassInput(previousOrParentTNode)) {\n var stylingContext = getStylingContext(previousOrParentTNode.index, lView);\n setInputsForProperty(lView, previousOrParentTNode.inputs['class'], getInitialClassNameValue(stylingContext));\n }\n}", "title": "" }, { "docid": "c38c8a32ddb6da5e3a46598c1d890f7f", "score": "0.54373074", "text": "get lastValue() {\n return this.size ? [...this.values()][this.size - 1] : null;\n }", "title": "" }, { "docid": "ba1f7df60d0ec37ad4247582ad6895ae", "score": "0.54362", "text": "function getLastLeaf(node) {\n\t while (node.lastChild && getSelectionOffsetKeyForNode(node.lastChild)) {\n\t node = node.lastChild;\n\t }\n\t return node;\n\t}", "title": "" }, { "docid": "10dcee9ec4d187c76e0726db08b58e43", "score": "0.5424515", "text": "get firstElementChild() {\n return this.childNodes.find(isElementPredicate) || null;\n }", "title": "" }, { "docid": "61a030f7779f8a40e3c16815bfb2b0d1", "score": "0.5422708", "text": "getDomRef() {\n if (!this.shadowRoot || this.shadowRoot.children.length === 0) {\n return;\n }\n\n return this.shadowRoot.children.length === 1 ? this.shadowRoot.children[0] : this.shadowRoot.children[1];\n }", "title": "" }, { "docid": "e31e839edbe810e859cbdfa89341cfb7", "score": "0.5373924", "text": "function getLastElement(arr) {\n return arr[arr.length - 1];\n}", "title": "" }, { "docid": "383209a264062a0b4c5b22d6237db879", "score": "0.53470415", "text": "function last() {\n var arr = this.value();\n return Option(arr[arr.length - 1]);\n}", "title": "" }, { "docid": "9507f6bc9ee75d254b81038a2dcdc7a8", "score": "0.53436863", "text": "function tail(arr) {\n return arr.length && arr[arr.length - 1] || undefined;\n}", "title": "" }, { "docid": "9507f6bc9ee75d254b81038a2dcdc7a8", "score": "0.53436863", "text": "function tail(arr) {\n return arr.length && arr[arr.length - 1] || undefined;\n}", "title": "" }, { "docid": "c9df35438cc4652e6d3a0115ae71a3c4", "score": "0.5339965", "text": "function deepestChild() {\n const grandNode = document.getElementById('grand-node');\n const nodes = grandNode.querySelectorAll('div');\n return nodes[nodes.length - 1];\n}", "title": "" } ]
256b53b237d2adc3eaabaabfea29e5de
Allows the Controller getting the "Delete" button of every product.
[ { "docid": "837af8f969bd5a529c01dc64e5322eac", "score": "0.71300787", "text": "getDeleteButtons() {\n return document.querySelectorAll('.delete-product');\n }", "title": "" } ]
[ { "docid": "c171ddaf333fb385267685557602eaee", "score": "0.6750268", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this)\n .parent(\"td\")\n .parent(\"tr\")\n .data(\"inventory\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/admin/\" + id\n }).then(getInventories);\n }", "title": "" }, { "docid": "47f02fe4742b73131b38c4d0e7a42e66", "score": "0.6659456", "text": "function deleteItem() {\n var childElements = document.getElementsByClassName('product');\n var buttonElements = document.getElementsByClassName('btn btn-delete');\n //Loop through array of buttoon element by class name 'btn btn-delete'\n for (var i=0;i<buttonElements.length;i++) {\n buttonElements[i].addEventListener('click', _handler, false);\n } \n}", "title": "" }, { "docid": "5ce7897341c65a38b7d78d1653f6ec98", "score": "0.66507107", "text": "function delete_button(id){\n\t var controller = $('#'+id).data('controller');\n\t $(\"#tombol-delete\").attr('href', \"proses_delete?idtr=\"+id+\"&&controller=\"+controller);\n }", "title": "" }, { "docid": "21713962c6fca3e1fa4c17b731cf349d", "score": "0.66257614", "text": "function handleDeleteButtons(){\n $('button[data-action=\"delete\"]').click(function(){\n const target = this.dataset.target;\n $(target).remove();\n });\n}", "title": "" }, { "docid": "c4b8b446ffcb70d084af7648cfbdbc4b", "score": "0.6466799", "text": "deleteProducts() {\n var self = this;\n Product.remove({}, function (error) {\n if (error) {\n return self.res.status(500).json({ error : error});\n }\n return self.res.status(204).send();\n });\n }", "title": "" }, { "docid": "9a0bb96e3256a63043c7cc5713b0f9df", "score": "0.64376616", "text": "function __click_delete_btn()\n{\n\t$(document).on(\n\t\t\"click\",\n\t\t\"button.d3SzntVG_delete\",\n\t\tfunction(){\n\t\t\t$(this).parent().parent().remove();\n\t\t}\n\t);\n}", "title": "" }, { "docid": "d5dd651c4e1c6b30f622d44ca6c3aa0a", "score": "0.64016163", "text": "function deleteProduct(event) {\n event.stopPropagation();\n var id = $(this).data(\"id\");\n $.ajax({\n method: \"DELETE\",\n url: \"/api/products/\" + id\n }).then(getProducts);\n }", "title": "" }, { "docid": "d5dd651c4e1c6b30f622d44ca6c3aa0a", "score": "0.64016163", "text": "function deleteProduct(event) {\n event.stopPropagation();\n var id = $(this).data(\"id\");\n $.ajax({\n method: \"DELETE\",\n url: \"/api/products/\" + id\n }).then(getProducts);\n }", "title": "" }, { "docid": "f552d7c8b8a6c77106596d9f13f54326", "score": "0.6369505", "text": "function DeleteProduct(productID) {\n $ngBootbox.confirm('Are you sure delete?').then(function () {\n var config = {\n params: {\n productID: productID\n }\n }\n apiHttpService.del('api/product/delete', config, function (result) {\n notificationService.displaySuccess(result.data.Name + ' đã được xóa.');\n //xoa xong goi lai ham search de get lai san pham\n search();\n }, function (error) {\n notificationService.displayError('Xóa sản phẩm không thành công.');\n })\n });\n }", "title": "" }, { "docid": "036eac1387a294c63dd380779b87c060", "score": "0.63230306", "text": "confirmDeletion() {\n let control = this.controller;\n var modal = document.getElementById(\"my-modal\");\n modal.style.display = \"block\";\n\n var confirm = document.getElementById(\"modal-confirm\");\n\n var cancel = document.getElementById(\"modal-cancel\");\n var close = document.getElementById(\"modal-close\");\n\n cancel.onclick = (event) => { modal.style.display = \"none\";}\n close.onclick = (event) => { modal.style.display = \"none\";}\n confirm.onclick = function(){\n modal.style.display = \"none\"; \n document.getElementById(\"add-list-button\").disabled = false;\n document.getElementById(\"add-item-button\").disabled = true;\n document.getElementById(\"delete-list-button\").disabled = true;\n document.getElementById(\"close-list-button\").disabled = true;\n control.handleListDeletion();\n }\n\n }", "title": "" }, { "docid": "3220a19d5d00cc4a121eb266fe7ebfd5", "score": "0.6309578", "text": "function deleteProduct(){\n var deleteAnimalButton = $('.deleteProduct');\n deleteAnimalButton.on('click',function(event){\n var idProduct = $(event.target).attr(\"value\");\n if(confirm('Etes-vous sur de vouloir vendre ce stock ?')){\n $.ajax({\n url : ajaxProductsRefresh, // La ressource ciblée\n type : 'GET',\n data : 'product=' + idProduct,\n dataType : 'html',// Le type de données à recevoir, ici, du HTML.\n success : function(code_html, statut){\n sectionGame.html(code_html);\n refreshCreations();\n deleteProduct();\n },\n\n error : function(resultat, statut, erreur){\n sectionGame.html('<p>erreur product</p>');\n }\n });\n tableBoard();\n }\n });\n }", "title": "" }, { "docid": "f7e0cfaf93a339ebf549ed2fe387e553", "score": "0.62962914", "text": "navigateToDeletePage(e, productId) {\n window.location = `/deleteProduct/${productId}`;\n }", "title": "" }, { "docid": "2b6b3bac7debad7cab64cefae4fb5dd2", "score": "0.62615085", "text": "function handleDeleteButtonPress() {\n event.preventDefault();\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"employee\");\n \n var id = $(\"#order1\").attr(\"databaseid\");\n $.ajax({\n method: \"DELETE\",\n url: \"/api/orders/\" + id\n })\n .done(getOrders);\n }", "title": "" }, { "docid": "af80defd12c27c6044966f24f8547003", "score": "0.6261103", "text": "function DeleteController() {\n\t}", "title": "" }, { "docid": "a7dbcccd89e086c27482f3f8d06a10d5", "score": "0.6247975", "text": "function deleteModalDeleteButtonOnClick() {\n let itemId = document.querySelector('#deleteModal input[name=id]').value;\n let categoryIds = $('#deleteModal input[name=category_ids]').map(function() { return $(this).val() } ).get();\n\n deleteItem({\n id: itemId,\n category_ids: categoryIds\n });\n}", "title": "" }, { "docid": "c9c2bbacfa187b1894780eb090bef598", "score": "0.62430686", "text": "render() {\n return (\n <div>\n Dashboard\n \n <button className=\"deleteButton\" onClick={() => this.props.deleteItem(this.props.id)}>Delete</button>\n <Product />\n </div>\n )\n }", "title": "" }, { "docid": "79b9289e26082838d1ebf71aaef4c065", "score": "0.62321526", "text": "function deleteItem() {\r\n var buttonClicked = event.target;\r\n var productId = Number(buttonClicked.parentNode.parentNode.getAttribute('data-product-id'));\r\n var transaction = db.transaction(['products'], 'readwrite');\r\n var objectStore = transaction.objectStore('products');\r\n var request = objectStore.delete(productId);\r\n\r\n transaction.oncomplete = function () {\r\n buttonClicked.parentNode.parentNode.parentNode.removeChild(buttonClicked.parentNode.parentNode)\r\n updateBasketTotal();\r\n }\r\n}", "title": "" }, { "docid": "7286feab9dd41eea61fa171ae1c7d1f1", "score": "0.61974025", "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": "d1f2aeee74a870528070278d984e0f88", "score": "0.61950916", "text": "function activerDeleteBtns() {\n const deleteBtns = document.querySelectorAll('.destroy');\n for (let deleteBtn of deleteBtns) {\n deleteBtn.onclick = function() {\n deleteItem(this.closest('li'));\n }\n }\n }", "title": "" }, { "docid": "c2621d1f95ff23d743c6342ef00b4428", "score": "0.6178157", "text": "function handleDeleteButtonPress(){\n var id = $(this).attr(\"id_to_delete\");\n $.ajax({\n method: \"DELETE\",\n url: \"/api/players/\" + id\n }).then(showPlayerList);\n }", "title": "" }, { "docid": "7b5d13611400620cfc917e1eee2a3c71", "score": "0.6164389", "text": "sendDeleteEvent() {\n\t\t\tconst formName = this.modal.name.substr(0, this.modal.name.indexOf('_')); // e.g. 'item_edit' => 'item'\n\t\t\tconst eventName = this.event.delete + this.capitalise(formName);\n\t\t\tbus.$emit(eventName, this.modal.trigger);\n\t\t\tthis.modal.isVisible = false;\n\t\t\tthis.resetFormData(this.modal.name); // The delete button is accessed by the respective edit form (so clear it!)\n\t\t}", "title": "" }, { "docid": "a452faa5c064a58fd402c715981a1320", "score": "0.6150301", "text": "displayDeleteButton() {\n if (this.props.formType === \"editCollection\") {\n return (\n <button\n className=\"form-button grey-button\"\n onClick={this.handleDelete}>\n Delete\n </button>\n )} else {\n return (\n <button\n className=\"form-button grey-button\"\n style={{display: \"none\"}}\n Delete>\n </button>\n )\n }\n }", "title": "" }, { "docid": "e7075023d1485db6a8c3d07405c7405b", "score": "0.61485755", "text": "function deleteProduct(e){\n let cartItem;\n if(e.target.tagName === \"BUTTON\"){\n cartItem = e.target.parentElement;\n cartItem.remove(); // this removes from the DOM only\n } else if(e.target.tagName === \"I\"){\n cartItem = e.target.parentElement.parentElement;\n cartItem.remove(); // this removes from the DOM only\n }\n\n let products = getProductFromStorage();\n let updatedProducts = products.filter(product => {\n return product.id !== parseInt(cartItem.dataset.id);\n });\n localStorage.setItem('products', JSON.stringify(updatedProducts)); // updating the product list after the deletion\n updateCartInfo();\n}", "title": "" }, { "docid": "2a80ce362779052012844fb2fe5ac979", "score": "0.61410743", "text": "deleteProduct(element) {\n if (element.name === 'delete') {\n element.parentElement.parentElement.parentElement.remove(); //Elimina la targeta\n }\n }", "title": "" }, { "docid": "3e0cdcfbbdc8ed4ed51b702fe360e60a", "score": "0.6111107", "text": "function deleteProduct(productId) {\n\t$('#progressModal').modal({ backdrop: 'static', keyboard: true, show: true });\n\tvar baseUrlApi = document.head.querySelector('meta[name=\"api_blockchain\"]').getAttribute('content');\n\n\taxios({\n\t\tmethod: 'delete',\n\t\turl: baseUrlApi + '/Produto/' + productId,\n\t\theaders: {\n\t\t\t'Accept': 'application/json'\n\t\t}\n\t}).then(function (response) {\n\t\tcloseModal();\n\n\t\t$.notify({ icon: \"add_alert\", message: \"Produto deletado com sucesso!\" }, { type: 'success', timer: 3000, placement: { from: 'top', align: 'right' } });\n\n\t\t$table.bootstrapTable('remove', {\n\t\t\tfield: 'ProdutoId',\n\t\t\tvalues: [productId]\n\t\t});\n\t}).catch(function (error) {\n\t\tcloseModal();\n\n\t\t$.notify({ icon: \"add_alert\", message: \"Ocorreu um erro, não foi possível deletar o produto!\" }, { type: 'danger', timer: 3000, placement: { from: 'top', align: 'right' } });\n\t});\n}", "title": "" }, { "docid": "81e95d8a0b47410ee0d4177063310c9e", "score": "0.61050576", "text": "static get DELETE() {\n return \"mg_delete_selected_page\";\n }", "title": "" }, { "docid": "43949d3417ed48609a7fa3e4681c96ca", "score": "0.61050576", "text": "deleteProduct(element){\n const products = JSON.parser(localStorage.getItem('Products'));\n for(let i = 0; i < products.length; i ++){\n if(products[i].name == element){\n products.splice(i,1);\n }\n }\n localStorage.setItem('Products',JSON.stringify(products));\n if(element.id === 'btnDelete'){\n element.parentElement.parentElement.remove();\n this.showMsj('Product Deleted Success', 'success');\n }\n }", "title": "" }, { "docid": "41a2ffabfc98f1d18839d72a76b736f1", "score": "0.61031836", "text": "function deleteProduct(e) {\n let cartItem;\n if (e.target.tagName === 'BUTTON') {\n cartItem = e.target.parentElement;\n cartItem.remove(); // this removes from the DOM only\n } else if (e.target.tagName === 'I') {\n cartItem = e.target.parentElement.parentElement;\n cartItem.remove(); // this removes from the DOM only\n }\n\n const products = getProductFromStorage();\n const updatedProducts = products.filter(product => {\n return product.id !== parseInt(cartItem.dataset.id);\n });\n localStorage.setItem('products', JSON.stringify(updatedProducts)); // updating the product list after the deletion\n updateCartInfo();\n}", "title": "" }, { "docid": "7a6a093c4c66f2ffe741e568d0f830a2", "score": "0.61031574", "text": "deleteProduct(element) {\n // Comparando y a donde a echo tiene la Propiedad name='delete' significa - clic en el Boton\n if (element.name === \"delete\") {\n // Accediendo a la Tarjeta que contiene el Boton de nombre y propiedad name='delete'\n // element.parentElement = 'Que elemento Padre tiene', para luego removerlo\n element.parentElement.parentElement.remove();\n // Llamando a un evento dentro de otro pasando sus propiedades\n this.showMessage(\"Producto eliminado correctamente\", \"success\");\n }\n }", "title": "" }, { "docid": "aaa27d54e8b23de1118424028838d131", "score": "0.6076927", "text": "@action\n deleteRecipe() {\n this.model.deleteRecord();\n this.model.get('isDeleted');\n this.model.save();\n this.transitionToRoute('recipesapp');\n }", "title": "" }, { "docid": "15593cb129dc89768b4fed7790d3eff4", "score": "0.60740894", "text": "function openDelete(entityName, fnPrimary, fnCancel) {\r\n open('<i class=\"fa fa-times\"></i> Delete ' + entityName,\r\n 'Are you sure you want to delete this ' + entityName + '? This action can not be undone.',\r\n fnPrimary,\r\n fnCancel,\r\n '/TravelAgency/Content/src/app/modal/deleteBtnSet.tpl.html');\r\n }", "title": "" }, { "docid": "984cde124d328cb4cf4325353a39132f", "score": "0.607138", "text": "function renderProducts (list) {\n productList.innerHTML = '';\n list.forEach(function (elem) {\n const newProduct = document.createElement('article');\n newProduct.classList.add('product');\n \n newProduct.innerHTML = `\n \n <div class=\"product__info\">\n <p class=\"title\">${elem.name}</p>\n <p class=\"product__price\"> ${elem.adress}</p>\n <p class=\"product__price\"> ${elem.products}</p>\n <p class=\"product__price\">$ ${elem.total}</p>\n <button class=\"carDelete\">X</button>\n\n </div>\n `;\n const deleteCar = newProduct.querySelector('.carDelete');\n\n deleteCar.addEventListener('click', function(){\n productsRef.doc(elem.id).delete().then(function(){\n \n \n }).catch(function(error){\n \n \n });\n });\n productList.appendChild(newProduct);\n });\n }", "title": "" }, { "docid": "fafe3a3916471c9b848d75b3a2b5139a", "score": "0.6059822", "text": "function handleDelete() {\n // save id for the clicked delete button\n const id = $(this).data(\"id\");\n console.log('Inside deleteTask', id);\n // call deletePopup with the saved id for validation\n deleteTaskPopup(id);\n}", "title": "" }, { "docid": "7b16c06d8a1ce20e681e89e7ffdedb32", "score": "0.60477716", "text": "function DeleteProductCategoryMaster(this_obj) {\n debugger;\n productCategoryVM = _dataTable.productCategoryList.row($(this_obj).parents('tr')).data();\n notyConfirm('Are you sure to delete?', 'DeleteProductCategory(\"' + productCategoryVM.Code + '\")');\n}", "title": "" }, { "docid": "0d78a62d3c6253e2e43e0d15c44b2e5f", "score": "0.6043158", "text": "deleteProduct(product) {\n Axios({method: 'DELETE', url: '/api/products/' + product.product._id})\n .then(alert(\"Your product was deleted from the product list\"))\n .then(window.location.href = \"/products\");\n }", "title": "" }, { "docid": "7d1c42f0b38bbb414c89333e8f92af1c", "score": "0.6026493", "text": "handleDelete() {\n const detail = {\n receiverComponent: this.modalData.receiverComponent,\n action: 'delete',\n section: this.modalData.section\n };\n fireEvent(this.pageRef, 'geTemplateBuilderSectionModalBodyEvent', detail);\n }", "title": "" }, { "docid": "89ef69f628312a2bffac30a4a29740f0", "score": "0.60248625", "text": "function deleteItem(e){\n\n}", "title": "" }, { "docid": "a1bd1831f42e411c33e35395050db750", "score": "0.6020042", "text": "function handleOnClickDelete() {\n handleOnDelete(id);\n }", "title": "" }, { "docid": "2a6c86c0dcaaf58e1719f26af306af62", "score": "0.6017839", "text": "async deleteProduct({ dispatch }, id) {\n if (confirm(`Delete Product dengan Id ${id} ?`))\n Api.delete(`product/${id}`)\n .then(() => dispatch(\"getProducts\"))\n\n .catch((error) => console.log({ error }));\n }", "title": "" }, { "docid": "e30c3d22805f933503b91036054af6ec", "score": "0.59938633", "text": "deleteProduct(id) {\n const index = this.products.findIndex(el => el.getId() === id)\n this.products.splice(index, 1)\n }", "title": "" }, { "docid": "8aa17f416cdddd521e543665173c2a98", "score": "0.59906965", "text": "Delete() {\r\n let userData = {};\r\n userData = this.ctrlActions.GetDataForm(this._form);\r\n //Hace el post al create\r\n this.ctrlActions.DeleteToAPI(this.service, userData);\r\n //Refresca la tabla\r\n this.getForm().reset()\r\n this.ReloadTable();\r\n }", "title": "" }, { "docid": "495f4dc2c1f57d88a9609d67862873f1", "score": "0.5990332", "text": "function onConfirmDelete(button, id) {\n if(button === 1){\n deleteStoreConform(id)\n }\n}", "title": "" }, { "docid": "ff47ec01b7a77d40d9565a03ba527b13", "score": "0.5981209", "text": "handleDeleteItem(evt) {\n var target = Object(_utility_dom__WEBPACK_IMPORTED_MODULE_2__[\"findParentByClassname\"])(evt.target, 'selective__list__item__delete');\n var uid = target.dataset.itemUid;\n var locale = target.dataset.locale;\n var listItems = this._getListItemsForLocale(locale) || [];\n var deleteIndex = -1;\n\n for (var index in listItems) {\n if (listItems[index].uid == uid) {\n deleteIndex = index;\n break;\n }\n }\n\n if (deleteIndex < 0) {\n return;\n }\n\n this.confirmDelete = new _parts_modal__WEBPACK_IMPORTED_MODULE_1__[\"ConfirmWindow\"]('Delete item', 'Delete item');\n\n this.confirmDelete.contentRenderFunc = () => {\n var preview = this.guessPreview(listItems[deleteIndex], deleteIndex);\n return Object(selective_edit__WEBPACK_IMPORTED_MODULE_0__[\"html\"])(_templateObject(), preview);\n };\n\n this.confirmDelete.promise.then(() => {\n super.handleDeleteItem(evt);\n this.confirmDelete.close();\n }).catch(() => {\n this.confirmDelete.close();\n });\n this.confirmDelete.open();\n }", "title": "" }, { "docid": "ff7c4952d41d3366d4a1d804badaf712", "score": "0.59714866", "text": "handleDeleteItem(evt) {\n const target = findParentByClassname(evt.target, 'selective__list__item__delete')\n const uid = target.dataset.itemUid\n const locale = target.dataset.locale\n const listItems = this._getListItemsForLocale(locale) || []\n\n let deleteIndex = -1\n for (const index in listItems) {\n if (listItems[index].uid == uid) {\n deleteIndex = index\n break\n }\n }\n if (deleteIndex < 0) {\n return\n }\n\n this.confirmDelete = new ConfirmWindow('Delete item', 'Delete item')\n\n this.confirmDelete.contentRenderFunc = () => {\n const preview = this.guessPreview(listItems[deleteIndex], deleteIndex)\n return html`Are you sure you want to delete <strong>${preview}</strong>?`\n }\n\n this.confirmDelete.promise.then(() => {\n super.handleDeleteItem(evt)\n this.confirmDelete.close()\n }).catch(() => {\n this.confirmDelete.close()\n })\n\n this.confirmDelete.open()\n }", "title": "" }, { "docid": "f4869d024239834cfcda1b16b8e8b1d9", "score": "0.59641707", "text": "deleteOrder() {\n const deleteBtn = document.querySelector(\".delete-order-btn\");\n\n deleteBtn.addEventListener(\"click\", () => {\n this.confirmAction(\"deleteOrder\");\n });\n }", "title": "" }, { "docid": "4fdc58fa0c9bb54c7bee68a94b04dffe", "score": "0.59613585", "text": "function onClickDeleteEmployee() {\n const $delectBtn = $(this);\n let deleteId = $delectBtn.data('id');\n deleteId = parseInt(deleteId);\n\n employees.splice(deleteId, 1);\n render();\n}", "title": "" }, { "docid": "c7d929ff619c0bece38c5892afdcc9b7", "score": "0.59602964", "text": "clickDelete() {\n this.removeModal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_2__remove_modal__[\"a\" /* RemoveModal */], { imageIds: this.imageIds });\n this.removeModal.onDidDismiss((data) => {\n this.onUpdateImageIds(data.imageIds);\n });\n this.removeModal.present();\n }", "title": "" }, { "docid": "c5a550ad5dc00e4c0730d84fb7cd8ad5", "score": "0.5958995", "text": "function handleDeleteButtonClick(e) {\n var currentDeleteButton = e.currentTarget;\n var currentItem = currentDeleteButton.parentElement;\n\n currentItem.remove();\n numbOfItems--;\n\n if(numbOfItems == 0)\n {\n document.querySelector(\".planer-button\").classList.add(\"hidden\");\n document.querySelector(\".empty-planer-message\").classList.remove(\"hidden\");;\n }\n}", "title": "" }, { "docid": "69b3c08f9aeb6cff6b50bf264022f54e", "score": "0.5955959", "text": "function deleteProduct( id ) {\n\t// Fill form data\n\tlet formData = new FormData();\n\tformData.append('id', id);\n\tformData.append('delete', 'delete');\n\t// Send request to backend\n\tfetch('../utilities/admin.php', {method: 'POST', body: formData})\n\t\t.then(( resp ) => resp.json())\n\t\t.then(function ( data ) {\n\t\t\tconsole.log(data);\n\t\t\twindow.location.reload();\n\t\t});\n}", "title": "" }, { "docid": "2ccc7882126663e2dd2188a3b66204f4", "score": "0.5955157", "text": "function special_product_delete(id)\n{\n\tvar x = confirm(\"Are you sure to delete this product permanently?\");\n\tif(x)\n\t{\n\t\tspecial_product_delete_action(id);\n\t}\n}", "title": "" }, { "docid": "f228e5ef294222c943c3b2e4a50a2b71", "score": "0.59457093", "text": "deleteProduct(req, res) {\n if (!req.params.id) {\n res.json({ error: 'Should receive an id' })\n }\n\n for (var i = 0; i < ListProducts.items.length; i++) {\n if (ListProducts.items[i].id == req.params.id) {\n ListProducts.items.splice(i, 1)\n i--;\n }\n }\n\n res.json(ListProducts);\n }", "title": "" }, { "docid": "8bbd51bc8a0acd329917f1a8e70581f9", "score": "0.59298015", "text": "function deleteTodo(e) {\n e.preventDefault();\n delete_button = this;\n $.ajax({\n url: this.action,\n type: 'delete'\n })\n .done(function(server_data) {\n delete_button.parentElement.remove();\n })\n .fail(function() {\n console.log(\"f'ed up\");\n })\n }", "title": "" }, { "docid": "779f13b87cbc88bc4210b1f838cbd9df", "score": "0.592611", "text": "function makeDELETEproductOnProduct() {\n //var sellerId = $('#txtSellerIdD').val();\n var productId = $('#txtProductIdD').val();\n \n $.ajax({\n url: 'http://localhost:8080/gaget/api/products/'+ productId,\n method: 'DELETE',\n success: function () {\n alert('record ' + productId + ' has been deleted');\n location.reload();\n },\n error: function (error) {\n alert(error);\n }\n });\n $('#productDeleteModal').modal('hide');\n}", "title": "" }, { "docid": "1bb7e1527ae1f3770291ce7d42a4e01e", "score": "0.5920131", "text": "function deleteProduct(index){\n productContainer.splice(index,1);\n localStorage.setItem('ourProduct',JSON.stringify(productContainer));\n displayProduct();\n}", "title": "" }, { "docid": "df23ad5411117015671b8cfc731da428", "score": "0.5918075", "text": "function handleItemDeleteClicked(){\n console.log('handleItemDeleteClicked ran');\n}", "title": "" }, { "docid": "ba149395ffbb26f766d817208c587562", "score": "0.59148455", "text": "function hot_product_delete(id)\n{\n\tvar x = confirm(\"Are you sure to delete this product permanently?\");\n\tif(x)\n\t{\n\t\thot_product_delete_action(id);\n\t}\n}", "title": "" }, { "docid": "8f72ab8298ea2a2128a728582ee3a261", "score": "0.59084934", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"player\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/players/\" + id\n })\n .then(getPlayers);\n }", "title": "" }, { "docid": "c5a36c187ff4e0ea10baf6ddff58b40d", "score": "0.59084374", "text": "function openDeleteModal(productID) {\n setIsDeleteModal(true);\n setProductClicked(productID);\n }", "title": "" }, { "docid": "8b5a4219c9f6a72145f5fbb507091036", "score": "0.59075195", "text": "function handleDeleteItemClicked() {\n $('.js-shopping-list').on('click','.js-item-delete',function(event){\n let itemIndex = getItemIndexFromElement(event.currentTarget);\n STORE.items.splice(itemIndex,1);\n //remove next line?\n // $(this).closest('li').remove();\n renderShoppingList();\n });\n}", "title": "" }, { "docid": "af4a02bfb214544ecf3663be9822dc06", "score": "0.58972734", "text": "function getDeleteBtnHTML() {\n return `\n <span class=\"trash-can\">\n <i class=\"fas fa-trash-alt\"></i>\n </span>`;\n}", "title": "" }, { "docid": "8c9f3d15f3ead2dbbe0735f6a497c940", "score": "0.5896718", "text": "function addDeleteButtonEvent() {\r\n\r\n $(\".deleteButton\").click(function () {\r\n let postId = $(this).attr(\"value\");\r\n\r\n let url = \"server/deletepost.php?postid=\" + postId;\r\n\r\n fetch(url, { credentials: \"include\" })\r\n .then(response => response.json())\r\n .then(showAllPosts);\r\n });\r\n }", "title": "" }, { "docid": "ef6f8ee42080450de64c29f147e3c304", "score": "0.58849347", "text": "function onDeletePressed(btn) {\n deleteOid();\n}", "title": "" }, { "docid": "7cb5eb73eca65012a6704f9749d47b16", "score": "0.5884237", "text": "delete() {\n $(this).triggerHandler('delete');\n }", "title": "" }, { "docid": "f912af0ddccc865e0ef0ddf644263b70", "score": "0.5882173", "text": "function openBatchDeleteModal() {\n var deleteObjects = []\n for(var index in ctrl.checkBox){\n if(ctrl.checkBox[index]){\n deleteObjects.push(ctrl.data.pods[index].name)\n }\n }\n confirmModal(\"Delete\", 'pods', ctrl.batchDelete, deleteObjects);\n }", "title": "" }, { "docid": "1b846c1ea7959e811d76c785fdddcc88", "score": "0.587952", "text": "function tableDeleteModalButtonOnClick() {\n let itemId = $(this).data('id');\n populateDeleteModal(itemId);\n}", "title": "" }, { "docid": "82d0d99196688c8d317ee52fecc19b25", "score": "0.58700573", "text": "'click .delete' () {\n Goals.remove(this._id);\n }", "title": "" }, { "docid": "5184e0b1a263bacaab196d95f603bd5b", "score": "0.586849", "text": "function _onClickDelete() {\n if (vm.selectedNode == null) {\n vm.$notificationService.warning(\"Please select a folder or media before proceeding\");\n } else {\n vm.hideAllPanels();\n if (vm.selectedNodeType == 'folder') {\n vm.displayFolderDetails = true;\n vm.mainFileTbD = vm.selectedNode.folderName;\n vm.wellDel = true;\n vm.folderCount = true;\n if (vm.tBdMedias > 0) {\n vm.mediaCount = true;\n }\n else {\n vm.mediaCount = false;\n }\n vm.displayDeletePanel = true;\n } else if (vm.selectedNodeType == 'pic') {\n vm.displayMediaDetails = true;\n vm.mainFileTbD = vm.selectedNode.mediaTitle;\n vm.wellDel = true;\n vm.folderCount = false;\n vm.mediaCount = true;\n vm.displayDeletePanel = true;\n }\n }\n }", "title": "" }, { "docid": "cac3ad07ae2f4ddbd9900419c8651e6a", "score": "0.58635527", "text": "function onConfirm(button) {\n var item_id = $('.delMenu').data('id');\n if (button == 1) {\n $this.deleteItem(item_id);\n }\n }", "title": "" }, { "docid": "715b4be7ae2b802b288881a2f46dd19d", "score": "0.5860445", "text": "function Delete(indexObj){\n\tshowModalDelete();\n\t//console.log(indexObj);\n\t//console.log(\"confirm instance: \", document.getElementById(\"confirmDelete\")); \n\tdocument.getElementById(\"confirmDelete\").addEventListener(\"click\",function() {\n\t\tconsole.log(\"Delete item with id: \", indexObj);\n\t\tdatabase.deleteItem(parseInt(indexObj, 10), dataBase);\n\t});\n\tdocument.getElementById(\"cancelDelete\").addEventListener(\"click\",function(){\n\t\t//do notting\n\t});\n}", "title": "" }, { "docid": "a1ad301da24003be258c25558d0e3196", "score": "0.58540523", "text": "function createDeleteButton(li) {\n const deleteButton = document.createElement('button')\n deleteButton.innerText = \"Delete Ye Bagel\"\n deleteButton.className = \"delete-button\"\n li.append(deleteButton)\n deleteButton.addEventListener('click', (event) => {\n let deleteId = event.target.parentNode.id\n event.target.parentNode.remove()\n bagelDelete(deleteId)\n })\n }", "title": "" }, { "docid": "9388e78831e2f6efb9c1e3581dd48b31", "score": "0.58503723", "text": "function remove() {\n if (confirm('Are you sure you want to delete?')) {\n vm.affiliateProduct.$remove($state.go('affiliateProducts.list'));\n }\n }", "title": "" }, { "docid": "32052b4f26c9c79beb200f353e7c9e25", "score": "0.58497083", "text": "function addMenuDeleteButton() {\r\n\tjQuery('#menu-to-edit li.menu-item').each(function(){\r\n\t\t\r\n\t\tvar delete_el \t= jQuery('.menu-item-actions a.item-delete', this);\r\n\t\tvar anchor \t\t= '<a class=\"top-item-delete\" id=\"' + delete_el.attr('id') + '\" href=\"' + delete_el.attr('href') + '\">' + delete_el.text() + '</a>';\r\n\t\tvar controls\t= jQuery('.item-controls', this);\r\n\t\tvar count\t\t= jQuery('a.top-item-delete', controls).size();\r\n\t\t\r\n\t\t// delete button already present?\r\n\t\tif ( count == 0 ) {\r\n\t\t\tcontrols.prepend( anchor + ' | ');\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "faf210efe991d34286a3e43fe8d94dac", "score": "0.5839437", "text": "function ListarSeleccionados() {\n $(\"#datostablaEspecialidadesDelDocente\").html(\"\");\n $.each(especialidadesSeleccionadas, function (i, especialidadesSeleccionadas) {\n $('#datostablaEspecialidadesDelDocente').append(\n '<tr>' +\n '<td>' + especialidadesSeleccionadas.descripcionEspecialidad + '</td>' +\n '<td>' +\n '<button onclick=\"EliminarEspecialidadDeDocente(' + i + ')\" class=\"btn btn-outline-danger\"><span class=\"fa fa-remove\"></button>' +\n '</td>' +\n '</tr>');\n });\n}", "title": "" }, { "docid": "c874d7b1b253a7e6bd80974ffb8b8142", "score": "0.5838107", "text": "delete(event) {\n event.preventDefault()\n\n if (!confirm(\"Are you sure?\")) { // eslint-disable-line no-restricted-globals\n return\n }\n\n const jsonData = {\n edit_summary: this.editSummary,\n }\n\n fetch(this.urlValue, {\n method: \"DELETE\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n \"X-CSRF-Token\": this.csrfToken(),\n },\n body: JSON.stringify(jsonData),\n }).\n then((response) => {\n if (!response.ok) {\n throw new Error(`HTTP status ${response.status}`)\n }\n return response\n }).\n then((_response) => {\n AntCat.notifySuccess(\"Deleted item\")\n this.container.remove()\n }).\n catch((error) => { alert(error) })\n }", "title": "" }, { "docid": "a12a481bf4cf355be9dd949ace3c09a4", "score": "0.58361447", "text": "function DeleteMulti() {\n $ngBootbox.confirm('Bạn có chắc chắn muốn xóa?').then(function () {\n var lstItem = [];\n // lay ra list id cua product voi lstItem = [5,6] sau do\n // su dung JSON.stringifly de convert toi kieu string va truyen vao params\n\n $.each($scope.selected, function (i, item) {\n lstItem.push(item.ID);\n });\n\n var config = {\n params: {\n //JSON.stringify chuyen params kieu int toi string boi vi backend web api co params lstProductID kieu string:\n // vi du khi khong su dung se sinh ra 2 params giong nhau hien thi url nhu sau:\n //localhost:64283/api/product/deletemulti?lstProductID=5&lstProductID=6 400 (Bad Request)\n // sau khi su dung localhost:64283/api/product/deletemulti?lstProductID=%5B5,6%5D\n lstProductID: JSON.stringify(lstItem)\n }\n }\n apiHttpService.del('api/product/deletemulti', config, function (result) {\n notificationService.displaySuccess(result.data + ' sản phẩm đã được xóa.');\n //xoa xong goi lai ham search de get lai san pham\n search();\n\n }, function (error) {\n notificationService.displayError('Xóa sản phẩm không thành công.');\n })\n });\n }", "title": "" }, { "docid": "f0d1c18566edc08d23e7e1f0eb21d653", "score": "0.5829891", "text": "_delete() {\n PCActions.deleteItem(this.props.item.id, this.props.item.type);\n }", "title": "" }, { "docid": "42e8b892b60da05b5586756401865013", "score": "0.5829197", "text": "deleteProduct(productid) {\n return this.http.delete(\"https://sheltered-falls-45349.herokuapp.com/api/products/\" + productid);\n }", "title": "" }, { "docid": "44b8c9ead1b184c3b202e4a2c5bd8c96", "score": "0.58175117", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this)\n .parent(\"td\")\n .parent(\"tr\")\n .data(\"owner\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/owners/\" + id\n }).then(getOwners);\n }", "title": "" }, { "docid": "345e824a798be5ae8222a35f4cae51b6", "score": "0.5816561", "text": "function getDeleteButton(id){\n\treturn \"<td><button class='deleteButton btn btn-block btn-secondary' data=\"+id+\">Slett</button></td>\";\n}", "title": "" }, { "docid": "386d01532519805a5b28d609010d85ad", "score": "0.5813072", "text": "function eliminarProductoDiv(){\n\n for (let i = 0; i < buttonEliminar.length; i++) {\n buttonEliminar[i].addEventListener(\"click\",()=>{\n console.log(`diste click en el boton ${productos[i].id}`)\n axios.delete(`http://localhost:18090/api/v1/producto/${productos[i].id}`)\n getProductos()\n location.replace(\"#\")\n location.reload()\n })\n }\n\n}", "title": "" }, { "docid": "a3b216bbb7bd059c2462a3acfdb8a790", "score": "0.5805692", "text": "function getDeleteBtnHTML() {\n return `\n <span class=\"trash-can\">\n <i class=\"fas fa-trash-alt\"></i>\n </span>`;\n}", "title": "" }, { "docid": "eb9574d50b752e95f01c71a0cc05f3b5", "score": "0.58029836", "text": "function onCommandDeleteItem() {\n sendMessage({ command: \"onCommandDeleteItem\" });\n}", "title": "" }, { "docid": "cc6ecdce4fc7dd5d9e2436d4454fa5a5", "score": "0.5801156", "text": "async function deleteProducts(req, res, next) {\n try {\n let id = req.params.id;\n await product.delete(id);\n res.json('Product is Deleted');\n } catch (e) {\n next(e.message);\n }\n}", "title": "" }, { "docid": "3a252e18849b31ed5101e5ca47c8588e", "score": "0.5798019", "text": "deleteproduct(req, res) {\n try {\n const id = req.params.id;\n Product.destroy({\n where: { id: id },\n }).then((num) => {\n if (num == 1)\n return res.status(200).send(\"product was deleted succesfully\");\n return res\n .status(404)\n .send(\n `Cannot deleted product with id=${id}. Maybe product was not found !`\n );\n });\n } catch (error) {\n res.status(500).send(error);\n }\n }", "title": "" }, { "docid": "0a1752499285e21cf90aa5bdbaae52d8", "score": "0.5794766", "text": "deleteProduct() {\n axios.delete('https://dextedoodle.herokuapp.com/products/delete-product/' + this.props.obj._id)\n .then((res) => {\n console.log('product successfully deleted!')\n }).catch((error) => {\n console.log(error)\n })\n }", "title": "" }, { "docid": "ea8e014755cf8a10e7e9701371e1a502", "score": "0.5788148", "text": "function hideAllDeleteButtons() {\r\n\tExt.select('div.show-delete-button').removeCls('show-delete-button');\r\n}", "title": "" }, { "docid": "5e7d4c1a533df2fdba768c896fa67180", "score": "0.5782311", "text": "btnDelete() {\n var me = this;\n var recordId;\n $('*').on('click', 'a#delete', function () {\n recordId = $(this).attr('recordId');\n $('.dialog-del').find('span').text(recordId);\n $('#myModal1').find('span').text(recordId);\n })\n\n //Event accept delete\n $('#btn-delete').on('click', function () {\n $.ajax({\n url: me.host + me.getApiRoter + `/${recordId}`,\n method: \"DELETE\",\n }).done(function (res) {\n me.loadData();\n }).fail(function (res) {\n\n })\n alert(\"Xóa thành công\");\n })\n }", "title": "" }, { "docid": "1f56a6c82c09a1ba891d4c0e013c9a66", "score": "0.5780817", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"source\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/sources/\" + id\n })\n .then(getsources);\n }", "title": "" }, { "docid": "2136e08a39c3a34dea24bf919b31559e", "score": "0.57759863", "text": "function deleteRecipeClicked(evt){\n evt.preventDefault()\n props.onDeleteClicked(props.id)\n }", "title": "" }, { "docid": "e2d33f71d39fb454d48634e3a3fc852e", "score": "0.57709324", "text": "function inCartDelete() {\n const mode = document.querySelector(\"input[name=mode]:checked\").id;\n // target deleted item's index\n let deleteKey = this.parentNode.id.split(\"^\");\n if (mode === 'cart') {\n let deleteIndex = cartArray.findIndex((item) => (item.name === deleteKey[0]) \n && (item.glaze === deleteKey[1]) \n && (item.qty === deleteKey[2]));\n cartArray.splice(deleteIndex, 1);\n // delete from model\n setCart();\n }\n else if (mode === 'wish') {\n let deleteIndex = wishListArray.findIndex((item) => (item.name === deleteKey[0]) \n && (item.glaze === deleteKey[1]) \n && (item.qty === deleteKey[2]));\n wishListArray.splice(deleteIndex, 1);\n // delete from model\n setWishList();\n }\n // delete item from view\n deleteItem(this.parentNode);\n}", "title": "" }, { "docid": "2d26a91a2d65511a104d736f19922ab8", "score": "0.5770434", "text": "function confirmDelete(data) {\r\n let actuatorId = data.id;\r\n let actuatorName = \"\";\r\n\r\n //Determines the actuator's name by checking all actuators in the actuator list\r\n for (let i = 0; i < actuatorList.length; i++) {\r\n if (actuatorId === actuatorList[i].id) {\r\n actuatorName = actuatorList[i].name;\r\n break;\r\n }\r\n }\r\n\r\n //Show the alert to the user and return the resulting promise\r\n return Swal.fire({\r\n title: 'Delete actuator',\r\n type: 'warning',\r\n html: \"Are you sure you want to delete actuator \\\"\" + actuatorName + \"\\\"?\",\r\n showCancelButton: true,\r\n confirmButtonText: 'Delete',\r\n confirmButtonClass: 'bg-red',\r\n focusConfirm: false,\r\n cancelButtonText: 'Cancel'\r\n });\r\n }", "title": "" }, { "docid": "db09e2164af9904278bf1e2bef6d22f2", "score": "0.57702506", "text": "function deleteComponent(componentRec)\n{\n\tclickedDelete();\n}", "title": "" }, { "docid": "6e1f26f8757058e8b6747de0de4d67cb", "score": "0.57683265", "text": "function deleteEntityAction(url, serial, entityId, entity, panelID) {\n if (confirm('Do you really want to delete ' + entity + '?')) {\n $.ajax({\n type: 'get',\n dataType: 'html',\n data: {\n id: entityId,\n serial: serial\n },\n url: url,\n success: function (data, textStatus) {\n $('#' + panelID).html(data);\n }\n\n });\n } else {\n return false;\n }\n\n}", "title": "" }, { "docid": "f1831988eeaf8387531cdfc21fbfd9a2", "score": "0.5765978", "text": "buildDeleteBtn() {\n let delBtn = this.buildBtn(this.options.delBtnInnerHTML, this.options.delBtnClasses);\n delBtn.addEventListener('click', e => this.handleDelete());\n return delBtn;\n }", "title": "" }, { "docid": "0fa524f6af4dc7466f40b56f57b28e82", "score": "0.5762266", "text": "function handleDeleteItemClicked() {\n $('.js-shopping-list').on('click', '.js-item-delete', function(event) {\n const itemId = getItemIdFromElement(event.currentTarget);\n deleteListItem(itemId);\n renderShoppingList();\n //As a user, I can delete an item from the list\n console.log('`handleDeleteItemClicked` ran');\n });\n}", "title": "" }, { "docid": "0db2e80768ac9fb050a10e253df8bc6a", "score": "0.575917", "text": "function showImageProduct(productImages) {\n $(\"#column-product-image\").html(\n \"<td style='text-align: center'> STT</td>\" +\n \"<td> Link ảnh </td>\" +\n \"<td> Chức Năng</td>\"\n );\n const listSize = Object.keys(productImages).length;\n if (listSize > 0) {\n let contentRow = '';\n var index = 1;\n productImages.map(function (productImage) {\n contentRow += `\n <tr>\n <td style='text-align: center' > ${index} </td>\n <td> ${productImage.url} </td>\n <td> \n <div class=\"btn-group\">\n <a class=\"btn btn-primary\" href=\"create-image-product\"><i class=\"fa fa-lg fa-plus\"></i></a>\n <a class=\"btn btn-primary\" href=\"update-image-product?id=${productImage.id}\"><i class=\"fa fa-lg fa-edit\"></i></a>\n <a class=\"btn btn-primary delete-image-product\" name=\"${productImage.id}\" ><i class=\"fa fa-lg fa-trash\" style=\"color: white\"></i></a>\n </div>\n </td>\n </tr>\n `;\n index++;\n });\n $(\"#row-product-image\").html(contentRow);\n //============ delete =============\n deleteImageProduct();\n }\n}", "title": "" }, { "docid": "e6fb011c080d8e106d38217e15daf730", "score": "0.57507956", "text": "function handleDeleteButton() {\n $('.js-bookmark-list').on('click', ('.js-bookmark-delete'), event => {\n event.preventDefault();\n const id = getIdFromElement(event.currentTarget);\n\n api.deleteBookmark(id, function() {\n store.deleteBookmark(id);\n render();\n });\n });\n }", "title": "" }, { "docid": "bb3803f6ed848bdf9eaabe9215f31a51", "score": "0.57499874", "text": "function deleteProduct(id){\n console.log(\"Tratando de enviar el delete\");\n return axios.delete('http://localhost:3000/products/'+id,{\n id:id\n })\n .then((response) => {\n console.log(response);\n }, (error) => {\n console.log(error);\n });\n}", "title": "" }, { "docid": "041cfc98d810b46f0049ed4e3295f52f", "score": "0.5742711", "text": "function deleteProduct(param) {\n\n productDeleteBtn.addEventListener('click', (e) => {\n\n param.remove();\n\n });\n\n}", "title": "" }, { "docid": "a5dd302edcb1f69e744d3ba3ea9b2ae2", "score": "0.5742091", "text": "function deleteProduct (productId) {\n\n // confirm delete\n const confirmDelete = confirm('Delete this Product?');\n\n // on confirm\n if (confirmDelete) {\n\n // get user info\n callProductsService({\n method: 'deleteProduct',\n productId: productId\n })\n .then( response => {\n\n // if successful\n if (response === 'success') {\n loadProducts();\n }\n\n // if not\n else {\n showErrorMsg(response);\n }\n\n });\n\n }\n\n}", "title": "" } ]
205b3c72288579d0a5de0e6f85c95568
Creates a new React class that is idempotent and capable of containing other React components. It accepts event listeners and DOM properties that are valid according to `DOMProperty`. Event listeners: `onClick`, `onMouseDown`, etc. DOM properties: `className`, `name`, `title`, etc. The `style` property functions differently from the DOM API. It accepts an object mapping of style properties to values.
[ { "docid": "028651ad8d6cfde03bcf9265adf41c84", "score": "0.0", "text": "function ReactDOMComponent(element) {\n\t var tag = element.type;\n\t validateDangerousTag(tag);\n\t this._currentElement = element;\n\t this._tag = tag.toLowerCase();\n\t this._namespaceURI = null;\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._hostNode = null;\n\t this._hostParent = null;\n\t this._rootNodeID = 0;\n\t this._domID = 0;\n\t this._hostContainerInfo = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._flags = 0;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._ancestorInfo = null;\n\t setAndValidateContentChildDev.call(this, null);\n\t }\n\t}", "title": "" } ]
[ { "docid": "ea561c238a4c60379a3ab521505225ec", "score": "0.5859378", "text": "function componentFactory() {\n var store = {};\n var instanceStore = {};\n var ownerStyles = {}; \n var rootNamespace =\"\";\n var that;\n var requireConditionals = [];\n var conditionalsLength = 0;\n var node;\n\n this.style = style;\n this.style.define = define;\n this.style.log = logStyles;\n this.style._getChildContext = getChildContext; \n this.style._componentWillUnmount = componentWillUnmount;\n this.style._componentDidUpdateOrMount = componentDidUpdateOrMount;\n return null;\n\n\n ///////////////////////////////////////////////////////////////////////////////\n\n function componentDidUpdateOrMount(){\n setGlobalStyles();\n\n node = that.getDOMNode();\n\n // defines eventListener for requiredConditional (\"hover\", \"pressed\")(only if changed); \n if(conditionalsLength < requireConditionals.length) {\n for(var i=0; i<requireConditionals.length; i++) {\n switch(requireConditionals[i]) {\n case \"hover\":\n\n node.addEventListener(\"mouseenter\", onMouseEnter);\n node.addEventListener(\"mouseleave\", onMouseLeave);\n\n break;\n case \"pressed\":\n\n node.addEventListener(\"mousedown\", onMouseDown);\n node.addEventListener(\"mouseup\", onMouseUp); \n \n break;\n }\n }\n conditionalsLength = requireConditionals.length;\n }\n }\n\n /////////////////////////////////////////////////////////////////////////////// \n function componentWillUnmount(){\n node.removeEventListener(\"mouseenter\", onMouseEnter);\n node.removeEventListener(\"mouseleave\", onMouseLeave);\n node.removeEventListener(\"mousedown\", onMouseDown);\n node.removeEventListener(\"mouseup\", onMouseUp);\n }\n\n ///////////////////////////////////////////////////////////////////////////////\n // this.style.define()\n\n function define(namespace, styles){\n if(typeof styles === \"undefined\") {\n styles = namespace;\n namespace = \"\";\n }\n if(typeof namespace === \"string\") {\n namespace = namespace.split(\",\");\n }\n for(var i=0; i<namespace.length; i++) {\n saveStyles(namespace[i], styles, store);\n };\n }\n\n ///////////////////////////////////////////////////////////////////////////////\n // Handles \"inheritance\" of styles down the component tree\n\n function getChildContext(){\n that = this;\n\n // get react-inline-style context\n this.context.reactInlineStyle = this.context.reactInlineStyle || {};\n var context = this.context.reactInlineStyle;\n context[this._reactInternalInstance._mountOrder] = context[this._reactInternalInstance._mountOrder] || {};\n var thisContext = context[this._reactInternalInstance._mountOrder];\n \n // get parent styles\n var id, parent = this._reactInternalInstance;\n var parentStyles = false;\n\n while(parent._currentElement._owner) {\n parent = parent._currentElement._owner;\n id = parent._mountOrder;\n if(typeof context[id] === \"object\" && typeof context[id].ownerStyles === \"function\") {\n parentStyles=context[id];\n break;\n }\n }\n\n // define componentInstance styles\n if(parentStyles) {\n ownerStyles = parentStyles.ownerStyles();\n rootNamespace = parentStyles.rootNamespace || \"\";\n }\n\n // apply root namespace\n var namespace = \"\";\n if(typeof this.props.styleNamespace === \"string\") {\n namespace = getNamespace(this.props.styleNamespace);\n ownerStyles = getClassFromString(namespace, ownerStyles);\n }\n\n rootNamespace = getNamespace(rootNamespace, namespace);\n\n // copy styles from moduleInstance to componentInstance\n new objct.e.extend(store, objct.e.deep(moduleStore), objct.e.deep(instanceStore));\n\n // pass on component styles\n context[this._reactInternalInstance._mountOrder]={\n ownerStyles : objct.e(store, objct.e.deep(ownerStyles)),\n rootNamespace : rootNamespace\n }\n\n return {\n reactInlineStyle : context\n }\n } \n \n ///////////////////////////////////////////////////////////////////////////////\n // this.style.log(): Log current virtual stylesheet \n\n function logStyles(){\n if(typeof console !== \"object\" || typeof console.log !== \"function\") return;\n console.log(\"react-inline-style\", {\n \"rootNamespace\" : rootNamespace, \n \"stylesheet\" : new objct.e(store, objct.e.deep(ownerStyles))\n });\n }\n ///////////////////////////////////////////////////////////////////////////////\n // Add styles to store\n\n function saveStyles(namespace, styles, store) {\n namespace = getNamespace(namespace);\n var namespaced = addNamespace(namespace, styles);\n new objct.e.extend(store, objct.e.deep(namespaced));\n new objct.e.extend(instanceStore, objct.e.deep(namespaced));\n }\n\n ///////////////////////////////////////////////////////////////////////////////\n // this.style(): Merge requested component and return \"flattened\" styles object\n\n function style(){\n var styles = Array.prototype.slice.call(arguments);\n var stored = new objct.e(store, objct.e.deep(ownerStyles));\n var returnStyles = [], style, extend, k;\n \n styles = flattenArray(styles);\n\n // flatten css \"classes\" and mix everything together -> output styles {};\n for(var i = 0; i<styles.length; i++) {\n style = styles[i];\n if(typeof style === \"string\") {\n if(!testConditional(style)) continue;\n // add namespace\n style = getNamespace(moduleNamespace, styles[i]);\n // get class\n style = getClassFromString(style, stored);\n }\n if(typeof style === \"object\") {\n\n // EXTEND STYLE\n if(typeof style._extend !== \"undefined\") {\n style._extend = typeof style._extend === \"string\" ?\n [style._extend]:\n style._extend;\n\n for(k=0; k<style._extend.length; k++) {\n if(!testConditional(style._extend[k])) continue;\n // add namespace\n extend = getNamespace(moduleNamespace, style._extend[k]);\n // get class\n extend = getClassFromString(extend, stored);\n\n if(typeof extend === \"object\"){\n returnStyles.push(extend);\n }\n }\n }\n\n returnStyles.push(style);\n }\n }\n\n styles = new objct(returnStyles);\n \n //cleanup \n returnStyles = {};\n for(style in styles){\n if(style !== \"_extend\" && (typeof styles[style] === \"string\" || typeof styles[style] === \"number\")) {\n returnStyles[style]= styles[style];\n }\n }\n return returnStyles;\n }\n\n /////////////////////////////////////////////////////////////////////////////// \n function onMouseEnter(e){\n if(node !== e.target) return;\n that.setState({\n hover:true\n });\n }\n /////////////////////////////////////////////////////////////////////////////// \n function onMouseLeave(e){\n if(node !== e.target) return;\n that.setState({\n hover:false\n });\n }\n /////////////////////////////////////////////////////////////////////////////// \n function onMouseDown(e){\n if(!nodeContains(node, e.target) && node !== e.target) return;\n that.setState({\n pressed:true\n });\n }\n /////////////////////////////////////////////////////////////////////////////// \n function onMouseUp(e){\n if(!nodeContains(node, e.target) && node !== e.target) return;\n that.setState({\n pressed:false\n });\n }\n /////////////////////////////////////////////////////////////////////////////// \n // transforms \"class:hover\" into \"this.state.hover && \"class\"\" then returns the result\n\n function testConditional(style){\n style = style.split(\":\");\n if(style.length < 2) return true;\n\n var condition = style[1];\n \n if(!that.state) {\n requireConditionals.push(condition);\n return false;\n }\n if(typeof that.state[condition] === \"undefined\") requireConditionals.push(condition);\n\n return that.state[condition];\n } \n\n }", "title": "" }, { "docid": "2349261afdfbb1c4ff699388afc22bf8", "score": "0.56460404", "text": "function createProperties() {\n var handlers = {};\n return {\n \"addEventListener\": {\n \"enumerable\": true\n , \"value\": addEventListener.bind(null, handlers)\n }\n , \"removeEventListener\": {\n \"enumerable\": true\n , \"value\": removeEventListener.bind(null, handlers)\n }\n , \"dispatchEvent\": {\n \"enumerable\": true\n , \"value\": dispatchEvent.bind(null, handlers)\n }\n };\n }", "title": "" }, { "docid": "a1adbd283e85a91f25687fe762b340ac", "score": "0.5637296", "text": "function getMyReact() {\n function render(element, parent) {\n // Get the props and type from element object\n var type = element.type,\n props = element.props; // Check if it is a text element\n\n var isTextElement = type === \"TEXT_ELEMENT\"; // Create a new dom element\n\n var dom = !isTextElement ? document.createElement(type) : document.createTextNode(props.nodeValue); // Filter for eventListeners in the props\n\n var isListener = function isListener(name) {\n return name.startsWith(\"on\");\n }; // Add eventListeners to the dom element\n\n\n Object.keys(props).filter(isListener).forEach(function (name) {\n var eventType = name.toLowerCase().substring(2);\n dom.addEventListener(eventType, props[name]);\n });\n\n var isAttribute = function isAttribute(name) {\n return !isAttribute && name !== \"children\";\n };\n\n Object.keys(props).filter(isAttribute).forEach(function (name) {\n dom[name] = props[name];\n }); // Check if there are any childrens of the given element\n\n var childElements = props.children || []; // render those childrens recursively first\n\n childElements.forEach(function (el) {\n return render(el, dom);\n }); // finally append the element to the parent element\n\n parent.appendChild(dom);\n }\n\n function createElement(type, config) {\n var _ref;\n\n var props = Object.assign({}, config);\n\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n var hasChildren = args.length > 0;\n var allChildren = hasChildren ? (_ref = []).concat.apply(_ref, args) : [];\n props.children = allChildren.filter(function (child) {\n return child !== null && child !== false;\n }).map(function (child) {\n return child instanceof Object ? child : createTextElement(child);\n });\n return {\n type: type,\n props: props\n };\n }\n\n function createTextElement(value) {\n return {\n type: TEXT_ELEMENT,\n props: {\n nodeValue: value\n }\n };\n }\n\n return {\n render: render,\n createElement: createElement\n };\n}", "title": "" }, { "docid": "a99f4b3a7458f8dcdebaa21b460713f7", "score": "0.55934495", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style, options) {\n function StyledComponent(props) {\n var children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"classes\", \"className\", \"clone\", \"component\"]);\n var className = (0, _classnames.default)(classes.root, classNameProp);\n\n if (clone) {\n return _react.default.cloneElement(children, {\n className: (0, _classnames.default)(children.props.className, className)\n });\n }\n\n var spread = other;\n\n if (style.filterProps) {\n var omittedProps = style.filterProps;\n spread = omit(spread, omittedProps);\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return _react.default.createElement(FinalComponent, (0, _extends2.default)({\n className: className\n }, spread), children);\n }\n\n \"development\" !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\r\n * A render function or node.\r\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n classes: _propTypes.default.object.isRequired,\n className: _propTypes.default.string,\n\n /**\r\n * If `true`, the component will recycle it's children DOM element.\r\n * It's using `React.cloneElement` internally.\r\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n throw new Error('You can not use the clone and component properties at the same time.');\n }\n }),\n\n /**\r\n * The component used for the root node.\r\n * Either a string to use a DOM element or a component.\r\n */\n component: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func, _propTypes.default.object]),\n theme: _propTypes.default.object\n }, style.propTypes || {}) : void 0;\n\n if (\"development\" !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat((0, _utils.getDisplayName)(Component), \")\");\n }\n\n var styles = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return (0, _withStyles.default)(styles, options)(StyledComponent);\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "aa0b1672dc7a6e4ac8290aefddc0c645", "score": "0.5568839", "text": "function mapReactProps(props) {\n var innerHTML = props.innerHTML,\n className = props.class,\n remainingProps = _objectWithoutPropertiesLoose(props, [\"innerHTML\", \"class\"]);\n\n var dangerouslySetInnerHTML = innerHTML ? {\n __html: innerHTML\n } : null;\n return _extends({\n dangerouslySetInnerHTML: dangerouslySetInnerHTML,\n className: className\n }, remainingProps);\n}", "title": "" }, { "docid": "e44dbcca8671226c504d8983199cfeaf", "score": "0.5429455", "text": "function createElement(type,config,children){var propName=void 0;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){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];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){if(typeof props.$$typeof==='undefined'||props.$$typeof!==REACT_ELEMENT_TYPE){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "32ecd46f9d006e2dc0b8116274f4a746", "score": "0.54092026", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx_default()(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: clsx_default()(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "8ea25e3e6454c19fbd147a6d7edd36ad", "score": "0.53964853", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){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];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){if(typeof props.$$typeof==='undefined'||props.$$typeof!==REACT_ELEMENT_TYPE){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.53198117", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.53198117", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.53198117", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.53198117", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5304331", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "675f8adea20dc25d1ff98d28ac1d02e6", "score": "0.52747935", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (false) {}\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.52706975", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.52706975", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.52706975", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.52706975", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "780988a4b14fdd15075453b0e92e585c", "score": "0.52594143", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "f6f0583c22e27f7f4f406c079c3c9aa1", "score": "0.52483654", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "a8ed8da7e2e2fdf3dbaf823ab77e14de", "score": "0.52334243", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\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[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t }", "title": "" }, { "docid": "b2d6ac5fd55a23502abfa0cec922d93e", "score": "0.5221483", "text": "function styled_styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx_m[\"a\" /* default */])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: Object(clsx_m[\"a\" /* default */])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5211643", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5211643", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5211643", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5211643", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52092165", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8ab326b5e3e014034ff27423e555e40a", "score": "0.5203972", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var name = options.name,\n stylesOptions = (0, _objectWithoutProperties2.default)(options, [\"name\"]);\n\n if (\"development\" !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (\"development\" !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = (0, _utils.getDisplayName)(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0, _makeStyles.default)(stylesOrCreator, (0, _extends2.default)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = _react.default.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n var classes = useStyles(props);\n var className = (0, _clsx.default)(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return _react.default.cloneElement(children, (0, _extends2.default)({\n className: (0, _clsx.default)(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/_react.default.createElement(FinalComponent, (0, _extends2.default)({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n \"development\" !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\n * A render function or node.\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n\n /**\n * If `true`, the component will recycle it's children HTML element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: _propTypes.default.elementType\n }, propTypes) : void 0;\n\n if (\"development\" !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "8c6beb1d502f298b3112192f276d79c6", "score": "0.519801", "text": "function createElement(name) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n const element = document.createElement(name);\n\n for (const [name, value] of Object.entries(props)) {\n if (name === 'style') {\n Object.assign(element.style, props.style);\n } else {\n element.setAttribute(name, value);\n }\n }\n\n for (const child of Array.isArray(children) ? children : [children]) {\n element.append(child);\n }\n\n return element;\n}", "title": "" }, { "docid": "3334afc514231e9b40aef0f50379033e", "score": "0.51944244", "text": "function createAnimatedComponent(Component) {\n var refName = 'animatedNode';\n var AnimatedComponentGenerated = (function (_super) {\n __extends(AnimatedComponentGenerated, _super);\n function AnimatedComponentGenerated(props) {\n var _this = _super.call(this, props) || this;\n _this._updateStyles(props);\n return _this;\n }\n AnimatedComponentGenerated.prototype.setNativeProps = function (props) {\n throw 'Called setNativeProps on web AnimatedComponent';\n };\n AnimatedComponentGenerated.prototype.componentWillReceiveProps = function (props) {\n this._updateStyles(props);\n };\n AnimatedComponentGenerated.prototype._updateStyles = function (props) {\n var _this = this;\n this._propsWithoutStyle = _.omit(props, 'style');\n if (!props.style) {\n this._initialStyle = undefined;\n this._animatedValues = [];\n return;\n }\n // If a style is present, make sure we initialize all animations associated with\n // animated values on it.\n // The way this works is:\n // - Animated value can be associated with multiple animated styles.\n // - When the component is being created we will walk through all the styles\n // and initialize all the animations within the animated value (the animation\n // gets registered when the animation function (e.g. timing) gets called, where the\n // the reference to the animation is kept within the animated value.\n // - We will initialize the animated value with the list of css properties and html element\n // where the style transition/animation. Should be applied and the css properties\n // associated with it: key and from/to values.\n // - Then we will kick off the animation as soon as it's initialized or flag it to\n // start anytime later.\n // Attempt to get static initial styles for the first build. After the build,\n // initializeComponent will take over and apply styles dynamically.\n var styles = Styles_1.default.combine(props.style);\n // Initialize the tricky properties here (e.g. transform).\n this._animatedValues = AnimatedTransform.initialize(styles);\n // Initialize the simple ones here (e.g. opacity);\n for (var key in styles) {\n if (styles[key] instanceof Value) {\n styles[key].addCssProperty(key, '##' + animatedPropUnits[key]);\n this._animatedValues.push(styles[key]);\n }\n }\n this._initialStyle = {};\n // Build the simple static styles\n for (var styleKey in styles) {\n if (_.isObject(styles[styleKey])) {\n continue;\n }\n else if (styles.hasOwnProperty(styleKey)) {\n this._initialStyle[styleKey] = styles[styleKey];\n }\n }\n // Add the complicated styles\n _.each(this._animatedValues, function (value) {\n value.updateElementStylesOnto(_this._initialStyle);\n });\n };\n AnimatedComponentGenerated.prototype.initializeComponent = function (props) {\n // Conclude the initialization setting the element.\n var element = ReactDOM.findDOMNode(this.refs[refName]);\n if (element) {\n this._animatedValues.forEach(function (Value) {\n Value.setAsInitialized(element);\n });\n }\n };\n AnimatedComponentGenerated.prototype.componentDidMount = function () {\n this.initializeComponent(this.props);\n };\n AnimatedComponentGenerated.prototype.componentDidUpdate = function () {\n this.initializeComponent(this.props);\n };\n AnimatedComponentGenerated.prototype.componentWillUnmount = function () {\n _.each(this._animatedValues, function (value) {\n value.destroy();\n });\n this._animatedValues = [];\n };\n AnimatedComponentGenerated.prototype.focus = function () {\n var component = this.refs[refName];\n if (component.focus) {\n component.focus();\n }\n };\n AnimatedComponentGenerated.prototype.blur = function () {\n var component = this.refs[refName];\n if (component.blur) {\n component.blur();\n }\n };\n AnimatedComponentGenerated.prototype.setFocusRestricted = function (restricted) {\n var component = this.refs[refName];\n if (component.setFocusRestricted) {\n component.setFocusRestricted(restricted);\n }\n };\n AnimatedComponentGenerated.prototype.setFocusLimited = function (limited) {\n var component = this.refs[refName];\n if (component.setFocusLimited) {\n component.setFocusLimited(limited);\n }\n };\n AnimatedComponentGenerated.prototype.render = function () {\n return (React.createElement(Component, __assign({ style: this._initialStyle }, this._propsWithoutStyle, { ref: refName }), this.props.children));\n };\n // Update the component's display name for easy debugging in react devtools extension\n AnimatedComponentGenerated.displayName = \"Animated.\" + (Component.displayName || Component.name || 'Component');\n return AnimatedComponentGenerated;\n }(React.Component));\n return AnimatedComponentGenerated;\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.5179984", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "fb30e38a5f86cd0cfd7d9932a39497dc", "score": "0.5177782", "text": "function createClass() {\n\tvar definition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n\tvar _definition$_isPrivat = definition._isPrivate,\n\t _isPrivate = _definition$_isPrivat === undefined ? false : _definition$_isPrivat,\n\t getDefaultProps = definition.getDefaultProps,\n\t _definition$statics = definition.statics,\n\t statics = _definition$statics === undefined ? {} : _definition$statics,\n\t _definition$component = definition.components,\n\t components = _definition$component === undefined ? {} : _definition$component,\n\t _definition$reducers = definition.reducers,\n\t reducers = _definition$reducers === undefined ? {} : _definition$reducers,\n\t _definition$selectors = definition.selectors,\n\t selectors = _definition$selectors === undefined ? {} : _definition$selectors,\n\t _definition$initialSt = definition.initialState,\n\t initialState = _definition$initialSt === undefined ? getDefaultProps && (0, _stateManagement.omitFunctionPropsDeep)(getDefaultProps.apply(definition)) : _definition$initialSt,\n\t _definition$propName = definition.propName,\n\t propName = _definition$propName === undefined ? null : _definition$propName,\n\t _definition$propTypes = definition.propTypes,\n\t propTypes = _definition$propTypes === undefined ? {} : _definition$propTypes,\n\t _definition$render = definition.render,\n\t render = _definition$render === undefined ? function () {\n\t\treturn null;\n\t} : _definition$render,\n\t restDefinition = _objectWithoutProperties(definition, ['_isPrivate', 'getDefaultProps', 'statics', 'components', 'reducers', 'selectors', 'initialState', 'propName', 'propTypes', 'render']);\n\n\tvar newDefinition = _extends({\n\t\tgetDefaultProps: getDefaultProps\n\t}, restDefinition, {\n\t\tstatics: _extends({}, statics, components, {\n\t\t\t_isPrivate: _isPrivate,\n\t\t\treducers: reducers,\n\t\t\tselectors: selectors,\n\t\t\tinitialState: initialState,\n\t\t\tpropName: propName\n\t\t}),\n\t\tpropTypes: (0, _assign3.default)({}, propTypes, (0, _mapValues3.default)(definition.components, function () {\n\t\t\treturn _propTypes2.default.any;\n\t\t})),\n\t\trender: render\n\t});\n\n\tnewDefinition.statics.definition = newDefinition;\n\n\treturn (0, _createReactClass2.default)(newDefinition);\n}", "title": "" }, { "docid": "fd6dc2f863c2d94933e2600e7e10d439", "score": "0.5169753", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){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];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "fd6dc2f863c2d94933e2600e7e10d439", "score": "0.5169753", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){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];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "2fb2859aa8c7cf66f052f0226c3da2e9", "score": "0.5169139", "text": "function createStyleAttribute(vnode) {\n const {\n elm,\n data: {\n styleMap\n }\n } = vnode;\n\n if (isUndefined(styleMap)) {\n return;\n }\n\n const {\n style\n } = elm;\n\n for (const name in styleMap) {\n style[name] = styleMap[name];\n }\n }", "title": "" }, { "docid": "604bb2200e5856bd8dcfc3c9d4ab50b0", "score": "0.5130447", "text": "function DomStyleObj(styleName){\n\t\t\n\t\tthis.styleName = styleName;\n\t}", "title": "" }, { "docid": "f6f3154e4639da1006f5306d21279ee6", "score": "0.51302445", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__[\"a\" /* default */])(options, [\"name\"]);\n\n if (process.env.NODE_ENV !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = Object(__WEBPACK_IMPORTED_MODULE_5__material_ui_utils__[\"g\" /* getDisplayName */])(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(__WEBPACK_IMPORTED_MODULE_7__makeStyles__[\"a\" /* default */])(stylesOrCreator, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = __WEBPACK_IMPORTED_MODULE_2_react___default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(__WEBPACK_IMPORTED_MODULE_3_clsx__[\"default\"])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return __WEBPACK_IMPORTED_MODULE_2_react___default.a.cloneElement(children, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n className: Object(__WEBPACK_IMPORTED_MODULE_3_clsx__[\"default\"])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(FinalComponent, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n process.env.NODE_ENV !== \"production\" ? StyledComponent.propTypes = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n /**\n * A render function or node.\n */\n children: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.node, __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func]),\n\n /**\n * @ignore\n */\n className: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,\n\n /**\n * If `true`, the component will recycle it's children HTML element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: Object(__WEBPACK_IMPORTED_MODULE_5__material_ui_utils__[\"b\" /* chainPropTypes */])(__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.elementType\n }, propTypes) : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n __WEBPACK_IMPORTED_MODULE_6_hoist_non_react_statics___default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "88b864e3a97b9188f2c06c5a3a105d2c", "score": "0.51225793", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var name = options.name,\n stylesOptions = (0, _objectWithoutProperties2.default)(options, [\"name\"]);\n\n if (process.env.NODE_ENV !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = (0, _utils.getDisplayName)(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0, _makeStyles.default)(stylesOrCreator, (0, _extends2.default)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = _react.default.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n var classes = useStyles(props);\n var className = (0, _clsx.default)(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return _react.default.cloneElement(children, (0, _extends2.default)({\n className: (0, _clsx.default)(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/_react.default.createElement(FinalComponent, (0, _extends2.default)({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n process.env.NODE_ENV !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\n * A render function or node.\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes.default.elementType\n }, propTypes) : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "72d21667c1636b7abafde858fa8f01ec", "score": "0.5107218", "text": "function styled_styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx_m[\"a\" /* default */])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = styled_omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: Object(clsx_m[\"a\" /* default */])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "d763276ef4fb3f00a7e7dcc5cf30ca0f", "score": "0.5101636", "text": "setClass(element, tfStyle) {\n if (!element) {\n return null;\n }\n const Element = element.type;\n return (\n <div style={tfStyle}>\n <Element {...element.props} />\n </div>\n );\n }", "title": "" }, { "docid": "d4de4ac12cd301db33477789db9d3509", "score": "0.5096631", "text": "render() {\n // inline style\n const style = {\n backgroundColor: 'white',\n font: 'inherit',\n border: '1px solid pink',\n padding: '8px',\n cursor: 'pointer'\n };\n\n // It has to return elements that will be rendered to the screen\n return (\n // That code looks like HTML but it's not - it's JSX - it's JS synthetic sugar - it will be compiled to JS\n // JSX allow us to write HTML code in JS files (the X is for XML).\n // All the elements that we are using (as div..) are provided by the React library, they are not the real HTML tags, React is converting them behind the scenes.\n // But we have some restrictions:\n // 1. Usually we use class instead of className, but class can't be use because it's a reserved word in JS - className is rendered to be class.\n // 2. Our JSX expression must have one root element. It's a best practice to wrap everything in one root element.\n <div className=\"App\">\n <h1>Hi, I'm a React App!</h1>\n <p>This is really working</p>\n <button style={style} onClick={() => this.switchNameHandler('Maximilian')}>Switch Name</button>\n <Person name={this.state.persons[0].name} click={() => this.switchNameHandler('Max!!!')}/>\n <Person name={this.state.persons[1].name} changed={this.nameChangedHandler}>My Hobbies: Tennis</Person>\n <Person name=\"Stephanie\"/>\n </div>\n );\n // The code above is compiled to this code\n // createElement gets an infinite nums of args, but minimum of 3.\n // return React.createElement('div', { className: 'App' }, React.createElement('h1', null, 'I\\'m a React App!'));\n }", "title": "" }, { "docid": "3a64a217cbe8333c3ed31dda8ca5f533", "score": "0.509472", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (\"development\" !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "f479ac70912422b50a730a8a63a03914", "score": "0.5092185", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(options, [\"name\"]);\n\n if ( true && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if ( true && !name) {\n // Provide a better DX outside production.\n var displayName = Object(_material_ui_utils__WEBPACK_IMPORTED_MODULE_5__[\"getDisplayName\"])(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(_makeStyles__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(stylesOrCreator, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(classes.root, classNameProp);\n\n if (clone) {\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.cloneElement(children, {\n className: Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(children.props.className, className)\n });\n }\n\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (typeof children === 'function') {\n return children(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(FinalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n ref: ref,\n className: className\n }, spread), children);\n });\n true ? StyledComponent.propTypes = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n /**\n * A render function or node.\n */\n children: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node, prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func]),\n\n /**\n * @ignore\n */\n className: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n */\n clone: Object(_material_ui_utils__WEBPACK_IMPORTED_MODULE_5__[\"chainPropTypes\"])(prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.elementType\n }, propTypes) : undefined;\n\n if (true) {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.50905836", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" } ]
ac78ac33a4e9b09e1496e01a63dca5d7
|| || Navigation || ||
[ { "docid": "d2fefc8384950f670d88fb4b544376d7", "score": "0.0", "text": "function toggleNav() {\n jQuery('.menu-toggle').click(function() {\n\n var navWidth,\n mobileNavMenu = jQuery('.mobile-nav-menu'),\n pageWrapper = jQuery('.wrapper'),\n menuSpeed = 250;\n\n // Copy navigation to mobile once when needed, and move register button to top of list\n if (!mobileNavMenu.find('.menu').length > 0) {\n jQuery('.primary-nav').find('.menu').clone().appendTo('.mobile-nav-menu');\n mobileNavMenu.find('.register').prependTo(mobileNavMenu.find('.menu'));\n }\n\n // Show and hide navigation\n if (pageWrapper.hasClass('open')) {\n pageWrapper.removeClass('open').animate({left: '0', right: '0'}, menuSpeed);\n mobileNavMenu.removeClass('open');\n } else {\n navWidth = mobileNavMenu.width();\n pageWrapper.addClass('open').animate({left: '-'+navWidth+'px', right: navWidth+'px'}, menuSpeed);\n mobileNavMenu.addClass('open');\n }\n });\n}", "title": "" } ]
[ { "docid": "c3e20b5a42b50b198237dbef87cf006e", "score": "0.76211786", "text": "function _addNavigation() {}", "title": "" }, { "docid": "cc09c41f37a9843a73f1d3a2e0466e93", "score": "0.7266125", "text": "function PagesNavigation() {\n\n}", "title": "" }, { "docid": "ea5bf8b1ea6c391979172cc3bdf468aa", "score": "0.68362355", "text": "function setupNavigation() {\n\tconsole.log('Rendering Page...');\n\tsetToolTab();\n\tsetContextItem();\n}", "title": "" }, { "docid": "a8d45a8bc1d06832694e1b9ddd9f9540", "score": "0.68094563", "text": "createNavigation() {\n var nav = super.createNavigation();\n nav.left.push(new NavButton('Review/Change Responses', this.back, true, false, 0));\n nav.right.push(new NavButton('Submit Assessment', scope.submitAndEnd, true, !this.isValid, 1));\n nav.right.push(new NavButton('Save and Exit', saveAndExit, true, false, 0));\n\n this.navigation = nav;\n }", "title": "" }, { "docid": "826c34ec05eef8d86d605b7d0235720d", "score": "0.6800752", "text": "function _plmNav(navInfo)\r\n{\t\r\n\tif(navInfo!=null)\r\n\t{\r\n\t\tloadWorkArea(navInfo,\"\",\"\",loadNavigationGrid);\r\n\t}\t\r\n}", "title": "" }, { "docid": "25b9a47daa9ba3b00e9ef5f8fa6f9e12", "score": "0.67783684", "text": "mainNav() {}", "title": "" }, { "docid": "224a8bfe7d33e179ce12bea90984df6b", "score": "0.6765958", "text": "function renderNavigationMenu() {\n\n }", "title": "" }, { "docid": "0e2f0d403b4e1c504511c6f8a5d44bc6", "score": "0.67291254", "text": "function setupNav() {\n Alloy.Globals.Menu.setTitle(\"Task Gallery\");\n Alloy.Globals.Menu.setColor(\"#aaa\");\n\n // Add menu\n Alloy.Globals.Menu.setButton({\n button: 'l1',\n image : \"/images/navigation/ic_chevron_left_white_48dp.png\",\n success: function() {\n log.debug('[Gallery] : Redirecting to Detail Page');\n Alloy.Globals.Menu.setMainContent('TodoListDetail', {todo_id: todoItem.get('todo_id')});\n //Alloy.Globals.Menu.goBack();\n }\n });\n\n Alloy.Globals.Menu.setButton({\n button: 'r2',\n image: \"/images/action/ic_search_white_48dp.png\",\n success: function() {\n if ($.search.height == 0) {\n $.search.height = 44;\n } else {\n $.search.height = 0;\n }\n\n }\n });\n\n Alloy.Globals.Menu.setButton({\n button: 'r1',\n image: \"/images/action/ic_add_white_48dp.png\",\n success: function() {\n require('Camera').promptGalleryOrCamera();\n }\n });\n\n Alloy.Globals.Menu.showButton('r1');\n Alloy.Globals.Menu.hideButton('r2');\n Alloy.Globals.Menu.showButton('l1');\n}", "title": "" }, { "docid": "ee4dfa131a7d6d825e31c39f341c56f1", "score": "0.66794527", "text": "function navigation() {\n\n console.log(\"Bienvenue dans le gestionnaire de contact\");\n console.log(\"1 : Liste des contacts\");\n console.log(\"2 : Ajouter un contact\");\n console.log(\"3 : Quitter\");\n}", "title": "" }, { "docid": "0731a62f9dd7c34ef3389f2c6990d77a", "score": "0.6638428", "text": "onRender () {\n let Navigation = new NavigationView();\n App.navigationRegion.show(Navigation);\n Navigation.setItemAsActive(\"home\");\n }", "title": "" }, { "docid": "801ec79b6c75bcbfd7ccbf317c2c1787", "score": "0.6626949", "text": "function navigation() {\n\t\n\t/* @TODO: reverse li und stelle angemeldet als nach oben */\n\t//$$('#account ul').insert( $$('#account ul li').reverse() );\n}", "title": "" }, { "docid": "89a6294a6db78022c96795f11cf9db37", "score": "0.66223156", "text": "createNavigation() {\n var nav = {\n left: [],\n right: []\n };\n nav.right.push(new NavButton('Review Results', scope.review, true, false, 0));\n\n this.navigation = nav;\n }", "title": "" }, { "docid": "f32f06c01faac9c35c250e9a848e5e46", "score": "0.6602626", "text": "createNavigation() {\n var nav = super.createNavigation();\n nav.right.push(new NavButton('Continue', this.next, true, true));\n this.navigation = nav;\n }", "title": "" }, { "docid": "b56f67f5f4d4807da218299e1ff8ded7", "score": "0.65832365", "text": "createNavigation() {\n var nav = super.createNavigation();\n nav.left.push(\n new NavButton('Back', this.back, !this.isFirstQuestionOfWizard, false, 0));\n nav.left.push(\n new NavButton('Cancel', this.cancel, true, false, 1));\n nav.right.push(\n new NavButton('Continue', this.next, true, false, 1));\n nav.right.push(\n new NavButton('Save and Exit', this.saveAndExit, true, false, 0));\n\n this.navigation = nav;\n }", "title": "" }, { "docid": "35a38fb71989ea79e741c77147044bdc", "score": "0.6572983", "text": "function onNavigatedTo(args) {\n page = args.object;\n \n //create a reference to the topmost frame for navigation\n topmostFrame = frameMod.topmost();\n}", "title": "" }, { "docid": "45fdc1fe2d320f4d7e2d99d494e2ee46", "score": "0.65658396", "text": "function navigate(nav, navArray){\n for (var i = 0; i < navArray.length; i++) {\n if (nav == navArray[i].nav) {\n navArray[i].page.style.display = \"block\";\n if (nav != document.getElementById('homenav')){\n navArray[i].nav.style.backgroundColor = \"#FAA669\";\n }\n navArray[i].nav.style.cursor = \"default\";\n } else {\n if (!(navArray[i].page == account && (nav == signNav || nav == logNav)))\n {\n navArray[i].page.style.display = \"none\";\n }\n if (navArray[i].nav != document.getElementById('homenav')){\n navArray[i].nav.style.backgroundColor = navArray[i].color;\n }\n navArray[i].nav.style.cursor = \"pointer\";\n }\n }\n }", "title": "" }, { "docid": "77977b22a35cef7647bf605a7e0e74b5", "score": "0.65429294", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "cf412027175dc3e636a241aee322339a", "score": "0.65097636", "text": "function MAIN_NAVIGATION$static_(){ToolbarSkin.MAIN_NAVIGATION=( new ToolbarSkin(\"main-navigation\"));}", "title": "" }, { "docid": "39b78f55686670f0fca2da2cd1a6e5e6", "score": "0.6499193", "text": "function setupPublicNavigation() {\n Navigation.clear();\n Navigation.breadcrumbs.add('Openings', '#!/openings', '#!/openings'); // add a breadcrumb\n Navigation.viewTitle.set('View Opening');\n }", "title": "" }, { "docid": "a02972316e557c9ab7b482440d5b5a7a", "score": "0.64539886", "text": "function setNavigation() {\r\n\t\t\tvar i, html = '';\r\n\r\n\t\t\t//generate the buttons\r\n\t\t\tif(o.buttons) {\r\n\t\t\t\t$nav = $('<ul />', {\r\n\t\t\t\t\tid: o.navigationId\r\n\t\t\t\t});\r\n\t\t\t\tfor(i = 0; i < itemNum; i++) {\r\n\t\t\t\t\thtml += '<li><span></span></li>';\r\n\t\t\t\t}\r\n\t\t\t\t$nav.html(html).appendTo($root).fadeIn(700);\r\n\r\n\t\t\t\t$navLi = $nav.find('li');\r\n\t\t\t\t$navLi.eq(0).addClass(o.selectedClass);\r\n\t\t\t}\r\n\r\n\t\t\t//generate the arrows\r\n\t\t\tif(o.arrows) {\r\n\t\t\t\t$prevArrow = $('<div />', {\r\n\t\t\t\t\t'class': o.prevArrowClass\r\n\t\t\t\t}).appendTo($root);\r\n\t\t\t\t$nextArrow = $('<div />', {\r\n\t\t\t\t\t'class': o.nextArrowClass\r\n\t\t\t\t}).appendTo($root);\r\n\t\t\t}\r\n\r\n\t\t}", "title": "" }, { "docid": "6266fc07d65c7f70f344b19e2e512ce4", "score": "0.6414357", "text": "function showNavigator() {\n console.log('>> Wunderlist Navigator shortcut clicked');\n $(Config.LIST_SWITCHER).show();\n $(Config.LIST_INPUT).focus();\n var lists = [];\n $(Config.LIST_LINKS).each(function (index, element) {\n var list = {};\n var $this = $(this);\n list.href = $this.attr('href');\n list.title = $this.find('.title').text();\n lists.push(list);\n });\n allLists = lists;\n populateLists(lists);\n }", "title": "" }, { "docid": "5247882e54318279aca46f2a540d7c39", "score": "0.6407787", "text": "function updateNavigation()\r\n {\r\n $('#linkLogin').hide();\r\n $('#linkRegister').hide(); \r\n $('#linkListBooks').show();\r\n $('#linkCreateBook').show();\r\n $('#linkLogout').show();\r\n showPage('viewBooks');\r\n }", "title": "" }, { "docid": "fcf72b4051af47128ee114bccc468f94", "score": "0.63830465", "text": "function main(){\r\n // build the nav\r\n createNav();\r\n\r\n // Add class 'active' to section when near top of viewport\r\n toggleActive();\r\n}", "title": "" }, { "docid": "6d390e474517594844eb3aef6d6aa03e", "score": "0.638287", "text": "function globalNavOpen() {\n openNav(navBtn);\n openNav(navMenu);\n}", "title": "" }, { "docid": "af56b3095538bad83f0574584ba30b17", "score": "0.6365035", "text": "function visSingleView() {\n console.log(\"visSingleView\");\n //add history.back();\n //Konstant der bestemmer window.location.search\n //Konstant der definerer en unik egenskab (her fx. navn).\n //Konstant der definerer URL til json\n //Andre lokale variabler\n //opret en klon med alle info fra json og sæt ind på siden vha textContent, link til billede + alt.\n}", "title": "" }, { "docid": "9604adf30f443d4fd6e262e91fc851d0", "score": "0.6364404", "text": "function determineNavAction() {\n if (options.jq.navContent.is(':hidden')) {\n openNav();\n } else {\n closeNav();\n }\n }", "title": "" }, { "docid": "9f8e69c6336b9873c545e1018c844c07", "score": "0.6352655", "text": "function setupPageNavs () {\n\t\t// For any nested list items, wrap the link text in a span so that we can put a border under the text on hover.\n\t\t$mobilemenu.find(\".ibm-mobilemenu-section li li a\").wrapInner(\"<span>\");\n\n\t\tIBM.common.util.a11y.makeTreeAccessible({\n\t\t\tel: $mobilemenu.find(\".ibm-mobilemenu-pagenav > ul\")\n\t\t});\n\t}", "title": "" }, { "docid": "61282b85b5c607330a6f73c25be4cc3e", "score": "0.634626", "text": "function navigations() {\n\t//Navigation Button\n\t$(\"#nav_schedule\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_schedule_sec\").offset().top\n\t\t}, 500);\n\t});\n\t$(\"#nav_features\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_features_sec\").offset().top\n\t\t}, 500);\n\t});\n\t$(\"#nav_benefits\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_benefits_sec\").offset().top\n\t\t}, 500);\n\t});\n\t$(\"#nav_statements\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_statements_sec\").offset().top\n\t\t}, 500);\n\t});\n\t$(\"#nav_login\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_login_sec\").offset().top\n\t\t}, 500);\n\t});\n\n\t$(\"#nav_top\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#top\").offset().top\n\t\t}, 500);\n\t});\n\n}", "title": "" }, { "docid": "dde9213f5cf3345245a85087929cf2db", "score": "0.63203454", "text": "get navigation() {\r\n return new Navigation(this);\r\n }", "title": "" }, { "docid": "127bd6e64b3c568fe1f0a4571be6d3bc", "score": "0.63118786", "text": "function findNavigation() {\n var navs = d.querySelectorAll('.' + proto.classes.nav);\n for (var i = navs.length; i--;) {\n new Navigation({ parent: navs[i] });\n }\n }", "title": "" }, { "docid": "dd4b302e7eb09bfcdd5c02cb1e92d921", "score": "0.62895286", "text": "homeClicked() {\n this.props.navChanged(\"Home\");\n }", "title": "" }, { "docid": "93b0f8748fef06f0f574b75828a9eaff", "score": "0.6278238", "text": "nav_helper_view(data) {\n\t\tp11.nav_helper_view(data);\n\t\tutil.elementClickable(p11.nextBtn)\n\t}", "title": "" }, { "docid": "bdc0416d3180ba90c491711755e186f3", "score": "0.62623477", "text": "function navActions () {\n $navMain.slideToggle();\n toggleClassOnVisibility($siteLogo, classToToggle);\n}", "title": "" }, { "docid": "dc64e0787d47e39598225313ea10d51b", "score": "0.6255101", "text": "function vfNavigationOnThisPage() {\n var scope = document;\n // based on the attribute we select all navigation links\n var navLinks = scope.querySelectorAll(\"[data-vf-js-navigation-on-this-page-container='true'] .vf-navigation__item a\");\n // we store all ids from anchor tags to know the sections we should care about\n var ids = [];\n navLinks.forEach(function (link) {\n if (link.hash) {\n ids.push(link.hash.substring(1));\n }\n });\n // get all elements with an id and convert it from NodeList to Array\n var sections = Array.prototype.slice.call(scope.querySelectorAll(\"[id]\"));\n var sectionPositions = [];\n if (!navLinks || !sections) {\n // exit: either sections or section content not found\n return;\n }\n if (navLinks.length === 0 || sections.length === 0) {\n // exit: either sections or section content not found\n return;\n }\n // remove all the elements that doesn't appear in the navigation based on it's id\n sections = sections.filter(function (section) {\n return ids.indexOf(section.id) !== -1;\n });\n function activateNavigationItem() {\n // althought costly, we recalculate the position of elements each time as things move or load dynamically\n sectionPositions = [];\n sections.forEach(function (e) {\n var rect = e.getBoundingClientRect();\n var scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n sectionPositions.push({\n id: e.id,\n position: rect.top + scrollTop\n });\n });\n // put sections in the bottom at the beginning of the array\n sectionPositions.reverse();\n var scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;\n // We reverse the array because Array.find starts to search from position 0 and to simplify\n // the logic to find which element is closest to the current scroll position, otherwise it will always\n // select the first element.\n var currentSection = sectionPositions.find(function (s) {\n return !(scrollPosition <= s.position - 95);\n });\n navLinks.forEach(function (link) {\n link.setAttribute(\"aria-selected\", \"false\");\n });\n // if we don't match any section yet, highlight the first link\n if (!currentSection) {\n navLinks[0].setAttribute(\"aria-selected\", \"true\");\n } else {\n navLinks.forEach(function (link) {\n if (link.hash === '#' + currentSection.id) {\n link.setAttribute(\"aria-selected\", \"true\");\n }\n });\n }\n isCalculating = false;\n }\n var isCalculating = false;\n window.onscroll = function () {\n if (!isCalculating) {\n isCalculating = true;\n window.requestAnimationFrame(activateNavigationItem);\n }\n };\n navLinks.forEach(function (link) {\n link.addEventListener(\"click\", function (event) {\n var section = document.querySelector(link.hash);\n var scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;\n if (!section) return;\n event.preventDefault();\n // get current styles of element we are moving to\n var elemStyles = window.getComputedStyle(section);\n // take into account the padding and/or margin top\n var value = elemStyles.paddingTop !== '0px' ? elemStyles.paddingTop : elemStyles.marginTop;\n // we remove the px characters from the value\n var offset = parseInt(value.slice(0, -2), 10);\n // total offset: margin/padding top of the element plus the size of the navigation bar\n window.scroll({\n top: section.getBoundingClientRect().top + scrollPosition - (offset + 40),\n behavior: 'smooth'\n });\n });\n });\n}", "title": "" }, { "docid": "22f03e3f140238d98fb6d8dd111410ac", "score": "0.6252773", "text": "function navigatePage_elementsExtraJS() {\n // screen (navigatePage) extra code\n /* navigateList */\n listView = $(\"#navigatePage_navigateList\");\n theme = listView.attr(\"data-theme\");\n if (typeof theme !== 'undefined') {\n var themeClass = \"ui-btn-up-\" + theme;\n listItem = $(\"#navigatePage_navigateList .ui-li-static\");\n $.each(listItem, function(index, value) {\n $(this).addClass(themeClass);\n });\n }\n /* nearbyButton */\n /* scanCodeButton */\n /* currentSelectionsButton */\n /* menuHistoryButton */\n /* favoritesButton */\n /* wishListButton */\n /* orderHistoryButton */\n /* searchPageReturnButton */\n /* updateProfileButton */\n /* settingsButton */\n /* helpButton */\n /* ratingInfoPageButton */\n /* logoutButton */\n /* logoutConfirmPopup */\n $(\"#navigatePage_logoutConfirmPopup\").popup(\"option\", \"positionTo\", \"window\");\n /* loginGotoPopup */\n $(\"#navigatePage_loginGotoPopup\").popup(\"option\", \"positionTo\", \"window\");\n /* quickMessagePopup */\n $(\"#navigatePage_quickMessagePopup\").popup(\"option\", \"positionTo\", \"window\");\n /* locationPopup */\n $(\"#navigatePage_locationPopup\").popup(\"option\", \"positionTo\", \"window\");\n /* featureLocationList */\n listView = $(\"#navigatePage_featureLocationList\");\n theme = listView.attr(\"data-theme\");\n if (typeof theme !== 'undefined') {\n var themeClass = \"ui-btn-up-\" + theme;\n listItem = $(\"#navigatePage_featureLocationList .ui-li-static\");\n $.each(listItem, function(index, value) {\n $(this).addClass(themeClass);\n });\n }\n /* featureLocationListItem */\n /* locationList */\n listView = $(\"#navigatePage_locationList\");\n theme = listView.attr(\"data-theme\");\n if (typeof theme !== 'undefined') {\n var themeClass = \"ui-btn-up-\" + theme;\n listItem = $(\"#navigatePage_locationList .ui-li-static\");\n $.each(listItem, function(index, value) {\n $(this).addClass(themeClass);\n });\n }\n /* locationItem */\n }", "title": "" }, { "docid": "a6f20176e28b4164d4c2dfa7604e56c9", "score": "0.62496054", "text": "function setupNav() {\n setupPageSelector();\n setupRecipeSelector();\n}", "title": "" }, { "docid": "1bbeec5480b1b157b67c24c90923955a", "score": "0.6244957", "text": "renderNavigationButton() {\n const { showNavigationButton } = this.props;\n const { destinationReached, isNavigation } = this.state;\n\n if (destinationReached || isNavigation || !showNavigationButton) {\n return null;\n }\n\n return this.renderButton('Start Navigation', this.startNavigation);\n }", "title": "" }, { "docid": "124c212fc3a7da2785b1254c021679de", "score": "0.62429416", "text": "function navigationBar() {\n authToken = localStorage.getItem(\"authToken\");\n $('#container').show();\n\n if (authToken === null) {\n navBar.find('a').hide();\n navBar.find('.active').show();\n showMainView();\n $('#welcome-container').find(\"h2\").show()\n welcomeButtons.show()\n profile.hide()\n } else {\n $('#welcome-container').find(\"h2\").hide()\n welcomeButtons.hide()\n navBar.find('a').show();\n navBar.find('.active').show();\n loadAllListings()\n profile.show();\n profile.find(\"a:first-child\").text(\"Welcome \" + localStorage.getItem(\"username\"))\n }\n }", "title": "" }, { "docid": "81a710c1a16086480e8be2810bdb7c7a", "score": "0.6238148", "text": "function OsNavAdditionInfo() {\r\n $('.os-menu a[href=\"#\"]').on('click', function (event) {\r\n event.preventDefault();\r\n });\r\n $('.os-menu li').has('ul').addClass('li-node').parent().addClass('ul-node');\r\n //$('.os-menu .mega-menu:not(.menu-fullwidth)').parent().css('position', 'relative')\r\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.6225703", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.6225703", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.6225703", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.6225703", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.6225703", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "c3fa781c75aca41781b0220b3351da5b", "score": "0.6222194", "text": "function navigation(){\n\n\t$('#chapter > li:first-child').remove();\n\n\t// ACTIVATES CHAPTER NAVIGATION\n\t$('.navigationLevel').on('click', function(){\n\t\tif($(window).width() > 768) {\n\t\t\t$(this).toggleClass('active').parent().addClass('active').siblings('#chapter').removeClass('fromLeft').addClass('active')\n\t\t} else {\n\t\t\t$(this).addClass('active').parents().eq(1).addClass('Chapters');\n\t\t\t$('.breadcrumbsMobile').addClass('levelOne');\n\t\t}\n\t});\n\n\t// MUTE SOUND AND STOP ANIMATION\n\t$('.miniTimelineSound').on('click', function(){\n\t\t$(this).toggleClass('active');\n\t});\n\n\t// TOGGLE NAVIGATION TIMELINE\n\tfunction navigationClick(){\n\t\t$('.miniTimelineNav').on('click', function(e){\n\t\t\t$(this).toggleClass('active');\n\t\t\t$('.nav').toggleClass('active');\n\t\t\t$('#chapter').removeClass('active');\n\t\t\te.stopPropagation();\n\t\t});\n\t\t$(document).on('click', function(e){\n\t\t\tif($(e.target).is('.miniTimelineNav') === false && $('#chapter').hasClass('active') === false) {\n\t\t\t\t$('.miniTimelineNav').removeClass('active');\n\t\t\t\t$('.nav').removeClass('active');\n\n\t\t\t}\n\t\t});\n\t}\n\tnavigationClick();\n\t// CLOSE CHAPTERS FROM WITHIN CHAPTERS\n\t$('.closeChapters').on('click', function(){\n\t\t$('#chapter').removeClass('active');\n\t\t$('.navigationList').removeClass('active');\n\t\t$('.nav').removeClass('active');\n\t});\n\t// CLOSE NAVIGATION FROM WITHIN MENU\n\t$('.navigationClose').on('click', function(){\n\t\t$('.miniTimelineNav').removeClass('active');\n\t\t$('.nav').removeClass('active');\n\t});\n\n\t// ADHERE CUSTOM SHARE TAGS TO SOCIAL LINKS\n\n\t// http://www.facebook.com/sharer.php?u=http://www.wearekoch.com/articles/building-steam.aspx\n\n\t// http://twitter.com/share?url=http://wearekoch.com/articles/building-steam&text=We Are Koch - Building Steam\n\n\t// mailto:?Subject=We Are Koch - Building Steam&Body=We Are Koch - Building Steam http://www.wearekoch.com/articles/building-steam\n\n\t$('.facebook').attr('href', 'http://www.facebook.com/sharer.php?u=' + queryString);\n\t$('.twitter').attr('href', 'http://twitter.com/share?url=http://www.kochind.com/timeline/' + queryString);\n\t$('.linkedin').attr('href', 'https://www.linkedin.com/cws/share?url=http://www.kochind.com/timeline/' + queryString);\n\n}", "title": "" }, { "docid": "1c64cf67f60dd64a38e37abc17ca5be6", "score": "0.6220915", "text": "function handleNavigation(){\r\n document.body.scrollTo({ y: 0 });\r\n var path = window.location.pathname;\r\n var hash = window.location.hash ? window.location.hash.substr(1) : '';\r\n \r\n getPage(path).then($html => {\r\n // remove old content\r\n while ($content.firstChild)\r\n $content.removeChild($content.firstChild);\r\n \r\n // add new content\r\n $content.appendChild($html);\r\n\r\n // update UI\r\n updateUi(path, hash);\r\n });\r\n}", "title": "" }, { "docid": "10510ea2d3b8e9ae9a046ceec0b91f6e", "score": "0.6206077", "text": "function navigation(clickElement, functionName, Element) {\n\t\t\t$(clickElement).on('click',function() {\n\t\t\t\t$('header ul li').removeClass('active');\n\t\t\t\t$(Element).hide();\n\t\t\t\tvar slideview = $(this).parent()[functionName](\"div \"+Element).attr('id');\n\t\t\t\tif(typeof slideview == 'undefined') {\n\t\t\t\t\tslideview = $(this).parent().attr('id');\n\t\t\t\t}\n\t\t\t\t$('#'+slideview).show();\n\t\t\t\t$('header ul li#' + slideview + 'Active').addClass('active');\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "7f2d45c8d3e1cbf2ac4886908333564b", "score": "0.6205461", "text": "function generateNav(callback){\n\t\t\tdocument.getElementById(\"terminal\").innerHTML = framework[\"terminal\"];\n\t\t\tdocument.getElementById(\"terminal-content\").innerHTML = framework[\"nav\"];\n\t\t\tcallback(current_tab);\n\t\t}", "title": "" }, { "docid": "0fdec27181931037f3527942c4cb90c2", "score": "0.6188183", "text": "landPageNav(e){\n this.props.navigation.navigate('LandingPage');\n }", "title": "" }, { "docid": "46ce9aaaf2810ef2adcbb918496563b9", "score": "0.6187408", "text": "function navigate(){\n\t\n\tvar clicked = $(this); //get clicked element in the navigation panel\n\tvar pageId = $(\".active\").attr('id'); //get clicked element id\n\tvar currentPage = parseInt(pageId.replace(\"Page\",\"\"),10); //get current page number\n\tvar futurePage = currentPage; //Initialize future page (same as current page)\n \n //Determin future page based on clicked button\t\n\tswitch(clicked.attr('id')){\n\t\tcase 'first':\n\t\t\t\tfuturePage = 1;\n\t\tbreak;\n\t\t\n\t\tcase 'last':\n\t\t\t\tfuturePage = commTotalPages;\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t pageId = clicked.attr('id'); //get clicked page ID\n\t\t\tvar newPage = pageId.replace(\"Page\",\"\"); //get clicked page number\n\t\t\t\n\t\t \t//if clicked page is in valid page range\n\t\t\tif(newPage >= 1 && newPage <=commTotalPages){\n\t\t\t\tfuturePage = newPage;\n\t\t\t}\n\t\tbreak;\n\t} //End Switch\n\t\n\tvar comments = new Comments();\n\tcomments.getCommentsForArticle(currentArticleId,futurePage,commPageSize).done(displayComments); //get and display comments for first page;\n\t\n\t//Manage visual spects\n\t$(\"a\").removeClass('active'); //remove active class for all elements\n\t$(\"#Page\" + futurePage).addClass('active'); //activate new page\n\t\n\t//Reconfigure first and last buttons\n\tif(parseInt(futurePage,10) === 1 ){\n\t\t$(\"#first\").addClass('disabled');\n\t\t$(\"#last\").removeClass('disabled');\n\t}else if(parseInt(futurePage,10) === commTotalPages ){\n\t\t$(\"#first\").removeClass('disabled');\n\t\t$(\"#last\").addClass('disabled');\n\t}\n\telse{\n\t\t$(\"#first\").removeClass('disabled');\n\t\t$(\"#last\").removeClass('disabled');\n\t}\n\t\n}//END Navigation function", "title": "" }, { "docid": "f30db13d5ee510f00688fe28cf4a87a8", "score": "0.61814046", "text": "function setUpPage() {\r\n document.querySelector(\"nav ul li:first-of-type\").addEventListener(\"click\", loadSetup, false);\r\n document.querySelector(\"nav ul li:last-of-type\").addEventListener(\"click\", loadDirections, false);\r\n}", "title": "" }, { "docid": "1bac84a6dd49207d89d5970ee9699e05", "score": "0.6156339", "text": "function _plmNavWithMethod(actionmethod)\r\n{\r\n // alert(\"_plmNavWithMethod:\");\r\n\tif(navInfo!=null)\r\n\t{\r\n\t\tloadWorkArea(navInfo,actionmethod,\"\",loadNavigationGrid);\r\n\t\tnavInfo = null;\r\n\t}\r\n}", "title": "" }, { "docid": "4acd36f29e64b391750f9053b09159d4", "score": "0.61510736", "text": "function vBpagenav()\n{\n}", "title": "" }, { "docid": "4e2470623777ebdd60412024203d9301", "score": "0.61493134", "text": "function _plmNavDefaultReload()\r\n{\r\n // alert(\"_plmNavWithMethod:\");\r\n\tif(navInfo!=null)\r\n\t{\r\n\t\tloadWorkArea(navInfo,\"\",\"\", \"\");\r\n\t\tnavInfo = null;\r\n\t}\r\n}", "title": "" }, { "docid": "faebd7809a78d4544e9babf6d1e3107d", "score": "0.6119784", "text": "function navigate(){\n\twidth = $(window).width();\n\t$(\"#header-wrap .sidebar\").css({\n\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\topacity: \"0\"\n\t});\n\t$(\"#header-wrap .browseMenu\").css({\n\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\topacity: \"0\"\n\t});\n\n\t$(\"#header-wrap .navigat\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\t\ttransform: \"translateX(-8px)\",\n\t\t\topacity: \"1\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#content-wrap .container-fluid a\").css({\n\t\t\tpointerEvents: \"none\",\n\t\t\tcursor: \"default\",\n\t\t});\n\t\t// $(\"#content-wrap .container-fluid\").css({\n\t\t// \tposition: \"relative\",\n\t\t// \tzIndex: \"111\",\n\t\t// \tbackgroundColor: \"gray\",\n\t\t// \topacity: \"0.8\",\n\t\t// \ttransition: \"all 0.4s ease\"\n\t\t// });\n\t});\n\t$(\"#header-wrap .sidebar .buttonBrowse\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\topacity: \"0\",\n\t\ttransition: \"all 0.4s ease\"\n\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(0)\",\n\t\t\topacity: \"1\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t});\n\t$(\"#header-wrap .browseMenu div\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\t\ttransform: \"translateX(-8px)\",\n\t\t\topacity: \"1\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t});\n\n\t$(\"#content-wrap .container1\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#content-wrap .container-fluid a\").css({\n\t\t\tpointerEvents: \"\",\n\t\t\tcursor: \"\"\n\t\t});\n\t\t// $(\"#content-wrap .container-fluid\").css({\n\t\t// \tbackgroundColor: \"\",\n\t\t// \topacity: \"\",\n\t\t// \ttransition: \"\",\n\t\t// \ttransition: \"all 0.4s ease\"\n\t\t// });\n\t});\n\n\n\t//olculerin beraberlesmesu ucun\n\tfunction widthSideBar(){\n\t\tif($(window).width() > 620){\n\t\t\twindowWidth = $(window).width() - 230;\n\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t$(window).resize(function() {\n\t\t\t\twindowWidth = $(window).width() - 230;\n\t\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t});\n\t\t}\n\t\tif($(window).width() < 620){\n\t\t\twindowWidth = $(window).width() - 100;\n\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t$(window).resize(function() {\n\t\t\t\twindowWidth = $(window).width() - 100;\n\t\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t});\n\t\t}\n\t}\n\twidthSideBar();\n\n\t//menunun uzunlugunun ekranin uzunlugu ile uygunlasmasi ucun\n\tfunction heightSideBar(){\n\t\theight = $(window).height();\n\t\t$(\"#header-wrap .sidebar\").height(height);\n\t\t$(\"#header-wrap .browseMenu\").height(height);\n\t}\n\theightSideBar();\n}", "title": "" }, { "docid": "98199e9f2701788216aac07ba25f8777", "score": "0.61179847", "text": "function navRouter(i) {\n if (i.text() === \"About\") {\n navAnimation('#0');\n showAbout();\n } else if (i.text() === \"Projects\") {\n navAnimation('#1');\n showProjects();\n } else {\n navAnimation('#2');\n showContactInfo();\n }\n toggleMenu();\n }", "title": "" }, { "docid": "44ea309fd34937a67a1f43f1f60e0d76", "score": "0.60929406", "text": "function initNavigationMode() {\n\t\tif (projectGlobal.navigationMode === \"desktop\") {\n\t\t\tSitoolsDesk.navProfile = sitools.user.desktop.navProfile.desktop;\n\t\t} else {\n\t\t\tSitoolsDesk.navProfile = sitools.user.desktop.navProfile.fixed;\n\t\t}\n\t}", "title": "" }, { "docid": "99343e31a2f0ef44aa4b4a38c12ae672", "score": "0.60807264", "text": "function updatePageNavigation() {\n const Navigation = MonitoringConsole.Model.Settings.Navigation;\n let panelConsole = $('#console');\n if (Navigation.isCollapsed()) {\n panelConsole.removeClass('state-show-nav');\n } else {\n if (!panelConsole.hasClass('state-show-nav')) {\n panelConsole.addClass('state-show-nav'); \n }\n }\n $('#NavSidebar').replaceWith(Components.createNavSidebar(createNavSidebarModel()));\n }", "title": "" }, { "docid": "bd42b26bfddd7fcd2192ea47d20b0618", "score": "0.607672", "text": "function returnToHome(){\n\t\n}", "title": "" }, { "docid": "387d915233c28b09698036eacdad84f2", "score": "0.60639536", "text": "get navigation() {\n return this._navigation;\n }", "title": "" }, { "docid": "11e39350f5167ddf33559a9353f76c16", "score": "0.60624415", "text": "gotoRestroHome(id,menu,img,status){\n this.props.navigator.push({\n id:'restro-home',\n restroId:id,\n menuId:menu,\n img:img,\n status:status,\n })\n }", "title": "" }, { "docid": "e93b974b115dee91da7f550ed087e319", "score": "0.6055668", "text": "function navigationClicks()\n{\n navigationBar.addEventListener('click',function(eventInfo)\n {\n var findSection=document.getElementById(eventInfo.target.dataset.nav);\n findSection.scrollIntoView();\n\n\n\n });\n}", "title": "" }, { "docid": "61a0583d646669121a77739a4109d6a6", "score": "0.6055558", "text": "navigateToMain(email) {\n console.log(\"navigating\");\n this.props.navigation.navigate('Selections',\n {\n email: email\n });\n }", "title": "" }, { "docid": "38a436ba6dce619472059d9993e6b815", "score": "0.60547084", "text": "function clickPageLinks() {\n\n // this event is fired everytime you click a link or when pressing back/forward browser buttons\n window.onpopstate = function() {\n var url = window.location.href;\n\n // extract the string after #\n var args = url.split('#')[1];\n\n // get the page (0 in the array of args)\n var page = args.split('&')[0];\n\n if(page!='') {\n\n // the element in the header to highlight is a li element that contains as class the \"pagename\"_page\n var newElm = $('li[class*=\"'+page+'_page\"]');\n\n // remove class from the previous active menu element\n var prevElm = $('li[class*=\"active\"]');\n prevElm.removeClass('active');\n\n newElm.addClass('active');\n\n if(page!='contact'&&page!='askus'&&page!='whereweare'&&page!='findyourshop')\n manager(args);\n else\n staticPageManager(page);\n }\n };\n}", "title": "" }, { "docid": "af13ceb528d5156498df5a89838ccfb4", "score": "0.6041153", "text": "static nav(to) {\n console.log(\"main nav to: \" + to)\n $.get(to, function (pageContent) {\n $('.content').html(pageContent);\n }).fail(HTMLHandler.failedGet)\n }", "title": "" }, { "docid": "ce3531decd3db44db083d9b3450572a2", "score": "0.60394573", "text": "function navigationHighlight(e) {\n $('.pl-nav-elements .pl-link').removeClass('is-current');\n $(this).addClass('is-current');\n }", "title": "" }, { "docid": "dbd7c56b989e2e1357693e6843200fec", "score": "0.6038284", "text": "function initMainNavigation(container) {\n\n // Add dropdown toggle that displays child menu items. Used on mobile and screenreaders.\n var dropdownToggle = $('<button />', {'class': 'dropdown-toggle', 'aria-expanded': false})\n //.append(seasaltpressScreenReaderText.icon)\n .append($('<span />', {'class': 'screen-reader-text', text: seasaltpressScreenReaderText.expand}));\n\n container.find('.menu-item-has-children > a, .page_item_has_children > a').after(dropdownToggle);\n\n // Set the active submenu dropdown toggle button initial state.\n container.find('.current-menu-ancestor > button, .current-menu-parent')\n .addClass('toggled-on')\n .attr('aria-expanded', 'true')\n .find('.screen-reader-text')\n .text(seasaltpressScreenReaderText.collapse);\n // Set the active submenu initial state.\n container.find('.current-menu-ancestor > .sub-menu').addClass('toggled-on').slideDown(); //added slidedown\n\n\n container.find('.dropdown-toggle').click(function (e) {\n var _this = $(this),\n screenReaderSpan = _this.find('.screen-reader-text');\n\n e.preventDefault();\n _this.toggleClass('toggled-on');\n _this.closest('li').toggleClass('toggled-on'); //added for styling the item clicked\n _this.closest('li').children('.children, .sub-menu').toggleClass('toggled-on').slideToggle();\n\n _this.attr('aria-expanded', _this.attr('aria-expanded') === 'false' ? 'true' : 'false');\n\n screenReaderSpan.text(screenReaderSpan.text() === seasaltpressScreenReaderText.expand ? seasaltpressScreenReaderText.collapse : seasaltpressScreenReaderText.expand);\n });\n }", "title": "" }, { "docid": "8b12da86ce8c13267325cb979fdc7b02", "score": "0.6031311", "text": "_navigate (){\n this.props.navigator.push({title: 'Filter Page', index: 3})\n }", "title": "" }, { "docid": "dea0a887c97cb10432adda38e0fddb91", "score": "0.60245126", "text": "createNavigation() {\n this.prevButton.addEventListener('click', this.prev.bind(this));\n this.nextButton.addEventListener('click', this.next.bind(this));\n }", "title": "" }, { "docid": "a7eb5cbb9235a87ab855da86623fc204", "score": "0.60131913", "text": "function Start() {\n LoadNavBar();\n LoadPageContent();\n}", "title": "" }, { "docid": "1d52df8fd108759cd9db6324c36aea3a", "score": "0.60083425", "text": "onNavigate (routeData) {\n this.channel.trigger('before:navigate', routeData.linked)\n\n routeData.linked.show(routeData.params)\n .then(() => {\n this.channel.trigger('navigate', routeData.linked)\n })\n .catch((error) => {\n console.error(error)\n this.channel.trigger('error')\n })\n }", "title": "" }, { "docid": "7b50dd620dbc3ef7f6e230bae248ea7e", "score": "0.60067415", "text": "function onPageLoad() {\r\n genNavBar();\r\n}", "title": "" }, { "docid": "d74ba7d5f5937c64810e138774502cbb", "score": "0.6001794", "text": "onRegisterClicked(){\r\n //this.Nav.push(RegisterPage);\r\n }", "title": "" }, { "docid": "b5abb4c1ec5d2bad57f5da5417fba0a8", "score": "0.6001557", "text": "function navigate() {\n\t   \t//remove css classes from items\n\t\t$('#js_itemlist > li').removeAttr('style');\n\t\t$('#js_itemlist > li.current').removeClass('current');\n\t\t$('#js_itemlist > li.next-out').removeClass('next-out');\n\t\t$('#js_itemlist > li.next-in').removeClass('next-in');\n\t\t$('#js_itemlist > li.prev-out').removeClass('prev-out');\n\t\t$('#js_itemlist > li.prev-in').removeClass('prev-in');\n\t\t\n\t\t\t\t\n\t\t//active and isNext nodes\n\t\tvar $active = $('#js_itemlist > li.current'),\n\t isNext = $(this).hasClass('next');\n\t\t\n\t\t//get current index\n\t\tcurrentIndex = (currentIndex + (isNext ? 1 : -1)) % itemCount;\n\n\t\t/* go back to the last item if we hit -1 */\n\t\tif (currentIndex === -1) {\n\t\t\tcurrentIndex = itemCount - 1;\n\t\t}\n\t\t\n\t\t//add css classes for transition\n\t\tvar $next = $('#js_itemlist > li:eq(' + currentIndex + ')');\n\t\t$active.addClass(isNext ? 'next-out' : 'prev-out');\n\t\t$next.addClass('current').addClass(isNext ? 'next-in' : 'prev-in');\n\t\t\n\t\treturn false;\n\t\t\n}", "title": "" }, { "docid": "d20f9db35913247f1c22fe0487a80c86", "score": "0.5998695", "text": "function navController_topNav(number){\n\t$(\".list-group-item\").removeClass('leftNav-active');\n\tlet table = viewObj.goodsTableName[number];\n\tif (table===\"none\")\n\t\tmainController_messageBox({message: \"База даних з цим товаром відсутня\", status: \"info\"});\n\telse {\n\t\tviewObj.topNavItemsIndex = number;\n\t\t$(\"#title\").text(viewObj.topNavItems[number]);\n\t\t$(\"#section\").empty();\n\t\t//Cancelling 'leftNav' status\n\t\tleftNavCancel();\n\t\t// - Selected\n\t\t$(\".topNav-item-element\").removeClass('topNav-active');\n\t\t$(document.querySelectorAll('.topNav-item-element')[number]).addClass('topNav-active');\n\t\t// - Show created tables from DB\n\t\tmodelController_goodsUpdate(table,number);\n\t}\n\t\n\tfunction leftNavCancel(){\n\t\tswitch (leftNavStatus.itemActive){\n\t\t\tcase 2:\n\t\t\t\t$(\"#deleteCancel\").trigger(\"click\");\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#editCancel\").trigger(\"click\");\n\t\t}\n\t\tleftNavStatus.itemActive = -1;\n\t}\n}", "title": "" }, { "docid": "ebdc513506956d25a9564da5875ab5c3", "score": "0.5994764", "text": "function setupNavBar(){\n\t// Get the container element\n\tvar btnContainer = document.getElementById(\"navbar\");\n\n\t// Get all buttons with class=\"btn\" inside the container\n\tvar btns = btnContainer.getElementsByClassName(\"btn\");\n\n\t// Loop through the buttons and add the active class to the current/clicked button\n\tfor (var i = 0; i < btns.length; i++) {\n\t btns[i].addEventListener(\"click\", function() {\n\t \t//console.log('clicked: ' + this);\n\t \t//console.dir(this);\n\t var current = document.getElementsByClassName(\"active\");\n\t current[0].className = current[0].className.replace(\" active\", \"\");\n\t this.className += \" active\";\n\n\t //switch pages!\n\t //find the swipe section based on which button index this is:\n\t var btn_list = document.getElementById(\"navbar\").getElementsByClassName(\"btn\");\n\t var btn_idx = -1;\n\t for(var j = 0; j<btn_list.length; j++){\n\t \tif(btn_list[j] == this){\n\t \t\tbtn_idx = j;\n\t \t}\n\t }\n\n\t if(btn_idx>-1){\n\t\t\t//need to make sure that the number of buttons equals the number of swipe sections...\n\t \tcurrent_swipe_section = btn_idx;\n\t \tvar step_list = document.getElementsByClassName(\"step\");\n\t\t\tfor(var i = 0; i<step_list.length; i++){\n\t\t\t\tif(i==current_swipe_section){\n\t\t\t\t\tstep_list[i].style.display=\"block\";\n\t\t\t\t\tstep_list[i].style.zIndex=100;\n\t\t\t\t}else{\n\t\t\t\t\tstep_list[i].style.display=\"none\";\n\t\t\t\t\tstep_list[i].style.zIndex=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.log('set current swipe section to: ' + current_swipe_section);\n\t\t\twindow.location.href = \"#IntroductionAnchor\";\n\n\t \tloadSection(current_swipe_section);\t \t\n\t }else{\n\t \tconsole.log('could not find btn idx for button: ');\n\t \tconsole.dir(this);\n\t }\n\n\t });\n\t}\t\t\t\n}", "title": "" }, { "docid": "d40d208d5aa23e3415cdac390184c74e", "score": "0.5989325", "text": "routeToContent(_item) {\n const routeToSelection = NavigationActions.navigate({\n routeName: 'SingleView',\n params: { item: _item}\n });\n this.props.navigation.dispatch(routeToSelection);\n }", "title": "" }, { "docid": "ffb9c4bc369034c1cc467bcdcb732f2f", "score": "0.5986497", "text": "function Start() {\n LoadNavBar();\n LoadPageContent();\n}", "title": "" }, { "docid": "2d121744830ff7e3a80ed5d8b49654c2", "score": "0.59831935", "text": "_navigate (){\n this.props.navigator.push({title: 'Home Screen', index: 0})\n }", "title": "" }, { "docid": "cebd86ed76623f9c92419fa674d6ef50", "score": "0.59767306", "text": "prepareNavigationPanel (navigationList) {\n let self = this;\n for(let index = 0; index < Object.keys(navigationList[JSON_LABEL]).length; index++) {\n var navigationListItem = document.createElement(\"li\");\n var navigationAnchor = document.createElement(\"a\");\n var navigationLabel = document.createTextNode(navigationList[JSON_LABEL][index][NAVIGATION_DOM_LABEL]);\n \n navigationAnchor.id = navigationList[JSON_LABEL][index][NAVIGATION_DOM_SECTION];\n navigationAnchor.href = \"#\";\n navigationAnchor.setAttribute('data-gmt', navigationList[JSON_LABEL][index][NAVIGATION_GMT_DATA] );\n navigationListItem.addEventListener('click', self.navigate.bind(this));\n navigationAnchor.appendChild( navigationLabel );\n navigationListItem.appendChild( navigationAnchor );\n navigationElement.appendChild( navigationListItem );\n }\n }", "title": "" }, { "docid": "90ffcf75277957d54d632b49816a3d73", "score": "0.597551", "text": "function outerNav() {\n\n /* Opens the navigation menu */\n navToggle.click(function(){\n\n perspective.addClass('perspective--modalview');\n\n setTimeout(function(){\n perspective.addClass('effect-rotate-left--animate');\n }, 25);\n\n $outerNav.add(outerNavLi).add(outerNavReturn).addClass('is-vis');\n });\n\n /* Closes the navigation menu on click of an item*/ \n outerNavReturn.add(outerNavLi).click(function(){\n\n perspective.removeClass('effect-rotate-left--animate');\n\n setTimeout(function(){\n perspective.removeClass('perspective--modalview');\n }, 400);\n\n $outerNav.add(outerNavLi).add(outerNavReturn).removeClass('is-vis');\n });\n\n }", "title": "" }, { "docid": "23067adf839e771cd3f0327f02b4b09d", "score": "0.59557503", "text": "Navigate(string, Variant, Variant, Variant, Variant) {\n\n }", "title": "" }, { "docid": "f0aa949b7c8083c0f639b678c2135292", "score": "0.5945909", "text": "get navigation() {\r\n return this.create(NavigationService);\r\n }", "title": "" }, { "docid": "ee3b98a88d4e6f3d9a1d5a87114be09d", "score": "0.5945408", "text": "function navigate() {\n withNavigationContainer((listHolder) => {\n openedLeftNavForNavigate = false;\n // Since the projects list can get reconstructed, watch for changes and\n // reconstruct the shortcut tips. A function to unregister the mutation\n // observer is passed in.\n oldNavigateOptions = [];\n const unregisterListener = registerMutationObserver(listHolder, () => {\n setupNavigate(listHolder);\n }, {childList: true, subtree: true});\n finishNavigate = () => {\n unregisterListener();\n finishNavigate = null;\n switchKeymap(DEFAULT_KEYMAP);\n updateKeymap();\n if (openedLeftNavForNavigate && !leftNavIsHidden()) {\n toggleLeftNav();\n }\n };\n setupNavigate(listHolder);\n });\n }", "title": "" }, { "docid": "f91a3d2a0294da2d285489581e6f9dc8", "score": "0.5941308", "text": "function getCustomNavigations( currentScreenKey, actionName ) {\n var customNavigations = new Array();\n return customNavigations;\n}", "title": "" }, { "docid": "1a7d972cb9d421b2ffebcddd00e02b66", "score": "0.5939533", "text": "function lstMenu_OnTouch( item )\r\n{\r\n if( item==\"Home\" ) {\r\n curUrl = \"Main.html\";\r\n ChangePage( layWebView );\r\n txtMsg.SetText( \"Main Page\" );\r\n }\r\n else if( item==\"Temp\" ) {\r\n curUrl = \"Temperature.html\";\r\n ChangePage( layWebView );\r\n txtMsg.SetText( \"Temperature\" );\r\n }\r\n else if( item==\"Settings\" ) {\r\n ChangePage( laySettings );\r\n txtMsg.SetText( \"Settings\" );\r\n }\r\n panel.Slide();\r\n}", "title": "" }, { "docid": "25fe6713496a77113d62fb82e2b1d25a", "score": "0.5934999", "text": "function selection() {\n let tags = [\"#navAbout\", \"#navExperience\", \"#navContact\"];\n let current = findView();\n // If the desktop site is displayed\n /* if (desktopSite()) {\n // If about back is visable, play animation\n if (current == \"#navAbout\") {\n aboutAnimation();\n }\n // Disable snap scroll for experience\n if (current == \"#navExperience\") {\n $(\"body\").css(\"scroll-snap-type\", \"y proximity\");\n $(\"html\").css(\"scroll-snap-type\", \"y proximity\");\n } else if (current != \"none\") {\n $(\"body\").css(\"scroll-snap-type\", \"both mandatory\");\n $(\"html\").css(\"scroll-snap-type\", \"both mandatory\");\n }\n } else {\n $(\"body\").css(\"scroll-snap-type\", \"none\");\n $(\"html\").css(\"scroll-snap-type\", \"none\");\n } */\n // Change the nav bar for current slide\n if (current != \"none\") {\n for (i in tags) {\n if (tags[i] != current) {\n $(tags[i])\n .removeClass(\"selected\")\n .addClass(\"unselected\");\n } else {\n $(tags[i])\n .removeClass(\"unselected\")\n .addClass(\"selected\");\n }\n }\n }\n}", "title": "" }, { "docid": "6a90e96ad5200becb1858951b43cc9fd", "score": "0.5931772", "text": "function onepage_activ_menu() {\r\n\t\r\n\tif(j$('body').hasClass('page-template-onepage') ) {\r\n\t\tj$('#header_container nav ul li a').click(function () {\r\n\t\tj$('#header_container nav ul li').removeClass('current-menu-item');\r\n\t\tj$(this).parent('li').addClass('current-menu-item');\r\n\t\t})\r\n\t\tvar aChildren = j$(\"#header_container nav ul li\").children(); // find the a children of the list items\r\n \tvar aArray = []; // create the empty aArray\r\n\t for (var i=0; i < aChildren.length; i++) { \r\n var aChild = aChildren[i];\r\n var ahref = j$(aChild).attr('href');\r\n aArray.push(ahref);\r\n \t} // this for loop fills the aArray with attribute href values\r\n\r\n j$(window).scroll(function(){\r\n var windowPos = j$(window).scrollTop(); // get the offset of the window from the top of page\r\n\r\n\t\tif(j$('.header_bottom_nav').length > 0){\r\n\t\t\tvar h_height = j$(\"#header_container\").height();\r\n\t\t\t}\r\n\t\t\telse if(j$(\".header_to_shrink\").length > 0) {\r\n\t\t\tvar h_height = \"55\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\tvar h_height = j$(\"#header_container\").height();\r\n\t\t}\r\n var windowHeight = j$(window).height(); // get the height of the window\r\n var docHeight = j$(document).height();\r\n\r\n for (var i=0; i < aArray.length; i++) {\r\n var theID = aArray[i];\r\n var divPos = (j$(theID).offset().top)-h_height;\r\n\t\t\tvar divh = j$(theID).height();\r\n var divHeight = +divh + +h_height; // get the height of the div in question\r\n if (windowPos >= divPos && windowPos < (divPos + divHeight)) {\r\n j$(\"a[href='\" + theID + \"']\").parent('li').addClass(\"current-menu-item\");\r\n } else {\r\n j$(\"a[href='\" + theID + \"']\").parent('li').removeClass(\"current-menu-item\");\r\n }\r\n }\r\n\r\n if(windowPos + windowHeight == docHeight) {\r\n if (!j$(\"#header_container nav ul li\").hasClass(\"current-menu-item\")) {\r\n var navActiveCurrent = j$(\".current-menu-item a\").attr(\"href\");\r\n j$(\"a[href='\" + navActiveCurrent + \"']\").parent('li').removeClass(\"current-menu-item\");\r\n j$(\"#header_container nav ul li:last-child a\").parent('li').addClass(\"current-menu-item\");\r\n }\r\n }\r\n });\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "f9efbf5e0e8fec7d9f5a206475f97a2e", "score": "0.59235996", "text": "function add_navigation(){\r\n\t\tif(list_elem_count==0){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar icon_markup2 = '<div class=\"icon2\" id=\"icon_wrapper\"><svg x=\"0px\" y=\"0px\" width=\"24.3px\" height=\"23.2px\" viewBox=\"0 0 24.3 23.2\" enable-background=\"new 0 0 24.3 23.2\" xml:space=\"preserve\"><polygon class=\"arrow\" fill=\"#ffffff\" points=\"'+ svg_arrow_icon +'\"></svg></div>';\r\n\t\t\r\n $('#2nav .vertab').after(icon_markup2);\r\n $('#2nav .icon2').eq(0).addClass('current_nav');\r\n\t}", "title": "" }, { "docid": "660d865f5beaf0eea2be5359b533e4f7", "score": "0.5920876", "text": "function SideNav() {\n return null;\n}", "title": "" }, { "docid": "9b31e28a09b140fe849be27e6adde583", "score": "0.5919579", "text": "navigateApp( urlObj, options ){\n\t\tconsole.log('navigateApp');\n\t\t\n\t\tvar sItemSelector = urlObj.hash.replace( /.*item=/, \"\" );\n\t\tvar oMenuItem = navigation[ sItemSelector ];\n\t\tvar sPageSelector = urlObj.hash.replace( /\\?.*$/, \"\" );\n\t\t\n\t\tconsole.log('oMenuItem',oMenuItem);\n\t\t\n\t\tif ( oMenuItem ) {\n\t\t\tvar oPage = $( sPageSelector );\n\t\t\tvar oHeader = oPage.find( \"#gameheader\" );\n\t\t\toHeader.find( \"h1\" ).text( oMenuItem.title );\n\t\t\tvar oContent = oPage.find( \"#gameboard\" );\n\t\t\t\n\t\t\tvar aItems = oMenuItem.items;\n\t\t\tvar iItemLength = aItems.length;\n\t\t\t\n\t\t\t//eigenen Content generieren\n\t\t\tvar markup = \"<p>\" + oMenuItem.type + \"</p><ul data-role='listview' data-inset='true'>\";\n\t\t\tfor ( var i = 0; i < iItemLength; i++ ) {\n\t\t\t\tmarkup += \"<li>\" + aItems[i].name + \"</li>\";\n\t\t\t}\n\t\t\tmarkup += \"</ul>\";\n\t\t\t\n\t\t\toContent.html( markup );\n\t\t\t\n\t\t\toContent.find( \":jqmData(role=listview)\" ).listview();\n\t\t}\n\t}", "title": "" }, { "docid": "f5d7769e6dd653de7811ccea6fc4bcc1", "score": "0.5918816", "text": "function redrawNav(){\r\n var article1Top = 0;\r\n // The top of each article is offset by half the distance to the previous article.\r\n var article2Top = $('#frontend-school').offset().top / 2;\r\n var article3Top = ($(document).height() - $('#experience').offset().top) / 2;\r\n $('nav.nav li').removeClass('active');\r\n if($(document).scrollTop() >= article1Top && $(document).scrollTop() < article2Top){\r\n $('li.general-info').addClass('active');\r\n } else if ($(document).scrollTop() >= article2Top && $(document).scrollTop() < article3Top){\r\n $('li.frontend-school').addClass('active');\r\n } else if ($(document).scrollTop() >= article3Top){\r\n $('li.experience').addClass('active');\r\n }\r\n \r\n }", "title": "" }, { "docid": "e1f69951eda0b46d7fc0dfa68d37f823", "score": "0.5917946", "text": "function centralInit(){\n homeNavBoxEvents();\n}", "title": "" }, { "docid": "b45595868f7551aea799da50252708e7", "score": "0.59167814", "text": "function onNavBack() {\n _currentTilesType = \"variables\";\n _selectedVariable = null;\n _$searchControl.val(_savedSearchQuery);\n\n _datasourceInfoPanel.hide();\n _$datasourcesList.hide();\n _$datasourcesListContent.empty();\n _$variablesList.show();\n _$navBackBtn.hide();\n _$sortControl.show();\n\n _$navPath.text(_currentSortMode == \"byName\" ?\n FC.Settings.LAYERS_BY_NAME_MESSAGE : FC.Settings.LAYERS_BY_CATEGORY_MESSAGE);\n\n if(_noCategoriesFound)\n _$sectionHeader.css(\"display\", \"none\");\n }", "title": "" }, { "docid": "03c10ffb401779dbf11f7f4a4cdf9193", "score": "0.5914718", "text": "function openNav() {\n $scope.navigatebuttons = '';\n if ($scope.bottomnav === 'active-bottom-nav') {\n $scope.bottomnav = '';\n $scope.chevron = 'chevron-image';\n $scope.navigatebuttons = 'navigationhidden';\n } else {\n $scope.bottomnav = 'active-bottom-nav';\n $scope.navigatebuttons = 'navigationshown';\n $scope.chevron = 'chevron-image active-chevron';\n }\n }", "title": "" }, { "docid": "71550e2b7a4cd564c51dba0cf9a7cbfe", "score": "0.5913851", "text": "setupNav() {\n this.router.on({}, () => {\n $('iframe').one('load', function() {\n this.style.height = (document.body.offsetHeight - \n $('iframe').offset().top) + \"px\";\n $('body').css('overflow-y', 'hidden');\n });\n });\n this.router.on({'page': 'quiz1'}, () => {\n this.changePage('https://docs.google.com/forms/d/e/1FAIpQLSdKVApwuQjnD3auoJI8ESKtfS-w6PlCptSHTbkxNGyPH1Iv6A/viewform?usp=sf_link');\n });\n this.router.on({'page': 'quiz2'}, () => {\n this.changePage('https://docs.google.com/forms/d/e/1FAIpQLSdt06Q9VWQHuVUZCfk0fnhMb6InsBAcI3bDrFXcKiSmiqgNvA/viewform?usp=sf_link');\n });\n this.router.on({'page': 'module1'}, () => {\n this.changePage('module1.html');\n });\n this.router.on({'page': 'module2'}, () => {\n this.changePage('module2.html');\n });\n this.router.on({'page': 'module3'}, () => {\n this.changePage('module3.html');\n });\n }", "title": "" }, { "docid": "29b4641b28c73925f576f494373fa417", "score": "0.5906175", "text": "function register_event_handlers()\n {\n\n var navMan = new ViewManager('#firstPage');\n\n\n }", "title": "" }, { "docid": "c66cbe6da98004f5dd8078cf930ca538", "score": "0.5900867", "text": "onNobodyHome() {\n throw new NotImplementedException();\n }", "title": "" }, { "docid": "d91d32cef4fe86b14abec6fabc380088", "score": "0.5896038", "text": "function setNav() {\n\n\t\t\t\tvar $nav = _$parent.find('nav');\n\t\t\t\tvar $contents = _$parent.find('.contents');\n\t\t\t\tvar $btn = $nav.find('p');\n\n\t\t\t\t$btn.on('click',function() {\n\n\t\t\t\t\tvar $target = $(this);\n\n\t\t\t\t\tif ($target.hasClass('active')) return;\n\t\t\t\t\t$contents.removeClass('show');\n\t\t\t\t\t$btn.removeClass('active');\n\t\t\t\t\t$target.addClass('active');\n\t\t\t\t\tvar id = $target.prop('id').split('-')[1];\n\t\t\t\t\t$contents.filter('#contet-' + id).addClass('show');\n\n\t\t\t\t});\n\n\t\t\t\treturn false;\n\t\t\t}", "title": "" }, { "docid": "6cc7a1ce99b2c0aa94dafe2a0ec8f9e4", "score": "0.58805776", "text": "function handleNav(ev){\n\tev.preventDefault();\n\tvar href = ev.target.href;\n\tvar parts = href.split(\"#\");\n\tloadPage( parts[1] );\t\n if (parts[1]==\"three\"){\n \n three();\n}\n return false;\n}", "title": "" }, { "docid": "095aedef54612ee16a6ace63d8f5bd6e", "score": "0.5879529", "text": "test() {\n\t\treturn this._nav;\n\t}", "title": "" } ]
801cae0b97fd72a8651719f034cce482
Set the entity plugin instance.
[ { "docid": "32c1096205faeb514b7f3e1768874217", "score": "0.5825979", "text": "createEntity(id, plugin) {\n return this.entities.set(id, plugin);\n }", "title": "" } ]
[ { "docid": "2d63977232dae0e72384d5ea4df8c958", "score": "0.61154515", "text": "setInstance(instance){\n\t\tthis.instance = instance;\n\t}", "title": "" }, { "docid": "2d63977232dae0e72384d5ea4df8c958", "score": "0.61154515", "text": "setInstance(instance){\n\t\tthis.instance = instance;\n\t}", "title": "" }, { "docid": "888e5e77eb4e69abb9d1eaa114986be0", "score": "0.53220516", "text": "setInstance(value){\n\t\tthis._options = this._validateType(value)\n\t}", "title": "" }, { "docid": "4a5613642b73dfc9f87dbad37f7bd99c", "score": "0.52742594", "text": "static setPinoInstance(pino_instance){\n this.pino_instance = pino_instance \n }", "title": "" }, { "docid": "ec574aeb5857725a6b545bd4e6ff66a3", "score": "0.5161549", "text": "set entity(pObj) {\n //Check for null\n if (pObj == null) {\n this.__Internal__Dont__Modify__.entity = null;\n return;\n }\n\n //Check the type\n if (!pObj instanceof Entity)\n throw new Error(\"Can not set the Entity Controllers Entity to \" + pObj + \" (Type: '\" + typeof pObj + \"') Please use a Entity object or null to remove\");\n\n //Set the value\n this.__Internal__Dont__Modify__.entity = pObj;\n }", "title": "" }, { "docid": "7479f26a27acd1963c88f93b9affef53", "score": "0.5031689", "text": "set entity(entity) {\n\t\tthis._request.entity = entity;\n\t}", "title": "" }, { "docid": "9ab6378ec39e20062ee5bf4f15932791", "score": "0.5004676", "text": "bindEntity(entity){\n if (entity) {\n this._entity = entity;\n this._FBPTriggerWire(\"--entityObjectInjected\", this._entity);\n\n // if data is injected, get the available HATEOAS links and activate/deactivate action buttons\n this._entity.links.addEventListener('this-repeated-field-changed', (e) => {\n let rels = [];\n e.detail.__childNodes.forEach((item) => {\n rels.push(item._value.rel);\n });\n\n let elems = this.shadowRoot.querySelectorAll('furo-button');\n elems.forEach((item) => {\n if (item.getAttribute('rel') != null && item.getAttribute('rel').length > 0 && rels.indexOf(item.getAttribute('rel')) === -1){\n item.setAttribute('hidden', '');\n } else {\n item.removeAttribute('hidden', '');\n }\n });\n\n });\n }\n }", "title": "" }, { "docid": "05a11b3ce0de07aed1426c32309a169d", "score": "0.49959838", "text": "enablePlugin() {\n this.yourProperty = 'Your Value';\n\n // Add all your plugin hooks here. It's a good idea to make use of the arrow functions to keep the context consistent.\n this.addHook('afterChange', (changes, source) => this.onAfterChange(changes, source));\n\n // The super method assigns the this.enabled property to true, which can be later used to check if plugin is already enabled.\n super.enablePlugin();\n }", "title": "" }, { "docid": "d58769d57fba19e46dac55056786fb23", "score": "0.4989715", "text": "constructor() {\n\t\tthis.traits = [];\n\t\tthis.className = 'Entity';\n\t}", "title": "" }, { "docid": "f9489485330b41307e182f926cba4f0d", "score": "0.49606842", "text": "get entity() {\n\t\treturn this.__entity;\n\t}", "title": "" }, { "docid": "65addba9c9edf734842d34b9e23633e3", "score": "0.4934325", "text": "updatePlugin() {\n\n // The updatePlugin method needs to contain all the code needed to properly re-enable the plugin. In most cases simply disabling and enabling the plugin should do the trick.\n this.disablePlugin();\n this.enablePlugin();\n\n super.updatePlugin();\n }", "title": "" }, { "docid": "c8d4107263c3fd2ac2f30ae4030dede3", "score": "0.49084657", "text": "function setInstance(value) {\n Private.instance = value;\n }", "title": "" }, { "docid": "55f60d596d7998d16b5542b20398d39b", "score": "0.4887216", "text": "function Plugin(gameEngine) {\n this._gameEngine = gameEngine;\n this._isEngineInitialized = false;\n }", "title": "" }, { "docid": "3f2f372f6cad08a2e15f81d68019e271", "score": "0.4799055", "text": "setApiEntity(entity, origin) {\n this._apiEntity = entity;\n this._identifier.initByApiEntity(entity, origin);\n }", "title": "" }, { "docid": "160c9c26b22ee35a45e8e950db28dfee", "score": "0.4767137", "text": "setFromObject(obj) { this.inst.setFromObject(obj); }", "title": "" }, { "docid": "d475160f3e4151d02e2fd3e62af3c6ca", "score": "0.47528467", "text": "SetProperty(path, value)\n\t{\n\t\tif(typeof path !== 'string')\n\t\t\tthrow new Error(\"Invalid argument type sent to Entity.SetProperty().\");\n\t\t\n\t\tlet s = path.split(\"-\");\n\t\tif(s.length != 2)\n\t\t\tthrow new Error(\"Invalid property path: \" + path);\n\t\t\t\n\t\tif(s[0] === 'Entity')\n\t\t{\n\t\t\tthis[s[1]] = value;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlet comp = this.GetComponent(s[0]);\n\t\t\n\t\t//HACK ALERT: This really should be replaced with a\n\t\t//recursive method to avoid performance AND safety issues!\n\t\teval('comp.' + s[1] + \" = value\");\n\t}", "title": "" }, { "docid": "f32cd73c2093db401ae99d0719a376c6", "score": "0.47503656", "text": "set instance(config) {\n // Class.implement essentially just calls Class#extend.\n /* istanbul ignore else: no comments */\n if(config) this.instance.extend(config);\n }", "title": "" }, { "docid": "e7f85621d054d7499e0bb531057a3176", "score": "0.4749898", "text": "setProvider(provider) {\n const deployed = this.requireDeployed();\n deployed.setProvider(provider);\n }", "title": "" }, { "docid": "c52d2a89107ded356747554f6dab03db", "score": "0.47274292", "text": "function initialize(args, instance) {\n instance._readyCallbacks = [];\n instance._readyPromises = [];\n\n // Entity manager can take 1 to 3 arguments.\n if (args.length < 1 || args.length > 3)\n throw helper.createError(i18N.managerInvalidArgs, { entityManager: instance });\n var service = args[0], metadataPrm = args[1], injections = args[2];\n // If first parameter is data service instance use it\n if (Assert.isInstanceOf(service, baseTypes.DataServiceBase)) {\n instance.dataService = service;\n injections = args[1];\n }\n else if (Assert.isTypeOf(service, 'string')) {\n if (args.length === 2) {\n if (Assert.isObject(metadataPrm) && !Assert.isInstanceOf(metadataPrm, metadata.MetadataManager)) {\n injections = metadataPrm;\n metadataPrm = undefined;\n }\n }\n\n // If first parameter is string, use it as an Uri and create the default service.\n var dst = settings.getDefaultServiceType();\n var serviceType = dst === enums.serviceTypes.OData ? services.ODataService : services.BeetleService;\n instance.dataService = new serviceType(service, metadataPrm, injections);\n }\n else throw helper.createError(i18N.managerInvalidArgs, { entityManager: this, arguments: args });\n\n injections = injections || {};\n instance.promiseProvider = injections.promiseProvider || settings.getPromiseProvider();\n instance.autoFixScalar = injections.autoFixScalar;\n instance.autoFixPlural = injections.autoFixPlural;\n instance.validateOnMerge = injections.validateOnMerge;\n instance.validateOnSave = injections.validateOnSave;\n instance.liveValidate = injections.liveValidate;\n instance.handleUnmappedProperties = injections.handleUnmappedProperties;\n instance.forceUpdate = injections.forceUpdate;\n instance.workAsync = injections.workAsync;\n instance.minimizePackage = injections.minimizePackage;\n\n // Create a integer value to hold change count. This value will be updated after every entity state change.\n instance.pendingChangeCount = 0;\n // Create the entity container.\n instance.entities = new core.EntityContainer();\n instance.validationErrors = [];\n // Events.\n instance.entityStateChanged = new core.Event('entityStateChanged', instance);\n instance.validationErrorsChanged = new core.Event('validationErrorsChanged', instance);\n instance.hasChangesChanged = new core.Event('hasChangesChanged', instance);\n instance.queryExecuting = new core.Event('queryExecuting', instance);\n instance.queryExecuted = new core.Event('queryExecuted', instance);\n instance.saving = new core.Event('saving', instance);\n instance.saved = new core.Event('saved', instance);\n\n var registerMetadataTypes = injections.registerMetadataTypes;\n if (registerMetadataTypes == null)\n registerMetadataTypes = settings.registerMetadataTypes;\n instance.dataService.ready(function () {\n var metadata = instance.dataService.metadataManager;\n if (metadata) {\n var types = metadata.types;\n if (types) {\n instance.entitySets = {};\n for (var i = 0; i < types.length; i++) {\n var type = types[i];\n var shortName = type.shortName;\n if (registerMetadataTypes) {\n if (!(shortName in instance))\n instance[shortName] = getManagerEntityClass(shortName, instance);\n\n if (!(shortName in root))\n root[shortName] = getGlobalEntityClass(type);\n }\n\n var setName = type.setName;\n if (setName && !instance.entitySets.hasOwnProperty(setName)) {\n var set = instance.createSet(type);\n if (registerMetadataTypes) instance[setName] = set;\n instance.entitySets[shortName] = set;\n }\n }\n }\n var enums = metadata.enums;\n if (enums) {\n for (var enumName in enums) {\n if (!(enumName in root))\n root[enumName] = enums[enumName];\n }\n }\n }\n\n checkReady(instance);\n });\n\n function getManagerEntityClass(shortName, manager) {\n return function (initialValues) {\n helper.extend(this, initialValues);\n manager.createEntity(shortName, this);\n };\n }\n\n function getGlobalEntityClass(type) {\n return function (initialValues, createRaw) {\n helper.extend(this, initialValues);\n if (createRaw == true)\n type.createRawEntity(this);\n else\n type.createEntity(this);\n };\n }\n }", "title": "" }, { "docid": "8d07d7c166dfb45f49ab59e53b931bdd", "score": "0.47118694", "text": "setInstance (instance = null) {\n\n if(instance instanceof SlotMachine){\n this.memory.set(\"slotMachine\", instance);\n }\n }", "title": "" }, { "docid": "8d40c4c90b18c052564f103b29927e76", "score": "0.46897587", "text": "createEntity(type, settings: Object): any {\n var entity = new type(this, settings);\n this.c.entities.register(entity);\n return entity;\n }", "title": "" }, { "docid": "a140ce09d0cc15d0574957c512bc5c25", "score": "0.46559566", "text": "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._currentCompanyId = window.currentCompanyId;\r\n this._currentUserId = window.currentUserId;\r\n this._projectPropertyData = null;//加载的数据\r\n this._projectPropertyEditData = null;//改动后的数据\r\n this.init();\r\n }", "title": "" }, { "docid": "fdff344ad7d7c3a0b8e146405830c4e2", "score": "0.46507537", "text": "static set(identifierOrServiceMetadata, value) {\n this.globalInstance.set(identifierOrServiceMetadata, value);\n return this;\n }", "title": "" }, { "docid": "d81b9c06038c6a06d99a5460941057f1", "score": "0.46051583", "text": "constructor() {\n /**\n * Entity to which AI is attached\n * @type {AutonomyEntity}\n */\n this.entity = null;\n }", "title": "" }, { "docid": "9549194e756ad1e3fa3e4f4a37ee0135", "score": "0.45771396", "text": "change(entity) {\n this.entity = entity\n this.__pronounUsed = null\n this.__forcedSingular = false\n }", "title": "" }, { "docid": "25f0bffc43d61ce6f1f7d77fb3cf9663", "score": "0.4557727", "text": "ready () {\n Editor.import(['packages:/', this.id, 'tools', 'plugin.js'].join('/'))\n .then((Plugin) => {\n return new Plugin(this.id, Editor)\n })\n .then((promise) => {\n new Vue({\n el: this.shadowRoot,\n })\n }) // end then\n }", "title": "" }, { "docid": "79b0ab60bccaf6bfd14ab7a33e0bf011", "score": "0.4524993", "text": "setFieldValue(key, entity, property) {\n let field = this.inputFields[key];\n if (field && field instanceof PInput) {\n field.bind(entity, property);\n }\n }", "title": "" }, { "docid": "ed1b2b9d7e2ea32f59b896163ff80406", "score": "0.44992796", "text": "playerInit() {\n return this.createEntity('player');\n }", "title": "" }, { "docid": "ab358ddd545f7a36cec93e6689b8d888", "score": "0.44452274", "text": "function set(obj) {\r\n settings = $.extend(true, settings, obj);\r\n }", "title": "" }, { "docid": "eb8eaa2dd74d4368cf546aa6e8911b70", "score": "0.44412568", "text": "get instance() {\n\t\treturn this.__instance;\n\t}", "title": "" }, { "docid": "eb8eaa2dd74d4368cf546aa6e8911b70", "score": "0.44412568", "text": "get instance() {\n\t\treturn this.__instance;\n\t}", "title": "" }, { "docid": "bfb4b8e62c64726d64ccfc73d2eeadd1", "score": "0.4436742", "text": "from(get) {\n return new PluginFieldProvider(this, get);\n }", "title": "" }, { "docid": "3167c060c6189821fad72b569a1a1291", "score": "0.44362298", "text": "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._currentUserId = window.currentUserId;\r\n this._currentCompanyId = window.currentCompanyId;\r\n this.init();\r\n }", "title": "" }, { "docid": "1f113838e3550de7b174b0e6314da2d2", "score": "0.44305897", "text": "run (Context) {\n Context.macro('setValue', function (key, value) {\n _.set(this.$presenter.$data, key, value)\n })\n }", "title": "" }, { "docid": "e05f99e0f7bfd3265dec9ad58dd3e8d4", "score": "0.44294935", "text": "pick(entity) {\n names = entity.ID.split(\"/\")\n\n switch (entity.Type) {\n case \"element\":\n case \"cluster\":\n case \"instance\":\n model = this.model\n element = names[0]\n\n loadSolution(view.domain, view.solution)\n .then(() => {\n model.SolElement = model.Solution.Elements[element]\n view.nav = \"Solution\"\n })\n return\n }\n }", "title": "" }, { "docid": "2c0fa79536526b1bd8d988aec23b2544", "score": "0.44121844", "text": "setProduct(product) {\n this.product = product;\n return this;\n }", "title": "" }, { "docid": "2c0fa79536526b1bd8d988aec23b2544", "score": "0.44121844", "text": "setProduct(product) {\n this.product = product;\n return this;\n }", "title": "" }, { "docid": "a4ce998f1f143a355297459148456e6b", "score": "0.43988073", "text": "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._currentCompanyId = window.currentCompanyId;//当前组织ID\r\n this._currentCompanyUserId = window.currentCompanyUserId;//当前员工ID\r\n this.init();\r\n }", "title": "" }, { "docid": "eeafd5d9dcf393f5d70272c169676656", "score": "0.4394437", "text": "attachPlugin(plugin) {\n if (this.#plugins.get(plugin.name)) {\n throw new Error(`cannot replace existing plugin: ${plugin.name} `);\n }\n this.#plugins.set(plugin.name, plugin.connect(this));\n return this;\n }", "title": "" }, { "docid": "c74a9f9ce566a5321281dd93a054cb47", "score": "0.43846783", "text": "function Plugin(element, options) {\r\n this.element = element;\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._currentCompanyId = window.currentCompanyId;\r\n this._selectedOrg = null;//当前选中的组织\r\n this.init();\r\n }", "title": "" }, { "docid": "c9f574ee1422dac1d31d87d2441c538a", "score": "0.43791416", "text": "setValue(property, value) {\n IDependencyObject.setValue(this, property, value);\n }", "title": "" }, { "docid": "d775afc67c97756cbadcca97b5d53d20", "score": "0.43764225", "text": "_init() {\n if (tinymce !== 'undefined') {\n this.$element.wrap('<div class=\"tiny-mce-editor\"></div>');\n\n this.$media = $(`#${this.mediaHandler}`);\n this.$shortcode = $(`#${this.shortcodeHandler}`);\n\n this.id = GetOrSetId(this.$element, 'tme');\n this.$wrapper = this.$element.parents('.tiny-mce-editor:first');\n this.computed = { target: this.$element.get(0), setup: this._setupCallback.bind(this) };\n this.options = $.extend({}, this.options, this.computed);\n this.options = this._snakeCase(this.options);\n\n tinymce.init(this.options);\n this._events();\n } else {\n console.log('TinyMCE is not available! Please download and install TinyMCE.');\n }\n }", "title": "" }, { "docid": "509cdaaba5796001a7ac6aee6d69e78b", "score": "0.43558332", "text": "setup()\n {\n // Some helpers\n const siteTemplate = this.options.siteTemplate || '${site.name.urlify()}';\n const entityCategoryTemplate = siteTemplate + '/' + (this.options.entityCategoryTemplate || '${entityCategory.pluralName.urlify()}');\n const entityIdTemplate = entityCategoryTemplate + '/' + (this.options.entityIdTemplate || '${entityCategory.shortName.urlify()}-${entityId.name.urlify()}');\n\n // Settings\n this.settings.add(\n {\n formats:\n {\n date: 'DD.MM.YYYY',\n number: '0.00'\n }\n });\n if (this.options.settings)\n {\n this.settings.add(this.options.settings);\n }\n\n // Urls\n this.urls.add(\n {\n root: '',\n siteTemplate: '${root}/' + siteTemplate,\n entityCategoryTemplate: '${root}/' + entityCategoryTemplate,\n entityIdTemplate: '${root}/' + entityIdTemplate\n });\n\n // Pathes\n this.pathes.add(\n this.clean(\n {\n root: this.options.pathes.root,\n entojTemplate: this.options.pathes.entoj || '${root}',\n cacheTemplate: '${entoj}/cache',\n sitesTemplate: '${root}/sites',\n siteTemplate: '${sites}/' + siteTemplate,\n entityCategoryTemplate: '${sites}/' + entityCategoryTemplate,\n entityIdTemplate: '${sites}/' + entityIdTemplate\n }));\n\n // Sites\n this.mappings.add(require('../model/index.js').site.SitesLoader,\n {\n '!plugins':\n [\n require('../model/index.js').loader.documentation.PackagePlugin,\n require('../model/index.js').loader.documentation.MarkdownPlugin\n ]\n });\n\n // EntityCategories\n const entityCategories = this.options.entityCategories ||\n [\n {\n longName: 'Global',\n pluralName: 'Global',\n isGlobal: true\n },\n {\n longName: 'Atom'\n },\n {\n longName: 'Molecule'\n },\n {\n longName: 'Organism'\n },\n {\n longName: 'Template'\n },\n {\n longName: 'Page'\n }\n ];\n this.mappings.add(require('../model/index.js').entity.EntityCategoriesLoader,\n this.clean(\n {\n categories: entityCategories\n }));\n\n // Entities\n this.mappings.add(require('../parser/index.js').entity.CompactIdParser,\n {\n options:\n {\n useNumbers: this.options.entityIdUseNumbers || false\n }\n });\n this.mappings.add(require('../model/index.js').entity.EntitiesLoader,\n {\n '!plugins':\n [\n require('../model/index.js').loader.documentation.PackagePlugin,\n {\n type: require('../model/index.js').loader.documentation.MarkdownPlugin,\n options:\n {\n sections:\n {\n DESCRIPTION: 'Abstract',\n FUNCTIONAL: 'Functional'\n }\n }\n },\n require('../model/index.js').loader.documentation.JinjaPlugin,\n require('../model/index.js').loader.documentation.ExamplePlugin,\n require('../model/index.js').loader.documentation.StyleguidePlugin\n ]\n });\n\n // ViewModel\n this.mappings.add(require('../model/index.js').viewmodel.ViewModelRepository,\n {\n '!plugins':\n [\n require('../model/index.js').viewmodel.plugin.ViewModelImportPlugin,\n require('../model/index.js').viewmodel.plugin.ViewModelLipsumPlugin,\n require('../model/index.js').viewmodel.plugin.ViewModelLipsumHtmlPlugin,\n require('../model/index.js').viewmodel.plugin.ViewModelTranslatePlugin\n ]\n });\n\n // Translations\n this.mappings.add(require('../model/index.js').translation.TranslationsLoader,\n this.clean(\n {\n filenameTemplate: this.options.models.translationFileTemplate || this.options.models.translationsFile\n }));\n\n // Settings\n this.mappings.add(require('../model/index.js').setting.SettingsLoader,\n this.clean(\n {\n filenameTemplate: this.options.models.settingsFile\n }));\n\n // ModelSynchronizer\n this.mappings.add(require('../watch/index.js').ModelSynchronizer,\n {\n '!plugins':\n [\n require('../watch/index.js').ModelSynchronizerTranslationsPlugin,\n require('../watch/index.js').ModelSynchronizerSettingsPlugin,\n require('../watch/index.js').ModelSynchronizerEntitiesPlugin,\n require('../watch/index.js').ModelSynchronizerSitesPlugin\n ]\n });\n\n // Nunjucks filter & tags\n this.mappings.add(require('../nunjucks/index.js').Environment,\n {\n options:\n {\n templatePaths: this.pathes.root + '/sites'\n },\n '!helpers':\n [\n {\n type: require('../nunjucks/index.js').helper.LipsumHelper\n }\n ],\n '!tags':\n [\n {\n type: require('../nunjucks/index.js').tag.ConfigurationTag\n }\n ],\n '!filters': this.clean(\n [\n {\n type: require('../nunjucks/index.js').filter.AssetUrlFilter,\n baseUrl: this.options.filters.assetUrl\n },\n {\n type: require('../nunjucks/index.js').filter.AttributeFilter\n },\n {\n type: require('../nunjucks/index.js').filter.AttributesFilter\n },\n {\n type: require('../nunjucks/index.js').filter.ConfigurationFilter\n },\n {\n type: require('../nunjucks/index.js').filter.DebugFilter\n },\n {\n type: require('../nunjucks/index.js').filter.EmptyFilter\n },\n {\n type: require('../nunjucks/index.js').filter.FormatDateFilter\n },\n {\n type: require('../nunjucks/index.js').filter.FormatNumberFilter\n },\n {\n type: require('../nunjucks/index.js').filter.HyphenateFilter\n },\n {\n type: require('../nunjucks/index.js').filter.JsonEncodeFilter\n },\n {\n type: require('../nunjucks/index.js').filter.LinkUrlFilter,\n dataProperties: this.options.filters.linkProperties\n },\n {\n type: require('../nunjucks/index.js').filter.LipsumFilter\n },\n {\n type: require('../nunjucks/index.js').filter.LoadFilter\n },\n {\n type: require('../nunjucks/index.js').filter.MarkdownFilter\n },\n {\n type: require('../nunjucks/index.js').filter.MarkupFilter,\n styles: this.options.filters.markupStyles\n },\n {\n type: require('../nunjucks/index.js').filter.MediaQueryFilter\n },\n {\n type: require('../nunjucks/index.js').filter.ModuleClassesFilter\n },\n {\n type: require('../nunjucks/index.js').filter.NotEmptyFilter\n },\n {\n type: require('../nunjucks/index.js').filter.GetFilter\n },\n {\n type: require('../nunjucks/index.js').filter.SetFilter\n },\n {\n type: require('../nunjucks/index.js').filter.SettingFilter\n },\n {\n type: require('../nunjucks/index.js').filter.SvgUrlFilter,\n baseUrl: this.options.filters.svgUrl || '/'\n },\n {\n type: require('../nunjucks/index.js').filter.SvgViewBoxFilter,\n basePath: this.options.filters.svgPath || '/'\n },\n {\n type: require('../nunjucks/index.js').filter.TranslateFilter\n },\n {\n type: require('../nunjucks/index.js').filter.TranslationsFilter\n },\n {\n type: require('../nunjucks/index.js').filter.UniqueFilter\n }\n ])\n }\n );\n\n // Linter\n this.commands.add(require('../command/index.js').LintCommand,\n {\n '!linters':\n [\n {\n type: require('../linter/index.js').NunjucksFileLinter\n }\n ]\n });\n\n // Server\n this.commands.add(require('../command/index.js').ServerCommand,\n {\n options:\n {\n port: this.options.server.port || this.local.port || 3000,\n http2: this.options.server.http2 || this.local.http2 || false,\n sslKey: this.options.server.sslKey || this.local.sslKey || false,\n sslCert: this.options.server.sslCert || this.local.sslCert || false,\n authentication: this.local.authentication || false,\n credentials: this.options.server.credentials || this.local.credentials || { username: 'entoj', password: 'entoj' },\n routes:\n [\n {\n type: require('../server/index.js').route.StaticFileRoute,\n options:\n {\n basePath: '${sites}',\n allowedExtensions: this.options.server.staticExtensions\n }\n },\n {\n type: require('../server/index.js').route.EntityTemplateRoute,\n options:\n {\n basePath: '${sites}'\n }\n }\n ]\n }\n }\n );\n\n\n // Config\n this.commands.add(require('../command/index.js').ConfigCommand);\n }", "title": "" }, { "docid": "2dc3f99638b60942477eda8121c42aa3", "score": "0.43433422", "text": "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._selectedUserIds = '';//已选人员ids\r\n this.init();\r\n }", "title": "" }, { "docid": "8bdc0791fe4379ae7fe3aa0f08165ff3", "score": "0.43427277", "text": "static registerPlugin(pluginClass) {\r\n GridStackDDI.ddi = new pluginClass();\r\n return GridStackDDI.ddi;\r\n }", "title": "" }, { "docid": "4352015133c49bd339b98ae21639df2a", "score": "0.43373147", "text": "set(object, name, value) {\n this.$set(object, name, value)\n }", "title": "" }, { "docid": "924ea3779672909df70cadbcc13f6cba", "score": "0.43269643", "text": "constructor() {\n super();\n\n /**\n * Entity information json data\n * @protected\n * @type {JSON}\n */\n this.entityData = null;\n\n /**\n * Entity animation\n * @type {GameImage}\n */\n this.animation = null;\n\n /**\n * Selection entity\n * @protected\n * @type {JSON}\n */\n this.selectEntity = null;\n\n /**\n * Selected entity\n * @protected\n * @type {JSON}\n */\n this.selectedEntity = null;\n }", "title": "" }, { "docid": "2002563d88b420a3cfeaad591b031e69", "score": "0.43259415", "text": "setPluginContext(\n // tslint:disable-next-line:no-any\n moduleExports, tracer, version, options, basedir) {\n this.moduleExports = moduleExports;\n this.tracer = tracer;\n this.version = version;\n this.basedir = basedir;\n this.logger = tracer.logger;\n this.options = options;\n this.internalFilesExports = this.loadInternalFiles();\n }", "title": "" }, { "docid": "2704fb53e5ae478c2340a87b1f65cb68", "score": "0.4322323", "text": "function Init( AgUtPluginSite )\n{\n\tm_AgUtPluginSite = AgUtPluginSite;\n\t\n\treturn true;\n}", "title": "" }, { "docid": "66b54bdbb7196bbd8c3d8d07fd520e5e", "score": "0.43206102", "text": "setConnectorBuilderInstance(nodeBuilder, nodeStack){\n\t\tthis.nodeBuilder = nodeBuilder; \n\t\tthis.nodeStack = nodeStack; \n\t}", "title": "" }, { "docid": "91afc769b07ad8d9951a6e3650cff355", "score": "0.43204772", "text": "function setArticle (article) {\n // console.log('Set article', article);\n setAttributes({ id: article.entity_id });\n setAttributes({ title: article.short_title });\n setAttributes({ teaser: article.teaser });\n setAttributes({ link: article.link });\n setAttributes({ image: article.main_image });\n setAttributes({ caption: article.image_caption });\n }", "title": "" }, { "docid": "7385cc8cec5c3f3d5ae65e2b5b54ddba", "score": "0.43181545", "text": "entity_fields(entity_fields) {\n this.attrs.entity_fields = entity_fields;\n return this;\n }", "title": "" }, { "docid": "6b25af82f706747ff3091aa363e2f9ac", "score": "0.43100646", "text": "function Plugin ( element, options ) {\r\n\t\tvar plugin = this;\r\n\t\tplugin.element = $(element);\r\n\t\t// jQuery has an extend method which merges the contents of two or\r\n\t\t// more objects, storing the result in the first object. The first object\r\n\t\t// is generally empty as we don't want to alter the default options for\r\n\t\t// future instances of the plugin\r\n\t\tplugin.settings = $.extend( {}, defaults, options );\r\n\r\n\t\t// set all vars\r\n\t\tplugin._editor = plugin.element;\r\n\t\tif(!plugin._editor.hasClass('extra-custom-editor-wrapper')) {\r\n\t\t\tplugin._editor = plugin._editor.find('.extra-custom-editor-wrapper');\r\n\t\t}\r\n\r\n\t\tplugin._textarea = plugin._editor.find(\"textarea.extra-custom-editor:first\").addClass(\"mceEditor\");\r\n\r\n\t\tthis._id = plugin._textarea.attr(\"id\");\r\n\t\tplugin._default_body_class = tinymce.settings.body_class;\r\n\t\tplugin._default_id = tinymce.settings.id;\r\n\t\tplugin._default_height = plugin.settings.height;\r\n\t\tplugin._default_content_css = tinymce.settings.content_css;\r\n\t\tplugin._default_selector = tinymce.settings.selector;\r\n\t\tplugin._default_wp_autoresize_on = tinymce.settings.wp_autoresize_on;\r\n\t\tplugin._default_wpautop = tinymce.settings.wpautop;\r\n\t\tplugin._default_plugins = tinymce.settings.plugins;\r\n\r\n\t\tplugin._tempSettings = $.extend({}, tinymce.settings);\r\n\t\tplugin._handle = $(\"#\" + plugin._id + \"-resize-handle\");\r\n\t\tplugin._mce = false;\r\n\t\tplugin._offset = 0;\r\n\t\tplugin._mceEditor = tinymce.get(plugin._id);\r\n\t\tplugin._document = $(document);\r\n\r\n\t\tplugin.init = function () {\r\n\t\t\tquicktags({\r\n\t\t\t\tid : plugin._id,\r\n\t\t\t\tbuttons : 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'\r\n\t\t\t});\r\n\r\n\t\t\t// SET NEW VALUES\r\n\t\t\ttinymce.settings.body_class = tinymce.settings.body_class + \" \" + plugin._textarea.data(\"extra-name\");\r\n\t\t\ttinymce.settings.id = plugin._id;\r\n\t\t\ttinyMCE.settings.id = plugin._id;\r\n\t\t\ttinymce.settings.height = plugin.settings.height;\r\n\t\t\ttinymce.settings.selector = '#'+plugin._id;\r\n\t\t\ttinymce.settings.wp_autoresize_on = false;\r\n\t\t\ttinymce.settings.wpautop = true;\r\n\t\t\t// try to remove ',wpview' for parse video issue...\r\n\t\t\ttinymce.settings.plugins = tinymce.settings.plugins.replace(',wpview', '');\r\n\r\n\t\t\tif(plugin._textarea.data('custom-css')) {\r\n\t\t\t\ttinymce.settings.content_css = tinymce.settings.content_css + ',' + plugin._textarea.data('custom-css');\r\n\t\t\t}\r\n\t\t\ttinyMCEPreInit.mceInit[ plugin._id ] = $.extend({}, tinymce.settings);\r\n\r\n\t\t\t// SET NEW EDITOR\r\n\t\t\ttinymce.execCommand('mceAddEditor', false, plugin._id);\r\n\r\n\t\t\t// MAKE IT RESIZABLE\r\n\t\t\tplugin._handle.on('mousedown.extra-editor-resize', function(event) {\r\n\t\t\t\tif ( typeof tinymce !== 'undefined') {\r\n\t\t\t\t\tplugin._mceEditor = tinymce.get(plugin._id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (plugin._mceEditor && !plugin._mceEditor.isHidden()) {\r\n\t\t\t\t\tplugin._mce = true;\r\n\t\t\t\t\tplugin._offset = $('#' + plugin._id + '_ifr').height() - event.pageY;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tplugin._mce = false;\r\n\t\t\t\t\tplugin._offset = plugin._textarea.height() - event.pageY;\r\n\t\t\t\t\tplugin._textarea.blur();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tplugin._document.on('mousemove.extra-editor-resize', plugin.dragging).on('mouseup.extra-editor-resize mouseleave.extra-editor-resize', plugin.endDrag);\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t}).on('mouseup.extra-editor-resize', plugin.endDrag);\r\n\r\n\r\n\t\t\t// OK, PROCESSED\r\n\t\t\tplugin._document.trigger(\"extra-editor-processed\", [plugin._wrapper, plugin._id]);\r\n\t\t\tplugin._editor.addClass('extra-editor-processed');\r\n\r\n\t\t\t// RESET DEFAULT VALUES\r\n\t\t\ttinymce.settings.body_class = plugin._default_body_class;\r\n\t\t\ttinymce.settings.id = plugin._default_id;\r\n\t\t\ttinymce.settings.selector = plugin._default_selector;\r\n\t\t\ttinymce.settings.wp_autoresize_on = plugin._default_wp_autoresize_on;\r\n\t\t\ttinymce.settings.wpautop = plugin._default_wpautop;\r\n\t\t\ttinymce.settings.height = plugin._default_height;\r\n\t\t\ttinymce.settings.content_css = plugin._default_content_css;\r\n\t\t\ttinymce.settings.plugins = plugin._default_plugins;\r\n\t\t\ttinymce.settings = $.extend({}, plugin._tempSettings);\r\n\r\n\t\t\tplugin._editor.on('enable.extraPageBuilderCustomEditor', plugin.enable);\r\n\t\t\tplugin._editor.on('disable.extraPageBuilderCustomEditor', plugin.disable);\r\n\t\t};\r\n\t\tplugin.dragging = function(event) {\r\n\t\t\tif (plugin._mce) {\r\n\t\t\t\tplugin._mceEditor.theme.resizeTo(null, plugin._offset + event.pageY);\r\n\t\t\t} else {\r\n\t\t\t\tplugin._textarea.height(Math.max(50, plugin._offset + event.pageY));\r\n\t\t\t}\r\n\t\t\tevent.preventDefault();\r\n\t\t};\r\n\t\tplugin.endDrag = function() {\r\n\t\t\tvar height,\r\n\t\t\t\ttoolbarHeight;\r\n\t\t\tif (plugin._mce) {\r\n\t\t\t\tplugin._mceEditor.focus();\r\n\t\t\t\ttoolbarHeight = $('#wp-' + plugin._id + '-editor-container .mce-toolbar-grp').height();\r\n\t\t\t\tif (toolbarHeight < 10 || toolbarHeight > 200) {\r\n\t\t\t\t\ttoolbarHeight = 30;\r\n\t\t\t\t}\r\n\t\t\t\theight = parseInt($('#' + plugin._id + '_ifr').css('height'), 10) + toolbarHeight - 28;\r\n\t\t\t} else {\r\n\t\t\t\tplugin._textarea.focus();\r\n\t\t\t\theight = parseInt(plugin._textarea.css('height'), 10);\r\n\t\t\t}\r\n\t\t\tplugin._document.off('.extra-editor-resize');\r\n\t\t\t// sanity check\r\n\t\t\tif (height && height > 50 && height < 5000) {\r\n\t\t\t\tsetUserSetting('ed_size', height);\r\n\t\t\t}\r\n\t\t};\r\n\t\tplugin.enable = function () {\r\n\t\t\ttinymce.settings.height = plugin.settings.height;\r\n\t\t\ttinymce.execCommand('mceFocus', false, plugin._id);\r\n\r\n\t\t\tvar rawContent = plugin._textarea.val();\r\n//\t\t\tif (tinymce.get(plugin._id)) {\r\n//\t\t\t\tconsole.log(tinymce.get);\r\n//\t\t\t\trawContent = tinymce.get(plugin._id).getContent();\r\n//\t\t\t}\r\n\t\t\tplugin._textarea.val(window.switchEditors.wpautop(rawContent));\r\n\t\t\ttinymce.execCommand('mceAddEditor', false, plugin._id);\r\n\t\t\ttinymce.execCommand('mceFocus', false, plugin._id);\r\n\t\t};\r\n\t\tplugin.disable = function () {\r\n\t\t\ttinymce.execCommand('mceRemoveEditor', false, plugin._id);\r\n\t\t};\r\n\r\n\t\tplugin.init();\r\n\t}", "title": "" }, { "docid": "3b1a047dd2c0abe610c14163801f937c", "score": "0.43069196", "text": "setController(controller) {\n this[local.config].controller = controller;\n }", "title": "" }, { "docid": "fd83e58bb6929c050f9fbc8e521a1e14", "score": "0.43041843", "text": "initializeEntity(entity, data) { }", "title": "" }, { "docid": "806dc77b76c7571eece28a7091eb5fb9", "score": "0.43023634", "text": "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._currentCompanyId = window.currentCompanyId;//当前组织ID\r\n this.init();\r\n }", "title": "" }, { "docid": "806dc77b76c7571eece28a7091eb5fb9", "score": "0.43023634", "text": "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._currentCompanyId = window.currentCompanyId;//当前组织ID\r\n this.init();\r\n }", "title": "" }, { "docid": "8ac57394d66e70eaa3db2ac0c03e995d", "score": "0.43007377", "text": "set partner(partner){\n super.partner=partner;\n // send the partner over...\n this._sendNewEvent('PARTNER',this._partner,2);\n }", "title": "" }, { "docid": "af8d6a46f0439da8924ffd8a3f16d836", "score": "0.42986178", "text": "async initStep() {\n this.settings = await this.mustFindServices('settings');\n return this.init();\n }", "title": "" }, { "docid": "182f0618ac8060f34bd59eb5197c92c5", "score": "0.42967623", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data('hermes.externalconnector');\n if (!data) $this.data('hermes.externalconnector', (data = new ExternalConnector(this)));\n })\n }", "title": "" }, { "docid": "14c90cf044b8e5e6673a5e4a7abcef8f", "score": "0.42961818", "text": "constructor() {\n this.id = Config.runningId++;\n Config.entities[this.id] = this;\n }", "title": "" }, { "docid": "bd92857efbed93c2ad6f346213224b01", "score": "0.4295133", "text": "setPlatform(platform) {\n this.platform = platform;\n }", "title": "" }, { "docid": "7b13fd45a014194c29987b10dc676751", "score": "0.42868167", "text": "function init(component/*:Component*/)/*:void*/ {var this$=this;\n com.coremedia.cms.editor.sdk.premular.fields.plugins.SetLocalizedPluginBase.prototype.init.call(this,component);\n component.on(\"afterrender\",\n function(field/*:Component*/)/*:void*/{\n var labelElement/*:Element*/ = findLabel$static(field);\n var tooltip/*:String*/ = com.coremedia.cms.editor.sdk.util.PropertyEditorUtil.getLocalizedTooltip(this$.contentTypeValueExpression.getValue(), this$.propertyName);\n if (labelElement && tooltip !== this$.propertyName) {\n Ext.tip.QuickTipManager.register({\n target: labelElement,\n text: tooltip\n });\n }\n }\n );\n\n component.on(\"destroy\",\n function(field/*:Component*/)/*:void*/{\n var labelElement/*:Element*/ = findLabel$static(field);\n if(labelElement){\n Ext.tip.QuickTipManager.unregister(labelElement);\n }\n }\n );\n }", "title": "" }, { "docid": "72111ed4c2c8722d356694de6bdac858", "score": "0.42746803", "text": "static define() { return new PluginField(); }", "title": "" }, { "docid": "75b9fa87d61c0b622e02f4589b441771", "score": "0.42720878", "text": "registerInWindow() {\n window.pingu.components[this.name].instances[this.uuid] = this;\n }", "title": "" }, { "docid": "18281254df10d97fd6f56a79a363b35b", "score": "0.4268517", "text": "function setup(localforageInstance) {\n if (!localforageInstance._pluginPrivateVariables) {\n localforageInstance._pluginPrivateVariables = {\n listOfImportantThings: [],\n callCount: 0\n };\n\n // in case you need to observe the invocation of some methods\n wireUpMethods(localforageInstance);\n }\n}", "title": "" }, { "docid": "8860d0c24eb2c09942e610e026c78c2c", "score": "0.4253327", "text": "set provider(patch) {\n Object.assign(this._provider, patch)\n }", "title": "" }, { "docid": "4b39c4ba6ae116a4f912108391fcc1e9", "score": "0.42383146", "text": "objectProxySetProp(target, prop, value, receiver) {\n ActiveClassification.setInstanceVariableValue({\n object: target,\n instanceVariableName: prop,\n value: value,\n })\n\n return target\n }", "title": "" }, { "docid": "fb7be1cbdc369dfb60d6da02c2a82945", "score": "0.42380118", "text": "enablePlugin() {\n this.sourceData = this.hot.getSourceData();\n this.trimRowsPlugin = this.hot.getPlugin('trimRows');\n this.manualRowMovePlugin = this.hot.getPlugin('manualRowMove');\n this.bindRowsWithHeadersPlugin = this.hot.getPlugin('bindRowsWithHeaders');\n\n this.dataManager = new DataManager(this, this.hot, this.sourceData);\n this.collapsingUI = new CollapsingUI(this, this.hot, this.trimRowsPlugin);\n this.headersUI = new HeadersUI(this, this.hot);\n this.contextMenuUI = new ContextMenuUI(this, this.hot);\n\n this.dataManager.rewriteCache();\n\n this.addHook('afterInit', (...args) => this.onAfterInit(...args));\n this.addHook('beforeRender', (...args) => this.onBeforeRender(...args));\n this.addHook('modifyRowData', (...args) => this.onModifyRowData(...args));\n this.addHook('modifySourceLength', (...args) => this.onModifySourceLength(...args));\n this.addHook('beforeDataSplice', (...args) => this.onBeforeDataSplice(...args));\n this.addHook('beforeDataFilter', (...args) => this.onBeforeDataFilter(...args));\n this.addHook('afterContextMenuDefaultOptions', (...args) => this.onAfterContextMenuDefaultOptions(...args));\n this.addHook('afterGetRowHeader', (...args) => this.onAfterGetRowHeader(...args));\n this.addHook('beforeOnCellMouseDown', (...args) => this.onBeforeOnCellMouseDown(...args));\n this.addHook('afterRemoveRow', (...args) => this.onAfterRemoveRow(...args));\n this.addHook('modifyRemovedAmount', (...args) => this.onModifyRemovedAmount(...args));\n this.addHook('beforeAddChild', (...args) => this.onBeforeAddChild(...args));\n this.addHook('afterAddChild', (...args) => this.onAfterAddChild(...args));\n this.addHook('beforeDetachChild', (...args) => this.onBeforeDetachChild(...args));\n this.addHook('afterDetachChild', (...args) => this.onAfterDetachChild(...args));\n this.addHook('modifyRowHeaderWidth', (...args) => this.onModifyRowHeaderWidth(...args));\n this.addHook('afterCreateRow', (...args) => this.onAfterCreateRow(...args));\n this.addHook('beforeRowMove', (...args) => this.onBeforeRowMove(...args));\n this.addHook('afterRowMove', (...args) => this.onAfterRowMove(...args));\n this.addHook('afterLoadData', (...args) => this.onAfterLoadData(...args));\n\n if (!this.trimRowsPlugin.isEnabled()) {\n // Workaround to prevent calling updateSetttings in the enablePlugin method, which causes many problems.\n this.trimRowsPlugin.enablePlugin();\n this.hot.getSettings().trimRows = true;\n }\n\n super.enablePlugin();\n }", "title": "" }, { "docid": "9484434094bdc0a096896536a8158c3d", "score": "0.42286402", "text": "function setPref(args, editToken, prefName, prefValue) {\n var widgetId = rave.getObjectIdFromDomId(args.gs.getActiveSiteHolder().getElement().id);\n var regionWidget = rave.getRegionWidgetById(widgetId);\n // update the memory prefs object\n regionWidget.userPrefs[prefName] = prefValue;\n // persist it to database\n rave.api.rest.saveWidgetPreference({regionWidgetId:widgetId, userPref:{prefName:prefName, prefValue:prefValue}});\n }", "title": "" }, { "docid": "8ea959b25b760338421cf3d2ee145d29", "score": "0.42242232", "text": "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._currentCompanyUserId = window.currentCompanyUserId;\r\n this._currentCompanyId = window.currentCompanyId;//当前组织ID\r\n this._taskIssueList = [];//当前经营列表\r\n this._isOrgManager = 0;\r\n this._isAssistant = 0;\r\n this.init();\r\n }", "title": "" }, { "docid": "d2a948e8c0715ef2525c8f5357d9565a", "score": "0.42222178", "text": "initialize(){this._saveInstanceProperties()}", "title": "" }, { "docid": "049a2ae9b740631d7d14b8be91dfc6d2", "score": "0.4215952", "text": "setPlayer(computerPlayer){\n\t\tthis.computerPlayer = computerPlayer;\n\t}", "title": "" }, { "docid": "aab002bcbab06950e9cf2f12d5076a8f", "score": "0.4208946", "text": "function Entity(me) {\n this.lectureID = me ? me.lectureID : currentLecture.id;\n this.slideID = me ? me.PageID : currentSlide.id;\n this.type = me ? me.entityType : \"textbox\";\n this.id = me ? me.entityID : idPlaceHolder + fakeIDCount++;\n this.x = me ? me.entityX : 0;\n this.y = me ? me.entityY : 0;\n this.z = me ? me.entityZ : 0;\n this.anim = me ? me.entityAnimation : \"none\";\n this.height = me ? me.entityHeight : 0;\n this.width = me ? me.entityWidth : 0;\n this.content = me ? me.entityContent : \"\";\n this.status = me ? \"unchanged\" : \"added\";\n this.changed = me ? false : true;\n}", "title": "" }, { "docid": "499410fcf5404bc63de4b4fe4c198973", "score": "0.4205429", "text": "constructor() {\n super();\n\n /**\n * Owned entity\n * @protected\n * @type {Entity}\n */\n this.owner = null;\n }", "title": "" }, { "docid": "499410fcf5404bc63de4b4fe4c198973", "score": "0.4205429", "text": "constructor() {\n super();\n\n /**\n * Owned entity\n * @protected\n * @type {Entity}\n */\n this.owner = null;\n }", "title": "" }, { "docid": "20c14b059e5dedc1644949f6127620ff", "score": "0.42023602", "text": "constructor() {\r\n this.instance = null;\r\n }", "title": "" }, { "docid": "961443c382c8a2972d9038c8ab3ebe95", "score": "0.4189114", "text": "withPlugin(plugin) {\n return new InsertQueryBuilder({\n ...this.#props,\n executor: this.#props.executor.withPlugin(plugin),\n });\n }", "title": "" }, { "docid": "c6801ff2c23663713db9da8f47418492", "score": "0.4186521", "text": "setComponent() {\n // Properties\n if (this.id) this.safeSet('id', this.id);\n if (this.type) this.safeSet('type', this.type);\n\n // Attributes\n if (this.nav) this.safeSet('nav', this.nav);\n if (this.col) this.safeSet('col', this.col);\n if (this.offset) this.safeSet('offset', this.offset);\n if (this.css) this.safeSet('css', this.css);\n }", "title": "" }, { "docid": "597b70fd6b84499bf3d9e6e98efe1d8b", "score": "0.41837755", "text": "constructor(entity, properties) {\n\n this.entity = entity + '';\n\n this.load(properties || {});\n }", "title": "" }, { "docid": "0fe7c0a72a4da48818fae499f707f391", "score": "0.41775775", "text": "setValue(val) {\n\t\toptions.set(this.get('id'), val);\n\t}", "title": "" }, { "docid": "c6c5610d22143d38290065be5b340a95", "score": "0.4173867", "text": "activate_entities(){\n //\n //Loop through all the static entities and activate each one of them\n for(let ename in this.entities){ \n //\n let static_entity = this.entities[ename];\n //\n //Create the active entity, passing this database as the parent\n let active_entity = new entity(this, static_entity);\n //\n //Replace the static with the active entity\n this.entities[ename] = active_entity;\n }\n }", "title": "" }, { "docid": "f269b062653bb3989c8b0179debc76e4", "score": "0.41731724", "text": "set property(){}", "title": "" }, { "docid": "512df056fec17b1091d3876ca883f4f3", "score": "0.4169483", "text": "getEntity()\n {\n if (this.props.entity !== null)\n {\n return this.props.entity;\n }\n\n throw new Meteor.Error('Entity not set');\n }", "title": "" }, { "docid": "2c7075b4e8cd91df1deed58cdc6348ab", "score": "0.4159754", "text": "static set property(){}", "title": "" }, { "docid": "4d203e821cf815d38f954ec089550cfd", "score": "0.41542542", "text": "function Entity() {\n}", "title": "" }, { "docid": "6b79c9b39a741b13705ea7e0748c274b", "score": "0.41538933", "text": "setTitulo(x){\n this.titulo = x;\n }", "title": "" }, { "docid": "1bed09ebc6761ae10c2c355af76b9b45", "score": "0.41507474", "text": "function WidgetScript(entity, comp){\n this.me = entity;\n this.selected = false;\n \n var inputmapper = me.GetOrCreateComponent(\"EC_InputMapper\");\n inputmapper.RegisterMapping(\"Ctrl+Tab\", \"ToggleCamera\", 1);\n this.CreateHandlers();\n\n}", "title": "" }, { "docid": "2f6398f0a207a12b47d2dd275e2ebe3a", "score": "0.4150611", "text": "function DelegatedEnactFactoryPlugin(options) {\n\tthis.options = options || {};\n}", "title": "" }, { "docid": "b2f0a3c3e068a21ffcb7448e202fa3c8", "score": "0.4146401", "text": "function plugin() {\n parameters = arguments;\n }", "title": "" }, { "docid": "acf3e451b2fce3cb642026943da69f6d", "score": "0.41459945", "text": "function _init() {\n createIntegrationModel(editor);\n }", "title": "" }, { "docid": "204af504cdb7e5f978b0cadbf48350ab", "score": "0.41459426", "text": "setEngine (engine) {\n if (this.middleware) throw new Error('JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice')\n const blockTracker = engine._blockTracker;\n const middleware = this._constructorFn({ engine, provider: engine, blockTracker });\n if (!middleware) throw new Error('JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware')\n if (typeof middleware !== 'function') throw new Error('JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function')\n this.middleware = middleware;\n }", "title": "" }, { "docid": "d28e25dcfbf9ab2fe70f5477d8feeff1", "score": "0.41450888", "text": "setSite(_success, _error)\n {\n this.site = new Site(this.config, _success, _error)\n }", "title": "" }, { "docid": "6ea6201c8e02c08828ca3687f5a7a897", "score": "0.4142982", "text": "bindEntity(entity) {\n if (entity && entity.data) {\n this._entity = entity;\n this._entity.addEventListener('this-branch-value-changed', () => {\n this._updateElements(this._entity);\n });\n this._entity.addEventListener('data-object-became-valid', () => {\n this._updateElements(this._entity);\n });\n this._entity.addEventListener('data-object-became-invalid', () => {\n this._updateElements(this._entity);\n });\n this._entity.addEventListener('field-value-changed', () => {\n this._updateElements(this._entity);\n });\n this._entity.addEventListener('data-injected', () => {\n this._updateElements(this._entity);\n });\n } else {\n // eslint-disable-next-line no-console\n console.warn('Invalid binding ', entity, this);\n }\n }", "title": "" }, { "docid": "86a59c1e52df89bac5be97446010d1f6", "score": "0.41360936", "text": "function Plugin ( element, options ) {\n\t\t\tthis.element = element;\n\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\tthis._defaults = defaults;\n\t\t\tthis._name = pluginName;\n\t\t\tthis.guid = this.guidGenerator();\n\t\t\tthis.init();\n\t\t}", "title": "" }, { "docid": "5eb0dce18bb57ce248c6e86b7b6e53d5", "score": "0.41332334", "text": "function Plugin ( element, options, content ) {\n\t\tthis.el = element;\n\t\tthis.$el = $(element);\n\t\tthis.content = content;\n\t\tthis._options = options;\n\t\tthis._version = pluginVersion;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\t}", "title": "" }, { "docid": "dc6c208354d46888395f775ff03f70a2", "score": "0.4132542", "text": "setAgent(agent) {\n this.form.find('#permission_template_access_grants_attributes_0_agent_id').val(agent)\n }", "title": "" }, { "docid": "8b90b2993070898b013714a3c01d1345", "score": "0.4131226", "text": "function IDEInstance(instance, type)\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n\t\n\t// Save the constructor parameters\n\tthis.instance = instance;\n\tthis.type = type;\n\t\n\t// Set the default property values from the property table\n\tthis.properties = {};\n\t\n\tfor (var i = 0; i < property_list.length; i++)\n\t\tthis.properties[property_list[i].name] = property_list[i].initial_value;\n\t\t\n\t// Plugin-specific variables\n\t// this.myValue = 0...\n}", "title": "" }, { "docid": "8b90b2993070898b013714a3c01d1345", "score": "0.4131226", "text": "function IDEInstance(instance, type)\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n\t\n\t// Save the constructor parameters\n\tthis.instance = instance;\n\tthis.type = type;\n\t\n\t// Set the default property values from the property table\n\tthis.properties = {};\n\t\n\tfor (var i = 0; i < property_list.length; i++)\n\t\tthis.properties[property_list[i].name] = property_list[i].initial_value;\n\t\t\n\t// Plugin-specific variables\n\t// this.myValue = 0...\n}", "title": "" }, { "docid": "8b90b2993070898b013714a3c01d1345", "score": "0.4131226", "text": "function IDEInstance(instance, type)\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n\t\n\t// Save the constructor parameters\n\tthis.instance = instance;\n\tthis.type = type;\n\t\n\t// Set the default property values from the property table\n\tthis.properties = {};\n\t\n\tfor (var i = 0; i < property_list.length; i++)\n\t\tthis.properties[property_list[i].name] = property_list[i].initial_value;\n\t\t\n\t// Plugin-specific variables\n\t// this.myValue = 0...\n}", "title": "" } ]
703294fdb5f724b60c5a2928e2234ffd
Build handler to open/close a SideNav; when animation finishes report completion in console
[ { "docid": "2ab91e6f31c13eee1b35f4bc6f5b4bb6", "score": "0.0", "text": "function buildDelayedToggler(navID) {\n return debounce(function() {\n $mdSidenav(navID)\n .toggle()\n .then(function () {\n $log.debug(\"toggle \" + navID + \" is done\");\n });\n }, 200);\n }", "title": "" } ]
[ { "docid": "5e74e3facf0a903dddb1b22b7843e59e", "score": "0.639161", "text": "function animationHandler() {\n if (opened === \"menu \") {\n setOpened(\"menu opened\");\n setAriaExpanded(\"opened\");\n } else {\n setOpened(\"menu \");\n setAriaExpanded(\"\");\n }\n }", "title": "" }, { "docid": "bcc566aafec29aec8221e5f94b2aa159", "score": "0.6296159", "text": "function side_nav_open(){\n// $('.side_nav').addClass('showSideNav');\n $(\".side_nav\").animate({left:'0'},10);\n $('.push_right').addClass('push_animation');\n}", "title": "" }, { "docid": "764edce119f65927af7532bc562320de", "score": "0.6294088", "text": "function openMainNavDrawer(event){\n \n $(\"#main_nav_holder\").show();\n\n //fade on msg then remove\n $('#main_nav_open_btn').stop().animate({\n left: -50\n }, 600, \"easeOutExpo\", function() {\n //animation done\n $(\"#main_nav_holder .contents\").stop().animate({\n left: 0\n }, 600, \"easeOutExpo\", function() {\n //animation done \n });\n });\n}", "title": "" }, { "docid": "d51ed09a2a10cc73816a0447075bc308", "score": "0.6178905", "text": "buildNav() {\n this.htmlData.root.innerHTML = this.htmlCode(this.htmlData.data);\n this.initHtmlElements();\n this.addMenuListeners();\n this.htmlData.toggleButtonOpen.addEventListener(\"click\", () =>\n this.buttonListener(event)\n );\n this.htmlData.toggleButtonClose.addEventListener(\"click\", () =>\n this.buttonListener(event)\n );\n }", "title": "" }, { "docid": "90a1fddeb3ac7660540718fb789f5149", "score": "0.61197096", "text": "onAnimationEnd_() {\n if (this.isOpen_()) {\n // On open sidebar\n const children = this.getRealChildren();\n this.scheduleLayout(children);\n this.scheduleResume(children);\n tryFocus(this.element);\n } else {\n // On close sidebar\n this.vsync_.mutate(() => {\n toggle(this.element, /* display */false);\n this.schedulePause(this.getRealChildren());\n });\n }\n }", "title": "" }, { "docid": "68d01f650359ed47d779439dfdfab1f9", "score": "0.6097178", "text": "function handleOpen() {\n $.background.animate({\n opacity: 0.5,\n duration: animationSpeed\n });\n menuWrapper.animate({\n left: 0,\n duration: animationSpeed\n });\n}", "title": "" }, { "docid": "ad7bc01ab0502fb0861e9118c9413a0f", "score": "0.6071963", "text": "function SideMenuHandler(){\n $('#side-pane')\n .transition('horizontal flip')\n ;\n $rootScope.side_menu = !$rootScope.side_menu;\n }", "title": "" }, { "docid": "e27a75b7ae7ce291c21eef58dc8b043e", "score": "0.60221875", "text": "function openNav() {\n title.animate({\n left: \"+=250\"\n }, 0.3, \"linear\")\n // else title.css(\"left\", \"-=250\")\n sidebar.addClass(\"displaySidebar\")\n main.addClass(\"mainSidebar\")\n }", "title": "" }, { "docid": "522c5aa9be503468f208f8d20c0d81e0", "score": "0.60178316", "text": "function openNav() {\n $('#nav-list li').removeClass('treelisthidden');\n storage.setItem(treesettings, '1');\n $('#sideNavigation').css('display', 'block');\n\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('.cover').css('display', 'none');\n $('body.support_kb').find('#sidefoot').css({\n 'width': '300px',\n 'margin-left': ''\n });\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '300px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '0');\n $('body').find('main').css('width', 'calc(100% - 350px)');\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"enable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n\n $('#side-toggle').attr('class', 'fa fa-angle-double-left');\n\n }", "title": "" }, { "docid": "6415f86b1664cb55a6d564a87caddc1d", "score": "0.587855", "text": "static openNav() {\n ElementHandler.setElementCSSById('sidebarMenu', 'width', \"250px\");\n ElementHandler.setElementCSSById('openSidebar', 'width', \"250px\");\n ElementHandler.hideElementById('openSidebar');\n }", "title": "" }, { "docid": "f78648bb952ab5e736a4c0c857284d54", "score": "0.5820691", "text": "function menuToggleClickHandler() {\n setSideMenuIsOpen(!sideMenuIsOpen);\n }", "title": "" }, { "docid": "5d9e05486bc9d31d5256b3ccbb3604ca", "score": "0.5809949", "text": "function openNav()\t{\n\t\tconsole.log('Open');\n\t\t$('#sidenav').addClass('open');\n\t\t$('#sidenav').removeClass('closed');\n\t\t$('#sidenav').css('width',\t'250px');\n\t\t//\n\t\t$('#main').css('transform',\t'translateX(250px)');\n\t\t$('#header_content').css('transform',\t'translateX(250px)');\n\t\t$('#about').css('transform',\t'translateX(250px)');\n\t}", "title": "" }, { "docid": "90ffcf75277957d54d632b49816a3d73", "score": "0.5759781", "text": "function outerNav() {\n\n /* Opens the navigation menu */\n navToggle.click(function(){\n\n perspective.addClass('perspective--modalview');\n\n setTimeout(function(){\n perspective.addClass('effect-rotate-left--animate');\n }, 25);\n\n $outerNav.add(outerNavLi).add(outerNavReturn).addClass('is-vis');\n });\n\n /* Closes the navigation menu on click of an item*/ \n outerNavReturn.add(outerNavLi).click(function(){\n\n perspective.removeClass('effect-rotate-left--animate');\n\n setTimeout(function(){\n perspective.removeClass('perspective--modalview');\n }, 400);\n\n $outerNav.add(outerNavLi).add(outerNavReturn).removeClass('is-vis');\n });\n\n }", "title": "" }, { "docid": "c6a6f3129741dcacfb7e6a2913d1ec04", "score": "0.5758662", "text": "function openNav() {\r\n side_nav.style.width = \"250px\";\r\n side_nav_shader.style.display = \"block\";\r\n}", "title": "" }, { "docid": "55d8f68e02fe38b3cca097714fe00670", "score": "0.5743227", "text": "open_side_nav() {\n var navButton = document.getElementsByClassName('js-drawer-open-left')[0];\n recreate_node(navButton, true);\n this.make_logo_home();\n var navDrawer = document.getElementById('NavDrawer');\n navDrawer.style.minWidth = '0px';\n navDrawer.style.width = '0px';\n navDrawer.style.display = 'block';\n navDrawer.style.left = '0';\n var navContainer = document.getElementById('NavContainer');\n var horizontalMenu = document.createElement('ul');\n horizontalMenu.id = 'od-nav-menu';\n var menuItems = navContainer.getElementsByClassName('mobile-nav__item')\n for (var i = 0; i < menuItems.length; i++) {\n horizontalMenu.appendChild(menuItems.item(i).cloneNode(true));\n }\n navDrawer.insertBefore(horizontalMenu, document.getElementById('SearchContainer'));\n navContainer.remove();\n if (window.location.href.indexOf(\"collections\") > -1\n && window.location.href.indexOf(\"products\") < 0) {\n try {\n document.getElementsByClassName('fixed-header')[0].style.paddingTop = '0px';\n } catch (error) {\n console.log(error);\n }\n } else {\n document.getElementById('PageContainer').style.marginTop = '130px';\n }\n var logo = document.getElementsByClassName('site-header__logo')[0];\n logo.style.display = 'none';\n logo.style.height = '0px';\n }", "title": "" }, { "docid": "bd6d589fe1f1554a171bd1a69acd564a", "score": "0.57238173", "text": "function navCloseHandler() {\n if (!widthFlg) {\n $navigation.removeClass('show');\n $navigation.attr('style', '');\n $btnMenu.text(\"menu\");\n $dropdownItem.removeClass('active');\n $dropdownItem.attr('style', '');\n $dropdownListItem.find(\"ul\").removeAttr('style');\n $(\"body\").removeClass(\"push_right\");\n $(\"body\").removeAttr('style');\n $btnMenu.css('display', 'none');\n $navItem.not(\".dropdown_list\").find(\"a > i.material-icons\").text(\" \");\n $dropdownItem.find('i.material-icons').text(\" \");\n } else {\n $btnMenu.css('display', 'block');\n $navItem.not(\".dropdown_list\").find(\"a > i.material-icons\").text(\"remove\");\n $dropdownItem.find('i.material-icons').text(\"keyboard_arrow_right\");\n }\n }", "title": "" }, { "docid": "a549f3f0e4a89d71cf0dd74694372eca", "score": "0.571118", "text": "toggleNavigationMenu() {\n const self = this;\n if (!this.sidebarIsOpen) {\n this.container.classList.remove('h5p-interactive-book-navigation-hidden');\n setTimeout(function () {\n self.container.classList.add('h5p-interactive-book-navigation-open');\n }, 1);\n }\n else {\n // Wait for the tranistion to end before hiding it completely\n H5P.Transition.onTransitionEnd(H5P.jQuery(this.container), function () {\n self.container.classList.add('h5p-interactive-book-navigation-hidden');\n }, 500);\n this.container.classList.remove('h5p-interactive-book-navigation-open');\n }\n\n this.sidebarIsOpen = !this.sidebarIsOpen;\n }", "title": "" }, { "docid": "800c6f8b1931d0189f1e34ba10a48ffd", "score": "0.5708707", "text": "static sideBarFunc(){\n navIcon.addEventListener('click', () => {\n sideBar.style.display = 'block';\n })\n }", "title": "" }, { "docid": "232e6de9d63c6d4d227aefd4ff53affb", "score": "0.568926", "text": "function closeNav() {\r\n side_nav.style.width = \"0\";\r\n side_nav_shader.style.display = \"none\";\r\n}", "title": "" }, { "docid": "b4499b3470280cbde382322225efaa50", "score": "0.56877893", "text": "function closeNav() {\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '20px');\n $('#nav-list li').addClass('treelisthidden');\n storage.removeItem(treesettings);\n $('#sideNavigation').css('display', 'none');\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('#sidefoot').css('margin-left', '-250px');\n $('body.support_kb').find('.cover').css('display', 'block');\n //$('body.support_kb').find('#sideNavigation').css('margin-left','0');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '-250px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('#side-toggle').attr('class', 'fa fa-angle-double-right');\n $(\"#sidefoot\").css(\"width\", \"50px\");\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"disable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n }", "title": "" }, { "docid": "0af8800ac7b0c4fed96e9f2f4e9a598d", "score": "0.5673787", "text": "function closeMainNavDrawer(event){\n\n //close drawer\n $(\"#main_nav_holder .contents\").stop().animate({\n left: -1000\n }, 1000, \"easeOutExpo\", function() {\n //animation done \n });\n\n $('#main_nav_open_btn').stop().delay(400).animate({\n left: 0\n }, 600, \"easeOutExpo\", function() {\n //animation done\n $(\"#main_nav_holder\").hide();\n });\n}", "title": "" }, { "docid": "faebd7809a78d4544e9babf6d1e3107d", "score": "0.56668997", "text": "function navigate(){\n\twidth = $(window).width();\n\t$(\"#header-wrap .sidebar\").css({\n\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\topacity: \"0\"\n\t});\n\t$(\"#header-wrap .browseMenu\").css({\n\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\topacity: \"0\"\n\t});\n\n\t$(\"#header-wrap .navigat\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\t\ttransform: \"translateX(-8px)\",\n\t\t\topacity: \"1\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#content-wrap .container-fluid a\").css({\n\t\t\tpointerEvents: \"none\",\n\t\t\tcursor: \"default\",\n\t\t});\n\t\t// $(\"#content-wrap .container-fluid\").css({\n\t\t// \tposition: \"relative\",\n\t\t// \tzIndex: \"111\",\n\t\t// \tbackgroundColor: \"gray\",\n\t\t// \topacity: \"0.8\",\n\t\t// \ttransition: \"all 0.4s ease\"\n\t\t// });\n\t});\n\t$(\"#header-wrap .sidebar .buttonBrowse\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\topacity: \"0\",\n\t\ttransition: \"all 0.4s ease\"\n\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(0)\",\n\t\t\topacity: \"1\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t});\n\t$(\"#header-wrap .browseMenu div\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\t\ttransform: \"translateX(-8px)\",\n\t\t\topacity: \"1\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t});\n\n\t$(\"#content-wrap .container1\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#content-wrap .container-fluid a\").css({\n\t\t\tpointerEvents: \"\",\n\t\t\tcursor: \"\"\n\t\t});\n\t\t// $(\"#content-wrap .container-fluid\").css({\n\t\t// \tbackgroundColor: \"\",\n\t\t// \topacity: \"\",\n\t\t// \ttransition: \"\",\n\t\t// \ttransition: \"all 0.4s ease\"\n\t\t// });\n\t});\n\n\n\t//olculerin beraberlesmesu ucun\n\tfunction widthSideBar(){\n\t\tif($(window).width() > 620){\n\t\t\twindowWidth = $(window).width() - 230;\n\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t$(window).resize(function() {\n\t\t\t\twindowWidth = $(window).width() - 230;\n\t\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t});\n\t\t}\n\t\tif($(window).width() < 620){\n\t\t\twindowWidth = $(window).width() - 100;\n\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t$(window).resize(function() {\n\t\t\t\twindowWidth = $(window).width() - 100;\n\t\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t});\n\t\t}\n\t}\n\twidthSideBar();\n\n\t//menunun uzunlugunun ekranin uzunlugu ile uygunlasmasi ucun\n\tfunction heightSideBar(){\n\t\theight = $(window).height();\n\t\t$(\"#header-wrap .sidebar\").height(height);\n\t\t$(\"#header-wrap .browseMenu\").height(height);\n\t}\n\theightSideBar();\n}", "title": "" }, { "docid": "275f4fd8841dba668c87fbf433a6eade", "score": "0.565059", "text": "function openSide() {\n sideMenu.style.height = \"100vh\";\n sideMenu.style.width = \"75%\";\n sideLinks.style.display = \"flex\";\n application.style.display = \"flex\";\n toggler.style.display = \"none\";\n overlayed.style.display = \"block\";\n}", "title": "" }, { "docid": "328f58858a0ef973a1e79cb46fdcf984", "score": "0.56285036", "text": "function showSideMenu() {\n if (sideMenuToggle == 0) {\n $(\"#mainpane\").animate({\n left: \"300\"\n }, 500);\n sideMenuToggle = 1;\n }\n else {$(\"#mainpane\").animate({\n left: \"0\"\n }, 500);\n sideMenuToggle = 0;\n }\n}", "title": "" }, { "docid": "8838f399c9c5e58cd68cc7d527c73378", "score": "0.56261533", "text": "function navSlide() {\n const burger = document.querySelector('.nav-burger');\n const nav = document.querySelector('.nav-links');\n const navLinks = document.querySelectorAll('.nav-links li');\n let sideBarOpened = false;\n\n burger.addEventListener('click', () => {\n // Afficher ou cacher le nav\n nav.classList.toggle('nav-active');\n // Animation du burger menu\n burger.classList.toggle('toggle');\n\n // Liens qui apparaissent\n navLinks.forEach((link, index) => {\n if (link.style.animation) {\n link.style.animation = '';\n } else {\n link.style.animation = `navLinkFade 0.5s ease forwards ${index / 7 + 0.4}s`;\n }\n });\n sideBarOpened = true;\n\n // Fermer la sidebar quand on clique sur un lien\n nav.addEventListener('click', () => {\n if (sideBarOpened) {\n nav.classList.toggle('nav-active');\n burger.classList.toggle('toggle');\n navLinks.forEach((link, index) => {\n if (link.style.animation) {\n link.style.animation = '';\n } else {\n link.style.animation = `navLinkFade 0.5s ease forwards ${index / 7 + 0.4}s`;\n }\n });\n sideBarOpened = false;\n }\n });\n });\n}", "title": "" }, { "docid": "ea38696718f442a7318691493af08e02", "score": "0.559326", "text": "function openMenu(level) {\n $(\".sidebar-menu\").stop().animate({ left: \"-\" + (($(\".sidebar-menu\").width() + 20) * level) });\n}", "title": "" }, { "docid": "79d5d66fddedf87fd5b932bb4f55be81", "score": "0.55882746", "text": "function buildToggler(navID, callback) {\n\t\t var debounceFn = $mdUtil.debounce(function(){\n\t\t $mdSidenav(navID)\n\t\t .toggle()\n\t\t .then(function () {\n\t\t\t\t\t\t callback()\n\t\t $log.debug(\"toggle \" + navID + \" is done\");\n\t\t });\n\t\t },200);\n\t\t return debounceFn;\n\t\t }", "title": "" }, { "docid": "bc7fff8ea61f4178424e9838b014077e", "score": "0.5581947", "text": "function navCloseHandler() {\n if (!widthFlg) {\n\n }\n }", "title": "" }, { "docid": "5d4d14505e8fe36aa8912b055ead7fc9", "score": "0.55795556", "text": "static closeNav() {\n ElementHandler.setElementCSSById('sidebarMenu', 'width', \"0px\");\n ElementHandler.setElementCSSById('openSidebar', 'width', \"0px\");\n ElementHandler.showElementById('openSidebar');\n }", "title": "" }, { "docid": "3990b5a8185ae84a1759cd172a833011", "score": "0.5561007", "text": "function animateOpen() // Menu opening animation.\n {\n let pos = parseInt(sideMenu.style.left);\n let id = setInterval(frame, 10);\n\n function frame() { // Animate.\n for (let i = 0; i < 10; i++) {\n if (pos == 0) {\n clearInterval(id);\n cancelOpen = false, cancelClose = false;\n } else {\n if (cancelOpen) {\n clearInterval(id);\n cancelOpen = false, cancelClose = false;\n }\n pos++;\n sideMenu.style.left = pos + \"px\";\n }\n }\n }\n }", "title": "" }, { "docid": "cde0ab44b6b8b9a0473f9d45428ead0e", "score": "0.5544321", "text": "showMenu() {\n this.$('jira-sidebar__menu').removeClass('jira-hidden');\n this.animate('in', width.sidebarSmall);\n }", "title": "" }, { "docid": "b55fecb101e378b4280e86940913a233", "score": "0.5541362", "text": "function openNav(){\n\t$('#openNav').removeClass('fadingIn fadingOut').addClass('fadingOut');\n\t$('#closeNav').removeClass('fadingIn fadingOut').addClass('fadingIn');\n\t$('#main-menu').show(\"slide\", { direction: \"right\" }, 500);\n\t$('header, main, footer').animate({opacity: '.2'}, 500);\n\t$('.cover-page').css('display', 'block');\n\t\n\n}", "title": "" }, { "docid": "706232761892412360575879d9b66d45", "score": "0.55318403", "text": "close() {\n this.sideNav.close()\n }", "title": "" }, { "docid": "5cabd0924a9d34a0216370cd755ffa05", "score": "0.5523431", "text": "onAnimationFinish(isNavMenuOpen) {\n this.isNavMenuOpen = isNavMenuOpen;\n this.menu.classList.toggle('menu-open', this.isNavMenuOpen);\n this.animation = null;\n this.isClosing = false;\n this.isExpanding = false;\n\n if (this.isNavMenuOpen) {\n this.menu.style.height = 'auto';\n }\n }", "title": "" }, { "docid": "145241e027a5094674534e904ebfcf89", "score": "0.551966", "text": "displaySideNav(){\n if(this.state.showSideNav){\n console.log('side nav show')\n this.state.showSideNav();\n }\n }", "title": "" }, { "docid": "bdc0416d3180ba90c491711755e186f3", "score": "0.55144626", "text": "function navActions () {\n $navMain.slideToggle();\n toggleClassOnVisibility($siteLogo, classToToggle);\n}", "title": "" }, { "docid": "a416fbfa76e5f87236a448817e17e666", "score": "0.5511059", "text": "function handleHamburgerMain() {\n // Déclenche l'animation du menu mobile\n if (liensNavMobile.classList.contains(\"liensNavMobileVisible\")) {\n liensNavMobile.classList.replace(\"liensNavMobileVisible\", \"liensNavMobileHidden\");\n main.style.opacity = \"1\";\n }\n // Déclenche l'animation du menu hamburger\n if (menuHamburger.classList.contains(\"menuHamburgerClicked\")) {\n menuHamburger.classList.replace(\"menuHamburgerClicked\", \"menuHamburger\");\n }\n }", "title": "" }, { "docid": "86371e26aaacb2dea15c2c330dbad7ae", "score": "0.55084544", "text": "function openSideBar() {\n\n document.getElementById(\"small_icon\").style.display = \"none\";\n document.getElementById(\"big_icon\").style.display = \"block\";\n document.getElementById(\"hamburger_button\").style.marginLeft = \"9em\";\n document.getElementById(\"main\").style.transform = \"scale(1,1)\";\n document.getElementById(\"main\").style.paddingLeft = \"17em\";\n document.getElementById(\"main\").style.paddingTop = \"6em\";\n\n for (var i = 0; i < elements_text_of_sidebar.length; i++) {\n elements_text_of_sidebar[i].style.transitionDelay = \"0.5s\";\n elements_text_of_sidebar[i].style.display = \"block\";\n }\n\n for (var i = 0; i < elements_sidebar_container.length; i++) {\n elements_sidebar_container[i].style.width = \"16em\";\n }\n\n sideBarIsOpen = 1;\n}", "title": "" }, { "docid": "69189aeafc253e63ac691449cec0ede1", "score": "0.5508044", "text": "function main() {\n\t$('.icon-menu').click(function() {\n\t\t$('.menu').animate({\n\t\t\t'left': '0px'\n\t\t}, 600);\n\n// *********close-menu**********\n\t$('.icon-close').click(function() {\n\t\t$('.menu').animate({\n\t\t\t'left': -285\n\t\t}, 600);\n\t});\n\n\t});\n}", "title": "" }, { "docid": "a171fd1ff090e3754d73cb77ee105cf1", "score": "0.54981875", "text": "function menuOpen() {\n $(\".menu\").animate({ width: \"toggle\" }, 500, \"swing\");\n menuState = !menuState;\n if (menuState) {\n $(\".toggle-icon\").fadeOut(100, function () {\n $(\".toggle-icon\").empty().append(close).fadeIn();\n });\n } else {\n $(\".toggle-icon\").fadeOut(100, function () {\n $(\".toggle-icon\").empty().append(open).fadeIn();\n });\n }\n}", "title": "" }, { "docid": "4b0301526b3c75923e15ec3b28375c63", "score": "0.54972154", "text": "function open( side ) {\n // Check to see if opposite Slidebar is open.\n if ( side === 'left' && $left && rightActive || side === 'right' && $right && leftActive ) { // It's open, close it, then continue.\n close();\n setTimeout( proceed, 400 );\n } else { // Its not open, continue.\n proceed();\n }\n\n // Open\n function proceed() {\n if ( init && side === 'left' && $left ) { // Slidebars is initiated, left is in use and called to open.\n $( 'html' ).addClass( 'sb-active sb-active-left' ); // Add active classes.\n $left.addClass( 'sb-active' );\n animate( $left, $left.css( 'width' ), 'left' ); // Animation\n setTimeout( function () { leftActive = true; }, 400 ); // Set active variables.\n } else if ( init && side === 'right' && $right ) { // Slidebars is initiated, right is in use and called to open.\n $( 'html' ).addClass( 'sb-active sb-active-right' ); // Add active classes.\n $right.addClass( 'sb-active' );\n animate( $right, '-' + $right.css( 'width' ), 'right' ); // Animation\n setTimeout( function () { rightActive = true; }, 400 ); // Set active variables.\n }\n }\n }", "title": "" }, { "docid": "50b911797b7ef07e9c3827c74cbb243c", "score": "0.5493397", "text": "function delegate_sidebar_dropdown_menu_animation(){\n\tjQuery('.hero_main').delegate('.hero_sidebar_dropdown_item', 'click', function(){\n\t\t//get height of menu item\n\t\tvar sidebar_item_height = jQuery('.hero_sidebar_item').height();\n\t\t//check if open\n\t\tif(jQuery(this).parent().data('visible') == 'hidden'){ //show\n\t\t\t//get content height\n\t\t\tvar sub_item_height = jQuery(this).parent().children('.hero_sub').height();\n\t\t\tjQuery(this).parent().stop().animate({\n\t\t\t\t'height': (sidebar_item_height + sub_item_height) +'px'\n\t\t\t},500, function(){\n\t\t\t\tjQuery(this).children('.hero_sidebar_parent').children('._dropdown_arrow').removeClass('hero_arrow_open').addClass('hero_arrow_close');\n\t\t\t}).data('visible','visible');\n\t\t}else{ //hide\n\t\t\tjQuery(this).parent().stop().animate({\n\t\t\t\t'height': sidebar_item_height +'px'\n\t\t\t},500, function(){\n\t\t\t\tjQuery(this).children('.hero_sidebar_parent').children('._dropdown_arrow').removeClass('hero_arrow_close').addClass('hero_arrow_open');\n\t\t\t}).data('visible','hidden');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "c59b955c57b5b53b33cc10855c8261a0", "score": "0.5476809", "text": "function openNav() {\r\n animating = true;\r\n $(\".menu-icon-div:nth-child(2)\").css(\"visibility\", \"hidden\");\r\n $(\".menu-icon-div:nth-child(1)\").css(\"margin-top\", \"13px\");\r\n $(\".menu-icon-div:nth-child(2)\").css(\"margin-top\", \"-3px\");\r\n $(\".menu-icon-div:nth-child(3)\").css(\"margin-top\", \"-3px\");\r\n\t\t\r\n setTimeout(function() {\r\n $(\".menu-icon-div:nth-child(1)\").css(\"-webkit-transform\", \"rotate(45deg)\");\r\n $(\".menu-icon-div:nth-child(1)\").css(\"-ms-transform\", \"rotate(45deg)\");\r\n $(\".menu-icon-div:nth-child(1)\").css(\"-moz-transform\", \"rotate(45deg)\");\r\n $(\".menu-icon-div:nth-child(1)\").css(\"-o-transform\", \"rotate(45deg)\");\r\n $(\".menu-icon-div:nth-child(1)\").css(\"transform\", \"rotate(45deg)\");\r\n $(\".menu-icon-div:nth-child(3)\").css(\"-webkit-transform\", \"rotate(-45deg)\");\r\n $(\".menu-icon-div:nth-child(3)\").css(\"-ms-transform\", \"rotate(-45deg)\");\r\n $(\".menu-icon-div:nth-child(3)\").css(\"-moz-transform\", \"rotate(-45deg)\");\r\n $(\".menu-icon-div:nth-child(3)\").css(\"-o-transform\", \"rotate(-45deg)\");\r\n $(\".menu-icon-div:nth-child(3)\").css(\"transform\", \"rotate(-45deg)\");\r\n\t\t\t\r\n animating = false;\r\n }, 500);\r\n }", "title": "" }, { "docid": "f17842925f62f43dcf2ae7565efb9e7d", "score": "0.5472676", "text": "_transitionendHandlerCollapse() {\n let menu, container;\n\n if (arguments.length === 1) {\n if (arguments[0].propertyName === 'visibility') {\n return;\n }\n\n container = this;\n menu = container.menuItemsGroup.menu;\n }\n else {\n menu = arguments[0];\n container = arguments[1];\n }\n\n container.menuItemsGroup.$.removeClass('jqx-' + menu._element + '-items-group-expanded');\n container.removeEventListener('transitionend', menu._transitionendHandlerCollapse);\n container.style.height = null;\n container.$.addClass('jqx-visibility-hidden');\n menu._checkOverflow(menu.$.mainContainer, false, [menu.$.scrollButtonNear, menu.$.scrollButtonFar]);\n\n if (menu._minimized) {\n menu._browserBoundsDetection(menu.$.mainContainer);\n }\n\n delete menu._treeAnimationInProgress;\n }", "title": "" }, { "docid": "00dd84c03f01cd837ee7ddb30db67972", "score": "0.54703426", "text": "function openBar() {\n $(\".dSideBar\").width('250px');\n $(\".container\").css({ 'margin-left': '250px' });\n console.log('open nav')\n}", "title": "" }, { "docid": "7e3ff6408b3223a19ea2058624dc6169", "score": "0.54586446", "text": "handleClick(e) {\n // media queries keep sidebar open unless under a certain size\n // when closed, activating will open or close\n document.querySelector('nav#drawer').classList.toggle('open');\n e.stopPropagation();\n }", "title": "" }, { "docid": "2eb6211b647b73b1ac204357efbfe85b", "score": "0.5452747", "text": "function OCM_clickTriggeredStylesInit() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Click triggered open bind.\r\n\t\t\t\t\t$body.on('click', '.slide-out-widget-area-toggle:not(.std-menu) a.closed:not(.animating)', function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (nectarBoxRoll.animating == 'true' || $('.slide-out-from-right-hover').length > 0) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$headerOuterEl.removeClass('no-transition');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Slide out from right.\r\n\t\t\t\t\t\tif ($offCanvasEl.hasClass('slide-out-from-right')) {\r\n\t\t\t\t\t\t\tOCM_slideOutRightOpen();\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\t// Fullscreen.\r\n\t\t\t\t\t\telse if ($offCanvasEl.hasClass('fullscreen')) {\r\n\t\t\t\t\t\t\tOCM_fullscreenOpen();\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\t// Fullscreen Alt.\r\n\t\t\t\t\t\telse if ($offCanvasEl.hasClass('fullscreen-alt')) {\r\n\t\t\t\t\t\t\tOCM_fullscreenAltOpen();\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\t// Simple dropdown.\r\n\t\t\t\t\t\telse if( $('#header-outer #mobile-menu').length > 0 ) {\r\n\t\t\t\t\t\t\tOCM_simpleDropdownOpen();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\r\n\t\t\t\t\t\t// Add open class\r\n\t\t\t\t\t\tif( $('#header-outer #mobile-menu').length == 0 ) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerOuterEl\r\n\t\t\t\t\t\t\t\t.removeClass('side-widget-closed')\r\n\t\t\t\t\t\t\t\t.addClass('side-widget-open');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Give header transparent state\r\n\t\t\t\t\t\t\tif ($('#header-outer[data-transparency-option=\"1\"]').length > 0 && \r\n\t\t\t\t\t\t\t$('#boxed').length == 0 && \r\n\t\t\t\t\t\t\t$('#header-outer[data-full-width=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t\t!nectarDOMInfo.usingFrontEndEditor) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($('body.material[data-slide-out-widget-area-style=\"slide-out-from-right\"]').length == 0 && \r\n\t\t\t\t\t\t\t\t$('body.material #header-outer[data-condense=\"true\"]').length == 0) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Dark slide transparent nav\r\n\t\t\t\t\t\t\tif ($('#header-outer.dark-slide.transparent').length > 0 && \r\n\t\t\t\t\t\t\t$('#boxed').length == 0 && \r\n\t\t\t\t\t\t\t$('body.material-ocm-open').length == 0) {\r\n\t\t\t\t\t\t\t\t$headerOuterEl\r\n\t\t\t\t\t\t\t\t\t.removeClass('dark-slide')\r\n\t\t\t\t\t\t\t\t\t.addClass('temp-removed-dark-slide');\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} // Not using simple OCM.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.slide-out-widget-area-toggle > div > a')\r\n\t\t\t\t\t\t\t.removeClass('closed')\r\n\t\t\t\t\t\t\t.addClass('open');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.slide-out-widget-area-toggle > div > a').addClass('animating');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t// Close event bind.\r\n\t\t\t\t\t$body.on('click', '.slide-out-widget-area-toggle:not(.std-menu) a.open:not(.animating), #slide-out-widget-area .slide_out_area_close, > .slide_out_area_close, #slide-out-widget-area-bg.slide-out-from-right, .material-ocm-open #ajax-content-wrap', function (e) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (e.originalEvent == undefined && \r\n\t\t\t\t\t\t\t$('.slide_out_area_close.non-human-allowed').length == 0 && \r\n\t\t\t\t\t\t\t$('.slide-out-widget-area-toggle.mobile-icon a.non-human-allowed').length == 0) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('.slide-out-widget-area-toggle:not(.std-menu) a.animating').length > 0) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$headerOuterEl.removeClass('no-transition');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.slide-out-widget-area-toggle:not(.std-menu) a')\r\n\t\t\t\t\t\t\t.removeClass('open')\r\n\t\t\t\t\t\t\t.addClass('closed');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.slide-out-widget-area-toggle:not(.std-menu) a')\r\n\t\t\t\t\t\t\t.addClass('animating');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Slide out from right.\r\n\t\t\t\t\t\tif ($offCanvasEl.hasClass('slide-out-from-right')) {\r\n\t\t\t\t\t\t\tOCM_slideOutRightClose();\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Fullscreen.\r\n\t\t\t\t\t\telse if ($offCanvasEl.hasClass('fullscreen')) {\r\n\t\t\t\t\t\t\tOCM_fullscreenClose();\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\t// Fullscreen alt.\r\n\t\t\t\t\t\telse if ($offCanvasEl.hasClass('fullscreen-alt')) {\r\n\t\t\t\t\t\t\tOCM_fullscreenAltClose();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Simple dropdown.\r\n\t\t\t\t\t\telse if( $('#header-outer #mobile-menu').length > 0 ) {\r\n\t\t\t\t\t\t\tOCM_simpleDropdownClose();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif( $('#header-outer #mobile-menu').length == 0 ) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Dark slide transparent nav\r\n\t\t\t\t\t\t\tif ($('#header-outer.temp-removed-dark-slide.transparent').length > 0 && $('#boxed').length == 0) {\r\n\t\t\t\t\t\t\t\t$headerOuterEl\r\n\t\t\t\t\t\t\t\t\t.removeClass('temp-removed-dark-slide')\r\n\t\t\t\t\t\t\t\t\t.addClass('dark-slide');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Remove header transparent state\r\n\t\t\t\t\t\t\tif ($('#header-outer[data-permanent-transparent=\"1\"]').length == 0 && $('#slide-out-widget-area.fullscreen-alt').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($('.nectar-box-roll').length == 0) {\r\n\t\t\t\t\t\t\t\t\tif ($('#header-outer.small-nav').length > 0 || \r\n\t\t\t\t\t\t\t\t\t$('#header-outer.scrolled-down').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('transparent');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tif ($('#header-outer.small-nav').length > 0 || \r\n\t\t\t\t\t\t\t\t\t$('#header-outer.scrolled-down').length > 0 || \r\n\t\t\t\t\t\t\t\t\t$('.container-wrap.auto-height').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('transparent');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Remove hidden menu\r\n\t\t\t\t\t\t\t$headerOuterEl.removeClass('hidden-menu');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerOuterEl\r\n\t\t\t\t\t\t\t\t.removeClass('side-widget-open')\r\n\t\t\t\t\t\t\t\t.addClass('side-widget-closed');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} // Not using simple OCM.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "title": "" }, { "docid": "73f0bc2042914bf1ab3e99f698476b8e", "score": "0.5452551", "text": "function sideSlide() {\n\n var slide = $('.menu_wrapper_slide');\n var overlay = $('#overlay');\n\n // click | Open\n $(document).on('click', \"#topBar .responsive-menu\", function(e) {\n e.preventDefault();\n slide.animate({\n 'right': 0\n }, 300);\n slide.addClass('open');\n $('body').animate({\n 'left': -250\n }, 300);\n $('#topBar').animate({\n 'left': 250\n }, 300);\n overlay.fadeIn(300);\n overLayVisible = true;\n });\n\n // click | close\n $('#close_menu, #overlay').click(function (e) {\n e.preventDefault();\n slide.animate({\n 'right': -250\n }, 300);\n slide.removeClass('open');\n $('body').animate({\n 'left': 0\n }, 300);\n $('#topBar').animate({\n 'left': 0\n }, 300);\n overlay.fadeOut(300);\n overLayVisible = false;\n });\n\n}", "title": "" }, { "docid": "fef14225bb949c808de1c9f1180193b1", "score": "0.54358476", "text": "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "title": "" }, { "docid": "fef14225bb949c808de1c9f1180193b1", "score": "0.54358476", "text": "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "title": "" }, { "docid": "7ceb936f198dd2eaff58b834b186f1a4", "score": "0.5435496", "text": "function onOpen() {\n createMenu();\n}", "title": "" }, { "docid": "b3abbc792c1bfef0d5b704ea0e47a9d7", "score": "0.5434752", "text": "function renderNavigation() {\n // CREATE NAVBAR IN DOM from MAIN_LINKS in data.js\n $('#header').append(componentNavbar());\n $('.sidebar-wrapper').append(componentSidebar());\n for (let link of MAIN_LINKS) {\n $('#navbar-list').append(componentNavbarList(link));\n }\n $('#navbar-list').append(\n '<li> <button type=\"button\" id=\"side-bar-button\" class=\"btn btn\"><i class=\"bi bi-cart-fill text-light\"></i></button></li>'\n );\n //SHOW SIDEBAR HANDLER\n $('#side-bar-button').click(function (e) {\n generateTotal();\n $('.sidebar-wrapper').css('display', 'block');\n });\n\n //HIDE SIDEBAR HANDLERS\n // BUTTON\n $('#side-bar-close').click(function (e) {\n //PREVENT CHILD EVENT PROPAGATION HANDLER\n $('.sidebar-wrapper').css('display', 'none');\n });\n // MODAL\n $('.sidebar-wrapper').click(function (e) {\n //PREVENT CHILD EVENT PROPAGATION HANDLER\n $('.sidebar').click(function (e) {\n e.stopPropagation();\n });\n $('.sidebar-wrapper').css('display', 'none');\n });\n // CREATE FOOTER IN DOM\n $('.footer-container').append(componentFooter());\n}", "title": "" }, { "docid": "4c1641571dbc0ec91451c7e8dcb17243", "score": "0.5434242", "text": "function openNav(id) {\n document.getElementById('mySidebar').style.width = '400px'\n\n setTimeout(() => {\n setContent(true)\n }, 400)\n\n setPropID(id)\n }", "title": "" }, { "docid": "41f0d20f8138222b77cce2f414d17f13", "score": "0.5433533", "text": "function handleHamburger() {\n // Déclenche l'animation du menu mobile\n if (liensNavMobile.classList.contains(\"liensNavMobileHidden\")) {\n liensNavMobile.classList.replace(\"liensNavMobileHidden\", \"liensNavMobileVisible\");\n main.style.opacity = \"0.2\";\n } else {\n liensNavMobile.classList.replace(\"liensNavMobileVisible\", \"liensNavMobileHidden\");\n main.style.opacity = \"1\";\n }\n // Déclenche l'animation du menu hamburger\n if (menuHamburger.classList.contains(\"menuHamburger\")) {\n menuHamburger.classList.replace(\"menuHamburger\", \"menuHamburgerClicked\");\n } else {\n menuHamburger.classList.replace(\"menuHamburgerClicked\", \"menuHamburger\");\n }\n }", "title": "" }, { "docid": "ac21c5650891ed66956666a66c0347de", "score": "0.54328233", "text": "function openNav(response) {\n // Saving the value of 0 through finding the screens width and minusing it from itself, for mobile responsive purposes.\n var pixels = `${$(window).width()}` - `${$(window).width()}`;\n // This is used to hide the information navbar on the right side\n $infoNav[0].style.right = `${pixels}px`;\n\n flag = true; // Flag that is used to check the status of the right-navbar\n $itemInfoHeader.html(\"Item Information\"); // A header in order to give context as to what the navbar does.\n $svg\n .attr(\"src\", `./assets/resources/${data[response.getAttribute(\"data-pos\")].category}.svg`) // Dynamically displaying the svg file depending on what the category of the chosen item. \n .attr(\"alt\", `${data[response.getAttribute(\"data-pos\")].category}`); // If the image doesn't load, then give an alternative display of what the picture is referencing, in this case, the category.\n $category.html(\"Category: \" + data[response.getAttribute(\"data-pos\")].category.charAt(0).toUpperCase() + data[response.getAttribute(\"data-pos\")].category.slice(1));// This long line of code makes it so that the first letter is capitalized.\n $itemName.html(\"Item Name: \" + data[response.getAttribute(\"data-pos\")].item) // Dynamically push the item name from the returned data-pos attribute.\n $itemType.html(\"Item Type: \" + data[response.getAttribute(\"data-pos\")].type) // Dynamically push the item type from the returned data-pos attribute.\n $itemBrand.html(\"Item Brand: \" + data[response.getAttribute(\"data-pos\")].brand) // Dynamically push the item brand from the returned data-pos attribute.\n $itemQuantity.html(\"Quantity: \" + data[response.getAttribute(\"data-pos\")].qty) // Dynamically push the item quantity from the returned data-pos attribute.\n}", "title": "" }, { "docid": "f3a7f7279db6e5bf908932bbdc6f34e7", "score": "0.5431626", "text": "function initSidemenu(){\n\n\t//\n\t$('#ham_button').click(openNav);\n\t$('#close_nav').click(closeNav);\n\t//\n\n\t// Side menu functions\n\tlet elem = $('#sidemenu\ta');\n\telem.each(function(i)\t{\n\t\t//\n\t\t$(this).click(function(){\n\t\t\tdeselectAll();\n\t\t\t$(this).children().addClass('selected');\n\t\t\t//\n\t\t\t$('#main').hide();\n\t\t\t$('#about').hide();\n\t\t\t$('#analytics').hide();\n\t\t\t$('#settings').hide();\n\t\t\t$('#contact').hide();\n\t\t\t//\n\t\t\tlet id = $(this).attr('id');\n\t\t\tif(id.includes('home')){\n\t\t\t\t$('#main').show();\n\t\t\t}else\tif(id.includes('about')){\n\t\t\t\t$('#about').show();\n\t\t\t}else\tif(id.includes('logout')){\n\t\t\t\tlogout();\n\t\t\t}\n\t\t\t//\n\t\t\tcloseNav();\n\t\t});\n\n\t});\n\n\t// NOTE\n\t// Following functions are scoped only for sidemenu\n\t//\n\t// function to open navigation\n\tfunction openNav()\t{\n\t\tconsole.log('Open');\n\t\t$('#sidenav').addClass('open');\n\t\t$('#sidenav').removeClass('closed');\n\t\t$('#sidenav').css('width',\t'250px');\n\t\t//\n\t\t$('#main').css('transform',\t'translateX(250px)');\n\t\t$('#header_content').css('transform',\t'translateX(250px)');\n\t\t$('#about').css('transform',\t'translateX(250px)');\n\t}\n\n\t// logout functionlity\n\tfunction logout(){\n\t\tconsole.log('Logging out...');\n\t\t//\n\t\tdeselectAll();\n\t\tcloseNav();\n\t\t//\n\t\tfirebase.auth().signOut();\n\t\t//\n\t\t$('#home_item').children().addClass('selected');\n\t\t$('#main-div').show();\n\t\t$('#main').hide();\n\t}\n\n\t// deselect sidemenu links\n\tfunction deselectAll(){\n\t\tlet elem = $('#sidemenu\ta');\n\t\telem.each(function(i)\t{\n\t\t\t$(this).children().removeClass('selected');\n\t\t});\n\t}\n\n\t// close navigation\n\tfunction closeNav()\t{\n\t\tconsole.log('Close');\n\t\t$('#sidenav').addClass('closed');\n\t\t$('#sidenav').removeClass('open');\n\t\t$('#sidenav').css('width','0');\n\t\t//\n\t\t$('#main').css('transform','translateX(0)');\n\t\t$('#header_content').css('transform','translateX(0)');\n\t\t$('#about').css('transform','translateX(0)');\n\t}\n}", "title": "" }, { "docid": "aa8ad2bd84199f65f17006b26112822b", "score": "0.54302984", "text": "function buildToggler(navID) {\n var debounceFn = $mdUtil.debounce (function() {\n $mdSidenav(navID)\n .toggle()\n .then(function () {\n $log.debug(\"toggle \" + navID + \" is done\");\n });\n },200);\n return debounceFn;\n }", "title": "" }, { "docid": "33008469a68acb90d31be861de0d8f24", "score": "0.5428279", "text": "function openNav() {\n sidenav.css(\"margin-left\", \"0\");\n sidenav.css(\"overflow\", \"auto\");\n backButton.addClass(\"active_background\");\n enableHamburger();\n menuOpen = true;\n}", "title": "" }, { "docid": "329e1daa6706a3937872dbd012ec1127", "score": "0.54282576", "text": "function buildToggler(navID) {\n var debounceFn = $mdUtil.debounce(function(){\n $mdSidenav(navID)\n .toggle()\n .then(function () {\n $log.debug(\"toggle \" + navID + \" is done\");\n });\n },300);\n return debounceFn;\n }", "title": "" }, { "docid": "0a62f2f4685c565fc6d2062bf8044311", "score": "0.54229456", "text": "function animateMenu() {\n\n var MenuUi = {\n elements: {\n mainPanel: $('.main-panel'),\n menu: $('.menu-slide'),\n navigationHeader: $('.nav-to-remove'),\n fluidContainer: $('.container-fluid'),\n sommaireButton: $('.sommaire'),\n closeButton: $('#close'),\n subMenuLastelem: $('.sub-menu li:lt(2)'),\n subMenuElem1: $('.sub-menu li .fa-print'),\n subMenu: $('.sub-menu')\n },\n\n //Configuration objects ends\n\n BindEvents: function () {\n enquire.register(\"screen and (min-width: 1222px)\", {\n match: function () {\n MenuUi.elements.subMenuLastelem.hide();\n MenuUi.elements.sommaireButton.on('click', function () {\n MenuUi.openMenuUIEvents();\n });\n MenuUi.elements.closeButton.on('click', function () {\n MenuUi.closeMenuUIEvents();\n });\n },\n unmatch: function () {\n MenuUi.elements.subMenuLastelem.show();\n MenuUi.elements.sommaireButton.off();\n MenuUi.elements.closeButton.off();\n }\n });\n },\n\n openMenuUIEvents: function () {\n MenuUi.elements.closeButton.show(600);\n setTimeout(function () {\n MenuUi.elements.menu.animate({\n height: '143px',\n left: '0px',\n opacity: '1'\n }, 500);\n MenuUi.elements.subMenuLastelem.show(700);\n MenuUi.elements.subMenu.animate({width: '199px'}, 700);\n }, 900);\n\n MenuUi.elements.sommaireButton.animate({\n left: '-50px',\n opacity: '0'\n }, 500, function () {\n MenuUi.elements.sommaireButton.animate({height: '150px'}, function () {\n $(this).animate({height: '100px'});\n });\n });\n },\n\n closeMenuUIEvents: function () {\n MenuUi.elements.closeButton.hide(600);\n setTimeout(function () {\n MenuUi.elements.menu.animate({\n //left: '-60px',\n opacity: '0',\n height: '1px'\n }, 700, \"linear\", function () {\n MenuUi.elements.subMenuLastelem.hide(500);\n MenuUi.elements.subMenu.animate({width: '45px'}, 700);\n });\n //different animation for sommaire . Comment for old animaztion\n MenuUi.elements.sommaireButton.animate({\n height: '150px'\n }, 750);\n //ends\n }, 1000);\n setTimeout(function () {\n MenuUi.elements.sommaireButton.animate({\n opacity: '1',\n left: '-10px'\n //height:'150px'//Uncomment for old animaion\n }, 600);\n }, 2300);\n },\n\n slideoutUIEvents: function () {\n enquire.register(\"screen and (max-width: 1221px)\", {\n match: function () {\n MenuUi.elements.menu.attr('id', 'menu');\n MenuUi.elements.mainPanel\n .attr('id', 'panel');\n console.log('added');\n },\n unmatch: function () {\n MenuUi.elements.menu.removeAttr('id');\n MenuUi.elements.mainPanel\n .removeAttr('id');\n console.log('removed');\n }\n });\n },\n\n slideoutInit: function () {\n enquire.register(\"screen and (max-width: 1221px)\", {\n match: function () {\n if(typeof slideout === \"undefined\"){\n var slideout = new Slideout(\n {\n 'panel': document.getElementById('panel'),\n 'menu': document.getElementById('menu'),\n 'padding': 250,\n 'tolerance': 70\n }\n );\n slideout.disableTouch();\n $('.to-hide').on('click', function () {\n console.log('slider clicked');\n slideout.toggle();\n });\n }\n },\n unmatch: function () {\n $('#navbar>ul').removeClass('slideout-menu');\n $('.main-panel').removeClass('slideout-panel');\n }\n });\n },\n\n //Rendering and executing the menu\n renderUI: function () {\n MenuUi.slideoutUIEvents();\n MenuUi.slideoutInit();\n MenuUi.BindEvents();\n },\n init: function () {\n return MenuUi.renderUI();\n }\n\n };\n\n //Let's load init menu\n MenuUi.init();\n\n }", "title": "" }, { "docid": "0ddcdbbd405e84695ab2c92b90e72f54", "score": "0.5419997", "text": "function closeNav() {\n $('#cover').hide();\n $('#mySidenav').animate({\n \"margin-left\": \"-80%\"\n }, 10);\n}", "title": "" }, { "docid": "df4cef086efa36100c14450f1acc4573", "score": "0.5413925", "text": "function buildToggler(navID) {\n var debounceFn = $mdUtil.debounce(function(){\n $mdSidenav(navID)\n .toggle()\n .then(function () {\n $log.debug(\"toggle \" + navID + \" is done\");\n });\n },300);\n return debounceFn;\n }", "title": "" }, { "docid": "c59fe4f8252d56df6889307042d4b709", "score": "0.53967625", "text": "function openNav() {\n\t\n\tvar html=\"\";\n\n\n\tStore.treeIterate(function(node){\n\t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\" data-cell=\"'+node.cell+'\">'+node.title+'</li>';\t\t\n\t});\n\t\n\t// Store.iterate(function(index,row){\n\t// \tvar value=row[\"id\"];\n\t//\n\t// \tif (value){\n\t// \t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\">Article '+index+'</li>';\n\t// \t\t// html+=\"<button class='btn btn-default'> Article \"+value+\". </button>\";\n\t// \t}\n\t// });\n\n\tvar el=$(\"#mySidenav\");\n\tel.html('<ul class=\"list-group\">'+\n\t\t\thtml+\n\t\t\t'</ul>');\n\t\n\tel.css(\"width\",\"200px\");\n\t\n document.getElementById(\"main\").style.marginLeft = \"200px\";\n}", "title": "" }, { "docid": "2c3b30e00c288c4bec5dca4b4d2031cd", "score": "0.53876734", "text": "function openNav_responsive() {\n options.jq.contentWell.css({\n position : 'absolute',\n top : 0,\n left : 0,\n height : '100%',\n overflow : 'hidden'\n });\n options.jq.navContainer.animate({marginLeft: 0}, animConfig());\n options.jq.contentWell.animate({left: '100%'}, animConfig(function () {\n options.jq.contentWell.hide();\n }));\n setNavState(1);\n }", "title": "" }, { "docid": "1cf05b3de7fbb9286c9a8efd9acf262d", "score": "0.5381914", "text": "function buildToggler(navID) {\n var debounceFn = $mdUtil.debounce(function(){\n $mdSidenav(navID)\n .toggle()\n .then(function () {\n $log.debug(\"toggle \" + navID + \" is done\");\n });\n },300);\n\n return debounceFn;\n }", "title": "" }, { "docid": "d3ffad49b6c1bce15929b0811e83d4b9", "score": "0.53802395", "text": "function open_side() {\n\n\t$('#map-content').on('click','.link-sidepanel', function(e) { //$(\"[class^=main]\")\n\n\n\t\t//alert('open sesame');\n\t\tvar hrefval = $(this).attr(\"href\");\n\n\t\tif(hrefval != \"\") {\n \t\tvar distance = $('#main').css('right');\n\n\t\t\tif(distance == \"auto\" || distance == \"0px\") {\n \t\t$(this).addClass(\"open\");\n\t\t\t\topenSidepage();\n\t\t\t} else {\n \t\tcloseSidepage();\n\t\t\t}\n\t\t}\n\t}); // end click event handler\n\n\n\t$(\"a.clickme\").on(\"click\", function(e){ //$(\"[class^=main]\")\n\n\n\t\t//alert('open sesame');\n\t\tvar hrefval = $(this).attr(\"href\");\n\n\t\tif(hrefval != \"\") {\n \t\tvar distance = $('#main').css('right');\n\n\t\t\tif(distance == \"auto\" || distance == \"0px\") {\n \t\t$(this).addClass(\"open\");\n\t\t\t\topenSidepage();\n\t\t\t} else {\n \t\tcloseSidepage();\n\t\t\t}\n\t\t}\n\t}); // end click event handler\n}", "title": "" }, { "docid": "6e1a95a7b541f8640c8da6822de42240", "score": "0.5378676", "text": "function openMenuAnimation_1() {\n if (!menuDisappearComplete_1) {\n menuDisappearAnimation_1();\n } else if (!arrowAppearComplete_1) {\n arrowAppearAnimation_1();\n }\n }", "title": "" }, { "docid": "9f751803163448b643291f551d038802", "score": "0.53782535", "text": "function triggerNav() {\n \n /* \n * navopen var stores the info that the user wants to show the navbar or to hide it.\n * navopen is a boolean variable that switches the boolean variable from true to false or vice versa \n */\n navopen = !navopen;\n\n /* \n * If the navopen is true that means User wants to show the navbar then add width, border and border-color by calling the \n * helper function stated above.\n * These values are observations and hence you can change according to you.\n */\n if(navopen){\n setAttributePanel(\"350px\", \"5px solid\", \"white\");\n }else{\n\n /* Otherwise make the width: 0, border: \"\", border-color: \"\" in order to hide the side panel */\n setAttributePanel(\"0px\", \"\", \"\");\n }\n}", "title": "" }, { "docid": "b9df514874ce5a6fe6abb20c375d69d4", "score": "0.53777385", "text": "function Nav() {\n $('nav').click(\n function () {\n countNav++;\n if(countNav == 1) {\n showItems();\n navOpen = true;\n }\n else if(countNav == 2) {\n countNav = 0;\n navOpen = false;\n hideItems();\n }\n });\n}", "title": "" }, { "docid": "11f573b3cd1b23f96cbb8f49ed6478de", "score": "0.5374071", "text": "_initialize() {\n // mobile navigation\n const $dropDownNavBtn = $('.' + this.dropDownMenuIconElClass);\n if ($dropDownNavBtn.length) {\n $dropDownNavBtn.get(0).onclick = this._handleDropDownClick.bind(\n this,\n $('.' + this.dropDownMenuElClass),\n $dropDownNavBtn.children('i'),\n this.iconMenuOpenClass,\n this.iconMenuCloseClass);\n } else {\n console.error('NavHandler: Couldn\\'t find element \\'.' + this.dropDownMenuIconElClass + '\\' in document.');\n return;\n }\n\n const $dropDownSectionExpandIconBtn = $('.' + this.dropDownSectionExpandIconElClass);\n\n if (!$dropDownSectionExpandIconBtn.length) {\n console.error('NavHandler: Drop down section expand icon must exist. Class: \\'' + this.dropDownSectionExpandIconElClass + '\\'');\n return;\n }\n\n //iterate all queried dropdown elements\n $dropDownSectionExpandIconBtn.each(function (index, element) {\n // unfortunately I found no other way to get the next child with a given class\n let dropDownSectionExpandEl = $(element).parent().children('.' + this.dropDownSectionExpandElClass);\n\n element.onclick = this._handleDropDownClick.bind(\n this,\n dropDownSectionExpandEl,\n $(element).children('i'),\n this.iconExpandClass,\n this.iconCollapseClass);\n\n $(dropDownSectionExpandEl).children('li').each( function (index, sectionElement) {\n // close menu on section navigation\n sectionElement.onclick = () => {\n $('.' + this.dropDownMenuIconElClass).click();\n };\n }.bind(this));\n\n }.bind(this));\n\n const $navTop = $('.' + this.navTopMenuElClass);\n if ($navTop.length) {\n const $backToTop = $('.' + this.backToTopButtonElClass);\n\n if ($backToTop.length) {\n // event handlers for sticky menu\n $navTop.on('sticky.zf.stuckto:top', () => $backToTop.show());\n $navTop.on('sticky.zf.unstuckfrom:top', () => $backToTop.hide());\n } else {\n console.error('NavHandler: Couldn\\'t find back to top button \\'.' + this.backToTopButtonElClass + '\\' in document.');\n }\n }\n }", "title": "" }, { "docid": "34963c30bf4c10d0055e3b2251283890", "score": "0.5372701", "text": "function openNav() {\r\n $('.hamburger_menu, .bannerContainer, .storiesContainer, footer').animate({\r\n marginLeft: \"250px\"\r\n });\r\n $('#mobile_menu').animate({\r\n marginLeft: \"0\"\r\n });\r\n}", "title": "" }, { "docid": "9f2060b3c05850e84307aa4caf87bbb7", "score": "0.53717554", "text": "function openNav()\n{\n let sideBar = document.querySelector(\".side-nav\");\n sideBar.style.visibility = \"visible\";\n sideBar.style.width = \"100%\";\n}", "title": "" }, { "docid": "8f19225407ba66659f35b37fbf6b8f71", "score": "0.5369148", "text": "function OCM_slideOutRightOpen() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tvar $slideOutAmount = ($bodyBorderTop.length > 0 && $('body.mobile').length == 0) ? $bodyBorderTop.height() : 0;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('body.material').length == 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//calc height if used bottom meta\r\n\t\t\t\t\t\t\t$('#slide-out-widget-area .inner').css({\r\n\t\t\t\t\t\t\t\t'height': 'auto',\r\n\t\t\t\t\t\t\t\t'min-height': $offCanvasEl.height() - 25 - $('.bottom-meta-wrap').height()\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($('#boxed').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$('.container-wrap, .home-wrap, #footer-outer:not(#nectar_fullscreen_rows #footer-outer), .nectar-box-roll, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({\r\n\t\t\t\t\t\t\t\t\tx: '-300px'\r\n\t\t\t\t\t\t\t\t}, 700, 'easeInOutCubic');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar $withinCustomBreakpoint = mobileBreakPointCheck();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($('#header-outer[data-format=\"centered-logo-between-menu\"]').length == 0 || $withinCustomBreakpoint) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($('#header-outer[data-transparency-option=\"1\"]').length == 0 || \r\n\t\t\t\t\t\t\t\t\t($('#header-outer[data-transparency-option=\"1\"]').length > 0 && $('#header-outer[data-full-width=\"true\"]').length == 0) || \r\n\t\t\t\t\t\t\t\t\t$('body.mobile').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.stop(true).css('transform', 'translateY(0)').transition({\r\n\t\t\t\t\t\t\t\t\t\t\tx: '-' + (300 + $slideOutAmount) + 'px'\r\n\t\t\t\t\t\t\t\t\t\t}, 700, 'easeInOutCubic');\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.stop(true).css('transform', 'translateY(0)').transition({\r\n\t\t\t\t\t\t\t\t\t\t\tx: '-' + (300 + $slideOutAmount) + 'px',\r\n\t\t\t\t\t\t\t\t\t\t\t'background-color': 'transparent',\r\n\t\t\t\t\t\t\t\t\t\t\t'border-bottom': '1px solid rgba(255,255,255,0.22)'\r\n\t\t\t\t\t\t\t\t\t\t}, 700, 'easeInOutCubic');\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} else {\r\n\t\t\t\t\t\t\t\t\t$('#header-outer header#top nav > ul.buttons, body:not(.material) #header-outer .cart-outer .cart-menu-wrap').transition({\r\n\t\t\t\t\t\t\t\t\t\tx: '-300px'\r\n\t\t\t\t\t\t\t\t\t}, 700, 'easeInOutCubic');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$offCanvasEl.stop(true).transition({\r\n\t\t\t\t\t\t\t\tx: '-' + $slideOutAmount + 'px'\r\n\t\t\t\t\t\t\t}, 700, 'easeInOutCubic').addClass('open');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($('#boxed').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Full width menu adjustments\r\n\t\t\t\t\t\t\t\tif ($('#header-outer[data-full-width=\"true\"]').length > 0 && !$body.hasClass('mobile')) {\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('highzI');\r\n\t\t\t\t\t\t\t\t\t$('#ascrail2000').addClass('z-index-adj');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($('#header-outer[data-format=\"centered-logo-between-menu\"]').length == 0) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif ($bodyBorderWidth == 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t$('header#top #logo').stop(true).transition({\r\n\t\t\t\t\t\t\t\t\t\t\t\tx: (300 + $slideOutAmount) + 'px'\r\n\t\t\t\t\t\t\t\t\t\t\t}, 700, 'easeInOutCubic');\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$('header#top .slide-out-widget-area-toggle .lines-button').addClass('close');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$('body #header-outer nav > ul > li > a').css({\r\n\t\t\t\t\t\t\t\t\t\t'margin-bottom': '0'\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerOuterEl.addClass('style-slide-out-from-right');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Fade In BG Overlay\r\n\t\t\t\t\t\t\t$offCanvasBG.css({\r\n\t\t\t\t\t\t\t\t'height': '100%',\r\n\t\t\t\t\t\t\t\t'width': '100%'\r\n\t\t\t\t\t\t\t}).stop(true).transition({\r\n\t\t\t\t\t\t\t\t'opacity': 1\r\n\t\t\t\t\t\t\t}, 700, 'easeInOutCubic', function () {\r\n\t\t\t\t\t\t\t\t$('.slide-out-widget-area-toggle:not(.std-menu) > div > a').removeClass('animating');\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Hide menu if no space\r\n\t\t\t\t\t\t\tif ($('#header-outer[data-format=\"centered-logo-between-menu\"]').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar $logoWidth = ($('#logo img:visible').length > 0) ? $('#logo img:visible').width() : $('#logo').width();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($('header#top nav > .sf-menu').offset().left - $logoWidth - 300 < 20) {\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('hidden-menu');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$headerOuterEl.addClass('hidden-menu-items');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($('#header-outer[data-remove-fixed=\"1\"]').length == 0 && nectarDOMInfo.winW > 1000) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($bodyBorderHeaderColorMatch == true && headerResize == true) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.stop(true).transition({\r\n\t\t\t\t\t\t\t\t\t\ty: '0'\r\n\t\t\t\t\t\t\t\t\t}, 0).addClass('transparent').css('transition', 'transform');\r\n\t\t\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') != 'true') {\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.attr('data-transparent-header', 'true').addClass('pseudo-data-transparent');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$window.off('scroll', bigNav);\r\n\t\t\t\t\t\t\t\t\t$window.off('scroll', smallNav);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t} else if ($bodyBorderHeaderColorMatch == true) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\r\n\t\t\t\t\t\t\t\t\t$window.off('scroll', opaqueCheck);\r\n\t\t\t\t\t\t\t\t\t$window.off('scroll', transparentCheck);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') != 'true') {\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.attr('data-transparent-header', 'true').addClass('pseudo-data-transparent');\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\t\r\n\t\t\t\t\t\t} else if ($('body.material').length > 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Material theme skin slide out from right\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//move ajax loading outside\r\n\t\t\t\t\t\t\tif ($loadingScreenEl.length > 0 && $('.ocm-effect-wrap #ajax-loading-screen').length > 0) {\r\n\t\t\t\t\t\t\t\t$loadingScreenEl.insertBefore('.ocm-effect-wrap');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Hide secondary header when not at top with hhun\r\n\t\t\t\t\t\t\tif (nectarDOMInfo.scrollTop > 40) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$('body[data-hhun=\"1\"] #header-secondary-outer').addClass('hidden');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t$('.slide-out-widget-area-toggle:not(.std-menu) > div > a').removeClass('animating');\r\n\t\t\t\t\t\t\t}, 300);\r\n\t\t\t\t\t\t\t$('#slide-out-widget-area, #slide-out-widget-area-bg, #header-outer .slide-out-widget-area-toggle').addClass('material-open');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Handle bottom bar nav\r\n\t\t\t\t\t\t\tif ($('body:not(.mobile) #header-outer[data-format=\"centered-menu-bottom-bar\"][data-condense=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t\t$('#header-outer[data-format=\"centered-menu-bottom-bar\"] .span_9').css('display') != 'none') {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$('#header-outer:not(.fixed-menu)').css('top', nectarDOMInfo.adminBarHeight - nectarDOMInfo.scrollTop + 'px');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($headerSecondaryEl.length > 0 && $('#header-outer.fixed-menu').length > 0) {\r\n\t\t\t\t\t\t\t\t\t$headerSecondaryEl.css('visibility', 'hidden');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('#ajax-content-wrap').css({\r\n\t\t\t\t\t\t\t\t'position': 'relative',\r\n\t\t\t\t\t\t\t\t'top': '-' + nectarDOMInfo.scrollTop + 'px'\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t$('.ocm-effect-wrap-inner').css({\r\n\t\t\t\t\t\t\t\t'padding-top': nectarDOMInfo.adminBarHeight\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('#fp-nav').addClass('material-ocm-open');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$body.addClass('material-ocm-open');\r\n\t\t\t\t\t\t\t$body.addClass('nectar-no-flex-height');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('.ocm-effect-wrap').css({\r\n\t\t\t\t\t\t\t\t'height': nectarDOMInfo.winH\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t$('.ocm-effect-wrap').addClass('material-ocm-open');\r\n\t\t\t\t\t\t\t}, 40);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('body > .slide_out_area_close').addClass('follow-body');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//icon effect\r\n\t\t\t\t\t\t\t$('#header-outer:not([data-format=\"left-header\"]) header#top .slide-out-widget-area-toggle a').addClass('effect-shown');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//handle hhun when at top\r\n\t\t\t\t\t\t\t$('body[data-hhun=\"1\"]:not(.no-scroll):not(.mobile) #header-outer[data-permanent-transparent=\"false\"]:not(.detached):not(.parallax-contained):not(.at-top-before-box)').css({\r\n\t\t\t\t\t\t\t\t'transition': 'none',\r\n\t\t\t\t\t\t\t\t'transform': 'translateY(' + nectarDOMInfo.adminBarHeight + 'px)'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t$('body > .slide_out_area_close').addClass('material-ocm-open');\r\n\t\t\t\t\t\t\t}, 350);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t}", "title": "" }, { "docid": "e17c929ebd95ea806c3c1755acc55078", "score": "0.53674173", "text": "function openNav() {\n $(\"#mySidenav\").css(\"width\", \"15%\");\n $(\"#main\").css(\"marginLeft\", \"15%\");\n $(\"#main\").css(\"Opacity\", \".4\");\n}", "title": "" }, { "docid": "1be0c81e21f3a833b948573ee1c37d65", "score": "0.5358032", "text": "function openNav(data) {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n getNavBar_html(data);\n document.getElementById(\"main\").style.marginLeft = \"500px\";\n document.body.style.backgroundColor = \"rgba(0,0,0)\";\n document.getElementById(\"main\").style.opacity = \"0.2\";\n}", "title": "" }, { "docid": "8f683e9d3493fb6865191d65913bd66b", "score": "0.5354595", "text": "function open(side) {\n\t\t\t// Check to see if opposite Slidebar is open.\n\t\t\tif (side === 'left' && $left && rightActive || side === 'right' && $right && leftActive) { // It's open, close it, then continue.\n\t\t\t\tclose();\n\t\t\t\tsetTimeout(proceed, 400);\n\t\t\t} else { // Its not open, continue.\n\t\t\t\tproceed();\n\t\t\t}\n\n\t\t\t// Open\n\t\t\tfunction proceed() {\n\t\t\t\tif (init && side === 'left' && $left) { // Slidebars is initiated, left is in use and called to open.\n\t\t\t\t\t$('html').addClass('sb-active sb-active-left'); // Add active classes.\n\t\t\t\t\t$left.addClass('sb-active');\n\t\t\t\t\tanimate($left, $left.css('width'), 'left'); // Animation\n\t\t\t\t\tsetTimeout(function() { leftActive = true; }, 400); // Set active variables.\n\t\t\t\t} else if (init && side === 'right' && $right) { // Slidebars is initiated, right is in use and called to open.\n\t\t\t\t\t$('html').addClass('sb-active sb-active-right'); // Add active classes.\n\t\t\t\t\t$right.addClass('sb-active');\n\t\t\t\t\tanimate($right, '-' + $right.css('width'), 'right'); // Animation\n\t\t\t\t\tsetTimeout(function() { rightActive = true; }, 400); // Set active variables.\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1ba4786f0fa43cfa13acaa071d5ecb1e", "score": "0.53535753", "text": "function buildToggler(navID) {\n var debounceFn = $mdUtil.debounce(function () {\n $mdSidenav(navID)\n .toggle()\n .then(function () {\n $log.debug(\"toggle \" + navID + \" is done\");\n });\n }, 200);\n return debounceFn;\n }", "title": "" }, { "docid": "3e768051029f311d3629894eb2bc2c73", "score": "0.53501505", "text": "function buildToggler(navID) {\n var debounceFn = $mdUtil.debounce(function() {\n $mdSidenav(navID)\n .toggle()\n .then(function() {\n $log.debug('toggle ' + navID + ' is done');\n });\n }, 300);\n\n return debounceFn;\n }", "title": "" }, { "docid": "58be802502ad814b2529d4d18e83649c", "score": "0.5345926", "text": "function settingsOpen(e){\r\n const item = e.target;\r\n sideBar.classList.toggle(\"openSidebar\");\r\n}", "title": "" }, { "docid": "aa6ff1dcf83fa943f9ba3e5ec646113d", "score": "0.5335875", "text": "function openNav() { //Used to open the sideMenu. Is called upon in the html \"onclick=\" on the header menu icon (hamburger-icon).\n document.querySelector(\".app-box__header__sidemenu\").style.width = \"130px\"; //Increases the sidemenus width.\n document.querySelector(\"#app-box__header__menuicon\").removeAttribute(\"onclick\", \"openNav()\"); //Removes the function\n document.querySelector(\"#app-box__header__menuicon\").setAttribute(\"onclick\", \"closeNav()\"); //To instead set the next click to close the sidemenu\n document.querySelector(\".app-box__main--menuHover\").classList.remove(\"hide\"); //removes the hide-class of the sidemenu. <<NTS: Is this nessecary at all? If time - Double check>>\n document.querySelector(\".main\").setAttribute(\"tabindex\", \"1\"); //Activates the tabindex when the sidemenu is opened.\n document.querySelector(\".stats\").setAttribute(\"tabindex\", \"2\"); //Activates the tabindex when the sidemenu is opened.\n document.querySelector(\".about\").setAttribute(\"tabindex\", \"3\"); //Activates the tabindex when the sidemenu is opened.\n controlChildrenTabIndexMinus(); //Sets the tabindex on the children of the main to \"-1\" to be untabable.\n}", "title": "" }, { "docid": "9c5f8da437832e389160613f5299c999", "score": "0.53314936", "text": "function subMenuOpenClicked(name) {\n categoryClicked(name)\n setTimeout(() => {\n menuOpenClicked();\n document.getElementById('leftSubSideBar').style.left = \"0\"; \n }, 100)\n }", "title": "" }, { "docid": "69b0fd3bd6ef86c0e6ee5d8774d760d8", "score": "0.53303784", "text": "function OCM_slideOutRightClose() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('body.material').length == 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.container-wrap, .home-wrap, #footer-outer:not(#nectar_fullscreen_rows #footer-outer), .nectar-box-roll, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({\r\n\t\t\t\t\t\t\tx: '0px'\r\n\t\t\t\t\t\t}, 700, 'easeInOutCubic');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('#header-outer[data-transparency-option=\"1\"]').length > 0 && $('#boxed').length == 0) {\r\n\t\t\t\t\t\t\tvar $currentRowBG = ($('#header-outer[data-current-row-bg-color]').length > 0) ? $headerOuterEl.attr('data-current-row-bg-color') : $headerOuterEl.attr('data-user-set-bg');\r\n\t\t\t\t\t\t\t$headerOuterEl.stop(true).transition({\r\n\t\t\t\t\t\t\t\tx: '0px',\r\n\t\t\t\t\t\t\t\t'background-color': $currentRowBG\r\n\t\t\t\t\t\t\t}, 700, 'easeInOutCubic');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$headerOuterEl.stop(true).transition({\r\n\t\t\t\t\t\t\t\tx: '0px'\r\n\t\t\t\t\t\t\t}, 700, 'easeInOutCubic');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$offCanvasEl.stop(true).transition({\r\n\t\t\t\t\t\t\tx: '301px'\r\n\t\t\t\t\t\t}, 700, 'easeInOutCubic').removeClass('open');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('#boxed').length == 0) {\r\n\t\t\t\t\t\t\tif ($('#header-outer[data-full-width=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('highzI');\r\n\t\t\t\t\t\t\t\t$('header#top #logo').stop(true).transition({\r\n\t\t\t\t\t\t\t\t\tx: '0px'\r\n\t\t\t\t\t\t\t\t}, 700, 'easeInOutCubic');\r\n\t\t\t\t\t\t\t\t$('.lines-button').removeClass('close');\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}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('#header-outer[data-format=\"centered-logo-between-menu\"]').length > 0) {\r\n\t\t\t\t\t\t\t$('#header-outer header#top nav > ul.buttons, #header-outer .cart-outer .cart-menu-wrap').stop(true).transition({\r\n\t\t\t\t\t\t\t\tx: '0px'\r\n\t\t\t\t\t\t\t}, 700, 'easeInOutCubic');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//fade out overlay\r\n\t\t\t\t\t\t$offCanvasBG.stop(true).transition({\r\n\t\t\t\t\t\t\t'opacity': 0\r\n\t\t\t\t\t\t}, 700, 'easeInOutCubic', function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('.slide-out-widget-area-toggle a').removeClass('animating');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t'height': '1px',\r\n\t\t\t\t\t\t\t\t'width': '1px'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($('#header-outer[data-remove-fixed=\"1\"]').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//hide menu if transparent, user has scrolled down and hhun is on\r\n\t\t\t\t\t\t\t\tif ($headerOuterEl.hasClass('parallax-contained') && \r\n\t\t\t\t\t\t\t\tnectarDOMInfo.scrollTop > 0 && \r\n\t\t\t\t\t\t\t\t$('#header-outer[data-permanent-transparent=\"1\"]').length == 0) {\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('parallax-contained').addClass('detached').removeClass('transparent');\r\n\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\telse if (nectarDOMInfo.scrollTop == 0 && $('body[data-hhun=\"1\"]').length > 0 && $('#page-header-bg[data-parallax=\"1\"]').length > 0 ||\r\n\t\t\t\t\t\t\t\tnectarDOMInfo.scrollTop == 0 && $('body[data-hhun=\"1\"]').length > 0 && $('.parallax_slider_outer').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($('#header-outer[data-transparency-option=\"1\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl\r\n\t\t\t\t\t\t\t\t\t\t.addClass('parallax-contained')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('detached');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//fix for fixed subpage menu\r\n\t\t\t\t\t\t\t$('.container-wrap').css('transform', 'none');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$headerOuterEl.removeClass('style-slide-out-from-right');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('#header-outer[data-remove-fixed=\"1\"]').length == 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($bodyBorderHeaderColorMatch == true && \r\n\t\t\t\t\t\t\t\theaderResize == true && \r\n\t\t\t\t\t\t\t\tnectarDOMInfo.winW > 1000) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$window.off('scroll.headerResizeEffect');\r\n\t\t\t\t\t\t\t\tif (nectarDOMInfo.scrollTop == 0) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$window.on('scroll.headerResizeEffect', smallNav);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($('#header-outer[data-full-width=\"true\"][data-transparent-header=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t\t\t\t$bodyBorderTop.length > 0 && \r\n\t\t\t\t\t\t\t\t\t$bodyBorderHeaderColorMatch == true && \r\n\t\t\t\t\t\t\t\t\t$('#header-outer.pseudo-data-transparent').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$('#header-outer[data-full-width=\"true\"] header > .container').stop(true, true).animate({\r\n\t\t\t\t\t\t\t\t\t\t\t'padding': '0'\r\n\t\t\t\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\t\t\t\tduration: 250,\r\n\t\t\t\t\t\t\t\t\t\t\teasing: 'easeOutCubic'\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$window.on('scroll.headerResizeEffect', bigNav);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($headerOuterEl.hasClass('pseudo-data-transparent')) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.attr('data-transparent-header', 'false')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('pseudo-data-transparent')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('transparent');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$headerOuterEl.css('transition', 'transform');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else if ($bodyBorderHeaderColorMatch == true && nectarDOMInfo.winW > 1000) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$window.off('scroll.headerResizeEffectOpaque');\r\n\t\t\t\t\t\t\t\t$window.on('scroll.headerResizeEffectOpaque', opaqueCheck);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$headerOuterEl.css('transition', 'transform');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($headerOuterEl.hasClass('pseudo-data-transparent')) {\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.attr('data-transparent-header', 'false')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('pseudo-data-transparent')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('transparent');\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}\r\n\t\t\t\t\t} \r\n\t\t\t\t\t\r\n\t\t\t\t\telse if ($('body.material').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//material\r\n\t\t\t\t\t\t$offCanvasEl.removeClass('open');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#slide-out-widget-area, #slide-out-widget-area-bg, #header-outer .slide-out-widget-area-toggle').removeClass('material-open');\r\n\t\t\t\t\t\t$('.ocm-effect-wrap, .ocm-effect-wrap-shadow, body > .slide_out_area_close, #fp-nav').removeClass('material-ocm-open');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('body > .slide_out_area_close').removeClass('follow-body');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t$('.slide-out-widget-area-toggle a').removeClass('animating');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$body.removeClass('material-ocm-open');\r\n\t\t\t\t\t\t\t$body.removeClass('nectar-no-flex-height');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('.ocm-effect-wrap').css({\r\n\t\t\t\t\t\t\t\t'height': '100%'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('.ocm-effect-wrap-inner').css({\r\n\t\t\t\t\t\t\t\t'padding-top': '0'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$window.scrollTop(Math.abs(parseInt($('#ajax-content-wrap').css('top'))));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('#ajax-content-wrap').css({\r\n\t\t\t\t\t\t\t\t'position': '',\r\n\t\t\t\t\t\t\t\t'top': ''\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//handle bottom bar nav\r\n\t\t\t\t\t\t\tif ($('#header-outer[data-format=\"centered-menu-bottom-bar\"]').length > 0 && \r\n\t\t\t\t\t\t\t$('#header-outer[data-format=\"centered-menu-bottom-bar\"] .span_9').css('display') != 'none' && \r\n\t\t\t\t\t\t\t$('body.mobile').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$('#header-outer:not(.fixed-menu)').css('top', '');\r\n\t\t\t\t\t\t\t\t$headerSecondaryEl.css('visibility', '');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//handle hhun when at top\r\n\t\t\t\t\t\t\t$('body[data-hhun=\"1\"]:not(.no-scroll) #header-outer[data-permanent-transparent=\"false\"]:not(.detached):not(.parallax-contained):not(.at-top-before-box)').css({\r\n\t\t\t\t\t\t\t\t'transform': ''\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t$('body[data-hhun=\"1\"]:not(.no-scroll) #header-outer[data-permanent-transparent=\"false\"]:not(.detached):not(.parallax-contained):not(.at-top-before-box)').css({\r\n\t\t\t\t\t\t\t\t\t'transition': ''\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}, 30);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('body[data-hhun=\"1\"] #header-secondary-outer.hidden').removeClass('hidden');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}, 900);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//icon effect\r\n\t\t\t\t\t\t\t$('#header-outer:not([data-format=\"left-header\"]) header#top .slide-out-widget-area-toggle a')\r\n\t\t\t\t\t\t\t\t.addClass('no-trans')\r\n\t\t\t\t\t\t\t\t.removeClass('effect-shown');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}, 200);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t//icon\r\n\t\t\t\t\t\t\t$('#header-outer:not([data-format=\"left-header\"]) header#top .slide-out-widget-area-toggle a').removeClass('no-trans');\r\n\t\t\t\t\t\t}, 500);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "title": "" }, { "docid": "9854b1b92d32d5683e0acc63c586fa4d", "score": "0.5325525", "text": "function closeNav_responsive() {\n options.jq.contentWell.show().animate({left: 0}, animConfig());\n options.jq.navContainer.animate({marginLeft: '-100%'}, animConfig(function () {\n options.jq.contentWell.removeAttr('style');\n options.jq.navContainer.removeAttr('style');\n }));\n setNavState(0);\n }", "title": "" }, { "docid": "d88ab11668a9e995cc4c3a3af8b7294f", "score": "0.5325332", "text": "function openNav(callback, noFade) {\n\n var cm = contentMargin, config;\n if (noFade === true) {\n config = animConfig(false, 0, callback);\n }\n options.jq.navContent.fadeIn(noFade ? 0 : options.params.navSpeed);\n options.jq.navLinks.fadeIn(noFade ? 0 : options.params.navSpeed);\n options.jq.contentWell.animate({marginLeft: cm}, config || animConfig(false, 200, callback));\n options.jq.navContainer.animate({width: cm}, config || animConfig());\n options.jq.header.animate({marginLeft: cm}, config || animConfig());\n setNavState(1);\n }", "title": "" }, { "docid": "689cf36c096524b83301ecb6d8d54c85", "score": "0.5324725", "text": "function buildToggler(navID) {\n var debounceFn = $mdUtil.debounce(function () {\n $mdSidenav(navID)\n .toggle()\n .then(function () {\n $log.debug('toggle ' + navID + ' is done');\n });\n }, 300);\n return debounceFn;\n }", "title": "" }, { "docid": "82bc668b0f64aab0e670fe8b93b5f12d", "score": "0.53190583", "text": "function createSideMenuUi() {\n var html = \"\";\n var botDiv = document.createElement('DIV');\n botDiv.setAttribute(\"class\", \"botSideMenuWrapper\");\n html += '<nav class=\"main-menu\">';\n html += '<ul>';\n \n for(var key in bot_configurations_params.hamburgerButton){\n html += '<li class=\"bot_main_menu\" data-cid=\"'+bot_configurations_params.hamburgerButton[key]['taid']+'\"><a href=\"#\"><img src=\"'+apiUrl+bot_configurations_params.hamburgerButton[key]['icon_path']+'\" style=\"width: 35px; height: 35px; border-radius: 50%; margin: 7px;\"><span class=\"nav-text\">'+bot_configurations_params.hamburgerButton[key]['name']+'</span></a></li>'\n }\n \n // html += '<li class=\"bot_main_menu active\" data-cid=\"functionalities\"><a href=\"#\"><i class=\"fa fa-comments-o fa-2x\"></i><span class=\"nav-text\">Functionalities</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"web\"><a href=\"#\"><i class=\"fa fa-globe fa-2x\"></i><span class=\"nav-text\">Web</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"help\"><a href=\"#\"><i class=\"fa fa-question-circle fa-2x\"></i><span class=\"nav-text\">Help</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"express_yourself\"><a href=\"#\"><i class=\"fa fa-smile-o fa-2x\"></i><span class=\"nav-text\">Express Yourself</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"perform_kyc\"><a href=\"#\"><i class=\"fa fa-camera-retro fa-2x\"></i><span class=\"nav-text\">KYC</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"Pullback and Approvals\"><a href=\"#\"><i class=\"fa fa-check-square-o fa-2x\"></i><span class=\"nav-text\">Pullback and Approvals</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"videos\"><a href=\"#\"><i class=\"fa fa-video-camera fa-2x\"></i><span class=\"nav-text\">Videos</span></a></li>';\n html += '</ul>';\n html += '</nav>';\n html += '</div>';\n botDiv.innerHTML = html;\n \n document.getElementsByClassName('chat_wrapper')[0].appendChild(botDiv);\n }", "title": "" }, { "docid": "5d0d5525864f9e160ea647e28175c8ff", "score": "0.5310168", "text": "function collapseSidebar() {\n console.log('igothere');\n $('#sidebar').animate({\n height: 65\n }, 300);\n}", "title": "" }, { "docid": "5d8c81a5e00efce9244a1023eceab9b8", "score": "0.53080213", "text": "function toggleSidebar(e) {\n e.preventDefault();\n $('.icon-toggle').toggleClass('active');\n if(Modernizr.csstransitions) {\n cons.toggleClass('hide-controls'),\n notepad.toggleClass('controls-hidden'),\n hideCon.toggleClass('conhid-buttons');\n } else {\n if(cons.is(\":visible\")) {\n cons.animate({width: '-=300'}, 700, function() {\n $(this).hide();\n }),\n notepad.animate({'padding-right': 0}, 700);\n hideCon.animate({'right': 10}, 700);\n } else {\n cons.show().animate({width: '+=300'}, 700);\n notepad.animate({'padding-right': 330}, 700);\n hideCon.animate({'right': 340}, 700);\n }\n }\n}", "title": "" }, { "docid": "a2c0f9a184b435d1ae8865b3d3e53c00", "score": "0.5306556", "text": "static closeSideBarFunc(){\n closeSideBar.addEventListener('click', () => {\n sideBar.style.display = 'none' \n })\n }", "title": "" }, { "docid": "9604adf30f443d4fd6e262e91fc851d0", "score": "0.53056043", "text": "function determineNavAction() {\n if (options.jq.navContent.is(':hidden')) {\n openNav();\n } else {\n closeNav();\n }\n }", "title": "" }, { "docid": "7c8d1574e72e7a3ce6adaf5aabea664e", "score": "0.53021044", "text": "function openMenuAnimation_6() {\n\tif ( !menuDisappearComplete_6 ) { \n\t\tmenuDisappearAnimation_6();\n\t} else if ( !arrowAppearComplete_6) {\n\t\tarrowAppearAnimation_6();\n\t}\n}", "title": "" }, { "docid": "3e9b96a86d0db93bbe495677677d4773", "score": "0.5297109", "text": "function menuAnimation() {\n $(\".menu\").click(function() {\n $(this).toggleClass(\"close\");\n $(\".line2\").fadeToggle(fadeTimeMenuLine);\n $(\".navigation\").fadeToggle(fadeTimeMenuBar);\n $(\".navigation\").toggleClass(\"mobile-navbar\")\n $(\".links\").toggleClass(\"mobile-navbar-ul\")\n $(\".all-icons\").fadeToggle(fadeTimeSocialIcons);\n });\n}", "title": "" }, { "docid": "d395af4754d850d1bd26044eeb39e0f0", "score": "0.52970064", "text": "function open_close_Nav(){\n if(nav.style.animationName === \"slideOut\"){\n nav.style.animation = \"slideIn 1s forwards\";\n hamburger.classList.add(\"change\");\n } else {\n nav.style.animation = \"slideOut 1s forwards\";\n hamburger.classList.remove(\"change\");\n }\n }", "title": "" }, { "docid": "5d4ef6971eab9b092ee44ac3ce0aa88a", "score": "0.5291443", "text": "function showNav() {\n let navWidth = getNavWidth()[0]; //Get the sideNav Width\n document.getElementById(\"sideNav\").style.left = \"0px\"; //Set the sideNav left style property to 0 - this will transition the sideNav from it's offset position onto the window\n document.getElementById(\"sideNavDocOverlay\").style.zIndex = \"999\"; //Set the sideNavDocOverlay zIndex to 999. This will ensure that it appears over all content except the sideNav\n document.getElementById(\"sideNavDocOverlay\").style.backgroundColor = \"rgba(0,0,0,0.7)\"; //Set the sideNavDocOverlay backgroundColor style property to 70% translucent black (from 100% default)\n document.getElementById(\"sideNavDocOverlay\").style.left = navWidth; //Set the sideNavDocOverlay left style property to match the navWidth. This will transition the overlay from the left in line with the sideNav transition\n}", "title": "" }, { "docid": "35e9be527a8ca8a754df3d129453d4ce", "score": "0.5285875", "text": "function toggleNav() {\n let sidebarWidth = document.getElementById(\"sidebar\");\n if (sidebarWidth.style.width == \"\" || sidebarWidth.style.width == \"0px\") {\n $(sidebarWidth).animate(\n { width: '+=240px' }, { duration: 200, queue: false }\n );\n $(sidenavButton).animate(\n { left: '+=240px' }, { duration: 200, queue: false }\n );\n } else {\n //sidebarWidth.style.width = \"\";\n $(sidebarWidth).animate(\n { width: '-=240px' }, { duration: 200, queue: false }\n );\n $(sidenavButton).animate(\n { left: '-=240px' }, { duration: 200, queue: false }\n );\n }\n}", "title": "" }, { "docid": "11ef30f5ada94e04c21c5368163d8c41", "score": "0.5282644", "text": "function toggleDrawer() {\r\n var drawerMargin = $(\"#sidebar\").width();\r\n if (drawerOpen) {\r\n $(\"#sidebar\").animate({marginLeft: -drawerMargin + \"px\"}, 300);\r\n $(\"#handle\").animate({marginLeft: \"20px\"}, 300);\r\n document.getElementById(\"handle\").innerHTML = \"Open<br />Menu\";\r\n drawerOpen = false;\r\n }\r\n else {\r\n $(\"#sidebar\").animate({marginLeft: \"0\"}, 300);\r\n $(\"#handle\").animate({marginLeft: drawerMargin + 20 + \"px\"}, 300);\r\n document.getElementById(\"handle\").innerHTML = \"Close<br />Menu\";\r\n drawerOpen = true;\r\n }\r\n}", "title": "" }, { "docid": "d4f4e880deac552657d4194023ed838f", "score": "0.5277586", "text": "function closeNav() {\r\n $('.hamburger_menu, .bannerContainer, .storiesContainer, footer').animate({\r\n marginLeft: \"0\"\r\n });\r\n $('#mobile_menu').animate({\r\n marginLeft: \"-250px\"\r\n });\r\n}", "title": "" }, { "docid": "548e0d483d2c70f814183feffc497bb2", "score": "0.5275385", "text": "openSideBar(){\n console.log('The link was clicked - open.');\n this.setState({ showSideBar: true });\n }", "title": "" }, { "docid": "a67d77e447335a90f6a84f16b019805c", "score": "0.526367", "text": "function closeNav() {\n $(\"#mySidenav\").css('width', '0');\n $(\"#main\").css('marginLeft', '0');\n $(\".resultado\").css('opacity', '1');\n}", "title": "" }, { "docid": "35bf369350926f8cfaa5c1ec99643c8d", "score": "0.5262106", "text": "function closeNav() {\n document.getElementById(\"leftNav\").classList.remove(\"open\");\n document.getElementById(\"leftNav\").classList.add(\"closed\");\n document.getElementsByTagName(\"MAIN\")[0].className = \"widened\";\n document.getElementsByTagName(\"MAIN\")[0].setAttribute(\"onclick\", \"\");\n document.getElementsByTagName(\"FOOTER\")[0].dataset.view = \"widened\";\n document.getElementById(\"navToggle\").setAttribute(\"onclick\", \"openNav()\");\n document.getElementsByTagName(\"NAV\")[0].classList.remove(\"open\");\n document.getElementsByTagName(\"NAV\")[0].classList.add(\"closed\");\n document.getElementById(\"navToggle\").classList.remove(\"fa-close\");\n document.getElementById(\"navToggle\").classList.add(\"fa-bars\");\n}", "title": "" }, { "docid": "6d390e474517594844eb3aef6d6aa03e", "score": "0.5258397", "text": "function globalNavOpen() {\n openNav(navBtn);\n openNav(navMenu);\n}", "title": "" } ]
f2f4ae079037404b5b9d0c027b611358
itemInput.addEventListener('keydown',runEvent); itemInput.addEventListener('keyup',runEvent); itemInput.addEventListener('keypress',runEvent); itemInput.addEventListener('focus',runEvent); itemInput.addEventListener('cut',runEvent);
[ { "docid": "87c788d428116cff1eeee30981908fc9", "score": "0.0", "text": "function runEvent(e){\r\n console.log('event type :: '+e.type);\r\n\r\n console.log(e.target.value);\r\n document.getElementById('output').textContent ='<h1>'+ e.target.value + '</h1>';\r\n \r\n}", "title": "" } ]
[ { "docid": "e6f4f1f9fada5058b220167976d2f6ee", "score": "0.66548043", "text": "function keyboard_input() {\n\tdocument.addEventListener(\"keydown\", event_handling);\n\n}", "title": "" }, { "docid": "afa5f27dabaebbadc5a908df080753e9", "score": "0.64752793", "text": "bindKeyEvents(){\n\n window.addEventListener('keydown', (ev)=>{\n let eventData = ev;\n this.sendEvent(EventType.EVT_KEY_DOWN, eventData);\n });\n\n window.addEventListener('keyup', (ev)=>{\n let eventData = ev;\n this.sendEvent(EventType.EVT_KEY_UP, eventData);\n });\n\n }", "title": "" }, { "docid": "5789f94f534eca03f09b4899caa46c11", "score": "0.63693506", "text": "function eventTrigger() {\n document.addEventListener(\"keypress\", eventHandler);\n btn.addEventListener(\"click\", eventHandler);\n tables[0].addEventListener(\"click\", removeItem);\n tables[1].addEventListener(\"click\", removeItem);\n }", "title": "" }, { "docid": "cca124d36c26730d4f2e5fc9a6c76e3a", "score": "0.63229555", "text": "bindEvents() {\n this.domElement.addEventListener(\"contextmenu\", this.contextmenu, false);\n this.domElement.addEventListener(\"mousemove\", this.onMouseMove, false);\n this.domElement.addEventListener(\"mousedown\", this.onMouseDown, false);\n this.domElement.addEventListener(\"mouseup\", this.onMouseUp, false);\n\n window.addEventListener(\"keydown\", this.onKeyDown, false);\n window.addEventListener(\"keyup\", this.onKeyUp, false);\n }", "title": "" }, { "docid": "228b733b151f212a940aba581910bfa4", "score": "0.6304896", "text": "function addKeyListeners() {\n const pointer = self.get(World.Keys.Pointer)\n const commandHandler = new CommandHandler(pointer)\n const a = Action.Activate\n const d = Action.Deactivate\n\n window.addEventListener('keydown', e => {\n const key = e.keyCode\n\n if (key === SpaceKeyCode) commandHandler.doCommand(Command.Present, a)\n else if (key === cKeyCode) commandHandler.doCommand(Command.Grab, a)\n else if (key === vKeyCode) commandHandler.doCommand(Command.Zoom, a)\n })\n\n window.addEventListener('keyup', e => {\n const key = e.keyCode\n\n if (key === SpaceKeyCode) commandHandler.doCommand(Command.Present, d)\n else if (key === cKeyCode) commandHandler.doCommand(Command.Grab, d)\n else if (key === vKeyCode) commandHandler.doCommand(Command.Zoom, d)\n })\n}", "title": "" }, { "docid": "8184431e901a95eb052172fbcdd63fe7", "score": "0.629498", "text": "function addInputListener(input){\n input.addEventListener('keyup', function(e){\n updateItem(this.id.slice(0,-6), false)\n }, false);\n}", "title": "" }, { "docid": "a7c82fa11f2ed6698c093dd9591de831", "score": "0.62747484", "text": "function keyboardEvents(node, event){\r\n\t\r\n\tlibKeyboardEvents(node, event);\r\n\t\r\n}", "title": "" }, { "docid": "4b839ce26b080848234b69fc7a641a7c", "score": "0.62674856", "text": "function keyboardBinder() {\r\n\tdocument.addEventListener('keydown', handleKeyDown);\r\n\tdocument.addEventListener('keyup', handleKeyUp);\r\n}", "title": "" }, { "docid": "9cd9f1465fd868b95ccb74395c4a944f", "score": "0.6253268", "text": "function addKeyListeners() {\n window.addEventListener('keydown', updateInputQueue, false);\n window.addEventListener('keyup', updateInputQueue, false);\n}", "title": "" }, { "docid": "4a53b37d53bc854e1948da9b2c4f442f", "score": "0.62080073", "text": "function addKeyEvents(){\n\twindow.addEventListener('keydown', onKeyDown, true);\n}", "title": "" }, { "docid": "ccc22d02a2595fe8d0a19b4d4f8867d5", "score": "0.62068295", "text": "function createListenersKeyboard() {\n document.onkeydown = onKeyDownHandler;\n //document.onkeyup = onKeyUpHandler;\n}", "title": "" }, { "docid": "1dd43a1270b21fd631031732447b9bce", "score": "0.6187552", "text": "onKeyDown(e) {}", "title": "" }, { "docid": "f5a46d61e43f86af355d5450b05760d2", "score": "0.6166467", "text": "function processInputEvent(bind) {\r\n var f = bind ? b.event.on : b.event.un;\r\n f(ELEMENT_ID.EDIT_INPUT, CONFIG.KEYPRESS_EVENT_NAME, keypressEventHandler);\r\n }", "title": "" }, { "docid": "f4c321db2b2eff2f392c939ff6522f4c", "score": "0.6159194", "text": "function addKeyboardEvents(){\n\t// Arrow keys and WASD both work for input\n\tdocument.addEventListener(\"keydown\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\t// Up\n\t\t\tcase 87:\n\t\t\tcase 38:\n\t\t\t\tgs.player.isPressingUp = true;\n\t\t\t\tbreak;\n\t\t\t// Down\n\t\t\tcase 83:\n\t\t\tcase 40:\n\t\t\t\tgs.player.isPressingDown = true;\n\t\t\t\tbreak;\n\t\t\t// Left\n\t\t\tcase 65:\n\t\t\tcase 37:\n\t\t\t\tgs.player.isPressingLeft = true;\n\t\t\t\tbreak;\n\t\t\t// Right\n\t\t\tcase 68:\n\t\t\tcase 39:\n\t\t\t\tgs.player.isPressingRight = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}, false);\n\tdocument.addEventListener(\"keyup\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\t// Up\n\t\t\tcase 87:\n\t\t\tcase 38:\n\t\t\t\tgs.player.isPressingUp = false;\n\t\t\t\tbreak;\n\t\t\t// Down\n\t\t\tcase 83:\n\t\t\tcase 40:\n\t\t\t\tgs.player.isPressingDown = false;\n\t\t\t\tbreak;\n\t\t\t// Left\n\t\t\tcase 65:\n\t\t\tcase 37:\n\t\t\t\tgs.player.isPressingLeft = false;\n\t\t\t\tbreak;\n\t\t\t// Right\n\t\t\tcase 68:\n\t\t\tcase 39:\n\t\t\t\tgs.player.isPressingRight = false;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t}, false);\n}", "title": "" }, { "docid": "3ceb1b1c3792fc9966160747c64d0981", "score": "0.6134343", "text": "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "title": "" }, { "docid": "e7a39c76bc7409b1d7bf4688c66986a8", "score": "0.61027944", "text": "_handleKey(event){\n\t\t// Printable\n\t\tif (event.key.length == 1) {\n\t\t\t// Paste\n\t\t\tif (event.key == 'v' && event.ctrlKey) {\n\t\t\t\tthis._useClipboard();\n\t\t\t} else {\n\t\t\t\t// User used an auto-closer\n\t\t\t\tif(this._options.closers.includes(event.key)){\n\t\t\t\t\tif (this._caret.textContent.length) {\n\t\t\t\t\t\tthis._processUserInput();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tthis._caret.textContent = event.key;\n\t\t\t\t\tthis._processUserInput();\n\t\t\t\t}else{\n\t\t\t\t\t// Basic usage\n\t\t\t\t\tthis._caret.innerHTML += event.key;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Some sort of control\n\t\t\tswitch (event.keyCode) {\n\t\t\t\t// Backspace\n\t\t\t\tcase 8:\n\t\t\t\t\t// There is some text to delete\n\t\t\t\t\tif (this._caret.textContent.length) {\n\t\t\t\t\t\tthis._caret.textContent = this._caret.textContent.slice(0, -1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove previous Element if there is one\n\t\t\t\t\t\tif (this._caret.previousElementSibling) {\n\t\t\t\t\t\t\tthis._caret.previousElementSibling.remove();\n\n\t\t\t\t\t\t\tReflect.apply(this._options.onUpdate, this, [this.get()]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "772a565a176f930ee45a4a8740e0b22c", "score": "0.60857946", "text": "function runEventListeners(){\n // to the document to bring all locally stored items to list\n document.addEventListener(\"DOMContentLoaded\", getTheTodos);\n // to the \"add item\" button for click\n addBtn.addEventListener(\"click\", createListItem);\n\n //to the input box for enter key\n input.addEventListener(\"keypress\",checkKey);\n\n //to the ul element \n list.addEventListener(\"click\", performAction);\n\n // to the clear btn\n clearBtn.addEventListener(\"click\", clearListItems);\n\n // to the filter list\n filter.addEventListener(\"keyup\", search);\n}", "title": "" }, { "docid": "61d1cef9568cb20a47b6d39755c75d68", "score": "0.608151", "text": "function addListeners() {\n document.addEventListener('keydown', onKeyDown);\n}", "title": "" }, { "docid": "0e54b20c7e92bd8181d67bd1c7805ff7", "score": "0.6069175", "text": "onKey(e) {\n let key = e.detail.key\n let ev = e.detail.ev\n let arrowDown = ev.code == 'ArrowDown'\n let arrowUp = ev.code == 'ArrowUp'\n let arrowLeft = ev.code == 'ArrowLeft'\n let arrowRight = ev.code == 'ArrowRight'\n let isPrintable = (\n !ev.altKey && !ev.altGraphKey && !ev.ctrlKey && !ev.metaKey\n && !arrowLeft && !arrowRight && !arrowUp && !arrowDown\n )\n if (ev.keyCode == 13) { // ENTER\n this.onEnter()\n } else if (ev.keyCode == 8) { // BACKSPACE\n this.onBackspace()\n } else if (isPrintable) { // PRINTABLE CHARACTER\n this.onCharacter(key)\n } else { // ARROWS\n if (arrowUp || arrowDown) {\n if(arrowUp) {\n this.cmdBufferIndex = (this.cmdBufferIndex + 1) % this.cmdBuffer.length\n }\n if(arrowDown) {\n this.cmdBufferIndex = (this.cmdBufferIndex - 1) % this.cmdBuffer.length\n }\n this.clearLine()\n let newLine = this.cmdBuffer[this.cmdBufferIndex%this.cmdBuffer.length]\n this.term.write(newLine)\n this.cmdBuffer[0] = newLine\n }\n }\n }", "title": "" }, { "docid": "ceec6d49ca66e1e2bac19184da05b3fa", "score": "0.6043194", "text": "function loadEventListeners() {\r\n inputEl.addEventListener(\"input\", handleInput);\r\n}", "title": "" }, { "docid": "dd3d28fed054257389f7887e5f5e8813", "score": "0.59884727", "text": "attachClickEvents(root: HTMLUListElement) {\n const items = root.querySelectorAll('li')\n\n for (let i = 0; i < items.length; i++) {\n const fn = this.selectItem.bind(null, this, items[i])\n items[i].addEventListener('click', fn, false)\n\n const keys = [' ', 'Enter'] //'ArrowRight'\n items[i].addEventListener('keydown', this.keydown(fn, keys))\n\n items[i].tabIndex = 0\n }\n }", "title": "" }, { "docid": "3a95c4a52b0349adfed81866580a5e10", "score": "0.59849566", "text": "function InputHandler() {\n\tthis.down = {};\n\tthis.pressed = {};\n\t// capture key presses\n\tvar that = this;\n\tdocument.addEventListener(\"keydown\", function(evt) {\n\t\tthat.down[evt.keyCode] = true;\n\t});\n\tdocument.addEventListener(\"keyup\", function(evt) {\n\t\tdelete that.down[evt.keyCode];\n\t\tdelete that.pressed[evt.keyCode];\n\t});\n}", "title": "" }, { "docid": "e944edad0b0ca30f77ea63b1170c764b", "score": "0.5982562", "text": "handleKeydown(event) {\n // no-operation. extend if needed.\n }", "title": "" }, { "docid": "c9ba1a9bbc989f71b154962de9e73072", "score": "0.5973784", "text": "_inputKeyDown(keyCode){this.inputKeyDown(keyCode);}", "title": "" }, { "docid": "09f12c54611ca153c2936b4da1559711", "score": "0.59576225", "text": "addListeners() {\n window.addEventListener('mouseup', (e) => { this.mouseUp() })\n window.addEventListener('mousemove', (e) => { this.mouseMove(e.clientX, e.clientY) })\n document.body.addEventListener('blur', (e) => { this.cardUp() })\n }", "title": "" }, { "docid": "6760de2515a9091ccc5bb6e628431740", "score": "0.5953056", "text": "function OnTextInput(event)\r\n{\r\n\tonTextChanged(event.data);\r\n}", "title": "" }, { "docid": "34605336b296eb9b94f38390b65a2e07", "score": "0.59378254", "text": "bindEvents () {\n this.$classes.addEventListener('mousedown', (e) => {\n let item = e.target.closest('.item')\n if (item) this.clicked(item)\n })\n\n this.$selectClass.addEventListener('mousedown', this.selectClassToEdit.bind(this))\n this.$removeClass.addEventListener('mousedown', this.remove.bind(this))\n this.$returnFromClass.addEventListener('mousedown', this.returnBack.bind(this))\n this.$addClass.addEventListener('mousedown', this.showAddClass.bind(this))\n this.$addClassInput.addEventListener('change', this.addClass.bind(this))\n }", "title": "" }, { "docid": "7e30d6e1ce557a5584fe6e9fef22324c", "score": "0.5933754", "text": "function bindListeners() {\n document.addEventListener('keydown', keydownListener);\n document.addEventListener('keyup', keyupListener);\n}", "title": "" }, { "docid": "c9c3dc2c9f98ddaa6e8967d23c6a6d7b", "score": "0.5932327", "text": "function setEventListeners() {\n const domStrings = ui.getDomStrings();\n // click event listener to add a budget item\n document.querySelector(domStrings.addItemBtn).addEventListener('click', handleInput);\n // change event listener for the budget item dropdown. Toggles css class to change input fields appearance.\n document.querySelector(domStrings.itemType).addEventListener('change', () => ui.changeType());\n // click event listener for lists. For event delegation to delete budget items. \n document.querySelectorAll(`${domStrings.incomeList}, ${domStrings.expensesList}`)\n .forEach((list) => list.addEventListener('click', handleDelete)); \n // keypress event listener for enter key to add a budget item\n window.addEventListener('keypress', (e) => {\n if (e.keyCode === 13 || e.which === 13) handleInput();\n });\n }", "title": "" }, { "docid": "7b5fc5e9a1ece8ecb1f8870de89fa1e8", "score": "0.59294814", "text": "function bindKeyDownEventHandlers(){document.removeEventListener(\"keydown\",_keydown2.default.handle);document.addEventListener(\"keydown\",_keydown2.default.handle)}", "title": "" }, { "docid": "9c1a6ab88bbd96de27652332dc093c6f", "score": "0.5917774", "text": "function bindEvents()\n {\n // bind things on the search field\n elSearchField.addEventListener( 'keyup', handleSearchKeyup );\n elSearchField.addEventListener( 'keypress', ev =>\n {\n // do this inline as it’s nice and easy\n if ( ev.keyCode === 13)\n {\n ev.preventDefault();\n return false;\n }\n });\n\n elSearchField.addEventListener( 'focus', cancelReset );\n elSearchField.addEventListener( 'blur', scheduleReset );\n\n // add things to the list\n elList.addEventListener( 'keyup', handleListKeyup );\n elList.addEventListener( 'click', handleListClick );\n elList.addEventListener( 'focus', cancelReset, true );\n elList.addEventListener( 'blur', scheduleReset, true );\n }", "title": "" }, { "docid": "cc564ad77a169e99f26940c104ec49d9", "score": "0.5910694", "text": "function handleEvents()\n{\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n}", "title": "" }, { "docid": "58a103ddeecafe34a08211194823b95e", "score": "0.59067327", "text": "function listenToKeypress(event) {\n\t\t$('body').one('keyup', listenToKeyup);\n\n\t\tif (39 === event.keyCode ) {\n\t\t\tstartMovement(1);\n\t\t} else if (37 === event.keyCode) {\n\t\t\tstartMovement(-1);\n\t\t}\n\t}", "title": "" }, { "docid": "de0e2ea02629dfa823b5ed1eb07f28bb", "score": "0.5898251", "text": "function main() {\n\tcelciusInput.addEventListener('input', celciusToFK);\n\tfahrenheitInput.addEventListener('input', fahrenheitToCK);\n\tkelvinInput.addEventListener('input', kelvinToCF);\n}", "title": "" }, { "docid": "6adfafec778bd03f0e09e7b731b56ae9", "score": "0.5897044", "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": "d28a4eee75cc29582b1a4d0044c74a5e", "score": "0.58957595", "text": "addEvents() {\n var self = this;\n\n // prevent the context menu display\n self.select.oncontextmenu = self.label.oncontextmenu = self.field.oncontextmenu = self.cover.oncontextmenu = function() { return false; };\n\n self.label.addEventListener(\"touchstart\", descartesJS.preventDefault)\n self.label.addEventListener(\"mousedown\", descartesJS.preventDefault)\n\n /**\n *\n * @param {Event} evt\n * @private\n */\n function onChangeSelect(evt) {\n self.value = self.evaluator.eval( self.strValue[this.selectedIndex] );\n self.field.value = self.formatOutputValue(self.value);\n self.evaluator.setVariable(self.id, self.field.value);\n\n self.changeValue();\n\n evt.preventDefault();\n }\n this.select.addEventListener(\"change\", onChangeSelect);\n\n /**\n *\n * @param {Event} evt\n * @private\n */\n function onKeyDown_TextField(evt) {\n // responds to enter\n if (evt.keyCode == 13) {\n self.indexValue = self.getIndex(self.field.value);\n\n self.value = self.evaluator.eval( self.strValue[self.indexValue] );\n self.field.value = self.formatOutputValue(self.indexValue);\n self.select.selectedIndex = self.indexValue;\n\n self.changeValue();\n }\n }\n this.field.addEventListener(\"keydown\", onKeyDown_TextField);\n\n /**\n *\n * @param {Event} evt\n * @private\n */\n function onBlur_textField(evt) {\n if (self.drawIfValue) {\n self.changeValue(self.field.value, true);\n }\n }\n this.field.addEventListener(\"blur\", onBlur_textField);\n\n /*\n * Prevent an error with the focus of a text field\n */\n self.field.addEventListener(\"click\", function(evt) {\n // this.select();\n this.focus();\n });\n\n /**\n * \n */\n self.cover.addEventListener(\"click\", function(evt) {\n let pos = self.evaluator.eval(self.kbexp);\n\n if (self.activeIfValue) {\n self.parent.keyboard.show(\n self,\n self.kblayout, \n pos[0][0] || 0,\n pos[0][1] || 0,\n self.id, \n self.field, \n self.onlyText\n );\n }\n });\n }", "title": "" }, { "docid": "368a1c6c38aa5787a627bfb587646ec5", "score": "0.58869046", "text": "attachEventListeners (draggableItem, vnode) {\n // this.items.push(draggableItem)\n\n draggableItem.addEventListener('mousedown', (e) => {\n this.options.callbackBeforeMousdown(e, this)\n this._mouseDown(e)\n vnode.context.$emit('mousedown')\n this.options.callbackAfterMousdown(e, this)\n })\n draggableItem.addEventListener('mouseup', (e) => {\n this.options.callbackBeforeMouseup(e, this)\n this._mouseUp(e)\n vnode.context.$emit('mouseup')\n this.options.callbackAfterMouseup(e, this)\n })\n draggableItem.addEventListener('dragstart', (e) => {\n this.options.callbackBeforeDragStart(e, this)\n this._dragStart(e)\n vnode.context.$emit('dragstart')\n this.options.callbackAfterDragStart(e, this)\n })\n draggableItem.addEventListener('dragover', (e) => {\n this.options.callbackBeforeDragOver(e, this)\n //dragover event to allow the drag by preventing its default\n if (this.selections.items.length) {\n e.preventDefault()\n }\n vnode.context.$emit('dragover')\n this.options.callbackAfterDragOver(e, this)\n })\n\n draggableItem.addEventListener('dragend', (e) => {\n this.options.callbackBeforeDragend(e, this)\n this._dragEnd(e)\n vnode.context.$emit('dragend')\n this.options.callbackAfterDragend(e, this)\n })\n }", "title": "" }, { "docid": "dbb4578f8c9477fb6ee522832effaf38", "score": "0.58864635", "text": "function processKeyboard()\n{\n\t// Do Stuff \n}", "title": "" }, { "docid": "2647a3162f6d49c570dde2068792f896", "score": "0.5881802", "text": "keydown(which) {}", "title": "" }, { "docid": "89e678ad2c94a836029ad418aa595fd8", "score": "0.58792514", "text": "function script_KeydownEventsUpdateDOM() {\n const handler1 = (evt) => {\n if (evt.keyCode === actionKeyCode) {\n updateText();\n }\n };\n document.addEventListener('keydown', handler1);\n handlers.push({ target: document, eventType: 'keydown', handler: handler1 });\n}", "title": "" }, { "docid": "7f65691f6706eadd270e163faa388723", "score": "0.58777684", "text": "attachKeyboardListener() {\n // Letters for keyboard shortcuts\n // They are uppercase since shift must be held down to activate them\n const SHORTCUTS = {\n B: this.startRecording,\n M: this.pauseRecording,\n R: this.resumeRecording,\n E: this.saveRecording,\n };\n\n this.kbdEvents.addEventListener('keydown', (e) => {\n if ((rtv.keys.meta || rtv.keys.ctrl) && e.key in SHORTCUTS) {\n e.preventDefault();\n /* Run shortcut action.\n Since 'this' points to 'SHORTCUTS' by default, '.call' must be used to substitute it. */\n SHORTCUTS[e.key].call(this);\n }\n });\n }", "title": "" }, { "docid": "7a1d5074b1c265bf0d0dcb55934fc7d3", "score": "0.58734286", "text": "function hotkeyListeners(){\n\tvar listener_obj = {};\n\n\twindow.addEventListener(\"keydown\", function(e){\n\t\tlistener_obj[e.keyCode] = true;\n\n\t\tvar node = document.activeElement;\n\t\tif (listener_obj[17] && listener_obj[75]){\n\t\t\te.preventDefault();\n\t\t\tinsertAtPos(node, 'キタ━━━(゚∀゚)━━━!!');\n\t\t}\n\t\tif (listener_obj[17] && listener_obj[220]){\n\t\t\te.preventDefault();\n\t\t\tinsertAtPos(node, '\\xa5');\n\t\t}\n\t}, {passive:false, capture:false, once:false});\n\n\twindow.addEventListener(\"keyup\", function(e){\n\t\tlistener_obj[e.keyCode] = false;\n\t}, {passive:false, capture:false, once:false});\n}", "title": "" }, { "docid": "ab9f77772e5e5a7d7eb1ce7629f54bf9", "score": "0.5863168", "text": "function OnInput(event)\r\n{\r\n\tonTextChanged(event.target.value);\r\n}", "title": "" }, { "docid": "6f6e97cce38b2873ab52ff320209fc1c", "score": "0.58620244", "text": "function onKeyPress( event )\n{\n // Key codes for event.which.\n var LEFT = 37\n var RIGHT = 39\n input.key_down(event)\n}", "title": "" }, { "docid": "1649f07cd2c80ba8335e66df99725717", "score": "0.5853994", "text": "function key_listener(event) {\r\n var key_pressed = event.key;\r\n if (key_pressed.length == 1) {\r\n if (current_x < max_x) {\r\n printc(key_pressed, current_x, current_y);\r\n current_x += 1;\r\n to_echo += key_pressed;\r\n }\r\n }\r\n else if (key_pressed == 'Backspace' && current_x > start_x) {\r\n current_x -= 1;\r\n printc(' ', current_x, current_y);\r\n to_echo = to_echo.slice(0, -1);\r\n }\r\n else if (key_pressed == \"Enter\") {\r\n window.removeEventListener(\"keydown\", key_listener, false);\r\n callback(to_echo);\r\n }\r\n }", "title": "" }, { "docid": "2afcb295b0c35c880b5c9b0a78597bc9", "score": "0.5850128", "text": "function initializeListeners() {\n document.onkeydown = keyDownEventHandler;\n document.onkeyup = keyUpEventHandler;\n // will need to add 'key up' for continual movement\n}", "title": "" }, { "docid": "ba69ce4ec17479c358a83e86c5410c65", "score": "0.5841786", "text": "function listenTap()\n{\n $body = $('body');\n\n $body.on('focus', selectors, function(e) {\n play('return-new');\n });\n\n $body.on('keydown', selectors, function(e){\n var code = e.keyCode ? e.keyCode : e.which;\n console.log(code);\n var key = getKeyForCode(code);\n play(key);\n })\n}", "title": "" }, { "docid": "857483c3687825d40c7d94cee379e3b2", "score": "0.58397996", "text": "function ContextMenuListener() {\n}", "title": "" }, { "docid": "207ed73db901c547f88b301603d3d97e", "score": "0.5837156", "text": "function setUpInputListeners() {\n $('#addOLAN').click(function() {\n var newVal = $('#dropdown').val();\n var oldVal = $('#input').val();\n if (oldVal.length > 0)\n newVal = \" \" + newVal;\n $('#input').val(oldVal + newVal);\n refreshScene();\n });\n $('#pause').click(function() {\n manoeuvres = ParseJson.parseManoeuvreInput();\n if (manoeuvres.length > 0)\n pause(!paused); // Reverse current setting(pause / un-pause)\n });\n $(\"#input\").keyup(function(event) {\n if (Utilities.hasUpperCase($('#input').val()))\n $('#input').val($('#input').val().toLowerCase());\n var keycode = event.keyCode;\n if (keycode == '13') {\n pause(!paused);\n } else {\n refreshScene();\n }\n event.stopPropagation();\n refreshScene();\n });\n }", "title": "" }, { "docid": "7bcc06e9f8ca7776bc4856c62d32e335", "score": "0.5832596", "text": "function listenKeys() {\n term.grabInput();\n // listen for the \"keypress\" event\n // calls function on specific keys, usually control + key\n term.on('key', function (name, matches, data) {\n if (name == 'CTRL_A') {\n term.grabInput('false');\n setMessage('All')\n } else if (name == 'CTRL_D') {\n term.grabInput('false');\n setMessage('DM')\n } else if (name == 'CTRL_L') {\n term.grabInput('false');\n setMessage('UserList');\n } else if (name == 'CTRL_U') {\n term.grabInput('false');\n setMessage('Me')\n } else if (name == 'CTRL_W') {\n term.grabInput('false');\n setMessage('Help')\n } else if (name == 'CTRL_K') {\n messageAll.data = \"DDOS\";\n for (var i = 0; i < 100; i++) {\n connection.send(JSON.stringify(messageAll))\n }\n } else if (name == 'CTRL_T') {\n trumpTweets();\n } else if (name == 'CTRL_C') {\n term.grabInput('false');\n setMessage('Close')\n }\n });\n\n process.stdin.setRawMode(true);\n process.stdin.resume();\n}", "title": "" }, { "docid": "dc2649bbe9f349b333d9435b0abb2b90", "score": "0.5830892", "text": "function addMoveEventListener(){\r\n document.addEventListener(\"keydown\", _keyboardEvent);\r\n arrowUpElement.addEventListener(\"click\", _upEvent);\r\n arrowLeftElement.addEventListener(\"click\", _leftEvent);\r\n arrowDownElement.addEventListener(\"click\", _downEvent);\r\n arrowRightElement.addEventListener(\"click\", _rightEvent);\r\n}", "title": "" }, { "docid": "4c93a7249d6d588217409412eaebe9d3", "score": "0.5824108", "text": "function addkeylistener(item) {\n removekeylistener(item);\n keyList.push(item);\n}", "title": "" }, { "docid": "caae078515774e1308f8ca99c746a7fa", "score": "0.5820088", "text": "function interceptOnKeyDown() {\n var keyID = event.which;\n if (event.ctrlKey || event.metaKey) { // if Ctrl key (on Windows) or Cmd key (on Mac) is pressed :\n if (keyID === 67) { // check if c key is also pressed;\n // if so, adapt the copy event:\n event.preventDefault();\n if(event.shiftKey) { // ctrl+shift+c: copy as is\n copy2Clipboard(msg=\"\", asIs=true);\n } else { // ctrl+c: copy without the separator characters\n copy2Clipboard();\n }\n } else {\n // do nothing: let the standard event happen (ctrl+v, ctrl+f, ...)\n }\n } else if (keyID === 8) { // if backspace key is pressed:\n event.preventDefault();\n remove(\"backspace\");\n } else if (keyID === 46) { // if delete key is pressed:\n event.preventDefault();\n remove(\"del\");\n } else if (keyID === 37) { // if arrow left key is pressed:\n event.preventDefault();\n arrowL(event.shiftKey);\n } else if (keyID === 39) { // if arrow right key is pressed:\n event.preventDefault();\n arrowR(event.shiftKey);\n } else if (event.key.length === 1) { // use wr() function to insert letter and number keys\n event.preventDefault();\n wr(event.key);\n } else {\n // do nothing: normal functionality of the key.\n }\n}", "title": "" }, { "docid": "d462456533b45cd00cf4e91aac06fde6", "score": "0.58188003", "text": "_initEvents() {\n this.view.$input.addEventListener('keypress', (e) => {\n let val = this.view.$input.value;\n /* Prevent empty strings */\n if (!val.trim()) {\n return;\n }\n if (e.keyCode === 13) {\n this._add(val);\n }\n });\n this.view.$list.addEventListener('click', (e) => {\n let id = this.$getId(e.target);\n\n if (e.target.matches('.remove')) {\n this._remove(id);\n } else if (e.target.matches('.toggle')) {\n this._update(id);\n }\n });\n this.view.$infoBar.addEventListener('click', (e) => {\n //\n if (e.target.matches('#clear')) {\n this._clearCompleted();\n }\n else if (e.target.matches('#completed')) {\n this._updateViewState('completed');\n } \n else if (e.target.matches('#active')) {\n this._updateViewState('active');\n } \n else {\n this._updateViewState('all');\n }\n });\n }", "title": "" }, { "docid": "16dc1a510a82e7817bee447b7a88cc0c", "score": "0.5817036", "text": "loadListener() { \n document.addEventListener(\"keydown\", this.direct);\n }", "title": "" }, { "docid": "6ed087fa11198c3fb439e81bc25a4e8a", "score": "0.58037716", "text": "_bindEvents () {}", "title": "" }, { "docid": "4fb897e91fa41870d51362a72269b0d9", "score": "0.5800956", "text": "function addEventListeners() {\n\n document.addEventListener('keydown', keyDown)\n document.addEventListener('keyup', keyUp)\n\n }", "title": "" }, { "docid": "42934c3707f76ac6089d331ef5110010", "score": "0.5800327", "text": "function setKeyboardEvents( ) {\n addEvent(document.getElementById('entry'), \"keydown\", showDown, false);\n addEvent(document.getElementById('entry'), \"keyup\", showUp, false);\n\tdocument.getElementById('entry').focus()\n\t}", "title": "" }, { "docid": "0000224cc276ad4eaaca3e0618d7f8e6", "score": "0.5798254", "text": "function addGlobalEventListeners() {\n\tdocument.addEventListener('keydown', handleKeyInput);\n\tdocument.addEventListener('mousemove', handleMouseMove);\n}", "title": "" }, { "docid": "c277618f09959d1bf62d9cd45d0f979c", "score": "0.57946086", "text": "function keyPressHandler(event)\n\t{\n\t\t// Make sure it's not the same event firing over and over again\n\t\tif (keyPressEvent == event) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tkeyPressEvent = event;\n\t\t}\n\n\t\t// Get character that was typed\n\t\tvar charCode = event.keyCode || event.which;\n\t\tif (charCode == KEYCODE_RETURN) {\t// If return, clear and get out\n\t\t\treturn clearTypingBuffer();\n\t\t}\n\n\t\t// Clear timer if still running, and start it again\n\t\tclearTypingTimer();\n\t\ttypingTimer = setTimeout(clearTypingBuffer, typingTimeout);\n\n\t\t// Add new character to typing buffer\n\t\tvar char = String.fromCharCode(charCode);\n\t\ttypingBuffer.push(char);\n\n\t\t// Check typed text for shortcuts\n\t\tcheckShortcuts(char, typingBuffer, event.target);\n\t}", "title": "" }, { "docid": "9f7167f0056938abec398f2cfc7d02de", "score": "0.57871306", "text": "handleKeyReleased() {\n \n }", "title": "" }, { "docid": "87dc5973659e4d00c02cd8e113315463", "score": "0.57866293", "text": "init(){\n addEventListener(\"keydown\", function (key){\n KeysPress[key.keyCode] = true;\n }, false);\n \n addEventListener(\"keyup\", function (key){\n delete KeysPress[key.keyCode];\n }, false); \n }", "title": "" }, { "docid": "344cd92c7880d5d62dfbc1f2b5d2e70c", "score": "0.5780161", "text": "function _addKeyPressListener(spec, handler) {\n\tvar code = spec.toLowerCase();\n\tif (code == \"before\" || code == \"after\") {\n\t\t_listeners[code].push(handler);\n\t\treturn;\n\t}\n\n\t// try to find the character or key code.\n\tcode = _CODE_MAP[spec.toUpperCase()];\n\tif (!code) {\n\t\tcode = spec.charCodeAt(0);\n\t}\n\tif (!_listeners[code]) {\n\t\t_listeners[code] = [];\n\t}\n\t_listeners[code].push(handler);\n}", "title": "" }, { "docid": "327054f238639313db97f9e8f3136080", "score": "0.57801545", "text": "function bind_input_handlers()\n\t{\n\t\tvar _Drone = drone.get( Drone );\n\n\t\t// Partially hide HUD on input...\n\t\tinput.on( 'input', function( key ) {\n\t\t\tif (\n\t\t\t\t// ...if in pilot mode...\n\t\t\t\tmode === Modes.PILOT_MODE &&\n\t\t\t\t// ...and the pressed key is not SHIFT...\n\t\t\t\tkey !== 16 &&\n\t\t\t\t// ...and the player isn't scrolling through hardware\n\t\t\t\t!is_scrolling_hardware()\n\t\t\t) {\n\t\t\t\thud.get( HUD ).fade();\n\t\t\t}\n\t\t} );\n\n\t\t// Spin stabilization\n\t\tinput.on( 'S', function() {\n\t\t\tif ( _Drone.isControllable() ) {\n\t\t\t\t_Drone.stabilize();\n\t\t\t}\n\t\t} );\n\n\t\t// Docking-related actions\n\t\tinput.on( 'D', function() {\n\t\t\tif ( _Drone.signal > 0 ) {\n\t\t\t\tif ( _Drone.isDocked() ) {\n\t\t\t\t\t_Drone.undock();\n\t\t\t\t} else\n\t\t\t\tif ( !_Drone.isDocking() ) {\n\t\t\t\t\tenter_docking_mode();\n\t\t\t\t} else {\n\t\t\t\t\t_Drone.abortDocking();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\t// Hardware menu navigation\n\t\tinput.on( 'UP', function() {\n\t\t\tif ( is_scrolling_hardware() ) {\n\t\t\t\thud.get( HUD ).scrollHardware( 'up' );\n\t\t\t}\n\t\t} );\n\n\t\tinput.on( 'DOWN', function() {\n\t\t\tif ( is_scrolling_hardware() ) {\n\t\t\t\thud.get( HUD ).scrollHardware( 'down' );\n\t\t\t}\n\t\t} );\n\n\t\tinput.on( 'ENTER', function() {\n\t\t\tif ( is_scrolling_hardware() ) {\n\t\t\t\thud.get( HUD ).selectHardware();\n\t\t\t}\n\t\t} );\n\t}", "title": "" }, { "docid": "d8919f1dcb8ab928e7a567088991b651", "score": "0.5771534", "text": "function input_cb(chr){\r\n\r\n var field; //Input field to modify\r\n\r\n // Figure out focused element type\r\n if(document.activeElement.type == \"textarea\"){\r\n field = document.activeElement.innerHTML;\r\n // Look out for special characters causing trouble\r\n field = field.replace(/&amp;/g, '&').replace(/&gt;/g,'>').replace(/&lt;/g,'<');\r\n }\r\n else if (document.activeElement.type == \"text\" || document.activeElement.type == \"tel\"){field = document.activeElement.value;}\r\n else {return}\r\n\r\n var startPos = document.activeElement.selectionStart;\r\n var endPos = document.activeElement.selectionEnd;\r\n \r\n // Backspace (remove character)\r\n if(chr==$.BS){\r\n // If we want to only delete one character, else we want to delete the selected text\r\n if(startPos == endPos){startPos=startPos-1}\r\n\r\n // Create new field value\r\n field = field.substring(0, startPos)\r\n + field.substring(endPos, field.length);\r\n\r\n // Update the element\r\n if(document.activeElement.type == \"textarea\"){document.activeElement.innerHTML = field;}\r\n else if (document.activeElement.type == \"text\" || document.activeElement.type == \"tel\"){document.activeElement.value = field;}\r\n\r\n // Update cursor position\r\n document.activeElement.setSelectionRange(startPos,startPos);\r\n }\r\n\r\n // Add pressed key\r\n else {\r\n\r\n // Change key value and hide kbd if ENTER was pressed (only on alphanumeric kbd)\r\n if (chr == $.OK){\r\n document.activeElement.blur();\r\n return;\r\n }\r\n\r\n // Create new field value\r\n field = field.substring(0, startPos)\r\n + chr\r\n + field.substring(endPos, field.length);\r\n\r\n // Update the element\r\n if(document.activeElement.type == \"textarea\"){document.activeElement.innerHTML = field;}\r\n else if (document.activeElement.type == \"text\" || document.activeElement.type == \"tel\"){document.activeElement.value = field;}\r\n\r\n // Update cursor position\r\n document.activeElement.setSelectionRange(startPos+1,startPos+1);\r\n }\r\n\r\n // Trigger oninput event\r\n var event = new Event('input');\r\n document.activeElement.dispatchEvent(event);\r\n}", "title": "" }, { "docid": "d806dc10ba170b5e454f5c4f252d5b23", "score": "0.5770372", "text": "function Keyboard() {\n\t\tdocument.addEventListener(\"keydown\", onkeydown, false);\n\t\tdocument.addEventListener(\"keyup\", onkeyup, false);\n\t}", "title": "" }, { "docid": "bdaa12abdc12669846cb91b73e6ac101", "score": "0.5767144", "text": "onKeyUp(e) {}", "title": "" }, { "docid": "8637d0b4ed6a84fc9463831379e95425", "score": "0.57655025", "text": "function keyupEventListener(event) {\n var key = event.keyCode;\n\n switch (key) {\n case keys.left:\n case keys.right:\n determineOrientation(event);\n break;\n case keys.delete:\n determineDeletable(event);\n break;\n case keys.enter:\n case keys.space:\n activateTab(event.target);\n break;\n }\n }", "title": "" }, { "docid": "6560efbf6a127791f22d97de55dd78c4", "score": "0.5753863", "text": "bindEvents() {}", "title": "" }, { "docid": "9ffaad54a1c3d685e524fa40fe09063a", "score": "0.5745566", "text": "_register() \n {\n window.addEventListener(\"keydown\", this);\n window.addEventListener(\"resize\", this);\n }", "title": "" }, { "docid": "27c0730bed79121c25fc9887b809279b", "score": "0.5743776", "text": "_addKeyHandler() {\n // Keyboard.addKeyHandlers...\n }", "title": "" }, { "docid": "e8bfd7a4bcc85587cff3a425160d07d7", "score": "0.57430243", "text": "initiKeyboard() {\n\n document.addEventListener('keyup', e=>{\n \n this.playAudio();\n\n switch(e.key){\n\n case 'Escape':\n this.clearAll();\n break;\n case 'Backspace':\n this.clearEntry();\n break;\n case '+':\n case '-':\n case '*':\n case '/':\n case '%':\n this.addOperation(e.key); \n break;\n case 'Enter':\n case '=':\n this.calc();\n break;\n case '.':\n case ',':\n this.addDot();\n break;\n \n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n this.addOperation(parseInt(e.key));\n \n break; \n \n case 'c':\n if (e.ctrlKey) this.copyToClipboard();\n break;\n }\n });\n\n }", "title": "" }, { "docid": "985bb68f0abd58038e8955351d37ba24", "score": "0.5740707", "text": "bindInputBlur () {\n this.input.addEventListener('blur', this.inputBlurHandler)\n }", "title": "" }, { "docid": "5f31c3cc88d7fd297197e0441a70d92e", "score": "0.5734684", "text": "bindGlobalEvent () {\n // is input changed\n this.inputs.forEach((item) => {\n item.addEventListener('keydown', this.overwriteDefault.bind(this))\n item.addEventListener('change', this.inputChanged.bind(this))\n })\n\n // is radio clicked\n this.radios.forEach((item) => {\n Array.from(item.children).forEach(child => {\n child.addEventListener('mousedown', this.radioClicked.bind(this))\n })\n })\n\n // is expandable clicked\n this.expandable.forEach((item) => {\n this.toggleExpandable(item)\n })\n\n this.inputProp.forEach((item) => {\n item.addEventListener('keydown', this.overwriteDefault.bind(this))\n item.addEventListener('change', this.propChanged.bind(this))\n })\n }", "title": "" }, { "docid": "aaa363d4d36f0011ffad01f49afb75f0", "score": "0.57292795", "text": "function keyListener0() {\n document.dispatchEvent(new KeyboardEvent(\"keydown\", { keyCode: 81, code: \"KeyQ\" }));\n}", "title": "" }, { "docid": "f8b28b427a4fd980a0288c5a249cf9dc", "score": "0.5728466", "text": "onKeyDown(event) {\n // ignore fake IME events (emitted in IE and Chromium)\n if ( event.key === 'Dead' ) return\n // Handle custom keyboard shortcuts globally\n let custom = this.editorSession.keyboardManager.onKeydown(event)\n return custom\n }", "title": "" }, { "docid": "7ab4ef99c9a951005cadc4c4a6f0a513", "score": "0.5724715", "text": "startInput () {\n //console.log('Starting input');\n let that = this;\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 x = Math.floor(x);\n y = Math.floor(y);\n\n return { x: x, y: y };\n };\n\n let coreMovementButtonDown = function (e) {\n that.keys[e.code].pressed = true;\n\n if (e.code === 'KeyQ' && !that.cast && !that.paused && !that.checkForKeyDown()) {\n //that.initKeys();\n that.cast = true;\n that.ctx.canvas.removeEventListener(\"keydown\", coreMovementButtonDown, false);\n that.ctx.canvas.removeEventListener(\"keyup\", coreMovementButtonUp, false);\n that.readCombo(that.ctx);\n } else if (e.code === 'KeyQ' && that.cast && !that.paused) {\n that.cast = false;\n } else if (e.code === 'Escape') {\n if (that.paused === false && that.level > 0) {\n that.pauseMenu = that.makePauseMenu();\n that.addEntity(that.pauseMenu);\n //that.pauseMenu.addElementsToEntities();\n that.paused = true;\n that.tempClockTick = that.clockTick;\n that.clockTick = 0;\n } else if (that.paused === true && that.level > 0) {\n if (that.pauseMenu !== null) {\n that.pauseMenu.removal = true;\n that.pauseMenu = null;\n that.paused = false;\n that.clockTick = that.tempClockTick;\n }\n }\n }\n e.preventDefault();\n };\n\n //movements\n this.ctx.canvas.addEventListener(\"keydown\", coreMovementButtonDown, false);\n\n let coreMovementButtonUp = function (e) {\n that.keys[e.code].pressed = false;\n e.preventDefault();\n };\n\n this.ctx.canvas.addEventListener(\"keyup\", coreMovementButtonUp, false);\n\n\n //swing sword\n this.ctx.canvas.addEventListener(\"click\", function (e) {\n that.click = true;\n e.preventDefault();\n });\n\n\n this.ctx.canvas.addEventListener(\"contextmenu\", function (e) {\n e.preventDefault();\n });\n\n\n this.ctx.canvas.addEventListener(\"mousemove\", function (e) {\n that.mouse = getXandY(e);\n }, false);\n\n\n this.ctx.canvas.addEventListener(\"click\", function (e) {\n that.click = getXandY(e);\n }, false);\n\n //console.log('Input started');\n }", "title": "" }, { "docid": "308a31e59e87166c7e8fdaf2f9e40538", "score": "0.572386", "text": "handleKeyPressed() {\n\n }", "title": "" }, { "docid": "99a235cfcf61d786c81aec63c9ea7365", "score": "0.57196116", "text": "events() {\n this.openButton.on(\"click\", this.openOverlay.bind(this));\n this.closeButton.on(\"click\", this.closeOverlay.bind(this));\n $(document).on(\"keydown\", this.keyPressDispatcher.bind(this));\n this.searchField.on(\"keyup\", this.typingLogic.bind(this));\n }", "title": "" }, { "docid": "306439dc9ed4de3970843f6dfdb5599e", "score": "0.5715203", "text": "inputDown(e) {\n super.inputDown(e);\n this.inputIsDown = true;\n }", "title": "" }, { "docid": "ab4af7e5c0ae29d7a471519ddd72006a", "score": "0.57040524", "text": "function observeInputEvents() {\n observeIndentationInputEvents();\n observeMaxerrInputEvents();\n observeMaxlenInputEvents();\n observePredefInputEvents();\n }", "title": "" }, { "docid": "27c61450e0f5a63cceaa03e0e592ac08", "score": "0.57015467", "text": "keyEvents(e){\n console.log(e.code);\n switch(e.code){\n case \"Space\": \n this.toggleReading();\n break;\n case \"KeyR\": \n this.resetReader();\n break;\n case \"ArrowLeft\":\n // this.backOneFlash();\n break;\n default: console.log(\"default\");\n }\n }", "title": "" }, { "docid": "0e2f4a7a79eebad55a510e3952b6d16d", "score": "0.56996167", "text": "function inputListener(world) {\n\tdocument.addEventListener(\"keydown\", function(e){\n\t\tprocess(e.keyCode, world, false);\n\t});\n\tdocument.addEventListener(\"keyup\", function(e){\n\t\tprocess(e.keyCode, world, true);\n\t});\n\n\treturn function() {};\n}", "title": "" }, { "docid": "02382526f643aa6d67ae44dd72afd7f4", "score": "0.56825805", "text": "bindEvents() {\n\n }", "title": "" }, { "docid": "e0c601e2512156d77f0f44fa9b73f2e0", "score": "0.56818223", "text": "function keyboardHandler(evt){\r\n\r\n\tif (keyObj.keyCheck===1){\r\n\r\n\t\tswitch (evt.keyCode){\r\n\t\t\tcase 83: sKeyHandler(); break;\r\n\t\t\tcase 68: dKeyHandler(); break;\r\n\t\t}\r\n\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "eaabe4b982db3ace23e7d56cca68b554", "score": "0.5678637", "text": "function Nt(){document.addEventListener(\"click\",Mt,!0),document.addEventListener(\"touchstart\",jt,ji),window.addEventListener(\"blur\",It)}", "title": "" }, { "docid": "3602992e46a140ce912d183d082cf37f", "score": "0.5672017", "text": "function setup_html_onkeypress_listener(){\n\n\t$.hotkeys.options.filterContentEditable = false;\n\t\n\t\n\t$(document).bind('keydown', 'ctrl+a', function(){\n \t\tconsole.log(\"ctrl+a pressed down\");\n \t\t\n \t\tselect_all_text($(\"#document-holder\")[0]);\n\n \t\t/*$(\".content-area\").each(function(){\n \t\t\tthis.contentEditable = false;\n \t\t\t\n \t\t});*/\n\n \t\n\n\t});\n\t/*\n\t$(document).bind('keyup', 'ctrl+a', function(){\n \t\tconsole.log(\"ctrl+a pressed up\");\n \t\t\n \t\t$(\".content-area\").each(function(){\n \t\t\tthis.contentEditable = true;\n \t\t\t\n \t\t});\n\n \t\t\n\t});\n\n\t*/\n $('.content-area').on('selectstart', function () {\n $(document).one('mouseup', function() {\n alert(this.getSelection());\n });\n });\n \n}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.56705683", "text": "function keyUp(event) {}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.56705683", "text": "function keyUp(event) {}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.56705683", "text": "function keyUp(event) {}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.56705683", "text": "function keyUp(event) {}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.56705683", "text": "function keyUp(event) {}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.56705683", "text": "function keyUp(event) {}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.56705683", "text": "function keyUp(event) {}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.56705683", "text": "function keyUp(event) {}", "title": "" }, { "docid": "25ede39cb919e125830190f7ffd2a670", "score": "0.56634796", "text": "componentDidMount() {\r\n document.addEventListener(\"keydown\", this.handleKeyDown);\r\n document.addEventListener(\"keyup\", this.handleKeyUp);\r\n }", "title": "" }, { "docid": "4c5191165b760ab40a11fca4cbc33e08", "score": "0.56628853", "text": "function addListeners() {\n \n // Listener for Language Selector\n let langSelector = document.querySelectorAll(\".lang-selector\").forEach(element => {\n element.addEventListener(\"click\", langSelectAction)\n });\n\n // Listener for text selector\n let textSelector = document.querySelector(\".selector\");\n textSelector.addEventListener('change', textSelected);\n\n // Listener for user input (typewriting)\n let useripnut = document.querySelector(\".user-input-field\");\n useripnut.addEventListener('keypress', userTyped);\n useripnut.addEventListener('keydown', backSpace);\n\n // Listener for play stop button\n let button = document.querySelector(\".action-button\");\n button.addEventListener('click', actionButton);\n \n }", "title": "" }, { "docid": "143bf8fe9831b89e27d659c033050a8f", "score": "0.5661406", "text": "function bindKeyDownEventHandlers() {\n document.removeEventListener(\"keydown\", KeyDown.handle);\n document.addEventListener(\"keydown\", KeyDown.handle);\n }", "title": "" }, { "docid": "1b652d742f60d60bafd9cb7d583b86cb", "score": "0.56571156", "text": "function addInputListener(){\n $(\"input\").keydown(function (event){\n if(event.keyCode == 13){\n $('ul').append('<li><span><i class=\"fa fa-trash\"></i></span>'+ $(\"input\").val() + '</li>');\n addDelete();\n addCross();\n $(this).val(\"\");\n }\n });\n }// end addInputListener", "title": "" }, { "docid": "26edf45242ac7d68448e9fb6058a2cec", "score": "0.5654905", "text": "function init(){\n\tinit_player();\n\tinit_items();\n\tinit_ghosts();\n\twindow.addEventListener(\"keydown\",keydownHandler,false);\n}", "title": "" }, { "docid": "2bbef60703940efd4fc1a245fd6c4757", "score": "0.56246233", "text": "handleKeyUp(e) {}", "title": "" } ]
b8c50e793aef1dda8683f21ae82391eb
Opdracht 2 Schrijf een functie die twee strings verwacht en deze aan elkaar geplakt teruggeeft. Je mag hier geen String Object methoden voor gebruiken. Verwachte uitkomsten: "abra", "cadabra" geeft "abracadabra"
[ { "docid": "3bac002e1244b5cf5491f115c894ea7d", "score": "0.59812623", "text": "function magicString (string1, string2) {\n return string1 + string2;\n}", "title": "" } ]
[ { "docid": "3a226c1926ddb5cd75f3fc0ecd4c8e3f", "score": "0.62849975", "text": "function NewString() {\r\n}", "title": "" }, { "docid": "0a38b1e3884f06cf8ef08c1043b6ece0", "score": "0.615971", "text": "function Utils(string) {\n this.string = string\n\n this.toUpperEven = function (upper) {\n let string = \" \";\n for (let i =0; i<upper.length;i++){\n if (i%2!==0){\n string+= upper[i].toUpperCase();\n } \n else {\n string+=upper[i].toLowerCase();\n }\n }\n return string;\n }\n\n\n this.findMid = function(center){\n let string = \" \";\n for(let i=0;i<center.length; i++){\n if(center.length%2==1){\n string=center.length/2;\n return center.substring(string,string+1);\n }\n else {\n string = center.length / 2 - 1;\n return center.substring(string, string + 2)\n }\n }\n }\n \n this.letterFrequency = function(frequency){\n let string={};\n for(i=0;i<frequency.length;i++){\n let letter = frequency[i];\n if(frequency[letter]){\n frequency[letter]++;\n }\n else{\n string[letter]=1;\n }\n }\n return string;\n }\n\n this.sortLetters = function(alpha){\n return alpha.split('').sort().join('');\n }\n \n}", "title": "" }, { "docid": "d08b7b6154913486f152497da4695602", "score": "0.6091889", "text": "function FiltroStringa(stringa,campo,colore) {\r\n var indice =0;\r\n var carattere = new String();\r\n var vecchiocarattere = new String();\r\n var nuovastringa = new String();\r\n \r\n for (indice=0; indice < stringa.length; indice++) {\r\n carattere = stringa.charAt(indice);\r\n if (carattere.charCodeAt(0) != 32 || vecchiocarattere.charCodeAt(0) != 32) {\r\n if (indice == 0 \r\n || vecchiocarattere.charCodeAt(0) == 32 // spazio\r\n || vecchiocarattere.charCodeAt(0)==39 // apostrofo\r\n || vecchiocarattere.charCodeAt(0)==45 // trattino -\r\n || vecchiocarattere.charCodeAt(0)==40 //parentesi aperta\r\n )\r\n {\r\n nuovastringa += carattere.toUpperCase();\r\n } else {\r\n nuovastringa += carattere.toLowerCase();\r\n }\r\n vecchiocarattere = carattere;\r\n }\r\n }\r\n document.getElementById(campo).value=nuovastringa;\r\n document.getElementById(campo).style.background=\"white\";\r\n document.getElementById(campo).style.color=colore;\r\n \r\n if (campo=='parrocchia_battesimo') {\r\n AssegnaBattesimo('blur');\r\n }\r\n \r\n return nuovastringa;\r\n}", "title": "" }, { "docid": "9e33544ce0b99fe0110d642db3889230", "score": "0.60143757", "text": "function methodOne(str){\n return \"hello, \" + str;\n}", "title": "" }, { "docid": "e010e9e6eb72ca79bb82f2aebb157021", "score": "0.60065854", "text": "function lowerCaseStrings(/* code here */) {\n /* code here */\n}", "title": "" }, { "docid": "3f491f18b3feee0e65e1555ac8da7bfa", "score": "0.5974343", "text": "static _getRouteFromMethode(str) {\n return str.replace(/([A-Z])/g, (str, letter, index) => {\n return index === 0 ? `${letter.toLowerCase()}` : `-${letter.toLowerCase()}`;\n });\n }", "title": "" }, { "docid": "32a5c4413b02639970cfa0bf45e8fe91", "score": "0.596981", "text": "function myString(stringvalue) { //al stringvalue, cuando se haga el console.log se le da el valor. \n return stringvalue + 'Hola';\n}", "title": "" }, { "docid": "3a5ef695d808a2183c25ed7e859bac01", "score": "0.590924", "text": "function rovesciaStringa(stringa) {\n\n // A N N A\n // A N N A\n\n // ANDREA\n // A N D R E A => split('')\n // A E R D N A => reverse()\n // AERDNA => join('')\n\n // separo tutti i caratteri della stringa in un array\n var caratteri = stringa.split('');\n\n // alternativa alla funzione split()\n // var array_caratteri = [];\n // for (var i = 0; i < stringa_inziale.length; i++) {\n // var singolo_carattere = stringa_inziale.charAt(i);\n // console.log(singolo_carattere);\n // array_caratteri.push(singolo_carattere);\n // }\n // console.log(array_caratteri);\n\n // rovescio l'array di caratteri\n var caratteri_rovesciati = caratteri.reverse();\n\n // ricompongo la stringa unendo i caratteri dell'array\n var stringa_rovescia = caratteri_rovesciati.join('');\n\n // alternativa alla funzione join()\n // var stringa_finale = '';\n // for (var i = 0; i < caratteri_rovesciati.length; i++) {\n // var singolo_carattere = caratteri_rovesciati[i];\n // console.log(singolo_carattere);\n // stringa_finale += singolo_carattere;\n // }\n // console.log(stringa_finale);\n\n // restituisco il risultato dell'elaborazione\n return stringa_rovescia;\n}", "title": "" }, { "docid": "09febd96e55f05c6cd9193a5f02ebcef", "score": "0.58819884", "text": "function addString(a,b){\n\tconst fullName = a +\" \"+ b;\n\n\treturn fullName;\n}", "title": "" }, { "docid": "81462fa3472def199dc7c4695ba07ff0", "score": "0.5879784", "text": "function _String() {}", "title": "" }, { "docid": "7e39723f24f617bd6b09893b954e0a9c", "score": "0.58348054", "text": "function palabra() {\n return 'gato';\n}", "title": "" }, { "docid": "193be33b9e93fe37b1e8566a6739070b", "score": "0.5812423", "text": "function funRet1() {\n\n /*\n Skriv en metod \"superImportant\" som returnerar stjärnor och texten med stora bokstäver.\n\n Om den anropas såhär:\n\n let text = superImportant(\"Itch\");\n console.log(text);\n\n Så ska följande skrivas ut:\n\n ****** ITCH ******\n */\n\n function superImportant(someText) {\n return `****** ${someText.toUpperCase()} ******`;\n }\n\n let text = superImportant(\"atjoooo!\");\n console.log(text);\n}", "title": "" }, { "docid": "61ac43e3d247f50d3aba6afe5b9c6c84", "score": "0.58085424", "text": "ladrar(){\n return 'Waau'\n }", "title": "" }, { "docid": "6c6b2e86cdeed3939855c3478158ef5d", "score": "0.57985383", "text": "function gatherStrings(obj) {\n\n}", "title": "" }, { "docid": "132714288273376c4542ae581f5999ac", "score": "0.57825106", "text": "function warble(string){\n var result = string + \"arglebargle\";\n return result;\n}", "title": "" }, { "docid": "bcf860d162d8ad0f435c8434db316c81", "score": "0.57605475", "text": "function hello(str){\n return str;\n }", "title": "" }, { "docid": "4fe047127ef48e55e243aea7606f3084", "score": "0.57398987", "text": "function EX_12(stringA, stringB)\n\t{\n\t// INSERT YOUR CODE HERE\n\t}", "title": "" }, { "docid": "b52fbad9b64138d05b0b342143511313", "score": "0.57347894", "text": "function String() {}", "title": "" }, { "docid": "a21e98ac068193d638c9e7d56575fbf3", "score": "0.57315266", "text": "function letterMap(str, obj) {\nlet result = \"\"\nlet words = str.split(\"\")\nlet k = Object.keys(obj)\nfor(let i = 0; i < k.length; i++) {\n let char = k[i]\n if(str.includes(char)){\n newChar = getChar(char, str)\n result += newChar\n } \n}\nreturn result\n}", "title": "" }, { "docid": "49569625818654208877a96915564579", "score": "0.573028", "text": "function stringFunctions(value) {\n console.log(`.length - ${value.length}`);\n console.log(`.endsWith('World') - ${value.endsWith(\"World\")}`);\n console.log(`.startsWith('Hello') - ${value.startsWith(\"Hello\")}`);\n console.log(`.indexOf('Hello') - ${value.indexOf(\"Hello\")}`);\n console.log(value.toLowerCase()); //just like in java, returning a string, not changing the value\n console.log(value);\n\n /*\n Other Methods\n - split(string)\n - substr(number, number) //these two are different from each other\n - substring(number, number)\n - toLowerCase()\n - trim()\n - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n */\n}", "title": "" }, { "docid": "0821a451a1d05b481fd9ddf7ad16b226", "score": "0.5726875", "text": "function saludar2() {\r\n let nombreCompleto = \"Leandro Borrelli\";\r\n return `Hola ${nombreCompleto}`;\r\n}", "title": "" }, { "docid": "d5e490c792ed00550fbdaf43c010d846", "score": "0.5724268", "text": "function sampleStrings() {\n return {\n 'Add Latin 1': 'HARFBUZZ FTW',\n 'Add Latin 2': 'I used to be a coder like you until I took an ARROW in the KNEE!',\n 'Add Latin 3': 'All their equipment and instruments are alive.',\n 'Add Latin 4': 'It was going to be a lonely trip back.',\n 'Add Cyrillic 1': 'Развернувшееся зрелище и впрямь было грандиозным.',\n 'Add Cyrillic 2': 'Я дивився на шторм – неймовірно красивий і жахаючий.',\n 'Add Vietnamese 1': 'Vật thể giống một mảng cỏ màu tím, rộng năm foot vuông, đang di chuyển trên cát về phía họ. Khi nó đến gần, anh thấy không phải là cỏ; không có lá mà chỉ là chùm rễ màu tím. Chùm rễ đang xoay tròn như những nan hoa của bánh xe không vành.',\n 'Add Vietnamese 2': 'Đó là hành trình tuyệt vời. Tôi gặp nhiều người tôi quý mến ngay từ đầu nhưng cũng có người tôi không muốn gặp lại; họ đều phải bảo vệ Redoubt. Ở mọi nơi tôi đặt chân tới, chúng tôi đi nhiều và có rất nhiều người để gặp nhưng thời gian thì có hạn.',\n 'Add Japanese 1': '各部位を正確に作るには時間がかかるので、当初の意図とは異なるが、巨大な人体を作ることにした。高さは約 8 フィートで、これに釣り合う体格だ。これを決断し、数か月にわたって材料を集め整理した後、作業を開始した。',\n 'Add Japanese 2': '5 平方フィート程度の紫色の草むらのようなものが、砂地を横切ってこちらに向かってきた。近くから見ると草ではないようだった。葉はなく紫色の根だけがある。その根が回転し、小さな草の集まりがそれぞれ縁のない車輪のようだった。'\n };\n }", "title": "" }, { "docid": "dd3531fdc8974f0bf039b3c6537e5018", "score": "0.57210255", "text": "function sc_string() {\n for (var i = 0; i < arguments.length; i++)\n\targuments[i] = arguments[i].val;\n return \"\".concat.apply(\"\", arguments);\n}", "title": "" }, { "docid": "6a2c6d8ee6254ac4f7e0deff4940d96e", "score": "0.56919587", "text": "function strungOut2(strString, strSubString) {\n\tlet newString2 = {};\n\tnewString2.original = strString;\n\tnewString2.getUpper = function getUpper() {\n\t\treturn strString.toUpperCase();\n\t}\n\tnewString2.getIndex = function getIndex() {\n\t\treturn strString.indexOf(strSubString);\n\t}\n\t//consider whether you want to use literal or object notation\n\n\t//return string information object\n\treturn newString2;\n}", "title": "" }, { "docid": "586e7a44f6936d591e330588efad63a2", "score": "0.56748205", "text": "myTestFunction1(str){\r\n return str;\r\n\r\n }", "title": "" }, { "docid": "2fc4f2a895af5772c032139a31562b2e", "score": "0.56642085", "text": "function iPutTheFunIn(string){\n\n var firstSlice = \"\";\n\n var seconSlice = \"\";\n\n var newWord = \"\";\n\n firstSlice = string.slice(0, string.length/2);\n\n secondSlice = string.slice(string.length/2);\n\n newWord = firstSlice + \"fun\" + secondSlice;\n\n return newWord;\n}", "title": "" }, { "docid": "cbe06934cf5270e3734464333df03bd1", "score": "0.5659982", "text": "function LetterChanges(str) {\n\n return str\n}", "title": "" }, { "docid": "cf011ad9344e7ae1f8ba55e0c9f7b148", "score": "0.5652778", "text": "static fStr3(x) {\nreturn this.fStr(x, 3);\n}", "title": "" }, { "docid": "cf011ad9344e7ae1f8ba55e0c9f7b148", "score": "0.5652778", "text": "static fStr3(x) {\nreturn this.fStr(x, 3);\n}", "title": "" }, { "docid": "1448c85697d357d0e0d36600503375ca", "score": "0.5619595", "text": "function str_val(str) {\n\n \n}", "title": "" }, { "docid": "066160b0b051138ba97979feff46cec7", "score": "0.5610036", "text": "static myReplace(str, toReplace, withStr) {\n\n let firstLetter = withStr.charAt(0).toLowerCase();\n if(toReplace.charAt(0) == toReplace.charAt(0).toUpperCase()) {\n firstLetter = withStr.charAt(0).toUpperCase();\n } \n withStr = firstLetter + withStr.slice(1);\n\n return str.replace(toReplace, withStr);\n\n }", "title": "" }, { "docid": "7591998bd49bd258a619032f81aabf25", "score": "0.559755", "text": "static SetString() {}", "title": "" }, { "docid": "5a106ad9b93227f2ee84a0b0317f188e", "score": "0.55911666", "text": "function saludo2(){\n return \"Hola buen dia 888\";\n }", "title": "" }, { "docid": "3560bc0ed1c4938e62c4a7331bd74a89", "score": "0.5562481", "text": "function saludar(){\n return 'hola'\n}", "title": "" }, { "docid": "09137772002ce5bd3b8bf37b4ebe2a45", "score": "0.55586493", "text": "function subFunc(obj, strng, r) {\n // loop through the string and parse each character\n for (i in strng) {\n if ('f+-'.includes(strng[i])) {\n vectorAdd(obj, strng[i], r);\n }\n else {\n console.log(`No function for character ${strng[i]}`);\n }\n }\n}", "title": "" }, { "docid": "857644a37779e5cad963853c788ffb2b", "score": "0.55550444", "text": "function get_my_name(name){\n return name + \" Ubanell\";\n}", "title": "" }, { "docid": "59e980394801319ca5242530c3eb0006", "score": "0.5538888", "text": "function f(str) {\n\n}", "title": "" }, { "docid": "406970b4ad1578ed3f262925d7618ae3", "score": "0.5532732", "text": "function StringHelp() {\n}", "title": "" }, { "docid": "fcc4791df9f1ee65fef828b4ae5ac9ec", "score": "0.5531739", "text": "function InString() {\r\n}", "title": "" }, { "docid": "38ca86a07c2eb36189b5d53c162ee58e", "score": "0.5528537", "text": "function getVardas() {\n return \"Tadas\";\n}", "title": "" }, { "docid": "9e14b8bf5c228723bbedbd0a4fec31ff", "score": "0.5516223", "text": "function UF_MY_FUNCTION(argstrMyString1, argstrMyString2)\n{\n\n var strMyString = argstrMyString1 + \" - \" + argstrMyString2;\n\n alert(\"My function was called. It added two strings together.\");\n\n return(strMyString); \n}", "title": "" }, { "docid": "30e4b16cd5ae92daef3b4537a229b48f", "score": "0.55092865", "text": "function hai(){\n\treturn \"haiiii\"\n}", "title": "" }, { "docid": "300b51ebf2c4d4481a4429dd96054deb", "score": "0.55086094", "text": "function rovescia(stringa) {\r\n var stringaReverse = '';\r\n\r\n // Giro contrario, partendo dall'ultima lettera\r\n // concateno ogni lettera in una nuova variabile di tipo striga\r\n for (var i = (stringa.length - 1); i >=0; i--) {\r\n stringaReverse += stringa[i];\r\n }\r\n\r\n return stringaReverse;\r\n}", "title": "" }, { "docid": "07e72b03c8e183bd4e29876e5157b126", "score": "0.5503784", "text": "function replaceStr(firstString, secondString) {\n var replaceString = firstString.replace(\"Vasile\", secondString);\n console.log(replaceString);\n}", "title": "" }, { "docid": "dfb6122f410eddba8ccd801ac7e8367e", "score": "0.549496", "text": "function letterChanges(str) {}", "title": "" }, { "docid": "dfb6122f410eddba8ccd801ac7e8367e", "score": "0.549496", "text": "function letterChanges(str) {}", "title": "" }, { "docid": "dfb6122f410eddba8ccd801ac7e8367e", "score": "0.549496", "text": "function letterChanges(str) {}", "title": "" }, { "docid": "1f147c8d8831a5616066f24246b9fd3f", "score": "0.54938024", "text": "getFourCCStr() {\nreturn FourCC.fourCCStr(this.fourCCName);\n}", "title": "" }, { "docid": "5c37f29fca93601dca192b5775783497", "score": "0.5491336", "text": "function marks2ndFunction(string) {\n console.log(string.toUpperCase());// use the toUpperCase() method on the string data type\n}", "title": "" }, { "docid": "09dd3ae8d0e7bd845f92306efb8599bf", "score": "0.5486707", "text": "function addS(word) {\n\n}", "title": "" }, { "docid": "37550dea6a8f80c38426fe0e1e98fb4c", "score": "0.54849017", "text": "function SimpleSymbols(str) {\n\n // code goes here\n return str;\n\n}", "title": "" }, { "docid": "8167f603f177082e070ee8c600911559", "score": "0.54651505", "text": "function returnStr(aString) {\n return aString;\n}", "title": "" }, { "docid": "67014ffed39d081f2242f065f4233ee6", "score": "0.5465101", "text": "function funname() {} //literals", "title": "" }, { "docid": "9bc59796da9dae3decc81ac2858f542c", "score": "0.54529655", "text": "function replaceLetters(str1 , str2 , str3){\n let newStr1 = ``\n for(let i = 0 ; i < str1.length ; i++){\n if(str1[i] !== str2){\n newStr1 += str1[i] \n } else {\n newStr1 += str3\n }\n }\n return newStr1;\n}", "title": "" }, { "docid": "c855a5177dabc79b269e1ad9df0befc1", "score": "0.54477036", "text": "function saludar(nombre) {\n return \"Hola, \" + nombre;\n}", "title": "" }, { "docid": "eb40de4f53fa25506151746832b54399", "score": "0.54389286", "text": "function stringWord() {\n for (var x = 0; x < letterObjects.length; x++) {\n var strings = [];\n var newStrings = letterObjects[x].guessLetter();\n strings.push(newStrings);\n // console.log(strings.join(\" \"));\n }\n }", "title": "" }, { "docid": "15a13063450efed5878582518d7de92b", "score": "0.5431445", "text": "function CrearCadOracion(cadena) {\n var cad = cadena.charAt(0).toUpperCase() + cadena.toLowerCase().slice(1);\n return cad;\n}", "title": "" }, { "docid": "a854e937f08e0783c0c12be31a1ff993", "score": "0.5431124", "text": "function iPutTheFunIn (str) {\n var newStr = ''\n for (var i = 0; i < str.length; i++) {\n if (i === (str.length / 2)) {\n newStr = newStr + 'fun'\n }\n newStr = newStr + str[i]\n }\n return newStr\n}", "title": "" }, { "docid": "3dd2d5ce80d28f3c2dde061e00c9de5a", "score": "0.542907", "text": "function stringReturnOne() {\n return \"This is string 1\"\n}", "title": "" }, { "docid": "034f4f048b250d500904d6bcf7c8a078", "score": "0.54244953", "text": "function alterJSFunction(fn_str, to_add_txt) {\n let _fn_str = fn_str;\n const _fn_params = _fn_str.substring(_fn_str.indexOf(\"(\")+1, _fn_str.indexOf(\")\"));\n\n _fn_str = _fn_str.slice(_fn_str.indexOf(\"{\") + 1, _fn_str.lastIndexOf(\"}\"));\n _fn_str = _fn_str.replace( _fn_str,to_add_txt+_fn_str)\n\n const _fn = new Function(_fn_params, _fn_str);\n return _fn;\n}", "title": "" }, { "docid": "04057a8341c5c8bac454a7df1fecce0d", "score": "0.5418628", "text": "function replacer(str, obj, p1, name) {\n return Object.prototype.hasOwnProperty.call(obj, p1) ? (name + p1) : str;\n }", "title": "" }, { "docid": "9a7e38799888075de9501907eb9d8e20", "score": "0.54125065", "text": "function masti(){\r\n return \" Helo India\";\r\n}", "title": "" }, { "docid": "1a9d34a9bc0e3be158af68905ad57a40", "score": "0.540699", "text": "function obtenerNombre(){\n return \"Dante\";\n}", "title": "" }, { "docid": "cb4fb7143755e9c86064b733f73fb659", "score": "0.5406911", "text": "function reverseString(stringa) {\n\n}", "title": "" }, { "docid": "c7645a1b9988cf964664c1c148d819c6", "score": "0.5402452", "text": "function MaysPrimera(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "title": "" }, { "docid": "ac593c68cdb0dedc93875533591ffdb2", "score": "0.53808993", "text": "function stringIsUnique(){\n\t\n}", "title": "" }, { "docid": "2dd218ab1bc034759e47be2787460ae4", "score": "0.5379577", "text": "function salut(){\r\n\treturn \"Salut !\";\r\n}", "title": "" }, { "docid": "4dba03dce4e5300c0847affa7049a88a", "score": "0.53785676", "text": "function Organigrama(){\n}", "title": "" }, { "docid": "fc87ed05626135c4f584a28cadbc1153", "score": "0.53755254", "text": "function twoStrings(firstName, lastName) {\n return firstName + lastName;\n}", "title": "" }, { "docid": "895db79e62c2583154df90a76b05766f", "score": "0.5369381", "text": "function fooBar(a){ return \"\"+a}", "title": "" }, { "docid": "fd0c31edc55e01648ca8db759444267e", "score": "0.5366325", "text": "function iPutTheFunIn(string){\n var halfStringLength = (string.length/2)\n var leftHalf = string.substring(0, halfStringLength)//identify the left half of the string\n var funWord = (leftHalf+\"fun\"+string.substring(halfStringLength,string.length))//stick fun in the middle\n return funWord\n}", "title": "" }, { "docid": "37e7126917d4681bd7adbe72f1ed9a0c", "score": "0.53642374", "text": "function tuna(stuff) {\n return stuff + \"2\"\n}", "title": "" }, { "docid": "b1746273eb1591a4ccd839ebbaccd297", "score": "0.5363777", "text": "function MyNameE() {\n return \"Carles\";\n}", "title": "" }, { "docid": "7495734f07c9a3be28f86438f2f45efc", "score": "0.53615624", "text": "function myName2(name){\n\treturn \"Hello \" + name + \". \";\n}", "title": "" }, { "docid": "0faf9395b8258a1c1c946a114ea1453b", "score": "0.53507197", "text": "function MainFunction()\n{\n 'use strict';\n\n console.log('ToWeirdCase first result is:');\n console.log('String' + ' --> ' + ToWeirdCase('String'));\n console.log('');\n\n console.log('ToWeirdCase second result is:');\n console.log('weird string case' + ' --> ' + ToWeirdCase('weird string case'));\n console.log('');\n\n}", "title": "" }, { "docid": "451ca16dd9a3c2cfbd14768e7a1e1959", "score": "0.53496224", "text": "function strTofunc(str){\n if(/^\\s*$/.test(str)){\n return false;\n }\n if(document.getElementById(str)){\n return false;\n }\n var script=$(\"<script text='text/javascript' id=\"+str+\"></script>\");\n script.html(str+\"()\");\n script.appendTo($(\"html\"));\n }", "title": "" }, { "docid": "7852ed1d690b3d705cb24ce1193df301", "score": "0.5347604", "text": "static beatufierString(k, v, avcs){\n var str=v;\n\n str=str.toLowerCase();\n str=str.replace(/â|ä|à|á|@/gi, \"a\");\n str=str.replace(/ê|ë|è|é|€/gi, \"e\");\n str=str.replace(/î|ï|ì|í/gi, \"i\");\n str=str.replace(/ô|ö|ò|ó/gi, \"o\");\n str=str.replace(/û|ü|ù|ú/gi, \"u\");\n \n return str;\n }", "title": "" }, { "docid": "f57f214d4f1c706e37d78a13f85d2446", "score": "0.5345117", "text": "function nombreFuncion(parametro){\n return \"regresan algo\"\n}", "title": "" }, { "docid": "aad9c42eb5822bd300a4b58f0138f545", "score": "0.53444827", "text": "function SimpleSymbols(str) { \n}", "title": "" }, { "docid": "f91da0813d0e5f0ea83b90dbc95597a3", "score": "0.53397834", "text": "function reverseString(whoseThat){ //function reverserString\nlet array = whoseThat.split('') //creating an array of whoseThat (splits the word rockstar into separate letters)\nreturn array.reverse('').join ('') //the reverse reverses the letters of rockstar and join joins the letters back together to create the word 'ratskcor'\n}", "title": "" }, { "docid": "82c908f79df1ca2257c1b3949f71e0b1", "score": "0.53393126", "text": "function workOnStrings(a,b){\n let cc=x=>x==x.toLowerCase()?x.toUpperCase():x.toLowerCase(), arra=a.split(''), arrb=b.split(''), r, res;\n res = arra.map(x=>{r=new RegExp(x,'gi'); return (b.match(r)||[]).length%2?cc(x):x}).join('');\n res += arrb.map(x=>{r=new RegExp(x,'gi'); return (a.match(r)||[]).length%2?cc(x):x}).join('');\n return res;\n}", "title": "" }, { "docid": "543d4c0950dffb35a13e08f41e43368b", "score": "0.5336727", "text": "function mutatedStr(str) {\n let firstChar = (str.slice(0,1));\n firstChar.toLowerCase();\n let lastChar = (str.slice(-1));\n lastChar.toUpperCase();\n let newString = lastChar + str.slice(1,-1) + firstChar;\n console.log(newString);\n}", "title": "" }, { "docid": "e0c7087c68513c601905255b1b339aeb", "score": "0.5333956", "text": "function enhance_string_like_python (){\n\tif(typeof(String.prototype.strip) === \"undefined\")\n\t{\n\t\tString.prototype.strip = function() \n\t\t{\n\t\t\treturn String(this).replace(/^\\s+|\\s+$/g, '');\n\t\t};\n\t};\n\tif(typeof(String.prototype.join) === \"undefined\")\n\t{\n\t\tString.prototype.join = function(set,connector) \n\t\t{\n\t\t\tif (connector == null) connector='';\n\t\t\toutput = String(this);\n\t\t\tfor (i in set) output+=set[i]+connector;\n\t\t\treturn output.slice(0,output.length-connector.length);\n\t\t};\n\t};\n\tif(typeof(String.prototype.find) === \"undefined\")\n\t{\n\t\tString.prototype.find = function(for_what) \n\t\t{\n\t\t\tstr = String(this);\n\t\t\tresult=str.indexOf(for_what);\n\t\t\tif (result==-1) result=str.length;\n\t\t\treturn result;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "60a0f994db5eb5d0aec9a70890c2ce09", "score": "0.533177", "text": "function abbreviation(a, b) {\n // Write your code here\n return a+b\n\n}", "title": "" }, { "docid": "09c7e35e301deed0d62e7f8ca8dbcaa2", "score": "0.5330023", "text": "function strungOut(strString, strSubString) {\n\tvar newString = {}\n\tnewString.original = strString;\n\tnewString.caps = strString.toUpperCase();\n\tnewString.subIndex = strString.indexOf(strSubString);\n\t//consider whether you want to use literal or object notation\n\n\t//return string information object\n\treturn newString;\n}", "title": "" }, { "docid": "fdd34a54a407b5ebd2b8c2fe1f191382", "score": "0.5323775", "text": "function retStr() { \n return \"hello world!!!\" ;\n }", "title": "" }, { "docid": "3ee19bebdd4132cc4c818142244fef14", "score": "0.53230625", "text": "function printUsername(fn) {\n return fn(\"biggaji\");\n}", "title": "" }, { "docid": "d7befc63295f89b120a726bb9427759f", "score": "0.5320248", "text": "function halo() {\n return '\"Halo Sanbers!\"';\n}", "title": "" }, { "docid": "554fb792ffb5bbce6dfa48404bfd0ed3", "score": "0.530276", "text": "function returnString(str) {\nconst rs= 'i am returning' + str ;\n return rs;\n}", "title": "" }, { "docid": "d712258b6018f587497f38c085d36fe0", "score": "0.53007114", "text": "function getName() {\n return \"Hello my name is Arief muhamad\";\n}", "title": "" }, { "docid": "983319e61e08dd3892b3657bc132fc0d", "score": "0.5291562", "text": "function greeter (greet){\r\n greet('rahul');\r\n\r\n}", "title": "" }, { "docid": "3a7e8ead52d73dc4613a0d99ac6be7aa", "score": "0.5288332", "text": "function ucFirst(str) {\n\n }", "title": "" }, { "docid": "4dcdccc6ffc47749bcff2d70491a0b2a", "score": "0.5286997", "text": "function activar_batiseñal() {\n return \"activada\";\n}", "title": "" }, { "docid": "e8c58a1dff715f408fdaf0cf22d84999", "score": "0.528643", "text": "function fazerSuco(fruta1, fruta2){\n return 'suco de: ' + fruta1+fruta2\n}", "title": "" }, { "docid": "141a5dcbae5156de0a45b8f05a0ab364", "score": "0.52861065", "text": "function func9(str) {\r\n return str\r\n .split(\"\")\r\n .map(char =>\r\n char == char.toUpperCase() ? char.toLowerCase() : char.toUpperCase()\r\n )\r\n .join(\"\");\r\n}", "title": "" }, { "docid": "d8f16db252ff9f34c702e4d7d7c07b59", "score": "0.5282411", "text": "function newFunction() {\n if (ben[0] === \"B\") {\n Bnames = ben + \" \" + Bnames;\n }\n\n if (emma[0] === \"B\") {\n Bnames = emma + \" \" + Bnames;\n }\n\n if (bolu[0] === \"B\") {\n Bnames = bolu + \" \" + Bnames;\n }\n}", "title": "" }, { "docid": "3060bc0a0b6a853bad70d00a7ade7953", "score": "0.5278849", "text": "function pyString(string1) {\n var firstTwo = string1.slice(0,2)\n if (firstTwo.toUpperCase() !== \"PY\") {\n string1 = \"Py\" + string1\n } else {\n string1 = string1\n }\n console.log(string1)\n}", "title": "" }, { "docid": "0e86cfcfd673d284e6f76e95c7c36370", "score": "0.52768946", "text": "function myName6(name){\n\treturn name;\n}", "title": "" }, { "docid": "ae4a286a518e76899f9eaf57f2ee2055", "score": "0.52746624", "text": "function func(){\n return `${this.name}(${this.type}) - ${this.age}`;\n}", "title": "" }, { "docid": "a5cf9bac1ff22a1a833720fe3852a8ec", "score": "0.5274537", "text": "function exOh(str)\n{\n // Function code goes here\n // Don't forget to return something!\n}", "title": "" } ]
fc364daecac7fc22c25499ef2ac3285b
can be assumed as an object of the FChatClient class
[ { "docid": "e006e18a65ad1034f18f9e77a65c4706", "score": "0.0", "text": "function onDisconnected(code, message) {\n this.emit('disconnected', code, message);\n}", "title": "" } ]
[ { "docid": "5e2d6d6a94cc4c3db0f4a7d47257b948", "score": "0.68603325", "text": "function ChatClient(){\r\n\tthis.url=\"\";\r\n\tthis.connection = null;\r\n}", "title": "" }, { "docid": "29e250c9f24ce3c84faa6cde418adf88", "score": "0.67421746", "text": "function KangoMessageClient(){}", "title": "" }, { "docid": "5f5796dd7af4b340ad7e21f074e5f317", "score": "0.6713469", "text": "function ChatManager() {\n\t// Configuration interne\n\tthis.clientName = 'EasyChat';\t\t// Nom du client\n\tthis.majorVersion = 0;\t\t\t\t// Version majeur du client\n\tthis.minorVersion = 4;\t\t\t\t// Version mineur du client\n\tthis.patchVersion = 1;\t\t\t\t// Version du patch du client\n\tthis.protocolVersion = '092';\t\t// Version du protocole\n\n\t// API\n\tthis.api = null;\t\t\t\t\t// Instance de ChatAPI\n\n\t// Gestion des instances\n\tthis.rooms = [];\t\t\t\t\t// Tableau des instances de salles du chat\n\tthis.activeRoom = false;\t\t\t// Référence de l'instance de salle active\n\tthis.mainRoom = null;\t\t\t\t// Référence de la salle principale\n\tthis.myself = false;\t\t\t\t// Pseudo de l'utiliateur en cours\n\tthis.myselfUser = false;\t\t\t// Référence de l'objet ChatUser de l'utilisateur en cours\n\tthis.follow = true;\t\t\t\t\t// Indique si le chat est en état de recevoir des messages (connecté, pas dans un menu d'options...)\n\n\t// Attributs Serveur\n\tthis.distantServer = null;\t\t\t// Instance du WebSocket\n\tthis.localServer = null;\t\t\t// Instance du serveur de message local\n\tthis.online = false;\t\t\t\t// Indique si la chat à connecté à son websocket\n\n\t// Paramètres\n\tthis.config = null;\t\t\t\t\t// Objet de configuration personnel de l'utilisateur (stocké en cookie)\n\tthis.defaultConfig = {\t\t\t\t// Configuration du chat par défaut, tout les paramètres non présent dans config seront utilisé\n\t\tplaySounds: true,\t\t\t\t\t// Jouer les sons du chat\n\t\tplayOnline: true,\t\t\t\t\t// Jouer un son lors d'une entrée dans le chat\n\t\tplayOffline: true,\t\t\t\t\t// Jouer un son lors d'une sortie dans le chat\n\t\tplayHint: true,\t\t\t\t\t\t// Jouer un son lors de la réception d'un message\n\t\tplayOnlyPrivate: false,\t\t\t\t// Ne jouer les sons que pour les discussions privées\n\n\t\tsoundVolume: 50,\t\t\t\t\t// Volume des sons (de 0 à 100)\n\t\tAFKTime: 2,\t\t\t\t\t\t\t// Temps en minute pour qu'un utilisateur soit déclarer absent\n\n\t\tpseudoHighlight: true,\t\t\t\t// Active la surbrillance des pseudos dans les messages\n\t\tprivateAutoOpen: true,\t\t\t\t// Ouvre automatique la discussion privée lors de la réception d'un message privé\n\t\thideAutoMsg: false,\t\t\t\t\t// N'affiche pas les messages générés automatiquement\n\t\thidePersoMsg: false,\t\t\t\t// N'affiche pas les messages personnalisé du serveur de message local\n\t\thideNotification: false,\t\t\t// Masque les notifications\n\n\t\tsavePseudo: true,\t\t\t\t\t// Mémorise le pseudo de l'utilisateur en cours\n\t\tautoLogin: true \t\t\t\t\t// Se connecte automatiquement lors du chargement du chat si le cookie d'authentification est présent\n\t};\n\n\tthis.authInfos = null;\t\t\t\t// Informations d'authentification de l'utilisateur\n\n\tthis.UI = null;\t\t\t\t\t\t// Instance de l'objet ChatUserInterface\n\n\tthis.locked = false;\t\t\t\t// Indique si la soumission d'un message au chat est authorisé\n\tthis.lockedInterval = 5000;\t\t\t// Délais de déverouillage (en millisecondes) du chat après la soumission d'un message\n}", "title": "" }, { "docid": "4d6a965474a9251730ad516f14787325", "score": "0.6674139", "text": "function ChatClient( config ) {\n\tthis.commands = {};\n}", "title": "" }, { "docid": "24dca06f384fb45dfa3c422405876ccc", "score": "0.6574147", "text": "function setupChat() {\n}", "title": "" }, { "docid": "64e4f879ee20f0de09e4aa1ce77f1765", "score": "0.65085065", "text": "function newChat(chat) {\n // we need to parse the message to find out which client to forward it to\n try {\n var chatobj = JSON.parse(chat);\n\n if ('chat' in chatobj && chatobj.chat.clientid in connections) {\n connections[chatobj.chat.clientid].write(chat);\n }\n } catch (e) {\n console.log(e);\n return;\n }\n}", "title": "" }, { "docid": "a8f6cc5a318fb0a24ed4b5cde4d9849a", "score": "0.6459638", "text": "function chatObj() {\n this.input = document.getElementById('m');\n this.session = new SessionModule('chat');\n this.text = null;\n this.massages = null;\n this.message = null;\n this.firstLi = null;\n this.user = null;\n this.users = null;\n this.nameUser = null;\n this.closeButton = null;\n this.openButton = null;\n this.minButton = null;\n this.name = '';\n\n this.data = {\n name: '',\n massage: '',\n list: [],\n status: '',\n };\n\n var self = this;\n\n this.session.getList(function(list) {\n self.data.list = list;\n // покажем ему список всех клиентов\n list.forEach(function(user) {\n // добавь клиента в список\n self.addUserList(user.id, user.name);\n });\n });\n }", "title": "" }, { "docid": "bd1f122e1cd9c690a1d4242f40cee99c", "score": "0.641362", "text": "chat (message)\n {\n chat(message);\n }", "title": "" }, { "docid": "1e68021642070768913b239289359466", "score": "0.6410963", "text": "function Chat(_nombre,_image,_ultimoMensaje, _hora){\n \n this.nombre = _nombre;\n this.imageURL = _image;\n this.ultimoMensaje = _ultimoMensaje;\n this.horaUltimoMensaje = _hora;\n /*this.contiene = function(_buscar){\n this.nombre.search(\"\")\n }*/ \n}", "title": "" }, { "docid": "91fc91c5c7f48c2392f091f317e4a79e", "score": "0.6333503", "text": "function Chat(aWindow, aUsername){\n\n this.aDiv = aWindow.nextElementSibling;\n this.address = \"ws://vhost3.lnu.se:20080/socket/\";\n this.aKey = \"eDBE76deU7L0H9mEBgxUKVR0VCnq0XBd\";\n this.wSocket = null;\n this.aUsername = aUsername;\n\n}", "title": "" }, { "docid": "4e0f84e6fb0e46bf1e738395a9e8c6a4", "score": "0.63009644", "text": "constructor(chat_id){\n this.id = Room.createCode();\n Room.roomAdd(this.id, this);\n this.usersmax = 10;\n this.users = [];\n this.oldmessages = [];\n this.messages = [];\n\n // GREET\n var message = new Message_JS('Room created', this.id, \"text\");\n this.oldmessages.push(message)\n\n // CHECK IF ROOM EXISTS\n this._id = chat_id\n this.load();\n }", "title": "" }, { "docid": "42aa30dd5e67e9941f333d0521baf4be", "score": "0.627021", "text": "function Conversation() {}", "title": "" }, { "docid": "9071c413a576a873c77de7000945ead5", "score": "0.6267092", "text": "function Chat()\n{\n\tthis.nombre = \" \";\n\tthis.gente= [];\n\tthis.mensajes = [];\n\tthis.chatImagen = \" \";\n}", "title": "" }, { "docid": "650ae1078c8c0d858c57d5c2d789604f", "score": "0.6252594", "text": "function Chat() {\n\n /**\n * ### Chat.chatEvent\n *\n * The suffix used to fire chat events\n *\n * Default: 'CHAT'\n */\n this.chatEvent = null;\n\n /**\n * ### Chat.stats\n *\n * Some basic statistics about message counts\n */\n this.stats = {\n received: 0,\n sent: 0,\n unread: 0\n };\n\n /**\n * ### Chat.submitButton\n *\n * Button to send a text to server\n *\n * @see Chat.useSubmitButton\n */\n this.submitButton = null;\n\n /**\n * ### Chat.useSubmitButton\n *\n * If TRUE, a button is added to send messages\n *\n * By default, this is TRUE on mobile devices.\n *\n * @see Chat.submitButton\n * @see Chat.receiverOnly\n */\n this.useSubmitButton = null;\n\n /**\n * ### Chat.useSubmitButton\n *\n * If TRUE, pressing ENTER sends the msg\n *\n * By default, TRUE\n *\n * @see Chat.submitButton\n * @see Chat.receiverOnly\n */\n this.useSubmitEnter = null;\n\n /**\n * ### Chat.receiverOnly\n *\n * If TRUE, users cannot send messages (no textarea and submit button)\n *\n * @see Chat.textarea\n */\n this.receiverOnly = false;\n\n /**\n * ### Chat.storeMsgs\n *\n * If TRUE, a copy of sent and received messages is stored in db\n *\n * @see Chat.db\n */\n this.storeMsgs = false;\n\n /**\n * ### Chat.db\n *\n * An NDDB database for storing incoming and outgoing messages\n *\n * @see Chat.storeMsgs\n */\n this.db = null;\n\n /**\n * ### Chat.chatDiv\n *\n * The DIV wherein to display the chat\n */\n this.chatDiv = null;\n\n /**\n * ### Chat.textarea\n *\n * The textarea wherein to write and read\n */\n this.textarea = null;\n\n /**\n * ### Chat.initialMsg\n *\n * An object with an initial msg and the id of sender (if not self)\n *\n * Example:\n *\n * ```\n * {\n * id: '1234', // Optional, add only this is an 'incoming' msg.\n * msg: 'the text'\n * }\n */\n this.initialMsg = null;\n\n /**\n * ### Chat.recipientsIds\n *\n * Array of ids of current recipients of messages\n */\n this.recipientsIds = null;\n\n /**\n * ### Chat.recipientsIdsQuitted\n *\n * Array of ids of recipients that have previously quitted the chat\n */\n this.recipientsIdsQuitted = null;\n\n /**\n * ### Chat.senderToNameMap\n *\n * Map sender id (msg.from) to display name\n *\n * Note: The 'from' field of a message can be different\n * from the 'to' field of its reply (e.g., for MONITOR)\n */\n this.senderToNameMap = null;\n\n /**\n * ### Chat.recipientToNameMap\n *\n * Map recipient id (msg.to) to display name\n */\n this.recipientToNameMap = null;\n\n /**\n * ### Chat.senderToRecipientMap\n *\n * Map sender id (msg.from) to recipient id (msg.to)\n */\n this.senderToRecipientMap = null;\n\n /**\n * ### Chat.recipientToSenderMap\n *\n * Map recipient id (msg.to) to sender id (msg.from)\n */\n this.recipientToSenderMap = null;\n\n /**\n * ### Chat.showIsTyping\n *\n * TRUE, if \"is typing\" notice is shown\n */\n this.showIsTyping = null;\n\n /**\n * ### Chat.amTypingTimeout\n *\n * Timeout to send an own \"isTyping\" notification\n *\n * Timeout is added as soon as the user start typing, cleared when\n * a message is sent.\n */\n this.amTypingTimeout = null;\n\n /**\n * ### Chat.isTypingTimeouts\n *\n * Object containing timeouts for all participants currently typing\n *\n * A new timeout is added when an IS_TYPING msg is received and\n * cleared when a msg arrives or at expiration.\n */\n this.isTypingTimeouts = {};\n\n /**\n * ### Chat.isTypingDivs\n *\n * Object containing divs where \"is typing\" is diplayed\n *\n * Once created\n */\n this.isTypingDivs = {};\n\n /**\n * ### Chat.preprocessMsg\n *\n * A function that process the msg before being displayed\n *\n * It does not preprocess the initial message\n * and \"is typing\" notifications.\n *\n * Example:\n *\n * ```js\n * function(data, code) {\n * data.msg += '!';\n * }\n * ```\n */\n this.preprocessMsg = null;\n\n }", "title": "" }, { "docid": "650ae1078c8c0d858c57d5c2d789604f", "score": "0.6252594", "text": "function Chat() {\n\n /**\n * ### Chat.chatEvent\n *\n * The suffix used to fire chat events\n *\n * Default: 'CHAT'\n */\n this.chatEvent = null;\n\n /**\n * ### Chat.stats\n *\n * Some basic statistics about message counts\n */\n this.stats = {\n received: 0,\n sent: 0,\n unread: 0\n };\n\n /**\n * ### Chat.submitButton\n *\n * Button to send a text to server\n *\n * @see Chat.useSubmitButton\n */\n this.submitButton = null;\n\n /**\n * ### Chat.useSubmitButton\n *\n * If TRUE, a button is added to send messages\n *\n * By default, this is TRUE on mobile devices.\n *\n * @see Chat.submitButton\n * @see Chat.receiverOnly\n */\n this.useSubmitButton = null;\n\n /**\n * ### Chat.useSubmitButton\n *\n * If TRUE, pressing ENTER sends the msg\n *\n * By default, TRUE\n *\n * @see Chat.submitButton\n * @see Chat.receiverOnly\n */\n this.useSubmitEnter = null;\n\n /**\n * ### Chat.receiverOnly\n *\n * If TRUE, users cannot send messages (no textarea and submit button)\n *\n * @see Chat.textarea\n */\n this.receiverOnly = false;\n\n /**\n * ### Chat.storeMsgs\n *\n * If TRUE, a copy of sent and received messages is stored in db\n *\n * @see Chat.db\n */\n this.storeMsgs = false;\n\n /**\n * ### Chat.db\n *\n * An NDDB database for storing incoming and outgoing messages\n *\n * @see Chat.storeMsgs\n */\n this.db = null;\n\n /**\n * ### Chat.chatDiv\n *\n * The DIV wherein to display the chat\n */\n this.chatDiv = null;\n\n /**\n * ### Chat.textarea\n *\n * The textarea wherein to write and read\n */\n this.textarea = null;\n\n /**\n * ### Chat.initialMsg\n *\n * An object with an initial msg and the id of sender (if not self)\n *\n * Example:\n *\n * ```\n * {\n * id: '1234', // Optional, add only this is an 'incoming' msg.\n * msg: 'the text'\n * }\n */\n this.initialMsg = null;\n\n /**\n * ### Chat.recipientsIds\n *\n * Array of ids of current recipients of messages\n */\n this.recipientsIds = null;\n\n /**\n * ### Chat.recipientsIdsQuitted\n *\n * Array of ids of recipients that have previously quitted the chat\n */\n this.recipientsIdsQuitted = null;\n\n /**\n * ### Chat.senderToNameMap\n *\n * Map sender id (msg.from) to display name\n *\n * Note: The 'from' field of a message can be different\n * from the 'to' field of its reply (e.g., for MONITOR)\n */\n this.senderToNameMap = null;\n\n /**\n * ### Chat.recipientToNameMap\n *\n * Map recipient id (msg.to) to display name\n */\n this.recipientToNameMap = null;\n\n /**\n * ### Chat.senderToRecipientMap\n *\n * Map sender id (msg.from) to recipient id (msg.to)\n */\n this.senderToRecipientMap = null;\n\n /**\n * ### Chat.recipientToSenderMap\n *\n * Map recipient id (msg.to) to sender id (msg.from)\n */\n this.recipientToSenderMap = null;\n\n /**\n * ### Chat.showIsTyping\n *\n * TRUE, if \"is typing\" notice is shown\n */\n this.showIsTyping = null;\n\n /**\n * ### Chat.amTypingTimeout\n *\n * Timeout to send an own \"isTyping\" notification\n *\n * Timeout is added as soon as the user start typing, cleared when\n * a message is sent.\n */\n this.amTypingTimeout = null;\n\n /**\n * ### Chat.isTypingTimeouts\n *\n * Object containing timeouts for all participants currently typing\n *\n * A new timeout is added when an IS_TYPING msg is received and\n * cleared when a msg arrives or at expiration.\n */\n this.isTypingTimeouts = {};\n\n /**\n * ### Chat.isTypingDivs\n *\n * Object containing divs where \"is typing\" is diplayed\n *\n * Once created\n */\n this.isTypingDivs = {};\n\n /**\n * ### Chat.preprocessMsg\n *\n * A function that process the msg before being displayed\n *\n * It does not preprocess the initial message\n * and \"is typing\" notifications.\n *\n * Example:\n *\n * ```js\n * function(data, code) {\n * data.msg += '!';\n * }\n * ```\n */\n this.preprocessMsg = null;\n\n }", "title": "" }, { "docid": "7687849ace7b9177f9f852a92c18651d", "score": "0.6223186", "text": "function ServerMessageChatMessage() {\n this.__init__();\n}", "title": "" }, { "docid": "6e9033fd56e5af1c361b854ae3e663a8", "score": "0.61911356", "text": "function viewChat(instance_id, url)\n{\n}", "title": "" }, { "docid": "79da62fc0e7f5766d9195be5b55687ee", "score": "0.61646175", "text": "function Chat(nom) { this.nom = nom}", "title": "" }, { "docid": "5722a7fee5a54a625045f8f8dddd03d1", "score": "0.61502105", "text": "function Userchat(Username)\n{\n\n this.User = Username;\n\n this.chatlog = [];\n\n\n}", "title": "" }, { "docid": "e09904870b3439c9eebc57f81820506e", "score": "0.6121479", "text": "openChatWith(userToChetWith) {\n // clear the messages after i changing user to talk with him\n this.setState({messages: []})\n if (userToChetWith.username === this.state.username) {\n alert('You cannot talk with yourself...')\n\n } else {\n // changes in state the current user & aemit him message\n this.setState({CurrentUserToChatWIth: userToChetWith});\n this\n .socket\n .emit('openChatWith', {\n chatWith: userToChetWith.socketid,\n me: this.state.username\n });\n this.setState({openChat: true});\n }\n\n }", "title": "" }, { "docid": "2ebb08fd3ff481f28be4bb20c77c80c7", "score": "0.61061215", "text": "onMessage(client, data) {}", "title": "" }, { "docid": "77718c802a9bdc23c72a7c439816a4d5", "score": "0.61056274", "text": "chat_init(){\n\tvar self = this;\n\t$(\"#chat_container\").show();\n\t$(\"#playerlist_container\").show();\n\n\t// --- Chat ---\n\t$(\"#chat_box\").focus();\n\t$(\"#chat_form\").prepend($('<label>').text(this.name + \": \"));\n\t$(\"#chat_form\").submit(function(event) {\n\t event.preventDefault();\n\t var chat_box = $(\"#chat_box\");\n\t var text = chat_box.val();\n\t var message = JSON.stringify({name:self.name, chat:text, id:self.game_id});\n\t self.socket.emit(\"chat_message\", message);\n\t chat_box.val(\"\");\n\t});\n\n\tself.socket.on(\"chat_message\", function(msg) {\n\t var json_msg = JSON.parse(msg);\n\t var msg_name = json_msg[\"name\"];\n\t var msg_chat = json_msg[\"chat\"];\n\t var messages = $(\"#messages\");\n\t messages.append($('<li>').text(msg_name + \": \" + msg_chat));\n\t messages.scrollTop(messages.prop(\"scrollHeight\"));\n\t});\n }", "title": "" }, { "docid": "c83767026a168449cbb4635e01bee7df", "score": "0.6099863", "text": "handleChannelMessage(message){\n Object.keys(message).forEach(uid => {\n if(this.players[uid]) {\n this.players[uid].setInput(message[uid]);\n }\n });\n }", "title": "" }, { "docid": "6b769607b99f684a47c89294af3afdc6", "score": "0.60775185", "text": "_initClient() {\n const c = this._config;\n this.channels = c.channels || CHANNELS;\n this._client = new irc.Client('chat.freenode.net', c.nick, {\n channels: this.channels.map(ch => `#${ch}`),\n password: c.password,\n realName: c.name,\n sasl: true,\n stripColors: true,\n userName: c.user\n });\n EVENTS.forEach(e => this._client.addListener(\n e, this[`_on${util.cap(e)}`].bind(this)\n ));\n }", "title": "" }, { "docid": "df1799acd2ca0f80b1f90d75ad164925", "score": "0.6070618", "text": "function renderReply(chat){\n\n}", "title": "" }, { "docid": "339bd1e333da89840c2314d20a75d111", "score": "0.60570586", "text": "function chatin() {\n\tvar chat = input.value();\n\n\tvar time = +new Date;\n\tvar data = {\n\t\tname: blobsdict[socket.id].name,\n\t\tchat: chat,\n\t\ttime: time\n\t};\n\t\n\tsocket.emit('chat', data);\n\n\tinput.value('');\n}", "title": "" }, { "docid": "721c0d762c15a4a90aacc022a2a4dfa1", "score": "0.60440964", "text": "function entrar_a_chat()\n{\nconsole.log(\"a entrar_a_chat\")\nsocket_client.emit(\"pedir usuario en chat\", socket_client.id);\n}//click tab chat", "title": "" }, { "docid": "5ca1344aad064f9aa4634620450325d4", "score": "0.60270154", "text": "function Channel() {\n\n}", "title": "" }, { "docid": "0744ff801b1db412aa5538953a492c34", "score": "0.5996803", "text": "function WebLiveChatListener() {\n\t/** Set the caption for the button bar button. */\n\tthis.caption = null;\n\tthis.switchText = true;\n\tthis.playChime = true;\n\t/** The name of the voice to use. */\n\tthis.voice = null;\n\t/** The name of the voice mod to use. */\n\tthis.voiceMod = null;\n\t/** Enable or disable speech. */\n\tthis.speak = false;\n\t/** Configure if the browser's native voice TTS should be used. */\n\tthis.nativeVoice = false;\n\t/** Set the voice name for the native voice. */\n\tthis.nativeVoiceName = null;\n\t/** Set the language for the native voice. */\n\tthis.lang = null;\n\t/** Enable or disable avatar (you must also set the avatar ID). */\n\tthis.avatar = false;\n\t/** Set the avatar. */\n\tthis.avatarId = null;\n\t/** Set if the avatar should request HD (high def) video/images. */\n\tthis.hd = null;\n\t/** Set if the avatar should request a specific video or image format. */\n\tthis.format = null;\n\tthis.lang = null;\n\tthis.nick = \"\";\n\tthis.connection = null;\n\tthis.sdk = null;\n\t/** Configure if chat should be given focus after message. */\n\tthis.focus = !SDK.isMobile();\n\t/** Element id and class prefix. Can be used to have multiple avatars in the same page, or avoid naming collisions. */\n\tthis.prefix = \"\";\n\t/** Allow the chat box button color to be set. */\n\tthis.color = \"#009900\";\n\t/** Allow the user to modify style sheets. */\n\tthis.version = null;\n\t/** Allow the chat box hover button color to be set. */\n\tthis.hoverColor = \"grey\";\n\t/** Allow the chat box background color to be set. */\n\tthis.background = null;\n\t/** Chat box width. */\n\tthis.width = 300;\n\t/** Chat box height. */\n\tthis.height = 320;\n\t/** Chat box offset from side. */\n\tthis.offset = 30;\n\t/** Chat Button Vertial Offset*/\n\tthis.verticalOffset = 0;\n\t/** Print response in chat bubble. */\n\tthis.bubble = false;\n\t/** Set the location of the button and box, one of \"bottom-right\", \"bottom-left\", \"top-right\", \"top-left\". */\n\tthis.boxLocation = \"bottom-right\";\n\t/** Set styles explicitly to avoid inheriting page styles. Disable this to be able to override styles. */\n\tthis.forceStyles = true;\n\t/** Override the URL used in the chat box popup. */\n\tthis.popupURL = null;\n\t/** Set if the box chat log should be shown. */\n\tthis.chatLog = true;\n\t/** Box chat loading message to display. */\n\tthis.loading = \"loading...\";\n\t/** Box chat show online users option. */\n\tthis.online = false;\n\t/** Link to online user list users to their profile page. */\n\tthis.linkUsers = true;\n\t/** Configure message log format (table or log). */\n\tthis.chatLogType = \"log\";\n\t/** Configure the chat to auto accept a bot after waiting */\n\tthis.autoAccept = null;\n\t/** Prompt for name/email before connecting. */\n\tthis.promptContactInfo = false;\n\tthis.hasContactInfo = false;\n\t/** Set if the back link should be displayed. */\n\tthis.backlink = SDK.backlink;\n\tthis.contactName = null;\n\tthis.contactEmail = null;\n\tthis.contactPhone = null;\n\tthis.contactInfo = \"\";\n\t/** Allow the close button on the box button bar to be removed, and maximize on any click to the button bar. */\n\tthis.showClose = true;\n\t/** Provide an email chat log menu item. */\n\tthis.emailChatLog = false;\n\t/** Ask the user if they want an email of the chat log on close. */\n\tthis.promptEmailChatLog = false;\n\tthis.windowTitle = document.title;\n\tthis.isActive = true;\n\t/** Variables used to get the user and bot images. */\n\tthis.botThumb = {};\n\tthis.userThumb = {};\n\tself = this;\n\t/** JSON object of all currently logged in users in the chat room take from updateUsersXML. */\n\tthis.users = {};\n\t/** Box chat chat room option. */\n\tthis.chatroom = false;\n\t/** Show and hides menu bar */\n\tthis.showMenubar = true;\n\t/** Show Box Max */\n\tthis.showBoxmax = true;\n\t/** Show Send Image */\n\tthis.showSendImage = true;\n\t\n\t/**\n\t * Create an embedding bar and div in the current web page.\n\t */\n\tthis.createBox = function() {\n\t\tif (this.prefix == \"\" && this.elementPrefix != null) {\n\t\t\tthis.prefix = this.elementPrefix;\n\t\t}\n\t\tif (this.caption == null) {\n\t\t\tthis.caption = this.instanceName;\n\t\t}\n\t\tvar backgroundstyle = \"\";\n\t\tvar backgroundstyle2 = \"\";\n\t\tvar buttonstyle = \"\";\n\t\tvar buttonHoverStyle = \"\";\n\t\tvar hidden = \"hidden\";\n\t\tvar border = \"\";\n\t\tif (this.backgroundIfNotChrome && (SDK.isChrome() || SDK.isFirefox())) {\n\t\t\tthis.background = null;\n\t\t}\n\t\tif (this.background != null) {\n\t\t\tbackgroundstyle = \" style='background-color:\" + this.background + \"'\";\n\t\t\thidden = \"visible\";\n\t\t\tborder = \"border:1px;border-style:solid;border-color:black;\";\n\t\t} else {\n\t\t\tborder = \"border:1px;border-style:solid;border-color:transparent;\";\n\t\t}\n\t\tif (this.color != null) {\n\t\t\tbuttonstyle = \"background-color:\" + this.color + \";\";\n\t\t}\n\t\tif (this.hoverColor != null) {\n\t\t\tbuttonHoverStyle = \"background-color:\" + this.hoverColor + \";\";\n\t\t}\n\t\t\n\t\tvar minWidth = \"\";\n\t\tvar divWidth = \"\";\n\t\tvar background = \"\";\n\t\tvar minHeight = \"\";\n\t\tvar divHeight = \"\";\n\t\tvar maxDivWidth = \"\";\n\t\tvar maxHeight = null;\n\t\tvar responseWidth = \"\";\n\t\tvar chatWidth = \"\";\n\t\tvar hideAvatar = \"\";\n\t\tvar avatarWidth = this.width;\n\t\tvar minAvatarWidth = \"\";\n\t\tvar scrollerHeight = this.height;\n\t\tvar scrollerMinHeight = \"\";\n\t\tif (this.width != null) {\n\t\t\tif (typeof this.width === \"string\") {\n\t\t\t\tthis.width = parseInt(this.width);\n\t\t\t}\n\t\t\t// Auto correct for a short window or screen (assuming square).\n\t\t\t// 250 is total box height minus avatar.\n\t\t\tif ((this.width + 280) > window.innerHeight) {\n\t\t\t\tavatarWidth = window.innerHeight - 280;\n\t\t\t\tif (avatarWidth < 100) {\n\t\t\t\t\thideAvatar = \"display:none\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tminWidth = \"width:\" + this.width + \"px;\";\n\t\t\tminAvatarWidth = \"width:\" + avatarWidth + \"px;\";\n\t\t\tbackground = \"background-size:\" + avatarWidth + \"px auto;\";\n\t\t\tdivWidth = minWidth;\n\t\t\tdivHeight = \"min-height:\" + avatarWidth + \"px;\";\n\t\t\tresponseWidth = \"width:\" + (this.width - 32) + \"px;\";\n\t\t\tmaxDivWidth = \"max-width:\" + (this.width - 50) + \"px;\";\n\t\t\tscrollerHeight = avatarWidth;\n\t\t}\n\t\tif (this.height != null) {\n\t\t\tif (typeof this.height === \"string\") {\n\t\t\t\tthis.height = parseInt(this.height);\n\t\t\t}\n\t\t\tminHeight = \"height:\" + this.height + \"px;\";\n\t\t\tdivHeight = minHeight;\n\t\t\tif (this.width != null) {\n\t\t\t\tbackground = \"background-size:\" + this.width + \"px \" + this.height + \"px;\";\n\t\t\t} else {\n\t\t\t\tbackground = \"background-size: auto \" + this.height + \"px;\";\n\t\t\t\tdivWidth = \"min-width:\" + this.height + \"px;\";\n\t\t\t\tresponseWidth = \"width:\" + (this.height - 16) + \"px;\";\n\t\t\t\tchatWidth = \"width:\" + this.height + \"px;\";\n\t\t\t}\n\t\t} else {\n\t\t\tscrollerMinHeight = \"height:\" + scrollerHeight + \"px;\";\n\t\t}\n\t\t\n\t\tvar boxloc = \"bottom:10px;right:10px\";\n\t\tif (this.boxLocation == \"top-left\") {\n\t\t\tboxloc = \"top:10px;left:10px\";\n\t\t} else if (this.boxLocation == \"top-right\") {\n\t\t\tboxloc = \"top:10px;right:10px\";\n\t\t} else if (this.boxLocation == \"bottom-left\") {\n\t\t\tboxloc = \"bottom:10px;left:10px\";\n\t\t} else if (this.boxLocation == \"bottom-right\") {\n\t\t\tboxloc = \"bottom:10px;right:10px\";\n\t\t}\n\t\tvar locationBottom = 20;\n\t\tif (this.version < 6.0 || this.prefix != \"botplatformchat\") {\n\t\t\tlocationBottom = 2;\n\t\t}\n\t\tvar boxbarloc = \"bottom:\" + (locationBottom + this.verticalOffset) + \"px;right:\" + this.offset + \"px\";\n\t\tif (this.boxLocation == \"top-left\") {\n\t\t\tboxbarloc = \"top:\" + (locationBottom + this.verticalOffset) + \"px;left:\" + this.offset + \"px\";\n\t\t} else if (this.boxLocation == \"top-right\") {\n\t\t\tboxbarloc = \"top:\" + (locationBottom + this.verticalOffset) + \"px;right:\" + this.offset + \"px\";\n\t\t} else if (this.boxLocation == \"bottom-left\") {\n\t\t\tboxbarloc = \"bottom:\" + (locationBottom + this.verticalOffset) + \"px;left:\" + this.offset + \"px\";\n\t\t} else if (this.boxLocation == \"bottom-right\") {\n\t\t\tboxbarloc = \"bottom:\" + (locationBottom + this.verticalOffset) + \"px;right:\" + this.offset + \"px\";\n\t\t}\n\t\tvar box = document.createElement('div');\n\t\tvar html =\n\t\t\t\"<style>\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"box { position:fixed;\" + boxloc + \";z-index:152;margin:2px;display:none;\" + border + \" }\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"boxmenu { visibility:\" + hidden + \"; }\\n\" //margin-bottom:12px;\n\t\t\t\t+ (this.forceStyles ? \"#\" : \".\") + \"\" + this.prefix + \"boxbarmax { font-size:18px;margin:2px;padding:0px;text-decoration:none; }\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"boxbar { position:fixed;\" + boxbarloc + \";z-index:152;margin:0;padding:6px;\" + buttonstyle + \" }\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"boxbar:hover { \" + buttonHoverStyle + \" }\\n\"\n\t\t\t\t+ \"#\" + this.prefix + \"emailchatlogdialog { \" + minWidth + \" }\\n\"\n\t\t\t\t+ \"#\" + this.prefix + \"contactinfo { \" + minHeight + minWidth + \" }\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"contactconnect { margin:4px;padding:8px;color:white;text-decoration:none;\" + buttonstyle + \" }\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"no-bubble-text { \" + responseWidth + \"; max-height:100px; overflow:auto; }\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"bubble-text { \" + responseWidth + \"; margin:4px; max-height:100px; overflow:auto; }\\n\"\n\t\t\t\t+ (this.forceStyles ? \"#\" : \".\") + this.prefix + \"chat { width:99%;min-height:22px; }\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"chat-1-div { \" + maxDivWidth + \"}\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"chat-2-div { \" + maxDivWidth + \"}\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"online-div { \" + minWidth + \" overflow-x: auto; overflow-y: hidden; white-space: nowrap; }\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"scroller { overflow-x:hidden;\" + minHeight + minWidth + \" }\\n\"\n\t\t\t\t+ \".\" + this.prefix + \"box:hover .\" + this.prefix + \"boxmenu { visibility:visible; }\\n\";\n\t\tif (this.version < 6.0 || this.prefix != \"botplatformchat\") {\n\t\t\thtml = html\n\t\t\t\t\t\t+ \".\" + this.prefix + \"box img { display:inline; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"boxbar img { display:inline; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"box:hover { border:1px;border-style:solid;border-color:black; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"box:hover .\" + this.prefix + \"boxmenu { visibility:visible; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"boxclose, .\" + this.prefix + \"boxmin, .\" + this.prefix + \"boxmax { font-size:22px;margin:2px;padding:0px;text-decoration:none; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"boxclose:hover, .\" + this.prefix + \"boxmin:hover, .\" + this.prefix + \"boxmax:hover { color: #fff;background: grey; }\\n\"\n\t\t\t\t\t\t+ \"#\" + this.prefix + \"emailchatlogdialog span { margin-left:0px;margin-top:4px; }\\n\"\n\t\t\t\t\t\t+ \"#\" + this.prefix + \"emailchatlogdialog input { margin:4px;font-size:13px;height:33px;width:90%;border:1px solid #d5d5d5; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"emailconfirm { margin:4px;padding:8px;color:white;background-color:grey;text-decoration:none; }\\n\"\n\t\t\t\t\t\t+ \"#\" + this.prefix + \"contactinfo span { margin-left:4px;margin-top:4px; }\\n\"\n\t\t\t\t\t\t+ \"#\" + this.prefix + \"contactinfo input { margin:4px;font-size:13px;height:33px;width:90%;border:1px solid #d5d5d5; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"no-bubble { margin:4px; padding:8px; border:1px; border-style:solid; border-color:black; background-color:white; color:black; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"boxbutton { width:20px;height:20px;margin:2px; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"bubble-div { padding-bottom:15px;position:relative; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"no-bubble-plain { margin:4px; padding:8px; border:1px; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"bubble { margin:4px; padding:8px; border:1px; border-style:solid; border-color:black; border-radius:10px; background-color:white; color:black; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"bubble:before { content:''; position:absolute; bottom:0px; left:40px; border-width:20px 0 0 20px; border-style:solid; border-color:black transparent; display:block; width:0;}\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"bubble:after { content:''; position:absolute; bottom:3px; left:42px; border-width:18px 0 0 16px; border-style:solid; border-color:white transparent; display:block; width:0;}\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"box-input-span { display:block; overflow:hidden; margin:4px; padding-right:4px; }\\n\"\n\t\t\t\t\t\t+ \"a.\" + this.prefix + \"menuitem { text-decoration: none;display: block;color: #585858; }\\n\"\n\t\t\t\t\t\t+ \"a.\" + this.prefix + \"menuitem:hover { color: #fff;background: grey; }\\n\"\n\t\t\t\t\t\t+ \"tr.\" + this.prefix + \"menuitem:hover { background: grey; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"powered { margin:4px;font-size:10px; }\\n\"\n\t\t\t\t\t\t+ \"img.\" + this.prefix + \"menu { width: 24px;height: 24px;margin: 2px;cursor: pointer;vertical-align: middle; }\\n\"\n\t\t\t\t\t\t+ \"span.\" + this.prefix + \"menu { color: #818181;font-size: 12px; }\\n\"\n\t\t\t\t\t\t+ \"img.\" + this.prefix + \"toolbar { width: 25px;height: 25px;margin: 1px;padding: 1px;cursor: pointer;vertical-align: middle;border-style: solid;border-width: 1px;border-color: #fff; }\\n\"\n\t\t\t\t\t\t+ \"td.\" + this.prefix + \"toolbar { width: 36px;height: 36px }\\n\"\n\t\t\t\t\t\t/*+ \".\" + this.prefix + \"online { height: 97px;width: 300px;overflow-x: auto;overflow-y: hidden;white-space: nowrap; }\\n\"*/\n\t\t\t\t\t\t+ \".\" + this.prefix + \"menupopup div { position:absolute;margin: -1px 0 0 0;padding: 3px 3px 3px 3px;background: #fff;border-style:solid;border-color:black;border-width:1px;width:160px;max-width:300px;z-index:152;visibility:hidden;opacity:0;transition:visibility 0s linear 0.3s, opacity 0.3s linear; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"menupopup:hover div { display:inline;visibility:visible;opacity:1;transition-delay:0.5s; }\\n\"\n\t\t\t\t\t\t+ \"img.chat-user-thumb { height: 50px; }\\n\"\n\t\t\t\t\t\t+ \"a.user { text-decoration: none; }\\n\"\n\t\t\t\t\t\t+ \"td.\" + this.prefix + \"chat-1 { width:100%;background-color: #d5d5d5;}\\n\"\n\t\t\t\t\t\t+ \"span.\" + this.prefix + \"chat-1 { color:#333;}\\n\"\n\t\t\t\t\t\t+ \"span.\" + this.prefix + \"chat-user { color:grey;font-size:small; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"console { width:100%; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"online-div { display: none; }\\n\"\n\t\t\t\t\t\t+ \".\" + this.prefix + \"-channel-title { display: none; }\\n\"\n\t\t\t\t\t\t+ \"#\" + this.prefix + \"boxtable { background:none; border:none; margin:0; }\\n\"\n\t\t\t\t\t\t+ \"#\" + this.prefix + \"boxbar3 { display:none; }\\n\"\n\t\t\t\t\t\t+ \"#\" + this.prefix + \"boxbarmax { color: white; }\\n\"\n\t\t\t\t\t\t+ \"img.\" + this.prefix + \"chat-user { height:40px; max-width:40px; }\\n\";\n\t\t}\n\t\thtml = html\n\t\t\t+ \"</style>\\n\"\n\t\t\t+ \"<div id='\" + this.prefix + \"box' class='\" + this.prefix + \"box' \" + backgroundstyle + \">\"\n\t\t\t\t+ \"<div class='\" + this.prefix + \"boxmenu'>\"\n\t\t\t\t\t+ (this.backlink ? \"<span class='\" + this.prefix + \"powered'>powered by <a href='\" + SDK.backlinkURL + \"' target='_blank'>\" + SDK.NAME + \"</a></span>\" : \"\")\n\t\t\t\t\t+ \"<span class=\" + this.prefix + \"-channel-title>\" + this.instanceName + \"</span>\"\n\t\t\t\t\t+ \"<span style='float:right'><a id='\" + this.prefix + \"boxmin' class='\" + this.prefix + \"boxmin' onclick='return false;' href='#'><img src='\" + SDK.url + \"/images/minimize.png'></a>\";\n\t\t\t\t\tif (this.showBoxmax) {\n\t\t\t\t\t\thtml = html + \"<a id='\" + this.prefix + \"boxmax' class='\" + this.prefix + \"boxmax' onclick='return false;' href='#'><img src='\" + SDK.url + \"/images/open.png'></a></span><br/>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\thtml = html + \"</span><br/>\";\n\t\t\t\t\t}\t\n\t\t\t\thtml = html + \"</div>\";\n\t\tif (this.online) {\n\t\t\thtml = html\n\t\t\t\t+ \"<div id='\" + this.prefix + \"online-div' class='\" + this.prefix + \"online-div'>\"\n\t\t\t\t\t+ \"<div id='\" + this.prefix + \"online' class='\" + this.prefix + \"online'\" + \"style='display:none;'>\"\n\t\t\t\t\t\t+ \"<table></table>\"\n\t\t\t\t\t+ \"</div>\"\n\t\t\t\t+ \"</div>\";\n\t\t}\n\t\tif (this.chatLog) {\n\t\t\thtml = html\n\t\t\t\t+ \"<div id='\" + this.prefix + \"scroller' class='\" + this.prefix + \"scroller'>\"\n\t\t\t\t+ \"<table id='\" + this.prefix + \"console' class='\" + this.prefix + \"console' width=100% cellspacing=2></table>\"\n\t\t\t\t+ \"</div>\"\n\t\t}\n\t\tif (this.avatar) {\n\t\t\thtml = html\n\t\t\t\t+ \"<div id='\" + this.prefix + \"avatar-div' style='\" + hideAvatar + \"'>\"\n\t\t\t\t\t+ \"<div id='\" + this.prefix + \"avatar-image-div' style='display:none;text-align:center;\" + minHeight + minAvatarWidth + \"'>\"\n\t\t\t\t\t\t+ \"<img id='\" + this.prefix + \"avatar' style='\" + minHeight + minAvatarWidth + \"'/>\"\n\t\t\t\t\t+ \"</div>\"\n\t\t\t\t\t+ \"<div id='\" + this.prefix + \"avatar-video-div' style='display:none;text-align:center;background-position:center;\" + divHeight + divWidth + background + \"background-repeat: no-repeat;'>\"\n\t\t\t\t\t\t+ \"<video muted='true' id='\" + this.prefix + \"avatar-video' autoplay preload='auto' style='background:transparent;\" + minHeight + minAvatarWidth + \"'>\"\n\t\t\t\t\t\t\t+ \"Video format not supported by your browser (try Chrome)\"\n\t\t\t\t\t\t+ \"</video>\"\n\t\t\t\t\t+ \"</div>\"\n\t\t\t\t\t+ \"<div id='\" + this.prefix + \"avatar-canvas-div' style='display:none;text-align:center;\" + divHeight + divWidth + \"'>\"\n\t\t\t\t\t\t+ \"<canvas id='\" + this.prefix + \"avatar-canvas' style='background:transparent;\" + minHeight + minAvatarWidth + \"'>\"\n\t\t\t\t\t\t\t+ \"Canvas not supported by your browser (try Chrome)\"\n\t\t\t\t\t\t+ \"</canvas>\"\n\t\t\t\t\t+ \"</div>\"\n\t\t\t\t\t+ \"<div id='\" + this.prefix + \"avatar-game-div' style='display:none;text-align:center;\" + divHeight + divWidth + \"'>\"\n\t\t\t\t\t+ \"</div>\"\n\t\t\t\t+ \"</div>\";\n\t\t}\n\t\tvar urlprefix = this.sdk.credentials.url + \"/\";\n\t\thtml = html\n\t\t\t\t+ \"<div>\\n\"\n\t\t\t\t\t+ \"<div \" + (this.bubble ? \"id='\" + this.prefix + \"bubble-div' class='\" + this.prefix + \"bubble-div'\" : \"\") + \">\"\n\t\t\t\t\t+ \"<div \"\n\t\t\t\t\t+ \"id='\" + this.prefix + (this.bubble ? \"bubble\" : (this.background == null ? \"no-bubble\" : \"no-bubble-plain\") )\n\t\t\t\t\t+ \"' class='\" + this.prefix + (this.bubble ? \"bubble\" : (this.background == null ? \"no-bubble\" : \"no-bubble-plain\") )\n\t\t\t\t\t+ \"'><div id='\" + this.prefix + (this.bubble ? \"bubble-text\" : \"no-bubble-text\" ) + \"' \"\n\t\t\t\t\t\t+ \"class='\" + this.prefix + (this.bubble ? \"bubble-text\" : \"no-bubble-text\" ) + \"'>\"\n\t\t\t\t\t\t+ \"<span id='\" + this.prefix + \"response'>\" + this.loading + \"</span><br/>\"\n\t\t\t\t\t+ \"</div></div></div>\\n\";\n\t\thtml = html\n\t\t\t+ \"<table id='\" + this.prefix + \"boxtable' class='\" + this.prefix + \"boxtable' style='width:100%'><tr>\\n\";\n\t\t\tif (this.showMenubar) {\n\t\t\t\thtml = html\n\t\t\t\t\t+ \"<td class='\" + this.prefix + \"toolbar'><span class='\" + this.prefix + \"menu'>\\n\"\n\t\t\t\t\t+ \"<div style='inline-block;position:relative'>\\n\"\n\t\t\t\t\t+ \"<span id='\" + this.prefix + \"menupopup' class='\" + this.prefix + \"menupopup'>\\n\"\n\t\t\t\t\t+ \"<div style='text-align:left;bottom:28px'>\\n\"\n\t\t\t\t\t+ \"<table>\\n\"\n\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"ping' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/ping.svg' title='\" + SDK.translate(\"Verify your connection to the server\") + \"'> \" + SDK.translate(\"Ping server\") + \"</a></td>\"\n\t\t\t\t\t+ \"</tr>\\n\";\n\t\t\t\tif (this.chatroom) {\n\t\t\t\t\thtml = html\n\t\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"flag' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/flag2.svg' title='\" + SDK.translate(\"Flag a user for offensive content\") + \"'> \" + SDK.translate(\"Flag user\") + \"</a></td>\"\n\t\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"whisper' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/whisper.png' title='\" + SDK.translate(\"Send a private message to another user\") + \"'> \" + SDK.translate(\"Whisper user\") + \"</a></td>\"\n\t\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"pvt' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/accept.svg' title='\" + SDK.translate(\"Invite another user to a private channel\") + \"'> \" + SDK.translate(\"Request private\") + \"</a></td>\"\n\t\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t}\n\t\t\t\thtml = html\n\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"clear' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/empty.png' title='\" + SDK.translate(\"Clear the local chat log\") + \"'> \" + SDK.translate(\"Clear log\") + \"</a></td>\"\n\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"accept' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/accept.svg' title='\" + SDK.translate(\"Accept a private request from an operator, bot, or another user\") + \"'> \" + SDK.translate(\"Accept private\") + \"</a></td>\"\n\t\t\t\t\t+ \"</tr>\\n\";\n\t\t\t\t\tif (this.showSendImage) {\n\t\t\t\t\t\thtml = html\n\t\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"sendImage' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/image.svg' title='\" + SDK.translate(\"Resize and send an image attachment\") + \"'> \" + SDK.translate(\"Send image\") + \"</a></td>\"\n\t\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"sendAttachment' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/attach.svg' title='\" + SDK.translate(\"Send an image or file attachment\") + \"'> \" + SDK.translate(\"Send file\") + \"</a></td>\"\n\t\t\t\t\t\t+ \"</tr>\\n\";\n\t\t\t\t\t}\n\t\t\t\tif (this.emailChatLog) {\n\t\t\t\t\thtml = html\n\t\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"emailChatLog' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img id='email' class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/message.svg' title='\" + SDK.translate(\"Send yourself an email of the conversation log\") + \"'> \" + SDK.translate(\"Email Chat Log\") + \"</a></td>\"\n\t\t\t\t}\n\t\t\t\thtml = html\n\t\t\t\t\t+ \"<tr id='\" + this.prefix + \"showChatLog' class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t+ \"<td><a class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + urlprefix + \"/images/chat_log.svg' title='Chat log'> \" + SDK.translate(\"Chat Log\") + \"</a></td>\"\n\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t\t+ \"<tr id='\" + this.prefix + \"showAvatarBot' class='\" + this.prefix + \"menuitem' style='display:none;'>\"\n\t\t\t\t\t\t+ \"<td><a class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + urlprefix + \"/images/avatar-icon.png' title='Avatar Bot'> \" + SDK.translate(\"Show Avatar\") + \"</a></td>\"\n\t\t\t\t\t+ \"</tr>\\n\";\n\t\t\t\thtml = html\n\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"toggleChime' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img id='boxchime' class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/sound.svg' title='\" + SDK.translate(\"Play a chime when a message is recieved\") + \"'> \" + SDK.translate(\"Chime\") + \"</a></td>\"\n\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"toggleSpeak' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img id='boxtalk' class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/talkoff.svg' title='\" + SDK.translate(\"Speak each message using voice synthesis\") + \"'> \" + SDK.translate(\"Text to speech\") + \"</a></td>\"\n\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"toggleListen' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'>\"\n\t\t\t\t\t\t\t\t+ \"<img id='boxmic' class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/micoff.svg' title='\" + SDK.translate(\"Enable speech recognition (browser must support HTML5 speech recognition, such as Chrome)\") + \"'> \" + SDK.translate(\"Speech recognition\") + \"</a>\"\n\t\t\t\t\t\t+ \"</td>\"\n\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t\t+ \"<tr class='\" + this.prefix + \"menuitem'>\"\n\t\t\t\t\t\t+ \"<td><a id='\" + this.prefix + \"exit' class='\" + this.prefix + \"menuitem' onclick='return false;' href='#'><img class='\" + this.prefix + \"menu' src='\" + SDK.url + \"/images/quit.svg' title='\" + SDK.translate(\"Exit the channel or active private channel\") + \"'> \" + SDK.translate(\"Quit private or channel\") + \"</a></td>\"\n\t\t\t\t\t+ \"</tr>\\n\"\n\t\t\t\t\t+ \"</table>\\n\"\n\t\t\t\t\t+ \"</div>\\n\"\n\t\t\t\t\t+ \"<img class='\" + this.prefix + \"toolbar' src='\" + SDK.url + \"/images/menu.png'>\\n\"\n\t\t\t\t\t+ \"</span>\\n\"\n\t\t\t\t\t+ \"</div>\\n\"\n\t\t\t\t\t+ \"</span></td>\\n\";\n\t\t\t}\n\t\thtml = html\n\t\t\t+ \"<td><span class='\" + this.prefix + \"box-input-span'><input id='\" + this.prefix\n\t\t\t\t+ \"chat' type='text' id='\" + this.prefix + \"box-input' \"\n\t\t\t\t+ \"class='\" + this.prefix + \"box-input'/></span></td>\"\n\t\t\t+ \"</tr></table>\"\n\t\t\t+ \"</div>\\n\"\n\t\t\t+ \"</div>\\n\"\n\t\t\t+ \"<div id='\" + this.prefix + \"boxbar' class='\" + this.prefix + \"boxbar'>\"\n\t\t\t\t+ \"<div id='\" + this.prefix + \"boxbar2' class='\" + this.prefix + \"boxbar2'>\"\n\t\t\t\t\t+ \"<span><a id='\" + this.prefix + \"boxbarmax' class='\" + this.prefix + \"boxbarmax' \" + \" onclick='return false;' href='#'><img id='\" + this.prefix + \"boxbarmaximage' \" + \"src='\" + SDK.url + \"/images/maximizew.png'> \" + this.caption + \" </a>\";\n\t\tif (this.showClose) {\n\t\t\thtml = html + \" <a id='\" + this.prefix + \"boxclose' class='\" + this.prefix + \"boxclose' onclick='return false;' href='#'> <img src='\" + SDK.url + \"/images/closeg.png'></a>\";\n\t\t}\n\t\thtml = html\n\t\t\t\t+ \"</span><br>\"\n\t\t\t+ \"</div>\\n\"\n\t\t\t+ \"<div id='\" + this.prefix + \"boxbar3' class='\" + this.prefix + \"boxbar3'\" + \">\"\n\t\t\t\t+ \"<span><a id='\" + this.prefix + \"boxbarmax2' class='\" + this.prefix + \"boxbarmax2' \" + (this.forceStyles ? \"style='color:white' \" : \"\") + \" onclick='return false;' href='#'>\" + \"</a>\"\n\t\t\t\t+ \"</span><br>\";\n\t\tif (this.showClose) {\n\t\t\thtml = html + \" <a id='\" + this.prefix + \"boxclose2' class='\" + this.prefix + \"boxclose2' onclick='return false;' href='#'> <img src='\" + SDK.url + \"/images/closeg.png'></a>\";\n\t\t}\n\t\thtml = html\n\t\t\t+ \"</div>\\n\"\n\t\t\t+ \"</span>\"\n\t\t\t+ \"</div>\\n\";\n\t\t\n\t\tif (this.promptContactInfo) {\n\t\t\thtml = html\n\t\t\t\t+ \"<div id='\" + this.prefix + \"contactinfo' class='\" + this.prefix + \"box' \" + backgroundstyle + \">\"\n\t\t\t\t\t+ \"<div class='\" + this.prefix + \"boxmenu'>\"\n\t\t\t\t\t\t+ \"<span style='float:right'><a id='\" + this.prefix + \"contactboxmin' class='\" + this.prefix + \"contactboxmin' onclick='return false;' href='#'><img src='\" + SDK.url + \"/images/minimize.png'></a>\"\n\t\t\t\t\t+ \"</div>\\n\"\n\t\t\t\t\t+ \"<div style='margin:10px'>\\n\"\n\t\t\t\t\t\t+ \"<span>\" + SDK.translate(\"Name\") + \"</span><br/><input id='\" + this.prefix + \"contactname' type='text' /><br/>\\n\"\n\t\t\t\t\t\t+ \"<span>\" + SDK.translate(\"Email\") + \"</span><br/><input id='\" + this.prefix + \"contactemail' type='email' /><br/>\\n\"\n\t\t\t\t\t\t+ \"<span>\" + SDK.translate(\"Phone\") + \"</span><br/><input id='\" + this.prefix + \"contactphone' type='text' /><br/>\\n\"\n\t\t\t\t\t\t+ \"<br/><a id='\" + this.prefix + \"contactconnect' class='\" + this.prefix + \"contactconnect' \" + (this.forceStyles ? \"style='color:white' \" : \"\") + \" onclick='return false;' href='#'>\" + SDK.translate(\"Connect\") + \"</a>\\n\"\n\t\t\t\t\t+ \"</div>\\n\"\n\t\t\t\t+ \"</div>\";\n\t\t}\n\t\tif (this.promptEmailChatLog) {\n\t\t\thtml = html\n\t\t\t\t+ \"<div id='\" + this.prefix + \"emailchatlogdialog' class='\" + this.prefix + \"box' \" + backgroundstyle + \">\"\n\t\t\t\t\t+ \"<div class='\" + this.prefix + \"boxmenu'>\"\n\t\t\t\t\t\t+ \"<span style='float:right'><a id='\" + this.prefix + \"emailchatlogdialogmin' class='\" + this.prefix + \"boxmin' onclick='return false;' href='#'><img src='\" + SDK.url + \"/images/minimize.png'></a>\"\n\t\t\t\t\t+ \"</div>\\n\"\n\t\t\t\t\t+ \"<div style='margin:10px;margin-bottom:20px;margin-top:20px;'>\\n\"\n\t\t\t\t\t\t+ \"<span>\" + SDK.translate(\"Would you like a copy of the chat log sent to your email?\") + \"</span><br/><input id='\" + this.prefix + \"emailchatlogemail' type='email' /><br/>\\n\"\n\t\t\t\t\t\t+ \"<br/><a id='\" + this.prefix + \"emailchatlogdialogyes' class='\" + this.prefix + \"emailconfirm' \" + (this.forceStyles ? \"style='color:white' \" : \"\") + \" onclick='return false;' href='#'> \" + SDK.translate(\"Yes\") + \"</a>\\n\"\n\t\t\t\t\t\t+ \" <a id='\" + this.prefix + \"emailchatlogdialogno' class='\" + this.prefix + \"emailconfirm' \" + (this.forceStyles ? \"style='color:white' \" : \"\") + \" onclick='return false;' href='#'> \" + SDK.translate(\"No\") + \"</a>\\n\"\n\t\t\t\t\t+ \"</div>\\n\"\n\t\t\t\t+ \"</div>\";\n\t\t}\n\t\t\n\t\tbox.innerHTML = html;\n\t\tSDK.body().appendChild(box);\n\n\t\tif (this.avatar && this.chatLog) {\n\t\t\tvar online = document.getElementById(this.prefix + \"online\");\n\t\t\tif (online != null) {\n\t\t\t\tonline.style.display = \"none\";\n\t\t\t}\n\t\t\tvar scroller = document.getElementById(this.prefix + \"scroller\");\n\t\t\tif (scroller != null) {\n\t\t\t\tscroller.style.display = \"none\";\n\t\t\t}\n\t\t\tvar chatLogDiv = document.getElementById(this.prefix + \"showChatLog\");\n\t\t\tif (chatLogDiv != null) {\n\t\t\t\tchatLogDiv.style.display = \"block\";\n\t\t\t}\n\t\t} else if (this.avatar && !this.chatLog) {\n\t\t\tvar online = document.getElementById(this.prefix + \"online\");\n\t\t\tif (online != null) {\n\t\t\t\tonline.style.display = \"none\";\n\t\t\t}\n\t\t\tvar scroller = document.getElementById(this.prefix + \"scroller\");\n\t\t\tif (scroller != null) {\n\t\t\t\tscroller.style.display = \"none\";\n\t\t\t}\n\t\t\tvar chatLogDiv = document.getElementById(this.prefix + \"showChatLog\");\n\t\t\tif (chatLogDiv != null) {\n\t\t\t\tchatLogDiv.style.display = \"none\";\n\t\t\t}\n\t\t} else if (!this.avatar && this.chatLog) {\n\t\t\tvar online = document.getElementById(this.prefix + \"online\");\n\t\t\tif (online != null) {\n\t\t\t\tonline.style.display = \"inline\";\n\t\t\t}\n\t\t\tvar scroller = document.getElementById(this.prefix + \"scroller\");\n\t\t\tif (scroller != null) {\n\t\t\t\tscroller.style.display = \"inline-block\";\n\t\t\t}\n\t\t\tvar avatarDiv = document.getElementById(this.prefix + \"avatar-div\");\n\t\t\tif (avatarDiv != null) {\n\t\t\t\tavatarDiv.style.display = \"none\";\n\t\t\t}\n\t\t\tvar chatLogDiv = document.getElementById(this.prefix + \"showChatLog\");\n\t\t\tif (chatLogDiv != null) {\n\t\t\t\tchatLogDiv.style.display = \"none\";\n\t\t\t}\n\t\t\tvar bubbleDiv = document.getElementById(this.prefix + \"bubble-div\");\n\t\t\tif (bubbleDiv != null) {\n\t\t\t\tbubbleDiv.style.display = \"none\";\t\n\t\t\t}\n\t\t\tvar noBubblePlain = document.getElementsByClassName(this.prefix + \"no-bubble-plain\");\n\t\t\tif (noBubblePlain != null && noBubblePlain.length != 0) {\n\t\t\t\tnoBubblePlain[0].style.display = \"none\";\n\t\t\t}\n\t\t} else {\n\t\t\tvar online = document.getElementById(this.prefix + \"online\");\n\t\t\tif (online != null) {\n\t\t\t\tonline.style.display = \"none\";\n\t\t\t}\n\t\t\tvar scroller = document.getElementById(this.prefix + \"scroller\");\n\t\t\tif (scroller != null) {\n\t\t\t\tscroller.style.display = \"none\";\n\t\t\t}\n\t\t\tvar avatarDiv = document.getElementById(this.prefix + \"avatar-div\");\n\t\t\tif (avatarDiv != null) {\n\t\t\t\tavatarDiv.style.display = \"none\";\n\t\t\t}\n\t\t\tvar chatLogDiv = document.getElementById(this.prefix + \"showChatLog\");\n\t\t\tif (chatLogDiv != null) {\n\t\t\t\tchatLogDiv.style.display = \"none\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (this.online && this.chatroom) {\n\t\t\tdocument.getElementById(this.prefix + \"online\").style.height = \"95px\";\n\t\t}\n\t\tif (this.chatLog && !this.bubble) {\n\t\t\tvar bubbleDiv = document.getElementById(this.prefix + 'bubble-div');\n\t\t\tif (bubbleDiv != null) {\n\t\t\t\tbubbleDiv.style.display = \"none\";\n\t\t\t}\n\t\t\tdocument.getElementById(this.prefix + 'no-bubble-plain').style.display = \"none\";\n\t\t\tdocument.getElementById(this.prefix + 'response').style.display = \"none\";\n\t\t}\n\t\t\n\t\tvar self = this;\n\t\tvar listen = false;\n\t\tif (document.getElementById(this.prefix + \"showChatLog\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"showChatLog\").addEventListener(\"click\", function() {\n\t\t\t\tself.showChatLog();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"showAvatarBot\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"showAvatarBot\").addEventListener(\"click\", function() {\n\t\t\t\tself.showAvatarBot();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"chat\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"chat\").addEventListener(\"keypress\", function(event) {\n\t\t\t\tif (event.keyCode == 13) {\n\t\t\t\t\tself.sendMessage();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"exit\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"exit\").addEventListener(\"click\", function() {\n\t\t\t\tself.exit();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"ping\")!= null) {\n\t\t\tdocument.getElementById(this.prefix + \"ping\").addEventListener(\"click\", function() {\n\t\t\t\tself.ping();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"clear\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"clear\").addEventListener(\"click\", function() {\n\t\t\t\tself.clear();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"accept\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"accept\").addEventListener(\"click\", function() {\n\t\t\t\tself.accept();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"sendImage\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"sendImage\").addEventListener(\"click\", function() {\n\t\t\t\tself.sendImage();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"sendAttachment\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"sendAttachment\").addEventListener(\"click\", function() {\n\t\t\t\tself.sendAttachment();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (this.emailChatLog) {\n\t\t\tif (document.getElementById(this.prefix + \"emailChatLog\") != null) {\n\t\t\t\tdocument.getElementById(this.prefix + \"emailChatLog\").addEventListener(\"click\", function() {\n\t\t\t\t\tself.emailChatLog();\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.promptEmailChatLog) {\n\t\t\tdocument.getElementById(this.prefix + \"emailchatlogdialogyes\").addEventListener(\"click\", function() {\n\t\t\t\tself.sendEmailChatLogBox();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tdocument.getElementById(this.prefix + \"emailchatlogdialogno\").addEventListener(\"click\", function() {\n\t\t\t\tself.minimizeEmailChatLogBox();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tdocument.getElementById(this.prefix + \"emailchatlogdialogmin\").addEventListener(\"click\", function() {\n\t\t\t\tself.minimizeEmailChatLogBox();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tvar menu = document.getElementById(this.prefix + \"flag\");\n\t\tif (menu != null) {\n\t\t\tmenu.addEventListener(\"click\", function() {\n\t\t\t\tself.flag();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tmenu = document.getElementById(this.prefix + \"whisper\");\n\t\tif (menu != null) {\n\t\t\tmenu.addEventListener(\"click\", function() {\n\t\t\t\tself.whisper();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tmenu = document.getElementById(this.prefix + \"pvt\");\n\t\tif (menu != null) {\n\t\t\tmenu.addEventListener(\"click\", function() {\n\t\t\t\tself.pvt();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"toggleChime\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"toggleChime\").addEventListener(\"click\", function() {\n\t\t\t\tself.toggleChime();\n\t\t\t\tif (self.playChime) {\n\t\t\t\t\tdocument.getElementById('boxchime').src = SDK.url + \"/images/sound.svg\";\n\t\t\t\t} else {\n\t\t\t\t\tdocument.getElementById('boxchime').src = SDK.url + \"/images/mute.svg\";\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"toggleSpeak\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"toggleSpeak\").addEventListener(\"click\", function() {\n\t\t\t\tself.toggleSpeak();\n\t\t\t\tif (self.speak) {\n\t\t\t\t\tdocument.getElementById('boxtalk').src = SDK.url + \"/images/talk.svg\";\n\t\t\t\t} else {\n\t\t\t\t\tdocument.getElementById('boxtalk').src = SDK.url + \"/images/talkoff.svg\";\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"toggleListen\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"toggleListen\").addEventListener(\"click\", function() {\n\t\t\t\tlisten = !listen;\n\t\t\t\tif (listen) {\n\t\t\t\t\tSDK.startSpeechRecognition();\n\t\t\t\t\tdocument.getElementById('boxmic').src = SDK.url + \"/images/mic.svg\";\n\t\t\t\t} else {\n\t\t\t\t\tSDK.stopSpeechRecognition();\n\t\t\t\t\tdocument.getElementById('boxmic').src = SDK.url + \"/images/micoff.svg\";\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tdocument.getElementById(this.prefix + \"boxmin\").addEventListener(\"click\", function() {\n\t\t\tself.minimizeBox();\n\t\t\treturn false;\n\t\t});\n\t\tif (this.promptContactInfo) {\n\t\t\tdocument.getElementById(this.prefix + \"contactboxmin\").addEventListener(\"click\", function() {\n\t\t\t\tself.minimizeContactInfoBox();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tdocument.getElementById(this.prefix + \"contactconnect\").addEventListener(\"click\", function() {\n\t\t\t\tself.contactConnect();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (document.getElementById(this.prefix + \"boxmax\") != null) {\n\t\t\tdocument.getElementById(this.prefix + \"boxmax\").addEventListener(\"click\", function() {\n\t\t\t\tself.popup();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t\tif (this.showClose) {\n\t\t\tdocument.getElementById(this.prefix + \"boxclose\").addEventListener(\"click\", function() {\n\t\t\t\tself.closeBox();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tdocument.getElementById(this.prefix + \"boxclose2\").addEventListener(\"click\", function() {\n\t\t\t\tself.closeBox();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tdocument.getElementById(this.prefix + \"boxbarmax\").addEventListener(\"click\", function() {\n\t\t\t\tself.maximizeBox();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tdocument.getElementById(this.prefix + \"boxbarmax2\").addEventListener(\"click\", function() {\n\t\t\t\tself.maximizeBox();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t} else {\n\t\t\tdocument.getElementById(this.prefix + \"boxbar\").addEventListener(\"click\", function() {\n\t\t\t\tself.maximizeBox();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t}\n\t\n\tthis.showChatLog = function() {\n\t\tvar avatarDiv = document.getElementById(this.prefix + \"avatar-div\");\n\t\tif (avatarDiv != null) {\n\t\t\tavatarDiv.style.display = \"none\";\n\t\t}\n\t\tvar online = document.getElementById(this.prefix + \"online\");\n\t\tif (online != null) {\n\t\t\tonline.style.display = \"inline\";\n\t\t}\n\t\tvar bubbleDiv = document.getElementById(this.prefix + \"bubble-div\");\n\t\tif (bubbleDiv != null) {\n\t\t\tbubbleDiv.style.display = \"none\";\n\t\t}\n\t\tvar noBubblePlain = document.getElementsByClassName(this.prefix + \"no-bubble-plain\");\n\t\tif (noBubblePlain != null && noBubblePlain.length != 0) {\n\t\t\tnoBubblePlain[0].style.display = \"none\";\n\t\t}\n\t\tvar scroller = document.getElementById(this.prefix + \"scroller\");\n\t\tif (scroller != null) {\n\t\t\tscroller.style.display = \"inline-block\";\n\t\t}\n\t\tdocument.getElementById(this.prefix + \"showChatLog\").style.display = \"none\";\n\t\tdocument.getElementById(this.prefix + \"showAvatarBot\").style.display = \"block\";\n\t\tif (this.background == null && this.backgroundIfNotChrome) {\n\t\t\tvar box = document.getElementById(this.prefix + \"box\");\n\t\t\tif (box != null) {\n\t\t\t\tbox.style.backgroundColor = \"#fff\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tthis.showAvatarBot = function() {\n\t\tvar online = document.getElementById(this.prefix + \"online\");\n\t\tif (online != null) {\n\t\t\tonline.style.display = \"none\";\n\t\t}\n\t\tvar scroller = document.getElementById(this.prefix + \"scroller\");\n\t\tif (scroller != null) {\n\t\t\tscroller.style.display = \"none\";\n\t\t}\n\t\tvar avatarDiv = document.getElementById(this.prefix + \"avatar-div\");\n\t\tif (avatarDiv != null) {\n\t\t\tavatarDiv.style.display = \"inline-block\";\n\t\t}\n\t\tvar bubbleDiv = document.getElementById(this.prefix + \"bubble-div\");\n\t\tif (bubbleDiv != null) {\n\t\t\tbubbleDiv.style.display = \"inherit\";\n\t\t}\n\t\tvar noBubblePlain = document.getElementsByClassName(this.prefix + \"no-bubble-plain\");\n\t\tif (noBubblePlain != null && noBubblePlain.length != 0) {\n\t\t\tnoBubblePlain[0].style.display = \"inherit\";\n\t\t}\n\t\tdocument.getElementById(this.prefix + \"showChatLog\").style.display = \"block\";\n\t\tdocument.getElementById(this.prefix + \"showAvatarBot\").style.display = \"none\";\n\t\tif (this.background == null && this.backgroundIfNotChrome) {\n\t\t\tvar box = document.getElementById(this.prefix + \"box\");\n\t\t\tif (box != null) {\n\t\t\t\tbox.style.backgroundColor = null;\n\t\t\t\tbox.style.border = null;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t * Minimize the live chat embedding box.\n\t */\n\tthis.minimizeBox = function() {\n\t\tthis.onlineBar = false;\n\t\tvar element = null;\n\t\tif (this.promptContactInfo) {\n\t\t\telement = document.getElementById(this.prefix + \"contactinfo\");\n\t\t\tif (element != null) {\n\t\t\t\telement.style.display = 'none';\n\t\t\t}\n\t\t}\n\t\telement = document.getElementById(this.prefix + \"box\");\n\t\tif (element != null) {\n\t\t\telement.style.display = 'none';\n\t\t}\n\t\tvar onlineDiv = document.getElementById(this.prefix + \"online\");\n\t\tif (onlineDiv != null) {\n\t\t\tonlineDiv.style.display = 'none';\n\t\t}\n\t\tif (this.promptEmailChatLog) {\n\t\t\telement = document.getElementById(this.prefix + \"emailchatlogemail\");\n\t\t\tif (element != null) {\n\t\t\t\telement.value = this.contactEmail;\n\t\t\t}\n\t\t\telement = document.getElementById(this.prefix + \"emailchatlogdialog\");\n\t\t\tif (element != null) {\n\t\t\t\telement.style.display = 'inline';\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\telement = document.getElementById(this.prefix + \"boxbar\");\n\t\tif (element != null) {\n\t\t\telement.style.display = 'inline';\n\t\t}\n\t\tif (this.prefix.indexOf(\"livechat\") != -1) {\n\t\t\telement = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"livechat\")) + \"boxbar\");\n\t\t\tif (element != null) {\n\t\t\t\telement.style.display = 'inline';\n\t\t\t}\n\t\t}\n\t\tif (this.prefix.indexOf(\"chat\") != -1) {\n\t\t\telement = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"chat\")) + \"boxbar\");\n\t\t\tif (element != null) {\n\t\t\t\telement.style.display = 'inline';\n\t\t\t}\n\t\t}\n\t\tthis.exit();\n\t\tsetTimeout(function() {\n\t\t\tself.exit();\n\t\t}, 100);\n\t\treturn false;\n\t}\n\t\n\t/**\n\t * Minimize the email chat log confirm dialog.\n\t */\n\tthis.minimizeEmailChatLogBox = function() {\n\t\tif (this.promptContactInfo) {\n\t\t\tdocument.getElementById(this.prefix + \"contactinfo\").style.display = 'none';\n\t\t}\n\t\tdocument.getElementById(this.prefix + \"box\").style.display = 'none';\n\t\tdocument.getElementById(this.prefix + \"emailchatlogdialog\").style.display = 'none';\n\t\tdocument.getElementById(this.prefix + \"boxbar\").style.display = 'inline';\n\t\tif (this.prefix.indexOf(\"livechat\") != -1) {\n\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"livechat\")) + \"boxbar\");\n\t\t\tif (chatbot != null) {\n\t\t\t\tchatbot.style.display = 'inline';\n\t\t\t}\n\t\t}\n\t\tif (this.prefix.indexOf(\"chat\") != -1) {\n\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"chat\")) + \"boxbar\");\n\t\t\tif (chatbot != null) {\n\t\t\t\tchatbot.style.display = 'inline';\n\t\t\t}\n\t\t}\n\t\tthis.exit();\n\t\tsetTimeout(function() {\n\t\t\tself.exit();\n\t\t}, 100);\n\t\treturn false;\n\t}\n\t\n\t/**\n\t * Minimize the email chat log confirm dialog.\n\t */\n\tthis.sendEmailChatLogBox = function() {\n\t\tthis.contactEmail = document.getElementById(this.prefix + \"emailchatlogemail\").value;\n\t\tthis.sendEmailChatLog();\n\t\tif (this.promptContactInfo) {\n\t\t\tdocument.getElementById(this.prefix + \"contactinfo\").style.display = 'none';\n\t\t}\n\t\tdocument.getElementById(this.prefix + \"box\").style.display = 'none';\n\t\tdocument.getElementById(this.prefix + \"emailchatlogdialog\").style.display = 'none';\n\t\tdocument.getElementById(this.prefix + \"boxbar\").style.display = 'inline';\n\t\tif (this.prefix.indexOf(\"livechat\") != -1) {\n\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"livechat\")) + \"boxbar\");\n\t\t\tif (chatbot != null) {\n\t\t\t\tchatbot.style.display = 'inline';\n\t\t\t}\n\t\t}\n\t\tif (this.prefix.indexOf(\"chat\") != -1) {\n\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"chat\")) + \"boxbar\");\n\t\t\tif (chatbot != null) {\n\t\t\t\tchatbot.style.display = 'inline';\n\t\t\t}\n\t\t}\n\t\tsetTimeout(function() {\n\t\t\tself.exit();\n\t\t}, 100);\n\t\treturn false;\n\t}\n\t\n\t/**\n\t * Minimize the contact info box.\n\t */\n\tthis.minimizeContactInfoBox = function() {\n\t\tif (this.promptContactInfo) {\n\t\t\tdocument.getElementById(this.prefix + \"contactinfo\").style.display = 'none';\n\t\t}\n\t\tdocument.getElementById(this.prefix + \"box\").style.display = 'none';\n\t\tdocument.getElementById(this.prefix + \"boxbar\").style.display = 'inline';\n\t\tif (this.prefix.indexOf(\"livechat\") != -1) {\n\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"livechat\")) + \"boxbar\");\n\t\t\tif (chatbot != null) {\n\t\t\t\tchatbot.style.display = 'inline';\n\t\t\t}\n\t\t}\n\t\tif (this.prefix.indexOf(\"chat\") != -1) {\n\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"chat\")) + \"boxbar\");\n\t\t\tif (chatbot != null) {\n\t\t\t\tchatbot.style.display = 'inline';\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t\n\t/**\n\t * Check contact info and connect.\n\t */\n\tthis.contactConnect = function() {\n\t\tthis.hasContactInfo = true;\n\t\tthis.contactName = document.getElementById(this.prefix + \"contactname\").value;\n\t\tvar ok = true;\n\t\tif (this.contactName != null && this.contactName == \"\") {\n\t\t\tok = false;\n\t\t\tdocument.getElementById(this.prefix + \"contactname\").style.borderColor = \"red\";\n\t\t\tdocument.getElementById(this.prefix + \"contactname\").placeholder = SDK.translate(\"Enter name\");\n\t\t}\n\t\tthis.contactEmail = document.getElementById(this.prefix + \"contactemail\").value;\n\t\tif (this.contactEmail != null && this.contactEmail.indexOf(\"@\") == -1) {\n\t\t\tok = false;\n\t\t\tdocument.getElementById(this.prefix + \"contactemail\").style.borderColor = \"red\";\n\t\t\tdocument.getElementById(this.prefix + \"contactemail\").placeholder = SDK.translate(\"Enter valid email\");\n\t\t}\n\t\tthis.contactPhone = document.getElementById(this.prefix + \"contactphone\").value;\n\t\tthis.contactInfo = this.contactName + \" \" + this.contactEmail + \" \" + this.contactPhone;\n\t\tif (ok) {\n\t\t\tthis.maximizeBox();\n\t\t}\n\t}\n\t\n\t/**\n\t * Maximize the embedding div in the current webpage.\n\t */\n\tthis.maximizeBox = function() {\n\t\tthis.onlineBar = true;\n\t\tif (this.promptContactInfo && !this.hasContactInfo) {\n\t\t\tdocument.getElementById(this.prefix + \"contactinfo\").style.display = 'inline';\n\t\t\tdocument.getElementById(this.prefix + \"boxbar\").style.display = 'none';\n\t\t\tdocument.getElementById(this.prefix + \"box\").style.display = 'none';\n\t\t\tif (this.prefix.indexOf(\"livechat\") != -1) {\n\t\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"livechat\")) + \"boxbar\");\n\t\t\t\tif (chatbot != null) {\n\t\t\t\t\tchatbot.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.prefix.indexOf(\"chat\") != -1) {\n\t\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"chat\")) + \"boxbar\");\n\t\t\t\tif (chatbot != null) {\n\t\t\t\t\tchatbot.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.promptContactInfo) {\n\t\t\t\tdocument.getElementById(this.prefix + \"contactinfo\").style.display = 'none';\n\t\t\t}\n\t\t\tdocument.getElementById(this.prefix + \"boxbar\").style.display = 'none';\n\t\t\tdocument.getElementById(this.prefix + \"box\").style.display = 'inline';\n\t\t\tif (this.prefix.indexOf(\"livechat\") != -1) {\n\t\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"livechat\")) + \"boxbar\");\n\t\t\t\tif (chatbot != null) {\n\t\t\t\t\tchatbot.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.prefix.indexOf(\"chat\") != -1) {\n\t\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"chat\")) + \"boxbar\");\n\t\t\t\tif (chatbot != null) {\n\t\t\t\t\tchatbot.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar chat = new LiveChatConnection();\n\t\t\tchat.sdk = this.sdk;\n\t\t\tif (this.contactInfo != null) {\n\t\t\t\tchat.contactInfo = this.contactInfo;\n\t\t\t}\n\t\t\tvar channel = new ChannelConfig();\n\t\t\tchannel.id = this.instance;\n\t\t\tchat.listener = this;\n\t\t\tchat.connect(channel, this.sdk.user);\n\t\t\tvar self = this;\n\t\t\tif (this.autoAccept != null) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tchat.accept();\n\t\t\t\t}, self.autoAccept);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t\n\t/**\n\t * Close the embedding div in the current webpage.\n\t */\n\tthis.closeBox = function() {\n\t\tif (this.promptContactInfo) {\n\t\t\tdocument.getElementById(this.prefix + \"contactinfo\").style.display = 'none';\n\t\t}\n\t\tdocument.getElementById(this.prefix + \"boxbar\").style.display = 'none';\n\t\tdocument.getElementById(this.prefix + \"box\").style.display = 'none';\n\t\tif (this.prefix.indexOf(\"livechat\") != -1) {\n\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"livechat\")) + \"boxbar\");\n\t\t\tif (chatbot != null) {\n\t\t\t\tchatbot.style.display = 'none';\n\t\t\t}\n\t\t}\n\t\tif (this.prefix.indexOf(\"chat\") != -1) {\n\t\t\tvar chatbot = document.getElementById(this.prefix.substring(0, this.prefix.indexOf(\"chat\")) + \"boxbar\");\n\t\t\tif (chatbot != null) {\n\t\t\t\tchatbot.style.display = 'none';\n\t\t\t}\n\t\t}\n\t\tthis.exit();\n\t\tvar self = this;\n\t\tsetTimeout(function() {\n\t\t\tself.exit();\n\t\t}, 100);\n\t\treturn false;\n\t}\n\t\n\t/**\n\t * Create a popup window live chat session.\n\t */\n\tthis.popup = function() {\n\t\tvar box = document.getElementById(this.prefix + \"box\");\n\t\tif (box != null) {\n\t\t\tbox.style.display = 'none';\n\t\t}\n\t\tif (this.popupURL != null) {\n\t\t\tvar popupURL = this.popupURL;\n\t\t\tif (popupURL.indexOf(\"livechat?\") != -1) {\n\t\t\t\tif (this.contactInfo != null && this.contactInfo != \"\") {\n\t\t\t\t\tpopupURL = popupURL + \"&info=\" + encodeURI(this.contactInfo);\n\t\t\t\t}\n\t\t\t\tif (this.translate == true && this.lang != null && this.lang != \"\") {\n\t\t\t\t\tpopupURL = popupURL + \"&translate=\" + encodeURI(this.lang);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSDK.popupwindow(popupURL, 'child', 700, 520);\n\t\t} else {\n\t\t\tvar form = document.createElement(\"form\");\n\t\t\tform.setAttribute(\"method\", \"post\");\n\t\t\tform.setAttribute(\"action\", SDK.url + \"/livechat\");\n\t\t\tform.setAttribute(\"target\", 'child');\n \n\t\t\tvar input = document.createElement('input');\n\t\t\tinput.type = \"hidden\";\n\t\t\tinput.name = \"id\";\n\t\t\tinput.value = this.instance;\n\t\t\tform.appendChild(input);\n\n\t\t\tinput = document.createElement('input');\n\t\t\tinput.type = \"hidden\";\n\t\t\tinput.name = \"embedded\";\n\t\t\tinput.value = \"embedded\";\n\t\t\tform.appendChild(input);\n \n\t\t\tinput = document.createElement('input');\n\t\t\tinput.type = \"hidden\";\n\t\t\tinput.name = \"chat\";\n\t\t\tinput.value = \"true\";\n\t\t\tform.appendChild(input);\n \n\t\t\tinput = document.createElement('input');\n\t\t\tinput.type = \"hidden\";\n\t\t\tinput.name = \"application\";\n\t\t\tinput.value = this.connection.credentials.applicationId;\n\t\t\tform.appendChild(input);\n \n\t\t\tif (this.css != null) {\n\t\t\t\tinput = document.createElement('input');\n\t\t\t\tinput.type = \"hidden\";\n\t\t\t\tinput.name = \"css\";\n\t\t\t\tinput.value = this.css;\n\t\t\t\tform.appendChild(input);\n\t\t\t}\n \n\t\t\tvar input = document.createElement('input');\n\t\t\tinput.type = 'hidden';\n\t\t\tinput.name = \"language\";\n\t\t\tinput.value = SDK.lang;\n\t\t\tform.appendChild(input);\n\t\t\t\n\t\t\tif (this.translate == true && this.lang != null && this.lang != \"\") {\n\t\t\t\tvar input = document.createElement('input');\n\t\t\t\tinput.type = 'hidden';\n\t\t\t\tinput.name = \"translate\";\n\t\t\t\tinput.value = this.lang;\n\t\t\t\tform.appendChild(input);\n\t\t\t}\n\t\t\t\n\t\t\tinput = document.createElement('input');\n\t\t\tinput.type = \"hidden\";\n\t\t\tinput.name = \"info\";\n\t\t\tinput.value = this.contactInfo;\n\t\t\tform.appendChild(input);\n\t\t\t\n\t\t\tSDK.body().appendChild(form);\n\t\t\t\n\t\t\tSDK.popupwindow('','child', 700, 520);\n\t\t\t\n\t\t\tform.submit();\n\t\t\tSDK.body().removeChild(form);\n\t\t}\n\t\tthis.minimizeBox();\n\t\treturn false;\n\t}\n\t\n\twindow.onfocus = function() {\n\t\tself.isActive = true;\n\t\tif (document.title != self.windowTitle) {\n\t\t\tdocument.title = self.windowTitle;\n\t\t}\n\t}; \n\n\twindow.onblur = function() {\n\t\tself.isActive = false;\n\t};\n\n\t\n\t/**\n\t * Search for link using <a href=\"chat:yes\">...\n\t * Switch them to use an onclick to post the chat back to the chat.\n\t */\n\tthis.linkChatPostbacks = function(node) {\n\t\tvar self = this;\n\t\tvar links = node.getElementsByTagName(\"a\");\n\t\tfor (var index = 0; index < links.length; index++) {\n\t\t\tvar a = links[index];\n\t\t\tvar href = a.getAttribute(\"href\");\n\t\t\tif (href != null && href.indexOf(\"chat:\") != -1) {\n\t\t\t\tvar chat = href.substring(\"chat:\".length, href.length).trim();\n\t\t\t\tvar temp = function(param, element) {\n\t\t\t\t\telement.onclick = function() {\n\t\t\t\t\t\tself.connection.sendMessage(param);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\ttemp(chat, a);\n\t\t\t}\n\t\t}\n\t\tvar buttons = node.getElementsByTagName(\"button\");\n\t\tfor (var index = 0; index < buttons.length; index++) {\n\t\t\tvar button = buttons[index];\n\t\t\tif (button.parentNode.nodeName == \"A\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar chat = button.textContent;\n\t\t\tif (chat != null && chat.length > 0) {\n\t\t\t\tvar temp = function(param, element) {\n\t\t\t\t\telement.onclick = function() {\n\t\t\t\t\t\tself.connection.sendMessage(param);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\ttemp(chat, button);\n\t\t\t}\n\t\t}\n\t\tvar choices = node.getElementsByTagName(\"select\");\n\t\tfor (var index = 0; index < choices.length; index++) {\n\t\t\tvar choice = choices[index];\n\t\t\tvar temp = function(param) {\n\t\t\t\tparam.addEventListener(\"change\", function() {\n\t\t\t\t\tself.connection.sendMessage(param.value);\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\t\t\ttemp(choice);\n\t\t}\n\t}\n\t\t\n\t/**\n\t * A user message was received from the channel.\n\t */\n\tthis.message = function(message) {\n\t\tvar index = message.indexOf(':');\n\t\tvar speaker = '';\n\t\tif (index != -1) {\n\t\t\tspeaker = message.substring(0, index + 1);\n\t\t\tresponseText = message.substring(index + 2, message.length);\n\t\t} else {\n\t\t\tresponseText = message;\n\t\t}\n\t\tif (speaker != (this.nick + ':')) {\n\t\t\tif (this.playChime) {\n\t\t\t\tSDK.chime();\n\t\t\t}\n\t\t\tif (this.avatar && this.sdk != null && this.avatarId != null) {\n\t\t\t\tvar config = new AvatarMessage();\n\t\t\t\tconfig.message = SDK.stripTags(responseText);\n\t\t\t\tconfig.avatar = this.avatarId;\n\t\t\t\tif (this.nativeVoice && SDK.speechSynthesis) {\n\t\t\t\t\tconfig.speak = false;\n\t\t\t\t} else {\n\t\t\t\t\tconfig.speak = this.speak;\n\t\t\t\t\tconfig.voice = this.voice;\n\t\t\t\t\tconfig.voiceMod = this.voiceMod;\n\t\t\t\t}\n\t\t\t\t//config.emote = emote;\n\t\t\t\t//config.action = action;\n\t\t\t\t//config.pose = pose;\n\t\t\t\tvar self = this;\n\t\t\t\tthis.sdk.avatarMessage(config, function(responseMessage) {\n\t\t\t\t\tself.updateAvatar(responseMessage, null);\n\t\t\t\t});\n\t\t\t} else if (this.speak) {\n\t\t\t\tSDK.tts(SDK.stripTags(responseText), this.voice, this.nativeVoice, this.lang, this.nativeVoiceName);\n\t\t\t}\n\t\t\tdocument.getElementById(this.prefix + 'response').innerHTML = SDK.linkURLs(responseText);\n\t\t\tthis.linkChatPostbacks(document.getElementById(this.prefix + 'response'));\n\t\t\t// Fix Chrome bug,\n\t\t\tif (SDK.fixChromeResizeCSS && SDK.isChrome()) {\n\t\t\t\tvar padding = document.getElementById(this.prefix + 'response').parentNode.parentNode.style.padding;\n\t\t\t\tdocument.getElementById(this.prefix + 'response').parentNode.parentNode.style.padding = \"7px\";\n\t\t\t\tvar self = this;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tdocument.getElementById(self.prefix + 'response').parentNode.parentNode.style.padding = padding;\n\t\t\t\t}, 10);\n\t\t\t}\n\t\t\tthis.switchText = false;\n\t\t} else {\n\t\t\tthis.switchText = true;\n\t\t}\n\t\tvar scroller = document.getElementById(this.prefix + 'scroller');\n\t\tvar consolepane = document.getElementById(this.prefix + 'console');\n\t\tif (scroller == null || consolepane == null) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.chatLog) {\n\t\t\tvar tr = document.createElement('tr');\n\t\t\ttr.style.verticalAlign = \"top\";\n\t\t\tvar td = document.createElement('td');\n\t\t\tvar td2 = document.createElement('td');\n\t\t\tvar div = document.createElement('div');\n\t\t\tvar span = document.createElement('span');\n\t\t\tvar br = document.createElement('br');\n\t\t\tvar span2 = document.createElement('span');\n\t\t\tvar div2 = document.createElement('div');\n\t\t\tvar chatClass = this.prefix + 'chat-1';\n\t\t\tdiv.className = this.prefix + 'chat-1-div';\n\t\t\tdiv2.className = this.prefix + 'chat-1-div-2';\n\t\t\tspan.className = this.prefix + 'chat-user-1';\n\t\t\ttd.className = this.prefix + 'chat-user-1';\n\t\t\tif (this.switchText) {\n\t\t\t\ttd.className = this.prefix + 'chat-user-2';\n\t\t\t\tchatClass = this.prefix + 'chat-2';\n\t\t\t\tdiv.className = this.prefix + 'chat-2-div';\n\t\t\t\tdiv2.className = this.prefix + 'chat-2-div-2';\n\t\t\t\tspan.className = this.prefix + 'chat-user-2';\n\t\t\t}\n\t\t\tvar userImg = document.createElement('img');\n\t\t\tuserImg.className = this.prefix + 'chat-user';\n\t\t\tvar speakerName = speaker.slice(0, -1);\n\t\t\tif (speakerName != \"Info\" && speakerName != \"Error\") {\n\t\t\t\tfor(var key in this.users) {\n\t\t\t\t\tif (key === speakerName) {\n\t\t\t\t\t\tuserImg.setAttribute('alt', speakerName);\n\t\t\t\t\t\tuserImg.setAttribute('src', this.users[key]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttd.appendChild(userImg);\n\t\t\ttd.setAttribute('nowrap', 'nowrap');\n\t\t\ttd2.className = chatClass;\n\t\t\ttd2.setAttribute('align', 'left');\n\t\t\ttd2.setAttribute('width', '100%');\n\t\t\t\n\t\t\tvar date = new Date(); \n\t\t\tvar time = date.getHours() + \":\" + ((date.getMinutes() < 10)? \"0\" : \"\") + date.getMinutes() + \":\" + ((date.getSeconds() < 10)? \"0\" : \"\") + date.getSeconds();\n\t\t\tspan.innerHTML = speaker + \" <small>\" + time + \"</small>\";\n\t\t\tspan2.className = chatClass;\n\t\t\tspan2.innerHTML = SDK.linkURLs(responseText);\n\t\t\tthis.linkChatPostbacks(span2);\n\t\t\tconsolepane.appendChild(tr);\n\t\t\t\n\t\t\ttr.appendChild(td);\n\t\t\ttr.appendChild(td2);\n\t\t\tdiv.appendChild(span);\n\t\t\tdiv.appendChild(br);\n\t\t\tdiv.appendChild(div2);\n\t\t\ttd2.appendChild(div);\n\t\t\tdiv2.appendChild(span2);\n\t\t}\n\t\tthis.switchText = !this.switchText;\n\t\twhile (consolepane.childNodes.length > 500) {\n\t\t\tconsolepane.removeChild(consolepane.firstChild);\n\t\t}\n\t\tscroller.scrollTop = scroller.scrollHeight;\n\t\tif (this.focus) {\n\t\t\tdocument.getElementById(this.prefix + 'chat').focus();\n\t\t}\n\t\tif (!this.isActive) {\n\t\t\tdocument.title = SDK.stripTags(responseText);\n\t\t}\n\t};\n\n\t/**\n\t * Update the avatar's image/video/audio from the message response.\n\t */\n\tthis.updateAvatar = function(responseMessage, afterFunction) {\n\t\tvar urlprefix = this.connection.credentials.url + \"/\";\n\t\tSDK.updateAvatar(responseMessage, this.speak, urlprefix, this.prefix, null, afterFunction, this.nativeVoice, this.lang, this.nativeVoiceName);\n\t};\n\t\n\t/**\n\t * An informational message was received from the channel.\n\t * Such as a new user joined, private request, etc.\n\t */\t\n\tthis.info = function(message) {\n\t\tif (this.connection.nick != null && this.connection.nick != \"\") {\n\t\t\tthis.nick = this.connection.nick;\n\t\t}\n\t\tthis.message(message);\n\t};\n\n\t/**\n\t * An error message was received from the channel.\n\t * This could be an access error, or message failure.\n\t */\t\n\tthis.error = function(message) {\n\t\tthis.message(message);\n\t};\n\t\n\t/**\n\t * Notification that the connection was closed.\n\t */\n\tthis.closed = function() {};\n\t\n\t/**\n\t * The channels users changed (user joined, left, etc.)\n\t * This contains a comma separated values (CSV) list of the current channel users.\n\t * It can be passed to the SDKConnection.getUsers() API to obtain the UserConfig info for the users.\n\t */\n\tthis.updateUsers = function(usersCSV) {};\n\n\t/**\n\t * The channels users changed (user joined, left, etc.)\n\t * This contains a HTML list of the current channel users.\n\t * It can be inserted into an HTML document to display the users.\n\t */\n\tthis.updateUsersXML = function(usersXML) {\n\t\tif (!this.linkUsers) {\n\t\t\tusersXML = usersXML.split('<a').join('<span');\n\t\t\tusersXML = usersXML.split('</a>').join('</span>');\n\t\t}\n\t\tvar onlineList = document.getElementById(this.prefix + 'online');\n\t\tif (onlineList == null) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this.chatLog) {\n\t\t\tonlineList.style.height = \"60px\";\n\t\t}\n\t\tvar div = document.createElement('div');\n\t\tdiv.innerHTML = usersXML;\n\t\tvar children = div.childNodes[0].childNodes;\n\t\tvar usersArray = {};\n\t\tvar size = children.length;\n\t\tfor(var i = 0; i < size; i++) {\n\t\t\tvar userName = children[i].innerText;\n\t\t\tvar child = children[i].childNodes;\n\t\t\tvar imageSrc = child[0].getAttribute('src');\n\t\t\tusersArray[userName] = imageSrc;\n\t\t}\n\t\tthis.users = usersArray;\n\t\tif (this.onlineBar) {\n\t\t\tvar onlineBar = onlineList;\n\t\t\tonlineBar.innerHTML = '';\n\t\t\tif (this.chatroom || this.isFrame) { // displaying list of users on top\n\t\t\t\tvar count = 0;\n\t\t\t\tvar ids = {};\n\t\t\t\tvar length = children.length;\n\t\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t\tvar child = children[i - count];\n\t\t\t\t\tids[child.id] = child.id;\n\t\t\t\t\tif (document.getElementById(child.id) == null) {\n\t\t\t\t\t\tonlineList.appendChild(child);\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tonlineList.style.margin = \"0\";\n\t\t\t\tonlineList.style.display = 'inline';\n\t\t\t}\n\t\t\telse { // displaying only single bot on top\n\t\t\t\tvar length = children.length;\n\t\t\t\tvar child = children[length - 1];\n\t\t\t\tvar keys = [];\n\t\t\t\tfor(var keyItem in this.users) {\n\t\t\t\t\tkeys.push(keyItem);\n\t\t\t\t}\n\t\t\t\tvar botName = keys[keys.length - 1];\n\t\t\t\tvar botImageSrc = this.users[botName];\n\t\t\t\tif (typeof botName === 'undefined' || typeof botImageSrc === 'undefined') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar botImage = document.createElement('img');\n\t\t\t\tbotImage.className = this.prefix + \"-bot-image\";\n\t\t\t\tbotImage.setAttribute('alt', botName);\n\t\t\t\tbotImage.setAttribute('src', botImageSrc);\n\t\t\t\tvar botSpan = document.createElement('span');\n\t\t\t\tbotSpan.className = this.prefix + \"user-bot\";\n\t\t\t\tbotSpan.innerHTML = botName;\n\t\t\t\tonlineBar.append(botImage);\n\t\t\t\tonlineBar.append(botSpan);\n\t\t\t\tif (!this.isFrame) {\n\t\t\t\t\tif (!this.avatar) {\n\t\t\t\t\t\tonlineList.style.display = 'block';\n\t\t\t\t\t}\n\t\t\t\t\tvar line = document.createElement('hr');\n\t\t\t\t\tvar onlineDiv = document.getElementById(this.prefix + 'online-div');\n\t\t\t\t\tonlineDiv.appendChild(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tonlineList.innerHTML = '';\n\t\tvar div = document.createElement('div');\n\t\tdiv.innerHTML = usersXML;\n\t\tvar children = div.childNodes[0].childNodes;\n\t\tvar count = 0;\n\t\tvar length = children.length;\n\t\tvar ids = {};\n\t\t// Add missing user\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar child = children[i - count];\n\t\t\tids[child.id] = child.id;\n\t\t\tif (document.getElementById(child.id) == null) {\n\t\t\t\tonlineList.appendChild(child);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\t// Remove missing users\n\t\tvar onlineDiv = document.getElementById(this.prefix + 'online-div');\n\t\tif (onlineDiv == null) {\n\t\t\treturn;\n\t\t}\n\t\tchildren = onlineDiv.childNodes;\n\t\tcount = 0;\n\t\tlength = children.length;\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar child = children[i - count];\n\t\t\tif (child.id != (this.prefix + 'online') && ids[child.id] == null) {\n\t\t\t\tonlineDiv.removeChild(child);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Decrease the size of the video element for the userid.\n\t */\n\tthis.shrinkVideo = function(user) {\n\t\tvar id = 'user-' + encodeURIComponent(user);\n\t\tvar userdiv = document.getElementById(id);\n\t\tif (userdiv != null) {\n\t\t\tvar media = userdiv.firstElementChild;\n\t\t\tif (media != null) {\n\t\t\t\tmedia.height = media.height / 1.5;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Increase the size of the video element for the userid.\n\t */\n\tthis.expandVideo = function(user) {\n\t\tvar id = 'user-' + encodeURIComponent(user);\n\t\tvar userdiv = document.getElementById(id);\n\t\tif (userdiv != null) {\n\t\t\tvar media = userdiv.firstElementChild;\n\t\t\tif (media != null) {\n\t\t\t\tmedia.height = media.height * 1.5;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Mute the audio for the userid.\n\t */\n\tthis.muteAudio = function(user) {\n\t\tvar id = 'user-' + encodeURIComponent(user);\n\t\tvar userdiv = document.getElementById(id);\n\t\tif (userdiv != null) {\n\t\t\tvar media = userdiv.firstElementChild;\n\t\t\tif (media != null) {\n\t\t\t\tif (media.muted) {\n\t\t\t\t\tif (user != this.nick) {\n\t\t\t\t\t\tmedia.muted = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmedia.muted = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Mute the video for the userid.\n\t */\n\tthis.muteVideo = function(user) {\n\t\tvar id = 'user-' + encodeURIComponent(user);\n\t\tvar userdiv = document.getElementById(id);\n\t\tif (userdiv != null) {\n\t\t\tvar media = userdiv.firstElementChild;\n\t\t\tif (media != null) {\n\t\t\t\tif (media.paused) {\n\t\t\t\t\tmedia.play();\n\t\t\t\t\tmedia.style.opacity = 100;\n\t\t\t\t} else {\n\t\t\t\t\tmedia.pause();\n\t\t\t\t\tmedia.style.opacity = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tthis.toggleChime = function() {\n\t\tthis.playChime = !this.playChime;\n\t}\n\n\tthis.toggleSpeak = function() {\n\t\tthis.speak = !this.speak;\n\t}\n\n\tthis.toggleKeepAlive = function() {\n\t\tthis.connection.toggleKeepAlive();\n\t}\n\t\n\tthis.sendMessage = function() {\n\t\tvar message = document.getElementById(this.prefix + 'chat').value;\n\t\tif (message != '') {\n\t\t\tthis.connection.sendMessage(message);\n\t\t\tdocument.getElementById(this.prefix + 'chat').value = '';\n\t\t}\n\t\treturn false;\n\t};\n\n\tthis.sendImage = function() {\n\t\tif (!(window.File && window.FileReader && window.FileList && window.Blob)) {\n\t\t\talert('The File APIs are not fully supported in this browser.');\n\t\t\treturn false;\n\t\t}\n\t\tvar form = document.createElement(\"form\");\n\t\tform.enctype = \"multipart/form-data\";\n\t\tform.method = \"post\";\n\t\tform.name = \"fileinfo\";\n\t\tvar fileInput = document.createElement(\"input\");\n\t\tvar self = this;\n\t\tfileInput.name = \"file\";\n\t\tfileInput.type = \"file\";\n\t\tform.appendChild(fileInput);\n\t\tfileInput.onchange = function() {\n\t\t\tvar file = fileInput.files[0];\n\t\t\tself.connection.sendAttachment(file, true, form);\n\t\t}\n\t\tfileInput.click();\n\t\treturn false;\n\t};\n\n\tthis.sendAttachment = function() {\n\t\tif (!(window.File && window.FileReader && window.FileList && window.Blob)) {\n\t\t\talert('The File APIs are not fully supported in this browser.');\n\t\t\treturn false;\n\t\t}\n\t\tvar form = document.createElement(\"form\");\n\t\tform.enctype = \"multipart/form-data\";\n\t\tform.method = \"post\";\n\t\tform.name = \"fileinfo\";\n\t\tvar fileInput = document.createElement(\"input\");\n\t\tvar self = this;\n\t\tfileInput.name = \"file\";\n\t\tfileInput.type = \"file\";\n\t\tform.appendChild(fileInput);\n\t\tfileInput.onchange = function() {\n\t\t\tvar file = fileInput.files[0];\n\t\t\tself.connection.sendAttachment(file, false, form);\n\t\t}\n\t\tfileInput.click();\n\t\treturn false;\n\t};\n\n\tthis.ping = function() {\n\t\tthis.connection.ping();\n\t\tdocument.getElementById(this.prefix + 'chat').value = '';\n\t\treturn false;\n\t};\n\n\tthis.accept = function() {\n\t\tthis.connection.accept();\n\t\tdocument.getElementById(this.prefix + 'chat').value = '';\n\t\treturn false;\n\t};\n\n\tthis.exit = function() {\n\t\tif (this.connection != null) {\n\t\t\tthis.connection.exit();\n\t\t\tdocument.getElementById(this.prefix + 'chat').value = '';\n\t\t}\n\t\treturn false;\n\t};\n\n\tthis.spyMode = function() {\n\t\tthis.connection.spyMode();\n\t\tdocument.getElementById(this.prefix + 'chat').value = '';\n\t\treturn false;\n\t};\n\n\tthis.normalMode = function() {\n\t\tthis.connection.normalMode();\n\t\tdocument.getElementById(this.prefix + 'chat').value = '';\n\t\treturn false;\n\t};\n\n\tthis.boot = function() {\n\t\tdocument.getElementById(this.prefix + 'chat').value = 'boot: user';\n\t\treturn false;\n\t};\n\n\tthis.emailChatLog = function() {\n\t\tdocument.getElementById(this.prefix + 'chat').value = 'email: ' + (this.contactEmail == null ? '[email protected]' : this.contactEmail);\n\t\treturn false;\n\t};\n\n\tthis.sendEmailChatLog = function() {\n\t\tthis.connection.sendMessage('email: ' + this.contactEmail);\n\t\treturn false;\n\t};\n\n\tthis.whisper = function(user) {\n\t\tif (user == null) {\n\t\t\tuser = 'user';\n\t\t}\n\t\tdocument.getElementById(this.prefix + 'chat').value = 'whisper: ' + user + ': message';\n\t\treturn false;\n\t};\n\n\tthis.flag = function(user) {\n\t\tif (user != null) {\n\t\t\tdocument.getElementById(this.prefix + 'chat').value = 'flag: ' + user + ': reason';\n\t\t\treturn false;\n\t\t}\n\t\tdocument.getElementById(this.prefix + 'chat').value = 'flag: user: reason';\n\t\treturn false;\n\t};\n\n\tthis.pvt = function(user) {\n\t\tif (user != null) {\n\t\t\tthis.connection.pvt(user);\n\t\t\treturn false;\n\t\t}\n\t\tdocument.getElementById(this.prefix + 'chat').value = 'private: user';\n\t\treturn false;\n\t};\n\n\tthis.clear = function() {\n\t\tdocument.getElementById(this.prefix + 'response').innerHTML = '';\n\t\tvar console = document.getElementById(this.prefix + 'console');\n\t\tif (console != null) {\n\t\t\tconsole.innerHTML = '';\n\t\t}\n\t\treturn false;\n\t};\n}", "title": "" }, { "docid": "26ac0e2bf5ee330415973bfda3550482", "score": "0.59926015", "text": "function ChatUserInterface() {\n\tthis.container = null;\t\t\t\t\t\t// Contenaire HTML principal du chat\n\tthis.WaitingNotifications = [];\t\t\t\t// Tableau des notifications en attente\n\tthis.notifInDisplay = false;\t\t\t\t// Indique di une notification est en cours d'affichage\n\n\tthis.currentMousePos = { x: 0, y: 0 };\t\t// Position courante de la souris\n\n\tthis.fadeInDelay = 250;\t\t\t\t\t\t// Durée de fade in des notifications (en millisecondes)\n\tthis.dateOutDelay = 2000;\t\t\t\t\t// Durée de fade out des notifications (en millisecondes)\n\tthis.notifDuration = 3000;\t\t\t\t\t// Durée d'affichage des notifications (en millisecondes)\n}", "title": "" }, { "docid": "16057d5da870a6dd2abc584f82689715", "score": "0.5986141", "text": "function ChatResponse() {\t\n\t/** The conversation id for the message. This will be returned from the first response, and must be used for all subsequent messages to maintain the conversational state. Without the conversation id, the bot has no context for the reply. */\n\tthis.conversation;\n\t/** Server relative URL for the avatar image or video. */\n\tthis.avatar;\n\t/** Second avatar animation. */\n\tthis.avatar2;\n\t/** Third avatar animation. */\n\tthis.avatar3;\n\t/** Forth avatar animation. */\n\tthis.avatar4;\n\t/** Fifth avatar animation. */\n\tthis.avatar5;\n\t/** Avatar MIME file type, (mpeg, webm, ogg, jpeg, png) */\n\tthis.avatarType;\n\t/** Server relative URL for the avatar talking image or video. */\n\tthis.avatarTalk;\n\t/** Avatar talk MIME file type, (mpeg, webm, ogg, jpeg, png) */\n\tthis.avatarTalkType;\n\t/** Server relative URL for the avatar action image or video. */\n\tthis.avatarAction;\n\t/** Avatar action MIME file type, (mpeg, webm, ogg, jpeg, png) */\n\tthis.avatarActionType;\n\t/** Server relative URL for the avatar action audio image or video. */\n\tthis.avatarActionAudio;\n\t/** Avatar action audio MIME file type, (mpeg, wav) */\n\tthis.avatarActionAudioType;\n\t/** Server relative URL for the avatar audio image or video. */\n\tthis.avatarAudio;\n\t/** Avatar audio MIME file type, (mpeg, wav) */\n\tthis.avatarAudioType;\n\t/** Server relative URL for the avatar background image. */\n\tthis.avatarBackground;\n\t/** Server relative URL for the avatar speech audio file. */\n\tthis.speech;\n\t/** The bot's message text. */\n\tthis.message;\n\t/** Optional text to the original question. */\n\tthis.question;\n\t/**\n\t * Emotion attached to the bot's message, one of:\n\t * NONE,\n\t * LOVE, LIKE, DISLIKE, HATE,\n\t *\tRAGE, ANGER, CALM, SERENE,\n\t *\tECSTATIC, HAPPY, SAD, CRYING,\n\t *\tPANIC, AFRAID, CONFIDENT, COURAGEOUS,\n\t *\tSURPRISE, BORED,\n\t *\tLAUGHTER, SERIOUS\n\t */\n\tthis.emote;\n\t/** Action for the bot's messages, such as \"laugh\", \"smile\", \"kiss\", or mobile directive (for virtual assistants). */\n\tthis.action;\n\t/** Pose for the bot's messages, such as \"dancing\", \"sitting\", \"sleeping\". */\n\tthis.pose;\n\t/** JSON Command for the bot's message. This can be by the client for mobile virtual assistant functionality, games integration, or other uses. */\n\tthis.command;\n\t/** The debug log of processing the message. */\n\tthis.log;\n\n\tthis.parseXML = function(element) {\n\t\tthis.conversation = element.getAttribute(\"conversation\");\n\t\tthis.avatar = element.getAttribute(\"avatar\");\n\t\tthis.avatar2 = element.getAttribute(\"avatar2\");\n\t\tthis.avatar3 = element.getAttribute(\"avatar3\");\n\t\tthis.avatar4 = element.getAttribute(\"avatar4\");\n\t\tthis.avatar5 = element.getAttribute(\"avatar5\");\n\t\tthis.avatarType = element.getAttribute(\"avatarType\");\n\t\tthis.avatarTalk = element.getAttribute(\"avatarTalk\");\n\t\tthis.avatarTalkType = element.getAttribute(\"avatarTalkType\");\n\t\tthis.avatarAction = element.getAttribute(\"avatarAction\");\n\t\tthis.avatarActionType = element.getAttribute(\"avatarActionType\");\n\t\tthis.avatarActionAudio = element.getAttribute(\"avatarActionAudio\");\n\t\tthis.avatarActionAudioType = element.getAttribute(\"avatarActionAudioType\");\n\t\tthis.avatarAudio = element.getAttribute(\"avatarAudio\");\n\t\tthis.avatarAudioType = element.getAttribute(\"avatarAudioType\");\n\t\tthis.avatarBackground = element.getAttribute(\"avatarBackground\");\n\t\tthis.emote = element.getAttribute(\"emote\");\n\t\tthis.action = element.getAttribute(\"action\");\n\t\tthis.pose = element.getAttribute(\"pose\");\n\t\tthis.command = element.getAttribute(\"command\");\n\t\tthis.speech = element.getAttribute(\"speech\");\n\n\t\tvar node = element.getElementsByTagName(\"message\")[0];\n\t\tif (node != null) {\n\t\t\tthis.message = SDK.innerHTML(node);\n\t\t}\n\t\t\n\t\tnode = element.getElementsByTagName(\"log\")[0];\n\t\tif (node != null) {\n\t\t\tthis.log = SDK.innerHTML(node);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "49cc57f2384a28773dc8b7c745f7f0b1", "score": "0.5982252", "text": "function connectChat(data){\n Twilio.Chat.Client.create(data.jwt).then(chatClient => {\n _chatClient=chatClient;\n chatClient.getChannelByUniqueName(data.room)\n .then(channel => channel\n ,error => {\n if(error.body.code===50300){\n return chatClient.createChannel({\n uniqueName: data.room,\n friendlyName: data.room+' Chat Channel',\n });\n }\n else{\n console.log(error.body);\n }\n })\n .then(async channel => {\n await channel.join()\n .catch(err => {console.log(\"err: member already exists\")});\n channel.getMessages().then(msg=>{\n chat.innerHTML='';\n for (i = 0; i < msg.items.length; i++) {\n chat.innerHTML+='<div class=\"sender\">'+msg.items[i].author+'</div>'+\n '<div class=\"single-msg\">'+msg.items[i].body+'</div><br>';\n chat.scrollTop = chat.scrollHeight - chat.clientHeight;\n }\n });\n chatChannelListeners(channel);\n })\n }, error => {\n console.error(`Unable to connect chat: ${error}`);\n }); \n}", "title": "" }, { "docid": "d0ee8f83dde25f2cd18c733b3c2181fe", "score": "0.597858", "text": "function Chat() {\n var id = null;\n this.getId = function () {return id;};\n\n if (1 == arguments.length && arguments[0][rhoUtil.rhoIdParam()]) {\n if (moduleNS != arguments[0][rhoUtil.rhoClassParam()]) {\n throw \"Wrong class instantiation!\";\n }\n id = arguments[0][rhoUtil.rhoIdParam()];\n } else {\n id = rhoUtil.nextId();\n // constructor methods are following:\n \n }\n }", "title": "" }, { "docid": "79f20d1dfb65ca67c2cb0842b2143a30", "score": "0.59731513", "text": "MessageCallback(obj) {\r\n \r\n /* actions depend on command */\r\n switch (obj.command) {\r\n \r\n case \"GetEffectList\": {\r\n /* share our effect list with sender */\r\n if (obj.callback) {\r\n this.sendTo(obj.from, obj.command, this.serverCon.GetEffectList(), obj.callback);\r\n }\r\n break;\r\n }\r\n case \"ConfigSanityCheck\": {\r\n /* perform a sanity check on the given config */\r\n if (obj.callback) {\r\n this.sendTo(obj.from, obj.command, this.ConfigSanityCheck(obj.message), obj.callback);\r\n }\r\n break;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "e5a4436c48dbb16a3f5a5055f5f192cb", "score": "0.59682274", "text": "function ActionChat(bot, data) {\n this.eventType = 'chat';\n this.bot = bot;\n this.msg = data.dep[0].fun;\n}", "title": "" }, { "docid": "7d31b6e3369619ea5777dea69b19e54e", "score": "0.59403473", "text": "function ChatRoom() {\n\tthis.name = '';\t\t\t\t// Nom de l'instance\n\tthis.id = false;\t\t\t\t// Référence de l'instance dans le ChatManager\n\n\tthis.manager = false;\t\t\t// Instance du Manager\n\n\tthis.messages = [];\t\t\t\t// Tableau des messages de la salle\n\n\tthis.usersOnline = [];\t\t\t// Tableau des utilisateurs connecté à l'instance\n\tthis.privateChat = false;\t\t// Défini si l'instance en cours est une instance privée ou non\n}", "title": "" }, { "docid": "16d92f78fa9ab84991c812cd63d1d24d", "score": "0.5933352", "text": "function chat(respondent, subject) {\n console.log('hi, ' + respondent + ' how goes the ' + subject + ' we spoke of with ' + this.name);\n }", "title": "" }, { "docid": "736e99d569211a62001053ee1ff6d0e1", "score": "0.5921643", "text": "newMess(newMessage){\n let data_out = {\n type: 'message',\n body: newMessage\n }\n this.chatty_server.send(JSON.stringify(data_out));\n }", "title": "" }, { "docid": "a7aed712176a61c42f8a8dfa9235f8ae", "score": "0.5905547", "text": "componentDidMount() {\n const chatManager = new Chatkit.ChatManager({\n instanceLocator: instanceLocator,\n userId: 'Mat',\n tokenProvider: new Chatkit.TokenProvider({\n url: testToken\n })\n });\n\n //connecting the chatManager to the API\n chatManager.connect().then(currentUser => {\n this.currentUser = currentUser\n this.currentUser.subscribeToRoom({\n roomId: roomId,\n hooks: {\n onNewMessage: message => {\n this.setState({\n messages: [...this.state.messages, message]\n });\n }\n }\n });\n });\n }", "title": "" }, { "docid": "b4d45fade8f24e5e5de4cc3b071c4f92", "score": "0.59030116", "text": "function ChatMessage() {\n\tthis.origin = null;\t\t// Origine du message\n\tthis.type = null;\t\t// Type de message\n\tthis.message = null;\t// Contenu du message\n\tthis.date = null;\t\t// Date d'émission du message\n\n\tthis.read = false;\t\t// Indique si le message à été lu ou non\n}", "title": "" }, { "docid": "203e9463c1a279c18675a360f0499908", "score": "0.5901989", "text": "function XmppClient_init() {\n var client = this; // Allows the callback to close over reference to this\n this.clientName = $('.userjid')[0].value + this.resourceName;\n this.stropheConnection = new Strophe.Connection(this.boshUrl);\n this.chatManager = new ChatManager(document.getElementById(this.messageHook),\n\t\t\t\t this.clientName,\n\t\t\t\t this.sendMessage);\n\n $('.connect').click(function () {\n\t\t\tvar button = $('.connect').get(0);\n\t\t\tif (button.value == 'connect') {\n\t\t\t button.value = 'disconnect';\n\t\t\t var fulljid = $('.userjid')[0].value + client.resourceName;\n\t\t\t client.stropheConnection.connect(fulljid,\n\t\t\t\t\t $('.userpass').get(0).value,\n\t\t\t\t\t client.onConnect);\n\t\t\t} else {\n\t\t\t button.value = 'connect';\n\t\t\t client.stropheConnection.disconnect();\n\t\t\t }\n\t\t\t}\n\t\t );\n}", "title": "" }, { "docid": "afde0408ba803be671dc786198796627", "score": "0.5888411", "text": "constructor(createChatBotMessage, setStateFunc, createClientMessage) {\n this.createChatBotMessage = createChatBotMessage;\n this.setState = setStateFunc;\n this.createClientMessage = createClientMessage;\n }", "title": "" }, { "docid": "65fd63d6367eac62063bac1039d7220b", "score": "0.58769226", "text": "sendMessage(message) {}", "title": "" }, { "docid": "658dfb3dd2b31182d61be22792e13eb2", "score": "0.5871409", "text": "function ChatUser() {\n\tthis.id = false;\t\t\t// Identifiant de l'utilisateur\n\tthis.pseudo = '';\t\t\t// Pseudo\n\tthis.rank = 0;\t\t\t\t// Rang (membre, modo, admin, ...)\n\tthis.avatar = false;\t\t// URL de l'avatar\n\tthis.formats = ['jpg', 'png', 'gif'];\n\n\tthis.lastMessage = null;\t// Date de dernier message\n\n\tthis.instances = 0;\t\t\t// Nombre d'instances de connexions\n\tthis.isOnline = false;\t\t// Indique si l'utilisateur est connecté\n\tthis.isAFK = false;\t\t\t// Indique si l'utilisateur est absent\n\tthis.isWritting = false;\t// Indique si l'utilisateur est en train d'écrire\n\tthis.isMobile = false;\t\t// Indique si l'utilisateur est sur mobile\n\tthis.isPrivate = false;\t\t// Indique si l'utilisateur à une conversation privée en cours\n}", "title": "" }, { "docid": "e99cf0f1bbe6006fa06d1815584202d7", "score": "0.58708876", "text": "constructor()\n {\n var message = {}\n this.ws = new WebSocket(\"ws://149.153.106.133:8080/wstest\");\n gameNs.ws = this.ws\n //called when the websocket is opened\n //this.player = new Player(100,100,200,200);\n this.player = new Player(100,100,200,200);\n this.otherPlayer = new Player(300,500,200,200);\n this.ready = false;\n initCanvas();\n\n gameNs.ws.onopen = function() {\n message.type = \"test\";\n message.data = \"hello\";\n gameNs.ws.send(JSON.stringify(message));\n };\n\n\n }", "title": "" }, { "docid": "d2ae1c3c5415f50b6bacbf265e92ea1e", "score": "0.5870592", "text": "function ChatScreen() {\n // constructor(props) {\n // super(props);\n\n // this.onSend = this.onSend.bind(this);\n // this.onReceivedMessage = this.onReceivedMessage.bind(this);\n // this.getUserId = this.getUserId.bind(this);\n\n // this.state = {\n // messages: [],\n // userId: null,\n // username: null,\n // };\n\n // this.socket = SocketIOClient(\"http://192.168.1.37:8080\");\n // this.socket.on(\"messages\", this.onReceivedMessage);\n // this.socket.on(\"userId\", this.getUserId);\n // }\n\n // getUserId(data) {\n // const { userId } = data;\n // this.setState({ userId });\n // }\n\n // onReceivedMessage(mes) {\n // const arrMes = [{ ...mes.messages }];\n // this.setState((previousState) => ({\n // messages: GiftedChat.append(previousState.messages, arrMes),\n // }));\n // }\n // onSend(messages) {\n // const mes = messages[0];\n // const { username } = this.state;\n // mes[\"username\"] = username;\n // this.socket.emit(\"messages\", mes);\n // }\n const [messages, setMessages] = useState([]);\n\n const onSend = useCallback((messages = []) => {\n setMessages((previousMessages) =>\n GiftedChat.append(previousMessages, messages)\n );\n }, []);\n\n return (\n <>\n <GiftedChat\n messages={messages}\n onSend={(messages) => onSend(messages)}\n user={{\n _id: 1,\n }}\n />\n </>\n );\n}", "title": "" }, { "docid": "8cab23d31789c4277d06a93aa7e82a2f", "score": "0.5870482", "text": "function startChatApi(){\n var lpNumber = LPVariables.LPNumber; \n var appKey = LPVariables.AppKey;\n if(lpNumber && appKey){\n chat = new lpTag.taglets.ChatOverRestAPI({\n lpNumber: lpNumber,\n appKey: appKey,\n //onInit: [showChatRequest, function (data) { writeLog(\"onInit\", data);} ],\n onInfo: [setAgentName, function (data) { writeLog(\"onInfo\", data); }],\n onLine: [addLines, function (data) { writeLog(\"onLine\", data); }],\n onState: [ updateChatState, function(data){ writeLog(\"onState\", data);} ],\n onStart: [hideChatRequest, updateChatState, bindInputForChat, setVisitorName, function (data) { writeLog(\"onStart\", data); }],\n onStop: [ hideSendRequest, updateChatState, unBindInputForChat],\n onAgentTyping: [agentTyping, function (data) { writeLog(\"onAgentTyping\", data); }],\n //onVisitorName: [setVisitorName, function (data) { writeLog(\"onVisitorName\", data); }],\n onRequestChat: function(data) { writeLog(\"onRequestChat\", data); }\n });\n showElementById(\"divChatContainer\");\n }\n }", "title": "" }, { "docid": "176be045490522d1a7bdace86d9cd8d6", "score": "0.5846852", "text": "async handleChat(text) {\n\n if (text === \"/joke\") {\n //return a joke\n try {\n const joke = await Joke.getJoke();\n\n this.send(JSON.stringify({ type: \"get-joke\", text: joke }));\n\n } catch (error) {\n //if can't get a joke back\n this.send(JSON.stringify({ type: \"get-joke\", text: \"no joke for you\" }));\n }\n } else if (text === \"/members\") {\n //list all members\n this.send(JSON.stringify({ type: \"members\", text: this.room.getMemberNames() }));\n\n } else if (text.startsWith(\"/name \")) {\n //change username\n const msgParts = text.split(\" \");\n const username = msgParts[1];\n const oldname = this.name;\n this.name = username;\n\n this.room.broadcast({\n type: \"note\",\n text: `${oldname} has been changed to ${username}`\n });\n\n } else if (text.startsWith(\"/priv \")) {\n //send to one user only\n const msgParts = text.split(\" \");\n const username = msgParts[1];\n const msg = `${text.substring(6 + username.length)}(Private message)`;\n\n const member = this.room.getMember(username);\n\n if (member != null) {\n const data = {\n name: this.name,\n type: \"chat\",\n text: msg\n };\n this.send(JSON.stringify(data));\n member.send(JSON.stringify(data));\n } else {\n this.send(JSON.stringify({\n type: \"note\",\n text: `can't find member with username ${username}`\n }));\n }\n\n } else {\n\n this.room.broadcast({\n name: this.name,\n type: 'chat',\n text: text\n });\n }\n\n }", "title": "" }, { "docid": "a07998790205968bd42455a965b5fce7", "score": "0.582031", "text": "chatManager()\n\t{\n\t\tconst chatManager = new ChatManager({\n\t\t instanceLocator,\n\t\t userId: 'admin',\n\t\t tokenProvider: new TokenProvider({ url: tokenUrl })\n\t\t});\n\t\tchatManager.connect()\n\t\t.then(currentUser => {\n\t\t\tthis.currentUser = currentUser;\n\t\t\tthis.roomList();\n\t\t})\n\t\t.catch(error => {console.log(error)})\n\n\t}", "title": "" }, { "docid": "fcdce8a0e5a898b7f17e2fdb8b84463e", "score": "0.58201164", "text": "componentWillUpdate() {\n this.getChat();\n }", "title": "" }, { "docid": "87525c36b8c916407416b58a6952b917", "score": "0.5815272", "text": "getChatsForUser(state) {\n \n }", "title": "" }, { "docid": "a276b49ff6c29d1beed4fb4912f89434", "score": "0.579744", "text": "function chatreq(event, obj) {\n console.log(obj);\n console.log(\"chatreq\");\n // $('#chatrequest').show();\n // $(\"#btn-accept\").click(function () {\n // isChatreq = true;\n // $('#chatrequest').hide();\n\n // });\n // $(\"#btn-reject\").unbind(\"click\").click(function () {\n // $('#chatrequest').hide();\n // sendio(obj.from, currentuser.name, '', \"rejectchatreq\");\n // });\n sendio(obj.from, currentuser.name, '', \"chatreqaccepted\");\n selecteduser.name = obj.from;\n setTimeout(function () {\n selecteduser.name = obj.from;\n\n }, 10);\n\n}", "title": "" }, { "docid": "69c0ea40b8ad09fd47b1de994ac6ff69", "score": "0.5794717", "text": "constructor(endpoint, options) {\n super(endpoint, options);\n this.chatThread = new ChatThread(this);\n this.chat = new Chat(this);\n }", "title": "" }, { "docid": "a21ff7cb2038c4c7938475c5fc71d3d5", "score": "0.5792783", "text": "function sendChat(client, message) {\n requestMethod('POST','../chat/'+encodeURIComponent(client.game.name),\n\t JSON.stringify([client.color, message]), function(resp) {});\n}", "title": "" }, { "docid": "ff9f92079f45387974112b7b7a2caa96", "score": "0.57852495", "text": "function Messenger() {\n}", "title": "" }, { "docid": "842701470b4c16d357ddef3404c3628f", "score": "0.5775973", "text": "function Client() {\n\n}", "title": "" }, { "docid": "1158bd0c96b54a87c733e8805de1ddf4", "score": "0.57752365", "text": "getMediumClient(){\n\t\t \n\t\t\t\n\t\t console.log(\"Invoking socket.io code........\");\t\n\t\t\t//console.log(this.configuration);\n\t\t\tvar userInteraction = new UserInteraction(this.conf);\n\t\t\tlet localConfiguration = this.conf; \n\t\t // Invoke a HTML client and move to \n\t\t\tvar client=require(\"socket.io\").listen(sharedProperties.get('appServer.webBotSocketPort')); \n\t\t\tconsole.log(\"Listening to port \" + \n\t\t\tsharedProperties.get('appServer.webBotSocketPort') + \"--------------\");\t\t\t\n\t\t\t\n\t\t\tclient.on('connection', function(socket)\n\t\t\t{\n\t\t\t\tconsole.log(JSON.stringify(localConfiguration, null, 3));\n\t\t\t\tvar channelAdaptor= localConfiguration.botconfiguration.channelconfiguration.channeladapter;\n\t\t\t\tconsole.log('chatserver connects AI Jarvis connection id ' + socket.client.conn.id); \n\t\t\t\tlogger.debug('chatserver connects AI Jarvis connection id ' + socket.client.conn.id); \n\t\t\t\t\n\t\t\t\tconsole.log(\"Connection done------------------\");\n\t\t\t\tconsole.log(socket.client.conn.id);\t\t\n\t\t\t\t\n\t\t\t\t// Hear to the incoming connection\n\t\t\t\tsocket.on('input-to-jarvis',function(data)\n\t\t\t\t{ \n\t\t\t\t console.log(\"Recieved message in HTML channel\" );\n\t\t\t\t\t\n\t\t\t\t\tconsole.log('--------------------Message recieved----------------------');\n\t\t\t\t\t\n\t\t\t\t\tconsole.log(data.room + '|' + data.ip +'--Jarvis receives data from chatserver with roomID --' + data.data); \n\t\t\t\t\tlogger.debug( data.room + '|' + data.ip + '--Jarvis receives data from chatserver with roomID --' + data.data); \n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Manage the user session\n\t\t\t\t\tsessionsUtility.manageUserSession( \n\t\t\t\t\t\n\t\t\t\t\tdata.room, // The user id\n\t\t\t\t\tlocalConfiguration.botconfiguration.sessionsinformation , // The sessions information\n\t\t\t\t\tdata.data, \n\t\t\t\t\tsocket, \n\t\t\t\t\tuserInteraction, \n\t\t\t\t\tchannelAdaptor\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\t\n\t\t\t\n\t\t\t//return client;\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "30a7e19329c86f78811e1af5b6dc0c8a", "score": "0.57650894", "text": "constructor(send, roomName) {\n this._send = send; // \"send\" function for this user\n this.room = Room.get(roomName); // room user will be in\n this.name = null; // becomes the username of the visitor\n\n console.log(`created chat in ${this.room.name}`);\n }", "title": "" }, { "docid": "54f429a3ba903149fd352d7406f4e712", "score": "0.5763868", "text": "constructor(chatBoxId, userEmail){\n this.chatBox = $(`#${chatBoxId}`);\n this.userEmail = userEmail;\n\n //io is a global variable that has been made available as soon as the cdn js file was included\n this.socket = io.connect('http://localhost:5000');\n\n //the connectionHandler must be called \n //it will only be called if there is userEmail\n if(this.userEmail){\n this.connnectionHandler();\n }\n }", "title": "" }, { "docid": "815073dfb5174008aac41e54a34e46fd", "score": "0.5763785", "text": "function fncChatEvtOnOpen() {\r\n\tdoConsoleLog(\"fncOnOpenClient: \" + 'configId:' + this.options.configId);\r\n\tthis.send('sessionId:' + this.options.sessionId);\r\n\tthis.send('configId:' + this.options.configId);\r\n\t\r\n\t//habilitar el chat si corresponde\r\n\tif (MUST_SHOW_CHAT) domAddMessageAsSystem(MSG_CONNECTION_WITH_SERVER_ACQUIRE);\r\n}", "title": "" }, { "docid": "93028df0f73c86250fba7f54dc7b00b1", "score": "0.57617474", "text": "function ChatConfig() {\n\t/** The conversation id for the message. This will be returned from the first response, and must be used for all subsequent messages to maintain the conversational state. Without the conversation id, the bot has no context for the reply. */\n\tthis.conversation;\n\t/** Sets if the voice audio should be generated for the bot's response. */\n\tthis.speak;\n\t/** Sets the message to be a correction to the bot's last response. */\n\tthis.correction;\n\t/** Flags the bot's last response as offensive. */\n\tthis.offensive;\n\t/** Ends the conversation. Conversation should be terminated to converse server resources. The message can be blank. */\n\tthis.disconnect;\n\t/** \n\t * Attaches an emotion to the user's message, one of:\n\t * NONE,\n\t * LOVE, LIKE, DISLIKE, HATE,\n\t *\tRAGE, ANGER, CALM, SERENE,\n\t *\tECSTATIC, HAPPY, SAD, CRYING,\n\t *\tPANIC, AFRAID, CONFIDENT, COURAGEOUS,\n\t *\tSURPRISE, BORED,\n\t *\tLAUGHTER, SERIOUS\n\t */\n\tthis.emote;\n\t/** Attaches an action to the user's messages, such as \"laugh\", \"smile\", \"kiss\". */\n\tthis.action;\n\t/** The user's message text. */\n\tthis.message;\n\t/** Include the message debug log in the response. */\n\tthis.debug;\n\t/** Set the debug level, one of: SEVER, WARNING, INFO, CONFIG, FINE, FINER. */\n\tthis.debugLevel;\n\t/** Enable or disable the bot's learning for this message. */\n\tthis.learn;\n\t/** Escape and filter the response message HTML content for XSS security. */\n\tthis.secure = SDK.secure;\n\t/** Strip any HTML tags from the response message. */\n\tthis.plainText;\n\t/** Send extra info with the message, such as the user's contact info (name email phone). */\n\tthis.info;\n\t/** Request a specific avatar (by ID). */\n\tthis.avatar;\n\t/** Request the response avatar media in HD. */\n\tthis.avatarHD = SDK.hd;\n\t/** Request the response avatar media in a video or image format. */\n\tthis.avatarFormat = SDK.format;\n\t/** Translate between the user's language and the bot's language. */\n\tthis.language;\n\t\n\tthis.toXML = function() {\n\t\tvar xml = \"<chat\";\n\t\txml = this.writeCredentials(xml);\n\t\tif (this.conversation != null) {\n\t\t\txml = xml + (\" conversation=\\\"\" + this.conversation + \"\\\"\");\n\t\t}\n\t\tif (this.emote != null) {\n\t\t\txml = xml + (\" emote=\\\"\" + this.emote + \"\\\"\");\n\t\t}\n\t\tif (this.action != null) {\n\t\t\txml = xml + (\" action=\\\"\" + this.action + \"\\\"\");\n\t\t}\n\t\tif (this.speak) {\n\t\t\txml = xml + (\" speak=\\\"\" + this.speak + \"\\\"\");\n\t\t}\n\t\tif (this.language != null) {\n\t\t\txml = xml + (\" language=\\\"\" + this.language + \"\\\"\");\n\t\t}\n\t\tif (this.avatar) {\n\t\t\txml = xml + (\" avatar=\\\"\" + this.avatar + \"\\\"\");\n\t\t}\n\t\tif (this.avatarHD) {\n\t\t\txml = xml + (\" avatarHD=\\\"\" + this.avatarHD + \"\\\"\");\n\t\t}\n\t\tif (this.avatarFormat != null) {\n\t\t\txml = xml + (\" avatarFormat=\\\"\" + this.avatarFormat + \"\\\"\");\n\t\t}\n\t\tif (this.correction) {\n\t\t\txml = xml + (\" correction=\\\"\" + this.correction + \"\\\"\");\n\t\t}\n\t\tif (this.offensive) {\n\t\t\txml = xml + (\" offensive=\\\"\" + this.offensive + \"\\\"\");\n\t\t}\n\t\tif (this.learn != null) {\n\t\t\txml = xml + (\" learn=\\\"\" + this.learn + \"\\\"\");\n\t\t}\n\t\tif (this.secure != null) {\n\t\t\txml = xml + (\" secure=\\\"\" + this.secure + \"\\\"\");\n\t\t}\n\t\tif (this.plainText != null) {\n\t\t\txml = xml + (\" plainText=\\\"\" + this.plainText + \"\\\"\");\n\t\t}\n\t\tif (this.debug) {\n\t\t\txml = xml + (\" debug=\\\"\" + this.debug + \"\\\"\");\n\t\t}\n\t\tif (this.info) {\n\t\t\txml = xml + (\" info=\\\"\" + SDK.escapeHTML(this.info) + \"\\\"\");\n\t\t}\n\t\tif (this.debugLevel != null) {\n\t\t\txml = xml + (\" debugLevel=\\\"\" + this.debugLevel + \"\\\"\");\n\t\t}\n\t\tif (this.disconnect) {\n\t\t\txml = xml + (\" disconnect=\\\"\" + this.disconnect + \"\\\"\");\n\t\t}\n\t\txml = xml + (\">\");\n\t\t\n\t\tif (this.message != null) {\n\t\t\txml = xml + (\"<message>\");\n\t\t\txml = xml + (SDK.escapeHTML(this.message));\n\t\t\txml = xml + (\"</message>\");\n\t\t}\n\t\txml = xml + (\"</chat>\");\n\t\treturn xml;\n\t}\n}", "title": "" }, { "docid": "2c17f0ebf416f366e8addd0cd583e6aa", "score": "0.57500005", "text": "function SendChatData() \n{\t\n\tif (g_oSAFRemoteDesktopClient != null) \n\t{\n\t\tif (false == g_bNewBinaries)\n\t\t{\n\t\t\t//\n\t\t\t// Send chat data to user (using Old interfaces)\n\t\t\t//\n\t\t\tg_oSAFRemoteDesktopClient.SendChannelData(c_szChatChannelID, chatText.value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//\n\t\t\t// Send chat data to user (using New interfaces)\n\t\t\t//\n\t\t\tg_oChatChannel.SendChannelData( chatText.value );\n\t\t}\n\t\t\n\t\t//\n\t\t// Update chat history window\n\t\t//\n\t\tincomingChatText.value = incomingChatText.value + L_cszExpertID + chatText.value;\n\t\t\n\t\t//\n\t\t// Clear chat msg window\n\t\t//\n\t\tchatText.value=\"\";\n\t\t\n\t\t//\n\t\t// Scroll down\n\t\t//\n\t\tincomingChatText.doScroll(\"scrollbarPageDown\");\n\t}\n}", "title": "" }, { "docid": "0ecda0f24a1336db0492a455b6c6daed", "score": "0.57499766", "text": "function reply(msg){ // replace sendChat to reply\n API.sendChat(msg);\n }", "title": "" }, { "docid": "90bc0d4aac3c938e330eb194ccf93e6a", "score": "0.5735317", "text": "function chat () {\n\t//this is where you write your message\n\ttextstring = GUI.TextArea (Rect (10, 240, 180, 50), textstring);\n\t\n\t//sends the message you wrote\n\tif (GUI.Button(Rect (200, 240, 40, 50), \"Send\")) {\n\t\ttextstring = myName + \": \" + textstring;\n\t\tif (talkTo == 0) {\n\t\t\tnetworkView.RPC(\"SubmitEntry\", RPCMode.Server, textstring, \"All\", 0);\n\t\t}\n\t\telse {\n\t\t\tif (talkTo == 1) {\n\t\t\t\tfor (var entry : String in groupNames) {\n\t\t\t\tnetworkView.RPC(\"SubmitEntry\", RPCMode.Server, textstring, entry, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse networkView.RPC(\"SubmitEntry\", RPCMode.Server, textstring, selectedPlayer, 2);\n\t\t\t\n\t\t\tvar myEntry = new EntryMsg ();\n\t\t\tmyEntry.message = textstring;\n\t\t\tmyEntry.dispcolor = talkTo;\n\t\t\tallchat.Add (myEntry);\n\t\t\tif (allchat.Count > 50) allchat.RemoveAt(0);\n\t\t\t//only pulls your view of the conversation to the new bottom if you were already looking at the bottom\n\t\t\t//this is so if you scroll up to read a previous post it doesn't pull you to the bottom as soon as someone else posts\n\t\t\tif (scrollPosition.y == maxScroll) scrollPosition.y = 1000000;\n\t\t\t//this will keep you at a previous post\n\t\t\telse if (allchat.Count == 50) scrollPosition.y -= 23;\n\t\t}\n\t\ttextstring = \"\";\n\t}\n\t\n\t//displays everyones messages\n\tGUILayout.BeginArea (Rect (10,30,230,200));\n\tscrollPosition = GUILayout.BeginScrollView (scrollPosition, GUILayout.Width(230), GUILayout.Height(200));\n\tfor (var entry in allchat) {\n\t\tif (entry.dispcolor == 0) GUILayout.Label (entry.message);\n\t\telse if (entry.dispcolor == 1) GUILayout.Label (entry.message, groupChat);\n\t\telse if (entry.dispcolor == 2) GUILayout.Label (entry.message, privateChat);\n\t\telse GUILayout.Label (entry.message, noticeChat);\n\t}\n\tGUILayout.EndScrollView();\n\tGUILayout.EndArea();\t\n\t\n\tGUILayout.BeginArea (Rect(250,30,200,260));\n\tplayerScrollPosition = GUILayout.BeginScrollView (playerScrollPosition, GUILayout.Width(200), GUILayout.Height(260));\n\tif (GUILayout.Button (\"Everyone\")) talkTo = 0;\n\tif (GUILayout.Button (\"Group\")) talkTo = 1;\n\tGUILayout.Label(\"Group Members:\");\n\tfor (var entry in groupNames) {\n\t\tif (GUILayout.Button(entry)) {\n\t\t\tselectedPlayer = entry;\n\t\t\ttalkTo = 2;\n\t\t}\n\t}\n\t\n\tGUILayout.BeginHorizontal();\n\taddToGroup = GUILayout.TextField(addToGroup);\n\tif (GUILayout.Button(\"Invite\")) {\n\t\tfor (var entry : String in groupNames) {\n\t\t\tif (entry == addToGroup) {\n\t\t\t\taddToGroup = \"Player Already In Group\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfor (var entry : String in playerNames) {\n\t\t\tif (entry == addToGroup) {\n\t\t\t\tnetworkView.RPC(\"SubmitInvite\", RPCMode.Server, myName, addToGroup);\n\t\t\t\taddToGroup = \"Invite Sent\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\taddToGroup = \"Name Not In Use\";\n\t}\n\tGUILayout.EndHorizontal();\n\t\n\t\n\tif (GUILayout.Button(\"Leave Group\")) {\n\t\t\tfor (var entry : String in groupNames) {\n\t\t\t\tnetworkView.RPC(\"SubmitLeaveGroup\", RPCMode.Server, entry, myName);\n\t\t\t\tplayerNames.Add(entry);\n\t\t\t\tplayerNames.Sort();\n\t\t\t}\n\t\t\tgroupNames.Clear();\n\t}\n\tGUILayout.Label(\"Other Players:\");\n\tfor (var entry in playerNames) {\n\t\tif (GUILayout.Button(entry)) {\n\t\t\tselectedPlayer = entry;\n\t\t\ttalkTo = 2;\n\t\t}\n\t}\n\t\n\tGUILayout.EndScrollView();\n\tGUILayout.EndArea ();\n\t\n\t\n\t\n\t//finds the maximum scroll position for use in the add entry rpc\n\t//can be issues if there are multiple lines in a single post... needs fix\n\tif (scrollPosition.y > maxScroll && scrollPosition.y != 1000000) maxScroll = scrollPosition.y;\n}", "title": "" }, { "docid": "e888ec6408bf1de2c462769038de4b93", "score": "0.5730746", "text": "startchat () {\n this.toggleModal()\n\n Actions.chat({ data: this.props.user })\n }", "title": "" }, { "docid": "9c8cd41a357078e2ea872e3ca13a27e1", "score": "0.5730118", "text": "constructor(){\n this.client = new Chuck();\n \n }", "title": "" }, { "docid": "8eb4b6d8e695ef9d0585eef0470b4a28", "score": "0.5725091", "text": "sendChat(msg) {\n if (this.model !== undefined) {\n this.model.updateChat(msg);\n }\n\n return this.data.name;\n }", "title": "" }, { "docid": "0dac4619f628563dccf90984a3195f4a", "score": "0.5718844", "text": "chatBox(newUser, newMessage) {\n if(this.state.currentUser.name === newUser || newUser === '') {\n // Add a new message to the list of messages in the data store\n const newestMessage = {\n type: 'postMessage',\n username: this.state.currentUser.name,\n\n content: newMessage};\n connectSocket.send(JSON.stringify(newestMessage))\n } else {\n this.setState({currentUser: {name: newUser}});\n connectSocket.send(JSON.stringify({\n type: 'postNotification',\n oldUsername: this.state.currentUser.name,\n newUsername: newUser\n }))\n\n const newestMessage = {\n type: 'postMessage',\n username: newUser,\n content: newMessage};\n connectSocket.send(JSON.stringify(newestMessage))\n}\n\n //Send the msg object as a JSON-formatted string\n document.getElementById('chatBarMessage')\n}", "title": "" }, { "docid": "96e46edbfaee22b7977df84167501123", "score": "0.57176656", "text": "function createCustomChat()\n {\n/*\n var i;\n var params = 'sendRequest=settumUPsettumMUP';\t\t\t// Gratuitous complication\n params += '&uname=' + uname;\t\t\t\t\t\t\t// Build parameter string\n params += '&pword=' + pword;\n\n params += '&t=' + chatTitle;\t\t\t\t\t\t\t// Title of session to be created\n params += '&l=' + creatorIsLeader;\t\t\t\t\t\t// Whether the session creator acts as session leader\n params += '&ac=' + ;\t\t\t\t\t\t\t\t\t\t// Count of members given access\n params += '&i' + i + '=' + ;\t\t\t\t\t\t\t// Each member's screen name\n params += '&kc=';\t\t\t\t\t\t\t\t\t\t// Count of session keywords (if any)\n params += '&kw' + i + '=' + ;\t\t\t\t\t\t\t// Each keyword\n*/\n }", "title": "" }, { "docid": "bd1d08cd343f11250460bb514d007d94", "score": "0.57100505", "text": "function initChatList() {\n messenger.getChats().forEach(chat => {\n try {\n addChatElement(chat);\n } catch (error) {\n console.log(`Error adding chat element: ${error}`);\n }\n });\n}", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.56949604", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.56949604", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.56949604", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.56949604", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "a415c95c7f382d07cdfaa2b7a90ba9d8", "score": "0.569375", "text": "function cancelar_chat_request_of(room_bthx, skt_id_rcvf, skt_id_mndf)\n{\nconsole.log(\"a cancelar_chat_request_of\")\nsocket_client.emit(\"cancelar chat request of\",\n{\nskt_id_mnd: skt_id_mndf,\nskt_id_rcv: skt_id_rcvf,\nroom_bth: room_bthx\n})\n}//cancelar_chat_request_of", "title": "" }, { "docid": "e1540585aa1cf3cc4e1cc808477051c0", "score": "0.5678644", "text": "function connect() {\r\n\t/* cricketClient = new WebSocket(endPointURL); */\r\n\tsocket.onmessage = function(event) {\r\n\t\tvar messagesArea = document.getElementById(\"messages\");\r\n\t\tvar jsonObj = JSON.parse(event.data);\r\n\t\tvar message = jsonObj.user + \": \" + jsonObj.message + \"\\r\\n\";\r\n\t\tmessagesArea.value = messagesArea.value + message;\r\n\t\tmessagesArea.scrollTop = messagesArea.scrollHeight;\r\n\t};\r\n}", "title": "" }, { "docid": "dcc00f3bd48bd76be19a4c90f1ad1037", "score": "0.56744564", "text": "function chatWithBot(text, instance) {\n\tif (!instance) return null;\n\tif (text === null) {\n\t\tif (chatWithBot.list[instance] !== undefined) {\n\t\t\tEngine.debug(\n\t\t\t\tEngine.DebugInfo,\n\t\t\t\t\"Explicitly deleting bot \" + instance\n\t\t\t);\n\t\t\tdelete chatWithBot.list[instance];\n\t\t}\n\t\treturn null;\n\t}\n\tvar bot = null;\n\tif (chatWithBot.list) bot = chatWithBot.list[instance];\n\telse chatWithBot.list = new Array();\n\tif (!bot) {\n\t\tEngine.debug(Engine.DebugInfo, \"Creating chat bot for \" + instance);\n\t\tbot = new Eliza();\n\t\tchatWithBot.list[instance] = bot;\n\t}\n\t// Since we usually have no clue a chat has ended we set it to expire\n\tbot.expireTime = Date.now() + 7200000; // Arbitrarily - 2 hours\n\tif (chatWithBot.expireInt === undefined) {\n\t\tEngine.debug(Engine.DebugAll, \"Starting bot expirer\");\n\t\tchatWithBot.expireInt = Engine.setInterval(__chatExpireFunc, 60000);\n\t}\n\treturn bot.listen(text);\n}", "title": "" }, { "docid": "30fae87bf9ecb8a62bedc226687915cf", "score": "0.56740403", "text": "static get is() { return \"bbm-chat-input\"; }", "title": "" }, { "docid": "3bf844bc71ad7e006ce15af37113a27c", "score": "0.56657535", "text": "function createClient(token) {\n let msg = new Object();\n //const SERVER = 'http://localhost:8080';\n //var socket = io.connect(SERVER, {query: \"token=\"+token});\n console.log('Connecting to the server...');\n var socket = io.connect(SERVER, {query: \"token=\" + token});\n $('#chat_form').submit((e)=>{\n msg.text = $('#msg').val();\n socket.emit('chat_msg',msg);\n $('#msg').val('');\n console.log(msg);\n e.preventDefault();\n });\n socket.on('connect_error',(data)=>{\n console.log(data);\n });\n socket.on('chat_msg',(msg)=>{\n const msgTxt = msg.text;\n const username = msg.username;\n $('#messages').append('<li>'+username+'=> '+msgTxt+'</li>');\n });\n}", "title": "" }, { "docid": "5eeeb6e790021c8af2c6c011e991d66a", "score": "0.5657358", "text": "constructor(host, username, displayname, channel) {\n\t\tthis._client = new BeliveRtmClient(host);\n\t\tthis._xchatToken = \"\";\n\t\tthis._userName = username;\n\t\tthis._displayName = displayname;\n\t\tthis._channelSubscribed = channel;\n\t\tconsole.log(\"what the fuck\");\n\t}", "title": "" }, { "docid": "07198951e837ffec6ea1f7f20ee7d028", "score": "0.5655699", "text": "function ChatBox()\r\n{\r\n\tthis.name = 'ChatBox';\r\n\tthis.onLoad = function()\r\n\t{\r\n\t\tif (!isLoggedIn())\r\n\t\t\treturn;\r\n\r\n\t\tMailReader.ifInMail_ParseMails();\r\n\r\n\t\tChatUi.init();\r\n\t\tChatUi.keepUpdating();\r\n\t}\r\n\t////////////////////////////////////////////////////////////\r\n\r\n\tfunction _soundPuk()\r\n\t{\r\n\t\tvar a = $('audio.v31_hangout_puk')\r\n\t\tif (!a.length) {\r\n\t\t\ta = $('<audio class=\"v31_hangout_puk\" src=\"http://p.brm.sk/puk.wav\">');\r\n\t\t\ta.appendTo('body');\r\n\t\t}\r\n\t\tif (a[0]) a[0].play();\r\n\t}\r\n\r\n\tfunction isLoggedIn()\r\n\t{\r\n\t\treturn $('input[type=submit][value=logout]').length > 0;\r\n\t}\r\n\r\n\tvar ChatUi = new function()\r\n\t{\r\n\t\tvar ChatUi = this;\r\n\t\tChatUi.$chats = null;\r\n\r\n\t\tChatUi.init = function()\r\n\t\t{\r\n\t\t\tMailReader.onNewMail = ChatUi.onNewMail;\r\n\t\t\tMailReader.onNewChecked = ChatUi.onNewChecked;\r\n\t\t\tMailReader.onMailLoad = ChatUi.onMailLoad;\r\n\t\t\t_createHtml();\r\n\r\n\t\t\tvar users = ChatsOpen.map();\r\n\t\t\tfor (var username in users)\r\n\t\t\t{\r\n\t\t\t\tif (users[username].windowUid != getWindowUid())\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tChatUi.startChatWith( username );\r\n\t\t\t}\r\n\r\n\t\t\t_friendlistUpgrade();\r\n\t\t}\r\n\r\n\t\tfunction _friendlistUpgrade()\r\n\t\t{\r\n\t\t\t$.addStyle('\\\r\n\t\t\t\t.v31_hangout_search { display: block; padding: 5px 8px; margin: 4px; width: 70%;\\\r\n\t\t\t\t\t\t\t\t\t font-size: 11px; height: 24px !important; border: none;\\\r\n\t\t\t\t\t\t\t\t\t margin-left: 30px; }\\\r\n\t\t\t\t.v31_hangout_latest\t{ background: #333; vertical-align: top; }\\\r\n\t\t\t\t.v31_hangout_latest>div\t{ padding: 1px; vertical-align: middle; line-height: 30px; }\\\r\n\t\t\t\t.v31_hangout_latest>div:hover { background: #555; cursor: pointer; }\\\r\n\t\t\t\t.v31_hangout_latest\timg { width: 23px; height: 23px; margin-right: 10px; }\\\r\n\t\t\t\t.v31_hangout_start\t{ float: left; background: #6dae42; opacity: 0.2; color: black;\\\r\n\t\t\t\t\t\t\t\t\theight: 23px; line-height: 23px; width: 23px; text-align: center;\\\r\n\t\t\t\t\t\t\t\t\tmargin-right: 4px; }\\\r\n\t\t\t\t.v31_hangout_start:hover\t{ opacity: 1; cursor: pointer; }\\\r\n\t\t\t');\r\n\t\t\tvar $search = $('<input type=\"text\" placeholder=\"Chat with..\" class=\"v31_hangout_search\">');\r\n\t\t\tvar $latest = $('<div class=\"v31_hangout_latest\">');\r\n\t\t\t$search.insertBefore('.active_friend.u:eq(0)');\r\n\t\t\t$latest.insertAfter($search);\r\n\t\t\t$search.keydown(function(e) {\r\n\t\t\t\tif (e.which==13) {\r\n\t\t\t\t\tChatUi.startChatWith( $search.val() );\r\n\t\t\t\t\t$search.val('');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t$search.blur(function() { setTimeout(function() { $latest.html('').hide(); }, 100); });\r\n\t\t\t$search.focus(function() {\r\n\t\t\t\t$latest.html('').show();\r\n\t\t\t\tvar users = MailReader.getUsers();\r\n\t\t\t\tfor (var i=0; i < users.length; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar u = users[i];\r\n\t\t\t\t\tvar e = $('<div><img><span>');\r\n\t\t\t\t\te.find('img').attr('src', avatarSrc(u.id));\r\n\t\t\t\t\te.find('span').text( u.name );\r\n\t\t\t\t\te.addClass(u.online ? 'online' : '');\r\n\t\t\t\t\te.appendTo($latest);\r\n\t\t\t\t\te.data('user', u.name).click(function() {\r\n\t\t\t\t\t\tChatUi.startChatWith($(this).data('user'));\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t$('.active_friend.u').each(function() {\r\n\t\t\t\t$('<div class=\"v31_hangout_start\">').text('+').prependTo(this).click(function() {\r\n\t\t\t\t\tvar username = $(this).parent().find('a:eq(0)').attr('title');\r\n\t\t\t\t\tChatUi.startChatWith(username);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction _createHtml()\r\n\t\t{\r\n\t\t\t$.addStyle('\\\r\n\t\t\t\t.v31_hangout\t{ position: fixed; bottom: 0; right: 20px; }\\\r\n\t\t\t\t.v31_hangout_receive\t{ float: right; padding: 10px; background: red; border-radius: 5px;\\\r\n\t\t\t\t\t\t\t\t\t\t color: black; font-weight: bold; margin-bottom: -5px; }\\\r\n\t\t\t\t.v31_hangout_receive:hover { opacity: 0.9; cursor: pointer; }\\\r\n\t\t\t');\r\n\t\t\tChatUi.$chats = $('<div class=\"v31_hangout\">').appendTo('body');\r\n\r\n\t\t\tChatUi.$openUnread = $('<div class=\"v31_hangout_receive\">').text('open new mails');\r\n\t\t\tChatUi.$openUnread.appendTo(ChatUi.$chats);\r\n\t\t\tChatUi.$openUnread.click(function() {\r\n\t\t\t\tMailReader.getMails('reload');\r\n\t\t\t\tChatUi.$openUnread.hide();\r\n\t\t\t});\r\n\t\t}\r\n\t\tChatUi.startChatWith = function(u)\r\n\t\t{\r\n\t\t\tvar ch = new ChatWindow;\r\n\t\t\tch.init(u);\r\n\t\t\treturn ch;\r\n\t\t}\r\n\r\n\t\tChatUi.updateBtnOpenUnread = function()\r\n\t\t{\r\n\t\t\tvar b = MailReader.numUnread() && !ChatUi.numOpen();\r\n\t\t\tif (b)\r\n\t\t\t\tChatUi.$openUnread.show();\r\n\t\t\telse\r\n\t\t\t\tChatUi.$openUnread.hide();\r\n\t\t}\r\n\r\n\t\tChatUi.keepUpdating = function()\r\n\t\t{\r\n\t\t\tChatUi.updateBtnOpenUnread();\r\n\r\n\t\t\t$('.v31_hangout_window>.reload').toggleClass('new', MailReader.numUnread()>0);\r\n\r\n\t\t\tfor (var u in ChatWindow.map)\r\n\t\t\t\tif (!ChatsOpen.getStateOf(u))\r\n\t\t\t\t\tChatWindow.map[u].close();\r\n\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tChatUi.keepUpdating();\r\n\t\t\t}, 5*1000);\r\n\t\t}\r\n\t\tChatUi.onNewMail = function(m)\r\n\t\t{\r\n\t\t\tvar win = ChatWindow.map[m.username_from];\r\n\t\t\tif (!win)\r\n\t\t\t\twin = ChatUi.startChatWith(m.username_from);\r\n\t\t\telse\r\n\t\t\t\twin.refresh();\r\n\t\t}\r\n\t\tChatUi.onMailLoad = function(mails)\r\n\t\t{\r\n\t\t\t$.each(ChatWindow.map, function(i, e) {\r\n\t\t\t\te.onMailLoad(mails);\r\n\t\t\t});\r\n\t\t}\r\n\t\tChatUi.numOpen = function() {\r\n\t\t\treturn $('.v31_hangout_window').length;\r\n\t\t}\r\n\t\tChatUi.onNewChecked = function(nUnread)\r\n\t\t{\r\n\t\t\tChatUi.updateBtnOpenUnread();\r\n\r\n\t\t\t$.each(ChatWindow.map, function(i, e) {\r\n\t\t\t\te.onNewChecked(nUnread);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tvar ChatWindow = function()\r\n\t{\r\n\t\tvar t = this;\r\n\t\tvar $win;\r\n\t\tt.username = '';\t// target user\r\n\t\tt.userid = '';\t\t// target user\r\n\r\n\t\tt.init = function(username)\r\n\t\t{\r\n\t\t\tt.username = username;\r\n\t\t\t_createHtml();\r\n\t\t\tChatWindow.map[username] = t;\r\n\r\n\t\t\t_renderMails( MailReader.getMails() );\r\n\t\t}\r\n\t\tt.onMailLoad = function(mails) { _renderMails(mails); }\r\n\t\tt.onNewChecked = function(nUnread) {\r\n\t\t\t$win.find('.reload').toggleClass('new', nUnread>0);\r\n\t\t}\r\n\t\tt.refresh = function()\r\n\t\t{\r\n\t\t\tvar mails = MailReader.getMails();//With(t.username);\r\n\t\t\t_renderMails(mails);\r\n\t\t}\r\n\t\tt.close = function()\r\n\t\t{\r\n\t\t\tChatsOpen.remove(t.username);\r\n\t\t\tdelete ChatWindow.map[t.username];\r\n\t\t\t$win.remove();\r\n\t\t\t//$win.fadeOut(function() { $win.remove(); });\r\n\t\t}\r\n\t\tt.toggle = function()\r\n\t\t{\r\n\t\t\tif ($win.height() > 150) {\r\n\t\t\t\t$win.animate({height: '150px'});\r\n\t\t\t\tChatsOpen.set(t.username, 'mini');\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$win.animate({height: '380px'});\r\n\t\t\t\tChatsOpen.set(t.username, 'normal');\r\n\t\t\t}\r\n\t\t}\r\n\t\tt.send = function()\r\n\t\t{\r\n\t\t\tvar ta = $win.find('textarea');\r\n\t\t\tta.prop('disabled', true).addClass('sending').removeClass('error');\r\n\t\t\tMailReader.sendMail(t.username, ta.val(), function() {\r\n\t\t\t\tta.prop('disabled', false).removeClass('sending');\r\n\t\t\t\tta.val('');\r\n\t\t\t}, function() {\r\n\t\t\t\tta.prop('disabled', false).removeClass('sending').addClass('error');\r\n\t\t\t});\r\n\t\t\tta.val();\r\n\t\t}\r\n\r\n\t\tfunction _createHtml()\r\n\t\t{\r\n\t\t\tif (!ChatWindow._styleAdded)\r\n\t\t\t{\r\n\t\t\t\tChatWindow._styleAdded = 1;\r\n\t\t\t\t$.addStyle('\\\r\n.v31_hangout_window\t\t\t\t{ width: 260px; height: 380px; margin-right: 5px; display: inline-block;\\\r\n\t\t\t\t\t\t\t\t vertical-align: bottom; position: relative; box-shadow: 0 0 5px #000;\\\r\n\t\t\t\t\t\t\t\t background: #222; }\\\r\n.v31_hangout_window .head\t\t{ height: 35px; line-height: 35px; cursor: pointer;\\\r\n\t\t\t\t\t\t\t\t background: #6dae42; color: #000; font-size: 13px; }\\\r\n.v31_hangout_window .resize\t\t{ float: left; width: 34px; height: 34px; cursor: nw-resize; }\\\r\n.v31_hangout_window .close\t\t{ float: right; padding: 0 13px; }\\\r\n.v31_hangout_window .close:hover{ background: rgba(255, 255, 255, 0.2); cursor: pointer; }\\\r\n.v31_hangout_window .messages\t{ position: absolute; top: 35px; bottom: 65px; left: 0; right: 0;\\\r\n\t\t\t\t\t\t\t\toverflow-y: scroll; padding: 8px; line-height: 18px;\\\r\n\t\t\t\t\t\t\t\tword-break: break-word; }\\\r\n.v31_hangout_window >.reload\t{ position: absolute; bottom: 35px; left: 0; right: 0; text-align: center;\\\r\n\t\t\t\t\t\t\t\t\tbackground: black; color: #6dae42; cursor: pointer;\\\r\n\t\t\t\t\t\t\t\t\theight: 30px; line-height: 30px; opacity: 0.5; }\\\r\n.v31_hangout_window >.reload.new { background: red; color: black; font-weight: bold; }\\\r\n.v31_hangout_window >.reload:hover\t{ opacity: 1; }\\\r\n.v31_hangout_window >textarea\t{ position: absolute; bottom: 0; left: 0; display: block;\\\r\n\t\t\t\t\t\t\t\tborder: 1px solid #6dae42; width: 100%; height: 35px; }\\\r\n.v31_hangout_window >textarea.sending { opacity: 0.7; }\\\r\n.v31_hangout_window >textarea.error\t{ color: red; }\\\r\n\\\r\n.v31_message\t\t\t\t\t{ padding: 3px; clear: both; overflow: hidden; }\\\r\n.v31_message>.icon\t\t\t\t{ width: 34px; height: 34px; }\\\r\n.v31_message.me>.icon\t\t\t{ float: right; }\\\r\n.v31_message.em>.icon\t\t\t{ float: left; }\\\r\n.v31_message>.bubble\t\t\t{ max-width: 70%; background: #000; color: #6dae42; padding: 5px 8px; }\\\r\n.v31_message.me>.bubble\t\t\t{ float: right; }\\\r\n.v31_message.em>.bubble\t\t\t{ float: left; }\\\r\n.v31_message .timestamp\t\t\t{ opacity: 0.4; }\\\r\n.v31_message>.icon.seen\t\t\t{ opacity: 0.3; width: 20px; height: 20px; }\\\r\n\t\t\t\t');\r\n\t\t\t}\r\n\r\n\t\t\tvar html = '\\\r\n\t\t\t<div class=\"v31_hangout_window\">\\\r\n\t\t\t\t<div class=\"head\">\\\r\n\t\t\t\t\t<div class=\"resize\"></div>\\\r\n\t\t\t\t\t<div class=\"close\"> X </div>\\\r\n\t\t\t\t\t<div class=\"user\">username</div>\\\r\n\t\t\t\t</div>\\\r\n\t\t\t\t<div class=\"messages\"></div>\\\r\n\t\t\t\t<div class=\"reload\">reload</div>\\\r\n\t\t\t\t<textarea></textarea>\\\r\n\t\t\t</div>\\\r\n\t\t\t';\r\n\t\t\t$win = $(html);\r\n\t\t\t$win.data('username', t.username)\r\n\t\t\t$win.find('.user').text(t.username);\r\n\t\t\t$win.find('.reload').click(function() { MailReader.getMails('reload'); });\r\n\t\t\t$win.find('.close').click(function() { t.close(); });\r\n\t\t\t$win.find('.head').click(function(e) { if ($(e.target).is('.user')) t.toggle(); });\r\n\t\t\t$win.find('textarea').keydown(function(e) {\r\n\t\t\t\tif (e.which==13 && !e.ctrlKey && !e.shiftKey) t.send(); });\r\n\t\t\t$win.appendTo( ChatUi.$chats );\r\n\t\t\t$win.find('textarea').focus();\r\n\r\n\t\t\t$win.find('.resize').mousedown(function(e) { $win.addClass('resizing'); return false; });\r\n\t\t\t$(document).mouseup(function(e) {\r\n\t\t\t\tif ($win.is('.resizing')) {\r\n\t\t\t\t\t$win.removeClass('resizing');\r\n\t\t\t\t\treturn false; }\r\n\t\t\t});\r\n\t\t\t$(document).mousemove(function(e) { _resize(e); });\r\n\r\n\r\n\t\t\tvar state = ChatsOpen.getStateOf(t.username);\r\n\t\t\tif (state == 'mini')\r\n\t\t\t\t$win.height(150);\r\n\r\n\t\t\tChatsOpen.set(t.username, state?state:'normal');\r\n\t\t}\r\n\r\n\t\tfunction _resize(e)\r\n\t\t{\r\n\t\t\tif (!$win.is('.resizing')) return;\r\n\r\n\t\t\tvar o = $win.offset();\r\n\t\t\tvar w = $win.width() + (o.left-e.pageX)+17;\r\n\t\t\tvar h = $win.height() + (o.top-e.pageY)+17;\r\n\t\t\t$win.width( Math.max(170, w) );\r\n\t\t\t$win.height( Math.max(170, h) );\r\n\t\t}\r\n\r\n\t\tfunction _renderMails(mails)\r\n\t\t{\r\n\t\t\t$win.find('.reload').removeClass('new');\r\n\t\t\t$win.find('.messages').html('');\r\n\t\t\t$win.addClass();\r\n\t\t\tfor (var i=0; i < mails.length; i++)\r\n\t\t\t{\r\n\t\t\t\tvar m = mails[i];\r\n\t\t\t\tif (m.username_from!=t.username && m.username_to!=t.username) continue;\r\n\r\n\t\t\t\tt.userid = m.isMe ? m.userid_to : m.userid_from;\r\n\t\t\t\t_renderMail( m );\r\n\t\t\t}\r\n\t\t\t_renderSeen();\r\n\t\t}\r\n\t\tfunction _renderMail(m)\r\n\t\t{\r\n\t\t\tvar html = '\\\r\n\t\t\t<div class=\"v31_message\">\\\r\n\t\t\t\t<img class=\"icon\">\\\r\n\t\t\t\t<div class=\"bubble\">\\\r\n\t\t\t\t\t<div class=\"content\"></div>\\\r\n\t\t\t\t\t<div class=\"timestamp\"></div>\\\r\n\t\t\t\t</div>\\\r\n\t\t\t</div>\\\r\n\t\t\t';\r\n\t\t\tvar $msg = $(html).addClass(m.isMe?'me':'em');\r\n\t\t\t$msg.find('.icon').attr('src', avatarSrc(m.userid_from)).attr('title', m.username_from);\r\n\t\t\t$msg.find('.content').html(m.content);\r\n\t\t\t$msg.find('.timestamp').text(_niceTimestamp(m.timestamp));\r\n\t\t\tif (m.isUnread) $msg.addClass('unread');\r\n\r\n\t\t\tvar $msgs = $('.messages', $win);\r\n\t\t\tvar atBottom = _isAtBottom($msgs);\r\n\t\t\t$msg.appendTo($msgs);\r\n\t\t\tif (atBottom) $msgs.scrollTop(9999999);\r\n\t\t}\r\n\t\tfunction _niceTimestamp(t)\r\n\t\t{\r\n\t\t\t//t = '09:07:58 - 17.01.2014';\r\n\t\t\tvar a = t.match(/([\\d]+).([\\d]+).([\\d]+)...([\\d]+).([\\d]+).([\\d]+)/);\r\n\t\t\tvar h = parseInt(a[1])\r\n\t\t\tvar m = a[2];\r\n\t\t\treturn h+':'+m;\r\n\t\t}\r\n\t\tfunction _renderSeen()\r\n\t\t{\r\n\t\t\tvar $seen = $('<div class=\"v31_message em\"><img class=\"icon seen\">');\r\n\t\t\t$seen.find('.icon').attr('src', avatarSrc(t.userid));\r\n\r\n\t\t\tvar $msgs = $('.messages', $win);\r\n\t\t\tvar atBottom = _isAtBottom($msgs);\r\n\r\n\t\t\tvar unread = $msgs.find('.unread:eq(0)');\r\n\t\t\tif (!unread.length)\r\n\t\t\t\t$msgs.append($seen);\r\n\t\t\telse\r\n\t\t\t\tunread.before($seen);\r\n\r\n\r\n\t\t\tif (atBottom) $msgs.scrollTop(9999999);\r\n\t\t}\r\n\r\n\t\tfunction _isAtBottom(e)\r\n\t\t{\r\n\t\t\tvar height = e.outerHeight();\r\n\t\t\tvar scrollHeight = e[0].scrollHeight;\r\n\t\t\tvar scrollTop = e.scrollTop();\r\n\t\t\treturn (scrollTop+height > scrollHeight-10);\r\n\t\t}\r\n\r\n\t}\r\n\tChatWindow.map = {};\t// this is map with users..\r\n\r\n\r\n\t// cross-tab state inside localStorage\r\n\tvar ChatsOpen = new function()\r\n\t{\r\n\t\tvar ChatsOpen = this;\r\n\r\n\t\tChatsOpen.remove = function(username)\r\n\t\t{\r\n\t\t\tvar a = ChatsOpen.map();\r\n\t\t\tdelete a[username];\r\n\t\t\tlocalStorage['v31_hangout_chats'] = JSON.stringify(a);\r\n\t\t}\r\n\t\tChatsOpen.set = function(username, state)\r\n\t\t{\r\n\t\t\tvar a = ChatsOpen.map();\r\n\t\t\ta[username] = {username:username, state:state, windowUid: getWindowUid()};\r\n\t\t\tlocalStorage['v31_hangout_chats'] = JSON.stringify(a);\r\n\t\t}\r\n\t\tChatsOpen.getStateOf = function(username)\r\n\t\t{\r\n\t\t\tvar a = ChatsOpen.map();\r\n\t\t\ta = a[username];\r\n\t\t\tif (a) return a.state;\r\n\t\t}\r\n\t\tChatsOpen.map = function(username, state)\r\n\t\t{\r\n\t\t\tvar a = localStorage['v31_hangout_chats'];\r\n\t\t\tif (a) return JSON.parse(a);\r\n\t\t\treturn {};\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t// loaduje maily do localStoragu, aby sa nacitali len raz pre vsetky taby..\r\n\tvar MailReader = new function()\r\n\t{\r\n\t\tvar MailReader = this;\r\n\t\tMailReader.mapUsers = {};\r\n\t\tMailReader.onNewMail = function(username) {};\r\n\t\tMailReader.onNewChecked = function(nUnread) {};\r\n\t\tMailReader.onMailLoad = function(mails) {};\r\n\r\n\t\tMailReader.getMailsWith = function(username)\r\n\t\t{\r\n\t\t\tvar mails = MailReader.getMails();\r\n\r\n\t\t\tvar out = [];\r\n\t\t\tfor (var i=0; i < mails.length; i++)\r\n\t\t\t{\r\n\t\t\t\tvar m = mails[i];\r\n\t\t\t\tif (m.username_from==username ||\r\n\t\t\t\t\tm.username_to==username)\r\n\t\t\t\t\tout.push(m)\r\n\t\t\t}\r\n\t\t\treturn out;\r\n\t\t}\r\n\t\tMailReader.sendMail = function(username, content, fnSuccess, fnFail)\r\n\t\t{\r\n\t\t\tvar data = {mail_to:username, mail_to_type:'name', mail_text:content, event:'send'};\r\n\t\t\t$.post('/id/24', data)\r\n\t\t\t.success(function(html) {\r\n\t\t\t\t_parseMails(html);\r\n\t\t\t\tif (fnSuccess) fnSuccess();\r\n\t\t\t})\r\n\t\t\t.fail(function() {\r\n\t\t\t\tif (fnFail) fnFail();\r\n\t\t\t});\r\n\t\t}\r\n\t\tMailReader.getUsers = function()\r\n\t\t{\r\n\t\t\tvar users = localStorage['v31_hangout_users'];\r\n\t\t\tif (users) return JSON.parse( users )\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tMailReader.getMails = function(bReload)\r\n\t\t{\r\n\t\t\tif (bReload)\r\n\t\t\t\t_loadMails();\r\n\r\n\t\t\t/*\r\n\t\t\tif (MailReader.isNewMail() || !localStorage['v31_hangout_mails'])\r\n\t\t\t{\r\n\t\t\t\tif (ago(localStorage['v31_hangout_lastLoadMail']) > 5)\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalStorage['v31_hangout_lastLoadMail'] = time();\r\n\t\t\t\t\t_loadMails();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t*/\r\n\r\n\t\t\tvar mails = localStorage['v31_hangout_mails'];\r\n\t\t\tif (mails) return JSON.parse( mails )\r\n\t\t\treturn [];\r\n\t\t}\r\n\t\tMailReader.ifInMail_ParseMails = function()\r\n\t\t{\r\n\t\t\tif (window.location.pathname == '/id/24' ||\r\n\t\t\t\twindow.location.pathname == '/id/24/')\r\n\t\t\t\t_parseMails( $('body') );\r\n\t\t}\r\n\r\n\t\t/////////////////////////////////////////\r\n\t\tfunction _loadMails()\r\n\t\t{\r\n\t\t\t$.get('/id/24', function(html) {\r\n\t\t\t\tMailReader.numUnreadNull();\r\n\t\t\t\t_parseMails(html);\r\n\t\t\t});\r\n\t\t}\r\n\t\tfunction _clearUsers()\r\n\t\t{\r\n\t\t\tMailReader.mapUsers = {};\r\n\t\t\tMailReader.arrUsers = [];\r\n\t\t}\r\n\t\tfunction _addUser(m)\r\n\t\t{\r\n\t\t\tif (!MailReader.mapUsers[m.userid_from])\r\n\t\t\t{\r\n\t\t\t\tMailReader.mapUsers[m.userid_from] = 1;\r\n\t\t\t\tMailReader.arrUsers.push( {id:m.userid_from, name:m.username_from, online:m.userlive_from} );\r\n\t\t\t}\r\n\t\t\tif (!MailReader.mapUsers[m.userid_to])\r\n\t\t\t{\r\n\t\t\t\tMailReader.mapUsers[m.userid_to] = 1;\r\n\t\t\t\tMailReader.arrUsers.push( {id:m.userid_to, name:m.username_to, online:m.userlive_to} );\r\n\t\t\t}\r\n\t\t}\r\n\t\tfunction _parseMails(html)\r\n\t\t{\r\n\t\t\tvar mails = [];\t\t// {userid_from, userid_to, timestamp, unread, new, content}\r\n\r\n\t\t\t_clearUsers();\r\n\t\t\tvar $mails = $(html).find('#formular .message');//.get().reverse();\r\n\t\t\t$.each($mails, function(i, e) {\r\n\t\t\t\tvar m = _extractMailFromElement(e);\r\n\t\t\t\tmails.push( m );\r\n\r\n\t\t\t\t_addUser(m);\r\n\r\n\t\t\t\tif (m.isNew)\r\n\t\t\t\t\tMailReader.onNewMail(m);\r\n\t\t\t});\r\n\r\n\t\t\tmails.reverse();\r\n\t\t\tlocalStorage['v31_hangout_mails'] = JSON.stringify( mails );\r\n\t\t\tlocalStorage['v31_hangout_users'] = JSON.stringify( MailReader.arrUsers );\r\n\r\n\t\t\tMailReader.onMailLoad( mails );\r\n\t\t}\r\n\t\tfunction _extractMailFromElement(e)\r\n\t\t{\r\n\t\t\te=$(e);\r\n\t\t\tvar $from\t\t= e.find('a[href^=javascript]:eq(0)');\r\n\t\t\tvar $to\t\t\t= e.find('a[href^=javascript]:eq(1)');\r\n\r\n\t\t\tvar m = {};\r\n\t\t\tm.userid_from\t= parseInt( $from.attr('href').match(/[\\d]+\\'\\)$/)[0] );\r\n\t\t\tm.userid_to\t\t= parseInt( $to.attr('href').match(/[\\d]+\\'\\)$/)[0] );\r\n\t\t\tm.username_from = $from.text();\r\n\t\t\tm.username_to\t= $to.text();\r\n\t\t\tm.userlive_from\t= !!$from[0].nextSibling.data.match('location');\r\n\t\t\tm.userlive_to\t= !!$to[0].nextSibling.data.match('location');\r\n\r\n\t\t\tm.timestamp\t= $.trim(e.find('.mail_checkbox')[0].nextSibling.nextSibling.nextSibling.data);\r\n\t\t\tm.important\t= $.trim(e.find('.header .most_important').text()).toLowerCase();\r\n\t\t\tm.isUnread\t= (m.important=='unread');\r\n\t\t\tm.isNew\t\t= (m.important=='new');\r\n\t\t\tm.content\t= e.find('.content').html();\r\n\t\t\tm.id\t\t= parseInt( e.find('.mail_checkbox').attr('name').match(/[\\d]+/)[0] );\r\n\t\t\tm.isMe\t\t= m.userid_from == 1297258;\r\n\t\t\treturn m;\r\n\t\t}\r\n\r\n\t\tMailReader.numUnreadNull = function()\t// when loading mails, we reset this\r\n\t\t{\r\n\t\t\tlocalStorage['v31_hangout_numUnread'] = 0;\r\n\t\t\tlocalStorage['v31_hangout_lastCheckMail'] = time();\r\n\t\t}\r\n\t\tMailReader.numUnread = function()\r\n\t\t{\r\n\t\t\tif (ago(localStorage['v31_hangout_lastCheckMail']) > 10) {\r\n\t\t\t\tlocalStorage['v31_hangout_lastCheckMail'] = time();\r\n\t\t\t\t_checkNewMail();\r\n\t\t\t}\r\n\r\n\t\t\treturn parseInt(localStorage['v31_hangout_numUnread']);\r\n\t\t}\r\n\r\n\t\tfunction _checkNewMail()\r\n\t\t{\r\n\t\t\t$.get('/ajax/check_new_mail.php', function(resp) {\r\n\t\t\t\tvar nUnread = parseInt(resp);//(resp[0]!='0') ? resp.substr(2) : '';\r\n\t\t\t\tlocalStorage['v31_hangout_numUnread'] = nUnread;\r\n\r\n\t\t\t\tif (nUnread && resp != localStorage['v31_hangout_lastPukResp']) {\r\n\t\t\t\t\t_soundPuk();\r\n\t\t\t\t\tMailReader.onNewChecked(nUnread);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlocalStorage['v31_hangout_lastPukResp'] = resp;\r\n\t\t\t})\r\n\t\t}\r\n\t};\r\n}", "title": "" }, { "docid": "cd3d9fed50d65d5a77418b790cc183f8", "score": "0.56551236", "text": "function Client()\r\n {\r\n var _self \t\t\t= this;\r\n \r\n var _status \t\t= false;\r\n var _subscription\t= null;\r\n\r\n var _username \t\t= null; \r\n \r\n \r\n \r\n var url = location.protocol + \"//\" + location.host + config.contextPath + \"/cometd\";\r\n $.cometd.configure\r\n (\r\n {\r\n url: url,\r\n logLevel: 'debug'\r\n });\r\n \r\n \r\n $.cometd.addListener('/meta/connect', _connect);\r\n $.cometd.addListener('/meta/handshake', _handshake);\r\n \r\n \r\n this.login = function(username)\r\n {\r\n \tif (_status)\r\n \t{\r\n \t\tstatus('you already are logged !!');\r\n \t \r\n \t}\r\n \telse\r\n \t{\r\n \t\t _username = username; \r\n \t\t \r\n \t\t $.cometd.handshake();\r\n \t}\r\n \t\r\n \t\r\n\r\n };\r\n \r\n this.logout = function()\r\n {\r\n \tif (_status)\r\n \t{\r\n \t\t $.cometd.disconnect();\r\n \t \r\n \t}\r\n\r\n };\r\n \r\n \r\n this.send = function()\r\n {\r\n \tif (!_status)\r\n \t{\r\n \t\tstatus('cannot send because you are disconnected !!');\r\n \t \r\n \t}\r\n \telse\r\n \t{\r\n \t\t$.cometd.publish('/service/event','Pushed');\r\n \t}\r\n \r\n };\r\n\r\n this.receive = function(message)\r\n {\r\n \t$('#response').text(message.data);\r\n };\r\n \r\n \r\n function status(message)\r\n {\r\n \t$('#status').append('<div>' + message + '</div>');\r\n };\r\n\r\n \r\n function _unsubscribe()\r\n {\r\n \tif (_subscription)\r\n {\r\n $.cometd.unsubscribe(_subscription);\r\n }\r\n \t\r\n \t_subscription = null;\r\n \r\n }\r\n\r\n function _subscribe(channel)\r\n {\r\n _subscription = $.cometd.subscribe(channel, _self.receive);\r\n }\r\n\r\n function _handshaked()\r\n {\r\n \t\r\n \t status('handshake successful');\r\n \t \r\n \t $('#username').prop('disabled', true);\r\n \t $('#login').prop('disabled', true);\r\n \t $('#logout').prop('disabled', false);\r\n \t \r\n \t \r\n \t _subscribe('/event/' + _username);\r\n }\r\n\r\n function _connected()\r\n {\r\n \t\r\n \t status('connected');\r\n \t _status \t= true;\r\n \r\n }\r\n\r\n function _disconnected()\r\n {\r\n status('disconnected');\r\n _status = false;\r\n \r\n $('#username').prop('disabled', false);\r\n \t \t$('#login').prop('disabled', false);\r\n \t \t$('#logout').prop('disabled', true);\r\n \r\n }\r\n\r\n function _closed()\r\n {\r\n \t status('closed');\r\n \t _status = false;\r\n \r\n }\r\n\r\n /*\r\n * Be warned that the use of the _connect() along with the _connected status variable can result in your code \r\n * to be called more than once if, for example, you experience temporary network failures or if the server restarts.\r\n */\r\n function _connect(message)\r\n {\r\n \t\t/*\r\n \t\t * One small caveat with the /meta/connect channel is that /meta/connect is also used for polling the server. \r\n \t\t * Therefore, if a disconnect is issued during an active poll, the server returns the active poll and this triggers the /meta/connect listener\r\n \t\t */\r\n \t\tif ($.cometd.isDisconnected())\r\n \t\t{\r\n \t\t\t _disconnected();\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n\t var t = _status;\r\n\t _status = message.successful === true;\r\n\t if (!t && _status)\r\n\t {\r\n\t _connected();\r\n\t }\r\n\t else if (t && !_status)\r\n\t {\r\n\t _disconnected();\r\n\t }\r\n \t\t}\r\n }\r\n\r\n function _handshake(message)\r\n {\r\n if (message.successful)\r\n {\r\n _handshaked();\r\n }\r\n }\r\n\r\n \r\n \r\n \r\n \r\n }", "title": "" }, { "docid": "5051146b703787fd5a55cbb24b684cda", "score": "0.5642545", "text": "function updateChat(msg) {\n var data = JSON.parse(msg.data);\n console.log(data.ERROR);\n if(data.hasOwnProperty('ERROR')) {\n \talert(data.ERROR);\n } else {\n insert(\"chat\", data.userMessage);\n id(\"userList\").innerHTML = \"\";\n data.userList.forEach(function (user) {\n insert(\"userList\", \"<li>\" + user + \"</li>\");\n });\n }\n\n}", "title": "" }, { "docid": "78ac2cc60cebe4d6352a53fdd8f4ddd1", "score": "0.564217", "text": "function updateChat(msg){\n\tvar data = JSON.parse(msg.data);\n\tinsert(\"chat\", data.userMessage);\n\tid(\"userlist\").innerHTML = \"\";\n\tdata.userlist.forEach(function (user){\n\t\tinsert(\"userlist\", \"<li>\" + user+\"</li>\");\n\t});\n}", "title": "" }, { "docid": "b612c07ea2ce8be62b294e9be2c70e46", "score": "0.5639288", "text": "render() {\n return (\n <div className=\"ChatApp\">\n <ChatFeed\n handleFormData={this._handleFormData}\n messages={this.state.messages}\n isTyping={this.state.is_typing}\n hasInputField={true}\n bubblesCentered={false}\n bubbleStyles={{\n text: {fontSize: 20},\n chatbubble: {borderRadius: 10,padding: 25}\n }}\n />\n </div>\n );\n }", "title": "" }, { "docid": "651cbf791eb7bbcdc918a372d9e0899b", "score": "0.5623812", "text": "function chat () {\n 'use strict';\n var socket;\n var username = \"\";\n\n this.init = function (controls) {\n };\n\n this.connect = function(io){\n /**\n * Created by ozkey_000 on 3/09/14.\n */\n\n socket = io.connect('http://localhost:8080');\n\n // on connection to server, ask for user's name with an anonymous callback\n socket.on('connect', function () {\n // call the server-side function 'adduser' and send one parameter (value of prompt)\n var id = Math.floor((Math.random() * 1000) + 1);\n username = \"u\"+id;\n socket.emit('adduser', username);\n });\n\n // listener, whenever the server emits 'updatedata', this updates the chat body\n socket.on('updatedata', function (username, data) {\n $('#conversation').append('<b>' + username + ':</b> ' + data + '<br>');\n });\n\n // listener, whenever the server emits 'updateusers', this updates the username list\n socket.on('updateusers', function (data) {\n $('#users').empty();\n $.each(data, function (key, value) {\n $('#users').append('<div>' + key + '</div>');\n });\n });\n\n socket.on('gameBoardData', function (data) {\n gameBoardClient.updateGameBoard(data);\n });\n\n // when the client clicks SEND\n $('#datasend').click(function () {\n var message = $('#data').val();\n $('#data').val('');\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit('sendchat', message);\n });\n\n $(document).keydown (function(e) {\n // when the client hits ENTER on their keyboard\n $('#data').keypress(function (e) {\n if (e.which == 13) {\n $(this).blur();\n $('#datasend').focus().click();\n }\n });\n });\n }\n}", "title": "" }, { "docid": "936cd3ef73c31d09a16207a6204ccf6b", "score": "0.5615189", "text": "function chat_connect(id){\n overlay_activate()\n try{\n let ws_connection = new WebSocket(\n `${url_center['chat']}/${id}`\n )\n return ws_connection\n }\n catch{\n console.log(\"something went wrong while connecting to websocket :(\")\n }\n }", "title": "" }, { "docid": "f35bfdf7ccff791c70b04387202dbe3a", "score": "0.56141865", "text": "function toggle_chat() {\n\n}", "title": "" }, { "docid": "7c3b5d1c648f0b3aebc24c0e72a888e0", "score": "0.5611967", "text": "function open_chat(chat, chat_type) {\n document.querySelector('#chat_window').removeAttribute('hidden');\n document.querySelector('#chat_name').innerHTML = chat;\n document.querySelector('#messages').innerHTML = \"\";\n const request = new XMLHttpRequest();\n request.open('GET', `/api/chat/${chat}?chat_type=${chat_type}&user_name=${user_name}`);\n request.onload = () => {\n const resp = JSON.parse(request.responseText);\n if (!resp.success) {\n document.querySelector('.alert').removeAttribute('hidden');\n document.querySelector('#error').innerHTML = resp.error;\n }\n else {\n document.querySelector('#messages').innerHTML = \"\";\n if (resp.messages.length === 0)\n {\n document.querySelector('#messages').innerHTML = \"No messages\";\n }\n else\n {\n for (let i = 0; i < resp.messages.length; i++)\n {\n const message = document.createElement('div');\n const user = document.createElement('h6');\n const date = document.createElement('small');\n const text = document.createElement('div');\n user.innerHTML = resp.messages[i]['user'];\n date.innerHTML = moment(resp.messages[i]['date']).fromNow();\n text.innerHTML = resp.messages[i]['message'];\n if (user_name !== resp.messages[i]['user'])\n {\n message.append(user);\n message.className = 'message_body';\n }\n else {\n message.className = 'message_body from_me';\n const del = document.createElement('span');\n del.className = \"delete_message material-icons message-icon\";\n del.innerHTML = 'delete';\n del.setAttribute('data-id', `${i}`);\n message.append(del);\n }\n message.append(text);\n message.append(date);\n if (i === resp.messages.length - 1)\n {\n message.setAttribute('id', 'new_message');\n }\n document.querySelector('#messages').append(message);\n }\n document.querySelectorAll('.delete_message').forEach(span => {\n span.onclick = () => {\n let message_id = span.getAttribute('data-id');\n socket.emit('delete_message', {'chat': g_chat, 'chat_type': g_chat_type, 'id': message_id, 'user_name': user_name});\n };\n });\n }\n }\n document.title = chat;\n history.pushState({'title': chat, 'text': resp}, chat, `/chat/${chat_type}/${chat}`);\n };\n g_chat_type = chat_type;\n g_chat = chat;\n activate_chat();\n request.send();\n }", "title": "" }, { "docid": "e8f25c619adf1fb1db7b9fe628c85c8c", "score": "0.5608976", "text": "handleMessage (client, message) {\n //console.log(\"onMessage\",client,message);\n console.log(\"TeamsConfigRoom\", \"onMessage\", this.roomName);\n\n const [command, data] = message;\n console.log(\"command\", command);\n console.log(\"data\", data);\n\n const handler = this.commandLibrary.getCommandHandler(command);\n\n if(handler) {\n // handler.handlerFunc(myClient, message);\n handler.handlerFunc(client, message);\n } else {\n console.log(\"unknown command\", command, data);\n }\n\n\n super.handleMessage(client, message);\n }", "title": "" }, { "docid": "cd1c0765c9ba2fa9af00b567b8d7a8c7", "score": "0.56071585", "text": "function passChatDb() {\n if (Object.keys(messageJson).length > 0) {\n socket.emit('updateDbChat', JSON.stringify(messageJson));\n }\n}", "title": "" }, { "docid": "97fc8a5495616bb6b413623f5c73739a", "score": "0.5606027", "text": "function Client(clientInfo, socketID) {\n for (var fld in clientInfo) {\n this[fld] = clientInfo[fld];\n }\n this.playerNo = null;\n this.socketID = socketID;\n this.playerStory = null;\n}", "title": "" }, { "docid": "4cc5be0356832369cd709e0cc8b8d183", "score": "0.5602179", "text": "showChat(index) {\n this.activeContact = index;\n this.activeMessage = false;\n }", "title": "" }, { "docid": "f911375f054f88b7706efa8186725b5a", "score": "0.5600517", "text": "function chat_owner(){\r\n if(!JBE_ONLINE){ \r\n snackBar('OFFLINE');\r\n return;\r\n }\r\n if(!CURR_USER){\r\n snackBar(\"Please Log In\");\r\n return;\r\n }\r\n\r\n window.history.pushState({ noBackExitsApp: true }, '');\r\n f_MainPage=false;\r\n\r\n var dtl= \r\n '<div id=\"div_chat_owner\" data-new=0 data-catno=\"\" data-img=\"\" style=\"width:100%;height:100%;padding:5px;background:white;\">'+ \r\n '<div style=\"width:100%;height:20px;margin-top:0px;background:white;\">'+\r\n '<span style=\"float:left;width:70%;height:100%;background:white;\">Username</span>'+\r\n '<span style=\"float:right;width:30%;height:100%;text-align:right;background:white;\"># Messages</span>'+\r\n '</div>'+\r\n '<div id=\"dtl_chat_owner\" style=\"width:100%;height:'+(H_VIEW-25)+'px;margin-top:0px;background:white;\"></div>'+\r\n '</div>';\r\n \r\n openView(dtl,'Select Client','close_chat_owner');\r\n disp_chat_owner();\r\n}", "title": "" }, { "docid": "69ae6f7f667cc8cec3f55e029e984146", "score": "0.5597214", "text": "function individualBotChat(chat) {\n\t\t\tconsole.log('I am bot chat');\n\t\t\tvar out = '';\n\t\t\tif (chat.handle == $('#user-info-username').text()) {\n\t\t\t\tout = 'message-out';\n\t\t\t}\n\n\t\t\tvar source = $(\"#message-template-bot\").html();\n\t\t\tvar template = Handlebars.compile(source);\n\t\t\tvar context = {\n\t\t\t\tmessage: chat.message,\n\t\t\t\tout: out,\n\t\t\t\tuser: chat.handle,\n\t\t\t\t// date: datetime.date,\n\t\t\t\t// time: datetime.time,\n\t\t\t\t// hidden: flag ? 'hidden' : '',\n\t\t\t};\n\t\t\tvar $ele = template(context); \n\n\t\t\treturn $ele;\n\t\t}", "title": "" }, { "docid": "d310cc005741bee9ef9c29f887c5b1c5", "score": "0.559714", "text": "function onOneOnOneChatCreate() {\n /*\n * 1. Is there a LISTED chat with 1 person in it?\n * -> Yes: return chatname, put user in this chat, done\n * -> No : Continue to (2)\n * \n * 2. Create a new random chat\n * 3. Make this chat listed\n * 4. Put user in this chat\n * 5. Send server message with info\n * 6. Repeat\n * 7. Profit???\n * \n */\n\n view('loading');\n $.getJSON(\"GhostChatServlet?action=getRandomListedChat\", function(data) {\n app.chatname = data.chatname;\n if (data.found === true) {\n app.chatType = 'join';\n } else {\n app.chatType = 'create';\n }\n var tmp = app.listed; // Remember setting, random chats must be listed\n app.listed = true;\n joinChat();\n app.listed = tmp; // Restore setting\n return;\n });\n\n}", "title": "" }, { "docid": "4e30af44e4829bfa762c1d8b73032928", "score": "0.5596734", "text": "function insereMessage3(objUser, message) {\n \n var text;\n \n if (objUser){\n text = '['+objUser.typeClient+'] '+ message;\n } else {\n text = '[????] '+ message;\n }\n /**/\n text += '\\n';\n \n $('#zone_chat_websocket').prepend(text);\n}", "title": "" }, { "docid": "6f4f94bfdc19b21b72aca02b8ce61622", "score": "0.55959237", "text": "function instaChat(container) {\n var socket = null;\n var config = {\n adress: \"ws://vhost3.lnu.se:20080/socket/\",\n key: \"eDBE76deU7L0H9mEBgxUKVR0VCnq0XBd\",\n channel: \"\"\n };\n\n login().then(function() {\n connect().then(function() {\n printOperationsScreen();\n container.querySelector(\".textArea\").addEventListener(\"keypress\", function(event) {\n if (event.keyCode === 13) {\n send(event.target.value);\n event.target.value = \"\";\n event.preventDefault();\n }\n });\n });\n });\n\n /**\n * Loads the template and prints the login screen in the container.\n */\n function printLoginScreen() {\n var template;\n var node;\n\n template = document.querySelector(\"#instaChatLoginTemplate\");\n node = document.importNode(template.content, true);\n container.appendChild(node);\n }\n\n /**\n * Loads the template for operations. So the charBox and textarea is created. The select element with the channel\n * options is also added together with an event listener listening for change in the select. When there is a change\n * the new channel is used to both listen on and write to. A notification is also printed.\n */\n function printOperationsScreen() {\n var template;\n var node;\n var options;\n\n template = document.querySelector(\"#instaChatTemplate\");\n node = document.importNode(template.content, true);\n container.appendChild(node);\n\n template = document.querySelector(\"#channelSelectTempalte\");\n node = document.importNode(template.content.firstElementChild, true);\n\n container.querySelector(\".topbar\").appendChild(node);\n\n node.addEventListener(\"change\", function() {\n var selected;\n options = node.children;\n\n selected = node.options[node.selectedIndex];\n\n config.channel = selected.value;\n printNotification(\"Switched to \" + selected.firstChild.data + \" channel\", false);\n });\n }\n\n /**\n * Prints a message to the chat box. Also ads a timestamp to each message so we know when we got it. The username of\n * the person who sent it is also displayed. If the message was sent by this user then the message will have\n * a different class to look different and instead of the username it will say \"you\".\n * @param message An objects from the server containing a message and other information.\n */\n function printMessage(message) {\n var template;\n var fragment;\n var messageElement;\n var usernameElement;\n var chatBox = container.querySelector(\".chatBox\");\n var date = new Date();\n var time = date.getHours() + \":\";\n if (date.getMinutes() < 10) {\n time += 0;\n }\n\n time += date.getMinutes();\n\n template = document.querySelector(\"#messageTemplate\");\n fragment = document.importNode(template.content, true);\n\n usernameElement = fragment.querySelector(\".username\");\n messageElement = fragment.querySelector(\".message\");\n\n if (message.username === sessionStorage.username) {\n message.username = \"You\";\n usernameElement.className += \" usernameSent\";\n messageElement.className += \" messageSent\";\n }\n\n usernameElement.appendChild(document.createTextNode(message.username + \" \" + time));\n messageElement.appendChild(document.createTextNode(message.data));\n\n chatBox.appendChild(fragment);\n }\n\n /**\n * Prints a notification in the chatBox. If temporary is true then the message will disapear after 5 seconds.\n * @param message A message we want in the notification.\n * @param temporary True if we want the message to disappear after 5 seconds. If not the false.\n */\n function printNotification(message, temporary) {\n var template = document.querySelector(\"#notificationTemplate\");\n var notification = document.importNode(template.content.firstElementChild, true);\n var text;\n\n text = document.createTextNode(message);\n\n notification.appendChild(text);\n\n container.querySelector(\".chatBox\").appendChild(notification);\n\n if (temporary) {\n setTimeout(function() {\n notification.remove();\n }, 5000);\n }\n }\n\n /**\n * Creates the login functionality. Returns a promise containing an if statement and an event listener. The if\n * statement checks if a username already exists in this session. If so we use that name and remove the loginDiv\n * and call resolve. The event listener is created if we can't find a username. It will listen to a press of the\n * enter key on the loginDiv. If there is nothing in the text input then a text is shows to the user. But if there\n * is a text then we save the name in session and move on.\n * @returns {Promise} A promise of a username.\n */\n function login() {\n printLoginScreen();\n var loginDiv = container.querySelector(\".instaChatLogin\");\n\n return new Promise(function(resolve) {\n\n if (sessionStorage.username) {\n loginDiv.remove();\n resolve();\n return;\n }\n\n loginDiv.addEventListener(\"keypress\", function(event) {\n if (event.keyCode === 13) {\n if (event.target.value) {\n sessionStorage.username = event.target.value;\n loginDiv.remove();\n resolve();\n } else {\n container.querySelector(\".alertText\").appendChild(document.createTextNode(\"Please enter a username!\"));\n }\n }\n });\n });\n }\n\n /**\n * This functions is called to connect to the server. It returns a Promise. In this Promise we create a web socket\n * connection to the server. We then listen for the event open from the server. We also listen for an error so we\n * know if something when wrong. An event listener for messages is also added. The type of the message is checked\n * and depending on what type it is then it will be printed as a message, a notification or not printed at all.\n * @returns {Promise}\n */\n function connect() {\n return new Promise(function(resolve, reject) {\n socket = new WebSocket(config.adress);\n socket.addEventListener(\"open\", function() {\n container.querySelector(\".closeWindowButton\").addEventListener(\"click\", function() {\n socket.close();\n });\n\n resolve();\n });\n\n socket.addEventListener(\"error\", function() {\n reject(\"An error has occured\");\n });\n\n socket.addEventListener(\"message\", function(event) {\n var message = JSON.parse(event.data);\n\n if (message.type === \"message\") {\n if (message.channel === config.channel) {\n printMessage(message);\n }\n } else if (message.type === \"notification\") {\n printNotification(message.data + \" Welcome \" + sessionStorage.getItem(\"username\"), true);\n }\n\n container.scrollTo(0, 100);\n });\n });\n }\n\n /**\n * This function is used to send messages to the server. We create an object and fill it with the information it\n * needs and then use send method.\n * @param text Text we want to send to the server and in turn the other users.\n */\n function send(text) {\n var data = {\n type: \"message\",\n data: text,\n username: sessionStorage.username,\n channel: config.channel,\n key: config.key\n };\n socket.send(JSON.stringify(data));\n }\n}", "title": "" }, { "docid": "119052b32d9cfdfdb6655521379dd5d6", "score": "0.5595009", "text": "constructor(...opts){\n super(...opts);\n this.on('message', (message) => {\n const data = JSON.parse(message);\n if(data.type==='request'){\n this.handle_request(data); \n } \n });\n }", "title": "" }, { "docid": "4d0cc686b423bb8dde850b92567027bf", "score": "0.55882996", "text": "function ChatMessage (data) {\n\t\tthis.name = data.Name;\n\t\tthis.message = data.Message;\n\t}", "title": "" }, { "docid": "aea844eb67668469568c3cc993be9013", "score": "0.55847114", "text": "function loadChat() {\n\tif (!validarDatos()) {\n\t return;\n\t}\t\n activarCapa(capaChat);\n\tloadDatos();\n\tif (_ref > 0) {\n sendFeedback(\"AV2CHAT\");\n\t}\n\t//carga variables asociadas a elementos del DOM\n\tcapaEmotion = document.getElementById(capaEmotion);\n\tcapaChatTxt = document.getElementById(capaChatTxt);\n\t//Escribe automaticamente la linea de entrada\n\tprintResponse(translate(\"PANTALLA-CHAT-ENTRADILLA\"));\n}", "title": "" } ]
afd432b79e7560392d22e451e748c2e5
prop:defaultListener: the default listener executed only when the Worker calls the pM() function directly mets: sendQuery (// queryable function name,g0,g1 )// calls a Worker's queryable function pM (string or JSON Data): see Worker.prototype.pM() terminate (): terminates the Worker addListener (name, function): adds a listener removeListener (name): removes a listener
[ { "docid": "b56a4327d6151c024b484abaae6e5a1f", "score": "0.59146917", "text": "function QueryableWorker (sURL, fDefListener, fOnError) {\n\n var oInstance = this,\n w = $Wr(sURL),\n oListeners = {};\n this.defaultListener = fDefListener || function () {};\n w.m(function (m){\n if (O(m.d)\n && m.d.hasOwnProperty(\"vo42t30\")\n && m.d.hasOwnProperty(\"rnb93qh\")) {\n oListeners[m.d.vo42t30]\n .apply(oInstance, m.d.rnb93qh)\n }\n\n else {\n this.defaultListener.call(oInstance, m.d);\n }\n })\n if (fOnError) { w.onerror = fOnError; }\n this.sendQuery = function () {var g=G(arguments)\n // queryable function name, argument to//pass 1,\n // argument to pass 2, etc. etc\n if (g.u) {throw new TypeError(\n \"QueryableWorker.sendQuery - not enough args\")\n return }\n wr.pM({bk4e1h0: g.f, ktp3fm1: g.r})\n }\n\n this.pM = function (vMsg) {\n //I just think there is no need to use call() method\n //how about just w.pM(vMsg);\n //the same situation with terminate\n //well,just a little faster,no search up the prototye chain\n Worker.prototype.pM.call(w, vMsg);\n }\n this.terminate = function () {Worker.prototype.terminate.call(w)}\n this.addListener = function (sName, fListener){oListeners[sName] = fListener}\n this.removeListener = function(sName){delete oListeners[sName]};\n\n }", "title": "" } ]
[ { "docid": "c62d0586cb1d21a9a01432e403877084", "score": "0.55634826", "text": "function onWorkerReady(){\r\n worker.removeEventListener('message',onWorkerReady);\r\n worker.addEventListener('message',onWorkerData);\r\n worker.postMessage(parseInt(vm.limit,10));\r\n }", "title": "" }, { "docid": "99228a2f79c10b2c17a4a09d54da0d72", "score": "0.54949003", "text": "function Listener() { }", "title": "" }, { "docid": "80b565714a8c0e2bfe499c439e1675de", "score": "0.53228605", "text": "function attachDefaultListeners() {\n var listenerDiv = $('listener');\n listenerDiv.addEventListener('load', moduleDidLoad, true);\n listenerDiv.addEventListener('error', moduleLoadError, true);\n listenerDiv.addEventListener('progress', moduleLoadProgress, true);\n listenerDiv.addEventListener('message', handleMessage, true);\n listenerDiv.addEventListener('crash', handleCrash, true);\n attachListeners();\n}", "title": "" }, { "docid": "cc6c7f99be657a8273dc6a066f3c95e9", "score": "0.52962804", "text": "get listener() : Function {\n return _listener;\n }", "title": "" }, { "docid": "08268ef409aa3a7b451087eba06b1b7f", "score": "0.5169671", "text": "_on (name, listener) {\n\t\tlet self = this;\n\t\tdebug.assert(name).is('string');\n\t\tdebug.assert(listener).is('function');\n\t\t//debug.log('name =', name, ', listener=', listener);\n\t\tself._events.on(name, listener);\n\t\treturn self.listen(name);\n\t}", "title": "" }, { "docid": "8abd064e4bdcccc0da92341476507ee5", "score": "0.51257795", "text": "function appMessageListener(m) {\n// console.log(\"Background got message from app:\", m);\n var id;\n switch (m.topic) {\n case TOPIC.PROBE:\n id = parseInt(m.data.id);\n var notify = false;\n if (m.data.programs === null) {\n selectList.delete(id);\n } else {\n var selectItem = selectList.get(id);\n if (selectItem !== undefined) {\n var a = m.data.programs.manifest.split(\" \");\n m.data.programs.manifest = (a.length === 1 && a[0] === \"\") ? [] : a;\n selectItem.programs = m.data.programs;\n verifyInsert(id, selectItem);\n notify = selectItem.programs.list.length > 1;\n }\n }\n setBusy(false);\n if (isBusy === 0 || notify) {\n post2popup({topic: TOPIC.INIT_SNIFFER, data: selectList});\n }\n break;\n case TOPIC.DOWNLOAD:\n id = parseInt(m.data.id);\n post2popup({id: id, topic: m.topic, data: updateDownload(m.data)});\n break;\n case TOPIC.SUBFOLDERS:\n case TOPIC.EXISTS:\n post2popup(m);\n break;\n case TOPIC.HOME:\n options.outdir = m.data.home;\n browser.storage.local.set(options);\n break;\n case TOPIC.VERSION:\n options.appVersion = m.data.version;\n if (appVersionOutdated()) {\n options.appError = APP_ERROR.VERSION;\n port2app.disconnect();\n } else {\n options.appError = APP_ERROR.NONE;\n initOptions();\n }\n setActive();\n post2options({topic: TOPIC.GET_OPTIONS, data: options});\n break;\n }\n}", "title": "" }, { "docid": "2aeff371974c257098d9f7a00aa89897", "score": "0.5065162", "text": "function start(){\n window.addEventListener(\"message\", _listener);\n }", "title": "" }, { "docid": "00b29a02c5c7b7d9465d443e2dec1c3f", "score": "0.50647885", "text": "addListener(what, callback) {\n if (!this.Mx) {\n throw \"listeners cannot be added until pluginInit is called\";\n }\n mx.addEventListener(this.Mx, what, callback, false);\n }", "title": "" }, { "docid": "9aae8aa07fcc6ecf024d63312e4710b1", "score": "0.5064574", "text": "function onListening() {\n}", "title": "" }, { "docid": "d3c8a105c7f5330d08dce268be6a5f1c", "score": "0.5048361", "text": "addListener(callback) {\r\n window.addEventListener('message', callback);\r\n }", "title": "" }, { "docid": "4059d1e7336c3f71e2df1083b8c35cd0", "score": "0.502145", "text": "Start() {\n window.addEventListener(\"message\",this.Listener.bind(this),false);\n for (var i = 0; i < this.min; i++) this.WebWorker(i);\n this.parent.postMessage({cmd:\"Ready\"},this.domain);\n return this;\n }", "title": "" }, { "docid": "284d5afb806d154c6bc282cfaa1b69ca", "score": "0.50202453", "text": "function addListeners() {\n browser.runtime.onMessage.addListener( handleOnMessageEvent );\n}", "title": "" }, { "docid": "ac26e2b72dfd9bd299dfc652294c3ef9", "score": "0.5005799", "text": "function AlmightyListener()\n{\n // get the message\n var message = getLatestMessage();\n handleCommand( message );\n\n // debug message if you're so inclined to hear it\n if (chatty_debug) console.debug('listner done!');\n\n}", "title": "" }, { "docid": "8806b97b4cda43364a5e45db5c257ed5", "score": "0.5004144", "text": "constructor(m_options) {\n this.m_options = m_options;\n this.m_workerChannelLogger = harp_utils_1.LoggerManager.instance.create(\"WorkerChannel\");\n this.m_eventListeners = new Map();\n this.m_workers = new Array();\n // List of idle workers that can be given the next job. It is using a LIFO scheme to reduce\n // memory consumption in idle workers.\n this.m_availableWorkers = new Array();\n this.m_workerPromises = new Array();\n this.m_readyPromises = new Map();\n this.m_requests = new Map();\n this.m_workerRequestQueue = [];\n this.m_nextMessageId = 0;\n this.m_stopped = true;\n this.m_referenceCount = 0;\n /**\n * Handles messages received from workers. This method is protected so that the message\n * reception can be simulated through an extended class, to avoid relying on real workers.\n *\n * @param workerId The workerId of the web worker.\n * @param event The event to dispatch.\n */\n this.onWorkerMessage = (workerId, event) => {\n if (harp_datasource_protocol_1.WorkerServiceProtocol.isResponseMessage(event.data)) {\n const response = event.data;\n if (response.messageId === null) {\n logger.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: no messageId`);\n return;\n }\n const entry = this.m_requests.get(response.messageId);\n if (entry === undefined) {\n logger.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: invalid messageId`);\n return;\n }\n if (workerId >= 0 && workerId < this.m_workers.length) {\n const worker = this.m_workers[workerId];\n this.m_availableWorkers.push(worker);\n // Check if any new work has been put into the queue.\n this.checkWorkerRequestQueue();\n }\n else {\n logger.error(`[${this.m_options.scriptUrl}]: onWorkerMessage: invalid workerId`);\n }\n if (response.errorMessage !== undefined) {\n const error = new Error(response.errorMessage);\n if (response.errorStack !== undefined) {\n error.stack = response.errorStack;\n }\n entry.resolver(error);\n }\n else {\n entry.resolver(undefined, response.response);\n }\n }\n else if (harp_datasource_protocol_1.WorkerServiceProtocol.isInitializedMessage(event.data)) {\n const readyPromise = this.getReadyPromise(event.data.service);\n if (++readyPromise.count === this.m_workerPromises.length) {\n readyPromise.resolve();\n }\n }\n else if (isLoggingMessage(event.data)) {\n switch (event.data.level) {\n case harp_utils_1.LogLevel.Trace:\n this.m_workerChannelLogger.trace(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Debug:\n this.m_workerChannelLogger.debug(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Log:\n this.m_workerChannelLogger.log(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Info:\n this.m_workerChannelLogger.info(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Warn:\n this.m_workerChannelLogger.warn(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Error:\n this.m_workerChannelLogger.error(...event.data.message);\n break;\n }\n }\n else {\n this.eventHandler(event);\n }\n };\n this.start();\n }", "title": "" }, { "docid": "a6b0c8a3f1f8bb4a12b9feb7d764cf39", "score": "0.4972998", "text": "function WorkerDispatcher() {\n this.msgId = 1;\n this.worker = null;\n}", "title": "" }, { "docid": "489e41a25bd268b2f0de2b27da3247e2", "score": "0.49613073", "text": "function sendMessageToWorker(e) {\n\tvar data = document.getElementById(\"msg\").value;\n if (myWorker != null) {\n myWorker.postMessage(data);\n } \n }", "title": "" }, { "docid": "ae06a87b903be7757543cf3c6b0b09db", "score": "0.49097165", "text": "function messageListener() {\n chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {\n executeMessage(request, sender, sendResponse);\n return true\n });\n}", "title": "" }, { "docid": "e32ab7cc8b91b7b97eb145a3464bb652", "score": "0.49070296", "text": "function worker(workerName,realName,num,maximum){\r\n\tthis.name = workerName;\r\n\tthis.displayName = realName;\r\n\tthis.number = num;\r\n\tthis.max = maximum;\r\n}", "title": "" }, { "docid": "7217fe2c09a091a65eca2d0df82cf168", "score": "0.48938328", "text": "addEventListener(_type, listener) {\n if (this.abortListeners) this.abortListeners.push(listener);\n }", "title": "" }, { "docid": "c182333dbd10820998d7c909fdcea07e", "score": "0.4886016", "text": "function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}", "title": "" }, { "docid": "33ef12f30b38c50bd1b64aab5cad3afb", "score": "0.48665527", "text": "listenForResults(listener, key, callback) {\n this.listeners[listener][key] = callback;\n }", "title": "" }, { "docid": "33ef12f30b38c50bd1b64aab5cad3afb", "score": "0.48665527", "text": "listenForResults(listener, key, callback) {\n this.listeners[listener][key] = callback;\n }", "title": "" }, { "docid": "128f090b9acb3cd46a5d1791140116ad", "score": "0.48260593", "text": "handleWorkerMessage(e) {\n var _a;\n const data = e.data;\n if (((_a = data.recipient) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === \"broadcaster\") {\n this.inbox(data.data);\n }\n else {\n this.sendDataToInboxes(data.inboxIndexes, data.data);\n }\n }", "title": "" }, { "docid": "a8e332a1dbc192f406b80030d6c567fa", "score": "0.48143652", "text": "function listenerFor42(listener, options) {\n\t\tvar rpc = webinos.rpcHandler.createRPC(this, \"listenAttr.listenFor42\", [options]);\n\n\t\t// add one listener, could add more later\n\t\trpc.onEvent = function(obj) {\n\t\t\t// we were called back, now invoke the given listener\n\t\t\tlistener(obj);\n\t\t\twebinos.rpcHandler.unregisterCallbackObject(rpc);\n\t\t};\n\n\t\twebinos.rpcHandler.registerCallbackObject(rpc);\n\t\twebinos.rpcHandler.executeRPC(rpc);\n\t}", "title": "" }, { "docid": "a8e332a1dbc192f406b80030d6c567fa", "score": "0.48143652", "text": "function listenerFor42(listener, options) {\n\t\tvar rpc = webinos.rpcHandler.createRPC(this, \"listenAttr.listenFor42\", [options]);\n\n\t\t// add one listener, could add more later\n\t\trpc.onEvent = function(obj) {\n\t\t\t// we were called back, now invoke the given listener\n\t\t\tlistener(obj);\n\t\t\twebinos.rpcHandler.unregisterCallbackObject(rpc);\n\t\t};\n\n\t\twebinos.rpcHandler.registerCallbackObject(rpc);\n\t\twebinos.rpcHandler.executeRPC(rpc);\n\t}", "title": "" }, { "docid": "0b91baaef8e94a67051e4519edde9c9b", "score": "0.48107484", "text": "WebWorker(i) {\n if (!this.workers[i]) {\n this.workers[i] = new Worker(this.WORKER);\n this.workers[i].addEventListener(\"message\",function (event) {\n var data = event.data;\n data.worker = i;\n if (WorkerCommands.hasOwnProperty(data.cmd)) {\n WorkerCommands[data.cmd].call(this,data);\n } else {\n this.Log(\"WorkerPool: invalid Worker command from worker \"+i+\": \"+data.cmd);\n }\n }.bind(this));\n }\n return this.workers[i];\n }", "title": "" }, { "docid": "3765cfd242cdbf23d98642bf0f8ce012", "score": "0.47947127", "text": "constructor() {\n\t\tsuper();\n\t\tthis._callback = this._defaultCallback;\n\t\tthis.listener = null;\n\t\tthis._data = {data: []};\n\t\tthis._createObserverList();\n\t\tthis._registerDBReadListener();\n\t\tthis._checkForLocalData('data'); // Offline equivalent of _registerDBReadListener, only useful if the user hasn't logged out\t\n\t}", "title": "" }, { "docid": "710cbe9b6b45e995ecfab97ba780b689", "score": "0.47821912", "text": "workerMessage(m) {\n\t\tconsole.log(\"SuggestMap received \" );\n\t\tlet segment = JSON.parse(m.data);\n\t\tthis.tilemap._mapData = segment._mapData;\n\t\tthis.tilemap.mapChanged = true;\n\t\tthis.workInProgress = false;\n\t\tif (this.nextMapInQueue != null) {\n\t\t\tthis.generateMap(this.nextMapInQueue);\n\t\t\tthis.nextMapInQueue = null;\n\t\t}\n\t\tdraw();\n\t}", "title": "" }, { "docid": "5fbbb8d65592cb07a5ce227d483a1c86", "score": "0.47667357", "text": "function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}", "title": "" }, { "docid": "5fbbb8d65592cb07a5ce227d483a1c86", "score": "0.47667357", "text": "function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}", "title": "" }, { "docid": "74e71828638735c64225dbaafa2aaece", "score": "0.47614023", "text": "addEventListener(type, listener) {\n if (type == \"abort\" && this.abortListeners)\n this.abortListeners.push(listener);\n }", "title": "" }, { "docid": "8b4db8b738769883f7446945b2d360c3", "score": "0.47511166", "text": "function Listener(n1,n2, n3) {\n this.num1 = 0;\n this.name1 = n1;\n this.intervalo1 = 3000;\n this.num2 = 0;\n this.name2 = n2;\n this.intervalo2 = 2000;\n this.num3 = 0;\n this.name3 = n3;\n this.intervalo3 = 10000;\n}", "title": "" }, { "docid": "0ac879117f01703f674dc2a6cbc5b73b", "score": "0.47286764", "text": "onMessage() {}", "title": "" }, { "docid": "a77e87bb4170bd6ccd32c34626d7856b", "score": "0.4707087", "text": "createAndConfigureBackgroundWorker() {\n\n this.worker = new Worker('js/webWorkers/indexWebWorker.js');\n\n //\n // The worker has retrieved some more messages, add them to the virtual list.\n //\n this.worker.onmessage = (event) => {\n this.retrievingMessages = false;\n this.nextPageToken = event.data.pageToken;\n this.model.addMessages(event.data.messages);\n this.render();\n };\n }", "title": "" }, { "docid": "6d2cca09039a5121d82a8883d25bce2d", "score": "0.46929938", "text": "static _onListenDone () {\n }", "title": "" }, { "docid": "42e8decef9ba34a35b65eead54fd97de", "score": "0.46877545", "text": "function executeListenersAsyncronously(name, args, defaultAction) {\n var listeners = _events[name];\n if (!listeners || listeners.length === 0) return;\n\n var listenerAcks = listeners.length;\n\n OTHelpers.forEach(listeners, function(listener) { // , index\n function filterHandlerAndContext(_listener) {\n return _listener.context === listener.context && _listener.handler === listener.handler;\n }\n\n // We run this asynchronously so that it doesn't interfere with execution if an\n // error happens\n OTHelpers.callAsync(function() {\n try {\n // have to check if the listener has not been removed\n if (_events[name] && OTHelpers.some(_events[name], filterHandlerAndContext)) {\n (listener.closure || listener.handler).apply(listener.context || null, args);\n }\n }\n finally {\n listenerAcks--;\n\n if (listenerAcks === 0) {\n executeDefaultAction(defaultAction, args);\n }\n }\n });\n });\n }", "title": "" }, { "docid": "583b6a127a5486213bf049537688c75d", "score": "0.46745723", "text": "static get listener() {\n return SocketPair._listener;\n }", "title": "" }, { "docid": "fbc266090596cc9f2e042a24ad2fb48a", "score": "0.46674818", "text": "attachMemeDatabaseListener () {\n // create \"memes\" reference\n const reference = Fire.getDatabase().child(\"memes\");\n\n // attach listener\n Fire.listen(reference, this.getMemes, this.memeDatabaseListenerErrorCallback);\n }", "title": "" }, { "docid": "d245577cb323b44ac12d7609195223ce", "score": "0.4667095", "text": "addListener(listener) {\n assert && assert(!this.isDisposed, 'Cannot add a listener to a disposed TinyEmitter');\n assert && assert(!this.hasListener(listener), 'Cannot add the same listener twice');\n\n // If a listener is added during an emit(), we must make a copy of the current list of listeners--the newly added\n // listener will be available for the next emit() but not the one in progress. This is to match behavior with\n // removeListener.\n this.guardListeners();\n this.listeners.add(listener);\n this.changeCount && this.changeCount(1);\n if (assert && window.phet?.chipper?.queryParameters && isFinite(phet.chipper.queryParameters.listenerLimit)) {\n if (maxListenerCount < this.listeners.size) {\n maxListenerCount = this.listeners.size;\n console.log(`Max TinyEmitter listeners: ${maxListenerCount}`);\n assert(maxListenerCount <= phet.chipper.queryParameters.listenerLimit, `listener count of ${maxListenerCount} above ?listenerLimit=${phet.chipper.queryParameters.listenerLimit}`);\n }\n }\n }", "title": "" }, { "docid": "3716ac429153656e8b1e1cd6f53365a0", "score": "0.4645374", "text": "function setupMainThread() {\n\n // Send a message to a worker, and optionally get an async response\n // Arguments:\n // - worker: one or more web worker instances to send the message to (single value or array)\n // - method: the method with this name, specified with dot-notation, will be invoked in the worker\n // - message: will be passed to the method call\n // Returns:\n // - a promise that will be fulfilled if the worker method returns a value (could be immediately, or async)\n //\n WorkerBroker.postMessage = function (worker, method) {\n for (var _len = arguments.length, message = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n message[_key - 2] = arguments[_key];\n }\n\n // If more than one worker specified, post to multiple\n if (Array.isArray(worker)) {\n return _Promise.all(worker.map(function (w) {\n var _WorkerBroker;\n\n return (_WorkerBroker = WorkerBroker).postMessage.apply(_WorkerBroker, [w, method].concat(message));\n }));\n }\n\n // Track state of this message\n var promise = new _Promise(function (resolve, reject) {\n messages[message_id] = { method: method, message: message, resolve: resolve, reject: reject };\n });\n\n worker.postMessage(JSON.stringify({\n type: 'main_send', // mark message as method invocation from main thread\n message_id: message_id, // unique id for this message, for life of program\n method: method, // will dispatch to a function of this name within the worker\n message: message // message payload\n }));\n\n message_id++;\n return promise;\n };\n\n // Add a worker to communicate with - each worker must be registered from the main thread\n var worker_id = 0;\n var workers = new _Map();\n\n WorkerBroker.addWorker = function (worker) {\n\n // Keep track of all registered workers\n workers.set(worker, worker_id++);\n\n // Listen for messages coming back from the worker, and fulfill that message's promise\n worker.addEventListener('message', function (event) {\n var data = maybeDecode(event.data);\n if (data.type !== 'worker_reply') {\n return;\n }\n\n // Pass the result to the promise\n var id = data.message_id;\n if (messages[id]) {\n if (data.error) {\n messages[id].reject(data.error);\n } else {\n messages[id].resolve(data.message);\n }\n delete messages[id];\n }\n });\n\n // Listen for messages initiating a call from the worker, dispatch them,\n // and send any return value back to the worker\n worker.addEventListener('message', function (event) {\n var data = maybeDecode(event.data);\n\n // Unique id for this message & return call to main thread\n var id = data.message_id;\n if (data.type !== 'worker_send' || id == null) {\n return;\n }\n\n // Call the requested method and save the return value\n // var target = targets[data.target];\n\n var _findTarget = findTarget(data.method);\n\n var _findTarget2 = _slicedToArray(_findTarget, 2);\n\n var method_name = _findTarget2[0];\n var target = _findTarget2[1];\n\n if (!target) {\n throw Error('Worker broker could not dispatch message type ' + data.method + ' on target ' + data.target + ' because no object with that name is registered on main thread');\n }\n\n var method = typeof target[method_name] === 'function' && target[method_name];\n if (!method) {\n throw Error('Worker broker could not dispatch message type ' + data.method + ' on target ' + data.target + ' because object has no method with that name');\n }\n\n var result, error;\n try {\n result = method.apply(target, data.message);\n } catch (e) {\n // Thrown errors will be passed back (in string form) to worker\n error = e;\n }\n\n // Send return value to worker\n var payload = undefined,\n transferables = [];\n\n // Async result\n if (result instanceof _Promise) {\n result.then(function (value) {\n if (value instanceof WorkerBroker.returnWithTransferables) {\n transferables = value.transferables;\n value = value.value;\n }\n\n payload = {\n type: 'main_reply',\n message_id: id,\n message: value\n };\n payload = maybeEncode(payload, transferables);\n worker.postMessage(payload, transferables.map(function (t) {\n return t.object;\n }));\n freeTransferables(transferables);\n // if (transferables.length > 0) {\n // Utils.log('trace', `'${method_name}' transferred ${transferables.length} objects to worker thread`);\n // }\n }, function (error) {\n worker.postMessage({\n type: 'main_reply',\n message_id: id,\n error: error instanceof Error ? error.message + ': ' + error.stack : error\n });\n });\n }\n // Immediate result\n else {\n if (result instanceof WorkerBroker.returnWithTransferables) {\n transferables = result.transferables;\n result = result.value;\n }\n\n payload = {\n type: 'main_reply',\n message_id: id,\n message: result,\n error: error instanceof Error ? error.message + ': ' + error.stack : error\n };\n payload = maybeEncode(payload, transferables);\n worker.postMessage(payload, transferables.map(function (t) {\n return t.object;\n }));\n freeTransferables(transferables);\n // if (transferables.length > 0) {\n // Utils.log('trace', `'${method_name}' transferred ${transferables.length} objects to worker thread`);\n // }\n }\n });\n };\n\n // Expose for debugging\n WorkerBroker.getMessages = function () {\n return messages;\n };\n\n WorkerBroker.getMessageId = function () {\n return message_id;\n };\n }", "title": "" }, { "docid": "5b390d84b756964660416e28242f0570", "score": "0.4633368", "text": "function ratedListener (data, flags) {\n if (client.messageCount++ < max) listener(data, flags)\n else client.emit('limited', data, flags)\n }", "title": "" }, { "docid": "053521fc52153792600551564fa71596", "score": "0.46332896", "text": "function getListener() {\n return Object(_core_Global__WEBPACK_IMPORTED_MODULE_0__[\"getContext\"])().listener;\n}", "title": "" }, { "docid": "c57da24cbfbd7c98bddeb45bb7085e0e", "score": "0.4631309", "text": "function createWebWorker(element) {\n //var waitingFunction;\n //var handlerFunction;\n\n //// if no web worker support: throw error so that the developer knows\n //// that the gs-table element requires web workers\n //if (window.Worker === undefined) {\n // throw 'GS-TABLE Error: Web Workers are not supported by this ' +\n // 'browser. The GS-TABLE element requires the use of a ' +\n // 'Web Worker.';\n //}\n\n //// get web worker and store it\n //element.internalWorker.worker = new Worker('worker-gs-table.js');\n\n //// this function listens to the web worker after the web worker has\n //// given the signal that it's ready\n //handlerFunction = function (event) {\n // var jsnMessage = event.data;\n // //console.log('handler received', jsnMessage);\n //};\n\n //// this function listens to the web worker until the worker gives the\n //// signal that it's ready for use\n //waitingFunction = function (event) {\n // var jsnMessage = event.data;\n // //console.log('handler received', jsnMessage);\n\n // if (jsnMessage.content === 'ready') {\n //// mark the worker as ready so that any code that can only run\n //// while the worker is ready will now be able to run\n //element.internalWorker.ready = true;\n\n //// re-bind worker lister to the main listener code\n //element.internalWorker.worker.onmessage = handlerFunction;\n\n // run first select now that the worker is ready\n dataSELECT(element);\n\n ////console.log('worker ready');\n // }\n //};\n\n ////element.internalWorker.worker.postMessage({\"first\": value});\n\n //// bind web worker message event so that we can begin using the worker\n //element.internalWorker.worker.onmessage = waitingFunction;\n }", "title": "" }, { "docid": "0105b8c6b86d4473dad96bbb6b12f359", "score": "0.45995083", "text": "function main() {\n listener()\n setTimeout(main, 1000 * 5)\n}", "title": "" }, { "docid": "a73f2dd99acc897c35505005640e91aa", "score": "0.459097", "text": "function setupWorkerThread() {\n\n // Send a message to the main thread, and optionally get an async response as a promise\n // Arguments:\n // - method: the method with this name, specified with dot-notation, will be invoked on the main thread\n // - message: will be passed to the method call\n // Returns:\n // - a promise that will be fulfilled if the main thread method returns a value (could be immediately, or async)\n //\n WorkerBroker.postMessage = function (method) {\n for (var _len2 = arguments.length, message = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n message[_key2 - 1] = arguments[_key2];\n }\n\n // Track state of this message\n var promise = new _Promise(function (resolve, reject) {\n messages[message_id] = { method: method, message: message, resolve: resolve, reject: reject };\n });\n\n self.postMessage({\n type: 'worker_send', // mark message as method invocation from worker\n message_id: message_id, // unique id for this message, for life of program\n method: method, // will dispatch to a method of this name on the main thread\n message: message // message payload\n });\n\n message_id++;\n return promise;\n };\n\n // Listen for messages coming back from the main thread, and fulfill that message's promise\n self.addEventListener('message', function (event) {\n var data = maybeDecode(event.data);\n if (data.type !== 'main_reply') {\n return;\n }\n\n // Pass the result to the promise\n var id = data.message_id;\n if (messages[id]) {\n if (data.error) {\n messages[id].reject(data.error);\n } else {\n messages[id].resolve(data.message);\n }\n delete messages[id];\n }\n });\n\n // Receive messages from main thread, dispatch them, and send back a reply\n self.addEventListener('message', function (event) {\n var data = maybeDecode(event.data);\n\n // Unique id for this message & return call to main thread\n var id = data.message_id;\n if (data.type !== 'main_send' || id == null) {\n return;\n }\n\n // Call the requested worker method and save the return value\n\n var _findTarget3 = findTarget(data.method);\n\n var _findTarget32 = _slicedToArray(_findTarget3, 2);\n\n var method_name = _findTarget32[0];\n var target = _findTarget32[1];\n\n if (!target) {\n throw Error('Worker broker could not dispatch message type ' + data.method + ' on target ' + data.target + ' because no object with that name is registered on main thread');\n }\n\n var method = typeof target[method_name] === 'function' && target[method_name];\n\n if (!method) {\n throw Error('Worker broker could not dispatch message type ' + data.method + ' because worker has no method with that name');\n }\n\n var result, error;\n try {\n result = method.apply(target, data.message);\n } catch (e) {\n // Thrown errors will be passed back (in string form) to main thread\n error = e;\n }\n\n // Send return value to main thread\n var payload = undefined,\n transferables = [];\n\n // Async result\n if (result instanceof _Promise) {\n result.then(function (value) {\n if (value instanceof WorkerBroker.returnWithTransferables) {\n transferables = value.transferables;\n value = value.value;\n }\n\n payload = {\n type: 'worker_reply',\n message_id: id,\n message: value\n };\n payload = maybeEncode(payload, transferables);\n self.postMessage(payload, transferables.map(function (t) {\n return t.object;\n }));\n freeTransferables(transferables);\n // if (transferables.length > 0) {\n // Utils.log('trace', `'${method_name}' transferred ${transferables.length} objects to main thread`);\n // }\n }, function (error) {\n self.postMessage({\n type: 'worker_reply',\n message_id: id,\n error: error instanceof Error ? error.message + ': ' + error.stack : error\n });\n });\n }\n // Immediate result\n else {\n if (result instanceof WorkerBroker.returnWithTransferables) {\n transferables = result.transferables;\n result = result.value;\n }\n\n payload = {\n type: 'worker_reply',\n message_id: id,\n message: result,\n error: error instanceof Error ? error.message + ': ' + error.stack : error\n };\n payload = maybeEncode(payload, transferables);\n self.postMessage(payload, transferables.map(function (t) {\n return t.object;\n }));\n freeTransferables(transferables);\n // if (transferables.length > 0) {\n // Utils.log('trace', `'${method_name}' transferred ${transferables.length} objects to main thread`);\n // }\n }\n });\n }", "title": "" }, { "docid": "4736c380922205e38cbab10de5528adb", "score": "0.45868477", "text": "function syncTreeSetupListener_(syncTree, query, view) {\n const path = query._path;\n const tag = syncTreeTagForQuery_(syncTree, query);\n const listener = syncTreeCreateListenerForView_(syncTree, view);\n const events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete);\n const subtree = syncTree.syncPointTree_.subtree(path); // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we\n // may need to shadow other listens as well.\n\n if (tag) {\n (0, _util.assert)(!syncPointHasCompleteView(subtree.value), \"If we're adding a query, it shouldn't be shadowed\");\n } else {\n // Shadow everything at or below this location, this is a default listener.\n const queriesToStop = subtree.fold((relativePath, maybeChildSyncPoint, childMap) => {\n if (!pathIsEmpty(relativePath) && maybeChildSyncPoint && syncPointHasCompleteView(maybeChildSyncPoint)) {\n return [syncPointGetCompleteView(maybeChildSyncPoint).query];\n } else {\n // No default listener here, flatten any deeper queries into an array\n let queries = [];\n\n if (maybeChildSyncPoint) {\n queries = queries.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(view => view.query));\n }\n\n each(childMap, (_key, childQueries) => {\n queries = queries.concat(childQueries);\n });\n return queries;\n }\n });\n\n for (let i = 0; i < queriesToStop.length; ++i) {\n const queryToStop = queriesToStop[i];\n syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery_(syncTree, queryToStop));\n }\n }\n\n return events;\n}", "title": "" }, { "docid": "66b4cab13fd0f141bac16d26d81f66a8", "score": "0.45861128", "text": "function getListener() {\n return Object(_core_Global__WEBPACK_IMPORTED_MODULE_0__[\"getContext\"])().listener;\n}", "title": "" }, { "docid": "efd615e3500ba06cfbb6465af53cc7a2", "score": "0.45856893", "text": "constructor() {\n this.listeners = {};\n }", "title": "" }, { "docid": "53227ac606b365f1d5afaedb0ec09c8f", "score": "0.4583496", "text": "function setupWorkerThread () {\n\n // Send a message to the main thread, and optionally get an async response as a promise\n // Arguments:\n // - method: the method with this name, specified with dot-notation, will be invoked on the main thread\n // - message: array of arguments to call the method with\n // Returns:\n // - a promise that will be fulfilled if the main thread method returns a value (could be immediately, or async)\n //\n WorkerBroker.postMessage = function (method, ...message) {\n // Parse options\n let options = {};\n if (typeof method === 'object') {\n options = method;\n method = method.method;\n }\n\n // Track state of this message\n var promise = new Promise((resolve, reject) => {\n messages[message_id] = { method, message, resolve, reject };\n });\n\n let payload, transferables = [];\n\n if (message && message.length === 1 && message[0] instanceof WorkerBroker.withTransferables) {\n transferables = message[0].transferables;\n message = message[0].value;\n }\n\n payload = {\n type: 'worker_send', // mark message as method invocation from worker\n message_id, // unique id for this message, for life of program\n method, // will dispatch to a method of this name on the main thread\n message // message payload\n };\n\n if (options.stringify) {\n payload = JSON.stringify(payload);\n }\n\n self.postMessage(payload, transferables.map(t => t.object));\n freeTransferables(transferables);\n if (transferables.length > 0) {\n log('trace', `'${method}' transferred ${transferables.length} objects to main thread`);\n }\n\n message_id++;\n return promise;\n };\n\n self.addEventListener('message', function WorkerBrokerWorkerThreadHandler(event) {\n let data = ((typeof event.data === 'string') ? JSON.parse(event.data) : event.data);\n let id = data.message_id;\n\n // Listen for messages coming back from the main thread, and fulfill that message's promise\n if (data.type === 'main_reply') {\n // Pass the result to the promise\n if (messages[id]) {\n if (data.error) {\n messages[id].reject(data.error);\n }\n else {\n messages[id].resolve(data.message);\n }\n delete messages[id];\n }\n }\n // Receive messages from main thread, dispatch them, and send back a reply\n // Unique id for this message & return call to main thread\n else if (data.type === 'main_send' && id != null) {\n // Call the requested worker method and save the return value\n var [method_name, target] = findTarget(data.method);\n if (!target) {\n throw Error(`Worker broker could not dispatch message type ${data.method} on target ${data.target} because no object with that name is registered on main thread`);\n }\n\n var method = (typeof target[method_name] === 'function') && target[method_name];\n\n if (!method) {\n throw Error(`Worker broker could not dispatch message type ${data.method} because worker has no method with that name`);\n }\n\n var result, error;\n try {\n result = method.apply(target, data.message);\n }\n catch(e) {\n // Thrown errors will be passed back (in string form) to main thread\n error = e;\n }\n\n // Send return value to main thread\n let payload, transferables = [];\n\n // Async result\n if (result instanceof Promise) {\n result.then((value) => {\n if (value instanceof WorkerBroker.withTransferables) {\n transferables = value.transferables;\n value = value.value[0];\n }\n\n payload = {\n type: 'worker_reply',\n message_id: id,\n message: value\n };\n self.postMessage(payload, transferables.map(t => t.object));\n freeTransferables(transferables);\n if (transferables.length > 0) {\n log('trace', `'${method_name}' transferred ${transferables.length} objects to main thread`);\n }\n }, (error) => {\n self.postMessage({\n type: 'worker_reply',\n message_id: id,\n error: (error instanceof Error ? `${error.message}: ${error.stack}` : error)\n });\n });\n }\n // Immediate result\n else {\n if (result instanceof WorkerBroker.withTransferables) {\n transferables = result.transferables;\n result = result.value[0];\n }\n\n payload = {\n type: 'worker_reply',\n message_id: id,\n message: result,\n error: (error instanceof Error ? `${error.message}: ${error.stack}` : error)\n };\n self.postMessage(payload, transferables.map(t => t.object));\n freeTransferables(transferables);\n if (transferables.length > 0) {\n log('trace', `'${method_name}' transferred ${transferables.length} objects to main thread`);\n }\n }\n }\n });\n\n}", "title": "" }, { "docid": "a6250191f21213aa0cfa543637de56c2", "score": "0.45773613", "text": "_postMessage(worker_id, req=\"\") {\n var [command, args] = req;\n var p = [worker_id, command, args];\n this._worker.postMessage([this._prefix, p]);\n }", "title": "" }, { "docid": "46ec06aac6681b9951943bf5a4f6d15d", "score": "0.45703396", "text": "function startWorker(e) {\n if (myWorker == null) {\n myWorker = new Worker(\"echoWorker.js\");\n myWorker.addEventListener(\"message\", handleReceipt, false);\n }\t\n}", "title": "" }, { "docid": "60c4b5f8e0fe8b9c2d9637b56dd86a1b", "score": "0.4568413", "text": "function Listener() {\n this.num1 = 0;\n this.num2 = 0;\n this.top = false;\n}", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.45556694", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "d8addf306921563a6eba23fb2911d643", "score": "0.4549576", "text": "function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}", "title": "" }, { "docid": "d8addf306921563a6eba23fb2911d643", "score": "0.4549576", "text": "function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}", "title": "" }, { "docid": "d6256785da9877e570b92c08c1f2c8ea", "score": "0.45394725", "text": "function wmlbrowserWebProgressListener (b,d) {\n this.browser = b;\n this.direction = d;\n this.logger =\n Components.classes['@mozilla.org/consoleservice;1'].getService(Components.interfaces.nsIConsoleService);\n}", "title": "" }, { "docid": "4f34eb5261659553f6efe464ae4fd84b", "score": "0.45390803", "text": "function MsgManager() {}", "title": "" }, { "docid": "3972d5f119ef7018b40e2ff514b10107", "score": "0.45357683", "text": "function onChange(listener) {\n listeners.push(listener); \n }", "title": "" }, { "docid": "d64247c27b4e43bc646fac1cc14ff037", "score": "0.45280138", "text": "function syncTreeSetupListener_(syncTree, query, view) {\n var path = query.path;\n var tag = syncTreeTagForQuery_(syncTree, query);\n var listener = syncTreeCreateListenerForView_(syncTree, view);\n var events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete);\n var subtree = syncTree.syncPointTree_.subtree(path);\n // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we\n // may need to shadow other listens as well.\n if (tag) {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(!syncPointHasCompleteView(subtree.value), \"If we're adding a query, it shouldn't be shadowed\");\n }\n else {\n // Shadow everything at or below this location, this is a default listener.\n var queriesToStop = subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) {\n if (!pathIsEmpty(relativePath) &&\n maybeChildSyncPoint &&\n syncPointHasCompleteView(maybeChildSyncPoint)) {\n return [syncPointGetCompleteView(maybeChildSyncPoint).getQuery()];\n }\n else {\n // No default listener here, flatten any deeper queries into an array\n var queries_1 = [];\n if (maybeChildSyncPoint) {\n queries_1 = queries_1.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(function (view) {\n return view.getQuery();\n }));\n }\n each(childMap, function (_key, childQueries) {\n queries_1 = queries_1.concat(childQueries);\n });\n return queries_1;\n }\n });\n for (var i = 0; i < queriesToStop.length; ++i) {\n var queryToStop = queriesToStop[i];\n syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery_(syncTree, queryToStop));\n }\n }\n return events;\n}", "title": "" }, { "docid": "7c97659a151e8471da5b22560c67ecb8", "score": "0.4522469", "text": "listenerFn(){\n this.broadcaster.addMembership(this.broadcast_address, this.ip);\n console.log(`* Multicast Server listening on: ${this.ip}:${this.port}`);\n console.log(`* Running server discovery`);\n // Prepare discovery message\n let messageBuffer = Buffer.from(JSON.stringify({origin: this.ip, body: BROADCAST_MESSAGE_REQUEST_MSG_SERVER}) );\n this.send_message(messageBuffer);\n }", "title": "" }, { "docid": "8fa6fd2fdd529431cc190934ad05e81b", "score": "0.45205542", "text": "function WorkerMessage(cmd, parameter) {\nthis.cmd = cmd; this.parameter = parameter;\n}", "title": "" }, { "docid": "b76857964e378611be244ec8177b31bd", "score": "0.45174298", "text": "setupMainListener() {\n\t\tipcMain.on('sea.mainRequest', this.handleMainRequest.bind(this));\n\t\tipcMain.on('system.addlistener', this.addSystemListener.bind(this));\n\t\tipcMain.on('system.removelistener', this.removeSystemListener.bind(this));\n\t}", "title": "" }, { "docid": "67819e717f9d4b404e4abcad79f928b6", "score": "0.4512143", "text": "function WebProgressListener() {\n}", "title": "" }, { "docid": "67819e717f9d4b404e4abcad79f928b6", "score": "0.4512143", "text": "function WebProgressListener() {\n}", "title": "" }, { "docid": "426c73ba415862f667c0b1ad5783b4ec", "score": "0.45117342", "text": "attach(listener) {\n this.listeners.push(listener);\n }", "title": "" }, { "docid": "600bee85f1357dd62cd05ce401663f45", "score": "0.4508115", "text": "function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}", "title": "" }, { "docid": "600bee85f1357dd62cd05ce401663f45", "score": "0.4508115", "text": "function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}", "title": "" }, { "docid": "302818c2b883b748eaa5f5ce0e13e538", "score": "0.4508017", "text": "constructor(){\n this._listeners = [];\n }", "title": "" }, { "docid": "565b2f9bee205aef48443f6ba7cb66be", "score": "0.4505743", "text": "function addMessageListeners() {\n\tchrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {\n\t\tswitch(request.command) {\n\t\t\tcase \"updateTime\":\n\t\t\t\t// document.getElementById(\"current-time\").innerText = request.time;\n\t\t\t\tupdateProgress(request.progress, request.time);\n\t\t\t\tbreak;\n\t\t\tcase \"timerEnded\":\n\t\t\t\tconsole.log(\"Timer ended.\");\n\t\t\t\tbreak;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "528e19f2b7079890e41a03c71bf1cfc9", "score": "0.4497638", "text": "function syncTreeSetupListener_(syncTree, query, view) {\n var path = query._path;\n var tag = syncTreeTagForQuery_(syncTree, query);\n var listener = syncTreeCreateListenerForView_(syncTree, view);\n var events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete);\n var subtree = syncTree.syncPointTree_.subtree(path);\n // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we\n // may need to shadow other listens as well.\n if (tag) {\n (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.assert)(!syncPointHasCompleteView(subtree.value), \"If we're adding a query, it shouldn't be shadowed\");\n }\n else {\n // Shadow everything at or below this location, this is a default listener.\n var queriesToStop = subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) {\n if (!pathIsEmpty(relativePath) &&\n maybeChildSyncPoint &&\n syncPointHasCompleteView(maybeChildSyncPoint)) {\n return [syncPointGetCompleteView(maybeChildSyncPoint).query];\n }\n else {\n // No default listener here, flatten any deeper queries into an array\n var queries_1 = [];\n if (maybeChildSyncPoint) {\n queries_1 = queries_1.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(function (view) { return view.query; }));\n }\n each(childMap, function (_key, childQueries) {\n queries_1 = queries_1.concat(childQueries);\n });\n return queries_1;\n }\n });\n for (var i = 0; i < queriesToStop.length; ++i) {\n var queryToStop = queriesToStop[i];\n syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery_(syncTree, queryToStop));\n }\n }\n return events;\n}", "title": "" }, { "docid": "1ba9a17a02547a03fcb04c0f5158d98c", "score": "0.44958594", "text": "function onmessage() {}", "title": "" }, { "docid": "90b5cfedde16c56d588ece29b31ddf37", "score": "0.44932187", "text": "constructor(name, cmdPrefix=\"\") {\n // Send the command prefix to the worker.\n this._prefix = cmdPrefix || name.toUpperCase();\n this._worker = new Worker(\"/assets/scripts/workers/\"+name+'.js');\n this._worker.postMessage(['__WKRPREFIX', this._prefix]);\n // Set up event handler.\n this._worker.onmessage = (e) => this._handleMessage(e);\n this._reqs = [];\n }", "title": "" }, { "docid": "c054cf3954036e2f479c8c899eb243cd", "score": "0.44886088", "text": "function Processor($q, node, worker) {\n this.flaggedForDeletion = false;\n this.node = node;\n this.$q = $q;\n if (worker == null) {\n this.worker = new Worker('js/worker.js');\n } else {\n this.worker = worker;\n }\n if (node) {\n try {\n this.worker.on('message', this.respond.bind(this));\n } catch (err) {}\n\n } else {\n try {\n this.worker.addEventListener('message', this.respond.bind(this), false);\n } catch (err) {}\n }\n}", "title": "" }, { "docid": "e1b6da517bb86c7901ca0d75e31d8bf3", "score": "0.44853893", "text": "function onmessage(event) {\n \"use strict\";\n //console.log('worker received', event);\n //postMessage('test');\n}", "title": "" }, { "docid": "eb295000bdd2b9437189e0d7c094e263", "score": "0.44819248", "text": "constructor(worker_uri, wasm_uri) {\n this.worker = new Worker(worker_uri);\n this.worker.onmessage = this.handleMessage.bind(this);\n this.worker.postMessage({\"init\": wasm_uri});\n }", "title": "" }, { "docid": "0223127410e5f14e9ed4deda3bf12951", "score": "0.4473156", "text": "listen(f) {\n this.listeners_.push(f);\n }", "title": "" }, { "docid": "f4b0e36e0e563a379d7fdeab66866fbe", "score": "0.44579127", "text": "function syncTreeSetupListener_(syncTree, query, view) {\n var path = query._path;\n var tag = syncTreeTagForQuery_(syncTree, query);\n var listener = syncTreeCreateListenerForView_(syncTree, view);\n var events = syncTree.listenProvider_.startListening(syncTreeQueryForListening_(query), tag, listener.hashFn, listener.onComplete);\n var subtree = syncTree.syncPointTree_.subtree(path);\n // The root of this subtree has our query. We're here because we definitely need to send a listen for that, but we\n // may need to shadow other listens as well.\n if (tag) {\n _firebaseUtil.assert(!syncPointHasCompleteView(subtree.value), \"If we're adding a query, it shouldn't be shadowed\");\n } else {\n // Shadow everything at or below this location, this is a default listener.\n var queriesToStop = subtree.fold(function (relativePath, maybeChildSyncPoint, childMap) {\n if (!pathIsEmpty(relativePath) && maybeChildSyncPoint && syncPointHasCompleteView(maybeChildSyncPoint)) {\n return [syncPointGetCompleteView(maybeChildSyncPoint).query];\n } else {\n // No default listener here, flatten any deeper queries into an array\n var queries_1 = [];\n if (maybeChildSyncPoint) {\n queries_1 = queries_1.concat(syncPointGetQueryViews(maybeChildSyncPoint).map(function (view) {\n return view.query;\n }));\n }\n each(childMap, function (_key, childQueries) {\n queries_1 = queries_1.concat(childQueries);\n });\n return queries_1;\n }\n });\n for (var i = 0; i < queriesToStop.length; ++i) {\n var queryToStop = queriesToStop[i];\n syncTree.listenProvider_.stopListening(syncTreeQueryForListening_(queryToStop), syncTreeTagForQuery_(syncTree, queryToStop));\n }\n }\n return events;\n}", "title": "" }, { "docid": "7d666e8664296eb7c87536c44ce16e70", "score": "0.44563577", "text": "function EMCallManagerListener() {\r\n var self = this;\r\n self._eventEmitter = new EventEmitter();\r\n self._eventEmitter.setMaxListeners(emCallManagerListenerCount);\r\n self._listener = new easemobNode.EMCallManagerListener();\r\n self._listener.onRecvCallFeatureUnsupported = function (callsession,error) {\r\n self._eventEmitter.emit('onRecvCallFeatureUnsupported', callsession,new EMError(error));\r\n };\r\n self._listener.onRecvCallIncoming = function (callsession) {\r\n self._eventEmitter.emit('onRecvCallIncoming', new EMCallSession(callsession));\r\n };\r\n self._listener.onRecvCallConnected = function (callsession) {\r\n self._eventEmitter.emit('onRecvCallConnected', new EMCallSession(callsession));\r\n };\r\n self._listener.onRecvCallAccepted = function (callsession) {\r\n self._eventEmitter.emit('onRecvCallAccepted', new EMCallSession(callsession));\r\n };\r\n self._listener.onRecvCallEnded = function (callsession,reason,error) {\r\n self._eventEmitter.emit('onRecvCallEnded', new EMCallSession(callsession),reason,new EMError(error));\r\n };\r\n self._listener.onRecvCallNetworkStatusChanged = function (callsession,toStatus) {\r\n self._eventEmitter.emit('onRecvCallNetworkStatusChanged', new EMCallSession(callsession),toStatus);\r\n };\r\n self._listener.onRecvCallStateChanged = function (callsession,type) {\r\n self._eventEmitter.emit('onRecvCallStateChanged', new EMCallSession(callsession),type);\r\n };\r\n}", "title": "" }, { "docid": "212298872d801231c50cc5c62d70e357", "score": "0.4449045", "text": "function setListeners() {\n sendcmd('{\"type\":\"power\",\"data\":{}}')\n}", "title": "" }, { "docid": "ddf65fb236224be5129b854ed99b7cbd", "score": "0.44456542", "text": "addListener(){}", "title": "" }, { "docid": "0b830b1ac818617c0c3f87166494c155", "score": "0.44434494", "text": "addFetchListener() {\n self.addEventListener(\"fetch\", (e) => {\n const { request: t } = e, n = this.handleRequest({ request: t, event: e });\n n && e.respondWith(n);\n });\n }", "title": "" }, { "docid": "f25ca27fb33e4126db45d0e320647f47", "score": "0.44399142", "text": "send(d){\n // Permite mandar mensajes al Worker\n this.worker.postMessage(this.storage);\n }", "title": "" }, { "docid": "f5de18f89e51ac1cd7856ca798c3a831", "score": "0.44358623", "text": "addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', event => {\n const {\n request\n } = event;\n const responsePromise = this.handleRequest({\n request,\n event\n });\n\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n });\n }", "title": "" }, { "docid": "5b697dbd00c8bd400b5a6e03ad18a32f", "score": "0.44347998", "text": "function listenForMessages() {\n chrome.runtime.onMessage.addListener(handleMessage);\n}", "title": "" }, { "docid": "b363661520c061624de2b1c3802651f7", "score": "0.44337308", "text": "listen() {\n debug('listen');\n\n if (!this._initialized) {\n this.init();\n }\n\n // Launch Mitm Proxy\n this.mitm.listen(this.options.mitm);\n\n if (!this.options.silent) { // FIXME: Better implement this by disabling this.logger object\n this.logger.info(`CICP listening on ${this.options.mitm.port}`);\n }\n\n // Memory state after everything is loaded\n debug(`Memory usage: ${Math.round((process.memoryUsage().heapUsed / 1024 / 1024) * 100) / 100} MB`);\n }", "title": "" }, { "docid": "50ab742cf19b6671241083ec25e8b3fa", "score": "0.44284865", "text": "attach(listener) {\n this._listeners.push(listener);\n }", "title": "" }, { "docid": "b11de2eb542a2f2e94ca7244da593381", "score": "0.4428248", "text": "constructor() {\n this._listeners = {};\n this._disabled = false;\n }", "title": "" }, { "docid": "8fcdfb93dac8a908c616cb6d08ec70ef", "score": "0.44258085", "text": "addEventListener(name, listener) {\n const opt = this.m_optionsMap.get(name);\n if (opt) {\n opt.addEventListener(DebugOption.SET_EVENT_TYPE, listener);\n }\n else {\n throw Error(\"Unknown option: \" + name);\n }\n }", "title": "" }, { "docid": "f4ae9856d42745f0263110135e906344", "score": "0.44216675", "text": "function WorkerFS(worker) {\n var _this = _super.call(this) || this;\n _this._callbackConverter = new CallbackArgumentConverter();\n _this._isInitialized = false;\n _this._isReadOnly = false;\n _this._supportLinks = false;\n _this._supportProps = false;\n _this._worker = worker;\n _this._worker.addEventListener('message', function (e) {\n var resp = e.data;\n if (isAPIResponse(resp)) {\n var i = void 0;\n var args = resp.args;\n var fixedArgs = new Array(args.length);\n // Dispatch event to correct id.\n for (i = 0; i < fixedArgs.length; i++) {\n fixedArgs[i] = _this._argRemote2Local(args[i]);\n }\n _this._callbackConverter.toLocalArg(resp.cbId).apply(null, fixedArgs);\n }\n });\n return _this;\n }", "title": "" }, { "docid": "5a169efeb532a3c2c305bc0a39a8ae99", "score": "0.44176438", "text": "onMessage(func) {\n this.eventListeners.message.push(func);\n }", "title": "" }, { "docid": "5a169efeb532a3c2c305bc0a39a8ae99", "score": "0.44176438", "text": "onMessage(func) {\n this.eventListeners.message.push(func);\n }", "title": "" }, { "docid": "5a169efeb532a3c2c305bc0a39a8ae99", "score": "0.44176438", "text": "onMessage(func) {\n this.eventListeners.message.push(func);\n }", "title": "" }, { "docid": "67f8505cebd9ff8deecddf0b6f914438", "score": "0.44166616", "text": "function eventTarget_addEventListener(eventTarget, listener) {\n /**\n * 1. If eventTarget is a ServiceWorkerGlobalScope object, its service\n * worker’s script resource’s has ever been evaluated flag is set, and\n * listener’s type matches the type attribute value of any of the service\n * worker events, then report a warning to the console that this might not\n * give the expected results. [SERVICE-WORKERS]\n */\n // TODO: service worker\n /**\n * 2. If listener’s callback is null, then return.\n */\n if (listener.callback === null)\n return;\n /**\n * 3. If eventTarget’s event listener list does not contain an event listener\n * whose type is listener’s type, callback is listener’s callback, and capture\n * is listener’s capture, then append listener to eventTarget’s event listener\n * list.\n */\n for (var i = 0; i < eventTarget._eventListenerList.length; i++) {\n var entry = eventTarget._eventListenerList[i];\n if (entry.type === listener.type && entry.callback.handleEvent === listener.callback.handleEvent\n && entry.capture === listener.capture) {\n return;\n }\n }\n eventTarget._eventListenerList.push(listener);\n}", "title": "" }, { "docid": "67f8505cebd9ff8deecddf0b6f914438", "score": "0.44166616", "text": "function eventTarget_addEventListener(eventTarget, listener) {\n /**\n * 1. If eventTarget is a ServiceWorkerGlobalScope object, its service\n * worker’s script resource’s has ever been evaluated flag is set, and\n * listener’s type matches the type attribute value of any of the service\n * worker events, then report a warning to the console that this might not\n * give the expected results. [SERVICE-WORKERS]\n */\n // TODO: service worker\n /**\n * 2. If listener’s callback is null, then return.\n */\n if (listener.callback === null)\n return;\n /**\n * 3. If eventTarget’s event listener list does not contain an event listener\n * whose type is listener’s type, callback is listener’s callback, and capture\n * is listener’s capture, then append listener to eventTarget’s event listener\n * list.\n */\n for (var i = 0; i < eventTarget._eventListenerList.length; i++) {\n var entry = eventTarget._eventListenerList[i];\n if (entry.type === listener.type && entry.callback.handleEvent === listener.callback.handleEvent\n && entry.capture === listener.capture) {\n return;\n }\n }\n eventTarget._eventListenerList.push(listener);\n}", "title": "" }, { "docid": "7f834cd98757f25e2c07708c376213b8", "score": "0.4414668", "text": "function notifyListeners(msg) {\n angular.forEach(listeners, function(listener) {\n if(listener.destination === msg.headers.destination) {\n msg.body = JSON.parse(msg.body);\n listener.listenFunction(msg);\n }\n });\n }", "title": "" }, { "docid": "b49fdce395937da4d70201c02b2f4e3c", "score": "0.44138417", "text": "link(listener) {\n this.addListener(listener);\n listener(this._value, null, this); // null should be used when an object is expected but unavailable\n }", "title": "" }, { "docid": "51275c9c46c28f20d5cdd186272e7e5d", "score": "0.4413603", "text": "function setUpListeners() {\n\t\tchrome.processes.onUpdatedWithMemory.addListener(function(processes) {\n // registerCallback(update.updateData);\n var processesArray = [];\n\t\t\tprocs.length = 0; // clear procs array\n\t\t\tfor(id in processes) {\n if(processes.hasOwnProperty(id)) {\n processesArray.push(processes[id]);\n\t\t\t\t\t// get_proc_info(processes[id], function(proc) {\n\t\t\t\t\t// \tprocs.push(proc);\n // console.log(proc.info);\n\t\t\t\t\t// });\n\t\t\t\t}\n\t\t\t}\n\n get_proc_info(processesArray, function() {\n \t\t\tlettucePush(procHistory, procs, historyLength);\n if (testFlag) {\n testFlag = false;\n update.setup(procs);\n }\n sendProcData(procs);\n\n });\n\n\t\t});\n\t}", "title": "" }, { "docid": "08e30974da4e5b3ffaed3dc15446dde3", "score": "0.44128466", "text": "get _listeners() {\n throw new TypeError('Future.prototype._listeners should be implemented in an inherited object.');\n }", "title": "" }, { "docid": "e5aceab4a9204a58d516752d7e190a55", "score": "0.44094464", "text": "function setEventListener() {\n\taddEventListener(\"message\", function(event) {\n\t\tif (event.origin + \"/\" == chrome.extension.getURL(\"\")) {\n\t\t\tvar eventToolName = event.data.name;\n\t\t\t//for close button\n\t\t\tif (eventToolName == \"close-button\") {\n\t\t\t\tcloseAll();\n\t\t\t}\n\t\t\t//scroll to top\n\t\t\tif (eventToolName == \"scroll-to-top\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//scroll to bottom\n\t\t\tif (eventToolName == \"scroll-to-bottom\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//to decrease size of frame\n\t\t\tif (eventToolName == \"resize-button\") {\n\t\t\t\tresizeFrame();\n\t\t\t}\n\t\t\t//to increase size of frame\n\t\t\tif (eventToolName == \"maximize-button\") {\n\t\t\t\tmaximizeFrame();\n\t\t\t}\n\t\t\t//for restarting tool\n\t\t\tif(eventToolName==\"restartTool\"){\n\t\t\t\trestartTool(false);\n\t\t\t}\n\t\t\t//for inviting friends to like a page\n\t\t\tif (eventToolName == \"post\") {\n\t\t\t\tvar message_inp = event.data.message;\n\t\t\t\tvar link = event.data.link;\n\t\t\t\tvar link_title = event.data.link_title;\n\t\t\t\tvar imglink = event.data.imglink;\n\t\t\t\tvar summary = event.data.summary;\n\t\t\t\tvar delay = event.data.delay;\n\t\t\t\tvar start = event.data.start;\n\t\t\t\tvar end = event.data.end;\n\t\t\t\tprocess(\n\t\t\t\t\tmessage_inp,\n\t\t\t\t\tlink,\n\t\t\t\t\tlink_title,\n\t\t\t\t\timglink,\n\t\t\t\t\tsummary,\n\t\t\t\t\tdelay,\n\t\t\t\t\tstart,\n\t\t\t\t\tend\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}, false);\n}", "title": "" }, { "docid": "e3d3d59bed4e6154db5b91cc8e3a6f87", "score": "0.4408023", "text": "function setupMessagingHandlers() {\n\t\tvar self = this;\n\t\tthis.worker.addEventListener('message', function(event) {\n\t\t\tvar message = event.data;\n\t\t\tif (this.isLogging) { console.log('receiving', message); }\n\n\t\t\t// handle replies\n\t\t\tif (message.name === 'reply') {\n\t\t\t\tvar cb = self.replyCbs[message.reply_to];\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb.func.call(cb.context, message);\n\t\t\t\t\tdelete self.replyCbs[message.reply_to]; // wont need to call again\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar listeners = self.messageListeners[message.name];\n\n\t\t\t// streaming\n\t\t\tif (message.name === 'endMessage') {\n\t\t\t\tvar mid = message.data;\n\t\t\t\tlisteners = self.messageListeners[mid]; // inform message listeners\n\t\t\t\tself.removeAllNamedMessageListeners(mid); // and release their references\n\t\t\t}\n\n\t\t\t// dispatch\n\t\t\tif (listeners) {\n\t\t\t\tlisteners.forEach(function(listener) {\n\t\t\t\t\tlistener.func.call(listener.context, message);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" } ]
235631a05b888b0e98e62c4d1ee9db3c
PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END PURE_IMPORTS_START _Observable,_util_identity,_util_isScheduler PURE_IMPORTS_END PURE_IMPORTS_START _defer,_empty PURE_IMPORTS_END PURE_IMPORTS_START _isArray PURE_IMPORTS_END
[ { "docid": "307afb6b409d5970a1361c330dcf1e59", "score": "0.0", "text": "function isNumeric(val) {\n return !isArray(val) && (val - parseFloat(val) + 1) >= 0;\n}", "title": "" } ]
[ { "docid": "cb7a7479a7a50aa667d06afbaa3c0094", "score": "0.6064669", "text": "map(projectFn) {\n return new Observable((obs) => {\n /**\n * this code is rxjs's quintessence, this 'this' is bound to map method call this(use arrow function to bind), so who call map method,\n * 'this' is who, in the Test, of method return a observable instance, the instance call map method, so the this is the of method's\n * return observable, so this.subscribe is of method return observable's executor, the executor will use of args and then call onNext\n * with the data, the onNext method is map method pass observer onNext method, so map method can do some thing the map want, so this\n * can extend for other method like filter and so on. And when the of call onNext method, it will inject the data that latter observer\n * need\n * */\n return this.subscribe({\n onNext: (val) => {\n obs.onNext(projectFn(val))\n }\n })\n })\n }", "title": "" }, { "docid": "26a71369d27e34df0e68206d29c5c1a6", "score": "0.6017406", "text": "function isInteropObservable(input) {\n return input && typeof input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__[\"observable\"]] === 'function';\n}", "title": "" }, { "docid": "26a71369d27e34df0e68206d29c5c1a6", "score": "0.6017406", "text": "function isInteropObservable(input) {\n return input && typeof input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__[\"observable\"]] === 'function';\n}", "title": "" }, { "docid": "da818cf4d3e942e45080f12b684cba7e", "score": "0.5877664", "text": "map(fn) {\n return new Single((subscriber) => {\n return this._source({\n onComplete: (value) => subscriber.onComplete(fn(value)),\n onError: (error) => subscriber.onError(error),\n onSubscribe: (cancel) => subscriber.onSubscribe(cancel),\n });\n });\n }", "title": "" }, { "docid": "64aa5770d97665b0f948a21889d82718", "score": "0.5827219", "text": "function isInteropObservable(input) {\n return input && typeof input[symbol_observable/* observable */.L] === 'function';\n}", "title": "" }, { "docid": "2fdd46fef63ab95b2b3fc6530ef85080", "score": "0.5751294", "text": "function isObservable(observableLike) {\r\n return observableLike && typeof observableLike.subscribe === \"function\";\r\n }", "title": "" }, { "docid": "87a92cb176c84e6bf47d1203f2a95ff2", "score": "0.57449305", "text": "function isInteropObservable(input) {\n return input && typeof input[symbol_observable[\"a\" /* observable */]] === 'function';\n}", "title": "" }, { "docid": "87a92cb176c84e6bf47d1203f2a95ff2", "score": "0.57449305", "text": "function isInteropObservable(input) {\n return input && typeof input[symbol_observable[\"a\" /* observable */]] === 'function';\n}", "title": "" }, { "docid": "87a92cb176c84e6bf47d1203f2a95ff2", "score": "0.57449305", "text": "function isInteropObservable(input) {\n return input && typeof input[symbol_observable[\"a\" /* observable */]] === 'function';\n}", "title": "" }, { "docid": "87a92cb176c84e6bf47d1203f2a95ff2", "score": "0.57449305", "text": "function isInteropObservable(input) {\n return input && typeof input[symbol_observable[\"a\" /* observable */]] === 'function';\n}", "title": "" }, { "docid": "ff540c23703080b2349e3e048165490d", "score": "0.57365936", "text": "function isInteropObservable(input) {\n\t return input && typeof input[observable] === 'function';\n\t}", "title": "" }, { "docid": "a1bc33a1cf02ff82be3c1532448dedee", "score": "0.57364625", "text": "function isObservable (ob) {\n return ob && typeof ob.subscribe === 'function'\n}", "title": "" }, { "docid": "a1bc33a1cf02ff82be3c1532448dedee", "score": "0.57364625", "text": "function isObservable (ob) {\n return ob && typeof ob.subscribe === 'function'\n}", "title": "" }, { "docid": "539967ca4d0ebd4909912014ed7e436d", "score": "0.57331914", "text": "function isInteropObservable(input) {\n return input && typeof input[observable] === 'function';\n}", "title": "" }, { "docid": "539967ca4d0ebd4909912014ed7e436d", "score": "0.57331914", "text": "function isInteropObservable(input) {\n return input && typeof input[observable] === 'function';\n}", "title": "" }, { "docid": "963e96e41fad891af0b36a287bebb057", "score": "0.57016593", "text": "function BaseObservable() {}", "title": "" }, { "docid": "963e96e41fad891af0b36a287bebb057", "score": "0.57016593", "text": "function BaseObservable() {}", "title": "" }, { "docid": "963e96e41fad891af0b36a287bebb057", "score": "0.57016593", "text": "function BaseObservable() {}", "title": "" }, { "docid": "a94c6540d182a2e40d4b0231852e3b33", "score": "0.56472075", "text": "static of(...args) {\n return new Observable((obs) => {\n args.forEach((arg) => {\n obs.onNext(arg)\n })\n obs.onComplete && obs.onComplete()\n\n return {\n unsubscribe: () => {\n obs = {}\n }\n }\n }) \n }", "title": "" }, { "docid": "c909d53b87140dd9a2e7f1360b997865", "score": "0.5646024", "text": "function Observable() {\n /** @type {?Array<function(TYPE)>} */\n this.handlers_ = null;\n }", "title": "" }, { "docid": "e6e51c3c1b646f4d24d16eef030253ba", "score": "0.5568565", "text": "function fromArray(input, scheduler) {\n if (!scheduler) {\n return new Observable[\"a\" /* Observable */](Object(subscribeToArray[\"a\" /* subscribeToArray */])(input));\n }\n else {\n return scheduleArray(input, scheduler);\n }\n}", "title": "" }, { "docid": "099b93dc9a3c8616e16904f2802a90b7", "score": "0.5560175", "text": "function fromArray(input, scheduler) {\n\t if (!scheduler) {\n\t return new Observable(subscribeToArray(input));\n\t }\n\t else {\n\t return scheduleArray(input, scheduler);\n\t }\n\t}", "title": "" }, { "docid": "721108b7d0756a264e3a4ce713bc4f9d", "score": "0.5551356", "text": "function fixObservable(obs) {\n obs[rxjs__WEBPACK_IMPORTED_MODULE_3__[\"observable\"]] = function () { return obs; };\n return obs;\n}", "title": "" }, { "docid": "b8954302f7eb3f6da1221540f00b3878", "score": "0.55505383", "text": "function isObservable(obj){// TODO: use isObservable once we update pass rxjs 6.1\n// https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#610-2018-05-03\nreturn!!obj&&typeof obj.subscribe===\"function\"}", "title": "" }, { "docid": "b8954302f7eb3f6da1221540f00b3878", "score": "0.55505383", "text": "function isObservable(obj){// TODO: use isObservable once we update pass rxjs 6.1\n// https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#610-2018-05-03\nreturn!!obj&&typeof obj.subscribe===\"function\"}", "title": "" }, { "docid": "b8954302f7eb3f6da1221540f00b3878", "score": "0.55505383", "text": "function isObservable(obj){// TODO: use isObservable once we update pass rxjs 6.1\n// https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#610-2018-05-03\nreturn!!obj&&typeof obj.subscribe===\"function\"}", "title": "" }, { "docid": "b8954302f7eb3f6da1221540f00b3878", "score": "0.55505383", "text": "function isObservable(obj){// TODO: use isObservable once we update pass rxjs 6.1\n// https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#610-2018-05-03\nreturn!!obj&&typeof obj.subscribe===\"function\"}", "title": "" }, { "docid": "b8954302f7eb3f6da1221540f00b3878", "score": "0.55505383", "text": "function isObservable(obj){// TODO: use isObservable once we update pass rxjs 6.1\n// https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#610-2018-05-03\nreturn!!obj&&typeof obj.subscribe===\"function\"}", "title": "" }, { "docid": "1c543b9ac4f404c31d2198fe33b003c1", "score": "0.55003035", "text": "function SanityObservableMinimal() {\n Observable.apply(this, arguments); // eslint-disable-line prefer-rest-params\n}", "title": "" }, { "docid": "1c543b9ac4f404c31d2198fe33b003c1", "score": "0.55003035", "text": "function SanityObservableMinimal() {\n Observable.apply(this, arguments); // eslint-disable-line prefer-rest-params\n}", "title": "" }, { "docid": "d782d2677dc46578241f409163969445", "score": "0.5397644", "text": "function observableFromIterable(iterable) {\n return rxjs_1.Observable.from(iterable);\n}", "title": "" }, { "docid": "111589164dfb05f8fd616d6e471fe583", "score": "0.5352379", "text": "from(iterable, mapfn, thisArg) {\n return new IArray(iterable).Cast().ToArray();\n }", "title": "" }, { "docid": "58c66fdbddc5240e1f13c52921c728be", "score": "0.5350124", "text": "function isArrayLike$$1(x) {\n return Array.isArray(x) || isObservableArray$$1(x);\n}", "title": "" }, { "docid": "58c66fdbddc5240e1f13c52921c728be", "score": "0.5350124", "text": "function isArrayLike$$1(x) {\n return Array.isArray(x) || isObservableArray$$1(x);\n}", "title": "" }, { "docid": "58c66fdbddc5240e1f13c52921c728be", "score": "0.5350124", "text": "function isArrayLike$$1(x) {\n return Array.isArray(x) || isObservableArray$$1(x);\n}", "title": "" }, { "docid": "c8920a3f8862a6ef165cc70401e69e0a", "score": "0.53341776", "text": "function isObservable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "c8920a3f8862a6ef165cc70401e69e0a", "score": "0.53341776", "text": "function isObservable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "bd1af5ff1843893ae0bdb944ea4463d9", "score": "0.5242711", "text": "function isObservable(obj) {\n return !!obj && (obj instanceof Observable[\"a\" /* Observable */] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));\n}", "title": "" }, { "docid": "bd1af5ff1843893ae0bdb944ea4463d9", "score": "0.5242711", "text": "function isObservable(obj) {\n return !!obj && (obj instanceof Observable[\"a\" /* Observable */] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));\n}", "title": "" }, { "docid": "bd1af5ff1843893ae0bdb944ea4463d9", "score": "0.5242711", "text": "function isObservable(obj) {\n return !!obj && (obj instanceof Observable[\"a\" /* Observable */] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));\n}", "title": "" }, { "docid": "b2e00a372ef0223eb251eb18a8ff3f8d", "score": "0.5209575", "text": "function andObservables(observables) {\n return observables.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"mergeAll\"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"every\"])(function (result) { return result === true; }));\n}", "title": "" }, { "docid": "b2e00a372ef0223eb251eb18a8ff3f8d", "score": "0.5209575", "text": "function andObservables(observables) {\n return observables.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"mergeAll\"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"every\"])(function (result) { return result === true; }));\n}", "title": "" }, { "docid": "d6eb145d220067ce6758e9ae9a87b3fe", "score": "0.5204504", "text": "function andObservables(observables) {\n return observables.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"mergeAll\"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"every\"])(function (result) { return result === true; }));\n}", "title": "" }, { "docid": "cce1df0d8f00388800e2997614459e3f", "score": "0.5194263", "text": "static observables() {\n return {\n // the server throughout its operation can save state or statistic information in this observable map\n stats: ['shallowMap', {}],\n listening: false,\n }\n }", "title": "" }, { "docid": "21f8d8644ebc55db58769802c27de34f", "score": "0.5192365", "text": "function isArrayLike(x) {\n return Array.isArray(x) || isObservableArray(x);\n}", "title": "" }, { "docid": "1e055deb791d3f68a22c4f93164775bc", "score": "0.51919556", "text": "function isArrayLike(x) {\n return Array.isArray(x) || isObservableArray(x);\n}", "title": "" }, { "docid": "1e055deb791d3f68a22c4f93164775bc", "score": "0.51919556", "text": "function isArrayLike(x) {\n return Array.isArray(x) || isObservableArray(x);\n}", "title": "" }, { "docid": "1e055deb791d3f68a22c4f93164775bc", "score": "0.51919556", "text": "function isArrayLike(x) {\n return Array.isArray(x) || isObservableArray(x);\n}", "title": "" }, { "docid": "1e055deb791d3f68a22c4f93164775bc", "score": "0.51919556", "text": "function isArrayLike(x) {\n return Array.isArray(x) || isObservableArray(x);\n}", "title": "" }, { "docid": "1e055deb791d3f68a22c4f93164775bc", "score": "0.51919556", "text": "function isArrayLike(x) {\n return Array.isArray(x) || isObservableArray(x);\n}", "title": "" }, { "docid": "b8fa6c3149ea62648957a54b92b6f2aa", "score": "0.5175055", "text": "function isObservable(obj) {\n return !!obj && (obj instanceof Observable/* Observable */.y || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));\n}", "title": "" }, { "docid": "037559f7f2018f91df157e262bd62fcd", "score": "0.5147388", "text": "function createWithObservable() {\n return Object(__WEBPACK_IMPORTED_MODULE_1__streamingComponent__[\"a\" /* streamingComponent */])(props$ => props$.pipe(Object(__WEBPACK_IMPORTED_MODULE_0_rxjs_operators__[\"distinctUntilChanged\"])((props, prevProps) => props.observable === prevProps.observable), Object(__WEBPACK_IMPORTED_MODULE_0_rxjs_operators__[\"switchMap\"])(props => props.observable.pipe(Object(__WEBPACK_IMPORTED_MODULE_0_rxjs_operators__[\"map\"])(observableValue => props.children\n ? props.children(observableValue)\n : id(observableValue))))));\n}", "title": "" }, { "docid": "afb172aa34d4a29d9d5a47bbdb66c381", "score": "0.5135854", "text": "function fromIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n if (!scheduler) {\n return new Observable[\"a\" /* Observable */](Object(subscribeToIterable[\"a\" /* subscribeToIterable */])(input));\n }\n else {\n return new Observable[\"a\" /* Observable */](function (subscriber) {\n var sub = new Subscription[\"a\" /* Subscription */]();\n var iterator;\n sub.add(function () {\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(function () {\n iterator = input[symbol_iterator[\"a\" /* iterator */]]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n var value;\n var done;\n try {\n var result = iterator.next();\n value = result.value;\n done = result.done;\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n }\n}", "title": "" }, { "docid": "e305bba3108cf3f22b56c4357e1d4f8b", "score": "0.5134539", "text": "function from(input, scheduler) {\n if (!scheduler) {\n if (input instanceof Observable[\"a\" /* Observable */]) {\n return input;\n }\n return new Observable[\"a\" /* Observable */](Object(subscribeTo[\"a\" /* subscribeTo */])(input));\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromObservable(input, scheduler);\n }\n else if (Object(isPromise[\"a\" /* isPromise */])(input)) {\n return fromPromise(input, scheduler);\n }\n else if (Object(isArrayLike[\"a\" /* isArrayLike */])(input)) {\n return fromArray(input, scheduler);\n }\n else if (isIterable(input) || typeof input === 'string') {\n return fromIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}", "title": "" }, { "docid": "9dc11c17c0f686177e3c1bda1ee1a7b4", "score": "0.50872165", "text": "getItems() {\n let observable = rxjs__WEBPACK_IMPORTED_MODULE_1__[\"Observable\"].create(observer => observer.next(this.cartItems));\n return observable;\n }", "title": "" }, { "docid": "32f74f3b4de961b5167f6358e78149b1", "score": "0.5073756", "text": "function fromArray(input, scheduler) {\n if (!scheduler) {\n return new Observable[\"a\" /* Observable */](Object(subscribeToArray[\"a\" /* subscribeToArray */])(input));\n }\n else {\n return new Observable[\"a\" /* Observable */](function (subscriber) {\n var sub = new Subscription[\"a\" /* Subscription */]();\n var i = 0;\n sub.add(scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n return;\n }\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n sub.add(this.schedule());\n }\n }));\n return sub;\n });\n }\n}", "title": "" }, { "docid": "caa099db4f8b8f73c6adad95cd211584", "score": "0.5068066", "text": "function getFromObserver(arr) {\n const publisher3 = create((observer) => {\n arr.forEach(item => {\n observer.next(item);\n });\n observer.complete();\n });\n \n return publisher3;\n}", "title": "" }, { "docid": "8a5aa0f4f76626f03e88f8134aa3e301", "score": "0.5054907", "text": "subscribe() {}", "title": "" }, { "docid": "8e371efa6622d9ca4b3523ffdfd69f3b", "score": "0.50467026", "text": "function Map () {}", "title": "" }, { "docid": "16ecb1441aa257271ff5fa9b5119493e", "score": "0.5041231", "text": "function fromObservable(input, scheduler) {\n if (!scheduler) {\n return new Observable[\"a\" /* Observable */](Object(subscribeToObservable[\"a\" /* subscribeToObservable */])(input));\n }\n else {\n return new Observable[\"a\" /* Observable */](function (subscriber) {\n var sub = new Subscription[\"a\" /* Subscription */]();\n sub.add(scheduler.schedule(function () {\n var observable = input[symbol_observable[\"a\" /* observable */]]();\n sub.add(observable.subscribe({\n next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },\n error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },\n complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },\n }));\n }));\n return sub;\n });\n }\n}", "title": "" }, { "docid": "b417341c12db47d828106296b679fe36", "score": "0.5040259", "text": "function ValueObservable(values) {\n\tObservableCtor.call(this)\n\tthis._values = Array.prototype.slice.call(values)\n\tif (!this._values) {\n\t\tthis._values = []\n\t}\n}", "title": "" }, { "docid": "a61da495b241a12b8bd9631967190b8f", "score": "0.5032494", "text": "getData() {\n this.authService.getAllInvoices().subscribe((clients) => {\n Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"of\"])(clients.map(client => new src_app_models_invoice_model__WEBPACK_IMPORTED_MODULE_25__[\"Invoice\"](client))).subscribe(clientes => {\n console.log('123213123');\n console.log(clientes);\n this.subject$.next(clientes);\n });\n });\n }", "title": "" }, { "docid": "9395b158d67482fdc76910b5ae5812b2", "score": "0.50102943", "text": "function ArrayUtil() {}", "title": "" }, { "docid": "00e090ef6de3a1775264820d478252dc", "score": "0.5004759", "text": "function concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return function (source) { return source.lift.call(_observable_concat__WEBPACK_IMPORTED_MODULE_0__[\"concat\"].apply(void 0, [source].concat(observables))); };\n}", "title": "" }, { "docid": "00e090ef6de3a1775264820d478252dc", "score": "0.5004759", "text": "function concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return function (source) { return source.lift.call(_observable_concat__WEBPACK_IMPORTED_MODULE_0__[\"concat\"].apply(void 0, [source].concat(observables))); };\n}", "title": "" }, { "docid": "87f96d83cc46feaa4f904be27b269992", "score": "0.50040793", "text": "function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n else if (Object(isPromise[\"a\" /* isPromise */])(input)) {\n return schedulePromise(input, scheduler);\n }\n else if (Object(isArrayLike[\"a\" /* isArrayLike */])(input)) {\n return scheduleArray(input, scheduler);\n }\n else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}", "title": "" }, { "docid": "27626bdc81bff98a27c9328518416595", "score": "0.5000006", "text": "function ObservableEvents() {\n this._observers = {};\n}", "title": "" }, { "docid": "8a5b5bd103415246820f5e51b6d02a67", "score": "0.4995524", "text": "function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n else if ((0,isPromise/* isPromise */.t)(input)) {\n return schedulePromise(input, scheduler);\n }\n else if ((0,isArrayLike/* isArrayLike */.z)(input)) {\n return (0,scheduleArray/* scheduleArray */.r)(input, scheduler);\n }\n else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}", "title": "" }, { "docid": "6e361887bfe119fb70709de6f25b9f1b", "score": "0.4979135", "text": "observerArray (items) {\n for (let i = 0, l = items.length; i < l; i++) {\n observe(items[i]);\n }\n }", "title": "" }, { "docid": "229fa6a70c104d9383507ea623eeb991", "score": "0.49765906", "text": "map(callback) {\n return this.all().map(callback, this);\n }", "title": "" }, { "docid": "e5108df88a64c05e25ed69099eb584d2", "score": "0.49760908", "text": "function subscribeBindable(valueObs, callback) {\n // A plain function (to make a computed from), or a knockout observable.\n if (typeof valueObs === 'function') {\n // Knockout observable.\n const koValue = valueObs;\n if (typeof koValue.peek === 'function') {\n const sub = koValue.subscribe((val) => callback(val));\n callback(koValue.peek());\n return sub;\n }\n // Function from which to make a computed. Note that this is also reasonable:\n // let sub = subscribe(use => callback(valueObs(use)));\n // The difference is that when valueObs() evaluates to unchanged value, callback would be\n // called in the version above, but not in the version below.\n const comp = (0,_computed__WEBPACK_IMPORTED_MODULE_0__.computed)(valueObs);\n comp.addListener((val) => callback(val));\n callback(comp.get());\n return comp; // Disposing this will dispose its one listener.\n }\n // An observable.\n if (valueObs instanceof _observable__WEBPACK_IMPORTED_MODULE_2__.BaseObservable) {\n // Use subscribe() rather than addListener(), so that bundling of changes (implicit and with\n // bundleChanges()) is respected. This matters when callback also uses observables.\n return (0,_subscribe__WEBPACK_IMPORTED_MODULE_3__.subscribe)(valueObs, (use, val) => callback(val));\n }\n callback(valueObs);\n return null;\n}", "title": "" }, { "docid": "7975a4a739c95713fd519e1f05d7a2a4", "score": "0.49749297", "text": "function map(project) {\n return function mapOperation(source$) {\n if (typeof project !== \"function\") {\n throw new TypeError(\"argument is not a function...\");\n }\n return Observable.create((observer) => {\n const subscription = source$.subscribe({\n next: value => {\n try {\n observer.next(project(value));\n } catch (e) {\n observer.error(e);\n }\n },\n error: observer.error,\n complete: () => observer.complete(),\n });\n return () => {\n subscription.unsubscribe();\n };\n });\n };\n}", "title": "" }, { "docid": "c4dd3e50be0874bc4ae8055aaf00e8bd", "score": "0.49702913", "text": "function testcase() {\n\n var newArr = [11].map(function () { });\n\n return Array.isArray(newArr);\n\n }", "title": "" }, { "docid": "47c1df59431d9af1a810b18588a1d31e", "score": "0.49494162", "text": "function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n else if (Object(isPromise[\"a\" /* isPromise */])(input)) {\n return schedulePromise(input, scheduler);\n }\n else if (Object(isArrayLike[\"a\" /* isArrayLike */])(input)) {\n return Object(scheduleArray[\"a\" /* scheduleArray */])(input, scheduler);\n }\n else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}", "title": "" }, { "docid": "47c1df59431d9af1a810b18588a1d31e", "score": "0.49494162", "text": "function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n else if (Object(isPromise[\"a\" /* isPromise */])(input)) {\n return schedulePromise(input, scheduler);\n }\n else if (Object(isArrayLike[\"a\" /* isArrayLike */])(input)) {\n return Object(scheduleArray[\"a\" /* scheduleArray */])(input, scheduler);\n }\n else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}", "title": "" }, { "docid": "7e9f9a7176d5008597f899a79568472c", "score": "0.49392882", "text": "function y(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||\"[object Arguments]\"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}", "title": "" }, { "docid": "cb107ef3bb6d6a34a63bb74c9b16d111", "score": "0.49392244", "text": "subscribe(e, t) {\n this.has(e) || (this.events[e] = []);\n let s = [];\n if (Array.isArray(t)) for (const n of t) s.push(...this.subscribe(e, n)); else this.events[e].push(t), \n s.push((() => this.removeListener(e, t)));\n return s;\n }", "title": "" }, { "docid": "e06a291758fce9d519e24cd09fa1f7aa", "score": "0.49300098", "text": "function scheduled(input, scheduler) {\n\t if (input != null) {\n\t if (isInteropObservable(input)) {\n\t return scheduleObservable(input, scheduler);\n\t }\n\t else if (isPromise(input)) {\n\t return schedulePromise(input, scheduler);\n\t }\n\t else if (isArrayLike(input)) {\n\t return scheduleArray(input, scheduler);\n\t }\n\t else if (isIterable(input) || typeof input === 'string') {\n\t return scheduleIterable(input, scheduler);\n\t }\n\t }\n\t throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n\t}", "title": "" }, { "docid": "04757db9a4cea2b47e49658417c7c004", "score": "0.49248856", "text": "function Observable(onObserverAdded) {\n this._observers = new Array();\n this._eventState = new EventState(0);\n if (onObserverAdded) {\n this._onObserverAdded = onObserverAdded;\n }\n }", "title": "" }, { "docid": "61f56859aa3fcb0eaefab8e185bedf7e", "score": "0.4914946", "text": "function flatMap(mapper) {\n return observable => {\n return new _observable.default(observer => {\n const scheduler = new _scheduler.AsyncSerialScheduler(observer);\n const subscription = observable.subscribe({\n complete() {\n scheduler.complete();\n },\n\n error(error) {\n scheduler.error(error);\n },\n\n next(input) {\n scheduler.schedule(next => __awaiter(this, void 0, void 0, function* () {\n var e_1, _a;\n\n const mapped = yield mapper(input);\n\n if ((0, _util.isIterator)(mapped) || (0, _util.isAsyncIterator)(mapped)) {\n try {\n for (var mapped_1 = __asyncValues(mapped), mapped_1_1; mapped_1_1 = yield mapped_1.next(), !mapped_1_1.done;) {\n const element = mapped_1_1.value;\n next(element);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (mapped_1_1 && !mapped_1_1.done && (_a = mapped_1.return)) yield _a.call(mapped_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } else {\n mapped.map(output => next(output));\n }\n }));\n }\n\n });\n return () => (0, _unsubscribe.default)(subscription);\n });\n };\n}", "title": "" }, { "docid": "61f56859aa3fcb0eaefab8e185bedf7e", "score": "0.4914946", "text": "function flatMap(mapper) {\n return observable => {\n return new _observable.default(observer => {\n const scheduler = new _scheduler.AsyncSerialScheduler(observer);\n const subscription = observable.subscribe({\n complete() {\n scheduler.complete();\n },\n\n error(error) {\n scheduler.error(error);\n },\n\n next(input) {\n scheduler.schedule(next => __awaiter(this, void 0, void 0, function* () {\n var e_1, _a;\n\n const mapped = yield mapper(input);\n\n if ((0, _util.isIterator)(mapped) || (0, _util.isAsyncIterator)(mapped)) {\n try {\n for (var mapped_1 = __asyncValues(mapped), mapped_1_1; mapped_1_1 = yield mapped_1.next(), !mapped_1_1.done;) {\n const element = mapped_1_1.value;\n next(element);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (mapped_1_1 && !mapped_1_1.done && (_a = mapped_1.return)) yield _a.call(mapped_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } else {\n mapped.map(output => next(output));\n }\n }));\n }\n\n });\n return () => (0, _unsubscribe.default)(subscription);\n });\n };\n}", "title": "" }, { "docid": "96ad66f3c2ccc124a14ab45e4bd824e6", "score": "0.49087325", "text": "function map(mapper) {\n return observable => {\n return new _observable.default(observer => {\n const scheduler = new _scheduler.AsyncSerialScheduler(observer);\n const subscription = observable.subscribe({\n complete() {\n scheduler.complete();\n },\n\n error(error) {\n scheduler.error(error);\n },\n\n next(input) {\n scheduler.schedule(next => __awaiter(this, void 0, void 0, function* () {\n const mapped = yield mapper(input);\n next(mapped);\n }));\n }\n\n });\n return () => (0, _unsubscribe.default)(subscription);\n });\n };\n}", "title": "" }, { "docid": "96ad66f3c2ccc124a14ab45e4bd824e6", "score": "0.49087325", "text": "function map(mapper) {\n return observable => {\n return new _observable.default(observer => {\n const scheduler = new _scheduler.AsyncSerialScheduler(observer);\n const subscription = observable.subscribe({\n complete() {\n scheduler.complete();\n },\n\n error(error) {\n scheduler.error(error);\n },\n\n next(input) {\n scheduler.schedule(next => __awaiter(this, void 0, void 0, function* () {\n const mapped = yield mapper(input);\n next(mapped);\n }));\n }\n\n });\n return () => (0, _unsubscribe.default)(subscription);\n });\n };\n}", "title": "" }, { "docid": "da5928ee86556386601ced5a30f484c6", "score": "0.49085617", "text": "function Be(e,t){var n=\"function\"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}", "title": "" }, { "docid": "e66686e346e8c64902ea0d4ca73dd1eb", "score": "0.49074683", "text": "function map(fn,list){return list?cons(fn(head(list)),map(fn,tail(list))):emptyList;}", "title": "" }, { "docid": "2689f9c92de361c1a313446ccce90e68", "score": "0.4903286", "text": "function isObservable(value, property) {\n if (value === null || value === undefined)\n return false;\n if (property !== undefined) {\n if (isObservableArray(value) || isObservableMap(value))\n throw new Error(getMessage(\"m019\"));\n else if (isObservableObject(value)) {\n var o = value.$mobx;\n return o.values && !!o.values[property];\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value.$mobx || isAtom(value) || isReaction(value) || isComputedValue(value);\n}", "title": "" }, { "docid": "7ecbc26bf979928662a311826ea84a07", "score": "0.4895538", "text": "function scheduleArray(input, scheduler) {\n\t return new Observable(function (subscriber) {\n\t var sub = new Subscription();\n\t var i = 0;\n\t sub.add(scheduler.schedule(function () {\n\t if (i === input.length) {\n\t subscriber.complete();\n\t return;\n\t }\n\t subscriber.next(input[i++]);\n\t if (!subscriber.closed) {\n\t sub.add(this.schedule());\n\t }\n\t }));\n\t return sub;\n\t });\n\t}", "title": "" }, { "docid": "fb11345ecacd2d3f112c02c86cb0613f", "score": "0.48928353", "text": "function isObservable(obj) {\n // TODO: use Symbol.observable when https://github.com/ReactiveX/rxjs/issues/2415 will be resolved\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "fb11345ecacd2d3f112c02c86cb0613f", "score": "0.48928353", "text": "function isObservable(obj) {\n // TODO: use Symbol.observable when https://github.com/ReactiveX/rxjs/issues/2415 will be resolved\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "fb11345ecacd2d3f112c02c86cb0613f", "score": "0.48928353", "text": "function isObservable(obj) {\n // TODO: use Symbol.observable when https://github.com/ReactiveX/rxjs/issues/2415 will be resolved\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "57ad336875e4094077ca093d5bf98a84", "score": "0.48824528", "text": "function thunkArray(lifetime, mappedArray) {\n var observableArray = ko.observableArray(), computed = ko.computed(function () {\n observableArray(mappedArray());\n });\n observableArray.dispose = computed.dispose.bind(computed);\n lifetime.registerForDispose(observableArray);\n return observableArray;\n }", "title": "" }, { "docid": "fa26d1c160959e75dcd5fb77c722e9f9", "score": "0.48799098", "text": "observeArray(items) {\n for (let i = 0, l = items.length; i < l; i++) {\n observe(items[i]);\n }\n }", "title": "" }, { "docid": "fa26d1c160959e75dcd5fb77c722e9f9", "score": "0.48799098", "text": "observeArray(items) {\n for (let i = 0, l = items.length; i < l; i++) {\n observe(items[i]);\n }\n }", "title": "" }, { "docid": "6b1feb19694a171c483ae1c0ac14b3d2", "score": "0.48723763", "text": "function Map(){}", "title": "" }, { "docid": "55269843c1ad051ab778a5908e95e648", "score": "0.48651448", "text": "function collectionsObs(db) {\n return rxjs_2.bindNodeCallback(db.collections).call(db);\n}", "title": "" }, { "docid": "84b35304fc983c74610decb1fd334958", "score": "0.4856786", "text": "constructor() {\n makeAutoObservable(this)\n }", "title": "" }, { "docid": "1f67c8ada25c621a87b37b52d452b846", "score": "0.48504606", "text": "function scheduleIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable[\"a\" /* Observable */](function (subscriber) {\n var sub = new Subscription[\"a\" /* Subscription */]();\n var iterator;\n sub.add(function () {\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(function () {\n iterator = input[symbol_iterator[\"a\" /* iterator */]]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n var value;\n var done;\n try {\n var result = iterator.next();\n value = result.value;\n done = result.done;\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n}", "title": "" }, { "docid": "1f67c8ada25c621a87b37b52d452b846", "score": "0.48504606", "text": "function scheduleIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable[\"a\" /* Observable */](function (subscriber) {\n var sub = new Subscription[\"a\" /* Subscription */]();\n var iterator;\n sub.add(function () {\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(function () {\n iterator = input[symbol_iterator[\"a\" /* iterator */]]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n var value;\n var done;\n try {\n var result = iterator.next();\n value = result.value;\n done = result.done;\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n}", "title": "" }, { "docid": "1f67c8ada25c621a87b37b52d452b846", "score": "0.48504606", "text": "function scheduleIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable[\"a\" /* Observable */](function (subscriber) {\n var sub = new Subscription[\"a\" /* Subscription */]();\n var iterator;\n sub.add(function () {\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(function () {\n iterator = input[symbol_iterator[\"a\" /* iterator */]]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n var value;\n var done;\n try {\n var result = iterator.next();\n value = result.value;\n done = result.done;\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n}", "title": "" }, { "docid": "fdfac505c3effe16d8c45d61ce7c1b62", "score": "0.4837693", "text": "function map(items, fun){\n let r = [];\n for(let i=0; i<items.length; i++){\n r.push(fun(items[i]));\n }\n return r;\n }", "title": "" }, { "docid": "8d74dfd045d4ba74d23c5521f87e7897", "score": "0.4832062", "text": "function of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = args[args.length - 1];\n if (Object(isScheduler[\"a\" /* isScheduler */])(scheduler)) {\n args.pop();\n return scheduleArray(args, scheduler);\n }\n else {\n return fromArray(args);\n }\n}", "title": "" } ]
ad75e8c748e30ba791674ab9f2bcf09b
better than above default arguments
[ { "docid": "07eff7cc6eb0fe2ce4c84c431a900ff3", "score": "0.0", "text": "function greet(name='tai', age=30, pet='cat') { //sets default arguments if none are given\n return `Hello ${name} you seem to be ${age-10}. What a lovely ${pet} you have`;\n}", "title": "" } ]
[ { "docid": "506249e1ea3ab45d7a3377b9bd87e11a", "score": "0.6139077", "text": "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "title": "" }, { "docid": "506249e1ea3ab45d7a3377b9bd87e11a", "score": "0.6139077", "text": "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "title": "" }, { "docid": "506249e1ea3ab45d7a3377b9bd87e11a", "score": "0.6139077", "text": "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "title": "" }, { "docid": "506249e1ea3ab45d7a3377b9bd87e11a", "score": "0.6139077", "text": "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "title": "" }, { "docid": "1cbf8fcc277fd558f684cddc20ac766f", "score": "0.60877526", "text": "function func(){\n\t\t\tfor(var i in arguments){\n\t\t\t\talert(arguments[i]);\n\t\t \t\targuments[i] = arguments[i] || __defaultValue__; \n\t\t \t}\n\t\t}", "title": "" }, { "docid": "c1ac03ad55477b0d4e46e4cbc8b0e9d9", "score": "0.6081208", "text": "function defaults(var_args){\n\t return find(toArray(arguments), nonVoid);\n\t }", "title": "" }, { "docid": "e996023f08f5b956a6132a200b1775bb", "score": "0.5897345", "text": "function defaultparameval(x = paramvalue()) {\r\n\treturn x;\r\n}", "title": "" }, { "docid": "eab1d6a23929e8520efd11b7180a1980", "score": "0.5795058", "text": "function a(param=6){\n return param;\n }", "title": "" }, { "docid": "8f4453857433e646506a9aafe961f2eb", "score": "0.57289183", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2.default[key] : args[key];\n }", "title": "" }, { "docid": "c8aae55f86e3f32157f2bb16cb3732a9", "score": "0.5696387", "text": "function defaults(a, b, c) {\r\n if (a != null) {\r\n return a;\r\n }\r\n if (b != null) {\r\n return b;\r\n }\r\n return c;\r\n }", "title": "" }, { "docid": "e0c0ace19a7ad425c52702a6aef5f378", "score": "0.5689016", "text": "function test1(x: {}) {} // need ... in function param", "title": "" }, { "docid": "d1ddab7607e0b207dc838f87efc995b7", "score": "0.5674007", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "1dd02a235eb9e48ca5db51288e83d008", "score": "0.5673647", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "99e9ce0e16eb2e74648839d5df2d7c66", "score": "0.56598", "text": "getDefaultParams() {\n throw new Error('Unimplemented method');\n }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "e4302e5b9c4549c4f6b2a40726b49d31", "score": "0.56482756", "text": "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "72d332cf73729667a943ec38a92fc5d0", "score": "0.56455", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "403759278ea1ef28fcf4f43bc6b2363e", "score": "0.5624891", "text": "function o0(o1 = 'default argument') {\n try {\nprint(e);\n}catch(e){}\n}", "title": "" }, { "docid": "586d9b6b44b5e1f4c73c9e9b0d037362", "score": "0.5622568", "text": "function funName(param_1=value_1,..., param_n=value_n){\n //Code\n }", "title": "" }, { "docid": "82717043d20249cccb86b1da8fc93447", "score": "0.5611992", "text": "function defaultArgs() {\n console.log(arguments)\n}", "title": "" }, { "docid": "17441c1435f2bb23857fc23b85b0becd", "score": "0.5609733", "text": "function defaults(a, b, c) {\n\tif (a != null) {\n\t\treturn a;\n\t}\n\tif (b != null) {\n\t\treturn b;\n\t}\n\treturn c;\n}", "title": "" }, { "docid": "1b2a9cac0b004cea8e4f5eea08fcd394", "score": "0.5609487", "text": "function func2(a=1, b=2){\n\t\t\t//...\n\t\t}", "title": "" }, { "docid": "b009fe12629f06ea8df442a73a81b423", "score": "0.5606553", "text": "function argumentOrDefault(key) {\n\t var args = customizations;\n\t return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n\t }", "title": "" }, { "docid": "fdd42d0b9a7997a60c05ae9fb4b01dc0", "score": "0.5604292", "text": "function foo(param = \"no\") {\n return \"yes\";\n}", "title": "" }, { "docid": "866db37020786084e385b42539148b06", "score": "0.56011146", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n\n if (b != null) {\n return b;\n }\n\n return c;\n }", "title": "" }, { "docid": "00c60b686a29a074c806f5827fc91713", "score": "0.55787295", "text": "function suma(a,b=10){\n return a+b; \n}", "title": "" }, { "docid": "be65b242ba29e159ea40a857497787cb", "score": "0.5578274", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a\n }\n if (b != null) {\n return b\n }\n return c\n }", "title": "" }, { "docid": "a3a53b8ae229dfb789f1a28dd0a46f25", "score": "0.5556597", "text": "function ejemploDefault(argumento = 10) {\n console.log(argumento);\n}", "title": "" }, { "docid": "1f39b12f59a0b913baa432c55155d185", "score": "0.5546339", "text": "function add_func(a, b=1)\r\n{\r\n return a+b;\r\n}", "title": "" }, { "docid": "8104d9148b64afdb7970ff7c6db167ea", "score": "0.55452776", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "8104d9148b64afdb7970ff7c6db167ea", "score": "0.55452776", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "4b5d49227f180f889ec1fb1d3c79b126", "score": "0.5538866", "text": "function defaults(a, b, c) {\n\t\tif (a != null) {\n\t\t\treturn a;\n\t\t}\n\t\tif (b != null) {\n\t\t\treturn b;\n\t\t}\n\t\treturn c;\n\t}", "title": "" }, { "docid": "9fbdb798ac6b9f9dde10a10b37c9eaf1", "score": "0.5530153", "text": "function soma1([a,b] = [0,0]){ // pode-se usar com default values tambem\n return a + b\n}", "title": "" }, { "docid": "7c0eceb11a907128405602f0af9991b0", "score": "0.5528025", "text": "init(...args) { }", "title": "" }, { "docid": "ddd0bae4e6cdf68732836ab60d95a7d4", "score": "0.55254304", "text": "function returnAllArgs() {}", "title": "" }, { "docid": "7dd8a07253ad4d14a418caa930b50b45", "score": "0.5521237", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "4d74ac0c14f9664f3322f678e87a337d", "score": "0.5513014", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "title": "" }, { "docid": "26fdb4e7dfe5e415fb2739e6cf90e626", "score": "0.5508827", "text": "function defaults(a, b, c) {\r\n if (a != null) {\r\n return a;\r\n }\r\n if (b != null) {\r\n return b;\r\n }\r\n return c;\r\n}", "title": "" }, { "docid": "0174ff3e3d8265db50752ea6548f48d0", "score": "0.5489595", "text": "function opt1() {\n var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 4;\n var m = n;\n var m;\n}", "title": "" }, { "docid": "b1afd331f19af517e3d3303d018ab206", "score": "0.5488195", "text": "function _fn(){ /*...*/ }\t\t//Funzioni private", "title": "" }, { "docid": "25ef3c39b0c8973ee8a071cfdb26d6fb", "score": "0.5484457", "text": "function example(x = 20, y = 50){ //this is using default values\n console.log(x + y);\n}", "title": "" }, { "docid": "c13165d0a8adb7a350bdffbfb56fe06d", "score": "0.5478028", "text": "function foo1(param1, param2) {\n param1 = param1 || 10;\n param2 = param2 || 10;\n console.log(param1, param2);\n}", "title": "" }, { "docid": "67c3298e1210baa55eb101778b0d4cdb", "score": "0.54719424", "text": "function add (a=10, b = 20) {\n return a + b;\n}", "title": "" }, { "docid": "9e99945979e57dc95b3c2081b8baa2b5", "score": "0.5446523", "text": "function a(e){return e&&\"object\"===typeof e&&\"default\"in e?e[\"default\"]:e}", "title": "" }, { "docid": "9e99945979e57dc95b3c2081b8baa2b5", "score": "0.5446523", "text": "function a(e){return e&&\"object\"===typeof e&&\"default\"in e?e[\"default\"]:e}", "title": "" }, { "docid": "14e7cff9bdc9c999f852bf13634be6f8", "score": "0.5435593", "text": "function foo(x,y = 10){\n\tconsole.log(x,y);\n}", "title": "" }, { "docid": "edf7b68732aca3c07711bb9ebbee9476", "score": "0.54331666", "text": "function foo(x=5) {\n return x+1;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" }, { "docid": "c14ef70a28a5fb3de7e81fb296e820f7", "score": "0.5432453", "text": "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "title": "" } ]
7af8e7ebb15c663cf943ac03cec61af3
Generates a 4bit vector representing the location of a point relative to the small circle's bounding box.
[ { "docid": "5340a609a80d014e6ede1be8440d2e11", "score": "0.0", "text": "function code(lambda, phi) {\n var r = smallRadius ? radius : _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }", "title": "" } ]
[ { "docid": "393aa7317d82c74b11c27d1ec146c1c2", "score": "0.65164816", "text": "to4(isPoint) {\r\n return Vec.of(this[0], this[1], this[2], +isPoint);\r\n }", "title": "" }, { "docid": "9f23a717870ad5cdf2439a6b3b23138f", "score": "0.6333499", "text": "function pointLocation(point, size_x, size_y) {\n var location = 0b0;\n if (point.x < -size_x) {\n location += 0b1000;\n } else if (point.x > size_x) {\n location += 0b0100;\n }\n\n if (point.y < -size_y) {\n location += 0b0001;\n } else if (point.y > size_y) {\n location += 0b0010;\n }\n\n return location;\n}", "title": "" }, { "docid": "90c33e1248a8ba7e1ee41cf8472a0937", "score": "0.63316286", "text": "pointLocation(point) {\n let location = 0b0\n\n if (point.x < -this.sizeX) {\n location += 0b1000\n } else if (point.x > this.sizeX) {\n location += 0b0100\n }\n\n if (point.y < -this.sizeY) {\n location += 0b0001\n } else if (point.y > this.sizeY) {\n location += 0b0010\n }\n\n return location\n }", "title": "" }, { "docid": "268406054336aa09fc78db6a4cc2e4e7", "score": "0.6308688", "text": "function getPointG (center, radius) {\n var x = center[0];\n var y = center[1];\n \n \n y += Math.round(2 * radius * .8660)\n\n console.log([x, y]);\n}", "title": "" }, { "docid": "142565ba45fc0c45e982b31d6396003a", "score": "0.6241421", "text": "generateRandomPoint() {\r\n let p = glMatrix.vec3.create();\r\n let x = Math.random() * (this.maxX - this.minX) + this.minX;\r\n let y = Math.random() * (this.maxY - this.minY) + this.minY;\r\n glMatrix.vec3.set(p, x, y, 0);\r\n return p;\r\n }", "title": "" }, { "docid": "0d3c6ac934f5c967560ed688d76d6f37", "score": "0.623518", "text": "function getTriangleCenter(x,y,size) {\n return {\n x: Math.floor((x + x+size + x) / 3),\n y: Math.floor((y + y+size + y+size) / 3)\n }\n}", "title": "" }, { "docid": "a0e090a2194d4a18dbd856334c5ba36f", "score": "0.61645794", "text": "function getCenterPoint() {\n var p = root.createSVGPoint();\n // center of 1024, 768\n p.x = 512;\n p.y = 384;\n return p;\n}", "title": "" }, { "docid": "2fdc20a72b2455d38ef1f451bb5ed103", "score": "0.6067858", "text": "get position() { return p5.prototype.createVector(0, this.height + Earth.RADIUS, 0); }", "title": "" }, { "docid": "93d702748610de2404acc9fdb8016026", "score": "0.6017219", "text": "_coord(arr) {\n var a = arr[0], d = arr[1], b = arr[2];\n var sum, pos = [0, 0];\n sum = a + d + b;\n if (sum !== 0) {\n a /= sum;\n d /= sum;\n b /= sum;\n pos[0] = corners[0][0] * a + corners[1][0] * d + corners[2][0] * b;\n pos[1] = corners[0][1] * a + corners[1][1] * d + corners[2][1] * b;\n }\n return pos;\n }", "title": "" }, { "docid": "67e0e38f120b32be241fd69b9e91a4b7", "score": "0.59361875", "text": "function getCoords(point) {\n return [Number(point.lat.toFixed(4)), Number(point.lng.toFixed(4))];\n }", "title": "" }, { "docid": "30e4bc7a76c785359a9d8688f2fedb2f", "score": "0.59196484", "text": "function calculatePoint(){\n var M = 40;\n var L = 3;\n var startPoint = vec2(115, 121);\n\n var currPoint_x = startPoint[0];\n var currPoint_y = startPoint[1];\n var nextPoint_x = startPoint[0];\n var nextPoint_y = startPoint[1];\n\n points = [];\n for( var i = 0; points.length < numberPoints; i++){\n nextPoint_x = M * (1 + 2*L) - currPoint_y + Math.abs(currPoint_x - L * M);\n nextPoint_y = currPoint_x;\n\n // to normalize this I think need to know the max value of x,y\n // instead of /canvas.width or /canvas.height\n points.push(vec2(nextPoint_x / canvas.width, nextPoint_y / canvas.height));\n // points.push(vec2(nextPoint_x, nextPoint_y));\n currPoint_x = nextPoint_x;\n currPoint_y = nextPoint_y;\n // console.log(points[i]);\n }\n}", "title": "" }, { "docid": "f2292cf8ae6ae372d4292fecdfb74600", "score": "0.59122694", "text": "round() {\n return new Vector(\n Math.round(this.x),\n Math.round(this.y)\n )\n }", "title": "" }, { "docid": "fd20e27c9308f4b11c034a06707b35fd", "score": "0.58843446", "text": "function Vector4(x,y,z,w){this.x=x;this.y=y;this.z=z;this.w=w;}", "title": "" }, { "docid": "b923e0c1d02a517aee99c57aa8f02730", "score": "0.5884276", "text": "givePosition() {\n let v = createVector(this.x, this.y);\n return v;\n }", "title": "" }, { "docid": "f2fe3e9703de6b2fbfe1cf934a73d64e", "score": "0.58659184", "text": "function from_coords(x,y) {\n return x + y*16;\n }", "title": "" }, { "docid": "3c8fb41db920c4e80672c1279421b51c", "score": "0.5852686", "text": "function point_offset(i) {\n return 4*i;\n }", "title": "" }, { "docid": "c4dc950308a44c177afef64e1d7e4064", "score": "0.58353376", "text": "function computeOrigin(x, y, quad, vec) {\r\n\r\n switch (quad) {\r\n case 2:\r\n vec = computeCameraOrientation(x, y, quad, vec);\r\n break;\r\n case 3:\r\n vec = computeCameraOrientation(x, y, quad, vec);\r\n break;\r\n case 4:\r\n vec = computeCameraOrientation(x, y, quad, vec);\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "d8e7f390aaf15498ff3f5637bdb4c1fa", "score": "0.58346826", "text": "function getPos(joint) {\n return createVector((joint.cameraX * width/2) + width/2, (-joint.cameraY * width/2) + height/2);\n}", "title": "" }, { "docid": "2ab034ee6bcfd72ad266a5042c5b1f4b", "score": "0.5826256", "text": "_transformedPoint(x, y) {\n let pt = this._svg.createSVGPoint()\n pt.x = x * this._pixelRatio()\n pt.y = y * this._pixelRatio()\n return pt.matrixTransform(this._transform.inverse())\n }", "title": "" }, { "docid": "cb7547d0dcea28903862199a7449f3d4", "score": "0.58015585", "text": "function getPos(joint) {\n return createVector(joint.cameraX*width/4, -joint.cameraY*width/4, joint.cameraZ*100);\n}", "title": "" }, { "docid": "e233874e2ab65dbfe03fb7d8e3f95b1b", "score": "0.579905", "text": "function getXY(number) {\n return `x${((number - 1) % 4) + 1}y${Math.ceil((number) / 4)}`;\n}", "title": "" }, { "docid": "c31c1743eff6b1ec8806fef1465b9bfa", "score": "0.57975084", "text": "function getProjectionPointOnSurface(point) {\n var radius = canvas.width/3; // Jari-jari virtual trackball kita tentukan sebesar 1/3 lebar kanvas\n var center = glMatrix.vec3.fromValues(canvas.width/2, canvas.height/2, 0); // Titik tengah virtual trackball\n var pointVector = glMatrix.vec3.subtract(glMatrix.vec3.create(), point, center);\n pointVector[1] = pointVector[1] * (-1); // Flip nilai y, karena koordinat piksel makin ke bawah makin besar\n var radius2 = radius * radius;\n var length2 = pointVector[0] * pointVector[0] + pointVector[1] * pointVector[1];\n if (length2 <= radius2) pointVector[2] = Math.sqrt(radius2 - length2); // Dapatkan nilai z melalui rumus Pytagoras\n else { // Atur nilai z sebagai 0, lalu x dan y sebagai paduan Pytagoras yang membentuk sisi miring sepanjang radius\n pointVector[0] *= radius / Math.sqrt(length2);\n pointVector[1] *= radius / Math.sqrt(length2);\n pointVector[2] = 0;\n }\n return glMatrix.vec3.normalize(glMatrix.vec3.create(), pointVector);\n }", "title": "" }, { "docid": "a85445a84e673d6b8d2864a448c0d0b3", "score": "0.57962036", "text": "function fixPoint(p) {\n return new Point( p.x + W /2, -p.y + H / 2 );\n}", "title": "" }, { "docid": "08e527e821c488864aed9f613b8b0fcc", "score": "0.5773125", "text": "function isoPoint(x, y) {\n let point = {};\n point.x = x - y;\n point.y = (x + y) / 2;\n return point;\n}", "title": "" }, { "docid": "f0c01da47538c8e67dfbd2bc7c791c19", "score": "0.5761874", "text": "function getPoint(x, gf) { return { 'x': x, 'y': gf(x)*-1 }; }", "title": "" }, { "docid": "bbb56f8bb6768dd9ee6e9a56d291b28a", "score": "0.57521325", "text": "function getRandomUnitVector(){\n\t let x = getRandom(-1, 1);\n\t let y = getRandom(-1, 1);\n\t let length = Math.sqrt(x*x + y*y);\n\t if(length == 0){ // very unlikely\n\t\t x=1; // point right\n\t\t y=0;\n\t\t length = 1;\n\t } else{\n\t\t x /= length;\n\t\t y /= length;\n\t }\n \n\t return {x:x, y:y};\n }", "title": "" }, { "docid": "8fbbd0f373c0cdf430b7c02bf4e859d5", "score": "0.5748212", "text": "_projectCoordinates() {\n var _point;\n return this._coordinates.map(latlon => {\n _point = this._world.latLonToPoint(latlon);\n\n // TODO: Is offset ever being used or needed?\n if (!this._offset) {\n this._offset = Point(0, 0);\n this._offset.x = -1 * _point.x;\n this._offset.y = -1 * _point.y;\n\n this._options.pointScale = this._world.pointScale(latlon);\n }\n\n return _point;\n });\n }", "title": "" }, { "docid": "96c2a331e7e5ad48a48beb8ec49013e4", "score": "0.5744702", "text": "static createFullLatitude() { return AngleSweep.createStartEndRadians(-0.5 * Math.PI, 0.5 * Math.PI); }", "title": "" }, { "docid": "4b4b391bff494ceed92087161d765d37", "score": "0.5737374", "text": "function vertex(point) {\n var lambda = (point[0] * Math.PI) / 180,\n phi = (point[1] * Math.PI) / 180,\n cosPhi = Math.cos(phi);\n return new THREE.Vector3(\n radius * cosPhi * Math.cos(lambda),\n radius * cosPhi * Math.sin(lambda),\n radius * Math.sin(phi)\n );\n }", "title": "" }, { "docid": "231b4ce9915f65506740b4d8eb9d69c1", "score": "0.57240593", "text": "getProjection(other_vector) {\n\n }", "title": "" }, { "docid": "a7fa134e4f8d12bbdbcac27e6df55812", "score": "0.57181376", "text": "Project(line) {\n let dotvalue = line.direction.x * (this.x - line.origin.x)\n + line.direction.y * (this.y - line.origin.y);\n\n return new Vector({\n x: line.origin.x + line.direction.x * dotvalue,\n y: line.origin.y + line.direction.y * dotvalue,\n })\n\n }", "title": "" }, { "docid": "cfad8c3678bda2b9b0f8a346c88145fd", "score": "0.5704581", "text": "getCenter(){\n\t\treturn {\n\t\t\tx: 2,\n\t\t\ty: 2\n\t\t};\n\t}", "title": "" }, { "docid": "5ca1cbcb26c4a5eec86827fc1497c848", "score": "0.5696565", "text": "function getRandomUnitVector()\n{\n\tlet x = getRandom(-1,1);\n\tlet y = getRandom(-1,1);\n\tlet length = Math.sqrt(x*x + y*y);\n\tif(length == 0)\n\t{ // very unlikely\n\t\tx = 1; // point right\n\t\ty = 0;\n\t\tlength = 1;\n\t} \n\telse\n\t{\n\t\tx /= length;\n\t\ty /= length;\n\t}\n\n\treturn {x:x, y:y};\n}", "title": "" }, { "docid": "6b1175dfede959fc2e974663208e4597", "score": "0.56894726", "text": "getMappingFunction() {\n return (v) => {\n const x = v.x*this[0][0] + v.y*this[0][1] + v.z*this[0][2] + this[0][3];\n const y = v.x*this[1][0] + v.y*this[1][1] + v.z*this[1][2] + this[1][3];\n const z = v.x*this[2][0] + v.y*this[2][1] + v.z*this[2][2] + this[2][3];\n const w = v.x*this[3][0] + v.y*this[3][1] + v.z*this[3][2] + this[3][3];\n\n return (w !== 0) ? new Point(x / w, y / w, z / w) : new Point(0, 0, 0);\n };\n }", "title": "" }, { "docid": "5b378fde163f61a9e92d62ca69e044cb", "score": "0.5686878", "text": "function inLocalScale(point) {\n\n var viewbox = canvas.viewbox();\n\n return {\n x: round(point.x / viewbox.scale),\n y: round(point.y / viewbox.scale)\n };\n }", "title": "" }, { "docid": "75500d1880d00da48546b33d2161d115", "score": "0.56762207", "text": "origin() {\n\t\treturn { x: -3, y: -4 };\n\t}", "title": "" }, { "docid": "a2e623724bc8677e5feb794aad8dcbbc", "score": "0.5673396", "text": "function toViewboxCoords( point ) {\n if ( ! svgRoot )\n return false;\n if ( typeof point.pageX !== 'undefined' ) {\n point = newSVGPoint(point.pageX, point.pageY);\n }\n return point.matrixTransform(svgRoot.getScreenCTM().inverse());\n }", "title": "" }, { "docid": "20ae9917246c52e9ae5a83aa1957ae27", "score": "0.5665924", "text": "function pixelToPoint(x, y) {\n // Map percentage of total width/height to a value from -1 to +1\n const zx = (x / width) * 2 - 1\n const zy = 1 - (y / height) * 2\n\n let z = math.complex(zx, zy); // Mathjs library\n z = z.div(zoom); // Mathjs library\n z = z.add(pan); // Mathjs library\n\n // Create a complex number based on our new XY values\n return z\n }", "title": "" }, { "docid": "ce238b7944fde7800cc2ba9207f7a194", "score": "0.5662791", "text": "function location(pos){\n return dimension * + Math.floor(-pos[2]) + Math.floor(pos[0]);\n}", "title": "" }, { "docid": "36f96b8b404cc2a00eeb93f3acdfcd23", "score": "0.564908", "text": "function physics2Origin(point){ return [point[0] - Globals.origin[0], point[1] - Globals.origin[1]]; }", "title": "" }, { "docid": "8f249bc3cf20bd42156874400397ebc4", "score": "0.5645887", "text": "function spherePointcloud(pointCount) {\n let points = [];\n for (let i = 0; i < pointCount; i++) {\n const r = () => Math.random() - 0.5 // -.5 <x<+.5\n\n const inputPoint = [r(), r(), r()];\n // const point = point(random);\n\n const outpointPoint = glMatrix.vec3.normalize(glMatrix.vec3.create(), inputPoint);\n\n points.push(...outpointPoint);\n }\n return points;\n}", "title": "" }, { "docid": "663f21dfd3711b4c1828310de8608c56", "score": "0.56386083", "text": "GetWorldPoint(viewPoint)\n {\n let worldx = this.wo.dx + viewPoint[0]/this.zoom.now;\n let worldy = this.wo.dy + viewPoint[1]/this.zoom.now; \n return [worldx,worldy];\n }", "title": "" }, { "docid": "eeab3beaea7336991e885c3bd4cb81cc", "score": "0.56244546", "text": "getCenterPoint() {\n return this.getIntermediatePoint(0.5);\n }", "title": "" }, { "docid": "5968dd5b8d6da0dbf72c478181a3e1e0", "score": "0.56139266", "text": "function getQuadrant(){\n var ns = \"S\";\n var ew = \"W\";\n var concat;\n\n if(pos.lat > 45.523063){\n ns = \"N\";\n }\n if(pos.lng > -122.667677){\n ew = \"E\";\n }\n concat = ns + ew;\n return concat;\n}", "title": "" }, { "docid": "d5b5c1d0009932671407b7048ed69218", "score": "0.5612122", "text": "circumcenter(ax, ay, bx, by, cx, cy) \n {\n bx -= ax;\n by -= ay;\n cx -= ax;\n cy -= ay;\n\n var bl = bx * bx + by * by;\n var cl = cx * cx + cy * cy;\n\n var d = bx * cy - by * cx;\n\n var x = (cy * bl - by * cl) * 0.5 / d;\n var y = (bx * cl - cx * bl) * 0.5 / d;\n\n return {\n x: ax + x,\n y: ay + y\n };\n }", "title": "" }, { "docid": "c687405a4b90aa5d8937bbf8a98859f7", "score": "0.56078386", "text": "function perp( v ) {\n let theta = -90 * Math.PI / 180;\n let cs = Math.cos(theta);\n let sn = Math.sin(theta);\n return {\n x: v.x * cs - v.y * sn,\n y: v.x * sn + v.y * cs,\n }\n}", "title": "" }, { "docid": "1238890d94600f3adf9983d8c1e69f6a", "score": "0.5606123", "text": "function coordonnees() {\n // code fictif\n return { x:25, y:12.5 };\n}", "title": "" }, { "docid": "a1178572dcf10929f59245b97c8e3809", "score": "0.56040573", "text": "function Vector4(x, y, z, w) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n }", "title": "" }, { "docid": "541aab2d17cf324b34203b1be27400d6", "score": "0.5603783", "text": "lngX(lon, worldSize) {\n return ((180 + lon) * (worldSize || this.worldSize)) / 360;\n }", "title": "" }, { "docid": "6b63afbca3fc6ae73469695c14cc16fd", "score": "0.5597898", "text": "function getPos(joint) {\n return createVector((joint.z * xscl) + xshift, (joint.x * yscl) + yshift);\n}", "title": "" }, { "docid": "93bb95bd37f8daf3612cd59f12cba8ff", "score": "0.55931926", "text": "function Vec4 (x, y, z, t) {\n this.x = x\n this.y = y\n this.z = z\n this.t = t\n}", "title": "" }, { "docid": "8a6a89bd93e9e5776ebeea8bf1d4135f", "score": "0.55928653", "text": "findCenter() {\n return {\n x: (this.right - this.left)/2 + this.left,\n y: (this.bottom - this.top)/2 + this.top\n };\n }", "title": "" }, { "docid": "d0010c03044c457888b745a0a4a6a0fd", "score": "0.5584235", "text": "function getRandomPosition(radius)\r\n{\r\n\tvar v = document.getElementById(\"offenseVis1\");\r\n\r\n\tvar minX = radius;\r\n\tvar minY = radius;\r\n\r\n\tvar maxX = (v ? v.clientWidth : 800) - radius - 60;\r\n\tvar maxY = (v ? v.clientHeight : 300) - radius - 60;\r\n\t\r\n\tvar position = {\r\n\t x: Math.floor(Math.random() * (maxX - minX) + minX),\r\n\t y: Math.floor(Math.random() * (maxY - minY) + minY),\r\n\t r: radius\r\n\t };\r\n\r\n\treturn position;\r\n}", "title": "" }, { "docid": "888727c6789d9063e097d7301782f35e", "score": "0.5582417", "text": "normalize() {\n\t\tlet m = this.getMagnitude();\n\t\tlet x = 0;\n\t\tlet y = 0\n\t\t\n\t\tif(m !== 0) {\n\t\t\tx = this.x / m;\n\t\t\ty = this.y / m;\n\t\t}\n\t\t\n\t\treturn new Vector(x, y);\n\t}", "title": "" }, { "docid": "a7559f1b19ab73faa5b86968adfc96bc", "score": "0.5578852", "text": "function Vector4( x, y, z, w ) {\n\n\tthis.x = x || 0;\n\tthis.y = y || 0;\n\tthis.z = z || 0;\n\tthis.w = ( w !== undefined ) ? w : 1;\n\n}", "title": "" }, { "docid": "00cd3ad036f5c5c58aa1ef169ae457eb", "score": "0.5577581", "text": "function moveTo(point) {\n return \" M\" + _utils_Math__WEBPACK_IMPORTED_MODULE_0__[\"round\"](point.x, 4) + \",\" + _utils_Math__WEBPACK_IMPORTED_MODULE_0__[\"round\"](point.y, 4) + \" \";\n}", "title": "" }, { "docid": "4a6011edcf27dd60fc259ce79472e583", "score": "0.5566778", "text": "function toPoint(p, s, d) {\n return [\n p[0] + s * d[0],\n p[1] + s * d[1]\n ];\n }", "title": "" }, { "docid": "aae6e364ed1caab3d3905bc90c228fda", "score": "0.55646217", "text": "function initPoints(){\n\n\tvar vertices = [];\n\n\tvertices.push( vec2( 0, 2/4 ) );\n\tvertices.push( vec2( 0.1/4, 1/4 ) );\n\tvertices.push( vec2( 0.4/4, 1/4 ) );\n\tvertices.push( vec2( 0, 4/4 ) );\n\tvertices.push( vec2( -1/4, -0.3/4 ) );\n\tvertices.push( vec2( -0.5/4, -0.5/4 ) );\n\n\treturn vertices;\n}", "title": "" }, { "docid": "eba825520f0dc2f88b5eb6ef0c760cd9", "score": "0.5557102", "text": "getCenter() {\n let point = L.CRS.EPSG3857.latLngToPoint(this.map.getCenter(), this.map.getZoom());\n let rMap = document.getElementById(this.id);\n if (rMap.clientWidth > rMap.clientHeight) {\n point.x -= this.map.getSize().x * 0.15;\n } else {\n //point.y += this.map.getSize().y * 0.15;\n }\n let location = L.CRS.EPSG3857.pointToLatLng(point, this.map.getZoom());\n return location;\n }", "title": "" }, { "docid": "0f296f37a92d701ccc4da56a3e604889", "score": "0.55542576", "text": "function gtaCoordToMap(x, y)\r\n{\r\n\tvar mapx = x * 0.03;\r\n\tvar mapy = y * 0.03;\r\n\treturn {x: mapx, y: mapy};\r\n}", "title": "" }, { "docid": "c739689f83a5673e59a4b18d2a77cd45", "score": "0.5553612", "text": "function pointOnCircle(posX, posY, radius, angle) {\n const x = posX + radius * p5.cos(angle)\n const y = posY + radius * p5.sin(angle)\n return p5.createVector(x, y)\n}", "title": "" }, { "docid": "f39289fe563925a9c162428d74c62da4", "score": "0.5552441", "text": "function proj(point) {\n // Shift the point by the camera's position.\n var shifted = [point[0] - camera[0], point[1] - camera[1], point[2] - camera[2]];\n // Rotate the point by the camera's rotation.\n var rotated = rotateX(\n rotateY(\n rotateZ(\n [shifted[0], shifted[1], shifted[2]],\n rotation[2]),\n rotation[1]),\n rotation[0]);\n if (rotated[2] <= 0 || rotated[2] > 100) {\n // Return false for points behind the camera or too far in front of it, which shouldn't be drawn.\n return false;\n }\n return [rotated[0] / rotated[2] * zoom, rotated[1] / rotated[2] * zoom];\n}", "title": "" }, { "docid": "d3e57af40b8e11dc598abd0e5bdeca75", "score": "0.5551251", "text": "getCenterPosition() {\n\t\tlet center = this.getCenter();\n\t\treturn {\n\t\t\tx: this.x + center.x,\n\t\t\ty: this.y + center.y\n\t\t};\n\t}", "title": "" }, { "docid": "df5e4bc0d840a556a1993b2d5fb7101b", "score": "0.5550825", "text": "function coords(box, { w, h }) {\n const [b1, b2, b3, b4] = box\n const round6 = (n) => (Math.round(n * 1000000) / 1000000).toFixed(6)\n const x = round6((b1 + b3) / 2 / w)\n const y = round6((b2 + b4) / 2 / h)\n const width = round6(Math.abs(b1 - b3) / w)\n const height = round6(Math.abs(b2 - b4) / h)\n\n return `${x} ${y} ${width} ${height}`\n}", "title": "" }, { "docid": "598af6753c19962ab403b11a905f78f0", "score": "0.55502784", "text": "function vector(angle, radius) {\n const offset = (angle === 30) ? [1, 2] : (angle === 90) ? [2, 0] : (angle === 120) ? [1, -2] : null;\n offset.forEach(function(value, i) { offset[i] *= radius; });\n return offset;\n}", "title": "" }, { "docid": "4b25abf59f76c93d9cd1671b668393d7", "score": "0.5549904", "text": "function origin2Physics(point){ return [point[0] + Globals.origin[0], point[1] + Globals.origin[1]]; }", "title": "" }, { "docid": "39917b47aa7f33b5d5c754e6ff0dd4eb", "score": "0.5549729", "text": "get vector4Value() {}", "title": "" }, { "docid": "9f870ca01891b61ad5a598d83f781688", "score": "0.5549123", "text": "function circle_center(px, py, qx, qy, rx, ry) {\n let v1 = sq(rx)+sq(ry)-sq(px)-sq(py);\n let v2 = sq(qx)+sq(qy)-sq(px)-sq(py);\n let y = (v1*(qx-px)-v2*(rx-px)) / (2*((rx-px)*(py-qy)-(py-ry)*(qx-px)));\n let x = (sq(qx)-sq(px)+sq(qy-y)-sq(py-y))/(2*(qx-px));\n let r = Math.sqrt(sq(px-x)+sq(py-y));\n //console.log([x, y, r]);\n return [x, y, r];\n}", "title": "" }, { "docid": "330f31abf0203e0a00de6ab1e5c41c23", "score": "0.5546355", "text": "function hexagon_points(x, y, r) {\n var sq = Math.sqrt(3) * 0.5;\n var rh = 0.5 * r;\n\n return [x, y-r, x+r*sq, y-rh, x+r*sq, y+rh, x, y+r, x-r*sq, y+rh, x-r*sq, y-rh];\n}", "title": "" }, { "docid": "4803faa02566797f2b49080b9edfd79c", "score": "0.5544207", "text": "get boxProjection() {}", "title": "" }, { "docid": "6e26b61913d8933a611164e80feff3b9", "score": "0.5544148", "text": "get center(): _Point {\n return Point(\n this.position.x + this.width / 2,\n this.position.y + this.height / 2\n )\n }", "title": "" }, { "docid": "cccaf5380a7cd0efb3cf1bc094e1538e", "score": "0.55346566", "text": "function appendCurrentVector(point){\r\n\t\tcurrent_vector.push(fill4DPoint(point));\r\n\t}", "title": "" }, { "docid": "513bedbdfe052a82d1863bc7800da92f", "score": "0.5533345", "text": "function findPixelPoint(scale, originLonglat, pointInPexel, rotationAngle) {\r\n console.log({pointInPexel})\r\n var pointInPexelToLongLat = [originLonglat[0]+(Number(pointInPexel[0])*scale[0]),originLonglat[1]+(Number(pointInPexel[1])*scale[1])]\r\n var newPoint = rotate(originLonglat[0], originLonglat[1], pointInPexelToLongLat[0], pointInPexelToLongLat[1], rotationAngle)\r\n console.log({newPoint})\r\n return [newPoint[0], newPoint[1]]\r\n }", "title": "" }, { "docid": "bed11adfeb5beba7a42c9b425c132892", "score": "0.553097", "text": "getExactPoint(x, y) {\n for (let i = 0; i < this.circleArray.length; i++) {\n if (x > this.circleArray[i].x - 30 && x < this.circleArray[i].x + 30 && y > this.circleArray[i].y - 30 && y < this.circleArray[i].y + 30) {\n return {\n x: this.circleArray[i].x,\n y: this.circleArray[i].y\n }\n\n }\n }\n }", "title": "" }, { "docid": "5cdc84d2347cb1d2ca50583244c69966", "score": "0.5529453", "text": "get centerPoint() {\n return {\n type : 'Point',\n geometry : {\n coordinates : this.center\n }\n };\n }", "title": "" }, { "docid": "5c7c45824744cf3415d643bc29d85089", "score": "0.55220354", "text": "getCenterX() {\n return this.x + this.width/2\n }", "title": "" }, { "docid": "eab9e9c0e8ac5d0c6ba0a8f6c45f5c0e", "score": "0.5521842", "text": "getCenterPoint() {\n var x1 = this.point1.getX();\n var y1 = this.point1.getY();\n var x2 = this.point2.getX();\n var y2 = this.point2.getY();\n var centerX = (x1 - x2) / 2 + x2;\n var centerY = (y1 - y2) / 2 + y2;\n return new Point2D({x: centerX, y: centerY});\n }", "title": "" }, { "docid": "afe8e359eb2dd48e3fadfb3e05351058", "score": "0.5517162", "text": "function nearestVertexCircle(vertex, size) {\n const point = Victor.fromObject(vertex);\n if ( point.length() > size) {\n let scale = size / point.length();\n return point.multiply(Victor(scale, scale));\n } else {\n return point;\n }\n}", "title": "" }, { "docid": "4618fb0bbe0814fea75d00fd68c99ec9", "score": "0.55112314", "text": "native () {\n // create new point\n const point = new SVGPoint()\n\n // update with current values\n point.x = this.x\n point.y = this.y\n\n return point\n }", "title": "" }, { "docid": "cd03bb83a6f035861a993a79d6bbdceb", "score": "0.5508554", "text": "function prepare(vector){var vertex=vector.normalize().clone();vertex.index = that.vertices.push(vertex) - 1; // Texture coords are equivalent to map coords, calculate angle and convert to fraction of a circle.\n\tvar u=azimuth(vector) / 2 / Math.PI + 0.5;var v=inclination(vector) / Math.PI + 0.5;vertex.uv = new THREE.Vector2(u,1 - v);return vertex;} // Approximate a curved face with recursively sub-divided triangles.", "title": "" }, { "docid": "07ab65acbf64a3e983622898ffd0dcea", "score": "0.55038834", "text": "transformPoint4(m, v, dest = math.vec4()) {\n dest[0] = m[0] * v[0] + m[4] * v[1] + m[8] * v[2] + m[12] * v[3];\n dest[1] = m[1] * v[0] + m[5] * v[1] + m[9] * v[2] + m[13] * v[3];\n dest[2] = m[2] * v[0] + m[6] * v[1] + m[10] * v[2] + m[14] * v[3];\n dest[3] = m[3] * v[0] + m[7] * v[1] + m[11] * v[2] + m[15] * v[3];\n\n return dest;\n }", "title": "" }, { "docid": "b3a835d55436ec8994d84ed8ca0b7d36", "score": "0.5500325", "text": "static getCoords(t, c, p) {\r\n\t\tlet m = MathTools.matMul(t.t, [\r\n\t\t\t[p.x],\r\n\t\t\t[p.y],\r\n\t\t\t[1]\r\n\t\t])\r\n\t\tm[0][0] += (t.x - c.x)\r\n\t\tm[1][0] += (t.y - c.y)\r\n\t\tm = MathTools.matMul(c.t, m)\r\n\t\treturn {\r\n\t\t\tx: m[0][0]+window.innerWidth/2,\r\n\t\t\ty: window.innerHeight - (m[1][0]+window.innerHeight/2)\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "cbe6e1705d2fcee759bbc25a96f70f7e", "score": "0.54950655", "text": "static adjust_point(view, [px, py]) {\n const scale = 2 ** view.scale;\n return [\n (px - view.origin[0]) * scale + view.width / 2,\n (py - view.origin[1]) * scale + view.height / 2,\n ];\n }", "title": "" }, { "docid": "8e3b99171ebec50d8f2672e09c38044d", "score": "0.5489882", "text": "static pointBox(x, y) {\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t};\n\t}", "title": "" }, { "docid": "1bddc10447ebfb58afc0b42983180f53", "score": "0.54890764", "text": "function findPointOnLand(){\n\n raster_northpole.on('load', function() {\n\n var count = 0;\n do {\n var vec = new Point(randPlusMinusOne()*212*ratio)*Point.random() + view.center; // \"212*ratio\" because 212*ratio ~ (((300*ratio)^2)/2)^0.5 \n var color = raster_northpole.getPixel(vec.x, vec.y);\n console.log('findPointOnLand - color: ' + color + ', vec(x,y): vec('+vec.x+','+vec.y+'), vec: ' + JSON.stringify(vec));\n\n var path = new Path.Circle(vec, 5);\n path.fillColor = 'green';\n group.addChild(path);\n\n ++count;\n } while(count < 20);\n\n });\n}", "title": "" }, { "docid": "c805ebce57c575c1fba0e14bea93669f", "score": "0.54880804", "text": "function getCenterXY() {\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar $this = sets.element;\r\n\t\tvar centerx = ($this.innerWidth()/2)-parseInt($('#inner').css('left'));\r\n\t\tvar centery = ($this.innerHeight()/2)-parseInt($('#inner').css('top'));\r\n\t\treturn new Point(centerx,centery);\r\n\t}", "title": "" }, { "docid": "11c9228afc4d95986f9d21c9d85cea87", "score": "0.54783225", "text": "normalizeToCorner( point, el ) {\n\t\t\treturn new Three.Vector2(\n\t\t\t\tpoint.x * (el.clientWidth / 2) + el.clientWidth / 2,\n\t\t\t\t-1 * point.y * (el.clientHeight / 2) + el.clientHeight / 2\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "6ad47b66ffb0347d76beb87c0ad0dc5b", "score": "0.54751766", "text": "function randomPoint(){\n\tx =(Math.random()*200)-100;\n\ty =(Math.random()*200)-100;\n\n\treturn new Point(x,y);\n}", "title": "" }, { "docid": "ff8bca7de767a3c4ed5aa77ea73156c0", "score": "0.5471344", "text": "function normalize(point) {\n let x = point.x;\n let y = point.y;\n let bSquared = (x * x) + (y * y);\n let mag = Math.sqrt(bSquared);\n point.x = x / mag;\n point.y = y / mag;\n return point;\n}", "title": "" }, { "docid": "bc8cf805c2628c6e648f2ffbb073c67e", "score": "0.54703397", "text": "function proj(coord){\n var x = (coord[0] - min_lon) / lon_width;\n var y = (coord[1] - min_lat) / lat_width;\n\n return [x * width, y * height]; \n}", "title": "" }, { "docid": "628e34430f095136e8d2982cdcb9dbee", "score": "0.5465863", "text": "static sq(v) {\n\t\treturn new vector(v.x*v.x, v.y*v.y)\n\t}", "title": "" }, { "docid": "c65170545d40271538216d77d4a38be0", "score": "0.5463046", "text": "function g4(param) {\n var ref = _slicedToArray(param === void 0 ? [\n 0\n ] : param, 2), x = ref[0], tmp = ref[1], y = tmp === void 0 ? 0 : tmp;\n}", "title": "" }, { "docid": "e2d777496062872d99a4a44834ebc591", "score": "0.5453", "text": "setupCoordinates(){\n // Start the circle off screen to the bottom left.\n // We divide the size by two because we're drawing from the center.\n this.xPos = -circleSize / 2;\n this.yPos = height + circleSize / 2;\n }", "title": "" }, { "docid": "9e2d33083c49d3cef4dcea3c97b8cc33", "score": "0.5447096", "text": "function xLng(x) {\n return (x - 0.5) * 360;\n}", "title": "" }, { "docid": "9e2d33083c49d3cef4dcea3c97b8cc33", "score": "0.5447096", "text": "function xLng(x) {\n return (x - 0.5) * 360;\n}", "title": "" }, { "docid": "9e2d33083c49d3cef4dcea3c97b8cc33", "score": "0.5447096", "text": "function xLng(x) {\n return (x - 0.5) * 360;\n}", "title": "" }, { "docid": "9e2d33083c49d3cef4dcea3c97b8cc33", "score": "0.5447096", "text": "function xLng(x) {\n return (x - 0.5) * 360;\n}", "title": "" }, { "docid": "9e2d33083c49d3cef4dcea3c97b8cc33", "score": "0.5447096", "text": "function xLng(x) {\n return (x - 0.5) * 360;\n}", "title": "" }, { "docid": "9e2d33083c49d3cef4dcea3c97b8cc33", "score": "0.5447096", "text": "function xLng(x) {\n return (x - 0.5) * 360;\n}", "title": "" }, { "docid": "9e2d33083c49d3cef4dcea3c97b8cc33", "score": "0.5447096", "text": "function xLng(x) {\n return (x - 0.5) * 360;\n}", "title": "" }, { "docid": "9e2d33083c49d3cef4dcea3c97b8cc33", "score": "0.5447096", "text": "function xLng(x) {\n return (x - 0.5) * 360;\n}", "title": "" } ]
d92054e41970fd3f12ab653d8a712712
below function to schedule and set alert if the task is not done in time
[ { "docid": "88677a9512969c545580255604a6e579", "score": "0.0", "text": "scheduleHabit() {\n if(requestIdleCallback in window){\n requestIdleCallback(\"Habit\", { timeout: 3000}); \n }\n else{\n while(habit.length)\n setTimeout(habit.shift(), 1);\n }\n function habit(deadline){\n while(deadline.timeRemaining() > 0 && habit.length > 0) {\n habit.shift()(); \n }\n if(habit.length > 0) {\n requestIdleCallback(habit); \n }\n }\n }", "title": "" } ]
[ { "docid": "d29ee25af72d7a84c2e2ccd61e50a5d1", "score": "0.68125033", "text": "scheduleTask() {\n for (let y = new Date().getFullYear(); y < new Date().getFullYear() + 100; y++) {\n for (let m = 0; m < 12; m++) {\n if (this.date <= Time.daysInMonth(m, y)) {\n let newTask = new Window(this.taskName, y, m, d, this.startTime, this.endTime, 1);\n if (newTask.duringSleep()) {\n //TODO: window.alert(\"Do you really want to schedule tasks during your sleep time?\"); Basically if yes, continue. If no, return.\n }\n if (!newTime.isPast()) {\n newTask.insertWindow();\n }\n } \n }\n }\n }", "title": "" }, { "docid": "413349456a67ccdfc75756d8e8e31b2f", "score": "0.6764262", "text": "callback(task) {\n // code to be executed on each run\n async function AutoSTC() {\n console.log(`System ${task.id}`);\n await bott.AutoSwapTransferAndClaim();\n }\n if (document.getElementById('auto-SwapTransfer').checked == true || document.getElementById('auto-claimnfts').checked == true) {\n if (TimeWaitz > 200) {\n AutoSTC()\n } else if (document.getElementById('auto-SwapTransfer').checked == true) {\n bott.appendMessage(`Status : Swap-Transfer Time left < 100sec [NOT PASS])`)\n } else if (document.getElementById('auto-claimnfts').checked == true) {\n bott.appendMessage(`Status : Auto Claims Time left < 100sec [NOT PASS])`)\n }\n }\n }", "title": "" }, { "docid": "6794c1088d57ba3e9302f4e6b5f3ce52", "score": "0.6709523", "text": "callback(task) {\n // code to be executed on each run \n //console.log(`${task.id} task has run times.${Math.ceil(task.totalRuns - task.currentRuns)}`);\n if (bott.counttimestop == false) {\n document.getElementById(\"text-cooldown\").innerHTML = `Countdown : ${Math.ceil(task.totalRuns - task.currentRuns)} Sec`;\n document.getElementsByTagName('title')[0].text = `${wax.userAccount} - ${Math.ceil(task.totalRuns - task.currentRuns)} Sec`\n } else {\n timer.reset();\n }\n }", "title": "" }, { "docid": "948736e81b73a6cd6fbf2e3ff7c4b441", "score": "0.66044825", "text": "scheduleTask() { \n for (let y = new Date().getFullYear(); y < new Date().getFullYear() + 100; y++) {\n for (let m = 0; m < 12; m++) {\n for (let d = 1; d <= Time.daysInMonth(m, y); d++) {\n let newTask = new Window(this.taskName, y, m, d, this.startTime, this.endTime, 1);\n if (newTask.duringSleep()) {\n //TODO: window.alert(\"Do you really want to schedule tasks during your sleep time?\"); Basically if yes, continue. If no, return.\n }\n if (!newTask.isPast()) {\n newTask.insertWindow();\n }\n } \n }\n }\n }", "title": "" }, { "docid": "971e1130fdb756161b11696baa752730", "score": "0.6569511", "text": "scheduleTask() { \n for (let y = new Date().getFullYear(); y < new Date().getFullYear() + 100; y++) {\n for (let m = 0; m < 12; m++) {\n for (let d = WeeklyTask.startingDate(y, m, this.day); d <= Time.daysInMonth(m, y); d += 7) {\n let newTask = new Window(this,taskName, y, m, d, this.startTime, this.endTime, 1);\n if (newTask.duringSleep()) {\n //TODO: window.alert(\"Do you really want to schedule tasks during your sleep time?\"); Basically if yes, continue. If no, return.\n }\n // Only scheduling tasks for the present and the future\n if (!newTime.isPast()) {\n newTask.insertWindow();\n }\n } \n }\n }\n }", "title": "" }, { "docid": "f2a2158fcfc21cc73a6ccc3887525ceb", "score": "0.64920324", "text": "function check_schedule(){\n schedule_ok = true;\n unlock_submit();\n}", "title": "" }, { "docid": "c57655777005aa7f936c8bcec5af6343", "score": "0.6485659", "text": "scheduleTask() { \n let previousDate = this.previousDate();\n for (let y = new Date().getFullYear(); y < new Date().getFullYear() + 100; y++) {\n for (let m = 0; m < 12; m++) {\n for (let d = BiweeklyTask.startingDate(y, m, this.day, previousDate); d <= Time.daysInMonth(m, y); d += 14) {\n let newTask = new Window(this.taskName, y, m, d, this.startTime, this.endTime, 1);\n if (newTask.duringSleep()) {\n //TODO: window.alert(\"Do you really want to schedule tasks during your sleep time?\"); Basically if yes, continue. If no, return.\n }\n // Only scheduling tasks for the present and the future\n if (!newTask.isPast()) {\n newTask.insertWindow();\n previousDate = d\n }\n }\n } \n }\n }", "title": "" }, { "docid": "38ab2ba78a89c66c39fde9f5333557d1", "score": "0.64399606", "text": "callback(task) {\n // code to be executed on each run\n timer.reset();\n console.log(`System ${task.id}`);\n document.getElementById(\"text-cooldown\").innerHTML = \"Countdown : CheckCPU..\"\n document.getElementsByTagName('title')[0].text = `${wax.userAccount} - CheckCPU..`\n document.getElementById(\"btn-mine\").disabled = false\n async function CPUchecking() {\n await bott.CPUchecked();\n }\n CPUchecking();\n }", "title": "" }, { "docid": "b80fcb3da9b175bebb0d5d68e05bd463", "score": "0.63988423", "text": "function scheduleReminders(phoneNum, hour, min) {\n console.log(\"scheduling daily reminders\"); \n\n patientJobs.add(`${phoneNum}-medRemJob`, `0 ${min} ${hour} */1 * *`, async function() {\n // Check if patient took medications today \n console.log(\"checking to send first reminder\"); \n const tookMeds = await hasTakenMeds(phoneNum); \n console.log(tookMeds); \n\n if(!tookMeds) {\n const remMsgs = specialTexts.reminders; \n const msgIdx = Math.floor(Math.random() * remMsgs.length); \n const msg = remMsgs[msgIdx]; \n\n qText(phoneNum, msg); \n }\n\n }, { timeZone: \"America/New_York\" }); \n patientJobs.start(`${phoneNum}-medRemJob`);\n\n}", "title": "" }, { "docid": "671e6c2ab61780b56137bf9e3da28cbc", "score": "0.6396856", "text": "function scheduleFinalFollowUps(phoneNum, hour, min) {\n console.log(\"scheduling final follow up text\"); \n\n\n patientJobs.add(`${phoneNum}-finalRemJob`, `0 ${min} ${hour} */1 * *`, async function() {\n console.log(\"checking to send third reminder\"); \n const tookMeds = await hasTakenMeds(phoneNum); \n console.log(tookMeds); \n\n // If patient didn't take medications today \n if(!tookMeds) {\n const daysInCrisis = await inCrisis(phoneNum); \n console.log(`crisis day: ${daysInCrisis}`); \n // Send crisis message \n let crisisMsg = \"\"; \n if(daysInCrisis % 3 == 1) crisisMsg = specialTexts.crisis1[0]; \n else if(daysInCrisis % 3 == 2) crisisMsg = specialTexts.crisis2[0]; \n else if(daysInCrisis % 3 == 0) crisisMsg = specialTexts.crisis3[0]; \n\n // Parse for emergency contact name \n crisisMsg = await parseNAME(phoneNum, crisisMsg); \n\n qText(phoneNum, crisisMsg); \n\n // Check to send opt out message \n if(daysInCrisis % 3 == 0) {\n const optOutMsg = specialTexts.optOutMsg[0]; \n qText(phoneNum, optOutMsg); \n }\n }\n }, { timeZone: \"America/New_York\" }); \n patientJobs.start(`${phoneNum}-finalRemJob`);\n\n\n\n}", "title": "" }, { "docid": "329fc644d09f203aba7a3cb3af31bc31", "score": "0.62964195", "text": "function scheduleFollowUps(phoneNum, hour, min) {\n console.log(\"scheduling daily follow up text\"); \n\n patientJobs.add(`${phoneNum}-folRemJob`, `0 ${min} ${hour} */1 * *`, async function() {\n // Check if patient took medications today \n console.log(\"checking to send second reminder\"); \n const tookMeds = await hasTakenMeds(phoneNum); \n console.log(tookMeds); \n\n if(!tookMeds) {\n // Send follow up message \n const folUpMsgs = specialTexts.medFollowUp; \n const msgIdx = Math.floor(Math.random() * folUpMsgs.length); \n const msg = folUpMsgs[msgIdx]; \n\n qText(phoneNum, msg); \n }\n }, { timeZone: \"America/New_York\" }); \n patientJobs.start(`${phoneNum}-folRemJob`);\n\n}", "title": "" }, { "docid": "0aff974a2fe4b8e7d7534c141f5bbd1a", "score": "0.62798464", "text": "callback(task) {\n if (bott.waitNoceMine == true) {\n console.log(`${task.id} Reload.`);\n location.reload();\n } else {\n timerNonceReload.stop()\n }\n }", "title": "" }, { "docid": "e336f90c8ae54ce581b8275240e336ca", "score": "0.6276569", "text": "async checkSchedule() {\n //Check settings and temp scheduled restart\n let nextRestart;\n if (this.nextTempSchedule) {\n nextRestart = this.nextTempSchedule;\n } else if (Array.isArray(this.config.restarterSchedule) && this.config.restarterSchedule.length) {\n const { valid } = parseSchedule(this.config.restarterSchedule);\n nextRestart = getNextScheduled(valid);\n } else {\n //nothing scheduled\n this.calculatedNextRestartMinuteFloorTs = false;\n return;\n }\n this.calculatedNextRestartMinuteFloorTs = nextRestart.minuteFloorTs;\n\n //Checking if skipped\n if (this.nextSkip === this.calculatedNextRestartMinuteFloorTs) {\n console.verbose.log(`Skipping next scheduled restart`);\n return;\n }\n\n //Calculating dist\n const thisMinuteTs = new Date().setSeconds(0, 0);\n const nextDistMs = nextRestart.minuteFloorTs - thisMinuteTs;\n const nextDistMins = Math.floor(nextDistMs / 60_000);\n\n //Checking if server restart or warning time\n if (nextDistMins === 0) {\n //restart server\n this.restartFXServer(\n `scheduled restart at ${nextRestart.string}`,\n globals.translator.t('restarter.schedule_reason', { time: nextRestart.string }),\n );\n\n //reset next scheduled\n this.nextTempSchedule = false;\n\n } else if (scheduleWarnings.includes(nextDistMins)) {\n const tOptions = {\n smart_count: nextDistMins,\n servername: globals.config.serverName,\n }\n\n //Send discord warning\n globals.discordBot.sendAnnouncement({\n type: 'warning',\n description: {\n key: 'restarter.schedule_warn_discord',\n data: tOptions\n }\n });\n\n //Dispatch `txAdmin:events:scheduledRestart` \n globals.fxRunner.sendEvent('scheduledRestart', {\n secondsRemaining: nextDistMins * 60,\n translatedMessage: globals.translator.t('restarter.schedule_warn', tOptions)\n });\n }\n }", "title": "" }, { "docid": "8a9fcdf2b9f15002be4a1693c50ada6b", "score": "0.6163922", "text": "schedule() {}", "title": "" }, { "docid": "d81cca701e6288947d8169cdee5c9fda", "score": "0.61512566", "text": "setFaildTask(task){\n var date1 = new Date(task.due_date);\n var date2 = new Date(Date.now());\n var diffDays = this.dateDiffInDays(date1, date2);\n if(task.status == 'new'){\n if (diffDays < 0 ){this.failedTask(task.id);this.failedTODO(this.props.id);}\n else {\n if ( diffDays < 7 ){\n console.log('ok');\n return true;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "e9e88100fe48a8905effa274b020966d", "score": "0.6070124", "text": "function pvpTimer() {\n var pvpA = new schedule.RecurrenceRule();\n var pvpB = new schedule.RecurrenceRule();\n pvpA.hour = 13; // JST 03:00 (alert at 02:00)\n pvpB.hour = 1; // JST 15:00 (alert at 14:00)\n pvpA.minute = 0;\n pvpB.minute = 0;\n\n var pvpSetA = schedule.scheduleJob(pvpA, function() {\n var msg = \":crossed_swords: **PVP ALERT** :crossed_swords:\\nSET A RESETS IN ONE HOUR\";\n beaver.createMessage(db.pvpAlert.channel, msg);\n pvpAlert('A');\n console.log(\"[\" + moment().format() + \"]\" + \"pvp alert sent\")\n });\n\n var pvpSetB = schedule.scheduleJob(pvpB, function() {\n var msg = \":crossed_swords: **PVP ALERT** :crossed_swords:\\nSET B RESETS IN ONE HOUR\";\n beaver.createMessage(db.pvpAlert.channel, msg);\n pvpAlert('B');\n console.log(\"[\" + moment().format() + \"]\" + \"pvp alert sent\")\n });\n }", "title": "" }, { "docid": "1c924312003a4246461634696662b0fe", "score": "0.6019602", "text": "function taskStartCallback(taskName) {\n // do something \n currentTask = taskName;\n for(var i = 0; i < tasks.length; i++){\n if(tasks[i] == currentTask){\n if(currentStatus != null){\n status.removeItem(currentStatus);\n currentStatus = null;\n }\n timeStarted = new Date().getTime();\n currentStatus = status.addItem(currentTask, { type : ['text', function(){\n return parseInt((new Date().getTime() - timeStarted) / 1000) + 's'\n }]});\n break;\n }\n }\n //status.addItem(currentTask, { type : ['bar', 'percentage']});\n }", "title": "" }, { "docid": "c047fc5161b61d4ed1c1d50d29c5a5b0", "score": "0.5982662", "text": "function recurTask(){\n\tconsole.log(\"Starting cron tasks!\")\n\tvar daily_update = schedule.scheduleJob(rule, function(){\n\t\tconsole.log(\"Updating user facing \" + Date.now())\n\t\tvar usersPromise = db_utils.getUsers()\n\t\tusersPromise.then(function(users){\n\t\t\tfor (var id in users){\n\t\t\t\tvar hour = users[id].rec_time['hour']\n\t\t\t\tvar minute = users[id].rec_time['minute']\n\t\t\t\tconsole.log(users[id].rec_time['hour'])\n\n\t\t\t\tvar userReminderRule = new schedule.RecurrenceRule();\n\t\t\t\tuserReminderRule.hour = hour\n\t\t\t\tuserReminderRule.minute = minute\n\n\t\t\t\tvar userRandomMessageRule = new schedule.RecurrenceRule();\n\t\t\t\t// Only show random messages between 9 AM and 9 PM\n\t\t\t\tvar max = 21;\n\t\t\t\tvar min = 9;\n\n\t\t\t\tuserRandomMessageRule.hour = Math.floor(Math.random()*(max - min)) + min;\n\n\t\t\t\t// userRandomMessageRule.hour = 17;\n\t\t\t\t// userRandomMessageRule.minute = 21;\n\n\n\t\t\t\t// Adding 1 day in MS = 86400000\n\n\n\t\t\t\tvar userReminderSend = schedule.scheduleJob({end: new Date(Date.now() + 86400000), rule: userReminderRule}, function(){\n\t\t\t\t\t\tconsole.log(\"Test! Id is: \" + id + \" and displaying a reminder\")\n\t\t\t\t\t\tfacebook_parser.sendFacebookMessage(id,\"Hoping you had a lovely day! Even if you didn’t (and not all days are!), think back to everything you did today. What’s something you’re grateful for?\")\n\t\t\t\t\t\tfacebook_parser.sendFacebookMessage(id,\"Enter in as many things as you'd like. I'll save them all!\")\n\t\t\t\t})\n\n\t\t\t\tvar userMessageSend = schedule.scheduleJob({end: new Date(Date.now() + 86400000), rule: userRandomMessageRule}, function(){\n\t\t\t\t\t\t// Extract and send a random past message\n\t\t\t\t\t\tvar userMessagePromise = db_utils.getRandomEntry(id)\n\t\t\t\t\t\tuserMessagePromise.then(function(message){\n\t\t\t\t\t\t\tconsole.log(\"Sending a message from the past at a random time!!\")\n\t\t\t\t\t\t\tfacebook_parser.sendFacebookMessage(id,\"Hey there, hope you’re having a lovely day.\")\n\t\t\t\t\t\t\tvar send_message = \"I wanted to remind you of something you were grateful for on \"+message.createdAt.toDateString()+\". You wrote the following: \"\n\t\t\t\t\t\t\tfacebook_parser.sendFacebookMessage(id, send_message)\n\t\t\t\t\t\t\tfacebook_parser.sendFacebookMessage(id, message)\n\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t}, function(err){\n\t\t\tconsole.log(err);\n\t\t})\n\n\t})\n\n}", "title": "" }, { "docid": "e0c87b20c35ce0a79a5e0081fcc51d4b", "score": "0.59610915", "text": "function setAlarm(e) {\r\n e.preventDefault();\r\n const alarm = document.getElementById('alarm');\r\n alarmDate = new Date(alarm.value);\r\n console.log(`Setting Alarm for ${alarmDate}...`);\r\n now = new Date();\r\n\r\n let timeToAlarm = alarmDate - now;\r\n console.log(timeToAlarm);\r\n if(timeToAlarm>=0){\r\n setTimeout(() => {\r\n console.log(\"Ringing now\")\r\n ringBell();\r\n }, timeToAlarm);\r\n }\r\n}", "title": "" }, { "docid": "d1ece78c84bbee6efb64ff72e7e39b60", "score": "0.59552616", "text": "function setAlarm(e) {\r\n e.preventDefault();\r\n const alarm = document.getElementById('alarm');\r\n alarmDate = new Date(alarm.value);\r\n\r\n var hour = alarmDate.getHours();\r\n var min = alarmDate.getMinutes();\r\n var sec = alarmDate.getSeconds();\r\n let timeofDay = (hour < 12) ? \"AM\" : \"PM\"\r\n\r\n // console.log(`Setting Alarm for ${alarmDate}...`);\r\n now = new Date();\r\n\r\n let timeToAlarm = alarmDate - now;\r\n\r\n document.getElementById(\"message\").innerHTML = \"You alarm is set on : \" + hour + \" : \" + min + \" : \" + sec + \" \" + timeofDay;\r\n // console.log(timeToAlarm);\r\n if (timeToAlarm >= 0) {\r\n setTimeout(() => {\r\n // console.log(\"Ringing now\")\r\n ringBell();\r\n }, timeToAlarm);\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "fe92b363443794e20e71df81185e7848", "score": "0.59263295", "text": "runETLFirstTime() {\n expect(etlTasks.runETLJob()).to.equal(true);\n }", "title": "" }, { "docid": "b3917d51ced26f90c8516ea0afe15f48", "score": "0.5914622", "text": "runNotify() {\n // Notify only animes for now only since mangas don't have this feature implemented yet.\n const type = true;\n \n console.log('Notify starting up.');\n\n // Runs each half hour -- since most of animes are released in hours like 12:00 or 12:30.\n const process = schedule.scheduleJob('00,30 * * * *', () => {\n const serverTime = new Date(Date.now());\n console.log(`[${serverTime.toString()}] Running content notifications.`);\n\n // Verifies all content that time of release is less or equal to actual server time - meaning tha episode is\n // already released.\n Notifications.find({type}).where('time').lte(serverTime).then(content => {\n // Notify only if there's any content to be notified.\n if(0 < content.length) {\n content.forEach(element => {\n // Notify all users upon new releases.\n this.notifySubscriptions(element._id, type);\n // Update relase time\n searchAnimeRelaseDate(element._id).then(time => {\n // update to next release.\n if(time)\n return element.update({time}).then(counter => {\n return (counter) ? true : false;\n }).catch(error => {throw error;});\n // or remove it in case it's finished -- or cancelled.\n else\n return element.remove().then(counter => {\n return (counter) ? true : false;\n }).catch(error => {throw error;});\n }).catch(error => {throw error;});\n });\n }\n else\n console.log('No available notifications in content.');\n }).catch(error => {\n console.log('[Error] runNotify content:', error);\n process.cancel();\n });\n });\n\n // Runs each hour.\n const later = schedule.scheduleJob('00 * * * *', () => {\n const laterTime = new Date(Date.now());\n console.log(`[${laterTime.toString()}] Running user notifications.`);\n \n // Verifies only the users whom seted this hour to be notified. Why comparing with a new date? Because\n // laterTime won't match because of miliseconds offset.\n User.find({notify: true}).where('time').equals(moment(laterTime).seconds(0).milliseconds(0).toISOString())\n .then(users => {\n if(0 < users.length) {\n // All user that have notifications to this time will be notified.\n this.notifyInTime(users);\n\n // Why updates all users that have this time for notifications even those who weren't notified now?\n // If those users who weren't notified today have notifications for tomorrow they won't be notified\n // because they time would not match with the server, even thought they have notifications -- that's\n // why the need to update it.\n users.forEach(user => {\n user.time = setNextDay(user.time, user.timezone);\n user.save().catch(error => {throw error;});\n });\n }\n\n else\n console.log('No users to be notified.');\n }).catch(error => {\n console.log('[Error] runNotify user:', error);\n later.cancel();\n });\n });\n }", "title": "" }, { "docid": "b9ad908ab60a6a02186dd2d4feee212d", "score": "0.5912758", "text": "createAlarm(){\n chrome.alarms.create('getTasks', {periodInMinutes: 1}); \n chrome.alarms.create('checkNewJobs', {periodInMinutes: 3}); \n }", "title": "" }, { "docid": "edeb62c554971d7c08d94d755f3f9388", "score": "0.58600676", "text": "function affirmOnTask(task) {\n task.affirmCount++;\n task.backoffIndex = Math.min(task.incrementalBackoffSet.length - 1, task.backoffIndex + 1);\n showTempMessage(\"Great job!\", \"On Task!\", () => startTask(task));\n}", "title": "" }, { "docid": "8cab1cdf86cee87dbec7dde92fdf3439", "score": "0.5853729", "text": "async function checkStartWorking () {\n try {\n let stateToday = await isStartWorkingToday();\n if (stateToday){\n let checkin = await getCheckInTime();\n console.log(checkin);\n setStartTime(checkin);\n setWorking(true);\n } else {\n getTodayData(); \n }\n } catch (error) {\n console.log('Check start working error');\n }\n }", "title": "" }, { "docid": "d9c52825f444a7dbc19619c2318ac7ba", "score": "0.5786149", "text": "function notifyTask(data) {\n nwNotify.notify({ title: 'Notification', text: data.assignerName + \" assigned you task : \" + data.taskName });\n // populate tasks\n getAllUserTasks();\n }", "title": "" }, { "docid": "66d92d57f7986cf502ef9fb1775a7ad0", "score": "0.5755504", "text": "function taskDeadlineDate(message) {\n message.reply(\n \"Would you like to add a deadline date?\\n\" +\n \"Confirm with `yes` or deny with `no`.\\n\" +\n \"You have 30 seconds or else Task will not be made.\\n\"\n );\n\n message.channel.awaitMessages((m) => m.author.id == message.author.id, {max: 1,time: 30000,})\n .then((collected) => {\n if (collected.first().content.toLowerCase() === \"yes\") {\n handleDeadlineDateInput(message);\n } else if (collected.first().content.toLowerCase() === \"no\") {\n finalConfirmation(message);\n } else {\n message.reply('That is not a valid response\\n' + 'Please re enter confirmation');\n taskDeadlineDate(message);\n }\n })\n .catch(() => {\n message.reply(\"No answer after 30 seconds, operation canceled.\");\n });\n}", "title": "" }, { "docid": "1fedc6b32b6961b39bee7acc286523a7", "score": "0.5748317", "text": "isScheduled() {\n return this.timeoutToken !== -1;\n }", "title": "" }, { "docid": "202cc1aca1a9e77c9bf378596c180959", "score": "0.5725363", "text": "function manualScheduler() {\n\t$.ajax({\n\t\turl : \"/manage/\", // the endpoint\n\t\ttype : \"GET\", // http method\n\t\t// handle a successful response\n\t\tsuccess : function(response) {\n\t\t\tupdateNumOfNotf();\n\t\t\tupdateNumOfMsg();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "18321296682260011fa4a07351b59764", "score": "0.57206184", "text": "function checkSchedule(){\r\n var theDate = getTheDate();\r\n var dayOfWeek = theDate.getDay();\r\n \r\n if(theDate.getHours() >= 1 && theDate.getHours() < 8 && dayOfWeek > 0 && dayOfWeek < 6 ){// turn off heater and turn off manual control\r\n manualOn = false;\r\n console.log(\"Schedule checked: heater turned off between 1:00 and 8:00 from monday to friday.\");\r\n return false;\r\n }\r\n \r\n if(theDate.getHours() === 8 && theDate.getMinutes() <= 30 && dayOfWeek > 0 && dayOfWeek < 6 ){// turn on heater and turn off manual control\r\n console.log(\"Schedule checked: heating turned on between 8:00 and 8:30 from monday to friday.\");\r\n manualOn = false;\r\n return true;\r\n }\r\n \r\n if(theDate.getHours() === 8 && theDate.getMinutes() > 30 && dayOfWeek > 0 && dayOfWeek < 6 ){// turn off heater and turn off manual control\r\n console.log(\"Schedule checked: turning heater off again after morning heating period.\");\r\n manualOn = false;\r\n return false;\r\n }\r\n \r\n // nothing sheduled\r\n var strHeaterIsOn = heaterIsOn ? \"on\" : \"off\";\r\n console.log(\"Schedule checked: nothing scheduled, setting heater to user choice (\" + strHeaterIsOn + \").\");\r\n return heaterIsOn; // turn on\r\n}", "title": "" }, { "docid": "ab27844bd114e0c99cf2e1a716b80f65", "score": "0.57090807", "text": "function sendReminder() {\n return setInterval(waterBreak, 3000);//every 3 seconds as of now\n}", "title": "" }, { "docid": "651a09ef052256cd6bb743eca0b5d344", "score": "0.5701577", "text": "function handleTimerMacrotask() {\n if (pendingFireTimers.length > 0) {\n fire(pendingFireTimers.shift());\n return pendingFireTimers.length === 0;\n }\n return true;\n }", "title": "" }, { "docid": "e1e537d8e7990ca008d3b2b5b1b703a2", "score": "0.5673933", "text": "function schedule(){\n document.getElementById(\"schedule-btn\").innerHTML=\"Please Wait!!\";\n document.getElementById(\"schedule-btn\").disabled = true;\n\n var beginDate = document.getElementById(\"beginDate\").value;\n beginDate = beginDate.split(\"-\");\n beginDate = new Date( beginDate[0], beginDate[1] - 1, beginDate[2]);\n beginDate = beginDate.getTime();\n\n var beginTime = document.getElementById(\"beginTime\").value;\n beginTime = beginTime.split(\":\");\n beginTime = beginTime[0]*60*60+beginTime[1]*60;\n beginTime = beginTime * 1000;\n\n var endDate = document.getElementById(\"endDate\").value;\n endDate = endDate.split(\"-\");\n endDate = new Date( endDate[0], endDate[1] - 1, endDate[2]);\n endDate = endDate.getTime();\n\n var endTime = document.getElementById(\"endTime\").value;\n endTime = endTime.split(\":\");\n endTime = endTime[0]*60*60+endTime[1]*60;\n endTime = endTime * 1000;\n \n var totalBeginTime = beginDate + beginTime;\n var totalEndTime = endDate + endTime;\n\n if(totalEndTime<totalBeginTime)\n {\n alert('Enter Valid Time!');\n return;\n }\n \n var intervieews = document.getElementById(\"justAnInputBox\").value;\n intervieews = intervieews.split(\", \");\n\n const url = '/schedule-interview';\n fetch(url, {\n method: \"POST\",\n body: JSON.stringify({\n \"intervieews\" : intervieews,\n \"totalBeginTime\" : totalBeginTime,\n \"totalEndTime\" : totalEndTime\n }),\n headers: {\n \"Content-type\": \"application/json; charset=UTF-8\"\n }\n })\n .then(response => response.json()) \n .then((data) => {\n if(!!data.message){\n document.getElementById(\"schedule-btn\").innerHTML=\"Schedule Again!!\";\n document.getElementById(\"schedule-btn\").disabled = false;\n alert(data.message);\n }\n else if(!!data.data.error){\n document.getElementById(\"schedule-btn\").innerHTML=\"Schedule Again!!\";\n document.getElementById(\"schedule-btn\").disabled = false;\n alert('error = '+ data.data.error + '. Conflicting intervieews are : ' + data.data.conflicting_intervieews);\n \n }\n else{\n alert('Successfully registered your meeting!');\n window.location.href = \"https://manage-interviews.herokuapp.com/show_all_interviews\";\n }\n \n })\n\n}", "title": "" }, { "docid": "c9798edd5912e9a7ef85c20b8ec0ef18", "score": "0.56662714", "text": "function handleConfirmation(thread, { phrase, data }) {\n return new Promise((resolve, reject) => {\n let time = new Date(thread.getData(\"time\"));\n let text = thread.getData(\"text\");\n\n // Close Thread.\n let response = \"Aborted\";\n if ([\"oui\", \"yes\", \"o\", \"oui!\", \"yes!\"].includes(phrase)) {\n response = \"Ok! Alarm set today at \" + time.toLocaleTimeString()\n }\n\n overseer.HookManager.create(\"alarms\").then((hook) => {\n schedule.scheduleJob(time, () => {\n overseer.HookManager.execute(hook._id, {\n message: {\n title: \"Alarm\",\n text: text,\n hook_id: hook._id\n }\n }).catch((err) => {\n if (err == overseer.HookManager.codes.NO_HOOK) {\n overseer.StorageManager.getItem(\"alarms\", \"alarms\").then((storage) => {\n let alarms = [];\n if (storage) {\n alarms = storage.filter((a) => a.hook !== hook._id);\n }\n \n overseer.StorageManager.storeItem(\"alarms\", \"alarms\", alarms).then().catch((err) => console.log(err));\n }).catch((err) => console.log(err));\n }\n });\n });\n overseer.StorageManager.getItem(\"alarms\", \"alarms\").then((storage) => {\n let alarms = [];\n if (storage) {\n alarms = storage;\n }\n\n alarms.push({ date: time, hook: hook._id, text });\n\n overseer.StorageManager.storeItem(\"alarms\", \"alarms\", alarms).then().catch((err) => console.log(err));\n }).catch((err) => console.log(err));\n overseer.ThreadManager.closeThread(thread._id).then(() => {\n return resolve({\n message: {\n title: \"Alarm \",\n text: response,\n request_hook: true,\n hook_id: hook._id\n }\n });\n }).catch((e) => {\n console.log(e);\n return resolve({\n message: {\n title: \"Alarm\",\n text: response,\n request_hook: true,\n hook_id: hook._id\n }\n });\n });\n }).catch((err) => {\n console.log(err);\n return reject(err);\n });\n });\n}", "title": "" }, { "docid": "1fae43ad3e98bd3e4a29c94a1b949328", "score": "0.56591934", "text": "function schedule (){\n localNote.schedule({\n id: 1,\n title: 'This is my reminder',\n text: \"Good afternoon!\",\n //firstAt: dt,\n every: \"day\", \n //icon: \"../../vici.png\"\n });\n }", "title": "" }, { "docid": "26514579274130d91fe2392389a87943", "score": "0.5651667", "text": "function calc_schedule() {\n draw_schedule();\n submit_schedule(0);\n last_submit = (new Date()).getTime();\n setTimeout(function(){\n if (((new Date()).getTime()-last_submit)>1900) {\n console.log(\"save\");\n submit_schedule(1);\n\n //if (schedule.device_type==\"smartplug\" || schedule.device_type==\"hpmon\") {\n clearTimeout(get_device_state_timeout)\n get_device_state_timeout = setTimeout(function(){ get_device_state(); },1000);\n //}\n }\n },2000);\n }", "title": "" }, { "docid": "83da0fa20119a9b94203cc9150e420d1", "score": "0.56451505", "text": "function if_required_fields(shedule_type) {\n host_select_list = get_all_select_host_id();\n if (host_select_list.length <= 0) {\n $.niftyNoty({\n type: 'danger',\n icon: 'pli-cross icon-2x',\n message: 'Please select a server to operate',\n container: 'floating',\n timer: 5000\n });\n } else if ($('#periodic_task_name').val().length <= 0) {\n $.niftyNoty({\n type: 'danger',\n icon: 'pli-cross icon-2x',\n message: 'Please give the task a name',\n container: 'floating',\n timer: 5000\n });\n } else if ($('#periodic_task_command').val().length <= 0) {\n $.niftyNoty({\n type: 'danger',\n icon: 'pli-cross icon-2x',\n message: 'Please enter a command to execute',\n container: 'floating',\n timer: 5000\n });\n } else {\n if (shedule_type == 'corntab') {\n corntab_periodic_task_button(host_select_list);\n } else if (shedule_type == 'interval') {\n //for future imporve\n } else if (shedule_type == 'clocked') {\n //for future imporve\n } else {\n //for future imporve\n }\n\n }\n}", "title": "" }, { "docid": "33293ff08516e9b8e8b9aa771318b0ec", "score": "0.56405836", "text": "async function updateTimeEnd(){\n console.log('updateTimeEnd() called...')\n let is_user_logged_in = await checkLoggedInBool();\n if(is_user_logged_in){\n // save task task to db only if a promodoro task \n if(currentTimer == \"Pomodoro\" && timerState != 'STOPPED' && timerState != ''){\n $.ajax({\n url: '/updateTaskTimeEnd',\n success: function(data) {\n console.log('Updated Task time_end', data);\n }\n });\n }\n } \n}", "title": "" }, { "docid": "55002af702ade2f1107de52da7dfeff9", "score": "0.5634952", "text": "function refreshTasks() {\r\n if (confirm('Are you sure you wish to create new tasks?')) {\r\n createNewTasks();\r\n }\r\n}", "title": "" }, { "docid": "55adb2e0586fcedacbde4020ea7136cb", "score": "0.5634411", "text": "async function checkDoorStatusAndAlert() {\n console.log('checkDoorStatusAndAlert job started')\n // if door open after 7pm, send alert\n const now = moment()\n if (isDoorOpen() && isDoorAlertingActive()) {\n await sendAlert(doorOpenMessage.replace('__TIME__', now.format('LT')))\n }\n}", "title": "" }, { "docid": "96df83e8e5efb36511e4a66e5ad31b38", "score": "0.56343824", "text": "function onRestart() {\n api.put(`tasks/${task.id}`, {\n title: task.title,\n description: task.description,\n status: 'started',\n startedIn: new Date().toISOString(),\n finishedIn: null\n }, {\n headers: {\n authorization: userId\n }\n })\n\n history.push('/main')\n }", "title": "" }, { "docid": "78e892a59c76805b2f3d72d89387ec1a", "score": "0.5618514", "text": "async started() {\n\t\trequire('./main/default/schedule/time_trigger').run()\n\t\trequire('./main/default/schedule/time_trigger_queue').run()\n\t}", "title": "" }, { "docid": "e03f2d37ec8fdf7ac374949ae65decae", "score": "0.5618021", "text": "function triggerAlarm() {\n \n const dates = helper_getAlarmDates();\n const alarms = JSON.parse(storage.getItem(topic));\n let currentDate = new Date();\n \n for (let i = 0; i < alarms.length; i++) {\n console.log();\n if ((dates[i].getFullYear() == \n currentDate.getFullYear()) && \n (dates[i].getMonth() == \n currentDate.getMonth()) && \n (dates[i].getDate() == \n currentDate.getDate()) && \n (dates[i].getHours() === \n currentDate.getHours()) && \n (dates[i].getMinutes() === \n currentDate.getMinutes()) && \n (dates[i].getSeconds() <= \n currentDate.getSeconds()) &&\n alarms[i].enabled) {\n \n const notify = new Notification(\n alarms[i].message);\n \n helper_disableAlarm(i);\n }\n }\n}", "title": "" }, { "docid": "6ff0a9413ffb6b86401869a9730a3c2c", "score": "0.5616314", "text": "function checkForPendingTasks() {\n if (!window.localStorage.vbpPendingTasks) {\n return;\n }\n\n const pendingTasks = JSON.parse(window.localStorage.vbpPendingTasks);\n const threshold = Date.now() - 180000; // 3 min max for pending validation tasks\n _.keys(pendingTasks).forEach(uuid => {\n if (pendingTasks[uuid] >= threshold) {\n checkTask(uuid);\n } else {\n delete pendingTasks[uuid];\n }\n });\n updatePendingTasks(pendingTasks) ;\n}", "title": "" }, { "docid": "01c3f7de43375a326fc71644ea271d5e", "score": "0.5612104", "text": "Cancel_LunchorDinner(tiffinType, CustomerId) {\n\n //check for deadline timeing for lunch 11:00 & Dinner 6:00\n const now = new Date();\n const lunch_dealine = new Date();\n const dinner_dealine = new Date();\n\n\n //get toadys date in deafult js format\n const date = moment().format(\"MM-DD-YYYY\");\n //get schedule-id\n getSchedule({ customerId: CustomerId, date: date, role: 'admin' }).then(function (schedule) {\n if (schedule.length > 0) {\n //update in db \n let bill = [];\n bill.push({ tiffinType: tiffinType, amount: 0, qty: 0, isActive: 0 })\n const obj = {\n _id: schedule[0].id,\n customerId: CustomerId,\n date: date,\n bill: bill,\n role: 'admin'\n }\n updateSchedule(obj).then(function (data) {\n alert(\"Done\");\n });\n } else {\n alert(\"Schedule not exist\");\n }\n });\n }", "title": "" }, { "docid": "91a2e01d789f87f4a25ccd72ea464270", "score": "0.56044686", "text": "function performTask(Ticket, Action) {\n $scope.HideCancelModal = true;\n $('#PopUpModal').modal('toggle');\n $scope.ALERTCONTENT = {\n Title: Constants.PopupTitleSuccess,\n MethodCase: \"PROCEED\",\n Object: Ticket,\n Type: \"success\"\n }\n $scope.MESSAGE = \"You've successfully \" + Action + \" the request #\" + Ticket.TicketId + \". You will receive an email shortly with further details. Please follow the <strong>Steps to validate</strong> section to proceed to the next step.\";\n }", "title": "" }, { "docid": "132153e4cf859643a35bfae2d2b8524f", "score": "0.55823433", "text": "async function doPeriodicTasks() {\n if (!util.exists(discordClient)) {\n console.log('No client');\n return;\n }\n if (!util.exists(module.exports.pugPollChannelId)) {\n console.log('Pug Poll Channel ID not found');\n return;\n }\n if (!util.exists(module.exports.pugAnnounceChannelId)) {\n console.log('Pug Announce Channel ID not found');\n return;\n }\n\n const curDate = new Date();\n\n if (curDate.getHours() === 0) {\n if (curDate.getDay() === 1) {\n // Delete the previous poll on Monday at Midnight.\n deletePreviousPoll();\n }\n } else if (curDate.getHours() === 12) {\n if (curDate.getDay() === 0) {\n // If it's Sunday at 12 PM PST, post a new PUG poll. The poll starts from\n // the next day because we post a day early.\n const tomorrow = new Date();\n tomorrow.setDate(curDate.getDate() + 1);\n postPoll(tomorrow);\n }\n } else if (curDate.getHours() === 17) {\n announcePug(curDate.getDay());\n }\n}", "title": "" }, { "docid": "eea3f1026d6a7e0565525e5b7f6a274b", "score": "0.5576908", "text": "async function schedule(obj){\r\n let right_now = new Date();\r\n let hour = right_now.getHours();\r\n let minute = right_now.getMinutes();\r\n let current_time = hour*60 + minute;\r\n console.log(\"Will post [\" + obj.name + \"] , in : \" + (obj.starting_hour*60 - current_time).toString() + \" minutes.\");\r\n bot.setTimeout(() => {\r\n sendmessage(obj);\r\n console.log(\"Posted a message\");\r\n }, (obj.starting_hour*60 - current_time - 5)*60*1000);\r\n return true;\r\n}", "title": "" }, { "docid": "90d07d832110ee78af1ef2fddbd6421c", "score": "0.55711985", "text": "function scheduleSaveExam(){\n\tvar dbIdx = makeSafeFname( getCurrDB().getFname() );\n\tif( saveExamScheduledJob != null ){\n\t\twindow.clearTimeout(saveExamScheduledJob);\n\t}\n\t$(\"#\" + dbIdx + \"_db\").siblings(\".file-status\").addClass(\"scheduled\");\n\tsaveExamScheduledJob = window.setTimeout(launchSaveExam, 5 * 1000);\n\tif(saveExamScheduledList.indexOf(dbIdx) === -1){\n\t\tsaveExamScheduledList.push(dbIdx);\n\t}\n}", "title": "" }, { "docid": "8dffaa4515c1e9164c2480274b39f337", "score": "0.5570802", "text": "function reportSubmittedBackgroundTask() {\r\n shareOperation.reportSubmittedBackgroundTask();\r\n }", "title": "" }, { "docid": "471efc7670dcf744a0c5b7f977e826c8", "score": "0.5569994", "text": "function tick() { // created function with a name of tick //\n seconds = seconds - 1;\n timer.innerHTML = seconds;\n setTimeout(tick, 1000); \n if(seconds == -1) { // if condition statment is seconds equal -1 than alert box will show up with message //\n alert(\"Time is up\"); // message that will display if second equal -1 //\n }\n }", "title": "" }, { "docid": "aedc56ec43e0cc4462458417c08681f2", "score": "0.5565175", "text": "function checkDates() {\n console.log('Notify client to check dates');\n sio.emit('checkDates');\n setTimeout(checkDates, sysvars.assetScheduleTimer);\n}", "title": "" }, { "docid": "65ad3be28057870769271c0666edbf9a", "score": "0.555701", "text": "function insertTaskInTable() {\n modifyScheduleTask(gClickResult.task.task.id,\n gDragResult.clickedDay,\n gDragResult.clickedHour,\n gDropResult.clickedHour);\n}", "title": "" }, { "docid": "9c74fac37a3fd61fece67a144c5d22be", "score": "0.55351746", "text": "scheduleEnd(task) {\n this._createScheduleIfNeeded();\n this._currentSchedule.endTasks.push(task);\n }", "title": "" }, { "docid": "9c74fac37a3fd61fece67a144c5d22be", "score": "0.55351746", "text": "scheduleEnd(task) {\n this._createScheduleIfNeeded();\n this._currentSchedule.endTasks.push(task);\n }", "title": "" }, { "docid": "2302b4d43f848476390659325673cf47", "score": "0.5531267", "text": "function startTime() {\n document.getElementById(\"selectProject\").disabled = true;\n document.getElementById(\"del\").disabled = true;\n document.getElementById(\"create\").disabled = true;\n document.getElementById(\"task\").value = \"\";\n\n /* check if seconds, minutes, and hours are equal to zero \n and start the Count-Up */\n if (seconds === 0 && minutes === 0 && hours === 0) {\n /* hide the fulltime when the Count-Up is running */\n var fulltime = document.getElementById(\"fulltime\");\n fulltime.style.display = \"none\";\n var showStart = document.getElementById(\"start\");\n showStart.style.display = \"none\";\n\n /* call the startWatch( ) function to execute the Count-Up \n whenever the startTime( ) is triggered */\n startWatch();\n }\n}", "title": "" }, { "docid": "6aed481ffa315acd5a18c61d29a3e34d", "score": "0.5525115", "text": "success() {\n //console.log('join meeting success');\n storeEventUSer();\n //setInterval(updateSpendTime(), 50000);\n setInterval(function() {\n updateSpendTime();\n }, 50000);\n }", "title": "" }, { "docid": "1968ce7951d9ddd5655b3536f163396d", "score": "0.55237216", "text": "function createSchedule() {\n dayStartTime = Time.stringToTime(document.getElementById(\"startTime\").value);\n dayEndTime = Time.stringToTime(document.getElementById(\"endTime\").value);\n let durHour = document.getElementById(\"durationHour\").value;\n let durMin = document.getElementById(\"durationMinute\").value;\n dayDuration = new Time(parseInt(durHour), parseInt(durMin));\n let startDay = document.getElementById(\"startDay\").value;\n let endDay = document.getElementById(\"endDay\").value;\n if(dayDuration.hour > 24 || dayDuration.hour < 0 || dayDuration.minute > 59 || dayDuration.minute < 0 || dayDuration.compareTo(new Time(0,0)) === 0) {\n alert(\"Duration cannot be 00:00.\");\n \n return;\n }\n if(dayStartTime.compareTo(dayEndTime) >= 0) {\n alert(\"Start time cannot be greater than or equal to end time.\");\n return false;\n } else if(dayDuration.compareTo(Time.subtract(dayStartTime, dayEndTime)) > 0) {\n alert(\"Duration must be between the start time and end time.\")\n return false;\n } else {\n schedule.generateSchedule(startDay, endDay, dayStartTime, dayEndTime, dayDuration);\n return true;\n }\n}", "title": "" }, { "docid": "f26c14ce839ad2e6007c37d6199e240d", "score": "0.5518796", "text": "async abortIfDoneAlready () {\n\t\tconst lastRunAt = await this.data.reinviteUsersLastRunAt.getByQuery({}, { overrideHintRequired: true });\n\t\tif (lastRunAt && lastRunAt[0] && lastRunAt[0].lastRunAt > Date.now() - RUN_INTERVAL) {\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "27f9565bbf659bc779aec444d0765316", "score": "0.5514419", "text": "scheduleHourlyCues() {\n const job = schedule.scheduleJob(\"0 0 0-23 * * *\", this.updateHourlyCues);\n jobQueue.push(job);\n }", "title": "" }, { "docid": "8d6bcc897ebf6903c4c830897275a3e6", "score": "0.55143267", "text": "doneTask(){\n\t\tlet aTask = this.props.task;\n\t\tlet aProject = this.props.project;\n\n\t\tif(aTask.status === 'Done'){\n\n\t\t\taTask.status = 'Undone';\n\n\t\t\t// delete undone task from done task today list\n\t\t\tconst isThere = aProject.tasksDoneToday.find(t => t.id === aTask.id);\n\n\t\t\tif(isThere !== undefined){\n\n\t\t\t\tconst tempTasks = aProject.tasksDoneToday.filter(t => t.id !== aTask.id);\n\n\t\t\t\taProject.tasksDoneToday = tempTasks;\n\n\t\t\t}\n\t\t}else{\n\n\t\t\taTask.status = 'Done';\n\n\t\t\t// a done task to done task today list\n\t\t\taProject.tasksDoneToday.push(aTask);\n\t\t}\n\n\t\t// update project updated date\n\t\tif(aProject.tasksDoneToday.length > 0){\n\t\t\tconst today = new Date();\n\n\t\t\taProject.updated = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();\n\t\t}else{\n\t\t\taProject.updated = aProject.oldUpdated;\n\t\t}\n\n\t\tthis.props.refreshDetailedPage(aProject.id);\n\t}", "title": "" }, { "docid": "9f2f5df3931b58f9e1140e71d2f80a45", "score": "0.55134374", "text": "function mtCTaskHoldCelebration(task_type, schedule) {\r\n\tthis.objId = mtNewId();\r\n\tthis.schedule = schedule;\r\n\tthis.taskType = task_type;\r\n\t\r\n\t//this.message = '<span style=\"color: red;\">Wait for configuration<span>';\r\n\tthis.message = '<span style=\"color: red;\">尚未設定<span>';\r\n\tthis.running = false;\r\n\t\r\n\tthis.async_seq = 0;\t// for avoid asynchronize execution conflict\r\n\t\r\n\tthis.config = null;\r\n}", "title": "" }, { "docid": "77f35e9e9bf7b6973263a57b0bf2cc78", "score": "0.5506001", "text": "_maybeReschedule() {\n this._pending = false;\n if (this._active) {\n this._timeoutHandle = setTimeout(this._fire, this._pollInterval);\n }\n }", "title": "" }, { "docid": "3715616aaa5782f1c2c421cd37d0aeb6", "score": "0.54990065", "text": "function checkAndArchiveItem(item) {\n if ((new Date().getTime() / 1000) - item.InitialStart > 86400 || item.TotalTime >= 86400) {\n var changesMade = 0;\n item.Archived = true;\n if (item.TotalTime > 86400) {\n item.TotalTime = 86400;//Math.min(item.TotalTime, 86400);\n changesMade++;\n }\n if (item.TimerOn) {\n item.TimerOn = false;\n $interval.cancel(item.Timer);\n changesMade++;\n }\n if (changesMade > 0) {\n updateTask(item);\n }\n\n }\n\n\n\n //}\n }", "title": "" }, { "docid": "4172e0571ce74ff3b7dcf64cb76cb8f0", "score": "0.5494478", "text": "function mark_task(id, e){ \n\tvar item_id = $$('list').locate(e);\n\t$$(\"list\").getItem(item_id).done = 1;\n\t$$(\"list\").updateItem(item_id);\n\tlist_filter();\n}", "title": "" }, { "docid": "450c8edd7c6d01cab162b202df02cfc8", "score": "0.5494153", "text": "function systemAddDefaultSchedule() {\n let job = nodeSchedule.scheduleJob('* 0 0 * * 1-5', function() {\n checkLastSurveyConfiguration()\n });\n}", "title": "" }, { "docid": "82f80fb8e0f09fd8c18f89c149a0f9f5", "score": "0.5486447", "text": "function post_periodic_task_button(data_dict, csrfmiddlewaretoken) {\n $.post('/periodic_task_post_views/', {\n 'csrfmiddlewaretoken': csrfmiddlewaretoken,\n 'data_dict': JSON.stringify(data_dict)\n }, function (callback) {\n callback = JSON.parse(callback)\n if (callback == 'taskname_used') {\n $.niftyNoty({\n type: 'danger',\n icon: 'pli-cross icon-2x',\n message: 'The task name was alraedy been taken!',\n container: 'floating',\n timer: 5000\n });\n } else if (callback == 'servererror') {\n $.niftyNoty({\n type: 'danger',\n icon: 'pli-cross icon-2x',\n message: 'Service busy please try again ',\n container: 'floating',\n timer: 5000\n });\n } else if (callback == 'success') {\n $.niftyNoty({\n type: 'success',\n icon: 'pli-like-2 icon-2x',\n message: 'The task has beed created successfully! ',\n container: 'floating',\n timer: 5000\n });\n $(\"#periodic_history_table_crontab\").bootstrapTable('refresh',setTimeout(1000));\n } else {\n $.niftyNoty({\n type: 'danger',\n icon: 'pli-cross icon-2x',\n message: 'Unknow error please contact amdin ',\n container: 'floating',\n timer: 5000\n });\n }\n });\n\n}", "title": "" }, { "docid": "f4029da786ac8c5e0342fa538f9f1561", "score": "0.5474708", "text": "function mainFunction() {\n\n createCountdownElement();\n\n $(\"#btnFinish\").click(function() {\n var confirmDelivery = confirm(\"ATTENZIONE!!!\\n Sei sicuro di voler consegnare il tuo esame???\\n\\n cliccando su OK consegnerai il tuo elaborato definitivamente,\\ne questa sarà la versione che verrà corretta\");\n if (confirmDelivery){\n deliveryExam();\n }\n });\n\n callForClockAulaStatus();\n}", "title": "" }, { "docid": "ebfda8b13499f3fba00a4ad1d5b3080d", "score": "0.5467913", "text": "onProcessSchdedule() {\n let data = this.state.dataschedule;\n\n // console.log('proces',data);\n //save complete schedule\n user.updateUserDoneMonth(this.state.complete_yesterday);\n if(this.props.userattendIsExpired == true){\n this.onUpdateRole(Constant.ROLE_FINISHTODAY,true)\n }\n //Global_checkStatus(this.onUpdateRole.bind(this))\n // ASYNC_getScheduleToday(KEYS.KEY_LISTDOCTODAY)\n }", "title": "" }, { "docid": "7168eb1b5cb5d97f0b17f53b02262319", "score": "0.5458246", "text": "schedule(taskFn, delay) {\n const id = setTimeout(taskFn, delay);\n return () => clearTimeout(id);\n }", "title": "" }, { "docid": "1a86f105d7243d5e84a3e17dbe1e94aa", "score": "0.54547143", "text": "scheduleAlert() {\n if (this.overlayPage === 0) { // for scheduling overlay\n if (this.selectedTime.period) {\n return 'Please select a window';\n } else if (this.selectedTime.date) {\n return 'Please select a period';\n } else {\n return 'Please select a day';\n }\n } else if (this.overlayPage === 1) { // for confirm overlay\n if (this.delivData.terms) {\n return 'I accept the Terms and Conditions for delivery';\n } else if (this.delivData.contact.knock || this.delivData.contact.doorbell || this.delivData.contact.phone || this.delivData.contact.other) {\n return 'Please read and accept the Terms and Conditions';\n } else {\n return 'Please select contact methods';\n }\n }\n }", "title": "" }, { "docid": "c58d916ec4856e865b547a7ef33bf6e3", "score": "0.5453863", "text": "scheduleDailyCues() {\n const job = schedule.scheduleJob(\"0 0 1 1-31 * *\", this.updateDailyCues);\n jobQueue.push(job);\n }", "title": "" }, { "docid": "5b904cb7bbd010c8af2a7993322649c2", "score": "0.54495406", "text": "function ScheduleAllDayCommands() {\n var Today = new Date();\n var ts = new timespan.TimeSpan(0, Today.getSeconds(), Today.getMinutes(), Today.getHours(), Today.getDay());\n\n for (var i = 0; i < Simulog.weekData[Today.getDay()].datalog.length; i++) {\n var ts2 = new timespan.TimeSpan(0, Simulog.weekData[Today.getDay()].datalog[i].Seconds, Simulog.weekData[Today.getDay()].datalog[i].Minutes, Simulog.weekData[Today.getDay()].datalog[i].Hours, Today.getDay());\n\n var diff = ts2.totalMilliseconds() - ts.totalMilliseconds();\n\n if (diff >= 0) {\n status.nextPlay = diff;\n var hourstring = Simulog.weekData[Today.getDay()].datalog[i].Hours + \":\" + Simulog.weekData[Today.getDay()].datalog[i].Minutes + \":\" + Simulog.weekData[Today.getDay()].datalog[i].Seconds;\n console.log('schedule command ' + Simulog.weekData[Today.getDay()].datalog[i].Status.status + ' at: ' + hourstring + \" in \" + diff / 1000 + \" sec\");\n\n playTimeout.push(\n {\n name: hourstring,\n timer: setTimeout(function (command) {\n // Set the output on bus\n SetBusValues(command);\n\n\n }, diff, Simulog.weekData[Today.getDay()].datalog[i])\n }\n );\n\n\n }\n }\n\n if (playTimeout.length == 0)\n { console.log('no schedule for this day'); }\n\n // schedule to populate timers for the day after\n var Tomorrow = new Date();\n Tomorrow.setHours(24, 0, 0, 0);\n\n var nextDaydiff = Tomorrow - Today;\n\n console.log('schedule new check for tomorrow (in ' + nextDaydiff + 'ms)');\n tomorrowPlayTimeout = setTimeout(ScheduleAllDayCommands, nextDaydiff);\n\n return 1;\n}", "title": "" }, { "docid": "4eb6bff4998b98a40447a85b065f38a3", "score": "0.5445632", "text": "async function isStartWorkingToday () {\n try {\n let lastDate = await getLastKnownDate();\n if (lastDate){\n return true;\n }\n console.log('is working?');\n return false;\n } catch (error) {\n console.log('Check start working error');\n }\n }", "title": "" }, { "docid": "34a751cf95ef60a8860511120659b4d0", "score": "0.54451287", "text": "function checkForPendingTask(popServer) {\n console.log(\"tasks--\", tasks.length);\n\n let taskPending = true; // check for pending task\n\n if (tasks.length) {\n let task = tasks.findIndex((obj) => obj.status === TASK_STATUS.WAITING),\n id = \"task\" + (task + 1);\n\n console.log(task, id, \"---\");\n\n if (task >= 0) {\n taskPending = false;\n\n let element = document.getElementById(id),\n trashId = \"trash\" + (task + 1),\n trashBtn = document.getElementById(trashId);\n\n element.parentNode.removeChild(trashBtn);\n\n tasks[task].status = TASK_STATUS.RUNNING;\n runningTask++;\n\n console.log(tasks[task], \"task up-----\");\n\n timeSetForRunningTask(element, task + 1);\n }\n }\n\n if (!tasks.length && popServer && taskPending) {\n servers.pop();\n }\n}", "title": "" }, { "docid": "f600fc1bc68b263a3eaecaa156f33a89", "score": "0.54388404", "text": "presentSucceededTask(task) {\n const pointer = this.logger.colors.green(Icons_1.icons.pointer);\n const duration = this.logger.colors.dim(task.duration);\n let message = `${pointer} ${task.title} ${duration}`;\n if (!task.completionMessage) {\n return message;\n }\n message = `${message}\\n ${this.logger.colors.dim(task.completionMessage)}`;\n return message;\n }", "title": "" }, { "docid": "abb870d4ad13a5be50c59521331e7a6e", "score": "0.54243416", "text": "function startAlram() {\r\n cancel = setInterval(triggerAlarm, 1000);\r\n}", "title": "" }, { "docid": "089c1cc3e045e19be6fa21a3e1e7e3a8", "score": "0.54179376", "text": "function schedule() {\n document.getElementById(\"edit-schedule\").innerHTML=\"Please Wait!!\";\n document.getElementById(\"edit-schedule\").disabled = true;\n\n var beginDate = document.getElementById(\"beginDate\").value;\n beginDate = beginDate.split(\"-\");\n beginDate = new Date(beginDate[0], beginDate[1] - 1, beginDate[2]);\n beginDate = beginDate.getTime();\n\n var beginTime = document.getElementById(\"beginTime\").value;\n beginTime = beginTime.split(\":\");\n beginTime = beginTime[0] * 60 * 60 + beginTime[1] * 60;\n beginTime = beginTime * 1000;\n\n var endDate = document.getElementById(\"endDate\").value;\n endDate = endDate.split(\"-\");\n endDate = new Date(endDate[0], endDate[1] - 1, endDate[2]);\n endDate = endDate.getTime();\n\n var endTime = document.getElementById(\"endTime\").value;\n endTime = endTime.split(\":\");\n endTime = endTime[0] * 60 * 60 + endTime[1] * 60;\n endTime = endTime * 1000;\n\n var totalBeginTime = beginDate + beginTime;\n var totalEndTime = endDate + endTime;\n\n if (totalBeginTime > totalEndTime) {\n alert('Enter Valid Time!');\n return;\n }\n\n var intervieews = document.getElementById(\"justAnInputBox\").value;\n intervieews = intervieews.split(\", \");\n\n const url = '/edit-interview/' + id;\n fetch(url, {\n method: \"POST\",\n body: JSON.stringify({\n \"intervieews\": intervieews,\n \"totalBeginTime\": totalBeginTime,\n \"totalEndTime\": totalEndTime\n }),\n headers: {\n \"Content-type\": \"application/json; charset=UTF-8\"\n }\n })\n .then(response => response.json())\n .then((data) => {\n console.log(data)\n if (!!data.message) {\n alert(data.message);\n document.getElementById(\"edit-schedule\").innerHTML=\"Try Again!!\";\n document.getElementById(\"edit-schedule\").disabled = false;\n }\n else if (!!data.data.error) {\n alert('error = ' + data.data.error + '. Conflicting intervieews are : ' + data.data.conflicting_intervieews);\n document.getElementById(\"edit-schedule\").innerHTML=\"Try Again!!\";\n document.getElementById(\"edit-schedule\").disabled = false;\n }\n else {\n alert('Successfully registered your meeting!');\n window.location.href = \"https://manage-interviews.herokuapp.com/show_all_interviews\";\n }\n\n })\n\n}", "title": "" }, { "docid": "62c28a4ac053c4b3ac29782d3251e399", "score": "0.54157656", "text": "function alertUser() {\n if(Date.now() - lastAlert > 5000) {\n lastAlert = Date.now();\n alert(\"Something happened to your phone!!!\");\n }\n}", "title": "" }, { "docid": "e61b3516af4f267f20e56099bea9cd14", "score": "0.54106516", "text": "function timeMsg() {\n \tvar t=setTimeout(\"alertMsgTO()\",3000);\n}", "title": "" }, { "docid": "50046aac5e61d5a61f7a66cc641d7f7e", "score": "0.54095304", "text": "function autoGuardar(tiempo){\n if(sesion.timer.timerId > -1){\n limpiarAutoGuardar(sesion.timer.timerId);\n }\n //calcular tiempo en milisegundos 60000 = 1 min\n var mili = parseInt(tiempo) * 60000;\n var timeId = setInterval(function(){\n $(\"#guardarTexto\").click();\n fechaUltimaVezGuardado();\n }, mili);\n sesion.timer.timerId = timeId;\n $(\"#alertAutoGuardado\").text(\"Guardado automatico ejecuntandose cada \" + tiempo + \" minuto(s)\");\n $(\"#alertAutoGuardado\").show();\n}", "title": "" }, { "docid": "81d28308697a27123e649892b24b0350", "score": "0.54093105", "text": "function schedule(){\n\t\tif(inShedule) return;\n\t\telse inShedule = true;\n\t\tif(!_curTask) refreshCurTask();\n\t\t//缓存数据达到要求的数据量\n\t\twhile(_curTask && (_bufferDataTotal >= taskWantDataLen(_curTask))){\n\t\t\tif(_curTask.type == 'once'){ //单次任务\n\t\t\t\tvar retData = getDataFromBuffers(_curTask.packLen);\n\t\t\t\t_curTask.cbFunc(retData);\n\t\t\t\trefreshCurTask();\n\t\t\t}else{ //多次任务\n\t\t\t\tcallLoopTask(_curTask);\n\t\t\t}\n\t\t}\n\t\tinShedule = false;\n\t}", "title": "" }, { "docid": "ecd9c3a6ed840377a8a4fdc0e3bc4b1b", "score": "0.5408831", "text": "function notDone(item) {\n var dateNow = new Date();\n var dateTask = new Date(item.date);\n return ((item.done == false) && (dateTask >= dateNow));\n }", "title": "" }, { "docid": "c261c7b7ec801e0f7ee1d39486dd4d58", "score": "0.54085344", "text": "function forceUpdate(){\n\n // alert the risk\n alertify.confirm(\"The subscription data is updated once per day, do you really need to force udpate it now ??\",\n function(){\n\n // we tell the user to be patient\n // after user clicks at \"ok\", we launch the action and the progress bar\n alertify.alert(\"The Refresh process may take 1 minute, please be patient.\", function(){\n\n // during the operation of force Update, we disable the possibility of re-asking another trial of force update\n document.getElementById(\"forceupdate\").onclick = function(){\n alertify.error(\"The operation is in progress !\");\n };\n\n // progress begin to run, normally it will run 60s\n progressBarRunning(\"progress_bar_force_update\",60);\n\n // launch the action to force update the data in MySQL\n $.ajax({\n url: 'php/Controllers/getData_Monitor_Unsubscription.php',\n method: \"GET\",\n data: {\n unsubscribed_all: true,\n force_update:'true'\n }\n }).done(\n\n // when the action is done, we close the progress bar\n // and refresh the page data\n function(){\n\n // we show the progress is finished, and make the bar disappear\n set_bar_progress(\"progress_bar_force_update\",100);\n\n alertify.message(\"Refresh finished successfully. Updating the display .. \");\n\n // refresh the data shown on the page\n refresh_unsubscription_page();\n\n // enable the force refresh trial\n document.getElementById(\"forceupdate\").onclick = function(){\n forceUpdate();\n }\n }\n )\n })\n },\n function(){\n // do nothing when user selects 'cancel'\n });\n}", "title": "" }, { "docid": "a6bb7ae8cd0c80b0e03bc75d589101aa", "score": "0.54037267", "text": "queueAlertUpdate() { this.tabs.updateMuteAlarm(); }", "title": "" }, { "docid": "4803d04ac7aa050f3af626a52bf09621", "score": "0.5401699", "text": "function get_alert(){\n var message = '';\n removeColumns(colList);\n colList = [];\n var task = document.getElementById('task').value;\n //make date input a date object\n var date = new Date(document.getElementById('date_to_complete').value.replace(/-/g, '\\/'));\n var today = new Date();\n //make sure date is in the future\n var futureDate = checkDate(today, date);\n\n // days = document.getElementById('days_to_complete').value;\n if (futureDate){\n\n\n var days_to_complete = differenceInDays(today, date);\n let tempDict = alertTrack(task, days_to_complete);\n\n for (const [key, value] of Object.entries(tempDict)){\n if (value < 3){\n message = \"alert alert-danger\"\n }\n else if (value < 7){\n message = \"alert alert-warning\"\n }else {\n message = \"alert alert-secondary\"\n }\n\n const div = document.createElement('div');\n div.className = message + \" alert-dismissible fade show\"\n col = colTracker(col);\n div.IdName = 'col' + col;\n colList.push(div.IdName);\n div.role = 'alert';\n if (value == 1){\n day = \" day\"\n }else{\n day = ' days'\n }\n div.innerHTML= key + ' ' + \"<br />\" + value + day + '<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>'\n document.getElementById(div.IdName).appendChild(div);\n document.getElementById('myForm').classList.remove('was-validated');\n }\n }\n }", "title": "" }, { "docid": "eabbf48652c0500b97c4c63026935c3a", "score": "0.5400103", "text": "runETLSecondTime() {\n sheepdogTask.runGenTestData(1);\n expect(etlTasks.runETLJob()).to.equal(true);\n }", "title": "" }, { "docid": "27449a3e5627d233d65214a8cfd919aa", "score": "0.5398335", "text": "schedule(task) {\n this._createScheduleIfNeeded();\n this._currentSchedule.tasks.push(task);\n }", "title": "" }, { "docid": "27449a3e5627d233d65214a8cfd919aa", "score": "0.5398335", "text": "schedule(task) {\n this._createScheduleIfNeeded();\n this._currentSchedule.tasks.push(task);\n }", "title": "" }, { "docid": "3bbf5a68dd856597b77ef82cb1a35245", "score": "0.5395241", "text": "function schedule(ch, duration, user) {\n var probe_time = moment();\n setTimeout(function () {\n sendTPL(ch, probe_time, duration, user);\n }, duration * 1000);\n}", "title": "" }, { "docid": "ed1bc87437e8efb521ed19d34876b7f6", "score": "0.538857", "text": "timeEventHandler(id){\n if (id === this.props.currentTask.id)\n this.props.addEvent(id, this.props.runningTimer)\n else { this.viewTaskHandler(id) }\n }", "title": "" }, { "docid": "24b1d445c3c57d4b2752c42a43703210", "score": "0.53806126", "text": "function exeTask() {\n\t\tchangePhotoInterval = setInterval(replacePic,3000);\n\t\t//nextMinute = Math.floor(Math.random() * 6);\n\t\tnextMinute = 28;\n\t}", "title": "" }, { "docid": "07a0492efc5cb911171ae3ae365cb784", "score": "0.5380565", "text": "function scheduleRequest() {\n\tconsole.log(\"Creating refresh alarm\");\n\tchrome.alarms.create(\"refresh\", {periodInMinutes: checkPeriodInMinute});\n}", "title": "" }, { "docid": "7624c9a741335ebc892493e1f17c8df0", "score": "0.53788435", "text": "neverNotifyCompleted() {}", "title": "" }, { "docid": "7624c9a741335ebc892493e1f17c8df0", "score": "0.53788435", "text": "neverNotifyCompleted() {}", "title": "" }, { "docid": "fc1e18cdaecb18bd7fc83de5717e9793", "score": "0.5375887", "text": "function validPreDeleteWorkingDayEvent(event) {\n\n // -------------------------------------------------\n // - date must be greater than today's date\n // -------------------------------------------------\n // tomorrow at 0am\n var tomorrow = new Date();\n tomorrow.setHours(24, 0, 0, 0);\n if ((new Date(event.date)).getTime() < tomorrow.getTime()) {\n var message = \"Only Non_Working Days in the future can be deleted.\";\n modalSrvc.showInformationMessageModal2(CONTROLLER_NAME, message);\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "1f35a98879bc2dc6d9ab2775bfab58c0", "score": "0.5373612", "text": "function doTask(time, text) {\n\tconsole.log(`[${new Date(time).toISOString()}] (${FORMATTER.format(Date.now() - time)}) ${text}`);\n}", "title": "" }, { "docid": "a41030c46b75324d5176fe41a3e2baeb", "score": "0.5371558", "text": "function currentIntent(app){\n var my_ion_request = 'https://ion.tjhsst.edu/api/schedule?format=json'; //no access token for schedule\n var failedMessage = 'Sorry, but school is not in session right now. Try again later!';\n\n request.get( {url:my_ion_request}, function (e, r, body) {\n var res_object = JSON.parse(body);\n\n var date = new Date();\n var year = Number(date.getFullYear().toString());\n var month = Number((date.getMonth() + 1).toString()); //returns 0-11 + 1\n var day = Number(date.getDate().toString());\n var hours = Number(date.getHours().toString());\n var mins = Number(date.getHours().toString());\n\n var schedDate = res_object.results[0].date;\n var schedYear = Number(schedDate.slice(0, 4));\n var schedMonth = Number(schedDate.slice(5, 7));\n var schedDay = Number(schedDate.slice(8, 10));\n\n if(year == schedYear && month == schedMonth && day == schedDay) //if current day is current schedule\n {\n var blockArray = res_object.results[0].day_type.blocks;\n for(var x = 0; x < blockArray.length; x++)\n {\n //split times into array of hours at index 0 and minutes at index 1\n var startArray = blockArray[x].start.split(':')\n var endArray = blockArray[x].end.split(':')\n if(Number(startArray[0]) > hours || ((Number(startArray[0]) == hours) && (Number(startArray[1]) > mins))) //before school or passing period\n {\n if(x == 0) //before school\n app.ask(failedMessage);\n else // passing period\n app.ask(\"School is currently in between classes. Enjoy your break!\")\n }\n else if(Number(endArray[0]) > hours || ((Number(endArray[0]) == hours) && (Number(endArray[1]) > mins))) //during this period\n app.ask(\"It is currently \" + blockArray[x].name + \"!\");\n else if(x = blockArray.length - 1) //if after the period, must continue unless last\n app.ask(failedMessage);\n }\n }\n });\n}", "title": "" }, { "docid": "a91d2fbf80628f97536998448d98f86f", "score": "0.5371249", "text": "function checkAndRun(){\r\n\tif(orderSave == 'true'){\r\n\t\torderByOnlineTimer();\r\n\t}else{\r\n\t\tstopOrder();\r\n\t}\r\n\tif(hideSave == 'true'){\r\n\t\thideOfflineTimer();\r\n\t}else{\r\n\t\tshowOffline();\r\n\t}\r\n}", "title": "" }, { "docid": "fa9ebe690c4ff1ab4df0935c56322fc3", "score": "0.53649086", "text": "function continuar() {\nif (marcha==0) { //sólo si el crono está parado\nemp2=new Date(); //fecha actual\nemp2=emp2.getTime(); //pasar a tiempo Unix\nemp3=emp2-cro; //restar tiempo anterior\nemp=new Date(); //nueva fecha inicial para pasar al temporizador\nemp.setTime(emp3); //datos para nueva fecha inicial.\nelcrono=setInterval(tiempo,10); //activar temporizador\nmarcha=1; //indicamos que se ha puesto en marcha.\n} \n}", "title": "" }, { "docid": "17e7ebf84de17951d4a4eae03c2198dd", "score": "0.5349376", "text": "handleStartTask(task){\n this.props.updateTaskStarted(task.id, true)\n }", "title": "" } ]
a2293176342d85ea1545c7af65407a1a
wraps a tokenizer to first check for a prefix string
[ { "docid": "6c40c9bf52ce62e9d457adebcb9d11be", "score": "0.69126827", "text": "function prefixed (prefix, tokenizer, transform = noop) {\n return function readPrefixed (nextChar, ...extraArgs) {\n // check if token starts with prefix\n for (let i = 0; i < prefix.length; i++) {\n if (nextChar() !== prefix[i]) return\n }\n\n // read child token\n let value = tokenizer(nextChar, ...extraArgs)\n if (value) value = transform(value)\n return value\n }\n}", "title": "" } ]
[ { "docid": "deb2ccf958b98732d9f2b876892dfb6c", "score": "0.61674017", "text": "_readPrefix(token) {\n if (token.type !== 'prefix') return this._error('Expected prefix to follow @prefix', token);\n this._prefix = token.value;\n return this._readPrefixIRI;\n }", "title": "" }, { "docid": "deb2ccf958b98732d9f2b876892dfb6c", "score": "0.61674017", "text": "_readPrefix(token) {\n if (token.type !== 'prefix') return this._error('Expected prefix to follow @prefix', token);\n this._prefix = token.value;\n return this._readPrefixIRI;\n }", "title": "" }, { "docid": "ccb8bed925c9c6951d20ca195e4fb14e", "score": "0.6141352", "text": "_readPrefix(token) {\n if (token.type !== 'prefix')\n return this._error('Expected prefix to follow @prefix', token);\n this._prefix = token.value;\n return this._readPrefixIRI;\n }", "title": "" }, { "docid": "871fcb7e02aa37f6b5655b524fa967a6", "score": "0.60660344", "text": "_readPrefix(token) {\n if (token.type !== 'prefix')\n return this._error('Expected prefix to follow @prefix', token);\n this._prefix = token.value;\n return this._readPrefixIRI;\n }", "title": "" }, { "docid": "c28157641159f38fbdcd19bfe87ad31b", "score": "0.6065725", "text": "_readPrefix(token) {\n if (token.type !== 'prefix')\n return this._error('Expected prefix to follow @prefix', token);\n this._prefix = token.value;\n return this._readPrefixIRI;\n }", "title": "" }, { "docid": "8bb6e9e8cd3ed5097415ef46f069267e", "score": "0.59621453", "text": "function stringStartsWith(string, prefix) {\n return string.slice(0, prefix.length).toLowerCase() == prefix.toLowerCase();\n }", "title": "" }, { "docid": "65f7d410572bb4a0981fce3837f324bc", "score": "0.594123", "text": "function createStartsWithFilter(startsWith) {\n // YOUR CODE BELOW HERE //\n \n return function(string){\n if(startsWith.toLowerCase() === string.charAt(0).toLowerCase()){\n return true;\n }else {return false}\n }\n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "6eb64d1bc1cd4f293a4b0d862ac03ea2", "score": "0.5847473", "text": "get _prefixMatch() { return `[^${this.separators}\"']+` }", "title": "" }, { "docid": "fe004cc829fbd738ff5468c91c948072", "score": "0.58095026", "text": "function createStartsWithFilter(startsWith) { \n // YOUR CODE BELOW HERE //\n return function(string){\n if(string[0].toLowerCase() === startsWith.toLowerCase()){ //testing if char = first element in string (we use bracket notation)\n return true;\n }else{\n return false;\n }\n };\n \n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "7d20b6c3e89ab57b1b540fdc1337f84d", "score": "0.5807958", "text": "function __stringStartsWith(str, prefix) {\n // returns true for empty string or null prefix\n if ((!str)) return false;\n if (prefix == \"\" || prefix == null) return true;\n return str.indexOf(prefix, 0) === 0;\n}", "title": "" }, { "docid": "7d20b6c3e89ab57b1b540fdc1337f84d", "score": "0.5807958", "text": "function __stringStartsWith(str, prefix) {\n // returns true for empty string or null prefix\n if ((!str)) return false;\n if (prefix == \"\" || prefix == null) return true;\n return str.indexOf(prefix, 0) === 0;\n}", "title": "" }, { "docid": "48164ad099b9b9653b04cabfbd9ca231", "score": "0.5780818", "text": "function starts_with(pre, str) {\n var bound = typeof(str) === 'string' ? false : true;\n return (bound ? pre : str).indexOf(bound ? this : pre) === 0; }", "title": "" }, { "docid": "14e27d8c7aebdaf8546c50cc6aba3ceb", "score": "0.5775699", "text": "_readPrefixIRI(token) {\n if (token.type !== 'IRI') return this._error(`Expected IRI to follow prefix \"${this._prefix}:\"`, token);\n\n const prefixNode = this._readEntity(token);\n\n this._prefixes[this._prefix] = prefixNode.value;\n\n this._prefixCallback(this._prefix, prefixNode);\n\n return this._readDeclarationPunctuation;\n }", "title": "" }, { "docid": "a451baac040fb49b29c7bec2640dc077", "score": "0.5763056", "text": "function doesStringStartWith(s, prefix) {\n\t\t return s.substr(0, prefix.length) === prefix;\n\t\t}", "title": "" }, { "docid": "02192b9e5c0eea0b1818d7b154cae420", "score": "0.57610315", "text": "_readPrefixIRI(token) {\n if (token.type !== 'IRI') return this._error('Expected IRI to follow prefix \"' + this._prefix + ':\"', token);\n\n var prefixNode = this._readEntity(token);\n\n this._prefixes[this._prefix] = prefixNode.value;\n\n this._prefixCallback(this._prefix, prefixNode);\n\n return this._readDeclarationPunctuation;\n }", "title": "" }, { "docid": "5d78ad92e2db2554e4641e269fef5222", "score": "0.57289875", "text": "_readPrefixIRI(token) {\n if (token.type !== 'IRI')\n return this._error('Expected IRI to follow prefix \"' + this._prefix + ':\"', token);\n var prefixNode = this._readEntity(token);\n this._prefixes[this._prefix] = prefixNode.value;\n this._prefixCallback(this._prefix, prefixNode);\n return this._readDeclarationPunctuation;\n }", "title": "" }, { "docid": "ef16e147add691c7b92a61f828ca4d1a", "score": "0.571681", "text": "_readPrefixIRI(token) {\n if (token.type !== 'IRI')\n return this._error('Expected IRI to follow prefix \"' + this._prefix + ':\"', token);\n var prefixNode = this._readEntity(token);\n this._prefixes[this._prefix] = prefixNode.value;\n this._prefixCallback(this._prefix, prefixNode);\n return this._readDeclarationPunctuation;\n }", "title": "" }, { "docid": "b8c5f882c2b8622d1acb5896854791bd", "score": "0.57040286", "text": "function wordStartsWithConsonantTransformation(word) {\n\n }", "title": "" }, { "docid": "e34bdd3a59970e86aef378fe4bea867b", "score": "0.5694369", "text": "function string_starts_with(st, prefix) {\n return st.slice(0, prefix.length) === prefix;\n}", "title": "" }, { "docid": "4272a0b823e8393d3a5b7ddc21e8055a", "score": "0.56937593", "text": "function createStartsWithFilter(startsWith) {\n // YOUR CODE BELOW HERE //\n /*if given a starts with character\n return function to see if string startswith character\n character\n single character\n find the character in the word\n compare the two\n return function*/\n \n \n \n return function(stringGiven) {\n const stringGivenFirstCharacter = stringGiven.toLowerCase().charAt(0);\n const lowerCaseStartsWith = startsWith.toLowerCase();\n return stringGivenFirstCharacter === lowerCaseStartsWith;\n };\n\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "c0a98c56430997cd0d2657207a8feb03", "score": "0.56588984", "text": "_readPrefixIRI(token) {\n if (token.type !== 'IRI')\n return this._error(`Expected IRI to follow prefix \"${this._prefix}:\"`, token);\n const prefixNode = this._readEntity(token);\n this._prefixes[this._prefix] = prefixNode.value;\n this._prefixCallback(this._prefix, prefixNode);\n return this._readDeclarationPunctuation;\n }", "title": "" }, { "docid": "72b5cab3bddb782d9f975800e89d8dbf", "score": "0.5592233", "text": "function appendPrefixIfNeeded(cm) {\n\tvar cur = cm.getCursor();\n\tvar token = cm.getTokenAt(cur);\n\tif (token.className == \"sp-prefixed\") {\n//\t\tif (token.string.endsWith(\":\")) {\n\t\tvar colonIndex = token.string.indexOf(\":\");\n\t\tif (colonIndex !== -1) {\n\t\t\t//check first token isnt PREFIX, and previous token isnt a '<' (i.e. we are in a uri)\n\t\t\tvar firstTokenString = getNextNonWsToken(cm, cur.line).string.toUpperCase();\n\t\t\tvar previousToken = cm.getTokenAt({line: cur.line, ch: token.start});//needs to be null (beginning of line), or whitespace\n\t\t\tif (firstTokenString != \"PREFIX\" && (previousToken.className == \"sp-ws\" || previousToken.className == null)) {\n\t\t\t\t//check whether it isnt defined already (saves us from looping through the array)\n\t\t\t\tvar currentPrefix = token.string.substring(0, colonIndex+1);\n\t\t\t\tvar queryPrefixes = getPrefixesFromQuery(cm);\n\t\t\t\tif (queryPrefixes.length == 0 || $.inArray(currentPrefix, queryPrefixes) == -1) {\n\t\t\t\t\tfor (var i = 0; i < prefixes.length; i++) {\n\t\t\t\t\t\tvar prefix = prefixes[i].substring(0, currentPrefix.length);\n\t\t\t\t\t\tif (prefix == currentPrefix) {\n\t\t\t\t\t\t\tappendToPrefixes(cm, prefixes[i]);\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}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0e0f08aedb7c90da61e2df1ba38e8faf", "score": "0.55731505", "text": "isPrefix(word) {\n let node = this.getRoot();\n for (let i = 0; i < word.length; i++) {\n var child;\n let j = 0;\n const childCount = node.getChildCount();\n for (; j < childCount; j++) {\n child = node.getChild(j);\n if (child.letter === word[i]) {\n break;\n }\n }\n if (j === childCount) {\n return false;\n }\n node = child;\n }\n\n return true;\n }", "title": "" }, { "docid": "e644fec2c174dae114004c5cd364b10f", "score": "0.55707014", "text": "startsWith(prefix) {\n let node = this.searchPrefix(prefix);\n return node != null;\n }", "title": "" }, { "docid": "7602e5260b86e0124f16e65c5a33cecb", "score": "0.55498683", "text": "function doesStringStartWith(s, prefix) {\n return s.substr(0, prefix.length) === prefix;\n}", "title": "" }, { "docid": "f4ebc9bd033211d8d471528931a4db51", "score": "0.5530188", "text": "function Prefixer(prefix) {\n\tthis.prefix = prefix;\n}", "title": "" }, { "docid": "332ae4150d0a54735331566d0ed41543", "score": "0.5504543", "text": "searchPrefix(prefix) {\n // YOUR CODE HERE\n }", "title": "" }, { "docid": "cfe2a3747f63b6c3cc557c01b520c251", "score": "0.543176", "text": "static withPrefix(value) {\n if (!this.prefixesRegexp) {\n this.prefixesRegexp = new RegExp(this.prefixes().join('|'))\n }\n\n return this.prefixesRegexp.test(value)\n }", "title": "" }, { "docid": "cfe2a3747f63b6c3cc557c01b520c251", "score": "0.543176", "text": "static withPrefix(value) {\n if (!this.prefixesRegexp) {\n this.prefixesRegexp = new RegExp(this.prefixes().join('|'))\n }\n\n return this.prefixesRegexp.test(value)\n }", "title": "" }, { "docid": "4454d44bfc35e7d6882e13fb14ece395", "score": "0.5425745", "text": "function isPrefix(word, prefix) {\n return word.startsWith(prefix.substr(0, prefix.length - 1));\n}", "title": "" }, { "docid": "cdcacbbe044f3159f19518755059b909", "score": "0.5423558", "text": "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "title": "" }, { "docid": "cdcacbbe044f3159f19518755059b909", "score": "0.5423558", "text": "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "title": "" }, { "docid": "cdcacbbe044f3159f19518755059b909", "score": "0.5423558", "text": "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "title": "" }, { "docid": "cdcacbbe044f3159f19518755059b909", "score": "0.5423558", "text": "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "title": "" }, { "docid": "4b0f2d887a9ea35bdb8a3f125dfdda84", "score": "0.5408202", "text": "function fromRegex(r) {\n return function (o) {\n return typeof o === 'string' && r.test(o);\n };\n } // Try to apply a prefix to a name", "title": "" }, { "docid": "ea599e791556d6d7b82d3521aa5f60bc", "score": "0.53998893", "text": "startsWith(prefix) {\n let root = this.root;\n let currLetter = prefix[0];\n\n for (let i = 0; i < prefix.length; i++) {\n if (currLetter in root.children) {\n root = root.children[currLetter];\n } else {\n return false;\n }\n currLetter = prefix[i + 1];\n }\n\n return true;\n }", "title": "" }, { "docid": "72ce2876816fa348b73a65fcd76433b7", "score": "0.5395025", "text": "calcBefore(prefixes, decl, prefix = '') {\n let max = this.maxPrefixed(prefixes, decl)\n let diff = max - utils.removeNote(prefix).length\n\n let before = decl.raw('before')\n if (diff > 0) {\n before += Array(diff).fill(' ').join('')\n }\n\n return before\n }", "title": "" }, { "docid": "72ce2876816fa348b73a65fcd76433b7", "score": "0.5395025", "text": "calcBefore(prefixes, decl, prefix = '') {\n let max = this.maxPrefixed(prefixes, decl)\n let diff = max - utils.removeNote(prefix).length\n\n let before = decl.raw('before')\n if (diff > 0) {\n before += Array(diff).fill(' ').join('')\n }\n\n return before\n }", "title": "" }, { "docid": "554010785f5f311c4b42465c2d5e6767", "score": "0.53878844", "text": "function normalizeKeepFirst(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 return fixSpecialNames('' + (text.slice(0, 1)) + (text.slice(1).toLowerCase()));\n }", "title": "" }, { "docid": "a046e5c75d9aaffd763b9f15ae5a2a85", "score": "0.53850394", "text": "function prefix (pre, name) {\n return typeof pre === 'string' ? pre + name\n : typeof pre === 'function' ? pre(name)\n : name\n }", "title": "" }, { "docid": "a17296309011f77a9717dd8cf2641ed1", "score": "0.5384366", "text": "function latinWordStartCheck(contextParams) {\n var char = contextParams.current;\n var prevChar = contextParams.get(-1);\n return (// ? latin first char\n prevChar === null && isLatinChar(char) || // ? latin char preceded with a non latin char\n !isLatinChar(prevChar) && isLatinChar(char)\n );\n}", "title": "" }, { "docid": "3401a6b50ecdcebecf836ab8ba5cd090", "score": "0.5380941", "text": "function prefix (pre, name) {\n return typeof pre === 'string' ? pre + name\n : typeof pre === 'function' ? pre(name)\n : name\n}", "title": "" }, { "docid": "3401a6b50ecdcebecf836ab8ba5cd090", "score": "0.5380941", "text": "function prefix (pre, name) {\n return typeof pre === 'string' ? pre + name\n : typeof pre === 'function' ? pre(name)\n : name\n}", "title": "" }, { "docid": "3401a6b50ecdcebecf836ab8ba5cd090", "score": "0.5380941", "text": "function prefix (pre, name) {\n return typeof pre === 'string' ? pre + name\n : typeof pre === 'function' ? pre(name)\n : name\n}", "title": "" }, { "docid": "ff0073e46465c3c187dd02bc5122c836", "score": "0.5371144", "text": "function _Lexer() {\n}", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.5347576", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "cc272a69b5541dfd105a12662982d96e", "score": "0.5319498", "text": "function tokenBase(stream, state) {\n var ch = stream.next();\n var before = \"\";\n\n curPunc = null;\n\n if (ch == \"?\") {\n before = getBefore(stream, /\\s/);\n var isAggregate = (before != \"\" && stream.peekback(before.length + 3).match(/\\s/) && stream.peekback(before.length + 2) == \"a\" && stream.peekback(before.length + 1) == \"s\");\n stream.match(/^[\\w\\d]*/);\n if (isAggregate) {\n return \"variable aggregate-variable\";\n }\n return \"variable\";\n } else if (ch == \"\\\"\" || ch == \"'\") {\n state.tokenize = tokenLiteral(ch);\n return state.tokenize(stream, state);\n } else if (/[{}\\(\\)\\[\\]]/.test(ch)) {\n curPunc = ch;\n return \"bracket\";\n } else if (/[,;\\/]/.test(ch)) {\n curPunc = ch;\n return \"control\";\n } else if (ch == \"<\") {\n before = getBefore(stream, /[\\s:]/);\n stream.match(/^[\\S]*>/);\n\n if (before.indexOf(\":\") != -1) {\n return \"prefix-declaration prefix-value\";\n }\n return \"entity\";\n } else if (ch == \"@\") {\n stream.match(/[\\w-]*@/);\n return \"string string-language\";\n } else if (ch == \"#\") {\n stream.match(/.*/);\n return \"comment\";\n } else {\n before = getBefore(stream, /:/);\n var match = stream.match(/[_\\w\\d\\.-]*(:(\\s*))?/);\n var word = stream.current();\n if (match && match[2] !== undefined) {\n if (match[2].length > 0) {\n stream.backUp(match[2].length);\n return \"prefix-declaration prefix-name\";\n }\n return \"entity prefixed-entity prefix-name\";\n } else if (word.match(/^[.|<|>|=]+$/)) {\n return \"control\";\n } else if (keywords.test(word)) {\n return \"keyword\";\n } else if (functions.test(word)) {\n return \"function\";\n } else if (before.length > 0) {\n return \"entity prefixed-entity entity-name\"\n } else if (word.match(/[\\d]+/)) {\n return \"literal\";\n }\n // console.warn(\"Could not tokenize word: \" + word);\n return \"other\";\n }\n }", "title": "" }, { "docid": "a00ac25d8a316676e035f2fc12c08f8e", "score": "0.53112394", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "5212d88140a2e2c402bb41cf45aadb88", "score": "0.52889997", "text": "set prefix(value) { this._prefix = value; }", "title": "" }, { "docid": "b1f8cd4138fb18b6396a24c2128bca92", "score": "0.52880424", "text": "function tokenize(code,o){\n\tif(o === undefined) o = {};\n\ttry {\n\t\t// console.log('tokenize') if o:profile\n\t\tif (o.profile) { console.time('tokenize') };\n\t\to._source = code;\n\t\tlex.reset();\n\t\tvar tokens = lex.tokenize(code,o);\n\t\tif (o.profile) { console.timeEnd('tokenize') };\n\t\t\n\t\tif (o.rewrite !== false) {\n\t\t\ttokens = rewriter.rewrite(tokens,o);\n\t\t};\n\t\treturn tokens;\n\t} catch (err) {\n\t\tthrow err;\n\t};\n}", "title": "" }, { "docid": "769e7932cc2e63a85d1897ca12c36980", "score": "0.5283282", "text": "function tokenize(code,o){\n\t\tif(o === undefined) o = {};\n\t\ttry {\n\t\t\to._source = code;\n\t\t\tlex.reset();\n\t\t\treturn lex.tokenize(code,o);\n\t\t} catch (err) {\n\t\t\tthrow err;\n\t\t};\n\t}", "title": "" }, { "docid": "f83ae6ca98d02392191655e9933a93ef", "score": "0.52769536", "text": "function makeLexer () {\n // A stack of (\n // start delimiter,\n // position of start in concatenation of chunks,\n // position of start in current chunk)\n // delimiter length in chunk\n // for each start delimiter for which we have not yet seen\n // an end delimiter.\n const delimiterStack = [ START_CONTEXT ]\n let position = 0\n\n function propagateContextOverChunk (origChunk) {\n // A suffix of origChunk that we consume as we tokenize.\n let chunk = origChunk\n while (chunk) {\n const top = delimiterStack[delimiterStack.length - 1]\n const [ topStartDelim ] = top\n let delimInfo = DELIMS[topStartDelim]\n let bodyRegExp = null\n if (delimInfo) {\n bodyRegExp = delimInfo.bodyRegExp // eslint-disable-line prefer-destructuring\n } else if (topStartDelim[0] === '<' && topStartDelim[1] === '<') {\n bodyRegExp = heredocBodyRegExp(heredocLabel(topStartDelim))\n delimInfo = DELIMS['<<']\n } else {\n throw fail`Failed to maximally match chunk ${chunk}`\n }\n const match = bodyRegExp.exec(chunk)\n // Our bodies always have a kleene-* so match will never be empty.\n const nCharsMatched = match[0].length\n chunk = chunk.substring(nCharsMatched)\n position += nCharsMatched\n\n if (!chunk) {\n // All done. Yay!\n break\n }\n\n const afterDelimitedRegion = findDelimitedRegionInChunk(\n delimInfo, origChunk, chunk)\n if (afterDelimitedRegion.length >= chunk.length) {\n throw fail`Non-body content remaining ${chunk} that has no delimiter in context ${top}`\n }\n chunk = afterDelimitedRegion\n }\n }\n\n /**\n * Look for a matching end delimiter, or, if that fails,\n * apply nesting rules to figure out which kind of start delimiters\n * we might look for.\n *\n * @param delimInfo relating to the topmost delimiter on the stack\n * @param origChunk the entire chunk being lexed\n * @param chunk the suffix of origChunk starting with the delimiter start\n *\n * @return the suffix of chunk after processing any delimiter\n */\n function findDelimitedRegionInChunk (delimInfo, origChunk, chunk) {\n let match = delimInfo.endRegExp.exec(chunk)\n if (match) {\n if (delimiterStack.length === 1) {\n // Should never occur since DELIMS[''] does not have\n // any end delimiters.\n throw fail`Popped past end of stack`\n }\n --delimiterStack.length\n position += match[0].length\n return chunk.substring(match[0].length)\n } else if (delimInfo.nests.length) {\n match = delimInfo.startRegExp.exec(chunk)\n if (match) {\n return propagateContextOverDelimiter(origChunk, chunk, match)\n }\n }\n return chunk\n }\n\n /**\n * Does some delimiter specific parsing.\n *\n * @param origChunk the entire chunk being lexed\n * @param chunk the suffix of origChunk starting with the delimiter start\n * @param match the match of the delimiters startRegExp\n */\n function propagateContextOverDelimiter (origChunk, chunk, match) {\n let [ start ] = match\n let delimLength = start.length\n if (start === '#') {\n const chunkStartInWhole = origChunk.length - chunk.length\n if (chunkStartInWhole === 0) {\n // If we have a chunk that starts with a\n // '#' then we don't know whether two\n // ShFragments can be concatenated to\n // produce an unambiguous ShFragment.\n // Consider\n // sh`foo ${x}#bar`\n // If x is a normal string, it will be\n // quoted, so # will be treated literally.\n // If x is a ShFragment that ends in a space\n // '#bar' would be treated as a comment.\n throw fail`'#' at start of ${chunk} is a concatenation hazard. Maybe use \\#`\n } else if (!HASH_COMMENT_PRECEDER.test(origChunk.substring(0, chunkStartInWhole))) {\n // A '#' is not after whitespace, so does\n // not start a comment.\n chunk = chunk.substring(1)\n position += 1\n return chunk\n }\n } else if (start === '<<' || start === '<<-') {\n // If the \\w+ part below changes, also change the \\w+ in fixupHeredoc.\n const fullDelim = /^<<-?[ \\t]*(\\w+)[ \\t]*[\\n\\r]/.exec(chunk)\n // http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_03\n // defines word more broadly.\n // We can't handle that level of complexity here\n // so fail for all heredoc that do not match word.\n if (!fullDelim) {\n throw fail`Failed to find heredoc word at ${chunk}. Just pick a label and sh will prevent collisions.`\n }\n start += fullDelim[1]\n delimLength = fullDelim[0].length\n }\n delimiterStack.push(Object.freeze(\n [ start, position, origChunk.length - chunk.length, delimLength ]))\n chunk = chunk.substring(delimLength)\n position += match[0].length\n return chunk\n }\n\n return (wholeChunk) => {\n if (wholeChunk === null) {\n // Test can end.\n if (delimiterStack.length !== 1) {\n throw fail`Cannot end in contexts ${delimiterStack.join(' ')}`\n }\n } else {\n propagateContextOverChunk(String(wholeChunk))\n }\n return delimiterStack[delimiterStack.length - 1]\n }\n}", "title": "" }, { "docid": "91b14253a04aa881245f2996dc54af7f", "score": "0.52734506", "text": "*tokenize(source, state = {}) {\n let done;\n\n // TODO: Consider supporting Symbol.species\n const Species = this.constructor;\n\n // Local context\n const contextualizer = this.contextualizer || (this.contextualizer = Species.contextualizer(this));\n let context = contextualizer.next().value;\n\n const {mode, syntax, createGrouper = Species.createGrouper || Object} = context;\n\n // Local grouping\n const groupers = mode.groupers || (mode.groupers = {});\n const grouping =\n state.grouping ||\n (state.grouping = new Grouping({\n syntax: syntax || mode.syntax,\n groupers,\n createGrouper,\n contextualizer,\n }));\n\n // Local matching\n let {match, index = 0, flags} = state;\n\n // Local tokens\n let previousToken, lastToken, parentToken;\n const top = {type: 'top', text: '', offset: index};\n\n // let lastContext = context;\n state.context = context;\n\n state.source = source;\n\n const tokenize = state.tokenize || (text => [{text}]);\n\n while (!done) {\n const {\n mode: {syntax, matchers, comments, spans, closures},\n punctuator: $$punctuator,\n closer: $$closer,\n spans: $$spans,\n matcher: $$matcher,\n token,\n forming = true,\n } = context;\n\n // Current contextual hint (syntax or hint)\n const hint = grouping.hint;\n\n while (state.context === (state.context = context)) {\n let next;\n\n // state.lastToken = lastToken;\n\n const lastIndex = state.index || 0;\n\n $$matcher.lastIndex = lastIndex;\n match = state.match = $$matcher.exec(source);\n done = index === (index = state.index = $$matcher.lastIndex) || !match;\n\n if (done) break;\n\n // Current contextual match\n const {0: text, 1: whitespace, 2: sequence, index: offset} = match;\n\n // Current quasi-contextual fragment\n const pre = source.slice(lastIndex, offset);\n pre &&\n ((next = token({\n type: 'pre',\n text: pre,\n offset: lastIndex,\n previous: previousToken,\n parent: parentToken,\n hint,\n last: lastToken,\n source,\n })),\n yield (previousToken = next));\n\n // Current contextual fragment\n const type = (whitespace && 'whitespace') || (sequence && 'sequence') || 'text';\n next = token({type, text, offset, previous: previousToken, parent: parentToken, hint, last: lastToken, source});\n\n // Current contextual punctuator (from sequence)\n const closing =\n $$closer &&\n ($$closer.test ? $$closer.test(text) : $$closer === text || (whitespace && whitespace.includes($$closer)));\n\n let after;\n let punctuator = next.punctuator;\n\n if (punctuator || closing) {\n let closed, opened, grouper;\n\n if (closing) {\n ({after, closed, parent: parentToken = top, grouper} = grouping.close(next, state, context));\n } else if ($$punctuator !== 'comment') {\n ({grouper, opened, parent: parentToken = top, punctuator} = grouping.open(next, context));\n }\n\n state.context = grouping.context = grouping.goal || syntax;\n\n if (opened || closed) {\n next.type = 'punctuator';\n context = contextualizer.next((state.grouper = grouper || undefined)).value;\n grouping.hint = `${[...grouping.hints].join(' ')} ${grouping.context ? `in-${grouping.context}` : ''}`;\n opened && (after = opened.open && opened.open(next, state, context));\n }\n }\n\n // Current contextual tail token (yield from sequence)\n yield (previousToken = next);\n\n // Next reference to last contextual sequence token\n next && !whitespace && forming && (lastToken = next);\n\n if (after) {\n let tokens, token, nextIndex;\n\n if (after.syntax) {\n const {syntax, offset, index} = after;\n const body = index > offset && source.slice(offset, index - 1);\n if (body) {\n body.length > 0 &&\n ((tokens = tokenize(body, {options: {sourceType: syntax}}, this.defaults)), (nextIndex = index));\n const hint = `${syntax}-in-${mode.syntax}`;\n token = token => ((token.hint = `${(token.hint && `${token.hint} `) || ''}${hint}`), token);\n }\n } else if (after.length) {\n const hint = grouping.hint;\n token = token => ((token.hint = `${hint} ${token.type || 'code'}`), context.token(token));\n (tokens = after).end > state.index && (nextIndex = after.end);\n }\n\n if (tokens) {\n for (const next of tokens) {\n previousToken && ((next.previous = previousToken).next = next);\n token && token(next);\n yield (previousToken = next);\n }\n nextIndex > state.index && (state.index = nextIndex);\n }\n }\n }\n }\n flags && flags.debug && console.info('[Tokenizer.tokenize‹state›]: %o', state);\n }", "title": "" }, { "docid": "219ff67404a740b1f352c975fdbb68cd", "score": "0.52724105", "text": "function newToken(prefix) {\n // generate three letters (ignoring confusing ones)\n const letters = randomString(3, 'ACEFHJKLMNPRSTUVWXY');\n // generate three digit number\n const numbers = randomString(3, '123456789');\n // generate verification number\n const code = `${prefix}${letters}${numbers}`;\n const verification = getVerificationNumber(code);\n\n if (letters.length !== 3 || numbers.toString().length != 3 || verification.toString().length !== 1) {\n throw new Error('Incorrect length found', letters, numbers, verification);\n }\n return `${code}${verification}`;\n}", "title": "" }, { "docid": "168c2d0bc1dbfdaaae1f4876c553c335", "score": "0.5267636", "text": "static isSimpleTermDefinitionPrefix(value, options) {\n return !Util.isPotentialKeyword(value)\n && (value[0] === '_' || options.allowPrefixNonGenDelims || Util.isPrefixIriEndingWithGenDelim(value));\n }", "title": "" }, { "docid": "168c2d0bc1dbfdaaae1f4876c553c335", "score": "0.5267636", "text": "static isSimpleTermDefinitionPrefix(value, options) {\n return !Util.isPotentialKeyword(value)\n && (value[0] === '_' || options.allowPrefixNonGenDelims || Util.isPrefixIriEndingWithGenDelim(value));\n }", "title": "" }, { "docid": "e33e1ec7072bcdcce16bd38188827d31", "score": "0.524935", "text": "function lex(source) {\n var prevPosition = 0;\n return function nextToken(resetPosition) {\n var token = readToken(source, resetPosition === undefined ? prevPosition : resetPosition);\n prevPosition = token.end;\n return token;\n };\n}", "title": "" }, { "docid": "36caf2268f690f0b223124bc0335c38c", "score": "0.5241079", "text": "function leading(a) {\n\t var index = a.indexOf(value);\n\t return index === 0 || a[index - 1] === ' ';\n\t } // match at name beginning only", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "b245d708bb38ddaae4679455ab05c281", "score": "0.5203052", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}", "title": "" }, { "docid": "883f3e0f2488d40a8fc03f37506e7faa", "score": "0.5191466", "text": "function lex(source) {\n\t var prevPosition = 0;\n\t return function nextToken(resetPosition) {\n\t var token = readToken(source, resetPosition === undefined ? prevPosition : resetPosition);\n\t prevPosition = token.end;\n\t return token;\n\t };\n\t}", "title": "" }, { "docid": "883f3e0f2488d40a8fc03f37506e7faa", "score": "0.5191466", "text": "function lex(source) {\n\t var prevPosition = 0;\n\t return function nextToken(resetPosition) {\n\t var token = readToken(source, resetPosition === undefined ? prevPosition : resetPosition);\n\t prevPosition = token.end;\n\t return token;\n\t };\n\t}", "title": "" }, { "docid": "883f3e0f2488d40a8fc03f37506e7faa", "score": "0.5191466", "text": "function lex(source) {\n\t var prevPosition = 0;\n\t return function nextToken(resetPosition) {\n\t var token = readToken(source, resetPosition === undefined ? prevPosition : resetPosition);\n\t prevPosition = token.end;\n\t return token;\n\t };\n\t}", "title": "" }, { "docid": "2db9dde97af7d01dd5fe44a1dff6b1ce", "score": "0.5188927", "text": "prefixed(prefix) {\n return this.name.replace(/^(\\W*)/, `$1${prefix}`)\n }", "title": "" }, { "docid": "2db9dde97af7d01dd5fe44a1dff6b1ce", "score": "0.5188927", "text": "prefixed(prefix) {\n return this.name.replace(/^(\\W*)/, `$1${prefix}`)\n }", "title": "" }, { "docid": "19c2993d73a3c4fdf137dc82fc962f6d", "score": "0.51863354", "text": "function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n return `token ${token}`;\n }", "title": "" }, { "docid": "674a31a769a81578c2899cbdcb6b20da", "score": "0.5181707", "text": "function getPrefix(editor, bufferPosition) {\r\n let line = editor.lineTextForBufferRow(bufferPosition.row);\r\n let textBeforeCursor = line.substr(0, bufferPosition.column);\r\n let normalized = textBeforeCursor.replace(/[ \\t]{2,}/g, '\\t');\r\n let reversed = normalized.split(\"\").reverse().join(\"\");\r\n let reversedPrefixMatch = /^[^\\t]+/.exec(reversed);\r\n if(reversedPrefixMatch) {\r\n return reversedPrefixMatch[0].split(\"\").reverse().join(\"\");\r\n } else {\r\n return '';\r\n }\r\n}", "title": "" } ]
279a717d6251dce31062db4f7da77eea
Use environment variables instead of hardcoding to be safer helper function to identify if memo has a valid steemit link
[ { "docid": "caf77fe1da889e34cc1a04f9f0dc0365", "score": "0.59206665", "text": "function isValidSteemitLink(link) {\n return link.indexOf('steemit.com') > -1;\n}", "title": "" } ]
[ { "docid": "c22a739f2e79294684f7cb3e5224bda1", "score": "0.6201722", "text": "_isLocalLink(link) {\n if (typeof link !== 'string') {\n return false;\n }\n\n if (link.charAt(0) == \"#\") return true;\n\n const splittedLink = link.split(\"#\");\n if (splittedLink.length > 0) {\n let linkAddress = splittedLink[0];\n\n if (window.location.pathname == linkAddress) {\n return true;\n }\n if (linkAddress.charAt(linkAddress.length - 1) == \"/\" && linkAddress.length > 1) {\n linkAddress = linkAddress.substring(0, linkAddress.length - 1);\n }\n if (linkAddress.length === 0) {\n return true;\n }\n\n let currentAddress = (window.location.href + \"\").split(\"#\")[0];\n if (typeof currentAddress !== 'string' || currentAddress.length < 1) {\n return false;\n }\n\n if (currentAddress.charAt(aktuelleAdresse.length - 1) == \"/\") {\n currentAddress = currentAddress.substring(0, currentAddress.length - 1);\n }\n\n if (linkAddress === currentAddress) {\n return true;\n }\n\n const hrefWithoutProtocol = currentAddress.split(\"://\");\n if (hrefWithoutProtocol.length >= 2 && linkAddress == hrefWithoutProtocol[1]) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "b145f7e6130dc7e54069df127345795d", "score": "0.5812143", "text": "function checkEnv() {\n\tconst {\n\t\tlocation\n\t} = window;\n\tif(/localhost|127.0.0.1/.test(location.href)){\n\t\treturn 'local';\n\t} else {\n\t\treturn 'production';\n\t}\n}", "title": "" }, { "docid": "d9eb1b8a83ffe57cdf1421a65a9531a1", "score": "0.5782978", "text": "static isExternalLink(link) {\n\t\t\tif (Story.has(link)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst urlRegExp = new RegExp(`^${Patterns.url}`, 'gim');\n\t\t\treturn urlRegExp.test(link) || /[/.?#]/.test(link);\n\t\t}", "title": "" }, { "docid": "00c0fd13943ad1827ebd11b167b4bd05", "score": "0.5766522", "text": "get infoIsUrl() {\n const url = this.slot_url;\n\n if (!url) {\n return false;\n }\n\n return !!/^(https?:\\/\\/[^\\s]+)$/.exec(url);\n }", "title": "" }, { "docid": "bfb09d8fc3f16e12e9739b65c46a3186", "score": "0.5726354", "text": "function hasMirrorLink() {\n\tvar a = getArray();\n\tvar platform = getPlatform();\n\n\tif ( a[4] == 'y' ) {\n\t\t// special handling for MAC, links in combination with general flag a[4]\n\t\tif ( platform.indexOf( \"Mac\" ) == -1 || a[5] == 'y' ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "5556812d2ce00c5fb39ebbbfa89dca45", "score": "0.5700923", "text": "function is_external(link_obj) {\n if (typeof link_obj !== 'undefined') {\n var hostname = $(link_obj).attr('href');\n if (typeof hostname !== 'undefined' && hostname != false) {\n return (link_obj.hostname != window.location.hostname);\n }\n }\n return false;\n}", "title": "" }, { "docid": "ad63a8865b5458e9ceaecc4d67433006", "score": "0.56203794", "text": "static checkUrl () {\n const host = window.location.hostname\n const config = {}\n if (!host || !host.length) return\n\n // Iterate through keys in urlCheck to get those configurations from the url.\n if (WebAlias.urlCheck === true) WebAlias.urlCheck = ['webalias', 'client', 'env']\n WebAlias.urlCheck.forEach(key => {\n config[key] = WebAlias[`get${key.charAt(0).toUpperCase() + key.slice(1).toLowerCase()}FromUrl`](host)\n })\n\n // Update the configuration.\n WebAlias.updateConfig(config)\n }", "title": "" }, { "docid": "0308b23659b9b51c32617dc815c083d2", "score": "0.5573061", "text": "function link_is_external(link_element) {\n return (link_element.host !== window.location.host);\n}", "title": "" }, { "docid": "72cec2c89058b48814ad991b0b3a948f", "score": "0.5571456", "text": "function developMomentumRedirectCheck(done) {\n const linkInfo = {\n name: \"Develop Momentum Index File\",\n skylink: \"EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw\",\n bodyHash: developMomentumBodyHash,\n metadata: developMomentumMetadata,\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "5f3eaf38572433bd6013464676e6416d", "score": "0.553365", "text": "function checkLinkExternal(link) {\n if (!(location.hostname === link.hostname || !link.hostname.length) && !jquery__WEBPACK_IMPORTED_MODULE_1___default()(link).hasClass('cta') && !jquery__WEBPACK_IMPORTED_MODULE_1___default()(link).parents().hasClass('connect-social__card') && !jquery__WEBPACK_IMPORTED_MODULE_1___default()(link).parents().hasClass('socialmedia-card')) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "802365945b92e6258c12ebe126dbb254", "score": "0.54997545", "text": "function testUTMLink( linktotest )\n{\n\tvar errorlabel = '<span style=\"color:red; text-weight:bold;\">Error: </span>';\n\tvar successlabel = '<span style=\"color:green; text-weight:bold;\">Success: the test passed</span>';\n\n\tif ( linktotest.length < 1 )\n\t{\n\t\treturn 'Please enter a link';\n\t}\n\n\t// check for issues where we can point them to the problem\n\tif ( -1 == linktotest.indexOf(\"store.steampowered.com/app/\") )\n\t{\n\t\treturn errorlabel + 'The link destination must be store.steampowered.com/app/YOUR_APP_ID';\n\t}\n\n\tif ( -1 == linktotest.indexOf(\"utm_campaign\") && -1 == linktotest.indexOf(\"utm_source\") )\n\t{\n\t\treturn errorlabel + 'A utm_campaign or utm_source parameter is required';\n\t}\n\n\t// check if there are other issues with the link.\n\t// Allow steam://openurl/ at the start\n\tlet re = new RegExp( '^(steam:\\/\\/openurl\\/)?https?:\\/\\/store\\.steampowered\\.com\\/app\\/[0-9]+(\\/?|\\/[A-Za-z0-9_]*\\/?)\\\\?(utm_campaign|utm_source|(utm_[A-Za-z0-9_]*=[A-Za-z0-9_]*&utm_campaign)|(utm_[A-Za-z0-9_]*=[A-Za-z0-9_]*&utm_source))=', 'i' );\n\n\treturn re.test( linktotest ) ? successlabel : errorlabel + 'The link does not appear valid. If you believe the link is formatted correctly please <a target=\"_blank\" href=\"https://help.steampowered.com/en/wizard/HelpWithPublishing?issueid=905\">contact us</a>.';\n\n}", "title": "" }, { "docid": "a139291405fcb164c08b7ca3831fe24b", "score": "0.5463255", "text": "function isUrlAbsoluta(target) {\n\n\tif (target.substring(0,6) == \"/fnet/\") {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "d35c14f8f33959e2d03f7e9dc39fddc9", "score": "0.5455511", "text": "function local_link (url, local)\r\n{\r\n if (url [0] == \"+\")\r\n {\r\n var dat = fs.existsSync (aliases) ? fs.readFileSync (aliases, \"utf8\") : \"\";\r\n var n = dat.indexOf (url + \",\"); if (n < 0) n = dat.indexOf (url + \"?,\");\r\n if (n < 0) url = \"\"; else\r\n {\r\n url = dat.substr (n + url.length + 1, 300);\r\n url = url.substr (url.indexOf (\"+\") + 1);\r\n url = url.substr (0, url.indexOf (\";\"));\r\n if (url && local > 0) console.log (\" FILE: \" + url);\r\n }\r\n }\r\n return (url.toLowerCase() == aliases ? \"\" : url);\r\n}", "title": "" }, { "docid": "3cb3e0c9679b5812813561fc89ac581e", "score": "0.54100484", "text": "get isSharedLink() {\n const yes_d = this.hash.hasOwnProperty('d');\n const no_s = !this.hash.hasOwnProperty('s');\n const no_shared_link = this.stories.filter(story => {\n return story.Mode == 'tag';\n }).length == 0;\n return yes_d && (no_s || no_shared_link);\n }", "title": "" }, { "docid": "3cb3e0c9679b5812813561fc89ac581e", "score": "0.54100484", "text": "get isSharedLink() {\n const yes_d = this.hash.hasOwnProperty('d');\n const no_s = !this.hash.hasOwnProperty('s');\n const no_shared_link = this.stories.filter(story => {\n return story.Mode == 'tag';\n }).length == 0;\n return yes_d && (no_s || no_shared_link);\n }", "title": "" }, { "docid": "26799d688e2abef4b9cfe076d07aec15", "score": "0.5383862", "text": "function checkUrl(longURL) {\n var check = longURL.match(/^https?:\\/\\//);\n if (check !== null) {\n return longURL;\n } else {\n return \"http://\" + longURL;\n }\n}", "title": "" }, { "docid": "d2e72061c0869e6aa0acfa00c4e1a287", "score": "0.53836995", "text": "isSymbolicLink() {\n return (this.#type & IFLNK) === IFLNK;\n }", "title": "" }, { "docid": "722d4e2f16954f0593eaf7892fc718a8", "score": "0.5352335", "text": "function link_is_external(link_element) {\n\t\t\treturn ( link_element.host !== window.location.host || link_element.href.indexOf(\"pdf\") > -1 );\n\t\t}", "title": "" }, { "docid": "76b112c4ead0d1bb22dedc083e24df02", "score": "0.53372294", "text": "function needsHTTPS() {\n if (typeof window===\"undefined\" || !window.location) return false;\n return window.location.protocol==\"https:\";\n }", "title": "" }, { "docid": "e059346a95bb452225495932409cb821", "score": "0.533697", "text": "function skyBinRedirectCheck(done) {\n const linkInfo = {\n description: \"SkyBin Redirect\",\n skylink: \"CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA\",\n bodyHash: \"767ec67c417e11b97c5db7dad9ea3b6b27cb0d39\",\n metadata: { filename: \"skybin.html\" },\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "7c50ba14a1940a7fb0daf225bdc2205e", "score": "0.5326915", "text": "function skyBinRedirectCheck(done) {\n const linkInfo = {\n name: \"SkyBin Redirect\",\n skylink: \"CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA\",\n bodyHash: \"767ec67c417e11b97c5db7dad9ea3b6b27cb0d39\",\n metadata: { filename: \"skybin.html\" },\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "103ed2526540d04c766bdd1a089f3574", "score": "0.529491", "text": "function checkUrlHash() {\n var hash = window.location.hash;\n\n // Allow deep linking to recover password form\n if (hash === '#recover') {\n toggleRecoverPasswordForm();\n }\n }", "title": "" }, { "docid": "8e47110f8c108b64f53d4424724f308e", "score": "0.5282148", "text": "function isPackageAliasEntry(val) {\n return !path.isAbsolute(val);\n}", "title": "" }, { "docid": "019c7ff234e572ba5be6904199feb1c7", "score": "0.5264975", "text": "function checkUrlsAreIntact(callback){\n\tchrome.storage.local.get([cacheLocalStorage], value1 => {\n\t\tvar urls= value1 != null && typeof value1[cacheLocalStorage] !== \"undefined\" ? value1[cacheLocalStorage] : null;\n\t\tchrome.storage.local.get([whiteListCheckLocalStorage], value2 => {\n\t\t\tvar mode= value2 != null && typeof value2[whiteListCheckLocalStorage] !== \"undefined\" ? {whitelist: value2[whiteListCheckLocalStorage]} : null;\n\t\t\tif (urls == null || mode == null){\n\t\t\t\tcallback(false);\n\t\t\t} else{\n\t\t\t\tvar currentHash= calculateHash(urls, mode);\n\t\t\t\tchrome.storage.local.get([hashLocalStorage], value => {\n\t\t\t\t\tif (value != null && value[hashLocalStorage] === currentHash){\n\t\t\t\t\t\tcallback(true);\n\t\t\t\t\t} else{\n\t\t\t\t\t\tcallback(false);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "7bf782c99041ca21238394f2463fa5b6", "score": "0.52567357", "text": "function checkURL() {\n\n console.log(\"\");\n console.log(\"\");\n\n // If invalid url.\n if (invalidurl) {\n\n console.log(\"###############################################\");\n console.log(\"\");\n console.log(\"URL Entered Not Valid\");\n console.log(\"\");\n console.log(\"###############################################\");\n\n // Exit\n start();\n }\n\n // After performing the \"check\", the next set of configs is intiated\n return\n\n}", "title": "" }, { "docid": "68fac9d63a211b75700c3c3debf3cc07", "score": "0.5254855", "text": "checkUrl() {\n const url = urlParse(this.url);\n if (url.hostname !== `www.${settings.target}.org`) {\n return `Esta URL no pertenece a ${capitalize(settings.target)} ni a Hispachan Files`;\n }\n if (!/\\/(.+)\\/res\\/(\\d+)(\\.html)?/.test(url.pathname)) {\n return 'Esta URL no pertenece a ningún hilo.';\n }\n this.parent.data.archiver.endUrl = settings.site.url + url.pathname;\n }", "title": "" }, { "docid": "efef254cc036c4cc3d16cafe36a71eda", "score": "0.5240842", "text": "function facebookCredsInEnv() {\n return !!(process.env.FB_APP_ID && process.env.FB_APP_SECRET);\n}", "title": "" }, { "docid": "b305886b8a8cb29f8dc1a1f71573f415", "score": "0.5234448", "text": "function LinkCheck(url) {\n var http = new XMLHttpRequest();\n http.open('HEAD', url, false);\n http.send();\n return http.status != 404;\n}", "title": "" }, { "docid": "468dc2df574dbff8f19b733a4c701c0a", "score": "0.5232341", "text": "function isPublishedExpoUrl(url) {\n return url.includes('https://d1wp6m56sqw74a.cloudfront.net');\n}", "title": "" }, { "docid": "f1a1799b2544b4cd5372100ec2c429f0", "score": "0.5227441", "text": "function isLink(err, command, next) {\r\n\tif (command.data.type === 'link') return next(err);\r\n\t// otherwise stop validating (don't call next validation function)\r\n}", "title": "" }, { "docid": "f4284d99417c28bf99ecfb039feabbfa", "score": "0.52258235", "text": "function checkExternalLink(el) {\n var url = el.getAttribute(\"href\"); //Get link href\n var httpRegex = /https?:\\/\\/((?:[\\w\\d-]+\\.)+[\\w\\d]{2,})/i;\n var linkMatch = url.match(httpRegex);\n\n console.log(\"linkMatch: \" + linkMatch);\n\n return linkMatch;\n }", "title": "" }, { "docid": "8082df0576119cf55c0845aca08ce41b", "score": "0.51853645", "text": "function verifyURLHash (mode) {\n var href = window.location.href;\n var hidx = href.indexOf(\"#\");\n if(hidx < 0) {\n href += \"#\"; }\n else {\n href = href.slice(0, hidx + 1); }\n if(mode === \"reference\") {\n href += \"menu=refmode\"; }\n jt.log(\"verifyURLHash \" + href);\n window.location.href = href;\n }", "title": "" }, { "docid": "72e5ebc0a6dfecb06be8c4079870f4e4", "score": "0.5180444", "text": "function goodLink(anchor) {\n if (!anchor.href || anchor.href.length == 0)\n return false\n return true\n}", "title": "" }, { "docid": "7ac9df02ead6c5eaab73b28d6291b61b", "score": "0.5171593", "text": "function isDownloadLink(f, svr) {\n return f.indexOf(svr) !== -1;\n }", "title": "" }, { "docid": "06bc173d83c707d541b001074f62108c", "score": "0.51679045", "text": "function isValidMemo(memo) {\n if (Buffer.from(memo).length > 100) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "583e064e86e4b5359ff6251c8fb08d86", "score": "0.5157072", "text": "checkLink(source, linkName) {\n let ret = linkName;\n let schLink = schema.getAllSchemasLink(source.localName, linkName.split(\":\")[1]);\n if (typeof(schLink) !== \"undefined\") {\n let linkUsed = [].filter.call(schLink.children, function(el) {\n return el.nodeName === \"cims:AssociationUsed\";\n })[0];\n if (linkUsed.textContent === \"No\") {\n let invLinkName = schema.schemaInvLinksMap.get(linkName.split(\":\")[1]);\n ret = \"cim:\" + invLinkName;\n } \n }\n return ret;\n }", "title": "" }, { "docid": "e985cba56edb5cc818585adf6a97e4f3", "score": "0.51277244", "text": "function isLink(err, command, next) {\r\n if (command.data.type === 'link') return next(err);\r\n // otherwise stop validating (don't call next validation function)\r\n}", "title": "" }, { "docid": "8c966392ff496d17c1e4fce2fc6ed933", "score": "0.5124722", "text": "function isLinkValid(strLink){\r\n\t\r\n\tstrURI = window.location.protocol + \"//\" + window.location.host + \"/wiki\"; // base url form current page\r\n\tif(strLink.indexOf(strURI) == 0\t\t\t\t// is url not directing to a foreign site\r\n\t\t\t&& strLink.indexOf(\"#\") == -1\t\t// ignore anchors\r\n\t\t\t&& strLink.lastIndexOf(\":\") < 6) \t// watching for colons is a hack for wikipedia's file/... protocol\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "3ba22c2aa179d164fd9b0126d3dd13c6", "score": "0.5113486", "text": "function url () {\n\tvar protocol = \"http\";\n\tvar secureProtocol = \"https\"\n\t\nif (protocol === \"http\") {\n\n\tconsole.log(\"Fullsail's website starts with \" + protocol + \".\");\n\t\n\tif (secureProtocol === \"https\") {\n\t\n\t\tconsole.log(\"Many secure websites start with \" + secureProtocol + \".\");\n\n\t} else {\n\n\tconsole.log(\"All websites start with \" + protocol + \".\");\n\t};\n\t\n} else {\n\t\n\tconsole.log(\"All websites start with \" + secureProtocol + \".\");\n\t}\n}", "title": "" }, { "docid": "102cb8dc4f9fd4ab8b0058fdfe475b44", "score": "0.51051444", "text": "function _detectURL(){\n\tvar winURL = window.location + \"\";\n\t/* we need the page that is showing */\n\tvar winURLReverse = reverseString(winURL);\n\tvar intLastSolidusPosition = getLastSlash(winURLReverse);\n\tvar pageName = getPageName(winURL, intLastSolidusPosition);\n\t/* we need to match our pageName with the value in our object literal \"site\" */\n\tvar intObjLiteralArrayIndex = getMatch(pageName);\n\tvar blnHasTopMenu = true;\n\n\t/* ok, use our object literal, site, second Array that has a one-one correspondance with each Array in site */\n\t/* use this second Array to write to the document */\n\twriteMessageToDocument(intObjLiteralArrayIndex);\n\t/* style the link associated with the page the visitor is rendering */\n\tif(!(!!document.getElementById(site.linkContainerId.top)) ){\n\t\tblnHasTopMenu = false;\n\t}else{\n\t\tstyleRespectiveLink(site.linkContainerId.top, intObjLiteralArrayIndex);\n\t}\t\n\tstyleRespectiveLink(site.linkContainerId.bottom, intObjLiteralArrayIndex);\n}", "title": "" }, { "docid": "58a67fab2a5dbd43385a1ae90865a6e6", "score": "0.5090659", "text": "async function linkValidator({value, name}){\n try{\n let res = await fetch(`https://cors-anywhere.herokuapp.com/${value}`)\n if (res.status === 200){\n return {pass: true, changeValue: null, messages: []}\n } else {\n return {pass: false, changeValue: \"\", messages: [\"INVALID URL\"]}\n }\n }\n\n catch{\n return {pass: false, changeValue: \"\", messages: [\"AN ERROR OCCURED, TRY AGAIN\"]}\n }\n}", "title": "" }, { "docid": "5f9a23c7433037d8d34dc0501eff5a6c", "score": "0.50753206", "text": "function isLinkValid(strLink){\r\n\t\r\n\tstrLinkPart = strLink.substring(strLink.indexOf(\".\"));\r\n\t\r\n\tstrURI = window.location.protocol + \"//\" + window.location.host + \"/people\"; // base url form current page\r\n\tstrURIPart = strURI.substring(strURI.indexOf(\".\"));\r\n\t\r\n\tif(strLinkPart.indexOf(strURIPart) == 0)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "76527191791a0112930470a9f827e066", "score": "0.5072571", "text": "function checkBinEnv(opts) {\n assert.object(opts, 'options');\n\n if (!opts.url && !process.env.MANTA_URL) {\n throw new Error('url is a required argument');\n }\n\n var noAuth = opts.noAuth === true ||\n process.env.MANTA_NO_AUTH === 'true';\n\n if (!noAuth && !opts.user && !process.env.MANTA_USER) {\n throw new Error('user is a required argument');\n }\n\n if (!noAuth && !opts.keyId && !process.env.MANTA_KEY_ID) {\n throw new Error('keyId is a required argument');\n }\n}", "title": "" }, { "docid": "faaf4093d2bb350e0511d0207e873b67", "score": "0.50645757", "text": "static hasLocalhostURLs(profile) {\n const urls = [];\n for (const nodeType of ['orderers', 'peers', 'certificateAuthorities']) {\n if (!profile[nodeType]) {\n continue;\n }\n const nodes = profile[nodeType];\n for (const nodeName in nodes) {\n if (!nodes[nodeName].url) {\n continue;\n }\n urls.push(nodes[nodeName].url);\n }\n }\n return urls.some((url) => this.isLocalhostURL(url));\n }", "title": "" }, { "docid": "ac94faeaed21c27d016cefbdfa3f01b5", "score": "0.50627434", "text": "get isMissingHash() {\n const no_s = !this.hash.hasOwnProperty('s');\n return !this.isSharedLink && no_s;\n }", "title": "" }, { "docid": "ac94faeaed21c27d016cefbdfa3f01b5", "score": "0.50627434", "text": "get isMissingHash() {\n const no_s = !this.hash.hasOwnProperty('s');\n return !this.isSharedLink && no_s;\n }", "title": "" }, { "docid": "ebda26dacf92acacfb23dee737f97db9", "score": "0.5048694", "text": "function isLink(parameter){\n\tif(parameter != null && parameter != ''){\n\t\tvar param = parameter.split('&');\n\t\tvar plength = param.length;\n\t\tfor(var i=0;i<plength;i++){\n\t\t\tvar tparam = param[i];\n\t\t\tvar key = tparam.split('=');\n\t\t\tvar tkey = key[0];\n\t\t\tif(tkey == 'isLink'){\n\t\t\t\tvar value = key[1];\n\t\t\t\treturn value == 'true';\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\t\n}", "title": "" }, { "docid": "47bcf0d5c5cc4f741e3107ed2623d533", "score": "0.5048022", "text": "function isOpenFromMTurk() {\n\n var mturk = \"mturk.com\";\n\n if (parent === window) {\n return true;\n } else {\n\n //regex to get the domain\n var referrer = document.referrer;\n var re = new RegExp(/^https?\\:\\/\\/([^\\/:?#]+)(?:[\\/:?#]|$)/i);\n var domain = referrer.match(re) && referrer.match(re)[1];\n var re2 = /.*mturk/;\n\n\t console.log(referrer);\n\n $scope.getMturkExternalSumbitUrl = re2.exec(referrer)[0] + '/externalSubmit';\n\n //check if referrer ends with mturk.com\n if (domain.indexOf(mturk, domain.length - mturk.length) !== -1) {\n\n return true;\n } else {\n return false;\n }\n }\n\n\n\n }", "title": "" }, { "docid": "7acf3e2a1ef2c0bec098110217e4cbe2", "score": "0.5045595", "text": "function checkSsl() {\n // check for SSL and whether we accept self-signed certificates and set as environment vars\n let httpsRegex = /^https:\\/\\//;\n let regex = new RegExp(httpsRegex);\n\n if (regex.test(options.stfAddress)) {\n scheme = \"https\";\n console.log(\"Running in https mode\");\n // accept self signed certificates\n if (options.acceptSelfsigned) {\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n console.log(\"Accepting self-signed certificates\")\n } else {\n console.log(\"Accepting only trusted certificates\")\n }\n } else {\n console.log(\"Running in http mode\")\n }\n }", "title": "" }, { "docid": "1deb2bb8beeac2a6d225856155e8b46b", "score": "0.5034731", "text": "function checkLinks() {\n const disabled =\n getShexText(shex).length > API.limits.byTextCharacterLimit\n ? API.sources.byText\n : shex.activeSource === API.sources.byFile\n ? API.sources.byText\n : false;\n\n setDisabledLinks(disabled);\n }", "title": "" }, { "docid": "19aeb115c2b0107a234d0093ed4f23e3", "score": "0.50319374", "text": "function isRemoteModule(specifier) {\n return (\n specifier.startsWith('//') ||\n specifier.startsWith('http://') ||\n specifier.startsWith('https://')\n );\n}", "title": "" }, { "docid": "69a7a4313d3362e7dfe19eef6570ff85", "score": "0.50216", "text": "async _checkIfusernameMatchesUri() {\n var linkPath = this._securityDescriptor.linkPath;\n if (!linkPath) return false;\n\n const user = await this._userLoader();\n if (!user) return false;\n if (!isGitHubUser(user)) return false;\n\n var currentUserName = user.username;\n if (!currentUserName) return false;\n\n return currentUserName.toLowerCase() === linkPath.toLowerCase();\n }", "title": "" }, { "docid": "9c0b7e3645efd17c151c5caaa2f32326", "score": "0.5001161", "text": "function isMemberMaliciousURL(url, dest, storeCode, callBack)\n{\n\n var time = moment().format('MMMM Do YYYY, h:mm:ss a');\n\n\n client.sismember(\"NP_URL_MALICIOUS\", url, function (error, value)\n {\n\n console.log(time + \": Result from sismember call for URL \" + url + \": value: \" + value + \" error: \" + error)\n\n if (1 == value)\n {\n console.log(\"URL \" + url + \" already known....\");\n }\n else\n {\n storeCode(url, dest, callBack);\n setstoreMaliciousURL(url);\n }\n\n });\n\n}", "title": "" }, { "docid": "8f87fa6516ebaf599494a2b021a84a2f", "score": "0.4987476", "text": "function isNotLink(err, command, next) {\r\n if (command.data.type !== 'link') {\r\n \treturn next(err);\r\n }\r\n // otherwise stop validating (don't call next validation function)\r\n}", "title": "" }, { "docid": "edc959501c717f9788e66efd16628053", "score": "0.49840322", "text": "function isNotLink(err, command, next) {\r\n\tif (command.data.type !== 'link') {\r\n\t\treturn next(err);\r\n\t}\r\n\t// otherwise stop validating (don't call next validation function)\r\n}", "title": "" }, { "docid": "e29c238b5a515bcf4f2f3de5114fb503", "score": "0.49803972", "text": "function can_i_get_meta_about_it(text) {\n return could_be_url(text);\n }", "title": "" }, { "docid": "2e820574e37bc905ef64bded66ac6379", "score": "0.49736997", "text": "function skyBayRedirectCheck(done) {\n const linkInfo = {\n description: \"SkyBay Redirect\",\n skylink: \"EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA\",\n bodyHash: \"25d63937c9734fb08d2749c6517d1b3de8ecb856\",\n metadata: {\n filename: \"skybay.html\",\n subfiles: { \"skybay.html\": { filename: \"skybay.html\", contenttype: \"text/html\", len: 11655 } },\n },\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "7a83435df425ad3be986aa1c0dc58bc9", "score": "0.49704206", "text": "function isUrl(url) {\n return url.indexOf('://') !== -1;\n } // Borrowed and adapted from https://github.com/systemjs/systemjs/blob/master/src/common.js", "title": "" }, { "docid": "5570698d386c9ed44d400c9e462c24d9", "score": "0.49679515", "text": "function isExternalURL(url){\n\t\treturn /^https?:\\/\\/.*/g.test(url);\n\t}", "title": "" }, { "docid": "9abde1d020bc3ee61b7bf2fd08d118f1", "score": "0.49676636", "text": "function skyBayRedirectCheck(done) {\n const linkInfo = {\n name: \"SkyBay Redirect\",\n skylink: \"EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA\",\n bodyHash: \"25d63937c9734fb08d2749c6517d1b3de8ecb856\",\n metadata: {\n filename: \"skybay.html\",\n subfiles: { \"skybay.html\": { filename: \"skybay.html\", contenttype: \"text/html\", len: 11655 } },\n },\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "d5ba5e75dde21090b0f81d60a8d671a4", "score": "0.4963385", "text": "function isInOfficialDevtoolsScript() {\n if (document.head) {\n return false;\n }\n var script = document.currentScript;\n if (!script) {\n return false;\n }\n var textContent = script.textContent;\n // https://github.com/facebook/react-devtools/blob/master/backend/installGlobalHook.js#L147\n if (textContent.indexOf('^_^') !== -1) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "b17d68c40d3c74d6934342b38acd7196", "score": "0.49608594", "text": "function checkURL(feed) {\n\t\t\tit ('has a URL', function() {\n\t\t\t\texpect(feed.url).toBeDefined();\n\t\t\t\texpect(feed.url.length).not.toBe(0);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "62c895c038d2adef649988966a05e012", "score": "0.49422663", "text": "function skyBinCheck(done) {\n const linkInfo = {\n description: \"SkyBin\",\n skylink: \"CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA/\",\n bodyHash: \"767ec67c417e11b97c5db7dad9ea3b6b27cb0d39\",\n metadata: { filename: \"skybin.html\" },\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "8465fd04ad666011e2c2855da04dad9c", "score": "0.4929485", "text": "function skyGalleryRedirectCheck(done) {\n const linkInfo = {\n description: \"SkyGallery Redirect\",\n skylink: \"AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg\",\n bodyHash: \"077e54054748d278114f1870f8045a162eb73641\",\n metadata: {\n filename: \"skygallery-v0.1.1-76c4c115fcb526716b2564568850f433\",\n subfiles: {\n \"css/app.84a130ed.css\": { filename: \"css/app.84a130ed.css\", contenttype: \"text/css\", len: 698 },\n \"css/chunk-5ce44031.d4e78528.css\": {\n filename: \"css/chunk-5ce44031.d4e78528.css\",\n contenttype: \"text/css\",\n offset: 698,\n len: 45,\n },\n \"css/chunk-6bef839b.593aa2be.css\": {\n filename: \"css/chunk-6bef839b.593aa2be.css\",\n contenttype: \"text/css\",\n offset: 743,\n len: 5013,\n },\n \"css/chunk-8ed50a48.8ba8c09d.css\": {\n filename: \"css/chunk-8ed50a48.8ba8c09d.css\",\n contenttype: \"text/css\",\n offset: 5756,\n len: 7204,\n },\n \"css/chunk-eb4c1efc.2a7e25ed.css\": {\n filename: \"css/chunk-eb4c1efc.2a7e25ed.css\",\n contenttype: \"text/css\",\n offset: 12960,\n len: 45,\n },\n \"css/chunk-vendors.b4f58487.css\": {\n filename: \"css/chunk-vendors.b4f58487.css\",\n contenttype: \"text/css\",\n offset: 13005,\n len: 382063,\n },\n \"img/skygallery_logo.2336197e.svg\": {\n filename: \"img/skygallery_logo.2336197e.svg\",\n contenttype: \"image/svg+xml\",\n offset: 395068,\n len: 923,\n },\n \"img/skynet-logo-animated.4d24345c.svg\": {\n filename: \"img/skynet-logo-animated.4d24345c.svg\",\n contenttype: \"image/svg+xml\",\n offset: 395991,\n len: 2600,\n },\n \"index.html\": { filename: \"index.html\", contenttype: \"text/html\", offset: 398591, len: 2534 },\n \"js/app.cff1e0a4.js\": {\n filename: \"js/app.cff1e0a4.js\",\n contenttype: \"application/javascript\",\n offset: 401125,\n len: 15604,\n },\n \"js/app.cff1e0a4.js.map\": {\n filename: \"js/app.cff1e0a4.js.map\",\n contenttype: \"application/json\",\n offset: 416729,\n len: 54424,\n },\n \"js/chunk-5ce44031.7fb55da9.js\": {\n filename: \"js/chunk-5ce44031.7fb55da9.js\",\n contenttype: \"application/javascript\",\n offset: 471153,\n len: 3644,\n },\n \"js/chunk-5ce44031.7fb55da9.js.map\": {\n filename: \"js/chunk-5ce44031.7fb55da9.js.map\",\n contenttype: \"application/json\",\n offset: 474797,\n len: 13494,\n },\n \"js/chunk-6bef839b.b543fe7d.js\": {\n filename: \"js/chunk-6bef839b.b543fe7d.js\",\n contenttype: \"application/javascript\",\n offset: 488291,\n len: 13349,\n },\n \"js/chunk-6bef839b.b543fe7d.js.map\": {\n filename: \"js/chunk-6bef839b.b543fe7d.js.map\",\n contenttype: \"application/json\",\n offset: 501640,\n len: 46690,\n },\n \"js/chunk-8ed50a48.35f8ef35.js\": {\n filename: \"js/chunk-8ed50a48.35f8ef35.js\",\n contenttype: \"application/javascript\",\n offset: 548330,\n len: 130329,\n },\n \"js/chunk-8ed50a48.35f8ef35.js.map\": {\n filename: \"js/chunk-8ed50a48.35f8ef35.js.map\",\n contenttype: \"application/json\",\n offset: 678659,\n len: 507145,\n },\n \"js/chunk-eb4c1efc.57b6e01c.js\": {\n filename: \"js/chunk-eb4c1efc.57b6e01c.js\",\n contenttype: \"application/javascript\",\n offset: 1185804,\n len: 4407,\n },\n \"js/chunk-eb4c1efc.57b6e01c.js.map\": {\n filename: \"js/chunk-eb4c1efc.57b6e01c.js.map\",\n contenttype: \"application/json\",\n offset: 1190211,\n len: 15355,\n },\n \"js/chunk-vendors.1fd55121.js\": {\n filename: \"js/chunk-vendors.1fd55121.js\",\n contenttype: \"application/javascript\",\n offset: 1205566,\n len: 749829,\n },\n \"js/chunk-vendors.1fd55121.js.map\": {\n filename: \"js/chunk-vendors.1fd55121.js.map\",\n contenttype: \"application/json\",\n offset: 1955395,\n len: 2793251,\n },\n },\n defaultpath: \"/index.html\",\n },\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "7ce435e865cd800a053cd530c3ff16d1", "score": "0.49285695", "text": "function checkGitUrl(giturl) {\n return (giturl.indexOf(GIT_PREFIX) === 0);\n}", "title": "" }, { "docid": "4afaf291d4b0250d124bceb1a1ba46f3", "score": "0.49284524", "text": "function urlCheck(url) {\n url = url.toLowerCase();\n if (url.startsWith(\"http:\") || url.startsWith(\"https:\") || url.startsWith(\"/api\")) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "4fb7cd4530d34075d9c9f8feeac6ca8e", "score": "0.49263158", "text": "async checkLink(link, statusCache=new Map()) {\n var normalizedLink = Paths.normalizePath(link.link, link.url)\n console.log(\"[fileindex] checkLink \" + link.url + \" -> \" +normalizedLink)\n var status = statusCache.get(normalizedLink)\n if (!status) {\n status = await this.validateLink(normalizedLink)\n statusCache.set(normalizedLink, status)\n }\n if (status == \"broken\") {\n console.warn(\"[fileindex ] broken link \" + link.url + \" -> \" + link.link)\n }\n await this.db.transaction(\"rw\", this.db.links, () => {\n this.db.links.where({url: link.url, link: link.link}).modify({status: status})\n })\n return status\n }", "title": "" }, { "docid": "c16f505b581a9af04572ffe8efa3bd60", "score": "0.4925239", "text": "function checkAnchors(){\n var hash = window.location.href.split(\"#\");\n if(hash[1]!=\"\"){\n showAnchor(hash[1]);\n }\n}", "title": "" }, { "docid": "a1e447bb6c0491192d66734c05d8485d", "score": "0.49219412", "text": "function skyBinCheck(done) {\n const linkInfo = {\n name: \"SkyBin\",\n skylink: \"CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA/\",\n bodyHash: \"767ec67c417e11b97c5db7dad9ea3b6b27cb0d39\",\n metadata: { filename: \"skybin.html\" },\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "0eed5178e2c2911003e62388db5a744d", "score": "0.49188998", "text": "function checkSite() {\n var path = \"./public\";\n var ok = fs.existsSync(path);\n if (ok) path = \"./public/index.html\";\n if (ok) ok = fs.existsSync(path);\n if (!ok) console.log(\"Can't find\", path);\n return ok;\n}", "title": "" }, { "docid": "c174a852f3fbe1ef7b28f9b3df14c2d6", "score": "0.49164772", "text": "function isExternalModuleSymbol(moduleSymbol){return!!(moduleSymbol.flags&1536/* Module */)&&moduleSymbol.name.charCodeAt(0)===34/* doubleQuote */;}", "title": "" }, { "docid": "eb68be853f1e56c8198ebe083b0277e5", "score": "0.49088025", "text": "isFileOnBitHub() {\n return this.indexPath.includes('/bithub/') || this.indexPath.includes('/tmp/scope-fs/');\n }", "title": "" }, { "docid": "8fa26e36a65ab1a73b3e809cc3040beb", "score": "0.49080056", "text": "function isValidURL(str) {\r\n var a = document.createElement('a');\r\n a.href = str;\r\n return (a.host && a.host != window.location.host);\r\n}", "title": "" }, { "docid": "5f2a446e2ca0bb82d8a9e794d1599c90", "score": "0.4901986", "text": "function ensureSocialUrlNotRemembered(url) {\n let gh = Cc[\"@mozilla.org/browser/global-history;2\"]\n .getService(Ci.nsIGlobalHistory2);\n let uri = Services.io.newURI(url, null, null);\n ok(!gh.isVisited(uri), \"social URL \" + url + \" should not be in global history\");\n}", "title": "" }, { "docid": "c59a303d3f6672f743b503400e9eee93", "score": "0.49019602", "text": "function validateURL(str) {\n let pattern = new RegExp(str); // fragment locator \n return !!pattern.test(window.location.href);\n}", "title": "" }, { "docid": "c9ddae2f5ddca19d21648b9868230299", "score": "0.48917913", "text": "function verifySecret(sig) {\n if ('' === process.env.NPM_SECRET)\n return true;\n \n return false;\n}", "title": "" }, { "docid": "835a234a6508de98e60f3add3b037105", "score": "0.48889688", "text": "function developMomentumCheck(done) {\n const linkInfo = {\n name: \"Develop Momentum Index File\",\n skylink: \"EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw/\",\n bodyHash: developMomentumBodyHash,\n metadata: developMomentumMetadata,\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "23d8085185724654b47c434cf7d8d476", "score": "0.4882596", "text": "function isRelativeUrl(url) {\r\n return url.protocol === \"\" &&\r\n url.separator === \"\" &&\r\n url.authority === \"\" &&\r\n url.domain === \"\" &&\r\n url.port === \"\";\r\n}", "title": "" }, { "docid": "23d8085185724654b47c434cf7d8d476", "score": "0.4882596", "text": "function isRelativeUrl(url) {\r\n return url.protocol === \"\" &&\r\n url.separator === \"\" &&\r\n url.authority === \"\" &&\r\n url.domain === \"\" &&\r\n url.port === \"\";\r\n}", "title": "" }, { "docid": "23d8085185724654b47c434cf7d8d476", "score": "0.4882596", "text": "function isRelativeUrl(url) {\r\n return url.protocol === \"\" &&\r\n url.separator === \"\" &&\r\n url.authority === \"\" &&\r\n url.domain === \"\" &&\r\n url.port === \"\";\r\n}", "title": "" }, { "docid": "18cba4145e291b8cc3b7979d4340867a", "score": "0.48702067", "text": "function dappExampleCheck(done) {\n const linkInfo = {\n description: \"Dapp Example (UniSwap)\",\n skylink: \"EAC5HJr5Pu086EAZG4fP_r6Pnd7Ft366vt6t2AnjkoFb9Q/index.html\",\n bodyHash: \"d6ad2506590bb45b5acc6a8a964a3da4d657354f\",\n metadata: {\n filename: \"/index.html\",\n length: 4131,\n subfiles: { \"index.html\": { filename: \"index.html\", contenttype: \"text/html\", len: 4131 } },\n },\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "eb63dee33498999d636c1b6aa059b2b4", "score": "0.48697656", "text": "function isAssetUrlStub(stub) {\n return isObject(stub) && typeof stub.url === 'string';\n}", "title": "" }, { "docid": "85d6625ddf8985eb6a163d344909c54e", "score": "0.48635072", "text": "function skylinkVerification(done, { name, skylink, bodyHash, metadata }) {\n const time = process.hrtime();\n\n // Create the query for the skylink\n const query = `http://${process.env.PORTAL_URL}/${skylink}?nocache=true`;\n\n // Get the Skylink\n superagent\n .get(query)\n .responseType(\"blob\")\n .then(\n (response) => {\n const entry = { name, up: true, statusCode: response.statusCode, time: calculateElapsedTime(time) };\n const info = {};\n\n // Check if the response body is valid by checking against the known hash\n const currentBodyHash = hash(response.body);\n if (currentBodyHash !== bodyHash) {\n entry.up = false;\n info.bodyHash = { expected: bodyHash, current: currentBodyHash };\n }\n\n // Check if the metadata is valid by deep comparing expected value with response\n const metadataHeader = response.header[\"skynet-file-metadata\"];\n const currentMetadata = metadataHeader && JSON.parse(metadataHeader);\n if (!isEqual(currentMetadata, metadata)) {\n entry.up = false;\n\n info.metadata = ensureValidJSON(detailedDiff(metadata, currentMetadata));\n }\n\n if (Object.keys(info).length) entry.info = info; // add info only if it exists\n\n done(entry); // Return the entry information\n },\n (error) => {\n done({\n name,\n up: false,\n statusCode: error.statusCode || error.status,\n errorResponseContent: getResponseContent(error.response),\n time: calculateElapsedTime(time),\n });\n }\n );\n}", "title": "" }, { "docid": "a7aabb579d27bb88d50541b2e632993f", "score": "0.48628446", "text": "function skylinkVerification(done, linkInfo) {\n const time = process.hrtime();\n\n // Create the query for the skylink\n const query = `http://${process.env.PORTAL_URL}/${linkInfo.skylink}?nocache=true`;\n\n // Get the Skylink\n superagent\n .get(query)\n .responseType(\"blob\")\n .end((err, res) => {\n // Record the statusCode\n const statusCode = (res && res.statusCode) || (err && err.statusCode) || null;\n let info = null;\n\n // Determine if the skylink is up. Start with checking if there was an\n // error in the request.\n let up = err === null;\n if (up) {\n // Check if the response body is valid by checking against the known\n // hash\n const validBody = hash(res.body) === linkInfo.bodyHash;\n // Check if the metadata is valid\n const metadata = res.header[\"skynet-file-metadata\"] ? JSON.parse(res.header[\"skynet-file-metadata\"]) : null;\n const validMetadata = isEqual(metadata, linkInfo.metadata);\n // Redetermine if the Skylink is up based on the results from the body\n // and metadata hash checks\n up = up && validBody && validMetadata;\n\n info = {\n body: { valid: validBody },\n metadata: { valid: validMetadata, diff: detailedDiff(metadata, linkInfo.metadata) },\n };\n }\n\n // Return the entry information\n done({\n name: linkInfo.description,\n up,\n info,\n statusCode,\n time: checks.catchRequestTime(time),\n critical: true,\n });\n });\n}", "title": "" }, { "docid": "7f92066ed7e6ac08fd4a1be7d661db99", "score": "0.48622257", "text": "function dw_checkAuth() {\n var loc = window.location.hostname.toLowerCase();\n var msg = 'A license is required for all but personal use of this code.\\n' + \n 'Please adhere to our Terms of Use if you use dyn-web code.';\n if ( !( loc == '' || loc == '127.0.0.1' || loc.indexOf('localhost') != -1 \n || loc.indexOf('192.168.') != -1 || loc.indexOf('dyn-web.com') != -1 ) ) {\n alert(msg);\n }\n}", "title": "" }, { "docid": "2cbe67d91da8ec7b323cb1e292a80846", "score": "0.4859519", "text": "function checkForValidUrl(tabId, changeInfo, tab) {\n console.log(\"CHECKING URL\", tabId, changeInfo, tab);\n}", "title": "" }, { "docid": "d61fe059708d97bb0ad5ad0d6b61295d", "score": "0.48583207", "text": "function isRemoteDataUrl(dataUrl) {\r\n return dataUrl.startsWith('http://') || dataUrl.startsWith('https://');\r\n}", "title": "" }, { "docid": "e4606e7d8ce9da3be44f09a05760e886", "score": "0.485552", "text": "async isLink(path) {\n\t\t\tpath = Path.fix(path);\n\n\t\t\tfor (let provider of providers) {\n\t\t\t\tif (await provider.exists(path)) {\n\t\t\t\t\treturn await provider.isLink(path);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new Error(\"Path '\" + path + \"' does not exist\");\n\t\t}", "title": "" }, { "docid": "fcc899ee2e88266d5a821488812b656d", "score": "0.48482102", "text": "function validateVendorUrlExternal() {\n\n $.getJSON('/validateUrl/' + $(\"#token\").val(), function (data) {\n if (data.msg === '') {\n return true;\n }\n else {\n $(\"body\").html(\"Invalid URL\");\n }\n\n });\n}", "title": "" }, { "docid": "003e1b30a6c4b2861ad47e507d08d34e", "score": "0.48462093", "text": "function skyGalleryRedirectCheck(done) {\n const linkInfo = {\n name: \"SkyGallery Redirect\",\n skylink: \"AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg\",\n bodyHash: skyGalleryBodyHash,\n metadata: skyGalleryMetadata,\n };\n\n skylinkVerification(done, linkInfo);\n}", "title": "" }, { "docid": "e640b24a82c29e9dc35b8baeee45bc06", "score": "0.4837104", "text": "function isUrl(path){return getEncodedRootLength(path)<0;}", "title": "" }, { "docid": "687a02919042717aaf4a77412b855c5a", "score": "0.48357022", "text": "function validExternal(url){\n\t\tvar ext = url.split('.').pop();\n var local = url.indexOf(\"http://localhost\");\n var addon = url.indexOf(\"chrome-extension://\");\n\n if(ext== \"html\" || ext== \"php\" || ext== \"htm\" ||\n\t\t\text== \"html#\" || ext== \"php#\" || ext== \"htm#\"){\n\n \tif(local == -1 && addon == -1){\n \t\treturn true;\n \t}\n }\n return false;\n\t}", "title": "" }, { "docid": "673f4e42ad633631f88b85644b069757", "score": "0.48337433", "text": "function filterLinks(event) {\n return event.target.hostname === 'localhost' //TODO: Find real hostname\n}", "title": "" }, { "docid": "640c3da3d4839a026881ef29a3d8aa4a", "score": "0.48263165", "text": "function urlTester() {\n let x;\n for(let feed of allFeeds){\n if(feed.url.length>0)\n x=\"defined\";\n else {\n x=undefined;\n break;\n }\n }\n return x;\n }", "title": "" }, { "docid": "b457946a61ccedd58c3058d4833ce587", "score": "0.48186404", "text": "githubRequirement(text) {\n let regexp = /^[\\w-_\\.]+\\/[\\w-_\\.]+$/;\n return regexp.test(text);\n }", "title": "" }, { "docid": "7abac0b26cbe47b7ddb4fecccc9178a3", "score": "0.4816096", "text": "function _test(prompt, symbol, keyword) {\n\tif (keyword.startsWith('CONFIG_')) {\n\t\tconst re = new RegExp(keyword.replace(\"CONFIG_\", \"\"));\n\t\treturn symbol.search(re) >= 0;\n\t} else {\n\t\tconst re = new RegExp(keyword, \"i\");\n\t\treturn prompt.search(re) >= 0 || symbol.search(re) >= 0;\n\t}\n}", "title": "" }, { "docid": "77604156ed4c813e82f18867bb022d4b", "score": "0.4815594", "text": "function isOmniInstore(){\n\tif(window.location.pathname.split(\"/\")[2] != undefined && window.location.pathname.split(\"/\")[2].indexOf(\"instore\")!=-1){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "b2da3bc6a6a493349ba54e6d6cbdd75c", "score": "0.4813751", "text": "function FindProxyForURL(url, host) {\n\tif (shExpMatch(host,\"*.dev\")) {\n\t\t//alert(\"proxy local\")\n\t\treturn \"PROXY localhost\";\n\t}\n\t//alert(\"proxy direct\")\n\treturn \"DIRECT\";\n}", "title": "" }, { "docid": "fb33478a5a7971c7ae24cb8e5da541db", "score": "0.4813585", "text": "function validateURL(url = \"\") {\n\tif (\n\t\t!url.match(\n\t\t\t// eslint-disable-next-line\n\t\t\t/^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$/\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\n\tconst { hostname, pathname } = new URL(url);\n\tlet flag = false;\n\n\t// eslint-disable-next-line\n\tswitch (hostname) {\n\t\tcase \"www.github.com\":\n\t\t\tflag = true;\n\t\t\tbreak;\n\n\t\tcase \"github.com\":\n\t\t\tflag = true;\n\t\t\tbreak;\n\n\t\tcase \"gist.github.com\":\n\t\t\tflag = true;\n\t\t\tbreak;\n\n\t\tcase \"replit.com\":\n\t\t\tflag = true;\n\t\t\tbreak;\n\n\t\tcase \"www.replit.com\":\n\t\t\tflag = true;\n\t\t\tbreak;\n\t}\n\n\tif (!pathname || pathname === \"/\") flag = false;\n\n\treturn flag;\n}", "title": "" }, { "docid": "943cf83a8c52e68345dbd9c2c5b4e73c", "score": "0.4813426", "text": "function isMerchantCircleProfileURL(string) {\n return /^(https?:\\/\\/)?(www\\.)?merchantcircle.com\\/.+$/.test(string);\n }", "title": "" } ]
3c6122c0a723122002c29d2caf657226
Fill the map with empty white blocks and draw the bounding walls and user tank
[ { "docid": "0671a6efee3b576a4880af51962f78b1", "score": "0.6243525", "text": "function clearCanvas() {\n mapCanvasContext.fillStyle = 'white';\n mapCanvasContext.fillRect(\n 0,\n 0,\n MAP_SIZE * MAPBUILDER_SCALE,\n MAP_SIZE * MAPBUILDER_SCALE\n );\n mapCanvasContext.fillStyle = 'rgb(256,0,0)';\n mapCanvasContext.fillRect(\n MAPBUILDER_SCALE,\n MAPBUILDER_SCALE,\n MAPBUILDER_SCALE,\n MAPBUILDER_SCALE\n );\n mapCanvasContext.fillStyle = 'rgb(100,100,100)';\n mapCanvasContext.fillRect(\n 0,\n 0,\n MAPBUILDER_SCALE * MAP_SIZE,\n MAPBUILDER_SCALE\n );\n mapCanvasContext.fillRect(\n 0,\n 0,\n MAPBUILDER_SCALE,\n MAPBUILDER_SCALE * MAP_SIZE\n );\n mapCanvasContext.fillRect(\n MAP_SIZE * MAPBUILDER_SCALE - MAPBUILDER_SCALE,\n 0,\n MAPBUILDER_SCALE,\n MAPBUILDER_SCALE * MAP_SIZE\n );\n mapCanvasContext.fillRect(\n 0,\n MAP_SIZE * MAPBUILDER_SCALE - MAPBUILDER_SCALE,\n MAPBUILDER_SCALE * MAP_SIZE,\n MAPBUILDER_SCALE\n );\n setTank = false;\n}", "title": "" } ]
[ { "docid": "35d36c6e7c0da5c588db85aab7fdd028", "score": "0.7451366", "text": "function drawMap() {\n // draw walls\n ctx.globalAlpha = 1;\n for (let y = 2; y < mapHeight; y++) {\n for (let x = 0; x < mapWidth; x++) {\n if (map[y*mapWidth + x] !== \".\") {\n var color = getColorByPieceCode(map[y*mapWidth + x]);\n drawRect(x*SCALE + 7*SCALE, y*SCALE - 2*SCALE, SCALE, SCALE, color);\n }\n }\n }\n}", "title": "" }, { "docid": "edc7a5df416dec3d53e436c723d9d8e8", "score": "0.72918713", "text": "function fillWall() {\n mapCanvasContext.fillStyle = 'rgb(100,100,100)';\n setTank = false;\n}", "title": "" }, { "docid": "07ae157ee6dacf8a6fbfeec2d8bcc17b", "score": "0.71651566", "text": "function drawInitMap() {\n\tvar miniMap = $(\"#minimap\")[0];\n\tvar cells = $('#cells')[0];\n\tvar wall = $('#walls')[0];\n\twall.width = cells.width = miniMap.width = width * miniMapScale + 1;\n\twall.height = cells.height = miniMap.height = height * miniMapScale + 1;\n\tvar cxt = miniMap.getContext(\"2d\");\n\tcxt.strokeStyle = \"rgba(200,200,200,1)\";\n\tfor (var x=0; x<=width; x++) {\n\t\tcxt.moveTo(x * miniMapScale,0);\n\t\tcxt.lineTo(x * miniMapScale, height * miniMapScale);\n\t\tcxt.stroke();\n\t}\n\tfor (var y=0;y<=height;y++) {\n\t\tcxt.moveTo(0, y * miniMapScale);\n\t\tcxt.lineTo(width * miniMapScale, y * miniMapScale);\n\t\tcxt.stroke();\n\t}\n}", "title": "" }, { "docid": "4beb3bf37877735d75a2a8c947965631", "score": "0.7149558", "text": "function drawmap() {\r\n\t// 2 for loops that loop through the map array.\r\n\tfor (var i = 0; i < map.length; i++) {\r\n\t for (var j = 0; j < map[i].length; j++) {\r\n\t\t\t// Drawing the the ground if the tile has a value of 0\r\n\t \tif (map[i][j] === 0) {\r\n\t\t\t\tctx.fillStyle = '#FFFFFF';\r\n\t\t ctx.fillRect(j * 40, i * 40, 40, 40);\r\n\t }\r\n\t\t\t// Drawing the player if the i and j variables are the same as playerX and playerY.\r\n\t \tif (playerX === i && playerY === j) {\r\n\t\t \tctx.fillStyle = '#FFFF00';\r\n\t\t ctx.fillRect(j * 40, i * 40, 40, 40);\r\n\t \t}\r\n\t\t\t// Drawing the walls if the tile has a value of 1;\r\n\t if (map[i][j] === 1) {\r\n\t ctx.fillStyle = '#000000';\r\n\t ctx.fillRect(j * 40, i * 40, 40, 40);\r\n\t }\r\n\t\t\t// Drawing Npc nr 1 if the tile has a value of 2.\r\n\t\t\tif (map[i][j] === 2) {\r\n\t ctx.fillStyle = '#0000FF';\r\n\t ctx.fillRect(j * 40, i * 40, 40, 40);\r\n\t }\r\n\t }\r\n\t}\r\n}", "title": "" }, { "docid": "38d931dd1128d7e0dd2b767ad64df2ca", "score": "0.70696765", "text": "function fillMap(map, x, y, size) {\n\tfor (let i = 0; i < 50; i++) {\n\t\tx = 0;\n\t\tfor (let j = 0; j < 30; j++) {\n\t\t\t//Crea los bordes del mapa exceptuando el inicio y el fin del camino\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tif (((i == 0 || i == 49) || (j == 0 || j == 29)) && matrix[i][j] != 2)\n\t\t\t\tmap[i][j] = new Chunk(borderImg, x, y, size, size, true);\n\t\t\telse if (matrix[i][j] == 1)\n\t\t\t\tmap[i][j] = new Chunk(grassImg, x, y, size, size, true); //Crea los muros internos\n\t\t\telse\n\t\t\t\tmap[i][j] = new Chunk(wallImg, x, y, size, size, false); //Crea los bloques el \"suelo\"\n\t\t\tx += size;\n\t\t}\n\t\ty += size;\n\t}\n}", "title": "" }, { "docid": "4cb19a583bdbb929cd885ef536787a88", "score": "0.70281583", "text": "function resetMap () {\r\n var x, y, num;\r\n\r\n PS.border( PS.ALL, PS.ALL, 0 ); // No borders on beads\r\n\r\n // Change active plane to PLANE_LIGHT\r\n PS.gridPlane( PLANE_LIGHT );\r\n\r\n for ( y = 0; y < GRID_HEIGHT; y += 1 ) {\r\n for ( x = 0; x < GRID_WIDTH; x += 1 ) {\r\n num = base_map [ ( y * GRID_WIDTH ) + x ];\r\n if ( num === 0 ) {\r\n PS.color( x, y, COLOR_LIGHT );\r\n } else if ( num === 1 ) {\r\n PS.color( x, y, COLOR_IMPASSABLE );\r\n }\r\n }\r\n }\r\n\r\n // Change active plane to PLANE_DARK\r\n PS.gridPlane( PLANE_DARK );\r\n\r\n for ( y = 0; y < GRID_HEIGHT; y += 1 ) {\r\n for ( x = 0; x < GRID_WIDTH; x += 1 ) {\r\n num = base_map [ ( y * GRID_WIDTH ) + x ];\r\n if ( num === 0 ) {\r\n PS.color( x, y, COLOR_DARK );\r\n } else if ( num === 1 ) {\r\n PS.color( x, y, COLOR_IMPASSABLE );\r\n }\r\n }\r\n }\r\n\r\n // Reset wall data for all beads\r\n for ( y = 0; y < GRID_HEIGHT; y += 1 ) {\r\n for (x = 0; x < GRID_WIDTH; x += 1) {\r\n PS.data( x, y, NOT_WALL );\r\n }\r\n }\r\n }", "title": "" }, { "docid": "eede3ac88c88e2e0daa194da7ecd7beb", "score": "0.68545306", "text": "function generateMap() {\n if (COLS <= 5 || ROWS <= 5) {\n alert(\"The map is too small, can't generate a map\");\n return\n }\n\n // fill the whole map with walls\n for (let row = 0; row < ROWS; row++) {\n map.push([]);\n for (let col = 0; col < COLS; col++) {\n map[row].push(ENTITIES.wall);\n }\n }\n let x = Math.floor(COLS / 2);\n let y = Math.floor(ROWS / 2);\n for (let i = 0; i < MAP_GEN_ROUNDS; i++) {\n // ensure the next step does leave a n-wide border of walls\n let nextx = x;\n let nexty = y;\n let tries = 0;\n do {\n tries++;\n // walk a random distance either in x or y direction\n let increment = directions[Math.floor(Math.random() * directions.length)];\n if (Math.random() < 0.5) {\n nextx = x + increment;\n } else {\n nexty = y + increment;\n }\n\n // if we are stuck in a wall, reset to the center to continue\n if (tries > MAX_TRIES_COUNT) {\n console.log(`reset with ${x},${y}`);\n nextx = Math.floor(COLS / 2);\n nexty = Math.floor(ROWS / 2);\n tries = 0;\n }\n } while (nextx <= 2 || nextx >= COLS - 3 || nexty <= 2 || nexty >= ROWS - 3);\n x = nextx;\n y = nexty;\n\n if (map[y][x] !== ENTITIES.floor) {\n map[y][x] = ENTITIES.floor;\n }\n }\n}", "title": "" }, { "docid": "e220dfb558eb5b5168b708ae4949ab09", "score": "0.68292516", "text": "function generateMap()\r\n{\r\n fill(0, 200, 256);\r\n rect(0, 580, 800, 20);\r\n rect(0, 0, 800, 20);\r\n rect(0, 0, 20, 600);\r\n rect(780, 0, 20, 260);\r\n rect(780, 340, 20, 260);\r\n\r\n}", "title": "" }, { "docid": "6250e2c8e99a9c6719e857a11dcc5f56", "score": "0.680776", "text": "function drawObstacles(){\r\n for(var i = 0; i < map.length; i++) {\r\n for (var j = 0; j < map[i].length; j++) {\r\n if (map[i][j]==0){\r\n ctx.fillStyle = \"black\";\r\n ctx.fillRect(hashMap[(map[i].length*i)+j][0], hashMap[(map[i].length*i)+j][1], cellsize-1, cellsize-1);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0eb0d4db69eeb332ac0ebc2ad2f6e8d5", "score": "0.67812794", "text": "function drawMap(map) {\n\n for (var i = 0; i < map.length; i++) {\n for (var j = 0; j < map[i].length; j++) {\n switch (map[i][j]) {\n\n /*case 1: \n ctx.fillStyle = \"#000000\" ; \n ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+mapOffset.y, tile_size,tile_size);\n break;\n\n case 2: \n ctx.fillStyle = \"#000000\" ; \n ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+(tile_size/2)+mapOffset.y, tile_size,tile_size/2);\n break;*/\n\n case 3:\n ctx.fillStyle = \"#e6350e\";\n ctx.fillRect(j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size / 2 + 10);\n ctx.fillStyle = \"#000000\";\n //ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+(tile_size/2)+mapOffset.y, tile_size,tile_size/2);\n break;\n\n case 4:\n ctx.fillStyle = \"#22bce3\";\n ctx.fillRect(j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size / 2 + 10);\n ctx.fillStyle = \"#000000\";\n //ctx.fillRect(j*tile_size+mapOffset.x, i*tile_size+(tile_size/2)+mapOffset.y, tile_size,tile_size/2);\n break;\n }\n }\n }\n\n\n // SHOWS GRIDLINES ///////////////////////////\n /*\n for (var i = 0; i<map.length; i++){ \n\n ctx.fillStyle = \"#ababab\" ; \n ctx.fillRect(0+mapOffset.x, i*tile_size+mapOffset.y, 1280, 1); \n }\n\n for (var j = 0; j<map[0].length; j++){\n \n ctx.fillRect(j*tile_size+mapOffset.x,0+mapOffset.y,1,720);\n \n }*/\n\n}", "title": "" }, { "docid": "8e44e852e26b2e5e47d56b324efea7a5", "score": "0.6735549", "text": "function newMap(){\n //Generate Background Border\n stageWidth = canvasCol * generateRandomNumber(200, 900);\n stageX = canvasCol * 500 - (stageWidth / 2); //Half way width. 500 is half of 1000\n stageHeight = canvasRow * generateRandomNumber(300, 700);\n stageY = canvasRow * 380 - (stageHeight / 2); //Y is slightly offset to make room for main menu\n //Get values to base our 2D Array\n pathWidth = Math.round(stageWidth / (canvasRow * 85));\n pathHeight = Math.round(stageHeight / (canvasCol * 85));\n //So randomly generated barriers fit stage width & height\n stageDivPathWidth = stageWidth / pathWidth;\n stageDivPathHeight = stageHeight / pathHeight;\n //Randomly generated map\n randomMap = createMap();\n barriers = generateMapGraphics(randomMap, 1);\n barriers = condensePath(barriers);\n nonBarriers = generateMapGraphics(randomMap, 0);\n nonBarriers = condensePath(nonBarriers);\n randomYSlice = getRandomYSlice();\n}", "title": "" }, { "docid": "41a83df0ecfa65649aeee5a7c218e4ca", "score": "0.6704209", "text": "function DrawMap()\n{\n var x=-32;\n var y=250+92;\n\nfor(var j=0;j<200;j++)\n{\n for(var i=0;i<50;i++)\n {\n block.draw(x,y,32,32);\n x=x+32;\n }\n y+=31;x=0;\n}\n for(var j=0;j<11;j++)\n {\n for(var i=0;i<50;i++)\n {\n water.draw(i*32,j*31,32,32);\n }}\n//obstacle\nif(start)\n{\n if(jumpcount>15)\n {\n jumpcount=0;\n translate4=1000;\n }\n\n if(score>lo)\n {\n lo+=100;\n xi+=1;\n s+=1;\n t2+=2;\n t3+=1;\n }\n special.drawAnimated(translate4-=3,310,[0,1,2,3,4,5,6],32,32,7);\n wall.draw(translate-=s,310,32,32);\n wall.draw(translate2-=t2,310,32,32);\n wall.draw(translate3-=t3,310,32,32);\n\n if(translate>-1&&translate<0||translate2>-1&&translate2<0||translate3>-1&&translate3<0)\n {\n document.getElementById(\"score\").textContent = Math.floor(score+=10);\n }\n\n if(translate<-2000)\n translate=1300;\n if(translate2<-1000)\n translate2=2300;\n if(translate3<-500)\n translate3=1300;\n //collision detection logic\n if(spacestart)\n {\n if(translate>=manx+10&&translate<=manx+35||translate2>=manx+10&&translate2<=manx+35||translate3>=manx+10&&translate3<=manx+35)\n {\n console.log(\"translate2\",translate2);\n console.log(\"many\",many);\n if(many>253)\n {\n console.log(\"game over\");\n console.log(\"many\",many);\n console.log(\"translate\",translate);\n start=false;\n\n\n }\n }\n if(translate+32>manx+17&&translate<manx)\n {\n if(many>253)\n {\n console.log(\"many\",many);\n console.log(\"translate\",translate);\n console.log(\"manx\",manx);\n start=false;\n }\n }\n }\nelse\n{\n if(translate>=manx+14&&translate<=manx+58||translate2>=manx+14&&translate2<=manx+58||translate3>=manx+14&&translate3<=manx+58)\n {\n console.log(\"many\",many);\n if(many>253)\n {\n console.log(\"game over\");\n console.log(\"many\",many);\n console.log(\"translate\",translate);\n start=false;\n\n }\n }\n }\n\n }\n\n\n}", "title": "" }, { "docid": "4456275cc8512278a4cb7ad08f1a8bc4", "score": "0.6666042", "text": "function drawMiniMap() {\r\n ctx = myArea.context;\r\n ctx.beginPath();\r\n ctx.fillStyle = '#000000';\r\n ctx.fillRect(595, 0, 210, 155);\r\n ctx.fillStyle = '#90ee90';\r\n ctx.fillRect(600, 0, 200, 150);\r\n var shape = gameinfo._allShapes;\r\n ctx.fillStyle = '#808080';\r\n for(var i = 0; i < shape.length; i++) {\r\n if(shape[i]._type == 'Tunnel') ctx.fillRect(600 + (shape[i]._x/32), (shape[i]._y/32), (shape[i]._width/32), (shape[i]._height/32));\r\n }\r\n ctx.fillStyle = '#b5651d';\r\n for(var i = 0; i < shape.length; i++) {\r\n if(shape[i]._type == 'room') ctx.fillRect(600 + (shape[i]._x/32), (shape[i]._y/32), (shape[i]._width/32), (shape[i]._height/32));\r\n }\r\n ctx.closePath();\r\n \r\n shape = gameinfo._allShapesPlayers;\r\n var team = gameinfo._allPlayerIndicator[screenShifter.index]._tm;\r\n var date = new Date();\r\n for(var i = 0; i < gameinfo._players.length; i++) {\r\n if(i == screenShifter.index) {\r\n ctx.beginPath();\r\n ctx.fillStyle = '#000000';\r\n ctx.arc(600 + (shape[i]._x + shape[i]._width/2)/32, (shape[i]._y + shape[i]._height/2)/32, 5, 0, 2*Math.PI);\r\n ctx.fill();\r\n ctx.closePath();\r\n }else if(gameinfo._allPlayerIndicator[i]._tm == team) {\r\n ctx.beginPath();\r\n ctx.fillStyle = '#0d98ba';\r\n ctx.arc(600 + (shape[i]._x + shape[i]._width/2)/32, (shape[i]._y + shape[i]._height/2)/32, 5, 0, 2*Math.PI);\r\n ctx.fill();\r\n ctx.closePath();\r\n }else if((date - gameinfo._allPlayerIndicator[i]._ready) < 500) {\r\n ctx.beginPath();\r\n ctx.fillStyle = '#ff0000';\r\n ctx.arc(600 + (shape[i]._x + shape[i]._width/2)/32, (shape[i]._y + shape[i]._height/2)/32, 5, 0, 2*Math.PI);\r\n ctx.fill();\r\n ctx.closePath();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6dc35df2721c65d5ef953b5f9aaba7d8", "score": "0.663487", "text": "function createMap() {\n\tdocument.write('<table>');\n\tfor ( y = 0; y < height; y++) {\n\t\tdocument.write('<tr>');\n\t\tfor( x = 0; x <width; x++) {\n\t\t\tif (x === 0|| x === width-1 || y === 0 || y === height-1) {\n\t\t\t\tdocument.write(\"<td class='wall' id='\"+x+\"-\"+y+\"'></td>\");\t\n\t\t\t} else {\n\t\t\t\tdocument.write(\"<td class='blank' id='\"+x+\"-\"+y+\"'></td>\");\n\t\t\t}\n\t\t}\n\t\tdocument.write('</tr>');\n\t}\n\tdocument.write('</table>');\n}", "title": "" }, { "docid": "93cfcdd555ac606fbfc9b252dcdec4f6", "score": "0.663201", "text": "function drawMap(){\n if(tilesReady){\n for(var y = 0; y < rows; y++){\n for(var x = 0; x < cols; x++){\n if(withinBounds(x,y)){\n ctx.drawImage(tiles, 32 * map[y][x], 0, 32, 32, (x * 32), (y * 32), 32, 32);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "ae8b8592ec01bd6147fb5ebdc899702a", "score": "0.662325", "text": "function drawMap() {\n\t var y, x, tileKind;\n\t Logic.main();\n\t requestAnimationFrame(Display.drawMap);\n\t Conf.mPanLoc.clearRect(0, 0, Conf.mPanCanvas.width, Conf.mPanCanvas.height);\n\t if(Conf.highlight) {\n\t Display.drawTile(0, CneTools.getTile('x'), CneTools.getTile('y'), Conf.tileHighlight, Conf.mPanLoc, false, 0, 0);\n\t }\n\t for(y = 0; y < Conf.yLimit; y++) {\n\t x = 0;\n\t while(x <= Conf.xLimit) {\n\t if(typeof Conf.mapTiles[Conf.level][Conf.retY - Conf.yShift + y][(Conf.retX - Math.round(Conf.xLimit / 2)) + x].kind === \"number\"){\n\t tileKind = Conf.mapTiles[Conf.level][Conf.retY - Conf.yShift + y][(Conf.retX - Math.round(Conf.xLimit / 2)) + x].kind;\n\t } else {\n\t tileKind = Conf.map[Conf.level][Conf.retY - Conf.yShift + y][(Conf.retX - Math.round(Conf.xLimit / 2)) + x].kind;\n\t }\n\n\t if(tileKind < 100) {\n\t Display.drawTile(tileKind, x, y, Conf.spritesheet, Conf.mPanel, false, 10, 3);\n\t } else if(tileKind >= 200) {\n\t Display.drawTile(tileKind - 200, x, y, Conf.spritesheet, Conf.mPanel, false, 0, 4);\n\t } else {\n\t Display.drawTile(tileKind - 100, x, y, Conf.spritesheet, Conf.mPanel, true, 0, 0);\n\t }\n\t x++;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "503ae6482c8967e02cb7fdb056c2e7e5", "score": "0.6599125", "text": "function drawMap() {\n\tgContext.clearRect(0, 0, canvas.width, canvas.height);\n\tfor (let j = 0; j < map.length; j++) {\n\t\tconst row = map[j];\n\t\tconst rowLength = row.length;\n\t\tfor (let i = 0; i < rowLength; i++) {\n\t\t\tlet tileNumber = row.charCodeAt(i) - 48;\n\t\t\tlet tile = tiles[tileNumber];\n\t\t\tlet xPosition = 32 * i;\n\t\t\tlet yPosition = 32 * j;\n\t\t\tgContext.drawImage(tile, xPosition, yPosition);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9f887151c403ee6e0ab54401988c58aa", "score": "0.6589852", "text": "function drawWalls() {\n\t//console.log(walls);\n\tvar wall = $('#walls')[0];\n\twall.width = width * miniMapScale + 1;\n\twall.height = height * miniMapScale + 1;\n\tvar cxt = wall.getContext(\"2d\");\n\tcxt.fillStyle = \"rgb(0,0,255)\";\n\tvar length = walls.length;\n\tfor (var i = 0; i < length; i++) {\n\t\tcxt.fillRect(\n\t\t\t(walls[i][0]-marginleft) * miniMapScale+1,\n\t\t\t(walls[i][1]-margintop) * miniMapScale+1,\n\t\t\tminiMapScale-2,miniMapScale-2\n\t\t);\n\t}\n}", "title": "" }, { "docid": "0ff6a8aefa3d621a5d411f4a21e94f51", "score": "0.6558448", "text": "function loop() {\n // fill background\n context.fillStyle = \"#7D7ABC\";\n context.fillRect(0, 0, canvasWidth, canvasHeight)\n\n // fill map structure\n context.fillStyle = \"#6457A6\";\n context.fillRect(0, upperMapHeight + rectHeight, canvasWidth / 3, canvasHeight - upperMapHeight - rectHeight)\n context.fillRect(canvasWidth / 3, lowerMapHeight + rectHeight, 2 * canvasWidth / 3, lowerMapHeight)\n\n // fill left rect\n context.fillStyle = \"#23F0C7\";\n context.fillRect(rectLeft.x_pos, rectLeft.y_pos, rectWidth, rectHeight);\n\n // fill center rect\n context.fillStyle = \"#FFE347\";\n context.fillRect(rectCenter.x_pos, rectCenter.y_pos, rectWidth, rectHeight);\n // adds smile or frown to center rect depending on position\n let circleXPos = rectCenter.x_pos + rectWidth / 2;\n let circleYPos = rectCenter.y_pos + rectHeight / 2;\n context.beginPath();\n if (isSmiling())\n context.arc(circleXPos, circleYPos, 30, 0, Math.PI, false);\n else\n context.arc(circleXPos, circleYPos + 30, 30, 0, Math.PI, true);\n context.moveTo(circleXPos - 10, circleYPos - 10);\n context.arc(circleXPos - 15, circleYPos - 10, 5, 0, Math.PI * 2, true);\n context.moveTo(circleXPos + 20, circleYPos - 10);\n context.arc(circleXPos + 15, circleYPos - 10, 5, 0, Math.PI * 2, true);\n context.stroke();\n\n // fill right rect\n context.fillStyle = \"#23F0C7\";\n context.fillRect(rectRight.x_pos, rectRight.y_pos, rectWidth, rectHeight);\n\n // fill platform\n context.fillStyle = \"#FFE347\";\n context.fillRect(rectPlatform.x_pos, rectPlatform.y_pos, rectWidth, platformHeight);\n\n // fill left and right buttons\n context.fillStyle = \"#23F0C7\";\n context.fillRect(rectButtonLeft.x_pos, rectButtonLeft.y_pos, rectWidth, platformHeight);\n context.fillRect(rectButtonRight.x_pos, rectButtonRight.y_pos, rectWidth, platformHeight);\n\n // handle platform movement and gravity depending on rectCenter position\n if (onLeftButton()) {\n movePlatform(platform_vel)\n }\n if (onRightButton()) {\n movePlatform(-platform_vel)\n }\n if (!onPlatform()) {\n gravity();\n }\n\n // call loop function again to draw next frame\n window.requestAnimationFrame(loop);\n}", "title": "" }, { "docid": "adb770f0f5adae7502b869c04ffb9eec", "score": "0.6555768", "text": "function Smoothe(){\r\n //borrowing from the cave.js script this is pure laziness on my part, could have made the cave.smoothe function 'public, but fuck it'\r\n for (var x = 0; x < map.length; x++) {\r\n for (var y = 0; y < map[0].length ; y++) {\r\n\r\n var surroundingWAllCount = getSurroundingWallCount(x, y), fillCondition = 4;\r\n if(surroundingWAllCount < fillCondition){ map[x][y] = 0; }\r\n if(surroundingWAllCount > fillCondition){ map[x][y] = 1; }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "5d3a1bd86c278776ad28d8c303cf88a5", "score": "0.65468246", "text": "function fillVerticalTank() {\n mapCanvasContext.fillStyle = 'rgb(253,253,253)';\n setTank = true;\n}", "title": "" }, { "docid": "86429af2ae1ef4e5174fca9839948275", "score": "0.6508946", "text": "drawMap(self){\n\t\tvar i = 0;\n\t\tactorEngine.actorStatus=\"\"\n\t\twhile(i<self.map.length){\n\t\t\tif((typeof self.map[i]) != \"undefined\" && self.map[i] != null ){\n\t\t\t\tself.drawRow(self.map[i], i);\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\tmapEngine.writeActor(actorEngine.actorStatus)\n\t}", "title": "" }, { "docid": "6aeaa0dddaf58d7f26cf7eef33df410d", "score": "0.6504219", "text": "function drawMap(map)\r\n{\r\n\t// Set the color determining the time of day\r\n\t//document.getElementById(\"canvas\").style.backgroundColor = 'rgba(158, 167, 184, 0.3)'; \r\n\r\n\tcolorizeTimeOfDay(\"canvas\");\r\n\tfor (var i = 0; i < map.cells_x; i++)\r\n\t{\r\n\t\tfor (var j = 0; j < map.cells_y; j++)\r\n\t\t{\r\n\t\t\tbtm.image = new Image();\r\n\t\t\tbtm.image.src = \"Images/Wheat1-\" + map.cells[i][j].food_herbivore + \".png\";\r\n\t\t\tctx.drawImage(btm.image, map.cells[i][j].pos_x, map.cells[i][j].pos_y, btm.width, btm.height);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "94541085b8f214534b8023344ef1f640", "score": "0.64923346", "text": "function render() {\n iterate(function (row, col) {\n let tileSize = Grid.tileSize;\n\n x = (col * tileSize);\n y = (row * tileSize);\n\n // draw placements\n if (map[row][col] !== 0) {\n let color = getTileColor(map[row][col]);\n context.fillStyle = color.fill;\n context.fillRect(x, y, tileSize, tileSize);\n context.strokeStyle = color.stroke;\n context.strokeRect(x, y, tileSize, tileSize);\n }\n });\n }", "title": "" }, { "docid": "4413f23b2feae11cd1ef3dd20c6e5c49", "score": "0.64695746", "text": "function fillHorizontalTank() {\n mapCanvasContext.fillStyle = 'rgb(254,254,254)';\n setTank = true;\n}", "title": "" }, { "docid": "9aa0cea3c68af23df7bd814273dcaef6", "score": "0.6464178", "text": "function World11(map) {\n map.locs = [\n new Location(0, 0),\n new Location(1, 0),\n new Location(0, 920, exitPipeVert)\n ];\n map.areas = [\n new Area(0, 0, \"Overworld\"),\n new Area(0, 1400, \"Underworld\")\n ];\n\n setLocationGeneration(0);\n \n pushPrePattern(\"backreg\", 0, 0, 5);\n pushPreThing(Floor, 0, 0, 69);\n pushPreThing(Block, 128, jumplev1);\n pushPreThing(Brick, 160, jumplev1);\n pushPreThing(Block, 168, jumplev1, Mushroom);\n pushPreThing(Goomba, 176, 8);\n pushPreThing(Brick, 176, jumplev1);\n pushPreThing(Block, 176, jumplev2);\n pushPreThing(Block, 184, jumplev1);\n pushPreThing(Brick, 192, jumplev1);\n pushPrePipe(224, 0, 16);\n pushPrePipe(304, 0, 24);\n pushPrePipe(368, 0, 32);\n pushPreThing(Goomba, 340, 8);\n pushPrePipe(368, 0, 32);\n pushPreThing(Goomba, 412, 8);\n pushPreThing(Goomba, 422, 8);\n pushPrePipe(456, 0, 32, false, 1);\n pushPreThing(Block, 512, 40, [Mushroom, 1], true);\n pushPreThing(Floor, 568, 0, 15);\n pushPreThing(Brick, 618, jumplev1);\n pushPreThing(Block, 626, jumplev1, Mushroom);\n pushPreThing(Brick, 634, jumplev1);\n pushPreThing(Brick, 640, jumplev2);\n pushPreThing(Goomba, 640, jumplev2 + 8);\n pushPreThing(Brick, 648, jumplev2);\n pushPreThing(Brick, 656, jumplev2);\n pushPreThing(Goomba, 656, jumplev2 + 8);\n pushPreThing(Brick, 664, jumplev2);\n pushPreThing(Brick, 672, jumplev2);\n pushPreThing(Brick, 680, jumplev2);\n pushPreThing(Brick, 688, jumplev2);\n pushPreThing(Brick, 696, jumplev2);\n pushPreThing(Floor, 712, 0, 64);\n pushPreThing(Brick, 728, jumplev2);\n pushPreThing(Brick, 736, jumplev2);\n pushPreThing(Brick, 744, jumplev2);\n pushPreThing(Brick, 752, jumplev1, Coin);\n pushPreThing(Block, 752, jumplev2);\n pushPreThing(Goomba, 776, 8);\n pushPreThing(Goomba, 788, 8);\n pushPreThing(Brick, 800, jumplev1);\n pushPreThing(Brick, 808, jumplev1, Star);\n pushPreThing(Block, 848, jumplev1);\n pushPreThing(Koopa, 856, 12);\n pushPreThing(Block, 872, jumplev1);\n pushPreThing(Block, 872, jumplev2, Mushroom);\n pushPreThing(Block, 896, jumplev1);\n pushPreThing(Goomba, 912, 8);\n pushPreThing(Goomba, 924, 8);\n pushPreThing(Brick, 944, jumplev1);\n pushPreThing(Brick, 968, jumplev2);\n pushPreThing(Brick, 976, jumplev2);\n pushPreThing(Brick, 984, jumplev2);\n pushPreThing(Goomba, 992, 8);\n pushPreThing(Goomba, 1004, 8);\n pushPreThing(Goomba, 1024, 8);\n pushPreThing(Goomba, 1036, 8);\n pushPreThing(Brick, 1024, jumplev2);\n pushPreThing(Brick, 1032, jumplev1);\n pushPreThing(Block, 1032, jumplev2);\n pushPreThing(Brick, 1040, jumplev1);\n pushPreThing(Block, 1040, jumplev2);\n pushPreThing(Brick, 1048, jumplev2); \n pushPreThing(Stone, 1072, 8, 1);\n pushPreThing(Stone, 1080, 16, 2);\n pushPreThing(Stone, 1088, 24, 3);\n pushPreThing(Stone, 1096, 32, 4);\n pushPreThing(Stone, 1120, 32, 4);\n pushPreThing(Stone, 1128, 24, 3);\n pushPreThing(Stone, 1136, 16, 2);\n pushPreThing(Stone, 1144, 8, 1);\n pushPreThing(Stone, 1184, 8, 1);\n pushPreThing(Stone, 1192, 16, 2);\n pushPreThing(Stone, 1200, 24, 3);\n pushPreThing(Stone, 1208, 32, 4);\n pushPreThing(Stone, 1216, 32, 4);\n \n pushPreThing(Floor, 1240, 0, 69);\n pushPreThing(Stone, 1240, 32, 4);\n pushPreThing(Stone, 1248, 24, 3);\n pushPreThing(Stone, 1256, 16, 2);\n pushPreThing(Stone, 1264, 8, 1);\n setEntrance(pushPreThing(Pipe, 1304, 16, 16), 2); // goes up\n \n pushPreThing(Brick, 1344, jumplev1);\n pushPreThing(Brick, 1352, jumplev1);\n pushPreThing(Block, 1360, jumplev1);\n pushPreThing(Brick, 1368, jumplev1);\n pushPreThing(Goomba, 1392, 8);\n pushPreThing(Goomba, 1404, 8);\n \n pushPreThing(Pipe, 1432, 16, 16);\n pushPreThing(Stone, 1448, 8, 1);\n pushPreThing(Stone, 1456, 16, 2);\n pushPreThing(Stone, 1464, 24, 3);\n pushPreThing(Stone, 1472, 32, 4);\n pushPreThing(Stone, 1480, 40, 5);\n pushPreThing(Stone, 1488, 48, 6);\n pushPreThing(Stone, 1496, 56, 7);\n pushPreThing(Stone, 1504, 64, 8);\n pushPreThing(Stone, 1512, 64, 8);\n endCastleOutside(1580, 0, castlev);\n \n setLocationGeneration(1);\n \n makeCeiling(32, 7);\n pushPreThing(Floor, 0, 0, 17);\n fillPreThing(Brick, 0, 8, 1, 11, 8, 8);\n fillPreThing(Brick, 32, 8, 7, 3, 8, 8);\n fillPreThing(Coin, 33, 31, 7, 2, 8, 16);\n fillPreThing(Coin, 41, 63, 5, 1, 8, 8);\n pushPreThing(PipeSide, 104, 16, 2);\n pushPreThing(PipeVertical, 120, 88, 88);\n}", "title": "" }, { "docid": "cbc8d3e4a9ec25a0a14cdf6b165b4341", "score": "0.64593834", "text": "function drawMap() {\r\n\r\n\tvar arrayIndex = 0;\r\n\tvar drawTileX = 0;\r\n\tvar drawTileY = 0;\r\n\r\n\tfor(var rowIndex = 0; rowIndex < MAP_ROWS; rowIndex++) {\r\n\t\tfor(var columnIndex = 0; columnIndex < MAP_COLS; columnIndex++) {\r\n\r\n\t\t\tvar arrayIndex = xyArrayIndex(columnIndex, rowIndex);\r\n\t\t\tvar tileType = gridMap[arrayIndex];\r\n\t\t\tvar image = mapTiles[tileType];\r\n\r\n\t\t\tif(tileTransparency(tileType) ) {\r\n\t\t\t\tcanvasContext.drawImage(mapTiles[TILE_GRASS],drawTileX,drawTileY);\r\n\t\t\t}\r\n\t\t\tcanvasContext.drawImage(image,drawTileX,drawTileY);\r\n\t\t\tdrawTileX += TILE_W;\r\n\t\t\tarrayIndex++;\r\n\t\t}\r\n\t\tdrawTileY += TILE_H;\r\n\t\tdrawTileX = 0;\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "3a12f54abda89740da849f0837b1459e", "score": "0.6439129", "text": "redrawMap(expandedRight, expandedDown) {\n\n // Grid lines\n for (var i = 0; i < this._horzLines.length; i++) {\n var horz = this._horzLines[i];\n var xPos = horz.x;\n var yPos = horz.y;\n horz.clear();\n horz.fillStyle(0x000000, 0.5);\n horz = horz.fillRect(0, ((i * 64) - 1), (this._width * 64), 2);\n }\n\n for (var i = 0; i < this._vertLines.length; i++) {\n var vert = this._vertLines[i];\n xPos = vert.x;\n yPos = vert.y;\n vert.clear();\n vert.fillStyle(0x000000, 0.5);\n vert = vert.fillRect(((i * 64) - 1), 0, 2, (this._height * 64));\n }\n\n\n // Tiles\n for (var y = 0; y < this._height; y++) {\n for (var x = 0; x < this._width; x++) {\n var tile = this.mapGetTile(x, y);\n if (tile.sprite) { continue; }\n\n var xPos = this.mapTilePos(x);\n var yPos = this.mapTilePos(y);\n\n var tileSprite = this._game.add.sprite(xPos, yPos, \"grass-0\").setOrigin(0, 0);\n tileSprite.depth = 1;\n\n this._tiles[y][x] = { sprite: tileSprite, name: \"G\" };\n this.mapInteractive(tileSprite, this._tiles[y][x]);\n\n // Vertical lines\n if (expandedRight && ((x + 1) >= this._width)) {\n var vert = this._game.add.graphics();\n vert.depth = 100;\n vert.fillStyle(0x000000, 0.5);\n vert = vert.fillRect(((x * 64) - 1), 0, 2, (this._height * 64));\n this._vertLines.push(vert);\n }\n }\n\n // Horizontal lines\n if (expandedDown && ((y + 1) >= this._height)) {\n var horz = this._game.add.graphics();\n horz.depth = 100;\n horz.fillStyle(0x000000, 0.5);\n horz = horz.fillRect(0, ((y * 64) - 1), (this._width * 64), 2);\n this._horzLines.push(horz);\n }\n }\n\n\n // Camera\n var camWidth = 64 * this._width;\n var camHeight = 64 * this._height;\n this._camera.setBounds(0, 0, camWidth, camHeight);\n }", "title": "" }, { "docid": "6ca4b0321d03aeded0fb7f0b3e6f1b66", "score": "0.6397317", "text": "drawMap() {\n // Initialize\n for (var y = 0; y < this._height; y++) {\n this._tiles.push(new Array(this._width));\n }\n\n // Draw map\n for (var y = 0; y < this._height; y++) {\n for (var x = 0; x < this._width; x++) {\n var xPos = this.mapTilePos(x);\n var yPos = this.mapTilePos(y);\n\n var tileSprite = this._game.add.sprite(xPos, yPos, \"grass-0\").setOrigin(0, 0);\n tileSprite.depth = 1;\n\n this._tiles[y][x] = { sprite: tileSprite, name: \"G\" };\n this.mapInteractive(tileSprite, this._tiles[y][x]);\n\n\n // Vertical lines\n var vert = this._game.add.graphics();\n vert.depth = 100;\n vert.fillStyle(0x000000, 0.5);\n vert = vert.fillRect(((x * 64) - 1), 0, 2, (this._height * 64));\n this._vertLines.push(vert);\n }\n\n // Horizontal lines\n var horz = this._game.add.graphics();\n horz.depth = 100;\n horz.fillStyle(0x000000, 0.5);\n horz = horz.fillRect(0, ((y * 64) - 1), (this._width * 64), 2);\n this._horzLines.push(horz);\n }\n }", "title": "" }, { "docid": "381a523e746a2040c2b9713e1f56aa1d", "score": "0.638907", "text": "function DrawMapToScreen(factor_x,factor_y){\r\n var x,y,id; \r\n var maxCols = _map.length/gb_maxRows;\r\n var maxTiles = _tiles.length/16; \r\n var cont_aux;\r\n var aux,aux1,aux2;\r\n var aux_x,aux_y;\r\n var offset_x=5;\r\n var offset_y=10;\r\n var cad_log=''; \r\n strokeWeight(1); \r\n for (y=0;y<gb_maxRows;y++){\r\n for (x=0;x<maxCols;x++){ \r\n id = _map[(y*maxCols)+x];\r\n //id = id-3;\r\n if (id>=0){\r\n cont_aux = id*2; //first row tile \r\n cad_log+=id+' ';\r\n for (i=0;i<8;i++){\r\n aux1 = _tiles[cont_aux]; //read row first 4 pixels\t\r\n\t aux2 = _tiles[cont_aux+1]; //read row end 4 pixels\t\r\n\t //cad_log+='c'+cont_aux+' '+aux1+' '+aux2+'|';\t\r\n\t //cad_log+=aux1+' '+aux2+'|';\t\r\n\t aux_x = (x*4)*factor_x;\r\n\t aux_y = ((y*8)+i)*factor_y;\r\n\t //0x03,0x01\r\n\t aux = ((aux1>>4)&(0x0F));\r\n\t //aux = GetArtefactColorGray(aux);\r\n\t aux = GetArtefactColor(aux);\r\n\t //cad_log+=' '+aux;\r\n\t //stroke(aux);\t \r\n\t stroke(aux);\r\n\t fill(aux);\r\n\t rect((offset_x+(aux_x)),offset_y+aux_y,factor_x,factor_y);\r\n\t aux = (aux1 & 0x0F);\r\n\t //aux = GetArtefactColorGray(aux);\r\n\t //cad_log+=' '+aux;\r\n\t //stroke(aux);\t \r\n\t stroke(GetArtefactColor(aux));\r\n\t fill(GetArtefactColor(aux));\r\n\t rect((offset_x+(aux_x+(1*factor_x))),offset_y+aux_y,factor_x,factor_y);\t \r\n\t aux = ((aux2>>4)&(0x0F));\r\n\t //aux = GetArtefactColorGray(aux);\r\n\t //cad_log+=' '+aux;\r\n\t //stroke(aux);\t \r\n\t stroke(GetArtefactColor(aux));\r\n\t fill(GetArtefactColor(aux));\r\n\t rect((offset_x+(aux_x+(2*factor_x))),offset_y+aux_y,factor_x,factor_y);\t\r\n\t aux = (aux2 & 0x0F);\r\n\t //aux = GetArtefactColorGray(aux);\t \r\n\t //cad_log+=' '+aux;\r\n\t //stroke(aux);\t\t \r\n\t stroke(GetArtefactColor(aux));\r\n\t fill(GetArtefactColor(aux));\r\n rect((offset_x+(aux_x+(3*factor_x))),offset_y+aux_y,factor_x,factor_y);\r\n\t cont_aux = cont_aux+ (maxTiles*2); //next row Tile \t\r\n }\r\n }\r\n }\r\n }\r\n //console.log(cad_log);\r\n}", "title": "" }, { "docid": "51db3a5be42981b06d9d9e1f3873a1b6", "score": "0.6338877", "text": "function drawMap(map)\n{\n\t$('.center-pane').empty()\n\tmap.pop()\n\n\n\tfor(i=0;i<map.length;i++){\n\t\tfor (w in wadi){\n\t\t\tif(wadi[w]['ID']==Number(map[i]['wadi_ID']))\n\t\t\t\tbreak\n\t\t}\n\t\tfor (s in souq){\n\t\t\tif(souq[s]['ID']==Number(map[i]['souq_ID']))\n\t\t\t\tbreak\n\t\t}\n\t\tdraw(w,s,100)\n\t}\n\t\t\n\t\n}", "title": "" }, { "docid": "a694ea7389a61baf76aa060acccc49fa", "score": "0.6327777", "text": "function drawMap(){\n for(let x = 0; x < 8; x++){\n for(let y = 0; y < 8; y++){\n if(g_horizontalMap[x][y] == 10){\n var body = new Cube();\n body.color = [.64, .17, .17, 1];\n body.textureNum = 3;\n //body.matrix.translate(0,0,0);\n body.matrix.translate(39,1,-22);\n body.matrix.scale(12,25,1);\n body.matrix.translate(x-4, -.17, y-6);\n body.render();\n }\n if(g_verticalMap[x][y] == 10){\n var body = new Cube();\n body.color = [.64, 0, .17, 1];\n body.textureNum = 3;\n body.matrix.translate(-.5 , 1, 33);\n body.matrix.scale(1, 25 , 8);\n body.matrix.translate(x-4, -.17, y-6);\n body.render();\n }\n }\n}\n for(let x = 0; x < 25; x++){\n for(let y = 0; y < 25; y++){\n if(g_mazeMap[x][y] == 10){\n var body = new Cube();\n body.color = [1, 0, 0, 1];\n body.textureNum = 2;\n body.matrix.translate(4.5, -.5, -7);\n body.matrix.scale(2,2,2);\n body.matrix.translate(x-4, -.17, y-6);\n body.render();\n }\n }\n }\n\n}", "title": "" }, { "docid": "821cbd6a895479836ec5629e42c27ec9", "score": "0.63214475", "text": "function renderMaze(mazeCanvas)\n{\n \n var ctx = mazeCanvas.getContext(\"2d\"); \n \n var tileWidth = mazeCanvas.width/MAZE_SIZE;\n var tileHeight = mazeCanvas.height/MAZE_SIZE;\n \n ctx.strokeStyle = WALL_COLOUR;\n ctx.lineWidth = 2;\n \n //loop through cells of the maze and draw lines\n for(var x = 0; x<MAZE_SIZE; x++)\n {\n for(var y = 0; y<MAZE_SIZE; y++)\n {\n //render NS wall\n \n if(walls_ns[x][y])\n {\n \n //calculate the start coords of this NS line \n var nsStartX = (x * tileWidth) + tileWidth;\n var nsStartY = (y * tileHeight);\n \n //calculate the end coords of this NS line\n var nsEndX = (x * tileWidth) + tileWidth;\n var nsEndY = (y * tileHeight) + tileHeight;\n \n //render this NS line\n ctx.beginPath();\n ctx.moveTo(nsStartX,nsStartY);\n ctx.lineTo(nsEndX,nsEndY);\n ctx.closePath();\n ctx.stroke();\n }\n \n \n //render EW wall\n \n if(walls_ew[x][y])\n {\n \n //calculate the start coords of this EW line\n var ewStartX = x * tileWidth;\n var ewStartY = y * tileHeight + tileHeight;\n \n //calculate the end coords of this EW line\n var ewEndX = x * tileWidth + tileWidth;\n var ewEndY = y * tileHeight + tileHeight;\n \n //render this EW wall\n ctx.beginPath();\n ctx.moveTo(ewStartX,ewStartY);\n ctx.lineTo(ewEndX,ewEndY);\n ctx.closePath();\n ctx.stroke();\n }\n }\n }\n \n //render the goal in the bottom-right corner\n var goalX = GOAL_CELL.x * tileWidth;\n var goalY = GOAL_CELL.y * tileHeight;\n \n var goalWidth = tileWidth*0.7;\n var goalHeight = tileHeight*0.7;\n \n ctx.fillStyle=GOAL_COLOUR;\n \n ctx.fillRect(goalX + (tileWidth * 0.15), //x\n goalY + (tileHeight * 0.15), //y\n goalWidth, goalHeight);\n}", "title": "" }, { "docid": "2d4e90cae86199cbd623cffe15ef6461", "score": "0.63150585", "text": "function drawMap() {\n map = document.createElement('div');\n\n let tiles = createTiles(gameData);\n for (let tile of tiles) {\n map.appendChild(tile);\n }\n document.body.appendChild(map); \n}", "title": "" }, { "docid": "8522e628aa366148799f282e398d1e56", "score": "0.6285659", "text": "function GenerateMap(){\n\tGrid.init((Level._level - 1)*4 + 20, (Level._level - 1)+5, canvas.width, canvas.height - INFOBAR);\n}", "title": "" }, { "docid": "60ffac7f6cf2a2761fb80b1b081eafa1", "score": "0.6280435", "text": "testTerrainWall() {\n const x = Math.floor(this.tilesWide / 2)\n const startY = Math.floor(this.tilesHigh * (1 / 4))\n const endY = Math.floor(this.tilesHigh * (3 / 4))\n\n for (let y = startY; y < endY; y++) {\n this.set(x, y, 0)\n }\n }", "title": "" }, { "docid": "284162ea66c627501d08526cb8751036", "score": "0.6276603", "text": "function createGroundMap() {\n\t\tg.groundCanvas.width = g.mc;\n\t\tg.groundCanvas.height = g.mr;\n\t\tg.groundCtx.imageSmoothingEnabled = false;\n\n\t\tlet tiles = [];\n\t\tlet y = 0;\n\t\tlet seed = 1;\n\n\t\tg.map.forEach( ( v, i ) => {\n\t\t\tlet x = i % g.mc;\n\t\t\tlet green = 90 + g.rndSeed( seed++ ) * 20;\n\t\t\tlet c = `rgb(18,${~~green},40)`;\n\n\t\t\t// Stone.\n\t\t\tif( v & 4 ) {\n\t\t\t\tc = '#282828';\n\t\t\t}\n\t\t\t// Water border.\n\t\t\telse if( !x || !y || x == g.mc - 1 || y == g.mr - 1 ) {\n\t\t\t\tlet blue = 140 + g.rndSeed( seed++ ) * 60;\n\t\t\t\tc = `rgb(30,90,${~~blue})`;\n\t\t\t\tg.map[i] = 16;\n\t\t\t}\n\n\t\t\tg.groundCtx.fillStyle = c;\n\t\t\tg.groundCtx.fillRect( x, y, 1, 1 );\n\n\t\t\ty += !( ++i % g.mc );\n\t\t} );\n\t}", "title": "" }, { "docid": "7d341a9741c4ffd4b0dc4804c78afabb", "score": "0.62624", "text": "function buildWalls() {\n\tvar e = arguments[0]||window.event;\n var x = parseInt((e.pageX - $('#layout3').offset().left)/miniMapScale)+marginleft;\n\tvar y = parseInt((e.pageY - $('#layout3').offset().top)/miniMapScale)+margintop;\n\t//alert(x+\" \"+y);\n\tif (map[x][y] == 0) {\n\t\twalls[walls.length] = [x, y];\n\t}else {\n\t\tvar index = multiDimArraySearch(x,y, walls);\n if (index > -1) {\n \twalls.splice(index, 1);\n }\n\t}\n\tmap[x][y] = - 1 - map[x][y];\n\tdrawWalls();\n}", "title": "" }, { "docid": "1645cc653c5ced9be214ecd0aa173509", "score": "0.6253996", "text": "update () {\n let nextMap = this.getMap()\n for (let x = 0; x < this.map.length; x++) {\n for (let y = 0; y < this.map[x].length; y++) {\n let nbrOfCells = this.checkProximity(x, y)\n if (this.map[x][y]) {\n if (nbrOfCells >= 2 && nbrOfCells <= 3) {nextMap[x][y] = true}\n }\n else {\n if (nbrOfCells === 3) {nextMap[x][y] = true}\n }\n } \n }\n this.map = nextMap\n this.turn++\n this.render()\n }", "title": "" }, { "docid": "a18ecd57458fae499c9009dc4f015b7f", "score": "0.6240163", "text": "function drawMap(ctx) {\n clearCanvas(canvasCTX);\n drawBackground(canvasCTX);\n\n\n // Update all of the ants in the sytem\n if (RUNNING) {\n TICK += 1;\n for (var i = 0; i < ANTS_LIST.length; i++)\n ANTS_LIST[i].update();\n\n // Grow food\n simulationFoodSystem.growFood();\n }\n\n // Update each cell on the map\n for (var i = 0; i < NUM_OF_CELLS; i++) {\n\n if (RUNNING) {\n // Update and draw the pheromones in the cell\n for (var k = 0; k < MAP[i].pheromone.length; k++) {\n var pheromone = MAP[i].pheromone[k];\n pheromone.update();\n }\n }\n\n // Draw only the first ant\n if (MAP[i].ant.length > 0) {\n var ant = MAP[i].ant[0];\n ant.draw(ctx);\n } else if (MAP[i].pheromone.length > 0) {\n var pheromone = MAP[i].pheromone[0];\n pheromone.draw(ctx);\n } else if (MAP[i].food !== void(0)) { // Don't draw food on top of ants\n var food = MAP[i].food;\n food.draw(ctx);\n }\n }\n drawGrid(canvasCTX);\n}", "title": "" }, { "docid": "e249fcfdb799c659e946f376f9a1533c", "score": "0.62372005", "text": "function Map(size) {\n\tthis.size = size;\n\tthis.wallArray = Wall.wallArray( size*size );\n\tthis.skybox = new Bitmap('outdoor_background.png');\n\tthis.light = 0;\n}", "title": "" }, { "docid": "36620941778f162d2d8423859d02a9b1", "score": "0.6226365", "text": "function drawGMap(map) {\n\n for (var i = 0; i < map.length; i++) {\n for (var j = 0; j < map[i].length; j++) {\n switch (map[i][j]) {\n\n case 91:\n ctx.drawImage(tileSheet, 40, 80, 40, 40, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size);\n break;\n\n case 92:\n ctx.drawImage(tileSheet, 80, 40, 40, 40, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size);\n break;\n\n case 93:\n ctx.drawImage(tileSheet, 0, 40, 40, 40, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size);\n break;\n\n case 94:\n ctx.drawImage(tileSheet, 40, 0, 40, 40, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size);\n break;\n\n case 95:\n ctx.drawImage(tileSheet, 0, 0, 40, 40, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size);\n break;\n\n case 96:\n ctx.drawImage(tileSheet, 80, 0, 40, 40, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size);\n break;\n\n case 97:\n ctx.drawImage(tileSheet, 80, 80, 40, 40, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size);\n break;\n\n case 98:\n ctx.drawImage(tileSheet, 0, 80, 40, 40, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size);\n break;\n\n case 99:\n ctx.drawImage(tileSheet, 40, 40, 40, 40, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y, tile_size, tile_size);\n break;\n\n case 10:\n ctx.drawImage(tileSheet, 40, 0, 40, 20, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y + tile_size / 2, tile_size, tile_size / 2);\n break;\n case 11:\n ctx.drawImage(tileSheet, 40, 0, 40, 20, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y + tile_size / 2, tile_size, tile_size / 2);\n break;\n case 12:\n ctx.drawImage(tileSheet, 40, 0, 40, 20, j * tile_size + mapOffset.x, i * tile_size + mapOffset.y + tile_size / 2, tile_size, tile_size / 2);\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "15182503a3bc0b24683dede47a31459b", "score": "0.62216085", "text": "function wall() {\r\n\r\n for(var c=0;c<brick_col;c++){\r\n \tfor(var r=0;r<brick_row;r++){\r\n \t\tif(bricks[c][r].status==1){\r\n \t\tvar brick_x=(c*(brick_width+brick_padding))+offsetleft;\r\n \t\tvar brick_y=(r*(brick_width+brick_padding))+offsettop;\r\n \t\tbricks[c][r].x=brick_x;\r\n \t\tbricks[c][r].y=brick_y;\r\n \t\tcontext.beginPath();\r\n \t\tcontext.rect(brick_x,brick_y,brick_width,brick_height);\r\n \t\tcontext.fillStyle=color_c[count];\r\n \t\tcontext.strokeStyle=\"yellow\";\r\n \t\tcontext.fill();\r\n \t\tcontext.closePath();\r\n \t}\r\n }\r\n\r\n}\r\nif(count!=2){\r\ncount++;\r\n\r\n}\r\nelse{\r\n\tcount=0;\r\n}\r\n}", "title": "" }, { "docid": "92cc4ca5a877321ae7d1a72742bfb289", "score": "0.62203413", "text": "function DrawMap() {\n GetMap(characters.player.map);\n for (let y = 0; y < mapArrays[int].map.length; y++) {\n for (let x = 0; x < mapArrays[int].map[y].length; x++) {\n setImage(x, y);\n function setImage(x, y) {\n let img = new Image();\n switch (mapArrays[int].map[y][x]) {\n case 9:\n img.src = \"resources/images/tiles/forbidden_tile.png\";\n break;\n case 0:\n img.src = \"resources/images/tiles/water_tile.png\";\n break;\n case 1:\n img.src = \"resources/images/tiles/grass_tile.png\";\n break;\n case 2:\n img.src = \"resources/images/tiles/cobble_tile.png\";\n break;\n case 3:\n img.src = \"resources/images/tiles/tree_tile.png\";\n break;\n }\n img.onload = function () {\n ctx.drawImage(img, x * 80, y * 80);\n if (characters.player.cords.x == x && characters.player.cords.y == y && !characters.player.lit) DrawPlayer();\n else if (characters.player.cords.x == x && characters.player.cords.y == y && characters.player.lit) DrawPlayerHighlight();\n }\n }\n }\n }\n}", "title": "" }, { "docid": "ce08302e440e7e18816cd4b345e2965e", "score": "0.6212232", "text": "paintBlockedCells () {\n this.context.fillStyle = 'lightskyblue'\n this.context.strokeStyle = 'azure'\n const blockedCells = this.game.grid.getCells().filter((cell) => cell.blocked)\n blockedCells.forEach((cell) => {\n let position = cell.getTopLeftPosition()\n this.context.strokeRect(position.x, position.y, CELL_EDGE_SIZE, CELL_EDGE_SIZE)\n this.context.fillRect(position.x, position.y, CELL_EDGE_SIZE, CELL_EDGE_SIZE)\n })\n\n this.game.towers.forEach((tower) => {\n this._paintBoundaries(tower.getBoundaries(), 'red')\n })\n }", "title": "" }, { "docid": "794dd5cb831a042c80dbe49324701200", "score": "0.61824465", "text": "function initializeMap() {\n debug.log(\"intializing map...\");\n \n/*\n player.x = map.spawnPoint.x;\n player.y = map.spawnPoint.y - 1 + 0.2;\n player.hitbox.x = map.spawnPoint.x;\n player.hitbox.y = map.spawnPoint.y;\n */\n map.tiles = map.map;\n\n let minW = map.tiles[0].x;\n let minH = map.tiles[0].y;\n let maxW = 0;\n let maxH = 0;\n for (let i = 0; i < map.tiles.length; i++) {\n if (map.tiles[i].x + map.tiles[i].w > maxW) {\n maxW = map.tiles[i].x + map.tiles[i].w;\n }\n if (map.tiles[i].y + map.tiles[i].h > maxH) {\n maxH = map.tiles[i].y + map.tiles[i].h;\n }\n if (map.tiles[i].x < minW) {\n minW = map.tiles[i].x;\n }\n if (map.tiles[i].y < minH) {\n minH = map.tiles[i].y;\n }\n }\n let margin = 6;\n let marginX, marginY;\n if (maxW - minW < meta.tilesWidth) {\n marginX = (meta.tilesWidth - (maxW - minW)) / 2 + (meta.tilesWidth - (maxW - minW)) % 2 / 2 + margin;\n } else {\n marginX = 4;\n }\n if (maxH - minH < meta.tilesHeight) {\n marginY = (meta.tilesHeight - (maxH - minH)) / 2 + (meta.tilesHeight - (maxH - minH)) % 2 / 2 + margin;\n } else {\n marginY = 4;\n }\n\n/*\n map.levelX = minW - marginX;\n map.levelY = minH - marginY;\n map.levelWidth = maxW + marginX;\n map.levelHeight = maxH + marginY;\n*/\n map.entities = [];\n map.vfxs = [];\n var removeList = [];\n for (let i = map.tiles.length - 1; i >= 0; i--) {\n if (map.tiles[i].type != 0) {\n map.tiles[i].solid = false;\n } else {\n map.tiles[i].solid = true;\n }\n switch (map.tiles[i].type) {\n case 1:\n break;\n\n case 2:\n break;\n\n case 3:\n break;\n\n case 4:\n break;\n\n case 5:\n break;\n\n case 6:\n break;\n\n case 7:\n break;\n\n case 8:\n break;\n \n case 9:\n break;\n \n case 10:\n break;\n \n case 11:\n break;\n \n case 12:\n break;\n \n case 13:\n break;\n \n case 14:\n break;\n }\n }\n debug.log(\"map initialized, \" + map.entities.length + \" entities found\");\n for (let i = 0; i < removeList.length; i++) {\n map.tiles.splice(removeList[i], 1);\n }\n}", "title": "" }, { "docid": "55c619b19f5720fa89a9354dbd4a6e06", "score": "0.6177856", "text": "function createMapBlocks(game, mapArray, mapX, mapY, tileX, tileY, group, list) {\n\n const MARGIN = 2; // TODO\n\n // Run horizontally for each row\n for (var py = 0; py < mapY; py++) {\n // Gather consecutive blocks with length longer than one\n var indices = mapRunLine(mapArray, py*mapX, 1, mapX);\n for (var i = 0; i < indices.length / 2; i++) {\n var start = indices[i*2];\n var end = indices[i*2 + 1];\n var width = tileX * (end-start + 1);\n var height = tileY;\n var centerX = 0.5*tileX*(end + start) + tileX*0.5;\n var centerY = py*tileY + 0.5*tileY;\n var newRect = game.add.rectangle(centerX, centerY, width - MARGIN, height, 0xff0000);\n newRect.setDepth(9.0);\n newRect.setAlpha(0.15);\n newRect.setVisible(false);\n group.add(newRect);\n list.push(newRect);\n }\n }\n\n // Run vertically for each column\n for (var px = 0; px < mapX; px++) {\n // Gather consecutive blocks with length longer than one\n var indices = mapRunLine(mapArray, px, mapX, mapY);\n for (var i = 0; i < indices.length / 2; i++) {\n var start = indices[i*2];\n var end = indices[i*2 + 1];\n var width = tileX;\n var height = tileY* (end-start + 1);\n var centerX = px*tileX + 0.5*tileX;\n var centerY = 0.5*tileY*(end + start) + tileY*0.5;\n var newRect = game.add.rectangle(centerX, centerY, width, height - MARGIN, 0xff0000);\n newRect.setDepth(9.0);\n newRect.setAlpha(0.15);\n newRect.setVisible(false);\n group.add(newRect);\n list.push(newRect);\n }\n }\n\n // Add singles\n for (var px = 0; px < mapX; px++) {\n for (var py = 0; py < mapY; py++) {\n if (\n mapIsBlocked(mapArray[(px)+(py)*mapX])\n && (px == 0 || !mapIsBlocked(mapArray[(px-1)+(py)*mapX]))\n && (px == mapX -1 || !mapIsBlocked(mapArray[(px+1)+(py)*mapX]))\n && (py == 0 || !mapIsBlocked(mapArray[(px)+(py-1)*mapX]))\n && (py == mapY - 1 || !mapIsBlocked(mapArray[(px)+(py+1)*mapX]))\n ) {\n var cx = px*tileX + tileX*0.5;\n var cy = py*tileY + tileY*0.5;\n var newRect = game.add.rectangle(cx, cy, tileX, tileY, 0xff0000);\n newRect.setDepth(9.0);\n newRect.setAlpha(0.15);\n newRect.setVisible(false);\n group.add(newRect);\n list.push(newRect);\n }\n }\n }\n\n console.log('Number of blocking rects: ' + list.length);\n\n}", "title": "" }, { "docid": "4a9653b09f83b1538a90752941443d26", "score": "0.6174198", "text": "function drawUnmapped(tier, canvas, padding) {\n let drawStart = tier.browser.viewStart - 1000.0/tier.browser.scale;\n let drawEnd = tier.browser.viewEnd + 1000.0/tier.browser.scale;\n let unmappedBlocks = [];\n if (tier.knownCoverage) {\n let knownRanges = tier.knownCoverage.ranges();\n knownRanges.forEach((range, index) => {\n if (index === 0) {\n if (range.min() > drawStart)\n unmappedBlocks.push({min: drawStart, max: range.min() - 1});\n } else {\n unmappedBlocks.push({min: knownRanges[index-1].max() + 1, max: range.min() - 1});\n }\n\n if (index == knownRanges.length - 1 && range.max() < drawEnd) {\n unmappedBlocks.push({min: range.max() + 1, max: drawEnd});\n }\n });\n }\n if (unmappedBlocks.length > 0) {\n canvas.fillStyle = 'gray';\n unmappedBlocks.forEach(block => {\n let min = (block.min - tier.browser.viewStart) * tier.browser.scale + 1000;\n let max = (block.max - tier.browser.viewStart) * tier.browser.scale + 1000;\n canvas.fillRect(min, 0, max - min, padding);\n });\n }\n}", "title": "" }, { "docid": "907f900d2d3d5077b66c8051a4bace8b", "score": "0.6173929", "text": "function generateMaze() {\n // ctx.beginPath();\n\n for (let i = 0; i < maze1Walls.length; i++) {\n ctx.beginPath();\n maze1Walls[i].render();\n ctx.stroke();\n }\n\n // //border walls\n // wall14.render();\n // wall15.render();\n // wall16.render();\n // wall17.render();\n\n // ctx.stroke();\n}", "title": "" }, { "docid": "d9fdd97a5c52b351a2a516a96da35d3e", "score": "0.61570257", "text": "function drawHeatmap() {\n\t\tif(unique <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(mapDiv === null) {\n\t\t\t//$log.log(preDebugMsg + \"no mapDiv to draw on\");\n\t\t\treturn;\n\t\t}\n\n\t\tif(!map) {\n\t\t\t//$log.log(preDebugMsg + \"map not loaded yet\");\n\t\t\treturn;\n\t\t}\n\n\t\t//$log.log(preDebugMsg + \"drawHeatmap\");\n\n\t\tcurrentColors = $scope.gimme(\"GroupColors\");\n\t\tif(typeof currentColors === 'string') {\n\t\t\tcurrentColors = JSON.parse(currentColors);\n\t\t}\n\n\n\t\tvar globalSelections = [];\n\t\tvar globalSelectionsPerId = $scope.gimme('GlobalSelections');\n\t\tif(globalSelectionsPerId.hasOwnProperty('DataIdSlot')) {\n\t\t\tglobalSelections = globalSelectionsPerId['DataIdSlot'];\n\t\t}\n\n\t\tlastSeenGlobalSelections = [];\n\t\tfor(var set = 0; set < globalSelections.length; set++) {\n\t\t\tlastSeenGlobalSelections.push([]);\n\t\t\tfor(var i = 0; i < globalSelections[set].length; i++) {\n\t\t\t\tlastSeenGlobalSelections[set].push(globalSelections[set][i]);\n\t\t\t}\n\t\t}\n\n\t\tvar scale = Math.pow(2, mapZoom);\n\n\t\ttry {\n\t\t\tvar mapBounds = map.getBounds();\n\t\t\tvar mapNE = mapBounds.getNorthEast();\n\t\t\tvar mapSW = mapBounds.getSouthWest();\n\t\t\tvar proj = map.getProjection();\n\t\t\tvar NEpx = proj.fromLatLngToPoint(mapNE);\n\t\t\tvar SWpx = proj.fromLatLngToPoint(mapSW);\n\t\t\tvar mapMinLat = mapSW.lat();\n\t\t\tvar mapMaxLat = mapNE.lat();\n\t\t\tvar mapMinLon = mapSW.lng();\n\t\t\tvar mapMaxLon = mapNE.lng();\n\t\t\tvar passDateLine = false;\n\t\t\tif(mapMinLon > mapMaxLon) {\n\t\t\t\tpassDateLine = true;\n\t\t\t}\n\n\t\t\tvar worldWidth = 256 * scale;\n\t\t\tvar mapWorldWraps = false;\n\t\t\tif(drawW > worldWidth) {\n\t\t\t\tmapWorldWraps = true;\n\t\t\t}\n\n\t\t\tvar currentPlace = map.getCenter();\n\t\t\tvar pCenter = proj.fromLatLngToPoint(currentPlace);\n\t\t\t// $log.log(preDebugMsg + \"lat \" + mapMinLat + \" to \" + mapMaxLat);\n\t\t\t// $log.log(preDebugMsg + \"lon \" + mapMinLon + \" to \" + mapMaxLon);\n\t\t\t// $log.log(preDebugMsg + \"scale \" + scale + \", can fit \" + (drawW / worldWidth) + \" worlds in window\");\n\t\t\tvar NSpxs = SWpx.y * scale - NEpx.y * scale; // subtracting small numbers gives loss of precision?\n\t\t\tvar WEpxs = NEpx.x * scale - SWpx.x * scale;\n\t\t} catch(e) {\n\t\t\t//$log.log(preDebugMsg + \"No map to draw on yet\");\n\t\t\t$timeout(function(){updateSize(); \t/*$log.log(preDebugMsg + \"drawHeatmap timeout function calls updateGraphics\");*/ updateGraphics();});\n\t\t\treturn;\n\t\t}\n\n\t\tvar col;\n\t\tvar fill;\n\t\tvar zeroTransp = 0.3;\n\t\tif(transparency < 1) {\n\t\t\tzeroTransp *= transparency;\n\t\t}\n\t\tvar zeroTranspAlpha = Math.floor(255*zeroTransp);\n\n\t\tif(myCanvas === null) {\n\t\t\tvar canvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(canvasElement.length > 0) {\n\t\t\t\tmyCanvas = canvasElement[0];\n\t\t\t}\n\t\t}\n\n\t\tif(myCtx === null) {\n\t\t\tmyCtx = myCanvas.getContext(\"2d\");\n\t\t}\n\n\t\tmyCtx.clearRect(0,0, myCanvas.width, myCanvas.height);\n\n\t\tvar rgba0 = hexColorToRGBAvec(legacyDDSupLib.getColorForGroup(0, colorPalette, currentColors), zeroTransp);\n\t\tvar rgbaText = hexColorToRGBAvec(textColor, 1.0);\n\t\tvar imData = myCtx.getImageData(0, 0, myCanvas.width, myCanvas.height);\n\t\tvar pixels = imData.data;\n\t\tvar valSpan = (limits.maxVal - limits.minVal);\n\t\tvar latPerPixel = (mapNE.lat() - mapSW.lat()) / myCanvas.height;\n\t\tvar lonPerPixel = (mapNE.lng() - mapSW.lng()) / myCanvas.width;\n\n\t\tfor(var set = 0; set < Ns.length; set++) {\n\t\t\tvar selArray = [];\n\t\t\tif(set < globalSelections.length) {\n\t\t\t\tselArray = globalSelections[set];\n\t\t\t}\n\t\t\tvar lon1 = lons1[set];\n\t\t\tvar lat1 = lats1[set];\n\t\t\tvar val1 = vals1[set];\n\t\t\tvar votes = {};\n\n\t\t\tfor(var i = 0; i < Ns[set]; i++) {\n\t\t\t\tvar inside = false\n\n\t\t\t\tif(mapWorldWraps) {\n\t\t\t\t\tinside = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar latInside = false;\n\t\t\t\t\tif((mapMinLat <= lat1[i]\n\t\t\t\t\t\t&& mapMaxLat >= lat1[i]) || (Math.abs(lat1[i] - mapMinLat) <= limits.minLatDiff || Math.abs(lat1[i] - mapMaxLat) <= limits.minLatDiff)) {\n\t\t\t\t\t\tlatInside = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar lonInside = false;\n\t\t\t\t\tvar normalizedLon = lon1[i]; // Google Maps API wants longitudes to be in -180 to 180, some data sets are in 0 to 360\n\t\t\t\t\twhile(normalizedLon < -180) {\n\t\t\t\t\t\tnormalizedLon += 360;\n\t\t\t\t\t}\n\t\t\t\t\twhile(normalizedLon > 180) {\n\t\t\t\t\t\tnormalizedLon -= 360;\n\t\t\t\t\t}\n\n\t\t\t\t\tif((!passDateLine && mapMinLon <= normalizedLon && mapMaxLon >= normalizedLon) || (passDateLine && (mapMinLon <= normalizedLon || mapMaxLon >= normalizedLon)) || (Math.abs(lon1[i] - mapMinLon) <= limits.minLonDiff || Math.abs(lon1[i] - mapMaxLon) <= limits.minLonDiff)) {\n\t\t\t\t\t\tlonInside = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(latInside && lonInside) {\n\t\t\t\t\t\tinside = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(inside) {\n\t\t\t\t\tvar p1 = new google.maps.LatLng(lat1[i], lon1[i]);\n\t\t\t\t\tvar p1px = proj.fromLatLngToPoint(p1);\n\n\t\t\t\t\tvar x1 = 0;\n\t\t\t\t\tif(true || mapWorldWraps) {\n\t\t\t\t\t\tx1 = leftMarg + Math.floor(drawW/2 + p1px.x * scale - pCenter.x * scale);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(passDateLine && (lon1[i] > 180)) {\n\t\t\t\t\t\t\tx1 = Math.floor(leftMarg + drawW - (NEpx.x * scale - p1px.x * scale));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tx1 = Math.floor(leftMarg + (p1px.x * scale - SWpx.x * scale));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar y1 = Math.floor(topMarg + (p1px.y * scale - NEpx.y * scale));\n\t\t\t\t\tvar groupId = 0;\n\t\t\t\t\tif(i < selArray.length) {\n\t\t\t\t\t\tgroupId = selArray[i];\n\t\t\t\t\t}\n\n\t\t\t\t\tvar v = val1[i];\n\t\t\t\t\tvar vAdj = adjustHeat(v);\n\n\t\t\t\t\tif(!votes.hasOwnProperty(x1)) {\n\t\t\t\t\t\tvotes[x1] = {};\n\t\t\t\t\t}\n\t\t\t\t\tif(!votes[x1].hasOwnProperty(y1)) {\n\t\t\t\t\t\tvotes[x1][y1] = {};\n\t\t\t\t\t}\n\t\t\t\t\tif(!votes[x1][y1].hasOwnProperty(groupId)) {\n\t\t\t\t\t\tvotes[x1][y1][groupId] = {};\n\t\t\t\t\t}\n\t\t\t\t\tif(!votes[x1][y1][groupId].hasOwnProperty(vAdj)) {\n\t\t\t\t\t\tvotes[x1][y1][groupId][vAdj] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvotes[x1][y1][groupId][vAdj] += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar sortedXs = [];\n\t\t\tvar ys = {};\n\t\t\tfor(var x in votes) {\n\t\t\t\tif(votes.hasOwnProperty(x)) {\n\t\t\t\t\tsortedXs.push(parseInt(x));\n\n\t\t\t\t\tfor(var y in votes[x]) {\n\t\t\t\t\t\tif(votes[x].hasOwnProperty(y)) {\n\t\t\t\t\t\t\tys[y] = 1;\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\tsortedXs.sort(function(a, b){return a-b});\n\n\t\t\tvar sortedYs = [];\n\t\t\tfor(var y in ys) {\n\t\t\t\tif(ys.hasOwnProperty(y)) {\n\t\t\t\t\tsortedYs.push(parseInt(y));\n\t\t\t\t}\n\t\t\t}\n\t\t\tsortedYs.sort(function(a, b){return a-b});\n\n\t\t\tfor(var x in votes) {\n\t\t\t\tif(votes.hasOwnProperty(x)) {\n\t\t\t\t\tfor(var y in votes[x]) {\n\t\t\t\t\t\tif(votes[x].hasOwnProperty(y)) {\n\t\t\t\t\t\t\tvar noofvotes = 0;\n\t\t\t\t\t\t\tvar groupId = 0;\n\t\t\t\t\t\t\tvar ls = [];\n\n\t\t\t\t\t\t\tfor(var groupId in votes[x][y]) {\n\t\t\t\t\t\t\t\tif(groupId > 0 && votes[x][y].hasOwnProperty(groupId)) {\n\t\t\t\t\t\t\t\t\tvar trans = 0;\n\t\t\t\t\t\t\t\t\tvar count = 0;\n\n\t\t\t\t\t\t\t\t\tfor(var val in votes[x][y][groupId]) { // start with selected data\n\t\t\t\t\t\t\t\t\t\tif(votes[x][y][groupId].hasOwnProperty(val)) {\n\t\t\t\t\t\t\t\t\t\t\tcount += votes[x][y][groupId][val];\n\t\t\t\t\t\t\t\t\t\t\ttrans += votes[x][y][groupId][val] * val;\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\tif(count > 0) {\n\t\t\t\t\t\t\t\t\t\tvar tmp = [];\n\t\t\t\t\t\t\t\t\t\ttmp.push(groupId);\n\t\t\t\t\t\t\t\t\t\ttmp.push(count);\n\t\t\t\t\t\t\t\t\t\ttmp.push(trans);\n\t\t\t\t\t\t\t\t\t\tls.push(tmp);\n\t\t\t\t\t\t\t\t\t\tnoofvotes += count;\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} // for groupId in votes[x][y]\n\n\t\t\t\t\t\t\tif(noofvotes <= 0) { // try with unselected data too\n\t\t\t\t\t\t\t\tvar groupId = 0;\n\n\t\t\t\t\t\t\t\tif(votes[x][y].hasOwnProperty(groupId)) {\n\t\t\t\t\t\t\t\t\tvar trans = 0;\n\t\t\t\t\t\t\t\t\tvar count = 0;\n\n\t\t\t\t\t\t\t\t\tfor(var val in votes[x][y][groupId]) { // start with selected data\n\t\t\t\t\t\t\t\t\t\tif(votes[x][y][groupId].hasOwnProperty(val)) {\n\t\t\t\t\t\t\t\t\t\t\tcount += votes[x][y][groupId][val];\n\t\t\t\t\t\t\t\t\t\t\ttrans += votes[x][y][groupId][val] * val;\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\tif(count > 0) {\n\t\t\t\t\t\t\t\t\t\tvar tmp = [];\n\t\t\t\t\t\t\t\t\t\ttmp.push(groupId);\n\t\t\t\t\t\t\t\t\t\ttmp.push(count);\n\t\t\t\t\t\t\t\t\t\ttmp.push(trans);\n\t\t\t\t\t\t\t\t\t\tls.push(tmp);\n\t\t\t\t\t\t\t\t\t\tnoofvotes += count;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif(noofvotes > 0) { // should always be true\n\t\t\t\t\t\t\t\tvar blendedCol = [];\n\n\t\t\t\t\t\t\t\tfor(var grIdx = 0; grIdx < ls.length; grIdx++) {\n\t\t\t\t\t\t\t\t\tvar groupCol = heatAndGroup2color(ls[grIdx][2] / ls[grIdx][1], ls[grIdx][0]);\n\t\t\t\t\t\t\t\t\tgroupCol[3] = ls[grIdx][2] / noofvotes;\n\n\t\t\t\t\t\t\t\t\tif(grIdx > 0) {\n\t\t\t\t\t\t\t\t\t\t// need to blend\n\t\t\t\t\t\t\t\t\t\tvar oldA = blendedCol[3];\n\t\t\t\t\t\t\t\t\t\tvar newA = groupCol[3];\n\t\t\t\t\t\t\t\t\t\tvar remainA = (1 - newA) * oldA;\n\t\t\t\t\t\t\t\t\t\tvar outA = newA + remainA;\n\n\t\t\t\t\t\t\t\t\t\tif(outA > 0) {\n\t\t\t\t\t\t\t\t\t\t\tfor(var colIdx = 0; colIdx < 3; colIdx++) {\n\t\t\t\t\t\t\t\t\t\t\t\tblendedCol[colIdx] = Math.min(255, (blendedCol[colIdx] * remainA + newA * groupCol[colIdx]) / outA);\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\telse {\n\t\t\t\t\t\t\t\t\t\t\tblendedCol[0] = 0;\n\t\t\t\t\t\t\t\t\t\t\tblendedCol[1] = 0;\n\t\t\t\t\t\t\t\t\t\t\tblendedCol[2] = 0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tblendedCol[3] = outA;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tblendedCol = groupCol;\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\tblendedCol[3] = Math.min(255, 255 * transparency);\n\t\t\t\t\t\t\t\tvar rgba = blendedCol;\n\t\t\t\t\t\t\t\tx = parseInt(x);\n\t\t\t\t\t\t\t\ty = parseInt(y);\n\t\t\t\t\t\t\t\tvar xIdx = legacyDDSupLib.binLookup(sortedXs, x, 0, sortedXs.length);\n\t\t\t\t\t\t\t\tvar yIdx = legacyDDSupLib.binLookup(sortedYs, y, 0, sortedYs.length);\n\t\t\t\t\t\t\t\tvar x1 = x;\n\t\t\t\t\t\t\t\tvar x2 = x;\n\t\t\t\t\t\t\t\tif(xIdx > 0) {\n\t\t\t\t\t\t\t\t\tx1 = Math.floor((sortedXs[xIdx - 1] + x) / 2);\n\t\t\t\t\t\t\t\t\tif(mapWorldWraps && Math.abs(x - x1) > 5) {\n\t\t\t\t\t\t\t\t\t\tx1 = x;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} if(xIdx < sortedXs.length - 1) {\n\t\t\t\t\t\t\t\t\tx2 = Math.floor((sortedXs[xIdx + 1] + x) / 2);\n\t\t\t\t\t\t\t\t\tif(mapWorldWraps && Math.abs(x - x2) > 5) {\n\t\t\t\t\t\t\t\t\t\tx2 = x;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(x1 < x) {\n\t\t\t\t\t\t\t\t\tx1++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar y1 = y;\n\t\t\t\t\t\t\t\tvar y2 = y;\n\t\t\t\t\t\t\t\tif(yIdx > 0) {\n\t\t\t\t\t\t\t\t\ty1 = Math.floor((sortedYs[yIdx - 1] + y) / 2);\n\t\t\t\t\t\t\t\t} if(yIdx < sortedYs.length - 1) {\n\t\t\t\t\t\t\t\t\ty2 = Math.floor((sortedYs[yIdx + 1] + y) / 2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(y1 < y) {\n\t\t\t\t\t\t\t\t\ty1++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif(mapWorldWraps) {\n\t\t\t\t\t\t\t\t\twhile(x2 < leftMarg) {\n\t\t\t\t\t\t\t\t\t\tx1 += worldWidth;\n\t\t\t\t\t\t\t\t\t\tx2 += worldWidth;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\twhile(x1 > leftMarg + drawW) {\n\t\t\t\t\t\t\t\t\t\tx1 -= worldWidth;\n\t\t\t\t\t\t\t\t\t\tx2 -= worldWidth;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tvar offset = 0;\n\t\t\t\t\t\t\t\t\twhile(x2 + offset > leftMarg && x1 + offset < leftMarg + drawW) {\n\t\t\t\t\t\t\t\t\t\tfillRect(x1 + offset,y1, x2 + offset,y2, rgba[3], rgba[0], rgba[1], rgba[2], pixels, myCanvas.width);\n\t\t\t\t\t\t\t\t\t\toffset += worldWidth;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\toffset = -worldWidth;\n\t\t\t\t\t\t\t\t\twhile(x2 + offset > leftMarg && x1 + offset < leftMarg + drawW) {\n\t\t\t\t\t\t\t\t\t\tfillRect(x1 + offset,y1, x2 + offset,y2, rgba[3], rgba[0], rgba[1], rgba[2], pixels, myCanvas.width);\n\t\t\t\t\t\t\t\t\t\toffset -= worldWidth;\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\telse {\n\t\t\t\t\t\t\t\t\tfillRect(x1,y1, x2,y2, rgba[3], rgba[0], rgba[1], rgba[2], pixels, myCanvas.width);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} // if noofvotes > 0\n\t\t\t\t\t\t} // if y really in votes[x]\n\t\t\t\t\t} // for y in votes[x]\n\t\t\t\t} // if x really in votes\n\t\t\t} // for x in votes\n\t\t}\n\t\tmyCtx.putImageData(imData, 0, 0);\n\t}", "title": "" }, { "docid": "3b3fdf96a8cc6283e22f456774b82869", "score": "0.6143623", "text": "function spawnMap() {\n var arr = map.areas[map.areanum].prethings; // For ease of use\n // Instead of screen.right + quads.width, use rightmost quad col - most recently added\n while(arr.length > map.current && screen.right + quads.rightdiff >= arr[map.current].xloc * unitsize) {\n if(arr[map.current].object.placed) continue;\n addThing(arr[map.current].object,\n arr[map.current].xloc * unitsize - screen.left, arr[map.current].yloc * unitsize);\n ++map.areas[map.areanum].current;\n ++map.current; // equals above?\n }\n}", "title": "" }, { "docid": "c2e6ed975473b3f06f5af15215005837", "score": "0.6139472", "text": "function createMap(){\r\n\tdocument.write(\"<table>\");\r\n\r\n\tfor(var y = 0; y< height; y++){\r\n\t\tdocument.write(\"<tr>\");\r\n\t\tfor(var x = 0; x < width; x++){\r\n\t\t\tif(x == 0 || x == width -1 || y == 0 || y == height -1){\r\n\t\t\t\tdocument.write(\"<td class= 'wall' id='\"+ x +\"-\" + y + \"'></td>\");\r\n\t\t\t}else{\r\n\t\t\t\tdocument.write(\"<td class= 'blank' id='\"+ x +\"-\" + y + \"'></td>\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tdocument.write(\"</tr>\");\r\n\t}\r\n\r\n\tdocument.write(\"</table>\");\r\n}", "title": "" }, { "docid": "933e2ae1b200c825e9ba2c57bc4ac9e0", "score": "0.6125621", "text": "function createMap() {\n\n //create starting variables for rows and columns\n let rowNumber = 0;\n let columnNumber = 0;\n\n //Create all tiles on the map based on the amounts given in width and height variables\n for (let i = 0; i < mapTileHeight; i++) {\n for (let i = 0; i < mapTileWidth; i++) {\n let tileID = `${rowNumber}-${columnNumber}`\n\n //add the tiles along with their information to the document\n $(\".canvas\").append(`<div class=tile id=${tileID}> ${tileID}</div>`);\n\n //append the relevant basic information\n $(`#${tileID}`).data(\"info\", {\n terrain: \"Water\",\n feature: \"Nothing\",\n cityRange: false,\n cityName: \"None\",\n x: columnNumber,\n y: rowNumber\n\n });\n //add to column to move on\n columnNumber += 1;\n //add the id's of all these tiles to an array for easy access\n allTilesIDs.push(tileID);\n };\n //add to row and nullify column to reset\n columnNumber = 0;\n rowNumber += 1;\n };\n\n}", "title": "" }, { "docid": "10a63dc08d1dacecaad6e73dd25d76c0", "score": "0.61255926", "text": "function run_block(){\n\tvar i, j, render_ok,\n\t\tk = 0, render = new Array(),\n\t\tmap_height = map.length,\n\t\tmap_width = map[0].length;\n\n\t//if currently there is a block moving\n\tif(block_in_scene){\n\t\trender_ok = true;\n\t\tfor(i = map_height - 1; i >= 0; i--){\n\t\t\tfor(j = 0; j < map_width; j++){\n\t\t\t\tif(map[i][j] == \"B\"){ //if current block is a moving block\n\t\t\t\t\trender[k++] = [i, j];\n\t\t\t\t\tif(i == map_height - 1) render_ok = false; //current block hits bottom\n\t\t\t\t}\n\t\t\t\tif(i > 0 && map[i-1][j] == \"B\"){ //if the block on top is a moving block\n\t\t\t\t\tif(map[i][j] == '1') render_ok = false; //if current block hits wall, stop rendering\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(render_ok){\n\t\t\tfor(i = 0; i < render.length; i++){ //clear current block\n\t\t\t\tmap[render[i][0]][render[i][1]] = \"0\";\n\t\t\t\tif(render[i][0] > 3){\n\t\t\t\t\tscene.rows[render[i][0] - 4].cells[render[i][1]].style.background = \"white\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(i = 0; i < render.length; i++){ //render next block one pixel down\n\t\t\t\tmap[render[i][0] + 1][render[i][1]] = \"B\";\n\t\t\t\tif(render[i][0] > 2){\n\t\t\t\t\tscene.rows[render[i][0] - 3].cells[render[i][1]].style.background = block_color[block_order[0]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{ //if block stops, make it wall\n\t\t\tfor(i = 0; i < render.length; i++){\n\t\t\t\tmap[render[i][0]][render[i][1]] = \"1\";\n\t\t\t}\n\t\t\tblock_in_scene = false;\n\t\t\t\n\t\t\tfor(i = 0; i < map_width; i++){\n\t\t\t\tif(map[3][i] == \"1\"){ //game over\n\t\t\t\t\tgameplay = false;\n\t\t\t\t\talert(\"GAME OVER\");\n\t\t\t\t\tplayback_txt.innerHTML = \"RESTART\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\telse{ //if no block in scene, load new block\n\t\tload_block();\n\t\t\n\t\tfor(i = 0; i < 4; i++){\n\t\t\tfor(j = 3; j < 7; j++){\n\t\t\t\tmap[i][j] = block[4*i+j-3];\n\t\t\t}\n\t\t}\n\t\tblock_in_scene = true;\n\t}\n}", "title": "" }, { "docid": "aefd4a9051c422e5d27704e8c7357001", "score": "0.6122588", "text": "function main() {\n\t//clearing / drawing background\n\tctx.fillStyle = loading_map.bg;\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\tctx.fillRect(0, 0, canvas.width, canvas.height);\n\n\t//draw world\n\tdrawMap();\n\n\t//ticking world thigns\n\tloading_map.tick();\n\n\t//draw player\n\tplayer.tick();\n\tplayer.beDrawn();\n\n\t//editor text if active\n\tif (editor_active) {\n\t\t//debug mode tag\n\t\tctx.fillStyle = color_player;\n\t\tctx.fillText(`~~DEBUG MODE~~`, canvas.width * 0.5, canvas.height * 0.07);\n\n\t\t//drawing coordinates\n\t\tctx.fillText(`Block: ${editor_block}`, canvas.width * 0.5, canvas.height * 0.9);\n\t\tctx.fillText(`X: ${player.x} Y: ${player.y}`, canvas.width * 0.5, canvas.height * 0.95);\n\t}\n\n\t//vignetting\n\tvar gradient = ctx.createRadialGradient(centerX, centerY * 1.5, 30, centerX, centerY * 1.5, canvas.height * 1);\n\t\n\tgradient.addColorStop(0, \"rgba(0, 0, 64, 0)\");\n\tgradient.addColorStop(1, \"rgba(0, 0, 64, 1)\");\n\tctx.fillStyle = gradient;\n\tctx.globalAlpha = display_vignetting;\n\tctx.setTransform(1, 0, 0, 0.75, 0, 0);\n\tctx.fillRect(0, 0, canvas.width, canvas.height * 2);\n\tctx.setTransform(1, 0, 0, 1, 0, 0);\n\tctx.globalAlpha = 1;\n\n\t//time based things\n\tgame_timer += 1;\n\tdisplay_tileShadowOffset = 6 + (Math.sin(game_timer / 100) * 2);\n\n\t//call self for next frame\n\tgame_animation = window.requestAnimationFrame(main);\n}", "title": "" }, { "docid": "adcfc3fa8bd8b1e6430d28ef241cfe3f", "score": "0.61194706", "text": "render () {\n this.context.clearRect(0, 0, this.canvasSize, this.canvasSize)\n this.context.fillText(this.turn, 5, 10)\n for (let x = 0; x < this.map.length; x++) {\n for (let y = 0; y < this.map[x].length; y++) {\n if (this.map[x][y] === true) {\n this.context.fillRect(this.cellSize * x, this.cellSize * y, this.cellSize, this.cellSize)\n }\n }\n }\n }", "title": "" }, { "docid": "efeacae5ccea45ebb136df8742dfb0c2", "score": "0.61183774", "text": "function drawWalls() {\n \n // Look at each section of wall\n for (var i = wall.length - 1; i > -1; i--) {\n \n // Draw the wall section\n image(wImg, wall[i].x, wall[i].y, wImg.w, wImg.h);\n \n }\n \n}", "title": "" }, { "docid": "bd2cc0917afdf809b3a5b8b92e6b568c", "score": "0.6118199", "text": "function createMap() {\r\n document.write(\"<table>\")\r\n\r\n for (var y = 0; y < height; y++){\r\n document.write(\"<tr>\");\r\n for (var x = 0; x < width; x++){\r\n if(x==0 || x == width -1 || y == 0 || y == height -1){\r\n document.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\");\r\n }else{\r\n document.write(\"<td class='blank' id='\"+ x + \"-\" + y +\"'></td>\");\r\n }\r\n }\r\n document.write(\"</tr>\");\r\n }\r\n\r\n document.write(\"</table>\");\r\n}", "title": "" }, { "docid": "ec342930b87634c3f8102f5e8d211cfd", "score": "0.61089844", "text": "function generate_map(){\n for (var i = 1; i < map_width; i++){\n k[i] = k[i - 1] + 100\n }\n\n for (var v = 1; v < map_height; v++){\n h[v] = h[v - 1] + 100\n }\n\n for(var i = 0; i < map_width; i++) {\n matrix[i] = [];\n for(var j = 0; j < map_height; j++) {\n sp = Math.floor((Math.random() * 100) + 1);\n if (sp <= 3){tilex = \"mountain\"}\n if (sp <= 30 && sp > 15){tilex = \"land\"}\n if (sp <= 15 && sp > 10){tilex = \"grassland_hills\"}\n if (sp <= 10 && sp > 6){tilex = \"desert\"}\n if (sp <= 6 && sp > 3){tilex = \"desert_hills\"}\n if (sp >= 31){tilex = \"water\"}\n //if (j === 0 || j === (map_height - 1)){tilex = \"ice\"}\n if (j === 0){tilex = \"ice\"}\n if (j === (map_height - 1)){tilex = \"ice\"; var transform = \"rotateX(180deg)\"}\n //matrix[i][j] = \"<div id='tile_\"+i+\"_\"+j+\"' class='\"+tilex+\"' style='left:\"+k[i]+\"; top:\"+h[j]+\";' onclick='tile_select(\"+i+\",\"+j+\")'>\"+sp+\"</div>\";\n /*matrix[i][j] = \"<div id='tile_\"+i+\"_\"+j+\"' class='\"+tilex+\"' style='left:\"+k[i]+\"; top:\"+h[j]+\"; transform:\" + transform + \";' onclick='tile_select(\"+i+\",\"+j+\")' onmouseover='if(unit_is_allowed_to_move === 1){showCoords(event);}'></div>\";*/\n matrix[i][j] = \"<div id='tile_\"+i+\"_\"+j+\"' class='\"+tilex+\"' style='left:\"+k[i]+\"; top:\"+h[j]+\"; transform:\" + transform + \";' onclick='tile_select(\"+i+\",\"+j+\")'></div>\";\n\n matrix_2[i][j] = new tile_struct(i,j,tilex,0);\n\n transform = \"\"; // reset the transforms so that it doesnt apply to every tile, only the ones that need it\n\n // add resources to the tiles based on their terrain type\n if (tilex === \"land\" || tilex === \"grassland_hills\" || tilex === \"desert\" || tilex === \"desert_hills\"){\n add_resource_tiles(i,j);\n }\n\n // add fog of war\n if (is_enabled_fog_of_war === 1){ fog_of_war_add(i,j); }\n }\n }\n\n // check if ocean tile borders land tile\n // then change ocean tile to have corresponding coastlines (border color)\n\n //research tech tree\n // then land\n\n //alert(matrix[0][0].match(/class/g))\n //alert(RegExp('[a]',matrix[0][0]))\n}", "title": "" }, { "docid": "da723fc2246a0762531b65ec695caeda", "score": "0.6106823", "text": "function draw(){\r\n\tvar canvas = $('#GameBoardCanvas');\r\n\tif(canvas.width() > window.innerHeight){\r\n\t\t$('#GameBoardCanvas').css(\"width\",(window.innerHeight - 150));\r\n\t\t$('#GameBoardCanvas').css(\"height\",(window.innerHeight - 150));\r\n\t}\r\n\tcanvas.attr(\"width\",canvas.width());\r\n\tcanvas.attr(\"height\",canvas.width());\r\n\tvar width = canvas.width();\r\n\tvar blockSize = width/board.length;\r\n\tconsole.log(\"width:\"+width+\"/board.length:\"+board.length+\"/blockSize:\"+blockSize);\r\n\tvar ctx = canvas[0].getContext('2d');\r\n\tctx.setTransform(1, 0, 0, 1, 0, 0);\r\n\tctx.clearRect(0, 0, width, width);\r\n\t//ctx.fillStyle=\"white\";\r\n\t//Loop through the board array drawing the walls and the goal\r\n\tfor(var y = 0; y < board.length; y++){\r\n\t\tfor(var x = 0; x < board[y].length; x++){\r\n\t\t\t//Draw a wall\r\n\t\t\tctx.globalAlpha = 1;\r\n\t\t\tif(board[y][x] === 1){\r\n\t\t\t\tctx.globalAlpha = 1;\r\n\t\t\t\t//ctx.fillStyle=\"white\";\r\n\t\t\t\t//ctx.fillRect(x*blockSize, y*blockSize, blockSize, blockSize);\r\n\t\t\t\tif(mazeBlockArray.length == 1){\r\n\t\t\t\t\tctx.drawImage(mazeBlockArray[0],x*blockSize,y*blockSize,blockSize*1.1,blockSize*1.1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar max = mazeBlockArray.length-1;\r\n\t\t\t\t\tvar min = 0;\r\n\t\t\t\t\tvar random = Math.floor(Math.random() * (max - min + 1)) + min;\r\n\t\t\t\t\tif(mazeBlockCordinated[x+\"\"+y] != undefined){\r\n\t\t\t\t\t\trandom = mazeBlockCordinated[x+\"\"+y];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tmazeBlockCordinated[x+\"\"+y] = random;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tctx.drawImage(mazeBlockArray[random],x*blockSize,y*blockSize,blockSize*1.1,blockSize*1.1);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(board[y][x] === 0){\r\n\t\t\t\t//ctx.fillStyle=\"#A788AE\";\r\n\t\t\t\t//ctx.fillRect(x*blockSize, y*blockSize, blockSize, blockSize);\r\n\t\t\t}\r\n\t\t\t//Draw the goal\r\n\t\t\telse if(board[y][x] === -1){\r\n\t\t\t\t/*\r\n\t\t\t\tctx.beginPath();\r\n\t\t\t\tctx.lineWidth = 5;\r\n\t\t\t\tctx.strokeStyle = \"gold\";\r\n\t\t\t\tctx.moveTo(x*blockSize, y*blockSize);\r\n\t\t\t\tctx.lineTo((x+1)*blockSize, (y+1)*blockSize);\r\n\t\t\t\tctx.moveTo(x*blockSize, (y+1)*blockSize);\r\n\t\t\t\tctx.lineTo((x+1)*blockSize, y*blockSize);\r\n\t\t\t\tctx.stroke();\r\n\t\t\t\t*/\r\n\t\t\t\tctx.drawImage(mazeDestination,x*blockSize,y*blockSize,blockSize,blockSize);\t\r\n\t\t\t\t//drawImage(ctx,x,y,blockSize,'/image/maze_saturn.png');\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t/*\r\n\t//Draw the player\r\n\tctx.beginPath();\r\n\tvar half = blockSize/2;\r\n\tctx.fillStyle = \"#FE5C57\";\r\n\tctx.arc(player.x*blockSize+half, player.y*blockSize+half, half, 0, 2*Math.PI);\r\n\tctx.fill();\r\n\t*/\r\n\tctx.globalAlpha = 1;\r\n\tctx.drawImage(mazeCharacter,player.x*blockSize,player.y*blockSize,blockSize,blockSize);\r\n}", "title": "" }, { "docid": "14448027e6fcebd25eeaad5133d33c03", "score": "0.6095693", "text": "function draw_map_original() {\n var div_map = $('#div_map');\n for (var i = 0; i < 60; i++) {\n for (var j = 0; j < 60; j++) {\n var cell = $('<div></div>');\n cell.attr('style', 'position:absolute;float:left;width:10px;height:10px;' + 'top:' + i * 10 + 'px' + ';' + 'left:' + j * 10 + 'px' + ';' + 'border:1px solid black;background-color:silver')\n cell.attr('id', 'cell_' + i + '_' + j);\n cell.addClass('cell');\n div_map.append(cell);\n };\n };\n}", "title": "" }, { "docid": "c55a26123ed18bdef0e642f2ee125d7b", "score": "0.6092805", "text": "function showMapBuilder() {\n // Manage the screen displays\n levelContainer.style.display = 'none';\n controlsButton.style.display = 'none';\n mapBuilderContainer.style.display = 'block';\n\n // Get mapbuilder canvas and it's context\n mapCanvas = document.getElementById('map-builder__canvas');\n mapCanvasContext = mapCanvas.getContext('2d');\n\n // Add event listeners for drawing on canvas\n mapCanvas.addEventListener('mousedown', function (e) {\n // Get position where mouse was clicked\n let position = getCursorPosition(mapCanvas, e);\n\n // Fill that position according type of object currently being drawn\n fillCanvas(position);\n\n // Set mousedown flag\n mousedown = true;\n });\n mapCanvas.addEventListener('mousemove', function (e) {\n // On mousemove if the mousedown flag is set and object to fill is not tank, then fill that position of mousemove\n if (mousedown && !setTank) {\n let position = getCursorPosition(mapCanvas, e);\n fillCanvas(position);\n }\n });\n mapCanvas.addEventListener('mouseup', function () {\n // On mouseup, reset mousedown flag\n mousedown = false;\n });\n\n // Initialize the canvas for drawing with boundary walls and user position\n clearCanvas();\n}", "title": "" }, { "docid": "8c3d6935cdf495c3a9d080cddf17f387", "score": "0.6084298", "text": "function drawVisibleTiles() {\r\n 'use strict';\r\n // what are the top-left most row and col visible on canvas?\r\n var cameraTopMostRow = Math.floor(camera.panY / TILE_H);\r\n var cameraLeftMostCol = Math.floor(camera.panX / TILE_W);\r\n // how many rows and columns of tiles fit on the canvas?\r\n var colsThatFitOnScreen = Math.floor(CANVAS_W / TILE_W);\r\n var rowsThatFitOnScreen = Math.floor(CANVAS_H / TILE_H);\r\n\r\n // finding the rightmost and bottommost tiles to draw + 1 on the side\r\n var cameraBottomMostRow = cameraTopMostRow + rowsThatFitOnScreen + 1;\r\n var cameraRightMostCol = cameraLeftMostCol + colsThatFitOnScreen + 1;\r\n\r\n for(var eachRow=cameraTopMostRow; eachRow<cameraBottomMostRow; eachRow++) {\r\n for(var eachCol=cameraLeftMostCol; eachCol<cameraRightMostCol; eachCol++) {\r\n\r\n var drawX = eachCol * TILE_W;\r\n var drawY = eachRow * TILE_H;\r\n\r\n\t\t\tif (isTileAtCoord(eachRow, eachCol)) {\r\n\r\n var tilePos = curMapVar.tileGrid[eachRow][eachCol];\r\n\r\n // Col/ Row is correct with respect to parameters and X/ Y; Row/ Col necessary due to JS Rows[Cols]\r\n var type = getType(eachCol, eachRow);\r\n\r\n var soilParameter = type[2];\r\n var plantParameter = type[3];\r\n var soilInfo = type[0];\r\n var plantInfo = type[1];\r\n\r\n // condition 2 & 4 invert the mapping of soil/ plant to row/ col (was col/ row in condition 1 & 2)\r\n if (condition === 2 || condition === 4) {\r\n soilInfo = type[1];\r\n plantInfo = type[0];\r\n soilParameter = type[3];\r\n plantParameter = type[2];\r\n }\r\n\r\n switch(tilePos) {\r\n case 0: // standard tile that has not been explored/ exploited\r\n curMapConst.soilSheet.draw(drawX, drawY, soilInfo, soilParameter);\r\n curMapConst.plantSheet.draw(drawX, drawY, plantInfo, plantParameter);\r\n break;\r\n case 1: // explored tile (i.e. no potato)\r\n curMapConst.soilSheet.draw(drawX, drawY, 3, 0);\r\n break;\r\n case 3: // exploited tile (i.e. potato found)\r\n curMapConst.soilSheet.draw(drawX, drawY, 3, 1);\r\n break;\r\n case 5: // water tile\r\n curMapConst.soilSheet.draw(drawX, drawY, 3, 2);\r\n break;\r\n case 6: // water tile with red X\r\n curMapConst.soilSheet.draw(drawX, drawY, 3, 2);\r\n curMapConst.plantSheet.draw(drawX, drawY, 3, 1);\r\n break;\r\n case 7: // rock type 1 on top of normal soil\r\n curMapConst.soilSheet.draw(drawX, drawY, soilInfo, soilParameter);\r\n curMapConst.plantSheet.draw(drawX, drawY, 3, 2);\r\n break;\r\n case 8: // rock type 2 on top of normal soil\r\n curMapConst.soilSheet.draw(drawX, drawY, soilInfo, soilParameter);\r\n curMapConst.plantSheet.draw(drawX, drawY, 3, 3);\r\n break;\r\n case 9: // rock type 2 on top of normal soil\r\n curMapConst.soilSheet.draw(drawX, drawY, soilInfo, soilParameter);\r\n curMapConst.plantSheet.draw(drawX, drawY, 3, 4);\r\n break;\r\n default: // water tile\r\n curMapConst.soilSheet.draw(drawX, drawY, 3, 2);\r\n break;\r\n }\r\n }\r\n else { // water tile\r\n curMapConst.soilSheet.draw(drawX, drawY, 3, 2);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "af159522a32cb3aee3e0f470ba0cd2fd", "score": "0.60585755", "text": "function createMap(currentPath, cb) {\n grid = [];\n\n $.getJSON(currentPath, data => {\n rows = data.dimensions[0].rows;\n columns = data.dimensions[0].columns;\n boxWidth = canvasWidth/rows;\n boxHeight = canvasHeight/columns;\n $.each(data.map, (i, value) => {\n grid.push({ x: value.x, y: value.y,\n isWall: value.isWall == \"true\", explored: false, visited: false,\n loopTrace: { id: null, previous: null, next: null }, loopMark: { id: null } });\n });\n }).fail(() => {\n alert(\"An error has occured.\");\n }).done(() => {\n autoBot = { id: \"agent1\", loc: /* 482 */getRandomLoc(grid), color: TEMP_COLOR, dir: 1 };\n /* victim1 = {id: \"victim\", loc: getRandomLoc(grid), color: VICTIM_COLOR, isFound: false};\n victim2 = {id: \"victim\", loc: getRandomLoc(grid), color: VICTIM_COLOR, isFound: false};\n hazard1 = {id: \"hazard\", loc: getRandomLoc(grid), color: HAZARD_COLOR, isFound: false};\n hazard2 = {id: \"hazard\", loc: getRandomLoc(grid), color: HAZARD_COLOR, isFound: false};\n obstacles.push(victim1, hazard1, hazard2); */\n\n drawMap(grid);\n spawn(autoBot);\n console.log(autoBot.loc);\n\n timeout = setInterval(updateTime, 1000);\n\n updateScrollingPosition(grid[autoBot.loc]);\n\n cb(grid);\n });\n}", "title": "" }, { "docid": "4ee8f42ca97afa23d73ca9c7c4ecb3fc", "score": "0.60582125", "text": "function render() {\n\tvar gameCanvas = document.getElementById(\"gameCanvas\");\n\tvar ctx = gameCanvas.getContext(\"2d\");\n\n\tfor (var x = 0; x < 30; x++) {\n\t\tfor (var y = 0; y < 20; y++) {\n\t\t\tboxFill(x, y, mazeGrid[x][y]);\n\t\t}\n\t}\n\t\n\tctx.putImageData(cachedData, 0, 0);\n}", "title": "" }, { "docid": "d4428568d23eb2f80153e17cdfdebbd7", "score": "0.60461736", "text": "function createMap(){\n document.write(\"<table>\");\n for( var y = 0; y < height; y++){\n document.write(\"<tr>\");\n for( var x = 0; x < width; x++){\n if(x === 0 || x === width -1 || y === 0 || y === height -1){\n document.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\");\n }else{\n document.write(\"<td class='blank' id='\"+ x + \"-\" + y +\"'></td>\");\n }\n }\n document.write(\"</tr>\");\n }\n document.write(\"</table>\");\n\n}", "title": "" }, { "docid": "3472b8d17e8a73e7b78c94a56b317374", "score": "0.6041444", "text": "function drawBricks() {\r\n for(c=0; c<wallCols; c++) {\r\n for(r=0; r<wallRows; r++) {\r\n if (Wall[c][r].status == 1) {\r\n\t\t\t\t\tvar brickX = (c*(brickW+padding))+OffsetLeft;\r\n\t\t\t\t\tvar brickY = (r*(brickH+padding))+OffsetTop;\r\n\t\t\t\t\tWall[c][r].x = brickX;\r\n\t\t\t\t\tWall[c][r].y = brickY;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tctx.beginPath();\r\n\t\t\t\t\tctx.rect(brickX, brickY, brickW, brickH);\r\n\t\t\t\t\tctx.fillStyle = '#0189CB';\r\n\t\t\t\t\tif (c==0) {\r\n\t\t\t\t\t\tctx.fillStyle = '#019BE6';\r\n\t\t\t\t\t} else if (c==2) {\r\n\t\t\t\t\t\tctx.fillStyle = '#03A7F7';\r\n\t\t\t\t\t} else if (c==4) {\r\n\t\t\t\t\t\tctx.fillStyle = '#00a2df';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tctx.fill();\r\n\t\t\t\t\tctx.closePath();\r\n\t\t\t\t}\r\n }\r\n }\r\n}", "title": "" }, { "docid": "fad6fccbc41d31180397d470654f44c9", "score": "0.6033397", "text": "function drawMap(canvas) {\n\n\tlogIt('drawMap called')\n\t//TODO: make this store the canvas \n\tif (!canvas){\n\t\t\tcanvas = document.getElementsByClassName('mapCanvas');\n\t}\n\tif( !canvas || canvas.length <= 0){\n\t\tlogIt(\"ERROR: can't draw with out a canvas specified\", 1);\n\t\treturn;\n\t}\n\tif(canvas.length > 0)\n\t\tcanvas = canvas[0];\n\t// prepare the canvas\n\tctx = canvas.getContext('2d');\n\tctx.fillStyle = \"rgb(200,0,0)\";\n\tvar Wid = canvas.width;\n\tvar Hei = canvas.height;\n\tvar nd = null;\n\tvar ndName = null, neighbor = null;\n\n\t//\n\t// Draw some edges\n\tfor ( var i = 0; i < _nodes.list.length; i++) {\n\t\tndName = _nodes.list[i];\n\t\tnd = _nodes[ndName];\n\t\t// draw edges\n\t\tctx.beginPath();\n\t\tfor ( var n = 0; n < nd.edges.length; n++) {\n\t\t\tif(nd.distances){\n\t\t\t\tctx.strokeStyle = \"rgb(0,255,0)\";\n\t\t\t\tctx.lineWidth = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tctx.strokeStyle = \"rgb(0,0,0)\";\n\t\t\t\tctx.lineWidth = 1;\n\t\t\t}\n\t\t\t\n\t\t\tctx.moveTo(nd.x * Wid, nd.y * Hei);\n\t\t\tneighbor = _nodes[nd.edges[n]];\n\t\t\tctx.lineTo(neighbor.x * Wid, neighbor.y * Hei);\n\t\t}\n\t\tctx.stroke();\n\t}\n\t//\n\t// Draw some nodes\n\tfor ( i = 0; i < _nodes.list.length; i++) {\n\t\tndName = _nodes.list[i];\n\t\tnd = _nodes[ndName];\n\t\tif(nd.type == \"way\"){\n\t\t\tctx.fillStyle = \"rgb(0,0,0)\";\n\t\t\tctx.fillRect(nd.x * Wid, nd.y * Hei, 2, 2);\n\t\t}\n\t\telse if(nd.type == \"amenity\"){\n\t\t\tctx.fillStyle = \"rgb(200,100,0)\";\n\t\t\tctx.fillRect(nd.x * Wid, nd.y * Hei, 5, 5);\n\t\t}\n\t\telse if(nd.type == \"tourism\"){\n\t\t\tctx.fillStyle = \"rgb(255,50,10)\";\n\t\t\tctx.fillRect(nd.x * Wid, nd.y * Hei, 5, 5);\n\t\t}\n\t\telse if(nd.type == \"bar\"){\n\t\t\tctx.fillStyle = \"rgba(100,255,10,0.7)\";\n\t\t\tctx.fillRect(nd.x * Wid, nd.y * Hei, 10, 10);\n\t\t}\n\t\telse if(nd.type == \"hotel\"){\n\t\t\tctx.fillStyle = \"rgba(100,200,10,0.7)\";\n\t\t\tctx.fillRect(nd.x * Wid, nd.y * Hei, 20, 10);\n\t\t}\n\t\telse{\n\t\t\tctx.fillStyle = \"rgb(0,64,0)\";\n\t\t\tctx.fillRect(nd.x * Wid, nd.y * Hei, 2, 2);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1cdae80ce3bd58cad4c0842be8cd9e95", "score": "0.6030336", "text": "function setupMap() {\n\n drawGrid();\n drawBackground();\n\n drawPaths();\n drawNodes();\n\n\n const startNode = getNodeForType(\"start\");\n character.setStartNode(startNode);\n\n // Start the animation\n animate();\n\n}", "title": "" }, { "docid": "2a71bfb6164099e4526f5a0ac5c0613d", "score": "0.60302997", "text": "function drawCells() {\n\tvar cells = $('#cells')[0];\n\tcells.width = width * miniMapScale + 1;\n\tcells.height = height * miniMapScale + 1;\n\tvar cxt = cells.getContext(\"2d\");\n\tcxt.fillStyle = \"rgb(255,0,0)\";\n\tvar length = previousLiveCells.length;\n\tfor (var i = 0; i < length; i++) {\n\t\tif (previousLiveCells[i][0] >= marginleft && previousLiveCells[i][1] >= margintop){\n\t\t\tcxt.fillRect(\n\t\t\t\t(previousLiveCells[i][0]-marginleft) * miniMapScale+1,\n\t\t\t\t(previousLiveCells[i][1]-margintop) * miniMapScale+1,\n\t\t\t\tminiMapScale-2,miniMapScale-2\n\t\t\t);\n\t\t}\n\t}\n\tif (length == 0) {\n\t\tcxt.clearRect(0,0, width*miniMapScale, height*miniMapScale);\n\t}\n}", "title": "" }, { "docid": "171197defbc354604577d2d922484550", "score": "0.6029025", "text": "renderWorld(offSet, leftRight, topDown){\n\n offSet = offSet * topDown * 66;\n //offSet=offSet;\n\n //Create background images\n for (var topLeft = 0; topLeft < leftRight; topLeft = topLeft +1){\n\n var fullOff = topLeft*107;\n\n var iArr = [];\n for(var rightOff = 0; rightOff < topDown; rightOff = rightOff +1){\n iArr.push({x:66*rightOff+offSet,y:fullOff});\n //this.grid.push({x:66*rightOff+offSet,y:fullOff});\n }\n this.grid.push(iArr);\n\n iArr = [];\n for(var rightOff = 0; rightOff < topDown; rightOff = rightOff +1){\n iArr.push({x:66*rightOff-65/2+offSet,y:fullOff+53});\n }\n this.grid.push(iArr);\n }\n\n\n //Fill all grid elements with random tiles\n for (var xPos = 0; xPos < leftRight; xPos = xPos +1){\n for(var yPos = 0; yPos < topDown; yPos = yPos +1){\n this.grid[xPos][yPos].tile =\n this.addSprite(xPos, yPos, Assets.tiles[Math.floor(Math.random()*Assets.tiles.length)]);\n }\n }\n\n }", "title": "" }, { "docid": "40f63c95fb56640304eb073d6e14841f", "score": "0.6009293", "text": "function emptyland()\n\t{\n\t\tbufferc.fillStyle = 'rgb(0,0,128)';\n\t\tbufferc.fillRect(0,0,256,256);\n\t\treturn [];\n\t}", "title": "" }, { "docid": "b7469f79ff3d2f706eef7c3b765e0aa9", "score": "0.6008848", "text": "function Background() {\n this.draw = function(map, z) {\n this.context.fillStyle = 'black';\n this.context.fillRect(this.x, this.y, this.canvasWidth, this.canvasHeight);\n for (n=0; n<map.length; n++){\n for (i=0; i<map[n].length; i++){\n if(map[n][i] > 1){\n x = map[n][i];\n this.context.drawImage(imageRepository.parts, 8*(x-1), 0, 8, 8, 8*i*z, 8*n*z, 8*z, 8*z);\n }\n }\n }\n };\n}", "title": "" }, { "docid": "15e1ef07790b5f8bfd9ba14c33707d7e", "score": "0.6001793", "text": "function fillBrd(){\n for (var i = 0; i < columns; i++)\n {\n for (var j = 0; j < rows; j++)\n {\n if (board[i][j] == 1){\n World.add(world, [Bodies.circle(Scale * 6 + (Scale / 5 + Scale) * j + 1 + Scale / 2 + Scale / 5, Scale * 3 + (Scale) * i + 1 + Scale / 2, Scale / 2,{\n isStatic: true,\n render: {\n fillStyle: '#FF0000'\n }\n })]);\n }\n if (board[i][j] == 2){\n World.add(world, [Bodies.circle(Scale * 6 + (Scale / 5 + Scale) * j + 1 + Scale / 2 + Scale / 5, Scale * 3 + (Scale) * i + 1 + Scale / 2, Scale / 2,{\n isStatic: true,\n render: {\n fillStyle: '#FFFF00'\n }\n })]);\n }\n }\n }\n}", "title": "" }, { "docid": "a13f676876e95325f118c92fba8aa8b1", "score": "0.59971", "text": "resetTiles() {\n this.showBuckets = true;\n for (let row = 0; row < this.map_.ROWS; row++) {\n for (let col = 0; col < this.map_.COLS; col++) {\n this.resetTile(row, col);\n }\n }\n }", "title": "" }, { "docid": "8a8c779ba12d4858aeb0c218be8824b9", "score": "0.5982152", "text": "function drawmaze(maze,scale,stepwidth,stephight,mazenumber)\n{ \n blocksize=scale*16;\n var xpos=blocksize/2,ypos=blocksize/2;\n var brick,currnt_element;\n var rownumber=mazenumber*11;\n var row_end=rownumber+10;\n var row_temp = 0; \n var end_pos = createVector(); \n //row loop\n for(var row=rownumber;row<row_end;row++)\n {\n //colomn loop \n for(var colomn=0;colomn<11;colomn++)\n {\n //charecter for this row in the array\n currnt_element = findelement(maze,11,row,colomn);\n\n if (colomn<10 && row_temp<10)\n {\n maze_array[row_temp][colomn] = currnt_element; \n \n }\n var currentX=xpos,currentY=ypos;\n \n \n // start block is special XD , so is the end block\n if (row==rownumber && colomn==0|| row==row_end-1 && colomn==9)\n {\n //loop on said block's rows and colomns and add them \n for(var inblock_row=0;inblock_row<stephight;inblock_row++)\n {\n xpos=currentX; // 1st 16 .. \n if (currnt_element=='o')\n {\n end_pos.x = xpos; \n end_pos.y = ypos\n }\n for(var inblock_colomn=0;inblock_colomn<stepwidth;inblock_colomn++)\n {\n Markbrick=new StartEnd(xpos,ypos,scale);\n Markbrick.drawbrick();\n xpos+=blocksize;\n } \n \n if (inblock_row +1>= stephight)\n {\n continue; \n }\n ypos+=blocksize;\n \n }\n ypos=currentY;\n }\n\n else if (currnt_element=='#')\n {\n //loop on said block's rows and colomns and add them \n for(var inblock_row=0;inblock_row<stephight;inblock_row++)\n {\n xpos=currentX;\n for(var inblock_colomn=0;inblock_colomn<stepwidth;inblock_colomn++)\n {\n brick=new Brick(xpos,ypos,scale);\n brick.drawbrick();\n blocks_array.add(brick.blockssprite); \n xpos+=blocksize;\n } \n if(inblock_row +1 >= stephight)\n {\n \n continue; \n }\n ypos+=blocksize;\n \n }\n ypos=currentY;\n \n }\n \n else if (currnt_element=='.')\n {\n for(var inblock_row=0;inblock_row<stephight;inblock_row++)\n {\n xpos=currentX;\n for(var inblock_colomn=0;inblock_colomn<stepwidth;inblock_colomn++)\n {\n path=new Path(xpos,ypos,scale);\n path.drawbrick();\n xpos+=blocksize;\n } \n if (inblock_row + 1 >= stephight)\n {\n continue; \n }\n ypos+=blocksize;\n \n }\n ypos=currentY;\n \n \n }\n else \n {\n \n continue;\n }\n \n //xpos+=blocksize/4;// remove this line to remove the spaces between each step \n }\n row_temp++; \n xpos=blocksize/2;\n ypos+=blocksize*(stephight);\n } \n return end_pos; \n}", "title": "" }, { "docid": "d0280b71cabcd9bcc572ffc9d54372cf", "score": "0.5974219", "text": "draw_background_tiles(){\n\n\t\t// calculate the tile positions the player is above\n\t\tvar player_floor_tile_pos = [Math.floor(this._player.cur_coord[0]/this._player.size), Math.floor(this._player.cur_coord[1]/this._player.size)];\n\t\tvar player_ceil_tile_pos = [Math.ceil(this._player.cur_coord[0]/this._player.size), Math.ceil(this._player.cur_coord[1]/this._player.size)];\n\n\t\t// retrieve the tiles beneath the player\n\t\tvar player_floor_tile = this._game_map.get_map_tile(player_floor_tile_pos);\n\t\tvar player_ceil_tile = this._game_map.get_map_tile(player_ceil_tile_pos);\n\n\t\t// draw tiles beneath the player\n\t\tplayer_floor_tile.draw(this._context);\n\t\tplayer_ceil_tile.draw(this._context);\n\n\t\tfor(var i = 0 ; i < this._ghosts.length; i++){\n\n\t\t\t// calculate the tile positions the ghost is above\n\t\t\tvar ghost_floor_tile_pos = [Math.floor(this._ghosts[i].cur_coord[0]/this._ghosts[i].size), Math.floor(this._ghosts[i].cur_coord[1]/this._ghosts[i].size)];\n\t\t\tvar ghost_ceil_tile_pos = [Math.ceil(this._ghosts[i].cur_coord[0]/this._ghosts[i].size), Math.ceil(this._ghosts[i].cur_coord[1]/this._ghosts[i].size)];\n\n\t\t\t// retrieve the tiles beneath the ghost\n\t\t\tvar ghost_floor_tile = this._game_map.get_map_tile(ghost_floor_tile_pos);\n\t\t\tvar ghost_ceil_tile = this._game_map.get_map_tile(ghost_ceil_tile_pos);\n\n\t\t\t// draw tiles beneath the ghost\n\t\t\tghost_floor_tile.draw(this._context);\n\t\t\tghost_ceil_tile.draw(this._context);\n\t\t}\n\t}", "title": "" }, { "docid": "8a7fcc4feab2b610657fcb01fd90db52", "score": "0.5972951", "text": "function turnFOWOff() {\n for (let i = 0; i < levelMap.length; i++) {\n for (let j = 0; j < levelMap.length; j++) {\n let location = levelMap[i][j]\n location.visible = true\n location.draw()\n }\n }\n drawBoard()\n}", "title": "" }, { "docid": "4dc471d3397e65a7b9b8309d23ce62cd", "score": "0.59663206", "text": "function updateCanvas()\r\n{\r\n\tcontext.drawImage(mapLibrary.getImage(0),0,0,640,640);\r\n\t// Map rendering.\r\n\tlet MAPWIDTH = 40;\r\n\tlet MAPHEIGHT = 40;\r\n\tlet TILE_SIZE = 16;\r\n\tfor (let index = 0; index < MAPWIDTH * MAPHEIGHT; index ++)\r\n\t{\r\n\t\tlet x = (index % MAPWIDTH) * TILE_SIZE;\r\n\t\tlet y = (Math.floor(index/MAPWIDTH)) * TILE_SIZE;\r\n\t\t\r\n\t\tcontext.drawImage(tileLibrary.getImage(0),0,0,16,16,x,y,TILE_SIZE,TILE_SIZE);\r\n\t\tconsole.log(x + \",\" + y);\r\n\t}\r\n} // end of updateCanvas()", "title": "" }, { "docid": "63bdd156d6de9f28f04d8552cbda72e0", "score": "0.5952864", "text": "initializeGame() {\n /**\n * Initialize border walls, put them in the quadtree\n * I'm still not sure I want to use the quadtree to store data for the borders.\n * I don't know how much it will help us, it might even not help. \n */\n var leftBorderWall = new Wall(0, 0, config.wall.width, config.gameHeight);\n var topBorderWall = new Wall(0, 0, config.gameWidth, config.wall.width);\n var rightBorderWall = new Wall(config.gameWidth - config.wall.width, 0, config.wall.width, config.gameHeight);\n var bottomBorderWall = new Wall(0, config.gameHeight - config.wall.width, config.gameWidth, config.wall.width);\n\n this.quadtree.put(leftBorderWall.forQuadtree());\n this.quadtree.put(topBorderWall.forQuadtree());\n this.quadtree.put(rightBorderWall.forQuadtree());\n this.quadtree.put(bottomBorderWall.forQuadtree());\n\n for(var i = 0; i < config.wall.count; i++){\n //random x,y to start barrier\n var x = Math.floor((Math.random() * config.gameWidth));\n var y = Math.floor((Math.random() * config.gameHeight));\n\n\n var w;\n var h;\n\n /*\n Half the rows tend to be wider than long, the other half tend to be longer than wide.\n I did this because I want more rectangular shapes than square shapes.\n */\n if(i % 2 === 0){\n w = Math.max(config.wall.minDimension, Math.floor((Math.random() * (config.wall.maxDimension / 3))));\n h = Math.max(config.wall.minDimension,Math.floor((Math.random() * config.wall.maxDimension)));\n }else{\n w = Math.max(config.wall.minDimension, Math.floor((Math.random() * config.wall.maxDimension)));\n h = Math.max(config.wall.minDimension,Math.floor((Math.random() * (config.wall.maxDimension / 3))));\n }\n\n var wall = new Wall(x,y,Math.min(config.gameWidth - x,w),Math.min(config.gameHeight - y,h));\n this.quadtree.put(wall.forQuadtree());\n }\n }", "title": "" }, { "docid": "899f6df67989f0f42f5db9b386015c12", "score": "0.5942825", "text": "function InitBlocks(){\n\t\tvar bMat = new THREE.MeshPhongMaterial({\n\t\t\tcolor: 0xFF9900\n\t\t});\n\n\t\tblocks = new Array();\n\t\tvar count = 0;\n\t\tfor(var n = 0; n < 32; n++){\n\t\t\trandX = Math.round((threeDWidth-10)*Math.random());\n\t\t\trandY = Math.round((threeDHeight-10)*Math.random());\n\t\t\tif(n < 2){\n\t\t\t\tvar building1 = new building_three();\n\t\t\t\tfor(var i = randY; i < randY+10; i++){\n\t\t\t\t\tfor(var j = randX; j < randX+10; j++){\n\t\t\t\t\t\tmapMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(n >= 2 && n < 7){\n\t\t\t\tvar building2 = new building_one();\n\t\t\t\tfor(var i = randY; i < randY+3; i++){\n\t\t\t\t\tfor(var j = randX; j < randX+3; j++){\n\t\t\t\t\t\tmapMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(n >= 17 && n < 22){\n\t\t\t\tvar building3 = new building_two();\n\t\t\t\tfor(var i = randY; i < randY+3; i++){\n\t\t\t\t\tfor(var j = randX; j < randX+3; j++){\n\t\t\t\t\t\tmapMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tvar building4 = new building_four();\n\t\t\t\tfor(var i = randY; i < randY+2; i++){\n\t\t\t\t\tfor(var j = randX; j < randX+2; j++){\n\t\t\t\t\t\tmapMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (var i = 0; i < threeDHeight; i+=3){\n\t\t\tfor (var j = 0; j < threeDWidth; j++) {\n\t\t\t\t\tif(mapMatrix[i][j] == 2){\n\t\t\t\t\t\t//count++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Horizontal SEO\n\t\t\t\t\t\tvar preJ = j;\n\t\t\t\t\t\tvar rowNum = 0;\n\t\t\t\t\t\twhile(mapMatrix[i][j] == 2) {\t\n\t\t\t\t\t\t\trowNum++;\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tj--;\n\t\t\t\t\t\n\t\t\t\t\t\tvar b1 = new THREE.Mesh(\n\t\t\t\t\t\t\tnew THREE.CubeGeometry(10*rowNum, 200*Math.random()+10, 10),\n\t\t\t\t\t\t\tbMat\n\t\t\t\t\t\t);\n\t\t\t\t\t\t//var b1 = new THREE.Mesh(\n\t\t\t\t\t\t//\tnew THREE.PlaneGeometry(10*rowNum, 10), \n\t\t\t\t\t\t//\tnew THREE.MeshLambertMaterial({color: 0xFFFFFF})\n\t\t\t\t\t\t//);\n\t\t\t\n\t\t\t\t\t\tvar nowJ = preJ + (rowNum-1)/2;\n\t\t\t\t\t\tb1.position.y = 0;\n\t\t\t\t\t\tb1.position.x = nowJ * 10;\n\t\t\t\t\t\tb1.position.z = i * 10;\n\t\t\t\t\t\tscene.add(b1);\n\t\t\t\t\t\tblocks.push(b1);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (var i = 1; i < threeDHeight; i+=3){\n\t\t\tfor (var j = 0; j < threeDWidth; j++) {\n\t\t\t\t\tif(mapMatrix[i][j] == 2){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Horizontal SEO\n\t\t\t\t\t\tvar preJ = j;\n\t\t\t\t\t\tvar rowNum = 0;\n\t\t\t\t\t\twhile(mapMatrix[i][j] == 2) {\t\n\t\t\t\t\t\t\trowNum++;\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tj--;\n\t\t\t\t\t\n\t\t\t\t\t\tvar b1 = new THREE.Mesh(\n\t\t\t\t\t\t\tnew THREE.PlaneGeometry(10*rowNum, 10), \n\t\t\t\t\t\t\tnew THREE.MeshLambertMaterial({color: 0x0000FF})\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar nowJ = preJ + (rowNum-1)/2;\n\t\t\t\t\t\tb1.position.y = -4;\n\t\t\t\t\t\tb1.position.x = nowJ * 10;\n\t\t\t\t\t\tb1.position.z = i * 10;\n\t\t\t\t\t\tb1.material.wireframe = true;\n\t\t\t\t\t\tscene.add(b1);\n\t\t\t\t\t\tblocks.push(b1);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (var i = 2; i < threeDHeight; i+=3){\n\t\t\tfor (var j = 0; j < threeDWidth; j++) {\n\t\t\t\t\tif(mapMatrix[i][j] == 2){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Horizontal SEO\n\t\t\t\t\t\tvar preJ = j;\n\t\t\t\t\t\tvar rowNum = 0;\n\t\t\t\t\t\twhile(mapMatrix[i][j] == 2) {\t\n\t\t\t\t\t\t\trowNum++;\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tj--;\n\t\t\t\t\t\n\t\t\t\t\t\tvar b1 = new THREE.Mesh(\n\t\t\t\t\t\t\tnew THREE.PlaneGeometry(10*rowNum, 10), \n\t\t\t\t\t\t\tnew THREE.MeshLambertMaterial({color: 0x0000FF})\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar nowJ = preJ + (rowNum-1)/2;\n\t\t\t\t\t\tb1.position.y = -4;\n\t\t\t\t\t\tb1.position.x = nowJ * 10;\n\t\t\t\t\t\tb1.position.z = i * 10;\n\t\t\t\t\t\tb1.material.wireframe = true;\n\t\t\t\t\t\tscene.add(b1);\n\t\t\t\t\t\tblocks.push(b1);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tconsole.log(count);\n\t}", "title": "" }, { "docid": "13dac4690662667ae113a7afde9a3b76", "score": "0.59406245", "text": "function drawMeleeTiles() {\n if (!booleans[\"show-melee-tiles\"] || !verzik) return;\n s = tile_size;\n st = tile_stroke;\n //draw box stroke\n ctxt.fillStyle = values[\"color-melee-marker\"];\n strokeRect((verzik.pos.x-1) * s, (verzik.pos.y-1) * s, (verzik.size+2) * s, (verzik.size+2) * s, st);\n strokeRect(verzik.pos.x * s - st, verzik.pos.y * s - st, verzik.size * s + 2 * st, verzik.size * s + 2 * st, st);\n //draw box highlight\n ctxt.fillStyle = values[\"color-melee-marker\"] + \"20\";\n ctxt.fillRect((verzik.pos.x-1) * s, (verzik.pos.y-1) * s, (verzik.size+2) * s, s );\n ctxt.fillRect((verzik.pos.x-1) * s, verzik.pos.y * s, s, (verzik.size+1) * s );\n ctxt.fillRect(verzik.pos.x * s, (verzik.pos.y+verzik.size) * s, (verzik.size+1) * s, s );\n ctxt.fillRect((verzik.pos.x+verzik.size) * s, verzik.pos.y * s, s, verzik.size * s );\n}", "title": "" }, { "docid": "a0c7b932c9cec92c98a1b96eb9b2f8cb", "score": "0.5938436", "text": "displayWarpMap(tileArray, h, w, selection) {\n this.mapDisplay.clear();\n for (let i = 0; i < tileArray.length; i++) {\n let x = i % w;\n let y = Math.floor(i/w);\n if (tileArray[i].selection == selection) {\n this.mapDisplay.draw(x, y, tileArray[i].sprite, \"red\", \"darkred\");\n } else {\n this.mapDisplay.draw(x, y, tileArray[i].sprite, tileArray[i].fgColor, tileArray[i].bgColor);\n }\n }\n }", "title": "" }, { "docid": "51fd19c0053e1e9f6cef70605cb68355", "score": "0.5932319", "text": "function render() {\n ctx.beginPath();\n\n for (let x = 0; x < columns; x++) {\n ctx.moveTo(x * tileWidth, 0);\n ctx.lineTo(x * tileWidth, h);\n }\n for (let y = 0; y < rows; y++) {\n ctx.moveTo(0, y * tileHeight);\n ctx.lineTo(w, y * tileHeight);\n\n }\n ctx.stroke();\n const loadingCoords = loadingData();\n for (let i = 0; i < loadingCoords.length; i++) {\n ctx.fillStyle = loadingCoords[i].colour;\n ctx.fillRect(loadingCoords[i].x, loadingCoords[i].y, tileWidth, tileHeight);\n }\n }", "title": "" }, { "docid": "1b7fe2d9c4e7f74235b66200d99f05dc", "score": "0.59313446", "text": "function draw()\n{\n\tbackground(0);\n\tpointLight(250, 250, 250,-c.width/2,-c.height/2,5);\n\tpointLight(250, 250, 250,c.width/2,-c.height/2,5);\n\tpointLight(250, 250, 250,c.width/2,c.height/2,5);\n\t//pointLight(250, 250, 250,0,0,5);\n\ttranslate(-c.width/2,-c.height/2);\n\t\n\tfindUnstableCell();\n\t\n\tdrawGrid();\n\n\tfor(var i = 0; i< N_SIZE;i++)\n\t{\n\t\t for(var j = 0;j< M_SIZE;j++)\n\t\t {\n drawBall(i,j);\n\t\t }\n\t}\n\tdrawUnstableBalls(); //animation of ball movement\n\tfindUnstableCell(); \n\tdrawStatTable(); \t\n\t//exclude();\n\t//requestAnimationFrame(redraw);\n}", "title": "" }, { "docid": "e33f17f0e2b578233e289a052d588c62", "score": "0.59300244", "text": "function initialize(){\n\tfor(let i=0; i<gridHeight; i++){\n\t\tgrid[i] = [];\n\t\tfor(let j=0; j<gridLength; j++){\n\t\t\tgrid[i][j] = new Wall(i,j); //Start by filling the entire map with walls\n\t\t}\n\t}\n\tsetRoom(); //set down a \"first\" room where the player will start\n\tplayerStart = setPlayerStart(); //set the starting location for the player\n}", "title": "" }, { "docid": "1f9b705485bb48aeae725b6b350adfd0", "score": "0.59265286", "text": "drawTiles() {\n // First display base tiles\n for (var y = 0; y < this._tiles.length; y++) {\n for (var x = 0; x < this._tiles[y].length; x++) {\n var xPos = this._offsetX + (x * this._tileSize);\n var yPos = this._offsetY + (y * this._tileSize);\n var image = this.getTile(x, y).image;\n var baseImage = this.getTile(x, y).baseImage;\n\n if (image == \"ocean-4-nswe\") { continue; } // No base tile needed for full tiles\n\n // Add the base tile for\n var tileImage;\n if (baseImage) { tileImage = baseImage; }\n else if (this._baseTile == \"grass\") { tileImage = getGrassTile(); }\n else { tileImage = this._baseTile; }\n this._game.add.image(xPos, yPos, tileImage).setOrigin(0, 0);\n }\n } // end tile loop\n\n // Display non-base tiles\n for (var y = 0; y < this._tiles.length; y++) {\n for (var x = 0; x < this._tiles[y].length; x++) {\n var xPos = this.posX(x);\n var yPos = this.posY(y);\n var image = this.getTile(x, y).image;\n var baseImage = this.getImageBase(image);\n var overImage = this.getTile(x, y).overImage;\n\n // Don't display base tiles again\n if (baseImage == this._baseTile) { continue; }\n\n // Skip tiles replaced by a larger tile image\n if (this.getTile(x, y).bigImage) { continue; }\n\n // Handle special tiles that overlap others\n // - Forest tiles that aren't vertical need to be bumped up some\n if (baseImage == \"forest\") {\n yPos = this._offsetY + ((y + 1) * this._tileSize);\n var forestImage = this._game.add.image(xPos, yPos, image).setOrigin(0, 1);\n forestImage.depth = 1;\n continue;\n }\n\n // Structures\n if (image.indexOf(\"-struct\") != -1) {\n // Display the structure in the middle-bottom\n xPos += (this._tileSize / 2)\n yPos = this._offsetY + ((y + 1) * this._tileSize);\n var structImage = this._game.add.image(xPos, yPos, image).setOrigin(0.5, 1);\n structImage.depth = 1.5;\n\n var tile = this.getTile(x, y);\n tile.tileSprite = structImage;\n tile.tileX = this.posX(x);\n tile.tileY = this.posY(y);\n\n // Workshops\n if (this.isWorkshop(tile)) {\n var faction = tile.faction;\n if (faction) {\n faction.addWorkshop(tile);\n }\n }\n\n continue;\n }\n\n // Walls near Stone\n if (baseImage == \"wall\") {\n this.addStoneUnder(x, y);\n }\n\n // Add the tile sprite\n var tileSprite = this._game.add.image(xPos, yPos, image).setOrigin(0, 0);\n if (baseImage == \"wall\") { tileSprite.depth = 0.5; }\n\n // Add overImages like bridges\n if (overImage) {\n this._game.add.image(xPos, yPos, overImage).setOrigin(0, 0);\n }\n } // end tile loop\n } // end tile loop\n }", "title": "" }, { "docid": "9f85c6ed361d7d452175a7ec15ab533c", "score": "0.59205145", "text": "function drawInitMinefield() {\n\tvar rc = {\"row\": 0, \"col\": 0};\n\tfor (rc.row = 0; rc.row < size.lvl; rc.row++) {\n\t\tfor (rc.col = 0; rc.col < size.lvl; rc.col++) {\n\t\t\tdrawRect('gray', rc);\n\t\t};\n\t};\n}", "title": "" }, { "docid": "00d6357515b9556e1ebf8f859d56372b", "score": "0.5916827", "text": "function draw_map(map) {\n for (let i = 0; i < map.length; i++) {\n let x1 = parseInt(i % 100);\n let x2 = parseInt(i / 100);\n drawcell(x1, x2, map[i]);\n }\n}", "title": "" }, { "docid": "90f4b6011e3ac50b37b6ca84aeeca3b7", "score": "0.591498", "text": "function setupBackgroundMap()\n {veg2DGrid[tempRow][tempCol] = value1.colorNum\n // backgroundMap.onload = function(){\n // canvas2DContext.globalAlpha = 0.5;\n // canvas2DContext.drawImage(backgroundMap, 0, 0);\n // }\n \n }", "title": "" }, { "docid": "443f68cbf107f1820583d7a0009469a5", "score": "0.59092444", "text": "function resetMap() {\n for (let y = 0; y < mapHeight; y++) {\n for (let x = 0; x < mapWidth; x++) {\n map[y*mapWidth + x] = x == 0 || x == mapWidth - 1 || y == mapHeight - 1 ? \"x\" : \".\";\n }\n }\n score = 0;\n lines = 0;\n level = 0;\n fallDelay = speeds[0];\n rotation = 0;\n holdPiece = [];\n}", "title": "" }, { "docid": "b68b712435cdf0846e3b884e9dd270ba", "score": "0.5906963", "text": "function drawBoard(){\n\tfor(var i = 0; i < columns; i++){\n\t\tfor(var j = 0 ; j < rows; j++){\n\t\t\tctx.rect(blockWidth*j, blockHeight*i, blockWidth, blockHeight);\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\tdrawBall();\n}", "title": "" }, { "docid": "16200b25c606e294de7263820567bbdb", "score": "0.5900852", "text": "function drawBoard() {\n drawWhiteBg();\n drawTail();\n drawName(\"MCKOY\");\n drawSilhouette();\n }", "title": "" }, { "docid": "dfdae0732a23aed45cc4774256419219", "score": "0.58998704", "text": "function drawMap(offsetX, offsetY) {\n for(var layerIdx=0; layerIdx<LAYER_COUNT; layerIdx++)\n {\n var idx = 0;\n for( var y = 0; y < level1.layers[layerIdx].height; y++ )\n {\n for( var x = 0; x < level1.layers[layerIdx].width; x++ )\n {\n if( level1.layers[layerIdx].data[idx] != 0 )\n {\n // the tiles in the Tiled map are base 1 (meaning a value of 0 means no tile), so subtract one from the tileset id to get the\n // correct tile\n var tileIndex = level1.layers[layerIdx].data[idx] - 1;\n var sx = TILESET_PADDING + (tileIndex % TILESET_COUNT_X) * (TILESET_TILE + TILESET_SPACING);\n var sy = TILESET_PADDING + (Math.floor(tileIndex / TILESET_COUNT_Y)) * (TILESET_TILE + TILESET_SPACING);\n \n var dx = x*TILE - offsetX;\n var dy = (y-1)*TILE - offsetY;\n \n context.drawImage(tileset, sx, sy, TILESET_TILE, TILESET_TILE, dx, dy, TILESET_TILE, TILESET_TILE);\n }\n idx++;\n }\n }\n\t\n \n \n }\n\n\n\n\n\n\n\n}", "title": "" }, { "docid": "79de7af706e03f6b1a84101e33f28dd6", "score": "0.5892406", "text": "function drawTileWorld(data) {\n if (typeof jQuery !== 'undefined') {\n (function($) {\n\n $(document).ready(function() {\n\n console.log(data);\n\n var tileWorld = '';\n\n // compute box width based on body's max width and font-size as percent of box width\n var maxSize = $(window).height() > $(window).width() ? $(window).width() : $(window).height();\n maxSize -= 110;\n var boxSize = (maxSize-2*data.gridWidth)/data.gridWidth;\n var fontSize = (80*boxSize/100)+\"px\";\n\n console.log(\"maxSize=\"+maxSize+\"; boxSize=\"+boxSize+\"; fontSize=\"+fontSize);\n\n // draw grid\n for(var i=0; i < data.gridHeight; i++) {\n tileWorld += '<div class=\"row\">';\n for(var j=0; j < data.gridWidth; j++) {\n tileWorld += '<div style=\"width:'+boxSize+'px; height:'+boxSize+'px;\" id=\"'+i+j+'\" class=\"box\"></div>';\n }\n tileWorld += \"</div>\";\n }\n $('#tileWorld').html(tileWorld);\n\n // mark obstacles\n for(var i=0; i < data.obstacles.length; i++) {\n var boxId = \"#\"+data.obstacles[i].xPosition+data.obstacles[i].yPosition;\n $(\"\"+boxId).addClass(\"obstacle\");\n }\n\n // mark holes\n for(var i=0; i < data.holes.length; i++) {\n var boxId = \"#\"+data.holes[i].xPosition+data.holes[i].yPosition;\n $(\"\"+boxId).html('<div class=\"hole\" style=\"width:'+boxSize+'px; height:'+boxSize+'px;\"></div>');\n $(\"\"+boxId+\" > .hole\").css(\"background-color\",data.holes[i].color);\n $(\"\"+boxId+\" > .hole\").html(data.holes[i].depth);\n }\n $(\".hole\").css(\"font-size\", fontSize);\n\n // mark tiles\n var tilesMaxSize = boxSize/2;\n for(var i=0; i < data.tiles.length; i++) {\n var tileSize = tilesMaxSize/data.tiles[i].numberOfTiles;\n var boxId = \"#\"+data.tiles[i].xPosition+data.tiles[i].yPosition;\n var tiles = '';\n for(var j = 0; j < data.tiles[i].numberOfTiles; j++) {\n tiles += '<div class=\"tile\" style=\"width:'+tileSize+'px; height:'+tileSize+'px; background-color:'+data.tiles[i].color+'\"></div>'\n }\n $(\"\"+boxId).html(tiles);\n }\n\n // mark agents\n for(var i=0; i < data.agents.length; i++) {\n var boxId = \"#\"+data.agents[i].xPosition+data.agents[i].yPosition;\n $(\"\"+boxId).html('<div class=\"agent\" style=\"width:'+boxSize+'px; height:'+boxSize+'px;\"></div>');\n $(\"\"+boxId+\" > .agent\").css(\"background-color\", data.agents[i].color);\n }\n $(\".agent\").css(\"font-size\", fontSize);\n\n $(\"#console\").css(\"height\", ($(\"#tileWorld\").height()-13)+\"px\");\n $(\"#console\").css(\"width\", ($(window).width() - $(\"#tileWorld\").width() - 42)+\"px\");\n $(\"#console\").scrollTop($(\"#console > ul > li.last\").scrollHeight);\n });\n\n })(jQuery);\n }\n}", "title": "" }, { "docid": "52f062911b9bd42c33530e3dbd3cc07a", "score": "0.5892142", "text": "function clearBlock() {\n mapCanvasContext.fillStyle = 'white';\n console.log(mapCanvasContext.fillStyle);\n setTank = false;\n}", "title": "" }, { "docid": "79fe137cb694f13a34b0d59d41e6438b", "score": "0.58895147", "text": "function drawMaze() {\n const range = {top: 0, left: 0, bottom: rows, right: cols};\n const w = sW/cols, h = sH/rows;\n g.clear();\n if (BANGLEJS2) g.setBgColor(bgColour);\n g.setColor(0.76, 0.60, 0.42);\n for(let row = range.top; row<=range.bottom; row++) {\n for(let col = range.left; col<=range.right; col++) {\n const walls = rooms[row*cols+col], x = col*w, y = row*h;\n if (walls&BOTTOM) g.drawLine(x, y+h, x+w, y+h);\n if (walls&RIGHT) g.drawLine(x+w, y, x+w, y+h);\n }\n }\n // outline\n g.setColor(0.29, 0.23, 0.17).drawRect(0, 0, sW-1, sH-1);\n // target\n g.setColor(0, 0.5, 0).fillCircle(sW-cW/2, sH-rH/2, r-1);\n if (route) drawRoute();\n }", "title": "" }, { "docid": "43c38a4376118698204f31f9a4c559d8", "score": "0.58880895", "text": "function drawZones(){\n \n for (var i = 0; i < (canvas.height / rows); i++) {\n addSquare(i);\n }\n }", "title": "" }, { "docid": "5bcc3575de0ca30da1de944aa4e3b63a", "score": "0.58852464", "text": "render () {\n // only render the tiles that can be seen on the screen\n let yMin = Math.floor(OasisCamera.location.y / Tile.size.height);\n let yMax = Math.ceil((OasisCamera.location.y + OasisCanvas.height) / Tile.size.height);\n\n let xMin = Math.floor(OasisCamera.location.x / Tile.size.width);\n let xMax = Math.ceil((OasisCamera.location.x + OasisCanvas.width) / Tile.size.width);\n\n // track how many tiles are being rendered\n let tileCount = 0;\n\n // reset container for all trees visible on the map\n allVisibleTrees = [];\n\n // cycle through only the screen-visible tiles\n for (let worldY = yMin - 1; worldY < yMax + 1; worldY++) {\n for (let worldX = xMin - 1; worldX < xMax + 1; worldX++) {\n let tilemapX = worldX;\n let tilemapY = worldY;\n\n // above/left of world\n if (worldY < 0) {\n tilemapY += 1;\n tilemapY = this.tilemap.length - ((-tilemapY) % this.tilemap.length) - 1;\n }\n if (worldX < 0) {\n tilemapX += 1;\n tilemapX = this.tilemap.length - ((-tilemapX) % this.tilemap.length) - 1;\n }\n\n // below/right of world\n if (worldY > this.tilemap.length - 1) tilemapY %= this.tilemap.length;\n if (worldX > this.tilemap.length - 1) tilemapX %= this.tilemap.length;\n\n // and render it\n Tile.render(worldX, worldY, this.tilemap[tilemapY][tilemapX], tilemapX, tilemapY);\n tileCount++;\n\n // if tile being rendered is a tree, save it in trees array\n if (this.tilemap[tilemapY][tilemapX] === 5) {\n const tree = {worldX, worldY};\n allVisibleTrees.push(tree);\n }\n }\n }\n\n // draw debug info\n if (debug) {\n // draw tiles rendered count\n OasisCanvasContext.fillStyle = 'black';\n OasisCanvasContext.font = \"15px Arial\";\n OasisCanvasContext.fillText(\n '' + tilecount,\n 100,\n 100\n );\n }\n }", "title": "" }, { "docid": "9a5f5477f950a07da6e2c50704bd2731", "score": "0.58850926", "text": "function resetMap(){\r\n\t\t\t\r\n\t\t\tthis.snake = new Array(2);\r\n\t\t\tthis.snake[0] = new snakePart(mapSize/2,mapSize/2);\r\n\t\t\tthis.snake[1] = new snakePart(this.snake[0].x+1, this.snake[0].y);\r\n\t\t\t\r\n\t\t\tthis.berries = new Array();\r\n\t\t\t\r\n\t\t}", "title": "" } ]
de89126dc8b78ec9ae878edb32347ae6
FUNCTIONS USED IN THIS JAVASCRIPT Function to paint the lines of the map, the pumps and the death people with a given scale
[ { "docid": "d47ad92c94a4013a6cb2b468eda55858", "score": "0.8087536", "text": "function paintMap(scale,from,to)\n{\n //initialize arrays to hold the position values for map lines, pumps and deaths\n var line_points = new Array();\n var line =[];\n var pump_position = new Array();\n var pump =[];\n var death_position = new Array();\n var death =[];\n //initialize array to hold sex color of the death\n var color = new Array();\n var age = new Array();\n //initialize array to hold where the pump is\n var at = new Array();\n at.push('Oxford Market');\n at.push('');\n at.push('Castle St. East');\n at.push('');\n at.push('Berners St.');\n at.push('');\n at.push('Newman St.');\n at.push('');\n at.push('Marlborough Mews');\n at.push('');\n at.push('Little Marlborogh St.')\n at.push('');\n at.push('Broad St.');\n at.push('');\n at.push('Warwick St.');\n at.push('');\n at.push('Bridle St.');\n at.push('');\n at.push('Rupert St.');\n at.push('');\n at.push('Dean St.');\n at.push('');\n at.push('Tichborne St.');\n at.push('');\n at.push('Vigo Street')\n\n\n\n //read coordenates from map and draw a line\n for (var i=0;i<Points.map.length;i++)\n {\n //we see the number of points\n var number_points=Points.map[i].y;\n for (var j=1;j<number_points+1;j++)\n {\n line_points.push((Points.map[i+j].x-3)*scale)\n line_points.push(-(Points.map[i+j].y-19)*scale)\n }\n\n if(number_points<=4){\n stroke_line=0.08;\n }\n else{ \n if(number_points>4){\n if(number_points<7){\n stroke_line=0.04;\n }\n if(number_points<=10){\n stroke_line=0.02;\n }\n if(number_points>10){\n stroke_line=0.01;\n }\n }\n }\n \n // create a line\n line[i] = new Kinetic.Line({\n \t\tx:0,\n \t\ty:0,\n points: line_points,\n stroke: 'white',\n strokeWidth: stroke_line*scale,\n });\n line_group.add(line[i]);\n i=i+j-1;\n line_points=[];\n }\n\n\n //Create the pumps array with their positions\n for (var i=0;i<Points.pumps.length;i++)\n {\n \tpump_position.push((Points.pumps[i].x-3)*scale)\n \tpump_position.push(-(Points.pumps[i].y-19)*scale)\n }\n\n //Create the real pumps and add them to the layer\n for (var i=0; i<26;i++)\n {\t\n \tpump[i] = new Kinetic.Circle({\n \t x: pump_position[i],\n \t y: pump_position[i+1],\n \t radius: 0.16*scale,\n \t fill: 'blue',\n \t stroke: 'black',\n \t strokeWidth: 0.02*scale,\n at: at[i]\n \t });\n pump_group.add(pump[i]);\n \ti++;\n }\n\n //Array to hold the position of deaths\n for (var i=0;i<Deaths.position.length;i++)\n {\n \tdeath_position.push((Deaths.position[i].x-3)*scale)\n \tdeath_position.push(-(Deaths.position[i].y-19)*scale)\n age.push(Deaths.position[i].age)\n if (Deaths.position[i].gender==1)\n {\n if (age[i]==0){\n color.push('#F2D0DC');\n }\n if (age[i]==1){\n color.push('#EEBCCD');\n }\n if (age[i]==2){\n color.push('#E8AABF');\n }\n if (age[i]==3){\n color.push('#CF90A6');\n }\n if (age[i]==4){\n color.push('#A17081');\n }\n if (age[i]==5){\n color.push('#73505C'); \n }\n }\n else\n {\n if (age[i]==0){\n color.push('#66E066');\n }\n if (age[i]==1){\n color.push('#33D633');\n }\n if (age[i]==2){\n color.push('#00CC00');\n }\n if (age[i]==3){\n color.push('#00A300');\n }\n if (age[i]==4){\n color.push('#008F00');\n }\n if (age[i]==5){\n color.push('#006600'); \n }\n }\n } \n\n //Add deaths to the layer\n for (var i=from; i<to;i++)\n {\n addNode(deathlayer,Deaths.position[i],scale,color,i,age); \n }\n\n //Add Workhouse and Brewery\n\n var workhouse = new Kinetic.Rect({\n x: 7.5*scale,\n y: 5.5*scale,\n width: 1.3*scale,\n height: 0.8*scale,\n fill: \"#666666\" ,\n stroke: 'black',\n strokeWidth: 0.01*scale, \n rotation: -22\n });\n var brewery = new Kinetic.Rect({\n x: 10.83*scale,\n y: 6.61*scale,\n width: 0.9*scale,\n height: 0.38*scale,\n fill: \"#666666\" ,\n stroke: 'white',\n strokeWidth: 0.01*scale, \n rotation: 61\n });\n\n line_group.add(workhouse)\n line_group.add(brewery)\n writeMessage(\"Work\",7.6*scale,5.5*scale,-21,scale,\"white\",0.25)\n writeMessage(\"house\",8*scale,5.7*scale,-21,scale,\"white\",0.25)\n writeMessage(\"Brewery\",10.8*scale,6.68*scale,60,scale,\"white\",0.23)\n\n maplayer.add(line_group)\n pumplayer.add(pump_group)\n //deathlayer.add(death)\n stage.add(maplayer);\n stage.add(pumplayer);\n stage.add(deathlayer);\n\n //Add names of the streets (Hardcoded)\n writeMessage(\"Oxford Street\",2.8*scale,3.2*scale,-12,scale,\"black\",0.25)\n writeMessage(\"Oxford Street\",8.5*scale,2.1*scale,-12,scale,\"black\",0.25)\n writeMessage(\"Soho Square\",14.45*scale,3.2*scale,-21,scale,\"black\",0.25)\n writeMessage(\"Regent Street\",2.9*scale,3.7*scale,75,scale,\"black\",0.25)\n writeMessage(\"Regent Street\",5.9*scale,10*scale,60,scale,\"black\",0.25)\n\n //Functions of paintMap fuction\n\n //Function to create a node\n function addNode(layer,DeathsPosition,scale,color,i) {\n var death = new Kinetic.Rect({\n x: (DeathsPosition.x-3)*scale,\n y: -(DeathsPosition.y-19)*scale,\n width: 0.1*scale,\n height: 0.1*scale,\n fill: color[i],\n stroke: 'black',\n strokeWidth: 0.01*scale, \n id: i,\n age: age[i],\n gender: Deaths.position[i].gender\n });\n deathlayer.add(death)\n }\n\n //Functions to see values of the data\n \n //1. Pumps mouseover\n pumplayer.on('mouseover', function(evt) {\n \n //Text to display\n\n var tooltip = new Kinetic.Label({\n opacity: 0.75,\n visible: false,\n listening: false\n });\n \n tooltip.add(new Kinetic.Tag({\n fill: 'black',\n pointerDirection: 'down',\n pointerWidth: 10,\n pointerHeight: 10,\n lineJoin: 'round',\n shadowColor: 'black',\n shadowBlur: 10,\n shadowOffset: {x:10, y:10},\n shadowOpacity: 0.2\n }));\n \n tooltip.add(new Kinetic.Text({\n text: '',\n fontFamily: 'Calibri',\n fontSize: 18,\n padding: 5,\n fill: 'white'\n }));\n \n tooltipLayer.add(tooltip);\n stage.add(tooltipLayer);\n\n var node = evt.targetNode;\n if (node) {\n // update tooltip\n var mousePosx = node.attrs.x;\n var mousePosy = node.attrs.y;\n tooltip.position({x:mousePosx, y:mousePosy - 5});\n tooltip.getText().text(node.attrs.at + ' pump');\n tooltip.show();\n tooltipLayer.batchDraw();\n }\n\n pumplayer.on('mouseout', function(evt) {\n tooltip.hide();\n tooltipLayer.draw();\n });\n pumplayer.on('mouseout', function(evt) {\n tooltip.hide();\n tooltipLayer.draw();\n });\n });\n\n //Deaths mouseover\n\n deathlayer.on('mouseover', function(evt) {\n \n //Text to display\n\n var tooltip = new Kinetic.Label({\n opacity: 0.75,\n visible: false,\n listening: false\n });\n \n tooltip.add(new Kinetic.Tag({\n fill: 'black',\n pointerDirection: 'down',\n pointerWidth: 10,\n pointerHeight: 10,\n lineJoin: 'round',\n shadowColor: 'black',\n shadowBlur: 10,\n shadowOffset: {x:10, y:10},\n shadowOpacity: 0.2\n }));\n \n tooltip.add(new Kinetic.Text({\n text: '',\n fontFamily: 'Calibri',\n fontSize: 18,\n padding: 5,\n fill: 'white'\n }));\n \n tooltipLayer.add(tooltip);\n stage.add(tooltipLayer);\n\n var node = evt.targetNode;\n if (node) {\n // update tooltip\n var mousePosx = node.attrs.x;\n var mousePosy = node.attrs.y;\n tooltip.position({x:mousePosx, y:mousePosy - 5});\n if (node.attrs.gender==1){\n gender=\"female\";\n }\n else{\n gender=\"male\";\n }\n if (node.attrs.age==0){\n age=\" < 10\"\n }\n if (node.attrs.age==1){\n age=\"11 - 20\"\n }\n if (node.attrs.age==2){\n age=\"21 - 40\"\n }\n if (node.attrs.age==3){\n age=\"41 - 60\"\n }\n if (node.attrs.age==4){\n age=\"61 - 80\"\n }\n if (node.attrs.age==5){\n age=\" > 80\" \n }\n tooltip.getText().text(\"\" + gender + \", \" + \"age: \" + age);\n tooltip.show();\n tooltipLayer.batchDraw();\n }\n\n deathlayer.on('mouseout', function(evt) {\n tooltip.hide();\n tooltipLayer.draw();\n });\n deathlayer.on('mouseout', function(evt) {\n tooltip.hide();\n tooltipLayer.draw();\n });\n });\n //streets mouseover\n maplayer.on('mouseover', function(event,death_group) {\n var mousePos = stage.getPointerPosition();\n var offset = stage.getOffset();\n var x = mousePos.x+offset.x;\n var y = mousePos.y+offset.y;\n //writeMessage('x: ' + x + ', y: ' + y);\n //writeMessage('Pump',x,y);\n });\n maplayer.on('mouseout', function(event,death_group) {\n var mousePos = stage.getPointerPosition();\n var x = mousePos.x-40;\n var y = mousePos.y+10;\n //writeMessage('x: ' + x + ', y: ' + y);\n //writeMessage(' ');\n });\n function writeMessage(message,x,y,rotation,scale,fill,fontsize) {\n var text = new Kinetic.Text({\n x: x,\n y: y,\n fontFamily: 'Calibri',\n fontSize: fontsize*scale,\n text: '',\n fill: fill,\n rotation: rotation\n });\n text.setText(message);\n textlayer.add(text);\n textlayer.draw();\n stage.add(textlayer);\n }\n}", "title": "" } ]
[ { "docid": "f99d1efc680277055e211b4a537c99cb", "score": "0.63104844", "text": "function drawMapLayer (scale) {\n var ctx = mapLayerCtx;\n ctx.fillStyle = \"black\";\n ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n // ctx.globalCompositeOperation = \"\";\n for (var i = 0; i < self.candles.length; ++i) {\n var candle = self.candles[i];\n var position = candle.GetPosition();\n var fixture = candle.GetFixtureList();\n var lighted = fixture.GetBody().GetUserData().lighted;\n if (lighted) {\n var x = Math.floor(scale*position.x-gradientImage.width/2),\n y = Math.floor(scale*(self.height-position.y)-gradientImage.height/2),\n w = gradientImage.width,\n h = gradientImage.height;\n ctx.save();\n ctx.clearRect(x, y, w, h);\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.clip();\n ctx.drawImage(gradientImage, x, y);\n ctx.restore();\n }\n }\n }", "title": "" }, { "docid": "bdedfa53eeb6d4d59164799437c52d1a", "score": "0.624538", "text": "function path(d) {\n return line(pathData.map(function(p) {\n //console.log(p.data, d[p.data], scaleY1(d[p.data]));\n //console.log(p,scaleX(p.value),scaleY1(d[p.data]));\n\n if(p.value ==1){\n //console.log(d[p.data]);\n return [scaleX(\"What age do you think you will stop Dancing?\"), scaleY1(d[p.data])];\n }\n if(p.value ==2){\n //console.log(d[p.data]);\n //console.log(Map2.get(+d[p.data]));\n //console.log(Map3.get(+d[p.data]));\n return [scaleX(\"Why do you think you will stop dancing?\"), scaleY2(Map3.get(+d[p.data]))];\n }\n if(p.value ==3){\n //console.log(d[p.data]);\n //console.log(Map3.get(+d[p.data]));\n return [scaleX(\"What will be the most serious challenge you will face when you stop dancing?\"), scaleY3(Map4.get(+d[p.data]))];\n }\n }))\n }", "title": "" }, { "docid": "9c69e93ccb072a09ddf11fa395f68e04", "score": "0.617105", "text": "drawMap(ctx,dt){\r\n ctx.drawImage(this.background,0,0,800,600);\r\n for(let i = 0; i< this.plataformas.length; i++){\r\n this.plataformas[i].draw(ctx);\r\n }\r\n for(let i = 0; i< this.enemies.length; i++){\r\n this.enemies[i].draw(ctx);\r\n }\r\n for(let i = 0; i< this.coins.length; i++){\r\n this.coins[i].draw(ctx);\r\n }\r\n this.flag.draw(ctx);\r\n ctx.fillStyle = \"white\";\r\n ctx.drawImage(this.heart, 10, 10, 50, 50);\r\n ctx.drawImage(this.coinImg, 0, 0, 15, 16, 10, 70, 50, 50);\r\n ctx.textAlign = \"right\";\r\n ctx.font = \"bold 40px Bahnschrift\";\r\n ctx.fillText(\"x\" + this.johny.lifes,120,50);\r\n ctx.fillText(this.johny.coinsCount,120,110);\r\n ctx.fillText(this.johny.bulletCount,120, 170);\r\n dt = Math.round(dt/1000);\r\n var minutes = Math.floor(dt / 60);\r\n var seconds = Math.round(dt - minutes * 60);\r\n if (minutes < 10) {minutes = \"0\"+minutes;}\r\n if (seconds < 10) {seconds = \"0\"+seconds;}\r\n ctx.textAlign = \"center\";\r\n ctx.fillText(minutes + \":\" + seconds,400,50);\r\n ctx.drawImage(this.bulletImg, 10, 130, 50, 50);\r\n }", "title": "" }, { "docid": "01af0b50a140ef539f7cc83ef7e2863a", "score": "0.61368334", "text": "function stand(){\n stroke('#fae');\n fill (120, 135, 220);\n rect (300, 510, 80, 130);\n rect (300, 490+80, 250, 50);\n rect(300, 390, 30, 110);\n ellipse(300, 300, 90, 90);\n strokeWeight(3);\n line(300, 150, 300, 450);\n line(150, 300, 450, 300);\n line (193, 399, 412, 200);\n line (412, 399, 193, 200);\n}", "title": "" }, { "docid": "117d6b033f5f4c7112ceb14085663643", "score": "0.6136368", "text": "function level() {\n stroke(255, 255, 0);\n line(50, 170, 302, 170);\n line(302, 170, 300, 300);\n line(333, 170, 500, 170);\n line(333, 170, 333, 300);\n}", "title": "" }, { "docid": "d1a5d657860e2562e7e95f740178067c", "score": "0.6124681", "text": "function drawVisualization1() {\n angleMode(DEGREES)\n //get&map amplitude\n var ampLevel = amplitude.getLevel();\n var drawLine = map(ampLevel, 0, 0.1, 100, 800);\n //astroid\n beginShape();\n stroke(visualizationColor)\n strokeWeight(0.5);\n noFill();\n translate(vizX + (vizW/2), vizY + (vizH/2));\n for (var i = 0; i < drawLine / 2; i++) { //mouseX controls number of curves\n if (width > 500) {\n LimMouseX = constrain(drawLine*2, 0, vizX + vizW);\n var a = map(LimMouseX, 0, vizX + vizW, 0, 60); //relate to mouseX\n } else {\n LimMouseX = constrain(drawLine*2, 0, width-20);\n var a = map(LimMouseX, 0, width-20, 0, 60);\n }\n // LimMouseX = constrain(drawLine*2, 0, width-20);\n // var a = map(LimMouseX, 0, width-20, 10, 60); //relate to mouseX\n var theta = map(i, 0, drawLine*2, 20, 360);\n var x = 2 * a * cos(theta) + a * cos(2 * theta);\n var y = 2 * a * sin(theta) - a * sin(2 * theta);\n vertex(x, y);\n endShape();\n rotate(drawLine*2); //rotate according to position of mouseX\n }\n}", "title": "" }, { "docid": "f97f3d88c603c0712d6ec191500f31b8", "score": "0.6064372", "text": "function setHeightMap(scale) {\r\n for (var i = 0; i <= scale; i++) {\r\n var temp = new Array(scale + 1);\r\n for (var j = 0; j <= scale; j++) {\r\n temp[j] = 0;\r\n }\r\n heightMap.push(temp);\r\n }\r\n heightMap[0][0] = 5;\r\n heightMap[0][scale] = 5;\r\n heightMap[scale][0] = 5;\r\n heightMap[scale][scale] = 5;\r\n diamond(0, 0, scale, 2.0);\r\n}", "title": "" }, { "docid": "30df0a75ac2d25a4f1b5150b05bdb46f", "score": "0.6057603", "text": "function thestreets() {\n//background of the streets graphic\n background(bg);\n//FILL PERCENTAGE BAR BACKGROUND RECT\n fill(0, 0, 255);\n rect(10, 10, 255, 10);\n//FILL PERCENTAGE BAR WHERE THE LENGTH IS BASED ON THE OPACITY OF FILL\n fill(0, 255, 0);\n//CONSTRAINED TO BE 100% instead of 255 because people dont really use that for percentages\n rect(10, 10, constrain(opacity, 0, 255), 10);\n push();\n//PUSHING SO I CAN SWITCH UP THE STYLES\n//BRINGING IN A TAG STYLE FONT\n textFont(slug);\n textSize (25);\n text(\"fill percentage \", 270 , 22);\n textSize(30);\n\n text(\"score\", 770, 30);\n pop();\n//NEW STANDARD FONT FOR THE NUMBERS FOR LEGIBILITY\n textSize (80);\n\n text(points, 800, 100);\n\n textSize(30);\n//MAP OPACITY (255) to be at a number between 1 and 100 because thats how percentages work\n text(map(opacity, 0, 255, 0, 100), 450, 25);\n\n//HYPE GRAPHICS WHICH APPEAR AFTER EACH NEW GRAFFITI TO KEEP PLAYER MOTIVATED\n if (points === 1) {\n\n push();\n textFont(burner);\n fill(0, 255, 0, 100);\n textSize(150);\n text(\"C R U S H I N G\", 40, 430, );\n pop();\n }\n\n\n if (points === 2) {\n\n push();\n textFont(burner);\n fill(0, 255, 0, 100);\n textSize(150);\n text(\"O M G\", 40, 430, );\n pop();\n }\n else if (points === 3) {\n\n push();\n textFont(burner);\n fill(0, 255, 0, 100);\n textSize(150);\n text(\" IMPOSSIBLE!\", 40, 430, );\n pop();\n }\n\n else if (points === 4) {\n\n push();\n textFont(burner);\n fill(0, 255, 0, 100);\n textSize(150);\n text(\"G O A T\", width/2-250, 430, );\n pop();\n }\n//GRAFFITI SPRAYING ACTION\n if (mouseIsPressed) {\n//increase opacity by 1\n opacity++;\n push();\n tint(255, opacity);\n image(currentImage, mouseX, mouseY);\n pop();\n\n//if opacity is full push the graff onto the wall\n if (opacity === 255) {\n var newGraff = new Graff(mouseX, mouseY, opacity, currentImage);\n graffArray.push(newGraff);\n//add a point of course :)\n points += 1;\n console.log(\"addedgraff\");\n//floor function to round the random number so a number in the array\n var randomIndex = floor(random(0, graffImages.length));\n//randomly selected graffiti from my array\n currentImage = graffImages[randomIndex];\n }\n // Add the prey object to the prey array\n\n } else {\n//graffiti is gone unless you hit 255 opacity\n opacity = 0;\n }\n\n for (var i = 0; i < graffArray.length; i++) {\n//my array display function!!!\n graffArray[i].display();\n }\n\n\n // Default the avatar's velocity to 0 in case no key is pressed this frame\n avatarVX = 0;\n avatarVY = 0;\n\n // Check which keys are down and set the avatar's velocity based on its\n // speed appropriately\n\n // Left and right\n if (keyIsDown(LEFT_ARROW)) {\n avatarVX = -avatarSpeed;\n } else if (keyIsDown(RIGHT_ARROW)) {\n avatarVX = avatarSpeed;\n }\n\n // Up and down (separate if-statements so you can move vertically and\n // horizontally at the same time)\n if (keyIsDown(UP_ARROW)) {\n avatarVY = -avatarSpeed;\n } else if (keyIsDown(DOWN_ARROW)) {\n avatarVY = avatarSpeed;\n }\n\n//this function is saying that if a police officer is on screen trigger this function\n if (currentCarimage === cops) {\n\n//this function makes the cops approach you at an increasing velocity\n policeVelocity();\n//this one makes sure the game still works and that you can still run off screen\n evadeCops();\n// a little aesthetic element which let you know there are cops\n push();\n textFont(burner);\n fill(255, 0, 0, 200);\n textSize(150);\n text(\"C O P S\", 40, 430, );\n fill(0, 0, 255, 200);\n text(\"R U N!\", 500, 430, );\n\n pop();\n//if there are not cops use the below functions\n } else {\n bartOffscreen();\n standardCollision();\n enemySpeed = 5;\n enemyVX = 5;\n enemyVY = 0;\n }\n // Move bart according to velocity but make sure he doesnt leave the ground\n avatarX = avatarX + avatarVX;\n avatarY = constrain(avatarY, 170, 480) + avatarVY;\n\n // The enemy always moves at enemySpeed\n\n // Update the enemy's position based on its velocity but also on the ground\n enemyX = enemyX + enemyVX;\n enemyY = constrain(enemyY, 100, 400) + enemyVY;\n\n\n // Check if the enemy has moved all the way across the screen\n if (enemyX > width) {\n // This means the player dodged so update its dodge statistic\n dodges = dodges + 1;\n // Tell them how many dodges they have made\n console.log(dodges + \" DODGES!\");\n // Reset the enemy's position to the left at a random height\n enemyX = 0;\n enemyY = random(height, height - height / 3);\n//pick a new car if this happens to continue the game\n var randomIndex2 = floor(random(0, carImages.length));\n\n currentCarimage = carImages[randomIndex2];\n }\n\n // Draw the player as bart simpson\n image(bart, avatarX, avatarY);\n\n//draw the enemy as the current image in the array\n image(currentCarimage, enemyX, enemyY);\n//threw in a spray paint can as the mouse\n image(kilz, mouseX, mouseY);\n}", "title": "" }, { "docid": "c28dc75dfc06ded0e27af9c582c2bce9", "score": "0.6034165", "text": "function drawMountains()\n{\n\tfor( var i = 0; i < mountains.length; i++)\n\t\t{\n\t\t\tfill (160, 82, 45);\n\t\t\trect(mountains[i].x_pos - 200 , mountains[i].y_pos - 230, 399, 230, 20, 15, 5, 10);\n\t\t\tfill(139 , 69 , 19 );\n\t\t\trect(mountains[i].x_pos - 200 , mountains[i].y_pos - 230, 80, 228 , 70, 0 ,2, 2);\n\t\t\tfill (0 ,128, 0);\n\t\t\tellipse(mountains[i].x_pos, mountains[i].y_pos - 220, 400, 50);\n\t\t}\n\t\n}", "title": "" }, { "docid": "67701951d78ebc8873e4126ff70e6296", "score": "0.5994942", "text": "function GenerateMapScale() {\n Highcharts.getJSON(FpathMap, function (data) {\n\n //Prevent logarithmic errors in color calulcation\n data.forEach(function (p) {\n p.value = (p.value < 1 ? 1 : p.value);\n });\n \n // Initiate the chart\n var chart = Highcharts.mapChart('container', {\n chart: {\n map: 'custom/world'\n },\n \n title: {\n text: 'LOL PLAYERS'\n },\n \n plotOptions: {\n series: {\n point: {\n events: {\n select: function () {\n var text = '',\n chart = this.series.chart;\n pData = this.name;\n pDataScore = this.value;\n codeCountry = this.name;\n face();\n if (!chart.selectedLabel) {\n chart.selectedLabel = chart.renderer.label(text, 0, 320)\n .add();\n } else {\n chart.selectedLabel.attr({\n text: text\n });\n }\n },\n unselect: function () {\n var text = '',\n chart = this.series.chart;\n if (!chart.unselectedLabel) {\n chart.unselectedLabel = chart.renderer.label(text, 0, 300)\n .add();\n } else {\n chart.unselectedLabel.attr({\n text: text\n });\n }\n }\n }\n }\n }\n },\n \n mapNavigation: {\n enabled: true,\n enableDoubleClickZoomTo: true\n },\n \n colorAxis: {\n min: 1,\n max: 1000,\n type: 'logarithmic'\n },\n \n series: [{\n data: data.filter(function(item){return item.value <= slider.value}),\n joinBy: ['iso-a3', 'code3'],\n name: 'Happiness',\n allowPointSelect: true,\n states: {\n hover: {\n color: '#a4edba'\n },\n select: {\n color: '#EFFFEF',\n borderColor: 'black',\n dashStyle: 'dot'\n }\n },\n tooltip: {\n valueSuffix: ''\n }\n }]\n });\n \n }); \n}", "title": "" }, { "docid": "f588107e4b04e4b097803608203e9cea", "score": "0.5942667", "text": "function draw() {\n //syntax for mapping:\n // map(value, start1, stop1, start2, stop2);\n x = map(mouseX, 0, 1920, 0, 255); \n y = map(mouseY, 0, 1080, 255, 0); \n\n background(x);\n \n drawEllipses (); // calling on the drawEllipses function\n}", "title": "" }, { "docid": "a32e77e97fed2f3c6f05a12cbb84747d", "score": "0.59422183", "text": "function draw(){\n //call the map function with the variables in it\n var cor = CreateRemap(0, canvas.width, 0, 255);\n\n //Used the Map function to find numbers between 0 and 255 in order to used them as the RGB values\n var r = Math.floor(cor(x));\n var g = Math.floor(cor(y));\n var b = Math.floor(cor(x+y/2));\n \n //Line parameters, weight and Color\n ctx.lineWidth=3;\n ctx.strokeStyle=`rgb(${r},${g},${b})`;\n\n //Randomizer and the line parameters for printing on the screen\n if(Math.floor(Math.random()*11) < 5){\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + spc, y + spc);\n ctx.stroke();\n }else{\n ctx.beginPath();\n ctx.moveTo(x, y + spc);\n ctx.lineTo(x + spc, y);\n ctx.stroke();\n }\n\n //re-set the position of the line \n x = x + spc;\n if(x > canvas.width){\n x = 0;\n y = y + spc;\n }\n}", "title": "" }, { "docid": "1131729260686a220f97fc6c37f98cae", "score": "0.5924079", "text": "function drawMap(players,grass, missiles) {\n var Width = c.width;\n var Height = c.height;\n //TODO have spacing be controlled based on the size of the player\n var GridSize = 80;\n\n // get a clean slate\n ctx.clearRect(0, 0, c.width, c.height);\n var i;\n for (i = -(Player.y % GridSize); i < Height; i += GridSize) {\n ctx.beginPath();\n ctx.lineWidth = 1;\n ctx.moveTo(0, i);\n ctx.lineTo(Width, i);\n ctx.stroke();\n ctx.closePath();\n }\n for (i = -(Player.x % GridSize); i < Width; i += GridSize) {\n ctx.beginPath();\n ctx.lineWidth = 1;\n ctx.moveTo(i, 0);\n ctx.lineTo(i, Height);\n ctx.stroke();\n ctx.closePath();\n }\n\n for (var key in players) {\n if (Player.id != key && players[key] != null) {\n //TODO implement enemy ram\n var offsetX = players[key][0] - Player.x;\n var offsetY = players[key][1] - Player.y;\n var radius = getRadius(players[key][2]);\n if (Math.abs(offsetX) < Width/2 + radius && Math.abs(offsetY) < Height/2 + radius) {\n drawCircle(radius, Width/2 + offsetX, Height/2 + offsetY, players[key][3]);\n //TODO Make this a function?\n // rotateAndPaintImage(ctx, img, Player.angle, Width/2 - Player.radius/2, Height/2 - Player.radius/2, Player.radius, Player.radius );\n // ctx.translate(Width/2 + offsetX, Height/2 + offsetY);\n // ctx.rotate(players[key][4] - Math.PI/2);\n // ctx.drawImage(enemyRam,-radius,-Player.radius,2*players[key][3],2*players[key][3]);\n // ctx.rotate(-players[key][4] + Math.PI/2);\n // ctx.translate(-Width/2 - offsetX, -Height/2 - offsetY);\n\n }\n }\n }\n // Render FIRED missiles\n for (var i = 0; i < Game.firedMissiles.length; i++) {\n if (Game.firedMissiles[i] != null) {\n var offsetX = Game.firedMissiles[i].x - Player.x;\n var offsetY = Game.firedMissiles[i].y - Player.y;\n if (Math.abs(offsetX) < Width/2 + MISSILE_SIZE && Math.abs(offsetY) < Height/2 + MISSILE_SIZE) {\n if (Game.firedMissiles[i].playerid != Player.id && Math.abs(offsetX) < Player.radius + MISSILE_SIZE && Math.abs(offsetY) < Player.radius + MISSILE_SIZE) {\n //TODO: Make damage dynamic\n Player.size -= HIT_REDUCTION;\n console.log('HIT');\n Game.firedMissiles[i] = null;\n if(Player.size <= 0) {\n console.log('DEATH');\n processDeath(Game.firedMissiles[i]);\n }\n socket.emit('MissileHit', Game.firedMissiles[i]);\n\n }\n drawCircle(MISSILE_SIZE, Width/2 + offsetX, Height/2 + offsetY, 'red');\n //TODO Make this a function?\n // rotateAndPaintImage(ctx, img, Player.angle, Width/2 - Player.radius/2, Height/2 - Player.radius/2, Player.radius, Player.radius );\n // ctx.translate(Width/2 + offsetX, Height/2 + offsetY);\n // ctx.rotate(players[key][4] - Math.PI/2);\n // ctx.drawImage(enemyRam,-radius,-Player.radius,2*players[key][3],2*players[key][3]);\n // ctx.rotate(-players[key][4] + Math.PI/2);\n // ctx.translate(-Width/2 - offsetX, -Height/2 - offsetY);\n\n }\n }\n }\n //TODO Make this a function?\n // rotateAndPaintImage(ctx, img, Player.angle, Width/2 - Player.radius/2, Height/2 - Player.radius/2, Player.radius, Player.radius );\n ctx.translate(Width/2, Height/2);\n ctx.rotate(Player.angle - Math.PI/2);\n ctx.drawImage(img,-Player.radius,-Player.radius,2*Player.radius,2*Player.radius);\n ctx.rotate(-Player.angle + Math.PI/2);\n ctx.translate(-Width/2, -Height/2);\n // drawCircle(Player.radius, Width/2, Height/2, Player.color);\n\n for (i = 0; i < grass.length; i++) {\n if (grass[i] != null) {\n var offsetX = grass[i].x - Player.x;\n var offsetY = grass[i].y - Player.y;\n if (Math.abs(offsetX) < Width / 2 + GRASS_SIZE && Math.abs(offsetY) < Height / 2 + GRASS_SIZE) {\n if (Math.abs(offsetX) < Player.radius + GRASS_SIZE && Math.abs(offsetY) < Player.radius + GRASS_SIZE) {\n socket.emit('EatRequest', {id: i, x: grass[i].x, y: grass[i].y});\n grass[i] = null;\n }\n else {\n drawCircle(GRASS_SIZE, Width / 2 + offsetX, Height / 2 + offsetY, 'green');\n }\n }\n }\n }\n // when a player gets close enough, pick up the missile\n var j;\n for (j = 0; j < missiles.length; j++) {\n if (missiles[j] != null) {\n var offsetX = missiles[j].x - Player.x;\n var offsetY = missiles[j].y - Player.y;\n if (Math.abs(offsetX) < Width / 2 + MISSILE_SIZE && Math.abs(offsetY) < Height / 2 + MISSILE_SIZE) {\n if (Math.abs(offsetX) < Player.radius + MISSILE_SIZE && Math.abs(offsetY) < Player.radius + MISSILE_SIZE) {\n socket.emit('PickupRequest', {id: j, x: missiles[j].x, y: missiles[j].y});\n missiles[j] = null;\n }\n else {\n drawCircle(MISSILE_SIZE, Width / 2 + offsetX, Height / 2 + offsetY, 'blue');\n }\n }\n }\n }\n}", "title": "" }, { "docid": "4823cfaae077cda8458e3b1d382b73a6", "score": "0.59123427", "text": "function setScales()\r\n{\r\n let x;\r\n let temp;\r\n ymax = -1000.0;\r\n //reset variable scale pointers\r\n ymin = 1000.0;\r\n for (x = xmin; x <= xmax; x += dx)\r\n {\r\n temp = getG(x);\r\n if (temp < ymin)\r\n {\r\n ymin = temp * 1.1;\r\n }\r\n if (temp > ymax)\r\n {\r\n ymax = temp * 1.1;\r\n }\r\n }\r\n xscale = G_WIDTH / (xmax - xmin);\r\n yscale = G_HEIGHT / (ymax - ymin);\r\n dscale = (C_HEIGHT - P_HEIGHT) / dmax;\r\n}", "title": "" }, { "docid": "5222df436a7b51511e9aa87fc99e98ab", "score": "0.59078634", "text": "function lvlOneMap()\n{ \n //app.renderer.backgroundColor = 0x000000;\n \n target = new Target(20,0xFF0000,100,500,500);\n target.x = 525;\n target.y = 475;\n levelOneScene.addChild(target);\n\n player = new Player(20,0x00FF00,100,100,300);\n player.x = 20;\n player.y = 20;\n player.radius = 20;\n //gameScene.addChild(player);\n levelOneScene.addChild(player);\n\n border = new Border(200, 2, 0xFFFFFF, 240, 500);\n borders.push(border);\n levelOneScene.addChild(border);\n\n border = new Border(230, 2, 0xFFFFFF, 40, 200);\n borders.push(border);\n levelOneScene.addChild(border);\n\n border = new Border(2, 200, 0xFFFFFF, 40, 0);\n borders.push(border);\n levelOneScene.addChild(border);\n\n border = new Border(240, 2, 0xFFFFFF, 0, 250);\n borders.push(border);\n levelOneScene.addChild(border);\n\n border = new Border(2, 250, 0xFFFFFF, 240, 250);\n borders.push(border);\n levelOneScene.addChild(border);\n\n border = new Border(2, 250, 0xFFFFFF, 270, 200);\n borders.push(border);\n levelOneScene.addChild(border);\n\n border = new Border(170, 2, 0xFFFFFF, 270, 450);\n borders.push(border);\n levelOneScene.addChild(border);\n\n border = new Border(2, 100, 0xFFFFFF, 440, 352);\n borders.push(border);\n levelOneScene.addChild(border);\n \n border = new Border(2, 100, 0xFFFFFF, 440, 500);\n borders.push(border);\n levelOneScene.addChild(border);\n\n border = new Border(160, 2, 0xFFFFFF, 440, 352);\n borders.push(border);\n levelOneScene.addChild(border);\n\n}", "title": "" }, { "docid": "fe32a9f8302ff238b11f9ff2854f95e9", "score": "0.58936125", "text": "function jail() {\n//background image\n background(bg2);\n//same text as streets\n fill(0, 0, 255);\n rect(10, 10, 255, 10);\n fill(0, 255, 0);\n rect(10, 10, constrain(opacity, 0, 255), 10);\n push();\n textFont(slug);\n textSize (25);\n text(\"fill percentage \", 270 , 22);\n textSize(30);\n\n text(\"score\", 770, 30);\n pop();\n\n textSize (80);\n\n text(points, 800, 100);\n\n textSize(30);\n\n text(map(opacity, 0, 255, 0, 100), 450, 25);\n\n//same graphics as streetz\n if (points === 1) {\n\n push();\n textFont(burner);\n fill(0, 255, 0, 100);\n textSize(150);\n text(\"C R U S H I N G\", 40, 430, );\n pop();\n }\n\n\n if (points === 2) {\n\n push();\n textFont(burner);\n fill(0, 255, 0, 100);\n textSize(150);\n text(\"O M G\", 40, 430, );\n pop();\n }\n else if (points === 3) {\n\n push();\n textFont(burner);\n fill(0, 255, 0, 100);\n textSize(150);\n text(\" IMPOSSIBLE!\", 40, 430, );\n pop();\n }\n\n else if (points === 4) {\n\n push();\n textFont(burner);\n fill(0, 255, 0, 100);\n textSize(150);\n text(\"G O A T\", width/2-250, 430, );\n pop();\n }\n\n\n\n\n\n if (mouseIsPressed) {\n// mousePressed();\n//same fill function as streetz\n opacity++;\n push();\n tint(255, opacity);\n image(currentImage, mouseX, mouseY);\n pop();\n//same new graff function as streetz\n if (opacity === 255) {\n var newGraff = new Graff(mouseX, mouseY, opacity, currentImage);\n graffArray.push(newGraff);\n points += 1;\n console.log(\"addedgraff\");\n var randomIndex = floor(random(0, graffImages.length));\n\n currentImage = graffImages[randomIndex];\n }\n\n } else {\n opacity = 0;\n }\n\n for (var i = 0; i < graffArray.length; i++) {\n graffArray[i].display();\n }\n\n\n // Default the avatar's velocity to 0 in case no key is pressed this frame\n avatarVX = 0;\n avatarVY = 0;\n\n // Check which keys are down and set the avatar's velocity based on its\n // speed appropriately\n\n // Left and right\n if (keyIsDown(LEFT_ARROW)) {\n avatarVX = -avatarSpeed;\n } else if (keyIsDown(RIGHT_ARROW)) {\n avatarVX = avatarSpeed;\n }\n\n // Up and down (separate if-statements so you can move vertically and\n // horizontally at the same time)\n if (keyIsDown(UP_ARROW)) {\n avatarVY = -avatarSpeed;\n } else if (keyIsDown(DOWN_ARROW)) {\n avatarVY = avatarSpeed;\n }\n\n// modifications to my police officer if statement\n if (currentJailimage === guard) {\n\n\n policeVelocity();\n evadeGuards();\n\n push();\n textFont(burner);\n fill(255, 0, 0, 200);\n textSize(150);\n text(\"C O P S\", 40, 430, );\n fill(0, 0, 255, 200);\n text(\"R U N!\", 500, 430, );\n\n pop();\n\n } else {\n bartOffscreen();\n standardJailcollision();\n enemySpeed = 5;\n enemyVX = 5;\n enemyVY = 0;\n }\n // Move the avatar according to its calculated velocity\n avatarX = avatarX + avatarVX;\n avatarY = constrain(avatarY, 170, 480) + avatarVY;\n\n // The enemy always moves at enemySpeed\n\n // Update the enemy's position based on its velocity\n enemyX = enemyX + enemyVX;\n enemyY = constrain(enemyY, 100, 400) + enemyVY;\n\n // Check if the enemy has moved all the way across the screen\n if (enemyX > width) {\n // This means the player dodged so update its dodge statistic\n\n // Tell them how many dodges they have made\n\n // Reset the enemy's position to the left at a random height\n enemyX = 0;\n enemyY = random(height, height - height / 3);\n\n var randomIndex3 = floor(random(0, jailImages.length));\n\n currentJailimage = jailImages[randomIndex3];\n }\n\n // Draw the player as jail bart\n image(bart2, avatarX, avatarY);\n\n // draw prisoners and guards instead of cop cars and sports cars\n image(currentJailimage, enemyX, enemyY);\n image(kilz, mouseX, mouseY);\n}", "title": "" }, { "docid": "2a0c80e9b933f42728b00f42914bb3fb", "score": "0.58907413", "text": "function createMountain(){\r\n mObj = {\r\n \r\n mountainArray: [],\r\n \r\n setup: function(mountainSize, amount, season){\r\n for(var i = 0; i < amount; i++)\r\n {\r\n var sections = (width+1000)/amount;\r\n var xPoint = -100 + i*sections;\r\n this.mountainArray.push({\r\n x: xPoint,\r\n size: random(mountainSize*1.25, mountainSize*2.25),\r\n colour: color(random(50,125)),\r\n snowColour: color(random(210,250))\r\n });\r\n }\r\n },\r\n draw: function()\r\n {\r\n for(var i = 0; i < this.mountainArray.length; i++)\r\n {\r\n \r\n if(season == \"spring\" || season == \"autumn\"){\r\n // Rounded Mountain\r\n fill(this.mountainArray[i].colour);\r\n beginShape();\r\n curveVertex(this.mountainArray[i].x+0 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+0 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+50 * this.mountainArray[i].size, floorPos_y-150 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+100 * this.mountainArray[i].size, floorPos_y-250 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+150 * this.mountainArray[i].size, floorPos_y-280 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+200 * this.mountainArray[i].size, floorPos_y-250 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+250 * this.mountainArray[i].size, floorPos_y-150 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+300 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+300 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n endShape();\r\n\r\n if(season == \"autumn\"){\r\n // Rounded Mountain Snow\r\n fill(this.mountainArray[i].snowColour);\r\n beginShape();\r\n curveVertex(this.mountainArray[i].x+49 * this.mountainArray[i].size, floorPos_y-150 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+49 * this.mountainArray[i].size, floorPos_y-150 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+98 * this.mountainArray[i].size, floorPos_y-251 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+150 * this.mountainArray[i].size, floorPos_y-280 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+202 * this.mountainArray[i].size, floorPos_y-251 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+251 * this.mountainArray[i].size, floorPos_y-150 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+200 * this.mountainArray[i].size, floorPos_y-200 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+150 * this.mountainArray[i].size, floorPos_y-150 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+100 * this.mountainArray[i].size, floorPos_y-180 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+50 * this.mountainArray[i].size, floorPos_y-150 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+50 * this.mountainArray[i].size, floorPos_y-150 * this.mountainArray[i].size);\r\n endShape();\r\n }\r\n\r\n // Rounded Mountain Shadow\r\n fill(0,0,0,50)\r\n beginShape();\r\n curveVertex(this.mountainArray[i].x+200 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+200 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+150 * this.mountainArray[i].size, floorPos_y-100 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+180 * this.mountainArray[i].size, floorPos_y-200 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+130 * this.mountainArray[i].size, floorPos_y-250 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+150 * this.mountainArray[i].size, floorPos_y-280 * this.mountainArray[i].size);\r\n\r\n curveVertex(this.mountainArray[i].x+199 * this.mountainArray[i].size, floorPos_y-255 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+252 * this.mountainArray[i].size, floorPos_y-150 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+300 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n curveVertex(this.mountainArray[i].x+300 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n endShape();\r\n\r\n }\r\n else if(season == \"summer\" || season == \"winter\")\r\n {\r\n // Pointy Mountain.\r\n fill(this.mountainArray[i].colour);\r\n beginShape();\r\n vertex(this.mountainArray[i].x+0 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+150 * this.mountainArray[i].size, floorPos_y-250 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+300 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n endShape();\r\n\r\n if(season == \"winter\"){\r\n // Pointy Mountain Snow.\r\n fill(this.mountainArray[i].snowColour);\r\n beginShape();\r\n vertex(this.mountainArray[i].x+78 * this.mountainArray[i].size, floorPos_y-130 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+150 * this.mountainArray[i].size, floorPos_y-250 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+222 * this.mountainArray[i].size, floorPos_y-130 * this.mountainArray[i].size);\r\n\r\n vertex(this.mountainArray[i].x+190 * this.mountainArray[i].size, floorPos_y-160 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+138 * this.mountainArray[i].size, floorPos_y-135 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+120 * this.mountainArray[i].size, floorPos_y-170 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+78 * this.mountainArray[i].size, floorPos_y-130 * this.mountainArray[i].size);\r\n endShape();\r\n }\r\n\r\n // Pointy Mountain Shadow\r\n fill(0,0,0,50)\r\n beginShape();\r\n vertex(this.mountainArray[i].x+150 * this.mountainArray[i].size, floorPos_y-250 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+126 * this.mountainArray[i].size, floorPos_y-210 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+160 * this.mountainArray[i].size, floorPos_y-170 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+135 * this.mountainArray[i].size, floorPos_y-130 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+170 * this.mountainArray[i].size, floorPos_y-90 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+135 * this.mountainArray[i].size, floorPos_y-50 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+170 * this.mountainArray[i].size, floorPos_y-0 * this.mountainArray[i].size);\r\n vertex(this.mountainArray[i].x+300 * this.mountainArray[i].size, floorPos_y+0 * this.mountainArray[i].size);\r\n endShape();\r\n }\r\n \r\n }\r\n }\r\n }\r\n return mObj;\r\n}", "title": "" }, { "docid": "2e53cef1ee372bf956cfb00117b49a26", "score": "0.5876329", "text": "function L(x,y) {\r\n if (zoomed) {\r\n zoom = zoomXY(x/10.0,y/10.0);\r\n ctx.lineTo(zoom.x,zoom.y);\r\n } else\r\n ctx.lineTo(x/10.0,y/10.0);\r\n}", "title": "" }, { "docid": "b42b40bae3df588a920f5b2ab4043484", "score": "0.58659166", "text": "function renderInternals(x, y, width, height, scale, disableLines){\n d.clearRect(0, 0, width, height);\n d.fillStyle = ba ? \"#111111\" : \"#F2FBFF\";\n d.fillRect(0, 0, width, height);\n //Lines\n if(!disableLines)\n renderLines(x, y, scale, width / scale, height / scale);\n renderPlayers(x, y, width, height, scale);\n z && 0 != w.length && d.drawImage(z, k - z.width - 10, 10);\n }", "title": "" }, { "docid": "be48b62f99df2e04a47d1fcc0d3121d6", "score": "0.58622044", "text": "function drawGrid() \n{\n \n// var rMap;\n// var mMap;\n// var cMap;\n// var coMap;\n\n if (showRollingMap) {\n rMap = rollingAlgorithm(w, h, rollingLife, rollingParticles);\n drawGrayMap('rolling', rMap, w, h, pixelSize); \n }\n\n if (showMiniMap) {\n mMap = createMiniMap(w,h);\n drawGrayMap('minimap', mMap, w, h, pixelSize);\n }\n \n if (showCombinedMap) {\n cMap = createCombinedMap(w,h, rMap, mMap);\n drawGrayMap('combined', cMap, w, h, pixelSize);\n }\n \n if (showColorMap) {\n drawColorMap('color', cMap, w, h, pixelSize);\n }\n\n if (showExploreMap)\n drawExploreMap();\n}", "title": "" }, { "docid": "8c434584c5d91694601ca0f9f9cc26a6", "score": "0.58488184", "text": "function drawMountains()\n{\n for(var i = 0; i< mountains1_x.length; i++) \n {\n \n stroke(218,165,32);\n fill(255,204,0);\n triangle(mountains1_x[i] +625, mountain.y_pos +200, \n mountains1_x[i] +765, mountain.y_pos +430, \n mountains1_x[i] +480, mountain.y_pos +430);\n fill(255,140,0);\n triangle(mountains1_x[i] +625, mountain.y_pos +200, \n mountains1_x[i] +716, mountain.y_pos +350, \n mountains1_x[i] +532, mountain.y_pos +350);\n \n fill(255,215,0);\n triangle(mountains2_x[i] +700, mountain.y_pos +250, \n mountains2_x[i] +800, mountain.y_pos +430, \n mountains2_x[i] +590, mountain.y_pos +430);\n fill(255,165,0);\n triangle(mountains2_x[i] +700, mountain.y_pos +250, \n mountains2_x[i] +772, mountain.y_pos +380, \n mountains2_x[i] +620, mountain.y_pos +380);\n \n fill(255,223,0);\n triangle(mountains3_x[i] +620, mountain.y_pos +310, \n mountains3_x[i] +690, mountain.y_pos +430, \n mountains3_x[i] +545, mountain.y_pos +430);\n fill(255, 191, 0)\n triangle(mountains3_x[i] +620, mountain.y_pos +310, \n mountains3_x[i] +677, mountain.y_pos +410, \n mountains3_x[i] +559, mountain.y_pos +410);\n \n //snow on the mountains\n //biggest mountain\n noStroke();\n fill(255, 255, 255);\n triangle(mountains1_x[i] +625, mountain.y_pos +200, \n mountains1_x[i] +668, mountain.y_pos +270, \n mountains1_x[i] +581, mountain.y_pos +270);\n \n fill(255,140,0);\n triangle(mountains1_x[i] +605, mountain.y_pos +250, \n mountains1_x[i] +620, mountain.y_pos +270, \n mountains1_x[i] +581, mountain.y_pos +270);\n triangle(mountains1_x[i] +630, mountain.y_pos +250, \n mountains1_x[i] +650, mountain.y_pos +270, \n mountains1_x[i] +601, mountain.y_pos +270);\n triangle(mountains1_x[i] +618, mountain.y_pos +250, \n mountains1_x[i] +650, mountain.y_pos +270, \n mountains1_x[i] +601, mountain.y_pos +270);\n triangle(mountains1_x[i] +645, mountain.y_pos +250, \n mountains1_x[i] +668, mountain.y_pos +270, \n mountains1_x[i] +610, mountain.y_pos +270);\n rect(mountains1_x[i] +584, mountain.y_pos +267, 80, 15)\n \n //medium mountain\n fill(255, 255, 255);\n triangle(mountains2_x[i] +700, mountain.y_pos +250, \n mountains2_x[i] +733, mountain.y_pos +310,\n mountains2_x[i] +663, mountain.y_pos +310);\n fill(255,165,0);\n triangle(mountains2_x[i] +675, mountain.y_pos +300, \n mountains2_x[i] +690, mountain.y_pos +320, \n mountains2_x[i] +655, mountain.y_pos +324);\n triangle(mountains2_x[i] +700, mountain.y_pos +300, \n mountains2_x[i] +720, mountain.y_pos +320, \n mountains2_x[i] +671, mountain.y_pos +320);\n triangle(mountains2_x[i] +688, mountain.y_pos +300,\n mountains2_x[i] +720, mountain.y_pos +320, \n mountains2_x[i] +671, mountain.y_pos +320);\n triangle(mountains2_x[i] +715, mountain.y_pos +300, \n mountains2_x[i] +738, mountain.y_pos +320, \n mountains2_x[i] +680, mountain.y_pos +321);\n \n //smallest mountain\n fill(255, 255, 255);\n triangle(mountains3_x[i] +620, mountain.y_pos +310, \n mountains3_x[i] +641, mountain.y_pos +349,\n mountains3_x[i] +596, mountain.y_pos +349);\n fill(255, 191, 0);\n triangle(mountains3_x[i] +605, mountain.y_pos +340, \n mountains3_x[i] +615, mountain.y_pos +360,\n mountains3_x[i] +590, mountain.y_pos +364);\n triangle(mountains3_x[i] +625, mountain.y_pos +340, \n mountains3_x[i] +645, mountain.y_pos +360, \n mountains3_x[i] +596, mountain.y_pos +360);\n triangle(mountains3_x[i] +613, mountain.y_pos +340, \n mountains3_x[i] +645, mountain.y_pos +360, \n mountains3_x[i] +596, mountain.y_pos +360);\n triangle(mountains3_x[i] +634, mountain.y_pos +340, \n mountains3_x[i] +645, mountain.y_pos +360, \n mountains3_x[i] +600, mountain.y_pos +361);\n } \n}", "title": "" }, { "docid": "1a6cd86869a9fb7eef6d045afde736d3", "score": "0.5846226", "text": "function curves(){\n let x1, x2, y1, y2;\n x1 = map(x[0],0,.7,g.lx,g.rx);\n x2 = map(x[1],0,.7,g.lx,g.rx);\n y1 = map(y[0],0,64,g.by,g.ty);\n y2 = map(y[1],0,64,g.by,g.ty);\n\n let m = (y2 - y1)/(x2 - x1);\n let b = y1 - m*x1;\n let yL, xR;\n\n yL = m*g.lx + b;\n xR = (g.ty - b)/m;\n\n push(); strokeWeight(2); stroke(g.pink);\n line(g.lx,yL,xR,g.ty);\n pop();\n\n x1 = map(0,0,.7,g.lx,g.rx);\n x2 = map(.7,0,.7,g.lx,g.rx);\n y1 = map(0,0,64,g.by,g.ty);\n y2 = map(59,0,64,g.by,g.ty);\n m1 = (y2 - y1)/(x2 - x1);\n b1 = y1 - m*x1;\n // let xL = (g.by-b1)/m1;\n // let yR = m1*g.rx + b1;\n\n push(); strokeWeight(2); stroke(g.orange); \n line(x1,y1,x2,y2);\n pop();\n\n \n for(let i = 1; i < 6; i++){\n x1 = map(x[i],0,.7,g.lx,g.rx);\n y1 = map(y[i-1],0,64,g.by,g.ty);\n y2 = map(y[i],0,64,g.by,g.ty);\n x2 = map(x[i-1],0,.7,g.lx,g.rx);\n if(i == 4){\n x1 = x1 - 1;\n y1 = y1 - 1;\n } else if(i == 5){\n x1 = x1 + 1; \n y1 = y1 + 1;\n } else if(i == 3){\n x1 = x1 + 1;\n y1 = y1 + 1;\n }\n push();\n strokeWeight(2);\n line(x1,y1,x1,y2);\n line(x2,y1,x1,y1);\n pop();\n }\n for(let i = 0; i < 6; i++){\n if(i == 0){\n x1 = map(0.05,0,.7,g.lx,g.rx);\n y1 = map(10,0,64,g.by,g.ty);\n push(); fill(g.blue); noStroke();\n ellipse(x1,g.by,9);\n fill(g.green);\n ellipse(x1,y1,9);\n pop();\n } else {\n x1 = map(x[i],0,.7,g.lx,g.rx);\n y1 = map(y[i-1],0,64,g.by,g.ty);\n y2 = map(y[i],0,64,g.by,g.ty);\n x2 = map(x[i-1],0,.7,g.lx,g.rx);\n if(i == 4){\n x1 = x1 - 1;\n y1 = y1 - 1;\n } else if (i == 5){\n x1 = x1 + 1;\n y1 = y1 + 1;\n } else if(i == 3){\n x1 = x1 + 1;\n y1 = y1 + 1;\n }\n \n push();\n fill(g.blue); noStroke();\n ellipse(x1,y1,9);\n pop();\n push();\n fill(g.green); noStroke(); \n ellipse(x1,y2,9);\n pop();\n \n }\n }\n\n push();\n strokeWeight(2); stroke(g.green); drawingContext.setLineDash([5,5]);\n line(g.lx,y2,g.lx+51,y2);\n line(g.lx+75,y2,g.rx,y2);\n pop();\n \n }", "title": "" }, { "docid": "ab33018291bead0861badc67e256bd72", "score": "0.58444756", "text": "function init()\n\t{\n\t/////////////////////\n\t///STATE VARIABLES\n\t/// All your variables get their start values here.\n\tmap.x = 0;\n\tmap.y = 4; \n\tmap.scale = .79\n\t\n\tcar1.x = 5\n\tcar1.y = 17\n\tcar1.scale = .1\n\t\n\tcar2.x = 70\n\tcar2.y = 300\n\tcar2.scale = .2\n\t\n\tcar3.x = 573\n\tcar3.y = 400\n\tcar3.scale = .1\n\t\n\tcar4.x = 600\n\tcar4.y = 370\n\tcar4.scale = .17\n\t\n\tchicken.x = \n\tchicken.y \n\tchicken.scale = .3\n\tchicken.speedx = 5\n\t\n\tgrass.x = 129\n\tgrass.y = 63\n\tgrass.scale = .79\n\t\n\tgrass2.x = -348 \n\tgrass2.y = 411\n\tgrass2.scale = .79\n\t\n\tgrass3.x = -348 \n\tgrass3.y = -278\n\tgrass3.scale = .79\n\t\n\tgrass4.x = -348 \n\tgrass4.x = -348 \n\tgrass4.y = 63\n\tgrass4.scale = .79\n\t\n\tgrass5.x = 129 \n\tgrass5.y = 600\n\tgrass5.scale = .79\n\t\n\tgrass6.x = 129\n\tgrass6.y = 410\n\tgrass6.scale = .79\n\t\n\tgrass7.y = -278\n\tgrass7.x = 129\n\tgrass7.scale = .79\n\t\n\tgrass8.y = -278\n\tgrass8.x = 620\n\tgrass8.scale = .79\n\t\n\t\t\n\tgrass9.x = 620\n\tgrass9.y = 60\n\tgrass9.scale = .79\n\t\n\tgrass10.x = 620\n\tgrass10.y = 410\n\tgrass10.scale = .79\n\t\n\t\n\t\n\twin.y = 1\n\twin.x = \n\twin.scale = 1.5\n\t\n\t\n\t\n\tdeath.x = 200 \n\tdeath.y = 100 \n\tdeath.scale = 1\n\t\n\t\n//////////////////////\n\t///GAME ENGINE START\n\t//\tThis starts your game/program\n\t//\t\"paint is the piece of code that runs over and over again, so put all the stuff you want to draw in here\n\t//\t\"60\" sets how fast things should go\n\t//\tOnce you choose a good speed for your program, you will never need to update this file ever again.\n\n\tif(typeof game_loop != \"undefined\") clearInterval(game_loop);\n\t\tgame_loop = setInterval(paint, 60);\n\t}", "title": "" }, { "docid": "7e3c9fb5bbce137f81ab1e693add0f34", "score": "0.5836307", "text": "function GUIScale() {\n\n var value = options.scaleValue;\n\n for (var i = 0; i < Vertices.length; i++) {\n Vertices[i] = scale(Vertices[i].x, Vertices[i].y, Vertices[i].z, value, value, value);\n }\n\n draw();\n}", "title": "" }, { "docid": "5d62c0372912532177590dca1a6d02c1", "score": "0.5831899", "text": "function standardDisplay(){\n for (var j = 0; j < standardMapObjects.numChildren; j++) {\n \n var currentObject = standardMapObjects.getChildAt(j);\n var currentTiming = currentObject.timing;\n \n var tempBackCircle =currentObject.getChildAt(0);//Background Circle\n var tempApprCircle = currentObject.getChildAt(1);//Approach Circle\n var tempLetter = currentObject.getChildAt(2); //Letter\n \n //Before hit\n if(ticks >= ((currentTiming-secToHit)*60) &&\n ticks <= (currentTiming*60)){\n currentObject.visible = true; //Letter\n\t\t\t \n tempApprCircle.alpha = 0.5;\n //code to change colors\n\t\t\tif(color == true && colorIt >= 10){\n\t\t\t\ttempBackCircle.filters = [colors[0]];\n\t\t\t\ttempBackCircle.updateCache();\n\t\t\t\ttempApprCircle.filters = [colors[0]];\n\t\t\t\ttempApprCircle.updateCache();\n\t\t\t\tcolors.push(colors.shift());\n\t\t\t\tcolorIt = 0;\n\t\t\t}\n\t\t\telse if(color == false){\n\t\t\t\ttempBackCircle.filters = [new createjs.ColorFilter(0,0,0,1,255,94,94, 0)];\n\t\t\t\ttempApprCircle.filters = [new createjs.ColorFilter(0,0,0,1,255,0,0, 0)];\n\t\t\t\ttempBackCircle.updateCache();\n\t\t\t\ttempApprCircle.updateCache();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcolorIt++;\n\t\t\t}\n //makes circle approach to enclose back circle\n tempApprCircle.scaleX -= circleScale;\n tempApprCircle.scaleY -= circleScale;\n\n //fades in the letter for aesthetics\n tempLetter.alpha += .0075;\n\t\t\t\n\t\t}\n\t\t//making object not visible at end of its display time\n else if(ticks >= (currentTiming) * 60 &&\n ticks <= (currentTiming + secToLateHit) * 60 - 0){\n standardMapObjects.getChildAt(j).visible = false;\n }\n //Miss, the object has reached its maximum hit time\n else if (ticks >= (currentTiming + secToLateHit) * 60 - 0){\n score.updateMaxScore();\n score.maxMultiplier += multiplierValue;\n currentMultiplier = 1;\n score.updateScore();\n\t\t\tselectedMap.currentLetterIndex += 1;\n standardMapObjects.removeChildAt(j);\n \n // letterHit(300, 0); //used to enable cheat mode for 100% by commenting the other code in this else\n }\n }\n}", "title": "" }, { "docid": "684b99c1070561cdb03ab0c6d5d07920", "score": "0.5818899", "text": "function draw() {\n background(bg.r, bg.g, bg.b);\n\n\n //Jar\n strokeWeight(3);\n stroke(0, 30);\n fill(jar.fill, jar.alpha);\n rect(jar.x, jar.y, jar.w, jar.h, jar.tlr, jar.trr, jar.brr, jar.blr);\n\n //Lid\n stroke(0, 10);\n fill(lid.r, lid.g, lid.b);\n rect(lid.x, lid.y, lid.w, lid.h, lid.r);\n rect(lid.x, lid.y - 10, lid.w, lid.h, lid.r);\n rect(lid.x, lid.y - 20, lid.w, lid.h, lid.r);\n noStroke();\n\n //Moth1\n moth1.x = moth1.x + 1\n moth1.y = moth1.y + 1\n fill(moth1.fill, moth1.alpha);\n moth1.size = random(5, 30);\n moth1.x = constrain(moth1.x, 190, 290);\n moth1.y = constrain(moth1.y, 190, 350);\n ellipse(moth1.x, moth1.y, moth1.size);\n\n //Moth2\n moth2.x = moth2.x - 1\n moth2.y = moth2.y - 1\n fill(moth2.fill, moth2.alpha);\n moth2.size = random(5, 20);\n moth2.x = constrain(moth2.x, 195, 320);\n moth2.y = constrain(moth2.y, 220, 400);\n square(moth2.x, moth2.y, moth2.size, 3);\n\n //Fairy\n fairycolours.r = random(100, 255);\n fairycolours.g = random(50, 170);\n fairycolours.b = random(200, 255);\n fill(fairycolours.r, fairycolours.g, fairycolours.b);\n fairy.size = map(mouseY, height, 0, 30, 120); //Size change\n fairy.x = constrain(mouseX, 0 + 50, width - 50);\n fairy.y = constrain(mouseY, 0 + 50, height - 15);\n ellipse(fairy.x, fairy.y, fairy.size);\n\n\n\n\n\n}", "title": "" }, { "docid": "93120dd5773035b5e2664eba9909665e", "score": "0.5818881", "text": "function drawGrid(){\n\tvar sc = screen.canvas;\n\tsc.beginPath();\n\tfor(var j = 0; j < screen.tileHeight; j++){\n\t\tsc.moveTo(0, j * tile.zoomSize + tile.align);\n\t\tsc.lineTo(screen.element.width, j * tile.zoomSize + tile.align); // draw horizontal lines\n\t\tfor(var i = 0; i < screen.tileWidth; i++){\n\t\t\t// The algorithm for a tile based map is in the nested for loop. i or j * tile.size * screen.zoom + x or y alignment\n\t\t\t// This algorithm supports zoom.\n\t\t\tsc.moveTo(i * tile.zoomSize + tile.align, 0);\n\t\t\tsc.lineTo(i * tile.zoomSize + tile.align, screen.element.height); // draw vertical lines\n\t\t}\n\t}\n\tsc.strokeStyle = \"red\";\n\tsc.lineWidth = 1;\n\tsc.stroke();\n}", "title": "" }, { "docid": "e9c7d742732f68db4b7eb0056ccf31d0", "score": "0.5812094", "text": "function draw() {\n\n // start off with a background\n background(250, 250, 250)\n\n fill(250, 250, 250)\n line(1, 101, 428, 228)\n line(628, 284, 1350, 500)\n\n //bridge\n line(628, 284, 530, 340)\n line(530, 340, 421, 479)\n line(500, 249, 501, 185)\n line(500, 249, 424, 304)\n line(424, 304, 305, 442)\n line(305, 442, 1, 345)\n line(501, 185, 423, 232)\n line(423, 232, 423, 305)\n line(423, 232, 307, 356)\n line(307, 356, 307, 441)\n line(344, 318, 344, 398)\n line(371, 289, 371, 366)\n line(398, 261, 398, 333)\n line(448, 218, 448, 286)\n line(476, 200, 476, 266)\n line(307, 379, 423, 250)\n line(307, 409, 423, 278)\n line(423, 250, 500, 202)\n line(423, 278, 500, 229)\n line(425, 304, 531, 339)\n line(500, 249, 628, 284)\n line(435, 482, 531, 361)\n line(531, 361, 531, 340)\n line(531, 361, 651, 292)\n line(629, 285, 629, 305)\n line(502, 186, 541, 199)\n line(501, 248, 624, 210)\n line(541, 199, 541, 234)\n line(501, 203, 540, 215)\n line(501, 229, 533, 238)\n line(522, 194, 522, 241)\n\n //path\n line(624, 210, 920, 10)\n line(625, 285, 742, 232)\n line(742, 232, 1050, 10)\n\n //pre-path foilage\n line(629, 517, 629, 545)\n line(629, 517, 635, 509)\n line(629, 521, 632, 521)\n line(656, 553, 704, 548)\n line(704, 548, 705, 555)\n line(696, 550, 697, 554)\n line(645, 550, 661, 495)\n line(661, 495, 666, 501)\n line(564, 529, 564, 520)\n line(554, 529, 554, 513)\n line(540, 537, 540, 520)\n line(561, 553, 561, 541)\n line(527, 522, 527, 506)\n line(532, 544, 532, 534)\n line(515, 536, 515, 521)\n line(520, 524, 520, 511)\n line(500, 510, 500, 498)\n line(490, 506, 490, 496)\n line(468, 506, 468, 491)\n line(11, 369, 11, 311)\n line(11, 311, 21, 317)\n line(11, 319, 16, 328)\n line(31, 381, 31, 340)\n line(31, 340, 40, 329)\n line(31, 346, 40, 346)\n line(31, 360, 24, 360)\n line(70, 433, 70, 402)\n line(70, 402, 73, 380)\n line(70, 410, 77, 398)\n\n //bridge hole\n fill(10)\n rect(390, 410, 10, 30)\n\n fill(10)\n rect(455, 350, 10, 30)\n\n//?\n line(421, 479, 960, 650)\n\n//trees\nfill(65, 35, 35)\nrect(998, 1, 25, 289)\nrect(1252, 1, 15, 270)\nrect(1195, 1, 12, 180)\nrect(1148, 1, 12, 190)\nrect(1098, 1, 14, 120)\nrect(1057, 1, 13, 100)\nrect(626, 1, 13, 140)\nrect(770, 1, 12, 75)\nrect(82, 1, 11, 125)\nrect(187, 1, 10, 160)\n\n//grass\nfill('rgba(0,255,0,0.25)')\ntriangle(793, 352, 926, 374, 869, 282)\ntriangle(806, 335, 684, 330, 760, 288)\ntriangle(870, 353, 1054, 271, 1106, 425)\ntriangle(1066, 414, 1194, 418, 1104, 345)\ntriangle(1106, 467, 1286, 470, 1158, 371)\ntriangle(656, 301, 658, 252, 713, 307)\ntriangle(680, 286, 781, 297, 735, 235)\ntriangle(180, 460, 55, 320, 34, 466)\ntriangle(896, 370, 1039, 401, 978, 433)\ntriangle(1012, 416, 1124, 420, 1068, 510)\ntriangle(1218, 459, 1288, 373, 1287, 546)\ntriangle(391, 537, 544, 501, 554, 559)\ntriangle(469, 195, 260, 178, 391, 248)\ntriangle(291, 196, 189, 209, 122, 136)\ntriangle(317, 172, 269, 118, 191, 159)\ntriangle(3, 111, 114, 106, 112, 187)\ntriangle(544, 227, 639, 198, 584, 186)\ntriangle(711, 142, 709, 101, 637, 198)\ntriangle(807, 287, 1005, 285, 903, 174)\ntriangle(735, 250, 818, 176, 650, 271)\ntriangle(95, 126, 187, 159, 186, 91)\ntriangle(2, 110, 145, 104, 72, 56)\ntriangle(1123, 300, 1279, 325, 1212, 200)\ntriangle(1062, 204, 1185, 210, 1086, 117)\ntriangle(1167, 187, 1248, 193, 1214, 140)\ntriangle(1024, 130, 1146, 156, 1105, 99)\ntriangle(869, 150, 956, 50, 994, 110)\ntriangle(723, 90, 788, 89, 758, 44)\ntriangle(601, 154, 682, 146, 650, 104)\ntriangle(197, 136, 245, 130, 232, 88)\ntriangle(515, 178, 635, 190, 549, 149)\ntriangle(1139, 135, 1246, 138, 1182, 70)\ntriangle(1025, 78, 1171, 87, 1086, 44)\ntriangle(1024, 279, 1151, 284, 1035, 209)\ntriangle(385, 154, 501, 154, 413, 104)\ntriangle(332,176,437,177,391,136)\ntriangle(448,186,510,180,515,114)\ntriangle(518,139,611,135,556,81)\ntriangle(298, 135, 395, 134, 339, 74)\ntriangle(346, 149, 218, 119, 271, 55)\ntriangle(378, 107, 625, 109, 488, 48)\ntriangle(810, 81, 936, 7, 837, 6)\ntriangle(199, 100, 430, 71, 343, 20)\n\n\n\n\n\n\n\n\n\n}", "title": "" }, { "docid": "d409f32474c58c8d94978316d3d6f0fe", "score": "0.5794163", "text": "function draw() {\nbackground(\"#ffffff\")\nif (a == 550 && x <= 400 || a == 550 && x >= 500) {\ncolorFill = \"#ffffff\"\nellipse(x, 550, 20, 20)\n}else if (b == 550 && x <= 100 || b == 550 && x >= 200) {\ncolorFill = \"#ffffff\"\nellipse(x, 550, 20, 20)\n}else if (c == 550 && x <= 700 || c == 550 && x >= 800) {\ncolorFill = \"#ffffff\"\nellipse(x, 550, 20, 20)\n}else if (d == 550 && x <= 300 || d == 550 && x >= 400) {\ncolorFill = \"#ffffff\"\nellipse(x, 550, 20, 20)\n}else if (e == 550 && x <= 600 || e == 550 && x >= 700) {\ncolorFill = \"#ffffff\"\nellipse(x, 550, 20, 20)\n}else if (f == 550 && x <= 0 || f == 550 && x >= 100) {\ncolorFill = \"#ffffff\"\nellipse(x, 550, 20, 20)\n}else if (a == 550 && x >= 400 || a == 550 && x <= 500) {\npoints++\n}else if (b == 550 && x >= 100 || b == 550 && x <= 200) {\npoints++\n}else if (c == 550 && x >= 700 || c == 550 && x <= 800) {\npoints++\n}else if (d == 550 && x >= 300 || d == 550 && x <= 400) {\npoints++\n}else if (e == 550 && x >= 600 || e == 550 && x <= 700) {\npoints++\n}else if (f == 550 && x >= 0 || f == 550 && x <= 100) {\npoints++\n}\nfill(colorFill)\nstroke(colorFill)\nellipse(x, 550, 20, 20)\nstroke(\"#000000\")\nline(100, 0, 100, 800)\nline(200, 0, 200, 800)\nline(300, 0, 300, 800)\nline(400, 0, 400, 800)\nline(500, 0, 500, 800)\nline(600, 0, 600, 800)\nline(700, 0, 700, 800)\nfill(\"#ff0000\")\nrect(0, a += 10, 100, 50)\nrect(100, a, 100, 50)\nrect(200, a, 100, 50)\nrect(300, a, 100, 50)\nrect(500, a, 100, 50)\nrect(600, a, 100, 50)\nrect(700, a, 100, 50)\nrect(0, b += 10, 100, 50)\nrect(200, b, 100, 50)\nrect(300, b, 100, 50)\nrect(400, b, 100, 50)\nrect(500, b, 100, 50)\nrect(600, b, 100, 50)\nrect(700, b, 100, 50)\nrect(0, c += 10, 100, 50)\nrect(100, c, 100, 50)\nrect(200, c, 100, 50)\nrect(300, c, 100, 50)\nrect(400, c, 100, 50)\nrect(500, c, 100, 50)\nrect(600, c, 100, 50)\nrect(0, d += 10, 100, 50)\nrect(100, d, 100, 50)\nrect(200, d, 100, 50)\nrect(400, d, 100, 50)\nrect(500, d, 100, 50)\nrect(600, d, 100, 50)\nrect(700, d, 100, 50)\nrect(0, e += 10, 100, 50)\nrect(100, e, 100, 50)\nrect(200, e, 100, 50)\nrect(300, e, 100, 50)\nrect(400, e, 100, 50)\nrect(500, e, 100, 50)\nrect(700, e, 100, 50)\nrect(100, f += 10, 100, 50)\nrect(200, f, 100, 50)\nrect(300, f, 100, 50)\nrect(400, f, 100, 50)\nrect(500, f, 100, 50)\nrect(600, f, 100, 50)\nrect(700, f, 100, 50)\ndocument.getElementById(\"score\").innerHTML = \"Points: \" + points\n}", "title": "" }, { "docid": "0dac99407df5cfd63dcca1f67b82f601", "score": "0.57793754", "text": "function zoomed()\n {\n pathG.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n //grids.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n //geofeatures.select(\"path.graticule\").style(\"stroke-width\", 0.5 / d3.event.scale);\n pathG.selectAll(\"path.boundary\").style(\"stroke-width\", 0.5 / d3.event.scale);\n }", "title": "" }, { "docid": "d028bf140e4972403c17c90180b2be5a", "score": "0.5762628", "text": "function zoomed() {\n features.attr(\"transform\", \"translate(\" + zoom.translate() + \")scale(\" + zoom.scale() + \")\")\n .selectAll(\"path\").style(\"stroke-width\", 1 / zoom.scale() + \"px\" );\n}", "title": "" }, { "docid": "70741c71036b61e8a26438d48472a0f7", "score": "0.5761718", "text": "function drawScale(c) {\n var ctx = c.getContext(\"2d\");\n var points = 10;\n var total = zoomRight - zoomLeft;\n ctx.font = \"15px Georgia\";\n\n for (var x=1; x < points; x++) {\n ctx.beginPath();\n var xPos = x / points * c.width;\n ctx.moveTo(xPos, c.height);\n ctx.lineTo(xPos, c.height - 20);\n ctx.stroke();\n\n var text = \"\"+ Math.round(zoomLeft + x / points * total);\n ctx.fillStyle = 'black';\n ctx.fillText(\"\"+ text, xPos - text.length * 4, c.height - 27);\n }\n\n}", "title": "" }, { "docid": "940cfa53440916679ebe2439e665858d", "score": "0.57608825", "text": "function drawDottedLines() {\n\tnewton_rings_stage.removeChild(line_top);\n\tnewton_rings_stage.removeChild(line_bottom);\n\tline_top = new createjs.Shape();\n\tline_top.graphics.moveTo(0,0).setStrokeStyle(1).beginStroke(\"#000000\").lineTo(0,0);\n\tline_top.graphics.dashedLineTo(210,50,microscope_container.x+microscope_container.getChildByName(\"eyepiece_lense\").x+20,microscope_container.getChildByName(\"eyepiece_lense\").y+10,10);\n\tnewton_rings_stage.addChild(line_top);\n\tline_bottom = new createjs.Shape();\n\tline_bottom.graphics.moveTo(0,0).setStrokeStyle(1).beginStroke(\"#000000\").lineTo(0,0);\n\tline_bottom.graphics.dashedLineTo(210,200,microscope_container.x+microscope_container.getChildByName(\"eyepiece_lense\").x+15,microscope_container.getChildByName(\"eyepiece_lense\").y+15,10);\n\tnewton_rings_stage.addChild(line_bottom);\n\tupdateStage(); \n}", "title": "" }, { "docid": "aeb5f086e11c9acf80654477d41d30ef", "score": "0.57595706", "text": "function render(scale=1) {\nfunction visor(fill) { // Visor!\nc.beginPath(); // a new starter point, ...for redrawing too, yeah\nc.arc( // so uh, a roundy curve,..\n (50)*scale, (50)*scale, // at 50;50,..\n (20)*scale, // with a small radius\n 3*Math.PI/2, Math.PI/2, true // what is this? supposed to draw from top to down, by the left side\n); // ...and that was the back of the head\n//c.lineTo(50+30, 50+20); -- obsolete, too sharp at start\n//c.arcTo(50+60, 50+20, 50, 50-20, 10); c.lineTo(50, 50-20); -- obsolete, too sharp at end\nc.bezierCurveTo( // here goes mess, don't read further it's too weird... (also i don't really know what a bezier curve is)\n (50+80)*scale, (50+20+5)*scale, // control point one: x+offset (way far to the right for the muzzle); y+radius+offset (a liiitle bit lower than needed),\n (50+20)*scale, (50-20)*scale, // control point two: x+offset (somewhere between arc center and cp1); y-offset (above center),\n (50)*scale, (50-20)*scale // finish this all where it all started: x of center; y of center and [radius] pixels above... nevermind, just where the arc was started\n); // kinda fine, already too bored to change, or maybe it's just a bit difficult\nif (fill) c.fill(); else c.stroke(); // to select the drawing style\n}\nfunction headband(fill) { // idk how it's called\n let points = { // to copy the lines with offset... uh, to \"dupe\" the line correctly... ahh, just some data\n x1: (50+5)*scale, y1: (50-20+1)*scale, // start\n cpx: (50-10)*scale, cpy: (50-6)*scale, // quad line\n x: (50-10)*scale, y: (50+18)*scale, // ..same quad line\n offx: (-5)*scale, offy: (-1)*scale,\n radius: (20)*scale // just why ?\n };\n c.beginPath();\n c.moveTo(points[\"x1\"], points[\"y1\"]);\n c.quadraticCurveTo( // uhh..? this should work, i guess... um?\n points[\"cpx\"], points[\"cpy\"],\n points[\"x\"], points[\"y\"],\n (20)*scale // nah, not points[\"radius\"]\n );\n c.lineTo(points[\"x\"]+points[\"offx\"], points[\"y\"]+points[\"offy\"]);\n c.quadraticCurveTo(\n points[\"cpx\"]+points[\"offx\"], points[\"cpy\"]+points[\"offy\"],\n points[\"x1\"]+points[\"offx\"], points[\"y1\"]+points[\"offy\"],\n (20)*scale\n ); // (yes!! it works!)\n c.closePath(); // easier than c.lineTo(points[\"x1\"], points[\"y1\"]); hehe\n if (fill) c.fill(); else c.stroke();\n}\nfunction ear(x,y,fill) {\n let points = { // now there are offsets only, fyi.. uh?\n cp1x: -25-2.5, cp1y: -25-5,\n cp2x: -50-7.5, cp2y: -5-5+2.5,\n x: -15, y: 35\n };\n c.beginPath();\n c.moveTo((x-2.5+2)*scale, (y+2.5+2)*scale);\n c.bezierCurveTo(\n (x+points[\"cp1x\"])*scale, (y+points[\"cp1y\"])*scale,\n (x+points[\"cp2x\"])*scale, (y+points[\"cp2y\"])*scale,\n (x+points[\"x\"])*scale, (y+points[\"y\"])*scale\n );\n if (fill) c.fill(); else c.stroke();\n}\nfunction cheekplate(fill) { // *cheekplates*, hilarious... thb i don't know how are these called\n let points = {\n x: (50-7.5)*scale, y: (50+10)*scale, // don't forget to copy to cheekcircle()!\n radius: (7.5)*scale,\n offx: (-30+2.5)*scale, stretch: (7.5)*scale // for the bezier curve instead of a quad curve\n };\n c.beginPath();\n c.arc(points[\"x\"], points[\"y\"], points[\"radius\"], Math.PI/2, 3*Math.PI/2, true); // why 'true' though?..\n /*c.quadraticCurveTo(\n points[\"x\"]-40, points[\"y\"],\n points[\"x\"], points[\"y\"]+points[\"radius\"]\n ); -- obsolete, too sharp*/\n c.bezierCurveTo(\n points[\"x\"]+points[\"offx\"], points[\"y\"]-points[\"stretch\"],\n points[\"x\"]+points[\"offx\"], points[\"y\"]+points[\"stretch\"],\n points[\"x\"], points[\"y\"]+points[\"radius\"]\n );\n if (fill) c.fill(); else c.stroke();\n}\nfunction cheekcircle(fill) { // x3\n let points = {\n x: (50-7.5)*scale, y: (50+10)*scale, // copy from cheekplate() here\n radius: (5)*scale\n };\n c.beginPath();\n c.arc(points[\"x\"], points[\"y\"], points[\"radius\"], 0, Math.PI*2); // a full circle\n if (fill) c.fill(); else c.stroke();\n}\nfunction display() {\n let points = {\n xe: (87.5/*mess*/)*scale, ye: (65)*scale, // xEnd and yEnding - edge of visor\n xs: (50+5)*scale, ys: (50+5)*scale // xSmile and ySmiling - edge of the smile ^^)\n };\n c.beginPath();\n c.moveTo(points[\"xe\"], points[\"ye\"]);\n //c.lineTo(points[\"xs\"], points[\"ys\"]);\n //c.lineTo()\n c.bezierCurveTo(\n (points[\"xe\"]-points[\"xs\"])/3*2+points[\"xs\"]/*WHAT*/, (points[\"ye\"]-points[\"ys\"])/3*1+points[\"ys\"], // HOW DOes this\n (points[\"xe\"]-points[\"xs\"])/3*1+points[\"xs\"], (points[\"ye\"]-points[\"ys\"])/3*2+points[\"ys\"], // actually work?!\n points[\"xs\"], points[\"ys\"]\n );\n c.stroke();\n // And a display...\n c.beginPath();\n (function(x, y, tilt){ // I'm tired of objects, gonna use a function\n c.arc(x, y, (5)*scale, 0+tilt, Math.PI+tilt, true); // And simply arc() for now.. ugh...\n })((50+10)*scale, (50-5)*scale, Math.PI/12); // this tilt of PI/12 reminds of some other proto...\n c.fill();\n}\n\n/// Final drawing [wip]\nc.lineWidth = 1*scale;\nc.strokeStyle = \"#000\";\nc.fillStyle = \"green\";\near(50+5, 50-20-1, true);\near(50+5, 50-20-1);\nc.fillStyle = \"#101040\";\nvisor(true);\n//c.fillStyle = \"deepskyblue\";\n//c.strokeStyle = \"darkturquoise\";\nc.fillStyle = \"cyan\";\nc.strokeStyle = \"cyan\";\ndisplay();\nc.strokeStyle = \"#000\";\nvisor();\nc.fillStyle = \"green\";\near(50, 50-20, true);\near(50, 50-20);\nc.fillStyle = \"AliceBlue\";\nheadband(true);\nheadband();\nc.fillStyle = \"azure\";\ncheekplate(true);\ncheekplate();\nc.fillStyle = \"deepskyblue\";\ncheekcircle(true);\ncheekcircle();\n}", "title": "" }, { "docid": "c4f55057aa71d181081d5b96d4849aae", "score": "0.57540023", "text": "function drawMapTeleportic()\n{\n // Snake head\n paintTile(m_iSnakeOne.head.x, m_iSnakeOne.head.y, m_iSnakeData.headColor, m_iBorderWidth.snakeHead);\n\n // Snake body\n for (var index = 1; index < m_iSnakeOne.body.length; index++)\n paintTile(m_iSnakeOne.body[index].x, m_iSnakeOne.body[index].y, getRandomColor(1, 255), m_iBorderWidth.snakeBody);\n\n // Teleporting blocks\n paintTeleporters();\n\n // Food\n paintFood();\n\n // Repaint toolbar\n paintToolbar();\n\n // Prints score on top of snake game\n writeMessage(m_iTextAlignment.left, m_iScore.color, \"Score: \" + m_iScore.one);\n writeMessage(m_iTextAlignment.left + 13, m_iScore.color, \"Highest Score: \" + m_iScore.highestOne);\n}", "title": "" }, { "docid": "9c3da9309c8bdf129c47ffe925027894", "score": "0.57419634", "text": "render() {\n\t\tstroke(\"rgba(166, 130, 206, 0.77)\");\n\t\tline(MAP_SCALE * player.x, MAP_SCALE * player.y, MAP_SCALE * this.wallHitX, MAP_SCALE * this.wallHitY);\n\t}", "title": "" }, { "docid": "770abc0f319218e01c3a0c17a7f552d0", "score": "0.5722806", "text": "function drawMap(){\n\tfor(j = 0 ; j < MAP_Y ; j++){\n\t\tfor(i = 0 ; i < MAP_X ; i++){\n\t\t\tswitch(map[j][i].value){\n\t\t\t\tcase 0:\n\t\t\t\t\tctx.fillStyle=\"#F6E3CE\"; //Beige\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tctx.fillStyle=\"#6666FF\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tctx.fillStyle=\"#6666AA\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tctx.fillStyle=\"#D7A25E\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tctx.fillStyle=\"#B78B51\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tctx.fillRect(i*CELL_SIZE+1, j*CELL_SIZE+1, CELL_SIZE-2, CELL_SIZE-2);\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "d306d3b17dcb2c13a16ab5d8960dac19", "score": "0.5698748", "text": "function drawMap () {\r\n\r\n // create plot to hold all the drawings\r\n NS.plot = NS.svg.append(\"g\")\r\n .attr(\"id\", \"plot\");\r\n\r\n // create the base to hold US map\r\n NS.base = NS.plot.append(\"g\")\r\n .attr(\"id\", \"basemap\");\r\n\r\n // append the geoPath to the base map\r\n NS.base.append(\"path\")\r\n .datum(NS.states)\r\n .attr(\"class\", \"land\")\r\n .attr(\"d\", NS.geoPath);\r\n\r\n // draw the interior states' border\r\n NS.base.append(\"path\")\r\n .datum(NS.interiorBorder)\r\n .attr(\"class\", \"border interior\")\r\n .attr(\"d\", NS.geoPath);\r\n\r\n // draw the exterior countries' border\r\n NS.base.append(\"path\")\r\n .datum(NS.exteriorBorder)\r\n .attr(\"class\", \"border exterior\")\r\n .attr(\"d\", NS.geoPath);\r\n\r\n} // end drawMap", "title": "" }, { "docid": "013f38260db64e83956116cab52433ae", "score": "0.5690699", "text": "function draw() {\n background(0); // Set the background to black\n // stroke(255, 230, 230, 1 * y);\n y = y + 1;\n m = m - 1;\n\n topStroke = 0 + 0.08 * y * y / 200;\n bottomStroke = 0 + 0.08 * m * m / 200;\n\n strokeWeight(topStroke);\n line(500 - y / 2, y, width - 500 + y / 2, y);\n if (y > height / 2) {\n y = height / 5;\n }\n\n b = b + 1;\n strokeWeight(bottomStroke);\n line(500 - m / 2, b, width - 500 + m / 2, b);\n if (b > height - (height / 5)) {\n b = height / 2;\n m = height / 2;\n }\n \n strokeWeight(topStroke);\n g = g + 1;\n line(500 - g / 2, g, width - 500 + g / 2, g);\n if (g > height / 2) {\n g = height / 5;\n }\n\n\n\n z = z + 1;\n xm = xm - 1;\n ztopStroke = 0 + 0.08 * z * z / 200;\n strokeWeight(ztopStroke);\n line(500 - z / 2, z, width - 500 + z / 2, z);\n if (z > height / 2) {\n z = height / 5;\n }\n\n\n x = x + 1;\n xbottomStroke = 0 + 0.08 * xm * xm / 200;\n strokeWeight(xbottomStroke);\n line(500 - xm / 2, x, width - 500 + xm / 2, x);\n if (x > height - (height / 5)) {\n x = height / 2;\n xm = height / 2;\n }\n\n}", "title": "" }, { "docid": "7077511765c89e90420ad97d4ab7898d", "score": "0.56842405", "text": "function drawScale(key, x, y, level, ancestors, offset) {\n //function drawscale(key, x, y, level, angle)\n //copy the array so that we dont modify the original with recursion\n ancestors = ancestors.slice();\n //add it to the ancestors array\n ancestors.push(key);\n\n if (scales[key].scale_class == \"whole_tone\") {\n fill(map(scales[key].root % 2, 0, 1, 200, 150));\n fontcolor = map(scales[key].root % 2, 0, 1, 200, 150);\n } else if (scales[key].scale_class == \"octatonic\") {\n fill(map(scales[key].root % 3, 0, 2, 200, 133));\n fontcolor = map(scales[key].root % 3, 0, 2, 200, 133);\n } else if (scales[key].scale_class == \"hexatonic\") {\n fill(map(scales[key].root % 4, 0, 3, 200, 100));\n fontcolor = map(scales[key].root % 4, 0, 3, 200, 100);\n } else {\n fill(hsvToRgb(map((scales[key].root * 7) % 12, 11, 0, 0, 1),\n map((scales[key].root * 7) % 12, 0, 11, 0.1, 0.5),\n 1));\n fontcolor = hsvToRgb(map((scales[key].root * 7) % 12, 11, 0, 0, 1),\n map((scales[key].root * 7) % 12, 0, 11, 0.1, 0.5),\n 1);\n }\n\n // console.log(\"fonty colory\", fontcolor);\n\n if (window.innerHeight > window.innerWidth) {\n var shape_size = (windowWidth * (0.23) / level);\n } else {\n var shape_size = (windowHeight * (0.15) / level);\n }\n\n\n //all of the babies\n let filt_adjacent_scales = scales[key].adjacent_scales;\n\n //filter out all ancestors\n\n filt_adjacent_scales = filt_adjacent_scales.filter(function(item) {\n return ancestors.indexOf(item) === -1;\n\n });\n\n if (level < 3) {\n touch_data.push({\n x: x,\n y: y,\n ssize: shape_size,\n k: key\n });\n }\n\n //color scheme by scale class\n polygon(x, y, shape_size, scales[key].adjacent_scales.length, scales[key].scale_class);\n\n stroke(0);\n fill(0, 0, 0);\n const font_size_1 = 32 / level;\n //textSize(font_size_1);\n //text(note_names[scales[key].root], x-(9 / level)-1, y-1);\n //text(scales[key].scale_class, x-(54 / level)-1, y+(33 / level)-1); //print out scale class\n fill(80, 80, 80);\n const font_size_2 = 30 / level;\n textSize(font_size_2);\n text(note_names[scales[key].root], x - (8 / level), y);\n textAlign(CENTER);\n var scale_class = scales[key].scale_class.replace(\"_\", \"\\n\");\n text(scale_class, x - (9 / level), y + (33 / level)); //print out scale class\n fill(0);\n\n if (level > 1) {\n return\n }\n\n for (let i = 0; i < filt_adjacent_scales.length; i++) {\n\n\n var angle;\n let divisor = pow(2, level);\n\n if (level == 1) {\n angle = map(i, 0, filt_adjacent_scales.length, 0, (TWO_PI));\n } else {\n // angle = map(i, 0, filt_adjacent_scales.length, 0, (PI)); \n let middle = Math.round((filt_adjacent_scales.length - 1) / 2);\n let pos = i - middle;\n angle = map(pos, 0, filt_adjacent_scales.length, offset - (PI / divisor), offset + (PI / divisor)) + (PI / divisor);\n }\n\n\n let theta = map(i, 0, scales[key].adjacent_scales.length, 0, (TWO_PI / (level * level)));\n if (level > 1) {\n // angle = angle + theta;\n }\n let newX = x + sin(angle + TWO_PI) * ((windowWidth * 0.42) / level);\n let newY = y + cos(angle + TWO_PI) * ((windowHeight * 0.36) / level);\n //rotate(cos(TWO_PI/adjacent_scales.length));\n\n drawScale(filt_adjacent_scales[i], newX, newY, level + 1, ancestors, angle);\n }\n}", "title": "" }, { "docid": "1bb5642861ebea22f365aa2905d82a39", "score": "0.5682079", "text": "function drawMap(visId) {\n\t//load the map\n\t//this custom svg has an overlay of a separate on top to allow for hatches over heatmap\n\tdocument.getElementById(\"details\").innerHTML = \"<h><br><br><b>Welcome to Team Hyperplane.<br>This is the Map View</b><br><br>\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"Here, we show the data encoded by state.<br><br>\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"Click on a state to see more information on that particular state that includes the number of legislators, bills, etc.<br><br>\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"You can change what information is displayed on this graph (between number of legislators and number of bills from that state).</h>\";\n \n\td3.xml(\"data/custom.svg\", \"image/svg+xml\", function(xml) {\n\t\tif (visId === \"#vis\") \n\t\t\tdocument.getElementById(\"vis\").appendChild(xml.documentElement);\n\t\t\n\t\t//grab what filter we are using:\n\t\tif (mapOptions === \"Legislators\") {\n\t\t\tfilterName = \"legislatorCount\";\n\t\t\tmaxValForColorScale = maxLegislatorCountForState;\n\t\t}\n\t\telse if (mapOptions === \"Bills\") {\n\t\t\tfilterName = \"billCount\";\n\t\t\tmaxValForColorScale = maxBillCountForState;\n\t\t}\n\t\t\n\t\t//update the color scale label\n\t\tdocument.getElementById(\"scale_label_end\").innerHTML = maxValForColorScale;\n\t\t\n for (var state in stateData) {\n\t\t\tvar color = computeColorByValue(filterName, maxValForColorScale, stateData[state]);\n\t\t\t\n d3.selectAll('#' + stateData[state].name)\n .attr('fill', function() {\n return (color);\n })\n .attr('stroke-width', function() {\n return (1);\n })\n\t\t\t\t.attr('stroke', \"black\")\n\t\t\t\t.on('click', function() {\n\t\t\t\t\tmapOnClick(this);\n\t\t\t\t})\n\t\t\t\t.on('mouseover', function() {\n\t\t\t\t\tmapOnHoverEnter(this);\n\t\t\t\t})\n\t\t\t\t.on('mouseout', function() {\n\t\t\t\t\tmapOnHoverExit(this);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t//for now, remove the overlay\n\t\t\td3.selectAll('#overlay_' + stateData[state].name).remove();\n }\n });\n}", "title": "" }, { "docid": "563a2080f0be4e9ea97efa7ee35895ad", "score": "0.5681064", "text": "function drawMap() {\n // main canvas and context vars we'll keep using\n\n _canvas = document.getElementById(\"myCanvas\");\n _ctx = _canvas.getContext(\"2d\");\n\n // add the mouse captures\n _canvas.addEventListener(\"mousedown\", doMouseDown, false);\n //_canvas.addEventListener(\"mousemove\", doMouseOver, false);\n\n // wait until all images are actually loaded before drawing on the map\n _imgInfPlatoon.onload = function() {\n drawAllUnits();\n };\n\n // walk through and draw the actual map squares\n for (var row = 1; row <= _rows; row++) {\n for (var col = 1; col <= _cols; col++) {\n\n x = (row - 1) * _squareSize;\n y = (col - 1) * _squareSize;\n\n _ctx.beginPath();\n _ctx.strokeStyle = \"black\";\n _ctx.fillStyle = _mapArray[getArrayPosforRowCol(_mapArray, row, col)].color;\n _ctx.rect(y, x, _squareSize, _squareSize);\n _ctx.fill();\n _ctx.stroke();\n\n if (_debugOn) {\n _ctx.font = \"8px\";\n _ctx.fillStyle = \"#0000\";\n _ctx.fillText(row + \",\" + col, y + 2, x + 10);\n _ctx.strokeText(row + \",\" + col, y + 2, x + 10);\n }\n\n _ctx.closePath();\n\n }\n\n }\n\n // set all the image sources\n _imgSniperTeam.src = \"sniper_team_34x28.png\";\n _imgMGTeam.src = \"mg_team_34x28.png\";\n _imgMortarSection.src = \"mortar_section_34x28.png\";\n _imgHQ.src = \"hq_section_34x28.png\";\n _imgInfSquad.src = \"inf_squad_34x28.png\";\n _imgInfPlatoon.src = \"inf_platoon_34x28.png\";\n\n // give images two additional seconds to load\n setTimeout(doNothing, 2000);\n\n}", "title": "" }, { "docid": "211f478a7abbed823780c5cce3f542aa", "score": "0.5670799", "text": "function drawLines(){\n\t\t\t\n\t\t//grab some target w and height to help with line placement ----- //\n\t\tvar h2a_w = jQuery('.rewards-have-fun').outerWidth(),\n\t\t\th2b_w = jQuery('.rewards-get-rewarded').outerWidth(),\n\t\t\th2b_h = jQuery('.rewards-get-rewarded').outerHeight(),\n\t\t\th2c_w = jQuery('.rewards-earn-points').outerWidth(),\n\t\t\ticon_1_w = jQuery('.rewards-cash-icon').outerWidth(),\n\t\t\ticon_1_h = jQuery('.rewards-cash-icon').outerHeight(),\n\t\t\ticon_2_w = jQuery('.rewards-cash-back-icon').outerWidth(),\n\t\t\ticon_2_h = jQuery('.rewards-cash-back-icon').outerHeight(),\n\t\t\ticon_3_w = jQuery('.rewards-cash-lvl-icon').outerWidth();\n\t\t\t\n\t\t//FIRST PATH -- all option values added [as sample]\n\t\tpath.exe({\n\t\t\t\n\t\t\t//svg parent element (class or id name)\n\t\t\tsvg_parent:'.rewards-svg-wrapper',\n\n\t\t\t//svg element (class or id name)\n\t\t\tsvg:'.rewards-lines-svg',\n\t\t\t\t\n\t\t\t//start point target element (class or id name)\n\t\t\tstart:'.rewards-have-fun',\n\t\t\t\t\n\t\t\t//end point target element (class or id name)\n\t\t\tend:'.rewards-get-rewarded',\n\t\t\t\t\n\t\t\t//setup start point poition and any offset you may want to add\n\t\t\tstart_offset:[h2a_w + 20, 30],\n\t\t\t\t\n\t\t\t//bend value for benzier curve [x:y]\n\t\t\tstart_bend:[420, -180],\n\t\t\t\t\n\t\t\t//setup endpoint poition and any offset you may want to add\n\t\t\tend_offset:[(h2b_w - 35), -20],\n\t\t\t\t\n\t\t\t//bend value for benzier curve [x:y]\n\t\t\tend_bend:[0, 0],\n\t\t\t\t\n\t\t\t//setup icons -- add img src url into an array -- add as many as you like\n\t\t\timg:['/contents/rewards/sports.png', '/contents/rewards/casino-lg2.png','/contents/rewards/casino.png', '/contents/rewards/poker_0.png', '/contents/rewards/horses.png'],\n\t\t\t\t\n\t\t\t//if you have images we need to set a path id name\n\t\t\tid:'svg_one'\n\t\t});\n\t\t\t\t\n\t\t\t//icon GetRewarded - 1\n\t\t\tpath.exe({\n\t\t\t\tsvg_parent:'.rewards-svg-wrapper',\n\t\t\t\tsvg:'.rewards-lines-svg',\n\t\t\t\tstart:'.rewards-get-rewarded',\n\t\t\t\tstart_offset:[h2b_w - 30, h2b_h + 15],\n\t\t\t\tend:'.rewards-cash-icon',\n\t\t\t\tend_offset:[icon_1_w - 30, -25]\n\t\t\t});\t\n\t\t\t\t\n\t\t\t//icon 1 - 2\n\t\t\tpath.exe({\n\t\t\t\tsvg_parent:'.rewards-svg-wrapper',\n\t\t\t\tsvg:'.rewards-lines-svg',\n\t\t\t\tstart:'.rewards-cash-icon',\n\t\t\t\tstart_offset:[icon_1_w - 30, icon_1_h + 15],\n\t\t\t\tend:'.rewards-cash-back-icon',\n\t\t\t\tend_offset:[icon_2_w - 30, -25]\n\t\t\t});\t\n\t\t\t\t\n\t\t\t//icon 2 - 3\n\t\t\tpath.exe({\n\t\t\t\tsvg_parent:'.rewards-svg-wrapper',\n\t\t\t\tsvg:'.rewards-lines-svg',\n\t\t\t\tstart:'.rewards-cash-back-icon',\n\t\t\t\tstart_offset:[icon_2_w - 30, icon_2_h + 15],\n\t\t\t\tend:'.rewards-cash-lvl-icon',\n\t\t\t\tend_offset:[icon_3_w - 30, -25]\n\t\t\t});\t\n\t\t\t\t\t\n\t\t//LAST PATH\n\t\tpath.exe({\n\t\t\tsvg_parent:'.rewards-svg-wrapper',\n\t\t\tsvg:'.rewards-lines-svg',\n\t\t\tstart:'.rewards-cash-lvl-icon',\n\t\t\tstart_offset:[60, 80],\n\t\t\tstart_bend:[-5, 109],\n\t\t\tend:'.rewards-earn-points',\n\t\t\tend_offset:[h2c_w + 20, 30]\n\t\t});\t\n\t\t\t\n\t}", "title": "" }, { "docid": "c6f13a5ed45ed8000961e26c3a415219", "score": "0.5667656", "text": "function draw() {\n \n background(135, 206, 235);\n \n //Sky(Sun)\n fill(255, 204, 0);\n square(312,10,80,100)\n\n //Building\n fill(128,128,128);\n rect(104,65,200,30);\n fill(255,255,255);\n rect(120,95,15,55);\n fill(255,255,255);\n rect(160,95,15,55);\n fill(255,255,255);\n rect(270,95,15,55);\n fill(255,255,255);\n rect(220,95,15,55);\n fill(255,255,255);\n rect(102,250,210,150);\n fill(255,255,255);\n rect(119,150,170,100);\n \n //Lake\n fill(10,2,0);\n rect(0,340,800,90);\n \n //Grass\n fill(0,255,0);\n rect(0,380,600,30);\n fill(0,255,0);\n rect(0,320,600,30); \n \n //Building Setup Display Function With Color Fill Fucntion\n fill(105,0,0);\n b0.display();\n fill(255,0,0);\n b1.display();\n fill(50,205,50);\n b2.display();\n fill(255,255,0);\n b3.display();\n fill(255,192,203);\n b4.display();\n fill(0,255,255);\n b5.display();\n fill(20,40,255);\n b6.display();\n fill(255,0,255);\n b7.display();\n fill(139, 0, 255);\n b8.display();\n fill(255,127,0);\n b9.display();\n fill(255,10,243);\n b10.display();\n\n}", "title": "" }, { "docid": "de0ec08df04dec03b250d24bd84dc6b8", "score": "0.56674194", "text": "function drawRoad() {\n drawPavement();\n drawroadDivider();\n}", "title": "" }, { "docid": "88c432a6130ada189bbfa5f67e0bda84", "score": "0.56623894", "text": "function render() {\n\n\t\t// Draw Horizontal Lines\n\t\tp.push();\n\n\t\t\tp.strokeCap(p.ROUND);\n\t\t\tp.stroke(121, 192, 242);\t\t\t\t// Light Blue\n\t\t\tp.translate(p.width/2, p.height/2);\t\t// Translate to center\n\n\t\t\t// Set strokeweight to decrease proportionally to the stretch factor\n\t\t\tvar base_stroke_weight = 3;\n\t\t\tvar stroke_weight = base_stroke_weight - (a_l_de.value * base_stroke_weight);\n\t\t\t\tstroke_weight = p.max(stroke_weight, 0.25);\n\t\t\t\n\t\t\tp.strokeWeight(stroke_weight);\n\n\t\t\tvar spacing = 75;\t\t\t\t\t\t// Set space around Es\n\t\t\t// Mult by -1 for left line\n\t\t\tvar x_1 = a_l_ds.value * (p.width / 2) + spacing; \t// Displacement Start\n\t\t\tvar x_2 = a_l_de.value * (p.width / 2) + spacing;\t\t// Displacement End\n\n\t\t\tp.line(-x_1, 0, -x_2, 0);\t\t// Left Line\n\t\t\tp.line(x_1, 0, x_2, 0);\t\t// Right Line\n\n\t\tp.pop();\n\n\t\t// Assemble Logo!\n\n\t\t// Rotate E\n\t\tp.push();\n\n\t\t\tp.tint(255, 255); // Opacity (255)\n\t\t\t\n\t\t\tp.translate(p.width/2, p.height/2);\n\t\t\tp.rotate(p.radians(a_ed_r.value));\t\t// All rotations must occur here!!!\n\t\t\tp.scale(1,1);\n\n\t\t\t// For Dots\n\t\t\tp.push();\n\n\t\t\t\tp.translate(-41.25,-42.65); \t\t// Center offset\n\t\t\t\tp.scale(0.15,0.15);\n\n\t\t\t\t// Polar Coordinates\n\t\t\t\tvar r = a_d_d.value;\t\t\t\t// Origin Offset \t{start: 300, end: 265}\n\t\t\t\tangle = p.radians(a_d_r.value);\t\t// Angle Offset\t\t{start: 0, end: 77}\n\t\t\t\tx = p.cos(angle) * r;\t\t\t\t// Multiply r * -1 for other Dot\n\t\t\t\ty = p.sin(angle) * r;\n\n\t\t\t\t\t// Top Dot\n\t\t\t\t\tp.push();\n\t\t\t\t\t\tp.scale(1, 1);\n\t\t\t\t\t\t// p.translate(278, 75); \t// Dot final position\n\t\t\t\t\t\tp.translate(x,y);\n\t\t\t\t\t\tp.translate(276,283); \t\t// Center on Es\n\t\t\t\t\t\tp.scale(a_d_s.value, a_d_s.value); \t// Each scale <-- Parametric\n\t\t\t\t\t\tp.image(dot, -50, -50); \t// Center around origin\n\t\t\t\t\t\t// p.ellipse(-1,1,2,2);\t\t// Debugging Center pt\n\t\t\t\t\tp.pop();\n\n\t\t\t\t\t// Bottom Dot\n\t\t\t\t\tp.push();\n\t\t\t\t\t\tp.scale(1, 1);\n\t\t\t\t\t\t// p.translate(175, 593); \t// Dot final position\n\t\t\t\t\t\tp.translate(-x,-y);\n\t\t\t\t\t\tp.translate(276,283); \t\t// Center on Es\n\t\t\t\t\t\tp.scale(a_d_s.value, a_d_s.value); \t// Each scale <-- Parametric\n\t\t\t\t\t\tp.image(dot2, -50, -50); \t// Center around origin\n\t\t\t\t\t\t// p.ellipse(-1,1,2,2);\t\t// Debugging Center pt\n\t\t\t\t\tp.pop();\n\n\t\t\tp.pop();\n\n\t\t\t// For Es\n\t\t\tp.push();\n\n\t\t\t\tp.scale(a_e_s.value, a_e_s.value); \t\t\t\t\t\t// Global scale\n\t\t\t\tp.translate(-41.25,-42.65); \t\t// Center offset\n\t\t\t\tp.scale(0.15,0.15);\n\n\t\t\t\t\n\t\t\t\t// Bottom E\n\t\t\t\tp.image(E, 100, 100);\n\n\t\t\t\t// Top E\n\t\t\t\tp.push();\n\t\t\t\t\tp.translate(200, 0);\n\t\t\t\t\tp.image(E2, 0, 0);\n\t\t\t\tp.pop();\n\n\t\t\tp.pop();\n\n\t\tp.pop();\n\n\t\tp.push();\n\t\t\tp.fill(255);\n\t\t\tp.noStroke();\n\t\t\tp.translate(p.width/2, p.height/2);\n\t\tp.pop();\n\n\t}", "title": "" }, { "docid": "05738d3a1de8d58263446ad51070c6bb", "score": "0.56596", "text": "function paintStroke(strokeLength, strokeThickness, luma, mappedAlpha) {\n //Two dimensional gradient mapping for dimensions luma and turbulence\n let turbulentDark = color(27,60,90,mappedAlpha);\n let turbulentLight = color(214,103,81,mappedAlpha);\n let neutralDark = color(81,81,107,mappedAlpha);\n let neutralLight = color(202,156,99,mappedAlpha);\n let peacefulDark = color(9,13,72,mappedAlpha);\n let peacefulLight = color(225,114,55,mappedAlpha);\n let currColor;\n\n //Maps from peaceful to neutral color palettes\n if (turbulence<=0.25){\n let currDark = lerpColor(peacefulDark,neutralDark,turbulence);\n let currLight = lerpColor(peacefulLight,neutralLight,turbulence);\n currColor = lerpColor(currDark,currLight,map(luma,0,255,0,1));\n }\n //Maps from neutral to turbulent color palettes\n else {\n let currDark = lerpColor(neutralDark,turbulentDark,turbulence);\n let currLight = lerpColor(neutralLight,turbulentLight,turbulence);\n currColor = lerpColor(currDark,currLight,map(luma,0,255,0,1));\n }\n\n //Determines if the stroke is curved. A straight line is 0.\n let tangent1 = 0;\n let tangent2 = 0;\n let odds = random(1.0);\n let stepLength = strokeLength/2;\n stroke(currColor);\n\n if(odds < 0.7) {\n tangent1 = random(-strokeLength, strokeLength);\n tangent2 = random(-strokeLength, strokeLength);\n }\n //Turbulence threshold for generating curves\n if (turbulence>0.2) {\n // Draw a curve\n strokeWeight(strokeThickness);\n rotate(radians(random(-90, 90)));\n curve(tangent1, -stepLength*2, 0, -stepLength, 0, stepLength, tangent2, stepLength*2);\n }\n else {\n //Plot a single point\n strokeWeight(strokeThickness*3);\n point(0,0)\n }\n let z = 1;\n}", "title": "" }, { "docid": "abf7913c1d6a9846d541962c91119c7f", "score": "0.56571335", "text": "function spawnTrace() {\n\t\t\t\t\tconst shape = rngRange(1, 8);\n\t\t\t\t\tlet paint = new PIXI.Graphics();\t\t\t\t\t\t\t\t\t// create a shape in the PIXI engine\n\t\t\t\t\tpaint.beginFill(0x000000, 0);\t\t\t\t\t\t\t\t\t\t// empty, transparant fill color\n\n\t\t\t\t\tswitch (shape) {\n\t\t\t\t\t\t// 0.8x0.8 square\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tpaint.lineStyle(4, randomColor({luminosity:'light', hue:'blue'}), 0.5);\n\t\t\t\t\t\t\tpaint.moveTo(-15, -15);\n\t\t\t\t\t\t\tpaint.lineTo(15, -15);\n\t\t\t\t\t\t\tpaint.lineTo(15, 15);\n\t\t\t\t\t\t\tpaint.lineTo(-15, 15);\n\t\t\t\t\t\t\tpaint.lineTo(-15, -15);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// 2x2 square\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tpaint.lineStyle(4, randomColor({luminosity:'light', hue:'green'}), 0.5);\t\t\t// line style\n\t\t\t\t\t\t\tpaint.moveTo(-40, -40);\n\t\t\t\t\t\t\tpaint.lineTo(40, -40);\n\t\t\t\t\t\t\tpaint.lineTo(40, 40);\n\t\t\t\t\t\t\tpaint.lineTo(-40, 40);\n\t\t\t\t\t\t\tpaint.lineTo(-40, -40);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// 3x3 square\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tpaint.lineStyle(4, randomColor({luminosity:'light', hue:'blue'}), 0.5);\n\t\t\t\t\t\t\tpaint.moveTo(-60, -60);\n\t\t\t\t\t\t\tpaint.lineTo(60, -60);\n\t\t\t\t\t\t\tpaint.lineTo(60, 60);\n\t\t\t\t\t\t\tpaint.lineTo(-60, 60);\n\t\t\t\t\t\t\tpaint.lineTo(-60, -60);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// 2x width circle\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tpaint.lineStyle(4, randomColor({luminosity:'light', hue:'red'}), 0.5);\n\t\t\t\t\t\t\tpaint.moveTo(0, 0);\n\t\t\t\t\t\t\tpaint.drawCircle(0, 0, 40);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// 0.7x width triangle (ratio 6:7 x:y)\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tpaint.lineStyle(4, randomColor({luminosity:'light', hue:'green'}), 0.5);\n\t\t\t\t\t\t\tpaint.moveTo(0, 18);\n\t\t\t\t\t\t\tpaint.lineTo(21, -18);\n\t\t\t\t\t\t\tpaint.lineTo(-21, -18);\n\t\t\t\t\t\t\tpaint.lineTo(0, 18);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// 1.3x width triangle\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\tpaint.lineStyle(4, randomColor({luminosity:'light', hue:'red'}), 0.5);\n\t\t\t\t\t\t\tpaint.moveTo(0, 30);\n\t\t\t\t\t\t\tpaint.lineTo(35, -30);\n\t\t\t\t\t\t\tpaint.lineTo(-35, -30);\n\t\t\t\t\t\t\tpaint.lineTo(0, 30);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// 1x4 bar\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\tpaint.lineStyle(4, randomColor({luminosity:'light', hue:'red'}), 0.5);\n\t\t\t\t\t\t\tpaint.moveTo(-20, -80);\n\t\t\t\t\t\t\tpaint.lineTo(20, -80);\n\t\t\t\t\t\t\tpaint.lineTo(20, 80);\n\t\t\t\t\t\t\tpaint.lineTo(-20, 80);\n\t\t\t\t\t\t\tpaint.lineTo(-20, -80);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// S block, facing right\n\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\tpaint.lineStyle(4, randomColor({luminosity:'light', hue:'green'}), 0.5);\n\t\t\t\t\t\t\tpaint.moveTo(20, 40);\n\t\t\t\t\t\t\tpaint.lineTo(20, 0);\n\t\t\t\t\t\t\tpaint.lineTo(60, 0);\n\t\t\t\t\t\t\tpaint.lineTo(60, -40);\n\t\t\t\t\t\t\tpaint.lineTo(-20, -40);\n\t\t\t\t\t\t\tpaint.lineTo(-20, 0);\n\t\t\t\t\t\t\tpaint.lineTo(-60, 0);\n\t\t\t\t\t\t\tpaint.lineTo(-60, 40);\n\t\t\t\t\t\t\tpaint.lineTo(20, 40);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault: break;\n\t\t\t\t\t}\n\n\t\t\t\t\tpaint.endFill();\t\t\t\t\t\t\t\t\t\t\t\t\t// ends vertice drawing\n\t\t\t\t\tskyObjectContainer.addChild(paint);\t\t\t\t\t\t\t\t\t// add shape to the PIXI stage\n\n\t\t\t\t\tpaint.x = rngRange(-500, 700);\t\t\t\t\t\t\t\t\t\t// Randomly place the tetris offscreen\n\t\t\t\t\tpaint.y = rngRange(690, 800);\t\t\t\t\t\t\t\t\t\t// Random starting height\n\t\t\t\t\tpaint.rotation = (rngRange(0,310)/100);\t\t\t\t\t\t\t\t// Random starting rotation\n\t\t\t\t\tconst speedX = rngRange(6, 10)/10;\t\t\t\t\t\t\t\t\t// Random X speed\n\t\t\t\t\tconst speedY = rngRange(6, 8)/10;\t\t\t\t\t\t\t\t\t// Random Y speed\n\t\t\t\t\tlet rotateSpeed = rngRange(-4,4)/100;\t\t\t\t\t\t\t\t// Random rotation speed\n\t\t\t\t\tif (rotateSpeed == 0) { rotateSpeed = 0.01; }\n\n\t\t\t\t\tfunction move() {\n\t\t\t\t\t\tpaint.x += speedX;\t\t\t\t\t\t\t\t\t\t\t\t// move right\n\t\t\t\t\t\tpaint.y -= speedY;\t\t\t\t\t\t\t\t\t\t\t\t// move right\n\t\t\t\t\t\tpaint.rotation += rotateSpeed;\t\t\t\t\t\t\t\t\t// rotate\n\n\t\t\t\t\t\tif (cow.boostMultiplier > 0) {\t\t\t\t\t\t\t\t\t// click boost\n\t\t\t\t\t\t\tpaint.x += cow.boostMultiplier * speedX * 2;\n\t\t\t\t\t\t\tpaint.y -= cow.boostMultiplier * speedY * 2;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (paint.y < -90 || paint.x > 990) {\t \t\t\t\t\t\t// if shape is offscreen..\n\t\t\t\t\t\t\tpaint.destroy(true); \t\t\t\t\t\t\t\t\t\t// kill it\n\t\t\t\t\t\t\tswitch (shape) {\n\t\t\t\t\t\t\t\tcase 1: cow.resourceSquares++; updateResourceCounter('square');\t\tbreak;\t\t\t\t\t// different rewards per shape\n\t\t\t\t\t\t\t\tcase 2: cow.resourceSquares++; updateResourceCounter('square');\t\tbreak;\n\t\t\t\t\t\t\t\tcase 3: cow.resourceSquares++; updateResourceCounter('square');\t\tbreak;\n\t\t\t\t\t\t\t\tcase 4: cow.resourceCircles++; updateResourceCounter('square');\t\tbreak;\n\t\t\t\t\t\t\t\tcase 5: cow.resourceTriangles++; updateResourceCounter('triangle');\tbreak;\n\t\t\t\t\t\t\t\tcase 6: cow.resourceTriangles++; updateResourceCounter('triangle');\tbreak;\n\t\t\t\t\t\t\t\tcase 7: cow.resourceSquares+=4; updateResourceCounter('square');\tbreak;\n\t\t\t\t\t\t\t\tcase 8: cow.resourceSquares+=4; updateResourceCounter('square');\tbreak;\n\t\t\t\t\t\t\t\tdefault: break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { window.requestAnimationFrame(move); }\t\t\t\t\t// otherwise, animate another frame and check again\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\n\t\t\t\t\twindow.requestAnimationFrame(move);\t\t\t\t\t\t\t\t\t// starts the animation moving\n\t\t\t\t}", "title": "" }, { "docid": "f2f60c9d297298d3b299f2170eeab14e", "score": "0.5656114", "text": "function zoomed() {\n features.attr(\"transform\", \"translate(\" + zoom.translate() + \")scale(\" + zoom.scale() + \")\")\n .selectAll(\"path\").style(\"stroke-width\", 1 / zoom.scale() + \"px\");\n }", "title": "" }, { "docid": "00a8817e1e385538e41d64598199f3d8", "score": "0.56515163", "text": "function createMap(){\n\t/* Create the svg tag */\n\t\tvar svgNS = \"http://www.w3.org/2000/svg\";\n\t\tvar svg = document.createElementNS(svgNS, \"svg\");\n\n\t\tvar width = 587.5;\n\t\tvar height = 700;\n\n\t\twidth *= scale;\n\t\theight *= scale;\n\n\t\tsvg.setAttribute(\"width\", width);\n\t\tsvg.setAttribute(\"height\", height);\n\t\tsvg.style.overflow = \"hidden\";\n\t\tsvg.style.position = \"relative\";\n\t/**********************/\n\n\tfor(var i = 0; i < map.datas.length; ++i){\n\t\t/* Create the link and the region for the svg */\n\t\t\tvar a = document.createElementNS(svgNS, \"a\");\n\t\t\tvar path = document.createElementNS(svgNS, \"path\");\n\n\t\t\ta.setAttribute(\"title\", map.datas[i].title);\n\t\t\ta.setAttribute(\"href\", file + \"&region=\" + map.datas[i].title);\n\t\t\ta.setAttribute(\"transform\", \"scale(\" + scale + \")\");\n\n\t\t\tpath.setAttribute(\"style\", map.style);\n\t\t\tpath.setAttribute(\"fill\", pc);\n\t\t\tpath.setAttribute(\"stroke\", lc);\n\t\t\tpath.setAttribute(\"stroke-width\", map.strokeWidth);\n\t\t\tpath.setAttribute(\"stroke-linejoin\", map.strokeLinejoin);\n\t\t\tpath.setAttribute(\"d\", map.datas[i].d);\n\t\t\tpath.setAttribute(\"onmouseover\", \"changeIn(this);\");\n\t\t\tpath.setAttribute(\"onmouseout\", \"changeOut(this);\");\n\n\t\t\ta.appendChild(path);\n\t\t\tsvg.appendChild(a);\n\t\t/**********************************************/\n\t}\n\n\tmapParent.appendChild(svg);\n}", "title": "" }, { "docid": "ec033a7db2134030133bceba981a55b9", "score": "0.5651129", "text": "function drawMountains()\n{\n for(var i = 0; i < mountain.length; i++)\n {\n noStroke();\n fill(119,136,153,200);\n triangle(mountain[i].x+737.5,mountain[i].y+200,mountain[i].x+660,mountain[i].y+432,mountain[i].x+815,mountain[i].y+432);\n triangle(mountain[i].x+892.5,mountain[i].y+200,mountain[i].x+970,mountain[i].y+432,mountain[i].x+815,mountain[i].y+432);\n \n fill(47,79,79,200);\n triangle(mountain[i].x+815,mountain[i].y+150,mountain[i].x+700,mountain[i].y+432,mountain[i].x+925,mountain[i].y+432);\n }\n}", "title": "" }, { "docid": "714d561f1207b61b3a19b6c42b1da4a5", "score": "0.5648156", "text": "function doStuff() {\n var mapCanv, usIH, xScale, yScale, zoomedX1, zoomedX0, zoomedY1, zoomedY0;\n mapCanv = setUpMap();\n usIH = calcChaos(mapCanv);\n graphBifurcation(usIH);\n}", "title": "" }, { "docid": "9b3f6388131a47e70291b6f45784526d", "score": "0.5644486", "text": "function graphChaosMap(mc3, chA) {\n var oldx, oldy, newx, newy, inlen, indx;\n \n oldx = chA[0] * 400 + 10;\n oldy = 410;\n \n inlen = chA.length;\n \n mc3.beginPath();\n mc3.moveTo(oldx, oldy);\n mc3.strokeStyle = \"red\";\n \n for (indx = 1; indx < inlen; indx++) {\n newx = oldx;\n newy = 410 - (chA[indx] * 400);\n mc3.lineTo(newx, newy);\n \n newx = (chA[indx] * 400) + 10;\n mc3.lineTo(newx, newy);\n \n oldx = newx;\n oldy = newy;\n }\n mc3.stroke();\n}", "title": "" }, { "docid": "d3f4a0445d4829b76b868fd9db609bca", "score": "0.56407326", "text": "function coverOld() {\n noStroke();\n fill(236, 227, 211);\n for (var i = 0; i < 7; i++){\n rect(plotX2 + 91, 80 + i*60, 468, 30);\n }\n}", "title": "" }, { "docid": "067ba7b543bd2c94abed25f1809af870", "score": "0.5638782", "text": "function figure(){\n push();\n scale(.8); translate(160,40);\n push();\n textSize(22); noStroke();\n text('mole ratios are in ppm',435,-15);\n pop();\n translate(0,10);\n\n push();\n for(let i = 1; i < 6; i++){\n if(i == g.stage){\n strokeWeight(4); fill(255,255,0);\n rect(480,50+70*(i-1),110,40);\n push();\n textSize(30); fill(0); \n text(i,525,81+70*(i-1));\n pop();\n } else {\n strokeWeight(1.5); fill(250);\n rect(480,50+70*(i-1),110,40)\n push();\n textSize(22); fill(0); \n text(i,528,77+70*(i-1));\n pop();\n }\n }\n pop();\n push();\n strokeWeight(2); \n for(let i = 0; i < 5; i++){\n stroke(g.blue);\n line(565,20+70*i,565,45+70*i);\n arrow([565,10+70*i],[565,50+70*i],g.blue,20,6);\n stroke(g.green);\n line(505,470-70*(i+1),505,442-70*(i+1));\n arrow([505,600-70*(i+1)],[505,439-70*(i+1)],g.green,20,6);\n }\n\n // Other arrows and lines\n line(480,400,505,400);\n line(490,20,505,20);\n line(505,20,505,50);\n arrow([505,20],[470,20],g.green,20,6);\n stroke(g.blue);\n line(565,370,565,400);\n line(565,400,580,400);\n arrow([565,400],[600,400],g.blue,20,6);\n line(590,20,565,20);\n pop();\n\n // Non-italic elements\n push();\n textSize(22); noStroke();\n fill(g.green);\n text('1 Mmol/h',400,5);\n text('1 Mmol/h',400,425);\n fill(g.blue);\n text('100 Mmol/h',580,5);\n text('100 Mmol/h',580,425);\n pop();\n\n // Value labels for x and y\n push();\n noStroke(); textSize(20); \n for(let i = 0; i < 5; i++){\n if(i == 0){\n fill(g.green);\n text(' = '+y[0],430,45);\n text(' = '+y[y.length-1],430,395);\n push();\n textStyle(ITALIC);\n text('y',410,45);\n text('y',410,395);\n pop();\n push();\n textSize(16);\n text('1',421,52);\n text('6',421,402);\n pop();\n fill(g.blue);\n text(' = '+x[0],630,45);\n text(' = '+x[x.length-1],630,395);\n push();\n textStyle(ITALIC);\n text('x',610,45);\n text('x',610,395);\n pop();\n push();\n textSize(16);\n text('0',621,52);\n text('5',621,402);\n pop();\n\n } else {\n fill(g.green);\n text(' = '+y[i],450,40+70*(i));\n push();\n textStyle(ITALIC);\n text('y',430,40+70*(i));\n pop();\n push();\n textSize(16);\n text(i+1,441,47+70*i);\n pop();\n fill(g.blue);\n if(i == 2){\n text(' = 0.20',600,40+70*i); \n } else {\n text(' = '+x[i],600,40+70*i); \n }\n push();\n textStyle(ITALIC);\n text('x',580,40+70*i);\n pop();\n push();\n textSize(16);\n text(i,591,47+70*i);\n pop();\n }\n }\n pop();\n pop();\n }", "title": "" }, { "docid": "e40aa3f565e8c93dcf9a791b6c13cc4a", "score": "0.5636024", "text": "function drawLinechart(pm25) {\n\t\t\n\t}", "title": "" }, { "docid": "3227bf688b66f280c1838d41e286c5f2", "score": "0.563235", "text": "function lines(size){\n //variable that determines how far the lines move from the original point\n var offsetYPosition = -size * 0.5 + size * (1 - movementOutRatio);\n stroke(255);\n strokeWeight(random(0.1, 4));\n noFill();\n //horizontal\n rect(this.yPosition + offsetYPosition, this.xPosition +250 , size + 300 , size/4);\n //vertical\n stroke(0, 0, 255);\n strokeWeight(0.1)\n fill(255);\n rect(this.xPosition, this.yPosition + offsetYPosition + 345, size / 10 , size +300);\n}", "title": "" }, { "docid": "9d47772fb04cb407944bf3f8a16e9c2a", "score": "0.5630778", "text": "function draw_Map(){\n\t\n\tfor(var y = screenT + Yfact; y < (screenB/magnify) + Yfact; y++){\n\t\tfor(var x = screenL + Xfact; x < (screenR/magnify) + Xfact; x++){\n\t\t//black out anything beyond the edge of the map\n\t\tif(x<0 || y < 0 || x>mymap.length-1 || y > mymap[x].length-1){\n\t\t\tmyScreen.fillStyle = (\"#000000\");myScreen.fillRect((x-Xfact)*tileX,(y-Yfact)*tileY,tileX+1,tileY+1);}\n\t\t//draw normally\n\t\telse{\n\t\tvar myPic = mymap[x][y].pic;\n\t\t//If the map tile is visible:\n\t\t//console.log(x+\" , \"+y);\n\t\tif(mymap[x][y].isVisible()){\n\t\t//. . .draw it to the screen\n\t\t\n\t\tmyScreen.drawImage(document.getElementById(myPic.sheet),myPic.getXind() * imageIndex,myPic.getYind()*imageIndex,myPic.xsiz,myPic.ysiz,(x-Xfact)*tileX,(y-Yfact)*tileY,tileX+1,tileY+1);\n\t\t//. . . and apply the apropriate fade.\n\t\tmyScreen.fillStyle = \"rgba(0, 0, 0,\"+myPic.getFade()+\")\";\n\t\tmyScreen.fillRect((x-Xfact)*tileX,(y-Yfact)*tileY,tileX+1,tileY+1);}\n\t\n\t\t//Otherwise, black out the square.\n\t\telse{myScreen.fillStyle = (\"#000000\");myScreen.fillRect((x-Xfact)*tileX,(y-Yfact)*tileY,tileX+1,tileY+1);}\n\t\t}\n\t\t\n\t\t}}\n\t\n\t\n\t}", "title": "" }, { "docid": "43be0c8c071379eacd30dba6691a46b2", "score": "0.56302154", "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": "807aad86dcf532cbba3b5c9578571da8", "score": "0.5630174", "text": "function makeFireworks(centerX, centerY, size2) {\n\n //Creating variables to give the fireworks random colors\n var c1 = random(66, 244);\n var c2 = random(66, 244);\n var c3 = random(66, 244);\n\n //Giving the fireworks a random color\n stroke(c1, c2, c3);\n\n //Changing the fireworks size\n size2 = random(10, 50); //gives the fireworks a random size if no key is pressed\n\n\n //Creating the lines for the fireworks\n line(centerX, centerY - 10, centerX, centerY - size2); //north line\n line(centerX + 10, centerY - 10, centerX + size2, centerY - size2); //northeast line\n line(centerX + 10, centerY, centerX + size2, centerY); //east line\n line(centerX + 10, centerY + 10, centerX + size2, centerY + size2); //southeast line\n line(centerX, centerY + 10, centerX, centerY + size2); //south line\n line(centerX - 10, centerY + 10, centerX - size2, centerY + size2); //southwest line\n line(centerX - 10, centerY, centerX - size2, centerY); //west line\n line(centerX - 10, centerY - 10, centerX - size2, centerY - size2); //northwest line\n}", "title": "" }, { "docid": "4c0ee928c762d4245946c36acd94dcab", "score": "0.5628254", "text": "function drawBackgroundMountains()\n{\n for (var i = 0; i < mountainsbackground_x1.length; i++)\n {\n noStroke();\n fill(60, 115, 215);\n triangle(mountainsbackground_x1[i] +250, mountain.y_pos +200, \n mountainsbackground_x1[i], 576, \n mountainsbackground_x1[i] +500, 576);\n }\n \n for (var i = 0; i < mountainsbackground_x2.length; i++)\n {\n noStroke();\n fill(60, 115, 215);\n triangle(mountainsbackground_x2[i] +250, mountain.y_pos +300, \n mountainsbackground_x2[i], 576, \n mountainsbackground_x2[i] +500, 576);\n }\n}", "title": "" }, { "docid": "26299924f1349ce47d646b91eb73335a", "score": "0.56218547", "text": "function drawMap() {\n\t\n\t// Space\n\tsetFill(\"#111111\")\n\tdrawRect(0,0,screenWidth,screenHeight);\n\n\t// Stars\n\tfor(var i = 0; i < arrStars.length; i++) {\n\t\tvar star = arrStars[i];\n\t\tsetFill(star.colour);\n\t\tdrawRect(star.x, star.y, star.size, star.size);\n\t}\n\n}", "title": "" }, { "docid": "c690d6e1e1e7c23ed3cffd601b75d171", "score": "0.5620703", "text": "function drawMountains()\n{\n for(var i = 0; i < mountains.length; i++)\n {\n noStroke();\n fill(178,34,34);\n triangle(mountains[i].x_pos+340, mountains[i].y_pos+333, mountains[i].x_pos+540, mountains[i].y_pos+333, mountains[i].x_pos+440, mountains[i].y_pos+100, mountains.size);\n\n noStroke();\n fill(255);\n triangle(mountains[i].x_pos+414, mountains[i].y_pos+162, mountains[i].x_pos+466, mountains[i].y_pos+166, mountains[i].x_pos+440, mountains[i].y_pos+100);\n }\n}", "title": "" }, { "docid": "13b6058e93719b1e19933f86d1a5b73d", "score": "0.561978", "text": "function draw_map() {\n\n hideAll();\n mirror_camera_blur();\n select('#map', HTMLElement).position(75,75);\n select('#map', HTMLElement).show();\n\n /*Commenting out previous code to work with new code */\n // if ((mouseX >= 485 && mouseX <= 585) && (mouseY >= 370 && mouseY <= 420) && mouseIsPressed) {\n // default_map = false;\n // school_map = true;\n // work_map = false;\n // }\n // else if ((mouseX >= 635 && mouseX <= 735) && (mouseY >= 370 && mouseY <= 420) && mouseIsPressed) {\n // default_map = false;\n // school_map = false;\n // work_map = true;\n // }\n //\n // if (default_map) {\n // image(default_map_img, 75, 75, 850, 350);\n // }\n // else if (school_map) {\n // image(school_map_img, 75, 75, 850, 350);\n // }\n // else if (work_map) {\n // image(work_map_img, 75, 75, 850, 350);\n // }\n //\n // fill(0);\n // noStroke();\n // rect(485, 370, 100, 50);\n // rect(635, 370, 100, 50);\n //\n // fill(255);\n // textAlign(CENTER, CENTER);\n // textSize(25);\n // textFont('Courier New');\n // text('SCHOOL', 535, 395);\n // text('WORK', 685, 395);\n\n draw_header();\n}", "title": "" }, { "docid": "5de6c7dd6680286a822820021495756e", "score": "0.56193995", "text": "function DrawLines (){\n for (let index = level.platforms.length - 1; index > -1; -- index) {\n let pf = level.platforms[index];\n if(pf.onMode == \"blackMode\") {\n base1 = new LineDrawer(blackMode, pf.startX, pf.endX, pf.y);\n }\n else{\n base1 = new LineDrawer(whiteMode, pf.startX, pf.endX, pf.y);\n }\n }\n}", "title": "" }, { "docid": "76e72a89c5ff7bb4d9e6a32898883cce", "score": "0.5615743", "text": "function drawMountains() {\n for (var i = 0; i < mountains.length; i++) {\n var m = mountains[i];\n fill(169, 169, 169);\n triangle(m.x, m.y, m.x + 140, m.y - 166, m.x + 300, m.y);\n fill(192, 192, 192);\n triangle(m.x - 100, m.y, m.x - 60, m.y - 176, m.x + 200, m.y);\n triangle(m.x - 400, m.y, m.x - 160, m.y - 156, m.x + 100, m.y);\n }\n\n}", "title": "" }, { "docid": "27dfc539a97b3f4f665572f7dda705c4", "score": "0.5615572", "text": "draw(m,s) {\n ctx.lineWidth = 0.3\n if(this.mx > 0 && this.mx < worldSize-1 && this.my > 0 && this.my < worldSize-1 && this.mz > 0 && this.mz < 8) {\n if(world[this.mx-1][this.my][this.mz] == 1 && world[this.mx+1][this.my][this.mz] == 1 &&\n world[this.mx][this.my-1][this.mz] == 1 && world[this.mx][this.my+1][this.mz] == 1 &&\n world[this.mx][this.my][this.mz-1] == 1 && world[this.mx][this.my][this.mz+1] == 1) {\n return;\n }\n }\n //put the faces in the correct order for distance drawing\n this.faces = sortFaces(this.points, this.faces)\n\n for(let i = 3; i<this.faces.length; i++) { //draw each face inidvidually, but only the 3 closest to the camera to reduce lag\n \n // if a face is covered by another cube, do not draw it.\n if(this.faces[i][4] == 1 && this.my > 0 && world[this.mx][this.my-1][this.mz] == 1) continue;\n if(this.faces[i][4] == 2 && this.my < worldSize-1 && world[this.mx][this.my+1][this.mz] == 1) continue;\n if(this.faces[i][4] == 3 && this.mx > 0 && world[this.mx-1][this.my][this.mz] == 1) continue;\n if(this.faces[i][4] == 5 && this.mx < worldSize-1 && world[this.mx+1][this.my][this.mz] == 1) continue;\n if(this.faces[i][4] == 4 && this.mz >= 0 && world[this.mx][this.my][this.mz+1] == 1) continue;\n if(this.faces[i][4] == 6 && this.mz < worldSize-1 && world[this.mx][this.my][this.mz-1] == 1) continue;\n \n //check if the player is currently looking at this face\n let point1 = get3dto2d(this.points[this.faces[i][0]].x, this.points[this.faces[i][0]].y, this.points[this.faces[i][0]].z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n let point2 = get3dto2d(this.points[this.faces[i][1]].x, this.points[this.faces[i][1]].y, this.points[this.faces[i][1]].z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n let point3 = get3dto2d(this.points[this.faces[i][2]].x, this.points[this.faces[i][2]].y, this.points[this.faces[i][2]].z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n let point4 = get3dto2d(this.points[this.faces[i][3]].x, this.points[this.faces[i][3]].y, this.points[this.faces[i][3]].z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n let polyPoints = [point1, point2, point3, point4]\n if(inside([xc, yc], polyPoints) && player.selectedBlock != this) {\n player.selectedBlock = this;\n i=0;\n }\n \n ctx.beginPath()\n let point3d = this.points[this.faces[i][0]]\n //transform the 3d point to a 2d point\n let point2d = get3dto2d(point3d.x, point3d.y, point3d.z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n if(!point2d) continue;\n ctx.moveTo(point2d[0], point2d[1]) //go to the location of the first point\n for(let j = 1; j<this.faces[i].length-1; j++) { //draw a line to each point of the current face\n let point3d = this.points[this.faces[i][j]]\n //transform the 3d point to a 2d point\n let point2d = get3dto2d(point3d.x, point3d.y, point3d.z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n if(!point2d) {ctx.beginPath(); break;};\n ctx.lineTo(point2d[0], point2d[1])\n }\n ctx.closePath() //finish at the line off at its start\n let gradient = ctx.createRadialGradient(window.innerWidth/2,window.innerHeight/2,30,window.innerWidth/2,window.innerHeight/2,750);\n gradient.addColorStop(0.1,ColorLuminance(this.color, player.light))\n gradient.addColorStop(1,this.color)\n ctx.fillStyle = gradient\n if(!m && player.selectedBlock == this) {\n ctx.fillStyle = ColorLuminance(this.color, 1)\n }\n ctx.fill() //actually draw the lines\n ctx.strokeStyle = \"#000000\"\n ctx.stroke() //draw the lines around the face\n \n }\n }", "title": "" }, { "docid": "471103dc4c88fb20f08d545692f7c43e", "score": "0.5607395", "text": "function spawnMap() {\n // Spawn solids\n var arr = map.area.presolids, prething, thing;\n while(arr.length > map.current_solid && screen.right + quads.width * 2 + quads.rightdiff >= arr[map.current_solid].xloc * unitsize) {\n prething = arr[map.current_solid];\n thing = prething.object;\n addThing(thing, prething.xloc * unitsize - screen.left, prething.yloc * unitsize);\n thing.placenum = map.current_solid;\n ++map.current_solid;\n }\n // Spawn characters\n arr = map.area.prechars;\n while(arr.length > map.current_char && screen.right + quads.rightdiff >= arr[map.current_char].xloc * unitsize) {\n prething = arr[map.current_char];\n thing = prething.object;\n addThing(thing, prething.xloc * unitsize - screen.left, prething.yloc * unitsize);\n thing.placenum = map.current_char;\n ++map.current_char;\n }\n map.area.current = map.current;\n map.area.current_solid = map.current_solid;\n map.area.current_char = map.current_char;\n}", "title": "" }, { "docid": "eeceb5ce2705386ee5191313181ac2e5", "score": "0.5601883", "text": "drawGraphic(){\n let canvas = this.setCanvas();\n let scales = this.setScales(this.props.data);\n this.setGrid(canvas, scales);\n this.setAxesToCanvas(canvas, scales);\n this.setPointsToCanvas(\n canvas,\n this.props.data,\n scales,\n this.props.x_label,\n this.props.y_label,\n this.props.language,\n this.props.percentage_x,\n this.props.percentage_y\n ); \n }", "title": "" }, { "docid": "78d029db73269baa2242c8c281c89e22", "score": "0.55987567", "text": "function updateMap(geographyChange) {\n \n switch (geographyChange) {\n case \"ProvincesTerritories\":\n geographyChange = \"province/territory\";\n break;\n case \"HealthRegions\":\n geographyChange = \"health regions\";\n break;\n case \"CensusMetropolitanAreas\":\n geographyChange = \"census metropolitan areas/large census agglomerations\";\n }\n \n //Update legend with new quintiles each change\n d3.selectAll(\".legendText\").each(function(item,index){\n if (quintileArray[index].lowerbound === 0)\n this.textContent = parseFloat(quintileArray[index].upperbound).toFixed(1) + \" or less\";\n else if (quintileArray[index].upperbound === 100)\n this.textContent = parseFloat(quintileArray[index].lowerbound).toFixed(1) + \" or more\";\n else if (quintileArray[index].upperbound === \"none\")\n this.textContent = \"Insufficient data\";\n else\n this.textContent = parseFloat(quintileArray[index].lowerbound).toFixed(1) + \" to \" + parseFloat(quintileArray[index].upperbound).toFixed(1);\n });\n \n d3.selectAll(\".legendRect\").each(function(item,index){\n this.attributes.upperbound.value = quintileArray[index].upperbound;\n this.attributes.lowerbound.value = quintileArray[index].lowerbound;\n });\n\n \n let circleContainer = d3.select(\"#circleContainer\");\n\n let currentArea = [];\n d3.selectAll(\"path[type=area]\")._groups[0].forEach(function(item) {\n item.__data__.data = cleanedData[\"$\" + geographyChange]\n [\"$\" + d3.select(\"#Indicator\").property(\"value\")]\n [\"$\" + d3.select(\"#AgeGroups\").property(\"value\")]\n [\"$\" + d3.select(\"#Sex\").property(\"value\")]\n .map(function(area) {\n switch (Number(area.GEO_Code)) {\n case Number(item.__data__.properties.PRUID):\n return area;\n case Number(item.__data__.properties.HR_UID):\n return area;\n case Number(item.__data__.properties.CMA):\n return area;\n case 0:\n canadaObject = area;\n }\n })\n .filter(Boolean)[0];\n currentArea.push(item.__data__);\n });\n\n circleContainer\n .data([canadaObject])\n .exit()\n .remove();\n\n circleContainer\n .enter()\n .append(\"circle\")\n .attr('id', 'canadaCircle')\n .attr(\"r\", 30)\n .style(\"stroke\", \"black\");\n\n circleContainer\n .select(\"circle\")\n .transition()\n .duration(1000)\n .style(\"fill\", function(d) { return returnColor({ \"data\": d }) });\n \n if (ecumeneToggle) {\n d3.selectAll(\"path[type=ecumene]\")\n .transition()\n .duration(1000)\n .style(\"fill\", function(d) {\n currentArea.forEach(function(area) {\n if (area.properties.PRUID === d.properties.PRUID && area.properties.PRUID !== undefined && (area.properties.HR_UID == undefined && area.properties.CMA == undefined))\n d.data = area.data;\n else if (area.properties.HR_UID === d.properties.HR_UID && area.properties.HR_UID !== undefined)\n d.data = area.data;\n else if (area.properties.CMA === d.properties.CMA && area.properties.CMA !== undefined)\n d.data = area.data;\n });\n return returnColor(d);\n })\n .style(\"stroke\", \"#333333\")\n .style(\"pointer-events\", \"none\");\n }\n else {\n d3.selectAll(\"path[type=area]\")\n .transition()\n .duration(1000)\n .style(\"fill\", function(d) {\n return returnColor(d);\n });\n }\n\n let allAreasArray = Array.from(d3.selectAll(\"path[type=area]\")._groups[0]);\n allAreasArray.unshift({\n __data__: {\n data: canadaObject\n }\n });\n parametersSelectedChange(\n d3.select(\"path[type=area]\").property(\"__data__\"),\n allAreasArray);\n}", "title": "" }, { "docid": "dc2708f0fb5888f2ccc5527e0d597227", "score": "0.5595841", "text": "function drawCross() {\n drawLongLeg(5);\n drawPegs(3);\n}", "title": "" }, { "docid": "bff81e0c7a64864c837d75207e6752d4", "score": "0.5595716", "text": "function setup() {\n\n // Create Title Div\n let title = createDiv(\"The Ring of Fire\");\n title.parent('title');\n\n // Setup canvas1 and connect to \"canvas1\" div\n let canvas1 = createCanvas(displayWidth, 900);\n canvas1.parent('canvas1');\n \n // first, call our map initialization function (look in the html's style tag to set its dimensions)\n setupMap();\n\n // call our function (defined below) that populates the maps with markers based on the table2019 contents\n // addCircles();\n\n // before querying the Tectonic plate/fault data, you need to let it know which map you're using\n Tectonic.useMap(globe);\n \n // Building out bar graphs and variables for November 2019\n var x1 = 25;\n var y1 = 400;\n var y2 = 650;\n var numOfBars = 7;\n var columnGap= 55;\n var barWidth = 40;\n var countryShift = 400;\n var scaleRatio = 0.1;\n var thickness = 1;\n var barArrayCA = [-237, -2537, -2065, -319, -36, 0, 0];\n var barArrayCAPos = [237, 2537, 2065, 319, 36, 0, 0];\n var barArrayAK = [-369, -303, -2227, -583, -129, -5, -0];\n var barArrayAKPos = [369, 303, 2227, 583, 129, 5, 0];\n var barArrayJP = [0, 0, 0, 0, -39, -2, 0];\n var barArrayJPPos = [0, 0, 0, 0, 39, 2, 0];\n var barArrayPH = [0, 0, 0, 0, -51, -14, 3];\n var barArrayPHPos = [0, 0, 0, 0, 51, 14, 3];\n var barArrayIND = [0, 0, 0, 0, -89, -22, 0];\n var barArrayINDPos = [0, 0, 0, 0, 89, 22, 0];\n var barArrayPNG = [0, 0, 0, 0, -22, -5, 0];\n var barArrayPNGPos = [0, 0, 0, 0, 22, 5, 0];\n var magRange = [\"0 - 0.199\", \"0.2 - 0.99\", \"1.00 - 1.99\", \"2.00 - 2.99\", \"3.00 - 4.99\", \"5.00 - 5.99\", \"6 +\"];\n var grades = [0, 0.2, 1, 2, 3, 5, 6];\n var countries = [\"California\", \"Alaska\", \"Japan\", \"Philippines\", \"Indonesia\", \"Papua New Guinea\"];\n \n let getColorQuakes = function(d) {\n return d > 6 ? '#800026' :\n d > 6 ? '#bd0026' :\n d > 5 ? '#e31a1c' :\n d > 3 ? '#fc4e2a' :\n d > 2 ? '#fd8d3c' :\n d > 1 ? '#feb24c' :\n d > 0.2 ? '#fed976' :\n '#fed976' ;\n };\n\n for(i = 0; i < numOfBars; i++){ \n fill(getColorQuakes(grades[i] +1));\n noStroke();\n // Top 3 charts / text represented left to right CA, Alaska, Japan\n //California\n rect(x1 + ((columnGap) * (i)), y1, barWidth, (barArrayCA[i] * scaleRatio));\n //Alaska\n rect(x1 + ((columnGap) * (i)) + countryShift, y1, barWidth, (barArrayAK[i] * scaleRatio));\n //Japan\n rect(x1 + ((columnGap) * (i)) + (countryShift * 2), y1, barWidth, (barArrayJP[i] * scaleRatio));\n textSize(10);\n textFont();\n fill(100);\n // California\n text(magRange[i], x1 + ((columnGap) * (i)), y1+15);\n text(barArrayCAPos[i], x1 + ((columnGap) * (i)) + 10, y1 + (barArrayCA[i] * scaleRatio) - 10);\n textSize(10);\n text(magRange[i], x1 + ((columnGap) * (i)) + countryShift, y1+15);\n // Alaska\n text(barArrayAKPos[i], x1 + ((columnGap) * (i)) + countryShift + 10, y1 + (barArrayAK[i] * scaleRatio) - 10);\n text(magRange[i], x1 + ((columnGap) * (i)) + (countryShift * 2), y1+15);\n // Japan\n text(barArrayJPPos[i], x1 + ((columnGap) * (i)) + (countryShift *2) + 10, y1 + (barArrayJP[i] * scaleRatio) - 10);\n \n \n // Get Color for charts through getColorQuakes function.\n fill(getColorQuakes(grades[i] +1));\n noStroke();\n // Bottom 3 charts represent left to right Philippines, Indonesia, Papua New Guinea\n //Philippines\n rect(x1 + ((columnGap) * (i)), y2, barWidth, (barArrayPH[i] * scaleRatio));\n //Indonesia\n rect(x1 + ((columnGap) * (i)) + countryShift, y2, barWidth, (barArrayIND[i] * scaleRatio));\n // Papua New Guinea\n rect(x1 + ((columnGap) * (i)) + (countryShift * 2), y2, barWidth, (barArrayPNG[i] * scaleRatio));\n textSize(10);\n textFont();\n fill(100);\n // Text for Philippines, Indonesia, Papua New Guinea\n text(magRange[i], x1 + ((columnGap) * (i)), y2+15);\n text(barArrayPHPos[i], x1 + ((columnGap) * (i)) + 10, y2 + (barArrayPH[i] * scaleRatio) - 10);\n text(magRange[i], x1 + ((columnGap) * (i)) + countryShift, y2+15);\n text(barArrayINDPos[i], x1 + ((columnGap) * (i)) + countryShift + 10, y2 + (barArrayIND[i] * scaleRatio) - 10);\n text(magRange[i], x1 + ((columnGap) * (i)) + (countryShift * 2), y2+15);\n text(barArrayPNGPos[i], x1 + ((columnGap) * (i)) + (countryShift *2) + 10, y2 + (barArrayPNG[i] * scaleRatio) - 10);\n }\n\n // Title and summary\n let summaryTitle = createDiv('');\n summaryTitle.parent('canvas1');\n\n\n // Country Labels\n\n //California\n textSize(16);\n textFont('Georgia');\n text(\"CALIFORNIA\", x1 + 125 , y1 -310);\n textSize(10);\n text(\"Magnitude Scale\", x1 , y1 + 30);\n text(\"Number of earthquakes in November, 2019\", x1 + 75, y1 - 290);\n\n //Alaska\n textSize(16);\n textFont('Georgia');\n text(\"ALASKA\", x1 + 520 , y1 -310);\n textSize(10);\n text(\"Magnitude Scale\", x1 + (columnGap * 7) + 10 , y1 + 30);\n text(\"Number of earthquakes in November, 2019\", x1 + 460, y1 -290);\n\n //Japan\n textSize(16);\n textFont('Georgia');\n text(\"JAPAN\", x1 + 930 , y1 -310);\n textSize(10);\n text(\"Magnitude Scale\", x1 + (columnGap * 14) + 25 , y1 + 30);\n text(\"Number of earthquakes in November, 2019\", x1 + 865, y1 -290);\n\n //Philippines\n textSize(16);\n textFont('Georgia');\n text(\"PHILIPPINES\", x1 + 125 , y2 - 140);\n textSize(10);\n text(\"Magnitude Scale\", x1, y2 + 30);\n text(\"Number of earthquakes in November, 2019\", x1 + 90, y2 - 120);\n\n //Indonesia\n textSize(16);\n textFont('Georgia');\n text(\"INDONESIA\", x1 + 500 , y2 -140);\n textSize(10);\n text(\"Magnitude Scale\", x1 + (columnGap *7) + 12, y2 + 30);\n text(\"Number of earthquakes in November, 2019\", x1 + 460, y2 - 120);\n\n //Papua New Guinea\n textSize(16);\n textFont('Georgia');\n text(\"PAPUA NEW GUINEA\", x1 + 885 , y2-140);\n textSize(10);\n text(\"Magnitude Scale\", x1 + (columnGap * 14) + 30, y2 + 30);\n text(\"Number of earthquakes in November, 2019\", x1 + 865, y2 - 120);\n\n //Source References\n textSize(10);\n text(\"Source: USGS https://earthquake.usgs.gov/earthquakes\", x1 + (columnGap * 9)+10, y2 + 130);\n text(\"Source: Smithsonian Institution National Museum of Natural History Global Volcanism Program, https://volcano.si.edu/database/webservices.cfm\", x1 + (columnGap * 9)+10, y2 + 140);\n\n\n \n // set up x, y, rowHeight, and colWidth\n let x = 200;\n let y = 550;\n let rowHeight = 45;\n let colWidth = 40;\n let colWidth2 = 5;\n \n let increment = 40;\n let opacity = 90;\n\n \n\n // create a color scale we can use for assigning colors based on magnitude and volcanic activity\n var magScale = chroma.scale('YlOrRd').mode('lch').domain([0, 10]);\n}", "title": "" }, { "docid": "730f907ade96d5d67bdadce80ffc85a6", "score": "0.5595251", "text": "function draw_Things(){\n\tfor(var y = screenT + Yfact; y < (screenB/magnify) + Yfact; y++){\n\t\tfor(var x = screenL + Xfact; x < (screenR/magnify) + Xfact; x++){\n\t\t\t//if the area in question is not on the map, do nothing\n\t\t\tif(x<0 || y < 0 || x>mymap.length-1 || y > mymap[x].length-1){}\n\t\t\t//otherwise, render visible items\n\t\t\telse{\n\t\t\tvar myStuff = [];\n\t\t\tmyStuff = mymap[x][y].getVisible();\n\t\t\tif(myStuff.length > 0){\n\t\t\t\tfor(var a = 0; a < myStuff.length; a++){\n\t\t\t\tvar myPic = myStuff[a].pic;\n\t\t\t\tmyScreen.drawImage(document.getElementById(myPic.sheet),myPic.getXind()*imageIndex,myPic.getYind()*imageIndex,myPic.xsiz,myPic.ysiz,((x-Xfact)*tileX)+myPic.Xoffset,((y-Yfact)*tileY)+myPic.Yoffset,tileX+1,tileY+1);\n\t\t\t\t}}\n\t\t\t}\n\t\t}}\n\t}", "title": "" }, { "docid": "82c486fdb8b3fc63ff378cc150da07ba", "score": "0.5591647", "text": "function drawSystem(measures, scale, width, ypos) {\n var out = \"\";\n var nmeasures = measures.filter((x) => x.length > 1).length;\n var measureWidth = width / nmeasures;\n for (var i = 0; i < 5; i++) {\n out += '<rect x=\"0\" y=\"' + (i * scale * 2) + '\" width=\"100%\" height=\"1\" fill=\"#000\" />';\n }\n var xpos = 0;\n for (var measure of measures) {\n out += drawMeasure(measure, scale, measure.length > 1 ? measureWidth : 0, xpos, ypos);\n xpos += measure.length > 1 ? measureWidth : 0;\n }\n return out;\n }", "title": "" }, { "docid": "12dd786ee0aeca9e8b33ebe78d3a45dc", "score": "0.5591331", "text": "function drawGround(hFactor, x, y) {\n ground1 = new component( 1280, 100, '#684027',x, y); //w,h,color,x,y\n ground2 = new component( 1280, 20, 'green', x, y);\n\n //Stairs 10 step\n obsground1 = new component( 1180,50, \"#a874b3\",150 , 570); //w, h , color, x,y\n obsground2 = new component(1130, 50,\"#b8639a\", 200 + hFactor, 515);\n obsground3 =new component(1080,50,\"#ba4e5d\",300 + hFactor,460);\n obsground4 = new component( 1080,50, \"#8c434b\",400 + hFactor, 405);\n obsground5 = new component(1080, 50,\"#D5D500\", 500 + hFactor, 350);\n obsground6 =new component(1080,50,\"#94E000\",600 + hFactor,295);\n obsground7 = new component( 1080,50, \"#54AA10\",700 + hFactor, 240);\n obsground8 = new component(1080, 50,\"#67DCE2\", 800 + hFactor, 185);\n obsground9 =new component(1080,50,\"#226EAA\",900 + hFactor,130);\n obsground10 =new component(1080,50,\"#624e99\",1000 + hFactor,75);\n\n\n // 10 food items\n var pineW = 40; var pineH = 50;\n var appleW = 40; var appleH = 50;\n key1 = new keycomponent(appleW,appleH,200,515, apple_img, counts[0]); //w, h, color, x,y \n key2 = new keycomponent(pineW,pineH,310,460, pine_img, counts[1]);\n key3 = new keycomponent(appleW,appleH,400,405, apple_img, counts[2]);\n key4 = new keycomponent(appleW,appleH,500,350, apple_img, counts[3]); //w, h, color, x,y \n key5 = new keycomponent(pineW,pineH,610, 295, pine_img, counts[4]);\n key6 = new keycomponent(pineW,pineH,710,240, pine_img, counts[5]);\n key7 = new keycomponent(appleW,appleH,800,185, apple_img, counts[6]); //w, h, color, x,y \n key8 = new keycomponent(pineW,pineH,910,130, pine_img, counts[7]);\n key9 = new keycomponent(pineW,pineH,1010,75, pine_img, counts[8]);\n key10 = new keycomponent(pineW,pineH,1110,20, pine_img, counts[9]);\n key1.update(); key2.update(); key3.update();\n key4.update(); key5.update(); key6.update();\n key7.update(); key8.update(); key9.update();\n key10.update();\n\n}", "title": "" }, { "docid": "f9a2d0246a03bc12a11a4af124977945", "score": "0.5591206", "text": "function shadowMap() {\n let sYear = document.getElementById(\"dateYear\").value;\n let sMonth = document.getElementById(\"dateMonth\").value;\n let sDay = document.getElementById(\"dateDay\").value;\n let ht = document.getElementById(\"timeHour\").value;\n let mt = document.getElementById(\"timeMin\").value;\n let st = document.getElementById(\"timeSec\").value;\n let sMoment = sYear + \"-\" + sMonth + \"-\" + sDay + \" \" + ht + \":\" + mt + \":\" + st;\n let lat = Utils.grad_textGMS2number(latGrad.value, latMin.value , latSec.value);\n let lon = Utils.grad_textGMS2number(lonGrad.value, lonMin.value , lonSec.value);\n let dUTCval = document.getElementById(\"dUTC\").value;\n let temp = document.getElementById(\"temp\").value;\n let press = document.getElementById(\"press\").value;\n let AoA;\n if( window.varsValue.userObj4shadow) { AoA = window.varsValue.userObj4shadow;}\n else {AoA = objects4shadow;}\n let gap = 4; //Pixels from screen edge to sketch\n\n //Define SCALE 4 drawing here. Finding biggest x,y range from all objects of AoAobj\n var options3 = {\n AoA: AoA,\n };\n var resArr = Utils.defineDrawScale(options3);\n var scale =resArr[0];\n var minx = resArr[1];\n var maxx = resArr[2];\n var miny = resArr[3];\n var maxy = resArr[4];\n\n let options = {\n AoA: AoA, // Array of objects [x,y,zLow,zUp], [x,y,zLow zUp],........\n aMoment: sMoment,\n Latitude: lat,\n Longitude: lon,\n dUTCval: dUTCval,\n Temperature: temp,\n Pressure: press,\n minSunHeight: window.varsValue.minSunHeight\n };\n let shadArr = Utils.calcObjectsShadow3D (options);\n\n let options2 = {\n AoAshadows: shadArr,\n AoAobjects: AoA,\n aMoment: sMoment,\n Latitude: lat,\n Longitude: lon,\n dUTCval: dUTCval,\n Temperature: temp,\n Pressure: press,\n minSunHeight: window.varsValue.minSunHeight,\n scale: scale,\n minx: minx,\n maxx: maxx,\n miny: miny,\n maxy: maxy\n };\n\n clearTimeout(window.varsValue.yearTimeOut) ; //2stop shadowAnimationYear\n clearTimeout(window.varsValue.dayTimeOut) ; //2stop shadowAnimationDay\n Utils.drawShadow(options2 );\n}", "title": "" }, { "docid": "7a7db695aa300485392491a02acea06c", "score": "0.55862504", "text": "function playerMap() {\n\n let mapX = map(playerSprite.xPos, enviorment.xMin, enviorment.xMax - width, miniMap.x + miniMap.playerDot/2, miniMap.xSize + width*0.01 - miniMap.playerDot/2);\n let mapY = map(playerSprite.yPos, enviorment.yMin, enviorment.yMax - height, miniMap.y + miniMap.playerDot/2, miniMap.ySize + height*0.01 - miniMap.playerDot/2);\n let rectW = map(width, enviorment.xMin, enviorment.xMax, miniMap.x, miniMap.xSize);\n let rectH = map(height, enviorment.yMin, enviorment.yMax, miniMap.y, miniMap.ySize);\n\n // player of position\n fill(\"blue\");\n noStroke();\n ellipse(mapX, mapY, miniMap.playerDot);\n\n // rectangle of vision\n noFill();\n stroke(255);\n strokeWeight(2);\n rectMode(CENTER);\n rect(mapX, mapY, rectW, rectH);\n\n // fixing the brakeables\n rectMode(CORNER);\n stroke(0);\n strokeWeight(1);\n}", "title": "" }, { "docid": "722a078a7193b4f53731c8adc592298e", "score": "0.55743253", "text": "function lvlTwoMap()\n{\n target = new Target(20,0xFF0000,100,500,500, 15, 15);\n target.height = 80;\n target.width = 80;\n target.x = 40;\n target.y = 560;\n levelTwoScene.addChild(target);\n\n player = new Player(20,0x00FF00,100,100,300);\n player.x = 20;\n player.y = 20;\n player.radius = 20;\n //gameScene.addChild(player);\n levelTwoScene.addChild(player);\n \n\n border = new Border(2, 300, 0xFFFFFF, 45, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(400, 2, 0xFFFFFF, 0, 520);\n borders.push(border);\n levelTwoScene.addChild(border);\n \n border = new Border(200, 2, 0xFFFFFF, 40, 330);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(400, 2, 0xFFFFFF, 40, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 120, 0xFFFFFF, 40, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(90, 2, 0xFFFFFF, 40, 480);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(90, 2, 0xFFFFFF, 70, 420);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 290, 0xFFFFFF, 80, 40);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 300, 0xFFFFFF, 120, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(100, 2, 0xFFFFFF, 160, 100);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 160, 0xFFFFFF, 160, 140);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 60, 0xFFFFFF, 160, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 60, 0xFFFFFF, 190, 40);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 60, 0xFFFFFF, 220, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(100, 2, 0xFFFFFF, 160, 300);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(100, 2, 0xFFFFFF, 160, 140);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 162, 0xFFFFFF, 260, 140);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 60, 0xFFFFFF, 100, 545);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(300, 2, 0xFFFFFF, 100, 545);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(300, 2, 0xFFFFFF, 130, 570);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 27, 0xFFFFFF, 250, 545);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(100, 2, 0xFFFFFF, 470, 570);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 50, 0xFFFFFF, 430, 522);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 300, 0xFFFFFF, 470, 270);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 200, 0xFFFFFF, 570, 340);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(35, 2, 0xFFFFFF, 570 , 520);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(50, 2, 0xFFFFFF, 472, 500);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(50, 2, 0xFFFFFF, 522, 540);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(50, 2, 0xFFFFFF, 522, 470);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(50, 2, 0xFFFFFF, 472, 430);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(50, 2, 0xFFFFFF, 522, 400);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(50, 2, 0xFFFFFF, 472, 370);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(50, 2, 0xFFFFFF, 522, 340);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(100, 2, 0xFFFFFF, 472, 310);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 100, 0xFFFFFF, 400, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 400, 492);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(70, 2, 0xFFFFFF, 400, 490);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 70, 0xFFFFFF, 190, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 100, 0xFFFFFF, 220, 420);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 110, 0xFFFFFF, 250, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 120, 0xFFFFFF, 280, 400);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 130, 0xFFFFFF, 310, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 130, 0xFFFFFF, 340, 390);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 130, 0xFFFFFF, 370, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 100, 0xFFFFFF, 160, 420);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 60, 0xFFFFFF, 190, 460);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 70, 390);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 100, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 130, 390);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 15, 0xFFFFFF, 160, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 15, 0xFFFFFF, 160, 405);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 60, 0xFFFFFF, 440, 360);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 40, 0xFFFFFF, 440, 450);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 128, 450);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 100, 420);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 70, 450);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 100, 0xFFFFFF, 290, 260);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 230, 0xFFFFFF, 290, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 200, 0xFFFFFF, 320, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 170, 0xFFFFFF, 350, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 140, 0xFFFFFF, 380, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 110, 0xFFFFFF, 410, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 80, 0xFFFFFF, 440, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 50, 0xFFFFFF, 470, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 130, 0xFFFFFF, 320, 230);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 160, 0xFFFFFF, 350, 200);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(200, 2, 0xFFFFFF, 380, 170);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 160, 0xFFFFFF, 380, 200);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 130, 0xFFFFFF, 410, 230);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 60, 0xFFFFFF, 410, 140);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 120, 0xFFFFFF, 440, 110);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 160, 0xFFFFFF, 470, 80);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 100, 0xFFFFFF, 440, 260);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 210, 0xFFFFFF, 500, 60);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 10, 0xFFFFFF, 500, 300);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 210, 0xFFFFFF, 530, 30);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 250, 0xFFFFFF, 560, 60);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 40, 0xFFFFFF, 530, 270);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 500, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 560, 0);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(10, 2, 0xFFFFFF, 590, 80);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(10, 2, 0xFFFFFF, 560, 110);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(10, 2, 0xFFFFFF, 590, 140);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(10, 2, 0xFFFFFF, 590, 200);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(10, 2, 0xFFFFFF, 560, 230);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(10, 2, 0xFFFFFF, 590, 260);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(10, 2, 0xFFFFFF, 560, 290);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(20, 2, 0xFFFFFF, 470, 340);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(20, 2, 0xFFFFFF, 470, 400);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(20, 2, 0xFFFFFF, 470, 470);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(20, 2, 0xFFFFFF, 470, 540);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(20, 2, 0xFFFFFF, 550, 370);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(20, 2, 0xFFFFFF, 550, 430);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(20, 2, 0xFFFFFF, 550, 500);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 72, 0xFFFFFF, 250, 30);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 40, 0xFFFFFF, 230, 100);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(2, 30, 0xFFFFFF, 200, 300);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(30, 2, 0xFFFFFF, 260, 190);\n borders.push(border);\n levelTwoScene.addChild(border);\n\n border = new Border(30, 2, 0xFFFFFF, 260, 280);\n borders.push(border);\n levelTwoScene.addChild(border);\n}", "title": "" }, { "docid": "ad5ee3544d0b24b34fefa27530c339d0", "score": "0.5572686", "text": "function updateScreen() {\n // Transform the player\n player.node.setAttribute(\"transform\", \"translate(\" + player.position.x + \",\" + player.position.y + \")\");\n \n var scale = new Point(zoom, zoom);\n var translate = new Point();\n\n translate.x = SCREEN_SIZE.w / 2- (player.position.x + PLAYER_SIZE.w /2 )* scale.x;\n if (translate.x > 0)\n translate.x = 0;\n else if (translate.x < SCREEN_SIZE.w -SCREEN_SIZE.w * scale.x)\n translate.x = SCREEN_SIZE.w -SCREEN_SIZE.w * scale.x;\n\n translate.y = SCREEN_SIZE.h / 2- (player.position.y + PLAYER_SIZE.h /2 )* scale.y;\n if (translate.y > 0)\n translate.y = 0;\n else if (translate.y < SCREEN_SIZE.h -SCREEN_SIZE.h * scale.y)\n translate.y = SCREEN_SIZE.h -SCREEN_SIZE.h * scale.y;\n\n svgdoc.getElementById(\"gamearea\").setAttribute(\"transform\", \"translate(\"+ translate.x + \",\" + translate.y + \")scale(\" + scale.x + \",\" + scale.y + \")\");\n\n\n if (playerIsMovingLeft){ // those fucking brackets!!! stupid string interpretation!!!!!\n player.node.setAttribute(\"transform\", \"translate(\" + (player.position.x + PLAYER_SIZE.w) + \",\" + player.position.y + \" ) scale(-1, 1)\");\n \n //doesn't work :(\n //svgdoc.getElementById(\"playerName\").setAttribute(\"transform\", \"translate(\" + 20 + \",\" + 0 + \" ) scale(-1, 1)\");\n }\n\n}", "title": "" }, { "docid": "ac9933de8ca7c45c7681ee2bc64c833f", "score": "0.5567693", "text": "function Map_One(){\r\n\tmakeborder('start');\r\n\tmakeland(4,0); // 4 lands\r\n\tmakeland(1,1); // 1 space\r\n\tmakeland(3,0); // 3 lands \r\n\tmakeland(1,1); // 1 space\r\n\tmakeland(2,0); // 2 lands \r\n\tmakeland(2,1); // 2 space\r\n\tmakeland(1,0); // 1 land \r\n\tmakeland(1,1); // 1 space\r\n\tmakeland(1,0); // 1 land\r\n\tmakeland(2,1); // 2 space\r\n\tmakeland(1,0); // 1 land\r\n\tmakeland(4,1); // 4 space\r\n\tmakeland(2,0); // 2 land\r\n\tmakeland(4,1); // 4 space\r\n\tmakeland(1,0); // 1 land\r\n\tmakeland(4,1); // 4 space\r\n\tmakeland(5,0); // 5 land\r\n\tmakeland(5,1); // 5 space\r\n\tmakeland(1,0); // 1 land\r\n\tmakeborder('end');\r\n}", "title": "" }, { "docid": "5252c57cd912a722ab9c6b92f7fc614b", "score": "0.55646956", "text": "display() {\n strokeWeight(1);\n stroke(200);\n fill(200);\n beginShape();\n for (let i = 0; i < this.surface.length; i++) {\n this.v = scaleToPixels(this.surface[i]);\n vertex(this.v.x, this.v.y);\n }\n vertex(width, height);\n vertex(0, height);\n endShape(CLOSE);\n }", "title": "" }, { "docid": "187ab9e2b79f2b1054d8065af03fcc7d", "score": "0.55643713", "text": "function drawMachine(){\n ctx.clearRect(0,0,900,900);\n ctx.drawImage(machineImage,0,0); //draw slot machine\n ctx.drawImage(redLever,829,100, 72,398);//red lever\n ctx.drawImage(blueLever,1,100, 72,398);//blue lever\n ctx.fillText(players[0].getScore().toString(),175,840); //print x score\n ctx.fillText(players[1].getScore().toString(),545,840);//print o score\n}", "title": "" }, { "docid": "9ced12d340ab5923a9a92cd6b17a0c07", "score": "0.5563915", "text": "function brewmap()\r\n {\r\n const main = d3.select('#main');\r\n main.selectAll(\"rect\").remove();\r\n initPumps(pumps);\r\n d3.csv(\"brewery.csv\", (data) => {\r\n var xScale = d3.scaleLinear();\r\n var yScale = d3.scaleLinear();\r\n xScale.domain([0, 15]).range([0, mapWidth]);\r\n\r\n yScale.domain([15, 0]).range([0, mapHeight]);\r\n\r\n var Rect1 = d3.select('#main').select('g').selectAll(\".brewrect\").data(data);\r\n Rect1.enter().append(\"rect\")\r\n .attr(\"width\", 30)\r\n .attr(\"height\",20)\r\n .style(\"fill\",'#808080')\r\n \r\n \r\n \r\n .attr(\"x\", function (d) {\r\n return xScale(d.x);\r\n })\r\n .attr(\"y\", function (d) {\r\n return yScale(d.y);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "8b1a9b5304fd3bd9b56d88e6e446b95c", "score": "0.5557624", "text": "function zoomChangeHandler(evt){\n on(featureLayer, \"graphic-draw\", function (evt) {\n \n for (var i = 0; i < document.getElementsByTagName(\"path\").length; i++) { \n //console.log(document.getElementsByTagName(\"path\")[i])\n var blkPoly = document.getElementsByTagName(\"path\")[i].getAttribute(\"data-FIPS\"); \n var blkColor = document.getElementsByTagName(\"path\")[i].getAttribute(\"data-originbreak\");\n \n for (var j = 0; j < myPolyArray.length; j++){\n if(myPolyArray[j].polyfips == blkPoly){\n //console.log(blkPoly, blkColor, \" yes\")\n document.getElementsByTagName(\"path\")[i].setAttribute(\"data-originbreak\",myPolyArray[j].polyorigin); \n }\n } \n } \n }); \n \n }", "title": "" }, { "docid": "0c2bf06ecb36376544690b456d0ac693", "score": "0.5548749", "text": "function render(){\r\n\tfor(let i = 0 ; i < tile.length;i++){\r\n\t\tlet xPos = i % panjang\r\n\t\t, yPos = floor(i/panjang)\r\n\t\tlet isTile = tile[i]!=0\r\n\t\tif(tile[i]!=0 || freedom[i]!=0){\r\n\t\t\tpush()\r\n\t\t\tfill(getColor(isTile?tile[i]:freedom[i]))\r\n\t\t\tstrokeWeight(0)\r\n\t\t\trect(xPos*ratioBoard,yPos*ratioBoard,ratioBoard,ratioBoard,0)\r\n\t\t\tpop()\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "ea5ec42929427ec700d885757e3d96bb", "score": "0.5547644", "text": "draw_luke() {\n this.fg_context.save();\n let base_image = new Image();\n base_image.src = 'http://i.imgur.com/PGSwOSh.png';\n let end_time = this.end_time();\n\n let x = this.timestamp_to_screen_space(end_time);\n let val = this.value_at_time(end_time);\n let y = this.value_to_screen_space(val ? val : 0, this.display_range, 0);\n this.fg_context.translate(x, y);\n this.fg_context.rotate(2*Math.sin(Date.now()/500)*Math.PI);\n let scale_val = ((-Date.now() % 500) / 500) + 2;\n this.fg_context.scale(scale_val, scale_val);\n this.fg_context.drawImage(base_image, -50, -50, 100, 100);\n this.fg_context.restore();\n }", "title": "" }, { "docid": "8a553bd774c46f9d3ff87a63f2312424", "score": "0.55458283", "text": "function draw() {\n\t//load the map\n\t//this custom svg has an overlay of a separate on top to allow for hatches over heatmap\n d3.xml(\"data/custom.svg\", \"image/svg+xml\", function(xml) {\n document.getElementById('vis').appendChild(xml.documentElement);\n\n //loop through all the legislators in our raw data\n for (var i = 0; i < rawLegislatorData.length; i++) {\n\t\t\t//in our legislatorData, use bill_id as the key\n legislatorData[rawLegislatorData[i].bioguide_id] = {\n bioguide_id: rawLegislatorData[i].bioguide_id,\n\t\t\t\tfirstname: rawLegislatorData[i].firstname,\n\t\t\t\tlastname: rawLegislatorData[i].lastname,\n\t\t\t\tgender: rawLegislatorData[i].gender,\n\t\t\t\tlastname: rawLegislatorData[i].lastname,\n\t\t\t\tstate: rawLegislatorData[i].state,\n\t\t\t\ttitle: rawLegislatorData[i].title,\n\t\t\t\twebsite: rawLegislatorData[i].website\n\t\t\t\t//TODO: NEED TO ADD BILLS\n };\n\t\t\t\n\t\t\t//init our state data\n\t\t\tstateData[rawLegislatorData[i].state] = {\n\t\t\t\tname: rawLegislatorData[i].state,\n\t\t\t\trepresentativeCount: 0,\n\t\t\t\tsenatorCount: 0\n\t\t\t}\n }\n\t\t\n\t\t//loop through our legislator data to finalize our state data\n\t\tfor (var legislator in legislatorData) {\n\t\t\tif (legislatorData[legislator].title === \"Rep\") \n\t\t\t\tstateData[legislatorData[legislator].state].representativeCount++;\n\t\t\telse if (legislatorData[legislator].title === \"Sen\") \n\t\t\t\tstateData[legislatorData[legislator].state].senatorCount++;\n }\n \n for (var state in stateData) {\n\t\t\n\t\t\t//encode the total number of legislators with the color red of each state\n\t\t\tvar totalLegis = stateData[state].representativeCount + stateData[state].senatorCount;\n d3.selectAll('#' + stateData[state].name)\n .attr('fill', function() {\n return (\"rgb(\" + totalLegis * 4 + \",0,0)\");\n })\n .attr('stroke-width', function() {\n return (1);\n });\n\t\t\t\t\n\t\t\t//for now, remove the overlay\n\t\t\td3.selectAll('#overlay_' + stateData[state].name).remove();\n \n\t\t\t//label each state with the abv\n var statePath = document.getElementById(stateData[state].name)\n if (statePath != null) {\n var stateBBox = statePath.getBBox()\n\n var svgMap = document.getElementsByTagName('svg')[0];\n \n var newElement = document.createElementNS(\"http://www.w3.org/2000/svg\", 'text'); //Create a path in SVG's namespace\n newElement.setAttribute(\"y\", stateBBox.y + stateBBox.height/2); \n newElement.setAttribute(\"x\", stateBBox.x + stateBBox.width/2); \n newElement.setAttribute(\"fill\", \"white\"); \n newElement.textContent = stateData[state].name;\n svgMap.appendChild(newElement);\n }\n }\n });\n}", "title": "" }, { "docid": "7fdbe83934d536892fa7edacc6167d39", "score": "0.5540692", "text": "function ShipShieldPointy(game,thickness,color)\n{\n var shield = game.add.graphics(0,0);\n var poly;\n\n shield.renderable = false;\n\n step = 1/thickness;\n\n for(i=0, alpha=1;i < thickness; i++, alpha = alpha - step) {\n\tshield.lineStyle(1,color,alpha);\n\tpoly = new Phaser.Polygon(ShipA.x,ShipA.y-i,\n\t\t\t\t ShipB.x+i,ShipB.y,\n\t\t\t\t ShipC.x,ShipC.y+i,\n\t\t\t\t ShipD.x-i,ShipD.y,\n\t\t\t\t ShipA.x,ShipA.y-i);\n\tshield.drawPolygon(poly.points);\n }\n\n return(shield);\n}", "title": "" }, { "docid": "2627b54a15b50e6ea3171e9bcfc59f12", "score": "0.55405027", "text": "function whmap()\r\n {\r\n const main = d3.select('#main');\r\n main.selectAll(\"rect\").remove();\r\n initPumps(pumps);\r\n d3.csv(\"workhouse.csv\", (data) => {\r\n var xScale = d3.scaleLinear();\r\n var yScale = d3.scaleLinear();\r\n xScale.domain([0, 15]).range([0, mapWidth]);\r\n\r\n yScale.domain([15, 0]).range([0, mapHeight]);\r\n\r\n var Rect1 = d3.select('#main').select('g').selectAll(\".whouserect\").data(data);\r\n Rect1.enter().append(\"rect\")\r\n .attr(\"width\", 30)\r\n .attr(\"height\",20)\r\n .style(\"fill\",'#8FBC8F')\r\n \r\n \r\n \r\n .attr(\"x\", function (d) {\r\n return xScale(d.x);\r\n })\r\n .attr(\"y\", function (d) {\r\n return yScale(d.y);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "da6eedc2d2fa876573dc175488acc1f5", "score": "0.5540294", "text": "function draw_mountain(posx, posy, angle_left, angle_right, angle_ridge, height, max_height, sun_dir, distance, local_ctx){\n local_ctx.strokeStyle = \"#000000\";\n local_ctx.fillStyle = \"#DFDFDF\";\n\n //multiplication to simulate crude gaussian\n var random_col_variation = (Math.random()*2-1)*(Math.random()*2-1);\n\n //the nearer the mountain is, the bigger the distortion\n var distortion_factor = 4+Math.pow(1-distance, 6)*20;\n\n var grass_red = Math.floor(24+8*random_col_variation)\n var grass_green = Math.floor(140+36*random_col_variation)\n var grass_blue = Math.floor(40+8*random_col_variation)\n\n var snow_height = height-110+30*Math.random();\n snow_height = (snow_height<0)?0:snow_height\n\n //gives variety, snow can be a bit gray\n var snow_colour = 0xD0 + Math.random()*0x2F;\n\n var left_middle_angle = (angle_left+angle_ridge)/2\n\n //substract 90deg to the angle between left side and the ridge to get a normal vector\n var left_side_normal_angle = left_middle_angle-Math.PI/2;\n var left_side_normal_vector = [Math.cos(left_side_normal_angle), Math.sin(left_side_normal_angle)];\n var light_strength_left = sun_dir[0]*left_side_normal_vector[0]+sun_dir[1]*left_side_normal_vector[1];\n if(light_strength_left < 0.3){\n light_strength_left = 0.3; //dont make it completely dark in case it is hidden ==> simulates ambiant light\n }\n var height_ratio = height/150;\n height_ratio = (height_ratio>1)?1:height_ratio;\n light_strength_left = height_ratio*light_strength_left+(1-height_ratio)*0.5;\n\n //var col_left = 0x010101*Math.floor(light_strength_left*0xFF);\n var rgb = [Math.floor(grass_blue*light_strength_left), Math.floor(grass_green*light_strength_left), Math.floor(grass_red*light_strength_left)]\n var col_left = rgb[0]+(rgb[1]<<8)+(rgb[2]<<16)\n var col = '#' + (col_left&0xffffff).toString(16).padStart(6, 0)\n local_ctx.fillStyle = col;\n local_ctx.strokeStyle = local_ctx.fillStyle;\n\n local_ctx.beginPath();\n local_ctx.moveTo(posx, posy);\n var p1 = [posx+Math.tan(angle_left)*height, posy+height];\n distorted_lineto([posx, posy], p1, distortion_factor, local_ctx);\n var p2 = [posx+Math.tan(angle_ridge)*height, posy+height];\n distorted_lineto(p1, p2, distortion_factor, local_ctx);\n distorted_lineto(p2, [posx, posy], distortion_factor, local_ctx);\n local_ctx.fill();\n\n var right_middle_angle = (angle_ridge+angle_right)/2\n\n //substract 90deg to the angle between left side and the ridge to get a normal vector\n var right_side_normal_angle = right_middle_angle-Math.PI/2;\n var right_side_normal_vector = [Math.cos(right_side_normal_angle), Math.sin(right_side_normal_angle)];\n var light_strength_right = sun_dir[0]*right_side_normal_vector[0]+sun_dir[1]*right_side_normal_vector[1];\n if(light_strength_right < 0.3){\n light_strength_right = 0.3; //dont make it completely dark in case it is hidden ==> simulates ambiant light\n }\n\n var height_ratio = height/150;\n height_ratio = (height_ratio>1)?1:height_ratio;\n light_strength_right = height_ratio*light_strength_right+(1-height_ratio)*0.5;\n var rgb = [Math.floor(grass_blue*light_strength_right), Math.floor(grass_green*light_strength_right), Math.floor(grass_red*light_strength_right)]\n\n var col_left = rgb[0]+(rgb[1]<<8)+(rgb[2]<<16)\n var col = '#' + (col_left&0xffffff).toString(16).padStart(6, 0)\n local_ctx.fillStyle = col;\n local_ctx.strokeStyle = local_ctx.fillStyle;\n\n local_ctx.beginPath();\n local_ctx.moveTo(posx, posy);\n var p1 = [posx+Math.tan(angle_ridge)*height, posy+height];\n distorted_lineto([posx, posy], p1, distortion_factor, local_ctx);\n var p2 = [posx+Math.tan(angle_right)*height, posy+height];\n distorted_lineto(p1, p2, distortion_factor, local_ctx);\n distorted_lineto(p2, [posx, posy], distortion_factor, local_ctx);\n local_ctx.fill();\n\n local_ctx.fillStyle = 'rgba(0,0,0,0)'; //maxe context transparent (create a layer)\n local_ctx.clearRect(0,0,size_canvas[0], posy+snow_height);\n\n //////////snowtop left\n var red = Math.floor(snow_colour*light_strength_left)\n var green = Math.floor(snow_colour*light_strength_left)\n var blue = Math.floor(snow_colour*light_strength_left)\n var col_left = blue+(green<<8)+(red<<16)\n var col = '#' + (col_left&0xffffff).toString(16).padStart(6, 0)\n local_ctx.fillStyle = col;\n local_ctx.strokeStyle = local_ctx.fillStyle;\n\n local_ctx.beginPath();\n local_ctx.moveTo(posx, posy);\n // local_ctx.lineTo(posx+Math.tan(angle_left)*snow_height, posy+snow_height);\n // local_ctx.lineTo(posx+Math.tan(angle_ridge)*snow_height, posy+snow_height);\n var p1 = [posx+Math.tan(angle_left)*snow_height, posy+snow_height];\n distorted_lineto([posx, posy], p1, distortion_factor, local_ctx);\n var p2 = [posx+Math.tan(angle_ridge)*snow_height, posy+snow_height];\n distorted_lineto(p1, p2, distortion_factor, local_ctx);\n distorted_lineto(p2, [posx, posy], distortion_factor, local_ctx);\n local_ctx.fill();\n\n //////////snowtop right\n\n var red = Math.floor(snow_colour*light_strength_right)\n var green = Math.floor(snow_colour*light_strength_right)\n var blue = Math.floor(snow_colour*light_strength_right)\n var col_left = blue+(green<<8)+(red<<16)\n var col = '#' + (col_left&0xffffff).toString(16).padStart(6, 0)\n local_ctx.fillStyle = col;\n local_ctx.strokeStyle = local_ctx.fillStyle;\n\n local_ctx.beginPath();\n local_ctx.moveTo(posx, posy);\n // local_ctx.lineTo(posx+Math.tan(angle_ridge)*snow_height, posy+snow_height);\n // local_ctx.lineTo(posx+Math.tan(angle_right)*snow_height, posy+snow_height);\n var p1 = [posx+Math.tan(angle_ridge)*snow_height, posy+snow_height];\n distorted_lineto([posx, posy], p1, distortion_factor, local_ctx);\n var p2 = [posx+Math.tan(angle_right)*snow_height, posy+snow_height];\n distorted_lineto(p1, p2, distortion_factor, local_ctx);\n distorted_lineto(p2, [posx, posy], distortion_factor, local_ctx);\n local_ctx.fill();\n}", "title": "" }, { "docid": "52e75ecf2542ee7633b1b5915ef053a7", "score": "0.553154", "text": "function processData(map, baseLayers, overlays, data) { \n //reset the data arrays\n var dataArrays = {\n \"Methane\": [],\n \"Carbon Dioxide\": [],\n \"CO\": [],\n \"Water Vapour\": [],\n \"Temperature\": [],\n \"Pressure\": []\n };\n \n// // reset the base layers\n// for (var key in baseLayers) {\n// baseLayers[key].clearLayers();\n// }\n// \n// // reset the wind overlay\n// overlays[\"Wind\"].clearLayers();\n\n // Set get the data arrays for the next points to be plotted \n var dataArrays = getDataArray(data, dataArrays, baseLayers);\n\n // Check that all required parameters exist\n if (map && baseLayers && overlays && data) { \n // Add the legend if it is undefined and wipe its contents\n if (legend === undefined){\n legend.addTo(map);\n }\n div.innerHTML=\"\";\n\n\n // Make function to change legend when baselayer is changed\n map.on({ \n baselayerchange: function(e) {\n for (var key in baseLayers) {\n if (e.name === key) {\n div.innerHTML=\"\"\n legend.update(dataArrays[key], key, baseLayers)\n }\n }\n }\n });\n\n // Update the legend\n legend.update(dataArrays[\"Methane\"], \"Methane\", baseLayers)\n\n var dataRows = data.replace(/\\s/g, '').split(\";\");\n var startingIndex = 0;\n// if (dataRows.length > (pltNum + 1) ) { \n// startingIndex = dataRows.length - (pltNum + 1); \n// } \n// else if (dataRows.length < (pltNum + 1)) { \n// for (var key in baseLayers) {\n// if (baseLayers.hasOwnProperty(key)) {\n// // If there are fewer data rows than points we want to plot, \n// // remove the last pltNum number of points, if they exist.\n//\n// for (i = dataRows.length - 1; i < pltNum; i++) {\n// if (baseLayers[key][i] && baseLayers[key][i] instanceof L.CircleMarker) { \n// map.removeLayer(baseLayers[key][i]);\n// baseLayers[key][i - startingIndex].removeLayer(L.CircleMarker)\n// console.log(\n// }\n// if (overlays[\"Wind\"][i] && overlays[\"Wind\"][i] instanceof L.Marker) {\n// map.removeLayer(overlays[\"Wind\"][i]);\n// baseLayers[\"Wind\"][i - startingIndex].removeLayer(L.CircleMarker)\n// }\n// }\n// }\n// } \n// } \n\n for (var i = startingIndex, l = dataRows.length - 1; i < l; i++) {\n // Remove all pre-existing markers and replace with updated markers\n try {\n// for (var key in baseLayers) {\n// if (baseLayers.hasOwnProperty(key)) {\n// if (baseLayers[key][i - startingIndex] && baseLayers[key][i - startingIndex] instanceof L.CircleMarker) {\n//// map.removeLayer(baseLayers[key][i - startingIndex]);\n// baseLayers[key][i - startingIndex].removeLayer(L.CircleMarker)\n// console.log(key, baseLayers[key])\n// }\n// }\n// }\n// if (overlays[\"Wind\"][i - startingIndex] && overlays[\"Wind\"][i - startingIndex] instanceof L.Marker) {\n//// map.removeLayer(overlays[\"Wind\"][i - startingIndex]);\n// baseLayers[key][i - startingIndex].removeLayer(L.Marker)\n// }\n \n var dataComponents = dataRows[i].split(\",\"); // Break up line i in datasource by commas, \n var dataDict = {\n \"timeStamp\": dataComponents[0], // call this the variable 'dataComponents'.\n \"latitude\": dataComponents[1], // We set a variable for each parameter in datasource.txt.\n \"longitude\": dataComponents[2],\n \"Temperature\": dataComponents[4],\n \"windDirection\": dataComponents[5],\n \"windSpeed\": dataComponents[6], //Speed in m/s\n \"Pressure\": dataComponents[7],\n \"avgTime\": dataComponents[14],\n \"Methane\": dataComponents[10],\n \"Water Vapour\": dataComponents[13],\n \"Carbon Dioxide\": dataComponents[11],\n \"CO\": dataComponents[12],\n };\n\n if (checkifNaN(dataDict[\"windDirection\"]) != \"Unknown\" || checkifNaN(dataDict[\"windSpeed\"]) != \"Unknown\") { \n var arrow_icon = L.icon({\n iconUrl: 'https://cdn1.iconfinder.com/data/icons/simple-arrow/512/arrow_24-128.png',\n iconSize: [50, scaleLength(dataDict[\"windSpeed\"])], // size of the icon [width,length]\n iconAnchor: [25, scaleLength(dataDict[\"windSpeed\"])], // Location on the icon which corresponts to it's actual position (pixels in x-y coordinates from top left)\n });\n\n var arrowMarker = new L.marker([dataDict[\"latitude\"], dataDict[\"longitude\"]], {\n icon: arrow_icon,\n rotationAngle: parseFloat(dataDict[\"windDirection\"]) + 180\n });\n }\n\n for (var key in baseLayers) {\n // Create a marker positioned and colored corresponding to the data passed from datasource.txt\n if (dataDict[\"latitude\"] != \"nan\" && dataDict[\"latitude\"] != \"nan\") {\n var circleMarker = new L.circleMarker([ dataDict[\"latitude\"], dataDict[\"longitude\"] ], { \n color: getColor(dataDict[key], key, dataArrays[key], baseLayers), \n radius: 5,\n opacity: 0.9,\n fillOpacity: 0.9\n }).bindPopup(\n \"<p>Time (UTC): \" + dataDict[\"timeStamp\"].substring(0, 10) + \" \" + dataDict[\"timeStamp\"].substring(10, 18) + \"</p>\"\n + \"<p>Temperature: \" + dataDict[\"Temperature\"] + \" \" + txto.sup() + \"C</p>\"\n + \"<p>Wind Direction: \" + checkifNaN(round(dataDict[\"windDirection\"], 2)) + \" \" + txto.sup() + \"</p>\"\n + \"<p>Wind Speed: \" + checkifNaN(round(dataDict[\"windSpeed\"], 2)) + \" m/s</p>\"\n + \"<p>Pressure: \" + dataDict[\"Pressure\"] + \" hPa</p>\"\n + \"<p>Methane: \" + checkifNaN(round(dataDict[\"Methane\"], 2)) + \" ppm</p>\" \n + \"<p>Water: \" + checkifNaN(round(dataDict[\"Water Vapour\"], 2)) + \" ppm</p>\"\n + \"<p>CO: \" + checkifNaN(round(dataDict[\"CO\"], 2)) + \" ppm</p>\"\n + \"<p>Carbon Dioxide: \" + checkifNaN(round(dataDict[\"Carbon Dioxide\"], 2)) + \" ppm</p>\"); // Add a popup tag which will show if someone clicks on the dot.\n baseLayers[key][i - startingIndex] = baseLayers[key]\n .addLayer(circleMarker)\n }\n };\n \n overlays[\"Wind\"][i - startingIndex] = overlays[\"Wind\"]\n .addLayer(arrowMarker)\n \n // try condition ends here\n } catch(err) {\n }\n\n // for loop ends here\n }\n \n \n // Centre the view on the points (only first time)\n if (j === 1) {\n // Add the baseLayers and overlays control to the map (first time only)\n L.control.layers(baseLayers, overlays).addTo(map);\n var bounds = L.latLngBounds(getBounds(data));\n if (bounds) {\n map.fitBounds(bounds,{paddingTopLeft: [20, 0], paddingBottomRight: [0, 20], maxZoom: 20});\n }\n }\n \n j = j + 1;\n }\n}", "title": "" }, { "docid": "ee6cc5e7859dfc4d7c299ee70ff428a8", "score": "0.55309844", "text": "function changeScale(delta,xx,yy,method=1) {\n\n\t// method = 3/2 - Zoom wrt center of screen\n\t// method = 1 - Zoom wrt position of mouse\n\t// Otherwise zoom wrt to selected object\n\n if(method==3){\n xx =(width/2 - globalScope.ox) / globalScope.scale\n yy = (height/2 - globalScope.oy) / globalScope.scale\n }\n else if(xx===undefined||yy===undefined||xx=='zoomButton'||yy=='zoomButton'){\n if (simulationArea.lastSelected && simulationArea.lastSelected.objectType!=\"Wire\") { // selected object\n xx = simulationArea.lastSelected.x;\n yy = simulationArea.lastSelected.y;\n } else { //mouse location\n if(method==1){\n xx = simulationArea.mouseX;\n yy = simulationArea.mouseY;\n }\n else if(method==2){\n xx =(width/2 - globalScope.ox) / globalScope.scale\n yy = (height/2 - globalScope.oy) / globalScope.scale\n }\n }\n }\n\n\n var oldScale = globalScope.scale;\n globalScope.scale = Math.max(0.5,Math.min(4*DPR,globalScope.scale+delta));\n globalScope.scale = Math.round(globalScope.scale * 10) / 10;\n globalScope.ox -= Math.round(xx * (globalScope.scale - oldScale)); // Shift accordingly, so that we zoom wrt to the selected point\n globalScope.oy -= Math.round(yy * (globalScope.scale - oldScale));\n // dots(true,false);\n\n\n\t// MiniMap\n if(!embed && !lightMode){\n findDimensions(globalScope);\n miniMapArea.setup();\n $('#miniMap').show();\n lastMiniMapShown = new Date().getTime();\n $('#miniMap').show();\n setTimeout(removeMiniMap,2000);\n }\n\n\n}", "title": "" }, { "docid": "c764c45728bcbd149b4f8f9544e7b5ad", "score": "0.5528898", "text": "function drawMap(worldpopulation) {\n\n var series = [];\n d3.json(\"worldpopulation.json\", function(error, data) {\n if (error) throw (error);\n data.forEach(function(d) {\n // change strings into real numbers\n d.tweeduizendvijftien = +d.tweeduizendvijftien;\n d.sixty = +d.sixty;\n // create new array with prefered format\n series.push([d.CountryCode, d.tweeduizendvijftien, d.sixty]);\n });\n\n var datasetMap = {};\n // determine min and max value in dataset based on obj[1] (2015)\n // devide values by 25 to create less space in color-range\n var onlyValues = series.map(function(obj) {\n return obj[1] / 25;\n });\n var minValue = Math.min.apply(null, onlyValues),\n maxValue = Math.max.apply(null, onlyValues);\n\n // create min-max color palette based on two colors \n var paletteScale = d3.scale.linear()\n .domain([minValue, maxValue])\n .range([\"#fee0d2\", \"#de2d26\"]);\n\n // create new dataset with fillcolors included\n series.forEach(function(item) {\n var iso = item[0],\n currentPop = item[1];\n sixtyPop = item[2];\n datasetMap[iso] = {\n Population: currentPop,\n fillColor: paletteScale(currentPop),\n sixtyPopulation: sixtyPop\n };\n });\n\n // draw map\n new Datamap({\n element: document.getElementById('container'),\n projection: 'mercator',\n fills: {\n defaultFill: '#F5F5F5'\n },\n data: datasetMap,\n history: series,\n geographyConfig: {\n borderColor: '#DEDEDE',\n highlightBorderWidth: 2,\n // don't change color on mouse hover\n highlightFillColor: function(geo) {\n return geo['fillColor'] || '#F5F5F5';\n },\n // change border color on mouseover\n highlightBorderColor: '#B7B7B7',\n // show info tooltip\n popupTemplate: function(geo, data) {\n // if country not present in dataset\n if (!data) {\n return ['<div class=\"hoverinfo\">',\n 'No data available for this region',\n '</div>'\n ].join('');\n }\n // tooltip info 1960 and 2015\n return ['<div class=\"hoverinfo\">',\n '<strong>', geo.properties.name, '</strong>',\n '<br>Population in 1960: <strong>', data.sixtyPopulation / 1000000, '</strong>', ' Milion',\n '</div>'\n ].join('');\n }\n },\n done: function(datamap) {\n datamap.svg.selectAll('.datamaps-subunit').on('click', function(countrySelection) {\n // SEND COUNTRYNAME TO BARCHART data\n console.log(countrySelection.properties.name);\n callBack(countrySelection.properties.name);\n });\n },\n });\n\n // create legendbar:\n // based on code from https://www.visualcinnamon.com/2016/05/smooth-color-legend-d3-svg-gradient.html\n // create new svg element in body\n var svg = d3.select(\"#legend\").append(\"svg\")\n .attr(\"width\", 1000)\n .attr(\"height\", 30)\n //Append a defs (for definition) element to SVG\n var defs = svg.append(\"defs\");\n //Append a linearGradient element to the defs and give it a unique id\n var linearGradient = defs.append(\"linearGradient\")\n .attr(\"id\", \"linear-gradient\");\n //Horizontal gradient\n linearGradient\n .attr(\"x1\", \"0%\")\n .attr(\"y1\", \"0%\")\n .attr(\"x2\", \"100%\")\n .attr(\"y2\", \"0%\");\n //A color scale for 3 colors\n var colorScale = d3.scale.linear()\n .range([\"#fee0d2\", \"#de2d26\", \"(#de2d26*25)\"]);\n //Append color gradient\n linearGradient.selectAll(\"stop\")\n .data(colorScale.range())\n .enter().append(\"stop\")\n .attr(\"offset\", function(d, i) {\n return i / (colorScale.range().length - 1);\n })\n .attr(\"stop-color\", function(d) {\n return d;\n });\n //Draw the rectangle and fill with gradient\n svg.append(\"rect\")\n .attr(\"width\", 800)\n .attr(\"height\", 20)\n .style(\"fill\", \"url(#linear-gradient)\");\n svg.append('text')\n .attr(\"class\", \"legend\")\n .text('< 1 milion')\n .style(\"text-anchor\", \"start\")\n .attr('x', 2)\n .attr('y', 15)\n .attr('fill', 'black')\n svg.append('text')\n .attr(\"class\", \"legend\")\n .text('1,3 Bilion')\n .style(\"text-anchor\", \"end\")\n .attr('x', 798)\n .attr('y', 15)\n .attr('fill', 'white')\n\n });\n }", "title": "" }, { "docid": "8c25432417bae01b4438fd0a8ca57830", "score": "0.55275846", "text": "function drawMountains() {\n\t//mountains\n\tfor (var k = 0; k < mountains.length; k++) {\n\t\tstroke(0);\n\t\tfill(255);\n\t\ttriangle(mountains[k].x_pos + 30, mountains[k].y_pos + 25, mountains[k].x_pos + 123, mountains[k].y_pos - 135, mountains[k].x_pos + 189, mountains[k].y_pos + 25);\n\n\t\tfill(165, 242, 243);\n\t\ttriangle(mountains[k].x_pos + 30, mountains[k].y_pos + 12, mountains[k].x_pos + 100, mountains[k].y_pos - 95, mountains[k].x_pos + 150, mountains[k].y_pos + 12);\n\t\ttriangle(mountains[k].x_pos + 65, mountains[k].y_pos + 12, mountains[k].x_pos + 115, mountains[k].y_pos - 95, mountains[k].x_pos + 200, mountains[k].y_pos + 12);\n\t\ttriangle(mountains[k].x_pos + 95, mountains[k].y_pos + 12, mountains[k].x_pos + 140, mountains[k].y_pos - 95, mountains[k].x_pos + 220, mountains[k].y_pos + 12);\n\n\t\tfill(220, 220, 220);\n\t\ttriangle(mountains[k].x_pos + 15, mountains[k].y_pos + 22, mountains[k].x_pos + 75, mountains[k].y_pos - 55, mountains[k].x_pos + 100, mountains[k].y_pos + 22);\n\t\ttriangle(mountains[k].x_pos + 45, mountains[k].y_pos + 22, mountains[k].x_pos + 90, mountains[k].y_pos - 55, mountains[k].x_pos + 150, mountains[k].y_pos + 22);\n\t\ttriangle(mountains[k].x_pos + 75, mountains[k].y_pos + 22, mountains[k].x_pos + 115, mountains[k].y_pos - 55, mountains[k].x_pos + 200, mountains[k].y_pos + 22);\n\t\ttriangle(mountains[k].x_pos + 105, mountains[k].y_pos + 22, mountains[k].x_pos + 140, mountains[k].y_pos - 55, mountains[k].x_pos + 210, mountains[k].y_pos + 22);\n\t\ttriangle(mountains[k].x_pos + 125, mountains[k].y_pos + 22, mountains[k].x_pos + 170, mountains[k].y_pos - 55, mountains[k].x_pos + 235, mountains[k].y_pos + 22);\n\n\t\tfill(200, 200, 200)\n\t\ttriangle(mountains[k].x_pos, mountains[k].y_pos + 32, mountains[k].x_pos + 48, mountains[k].y_pos - 20, mountains[k].x_pos + 100, mountains[k].y_pos + 32);\n\t\ttriangle(mountains[k].x_pos + 30, mountains[k].y_pos + 32, mountains[k].x_pos + 80, mountains[k].y_pos - 20, mountains[k].x_pos + 130, mountains[k].y_pos + 32);\n\t\ttriangle(mountains[k].x_pos + 60, mountains[k].y_pos + 32, mountains[k].x_pos + 110, mountains[k].y_pos - 20, mountains[k].x_pos + 160, mountains[k].y_pos + 32);\n\t\ttriangle(mountains[k].x_pos + 90, mountains[k].y_pos + 32, mountains[k].x_pos + 140, mountains[k].y_pos - 20, mountains[k].x_pos + 190, mountains[k].y_pos + 32);\n\t\ttriangle(mountains[k].x_pos + 120, mountains[k].y_pos + 32, mountains[k].x_pos + 170, mountains[k].y_pos - 20, mountains[k].x_pos + 220, mountains[k].y_pos + 32);\n\t\ttriangle(mountains[k].x_pos + 150, mountains[k].y_pos + 32, mountains[k].x_pos + 200, mountains[k].y_pos - 20, mountains[k].x_pos + 250, mountains[k].y_pos + 32);\n\t}\n\n}", "title": "" }, { "docid": "14c5ab6a6bbb2614e221a069a586ad38", "score": "0.5527567", "text": "makeLine(){\n for(var i = 0; i < squares.length; i++){\n if(this.loc.dist(squares[i].loc) < 75){\n stroke(255,255,255);\n line(this.loc.x, this.loc.y, squares[i].loc.x + 5, squares[i].loc.y + 5);\n noStroke();\n }\n if(this.loc.dist(balls[i].loc) < 75){\n stroke(255,255,255);\n line(this.loc.x, this.loc.y, balls[i].loc.x + 5, balls[i].loc.y + 5);\n noStroke();\n }\n }\n}", "title": "" }, { "docid": "7adf7ee565be63d5aa39f3f0827da004", "score": "0.55224687", "text": "function initMap() {\r\n\r\n // create new map centered in Troy, NY\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: {lat: 42.734852, lng: -73.791304},\r\n zoom: 15,\r\n mapTypeId: google.maps.MapTypeId.SATELLITE\r\n });\r\n // place a marker at overpass\r\n var deleted1= new google.maps.LatLng(42.727218, -73.799254);\r\n var deleted2= new google.maps.LatLng(42.728664, -73.796741);\r\n var deleted3= new google.maps.LatLng(42.730674, -73.792064);\r\n var deleted4= new google.maps.LatLng(42.732462, -73.791210); \r\n var deleted5= new google.maps.LatLng(42.737158, -73.785668); \r\n var deleted6= new google.maps.LatLng(42.732008, -73.793095); \r\n var deleted7= new google.maps.LatLng(42.731894, -73.792561); \r\n var deleted8= new google.maps.LatLng(42.731925, -73.792209); \r\n var deleted9= new google.maps.LatLng(42.732059, -73.791745); \r\n var deleted10= new google.maps.LatLng(42.732462, -73.791210); \r\n var deleted11= new google.maps.LatLng(42.735932, -73.787230); \r\n var deleted12= new google.maps.LatLng(42.736241, -73.786525); \r\n var deleted13= new google.maps.LatLng(42.736573, -73.785654); \r\n var deleted14= new google.maps.LatLng(42.737088, -73.785026); \r\n var ramp1= new google.maps.LatLng(42.737158, -73.785668);\r\n var ramp2= new google.maps.LatLng(42.736130, -73.785830);\r\n\r\n var legendImage = \"Legend.png\";\r\n var legendLocation= new google.maps.LatLng(42.724995, -73.769896);\r\n\r\n\r\n var bridge1 = new google.maps.Marker({\r\n position: {lat: 42.725565, lng: -73.802443},\r\n map: map\r\n });\r\n // place a marker at Underpass1\r\n var Underpass1 = new google.maps.Marker({\r\n position: {lat: 42.728245, lng: -73.796006},\r\n map: map\r\n });\r\n // place a marker at Underpass2\r\n var Underpass2 = new google.maps.Marker({\r\n position: {lat: 42.738427, lng: -73.783303},\r\n map: map\r\n });\r\n\r\n\r\n var legend = new google.maps.Marker({\r\n position: legendLocation, \r\n map: map,\r\n icon: legendImage\r\n\r\n });\r\n\r\n var erase1= new google.maps.Polyline({\r\n path:[deleted1, deleted2],\r\n strokeColor: \"#ff0000\",\r\n strokeOpacity: 1.0,\r\n strokeWeight: 5\r\n });\r\n\r\n var erase2= new google.maps.Polyline({\r\n path:[deleted3, deleted4, deleted5],\r\n strokeColor: \"#ff0000\",\r\n strokeOpacity: 1.1,\r\n strokeWeight: 5\r\n });\r\n\r\n var erase3= new google.maps.Polyline({\r\n path:[deleted6, deleted7, deleted8, deleted9, deleted10],\r\n strokeColor: \"#ff0000\",\r\n strokeOpacity: 1.1,\r\n strokeWeight: 5\r\n });\r\n\r\nvar erase4= new google.maps.Polyline({\r\n path:[deleted11, deleted12, deleted13, deleted14],\r\n strokeColor: \"#ff0000\",\r\n strokeOpacity: 1.1,\r\n strokeWeight: 5\r\n });\r\n\r\nvar newRamp1= new google.maps.Polyline({\r\n path:[ramp1, ramp2], \r\n strokeColor: \"#fffcaf\",\r\n strokeOpacity: 1.1,\r\n strokeWeight: 5\r\n });\r\n\r\n erase1.setMap(map);\r\n erase2.setMap(map);\r\n erase3.setMap(map);\r\n erase4.setMap(map);\r\n newRamp1.setMap(map);\r\n}", "title": "" }, { "docid": "5c8b20d7d19b03bbf5f9a9b8e2f8eec1", "score": "0.55223686", "text": "draw() {\n basic.clearScreen();\n led.plot(this.player.position, this.player.elevation);\n\n for (let k = 0; k < this.playerBullets.length; k++) {\n let bullet: Bullet = this.playerBullets.get(k);\n led.plot(bullet.position, bullet.elevation);\n }\n\n for (let l = 0; l < this.enemyBullets.length; l++) {\n let bullet2: Bullet = this.enemyBullets.get(l);\n led.plot(bullet2.position, bullet2.elevation);\n }\n\n for (let m = 0; m < this.enemies.length; m++) {\n let enemy: Invader = this.enemies.get(m);\n led.plot(enemy.position, enemy.elevation);\n }\n }", "title": "" }, { "docid": "ec679fa7bf1afa38af6c89b4cc9f2cc8", "score": "0.55200523", "text": "function zoomin() {\n ruler.graphics.clear();\n var tickcheck = tickcircle.visible;\n tickcircle.graphics.clear();\n rulerCont.removeAllChildren();\n stage.update();\n //update rulerSpacing\n var rulerOldDiff = rulerSpacing;\n if (zoom_check == 1) {\n rulerSpacing = rulerSpacing + 35;\n if (clock_cont.visible == true) {\n stage.canvas.width = rulerWidth + 250;\n } else {\n stage.canvas.width = ((rulerSpacing + 2) * 100) + 50;\n }\n } else if (zoom_check == 2) {\n rulerSpacing = rulerSpacing + 40;\n if (clock_cont.visible == true) {\n stage.canvas.width = rulerWidth - 850; \n } else {\n stage.canvas.width = ((rulerSpacing + 2) * 100) + 50;\n }\n }\n zoom_check++;\n //update innerBaseWidth\n innerBaseWidth = (3 * rulerSpacing) - 20; \n //update ruler width\n rulerWidth = (rulerSpacing + 1) * 100;\n\n createRuler(30, rulerWidth, textarray, tickcheck);\n //for clock and start up message infront of ruler\n if (clock_cont.visible == true) {\n stage.setChildIndex(clock_cont, stage.getNumChildren() - 1);\n }\n\t//For numberJumps\n var tempArray = [];\n var tempCustomText = [];\n for (var i in jumpObjectsList) {\n stage.setChildIndex(jumpObjectsList[i], stage.getNumChildren() - 1);\n var count = Math.round(jumpObjectsList[i].jumpWidth / rulerOldDiff);\n var width = count * rulerSpacing;\n var color = jumpObjectsList[i].color;\n oldX = jumpObjectsList[i].x;\n oldY = jumpObjectsList[i].y;\n oldPos = Math.round(oldX / rulerOldDiff);\n var tempTopbitmap = jumpObjectsList[i].getChildByName('top');\n //check text on innershape \n if (jumpObjectsList[i].getChildAt(9) != undefined) {\n checkcont = jumpObjectsList[i].getChildAt(9);\n if (checkcont.children != undefined) {\n tempCustomText = checkcont.children;\n }\n }\n stage.removeChild(jumpObjectsList[i]);\n tempArray.push(jumpObjectsList[i]);\n newContainX = oldPos * rulerSpacing;\n createJump(width, newContainX, oldY, color, tempTopbitmap.y, tempCustomText);\n stage.update();\n tempCustomText = [];\n\t snapLeft();\n }\n for (var t in tempArray) {\n removeFromArray(jumpObjectsList, tempArray[t]);\n }\n\t//snapLeft();\n\t//For tickMarkers\n for (var p in purplecircleArray) {\n stage.setChildIndex(purplecircleArray[p], stage.getNumChildren() - 1);\n var purplecircle = purplecircleArray[p].children[1];\n numcnt = purplecircle.name.replace(\"circle\", \"\");\n\t numcnt = (purplecircleArray[p].x - 3)/rulerOldDiff;\n\t purplecircleArray[p].x += numcnt * (rulerSpacing - rulerOldDiff);\n } \n }", "title": "" }, { "docid": "b1e50ce205ad69eb87f2f6d8dd56b867", "score": "0.5518144", "text": "function drawMap(mapName, mapHolder) {\n mapHolder.append('text')\n .attr('class', 'chart-label')\n .attr('dy', rem *1.5)\n .text(d => d.mapName);\n \n let cells = allCells.find((d) => {return d.mapName === mapName});\n\n const projection = d3.geoIdentity()\n .reflectY(true)\n .fitSize([mapDim[0], mapDim[1]], shapeData);\n\n const path = d3.geoPath(projection);\n\n //draw svg lines of the boundries\n const cellsPaths = mapHolder\n .selectAll('.statePolygons')\n .data(shapeData.features)\n .enter()\n .append('path')\n .attr('class','statePolygons')\n .attr('id', (d) => {\n return (d.properties.name + d.properties.id +'-').replace(/\\s/g, '-')})\n .attr('d', path)\n .attr('fill', d => lookup(cells.mapData, d.properties.CODE))\n .attr('stroke', '#ffffff')\n .attr('stroke-width', 0.4);\n \n const borders = mapHolder\n .selectAll('.borders')\n .data(regionData.features)\n .enter()\n .append('path')\n .attr('class', 'borders')\n .attr('d', path)\n .attr('fill','none')\n .attr('stroke', '#fff1e5')\n .attr('stroke-width', 2);\n\n function lookup(row, idName) {\n const uniqueCell = row.find((d) => {return d.cellId === idName});\n if(!uniqueCell || uniqueCell.value === '') {\n return 'none'\n }\n return colourScale(uniqueCell.value)\n }\n\n function getSroke(row, idName) {\n const uniqueCell = row.find((d) => {return d.cellId === idName});\n if(!uniqueCell || uniqueCell.value === 0) {\n return colourScale.range()[0]\n }\n return 'none'\n }\n }", "title": "" }, { "docid": "b69ab076bae52ae50f63fc1e1314a68c", "score": "0.5516637", "text": "function paths(data, ctx) {\n ctx.clearRect(-1,-1,w()+2,h()+2);\n ctx.beginPath();\n data.forEach(function(d) {\n __.dimensions.map(function(p,i) {\n if (i == 0) {\n ctx.moveTo(position(p),yscale[p](d[p]));\n } else {\n ctx.lineTo(position(p),yscale[p](d[p]));\n }\n });\n });\n ctx.stroke();\n}", "title": "" } ]
23af15c95c13967087b8b3970f9c5625
sourceMappingURL=parsePhoneNumber.js.map CONCATENATED MODULE: ./node_modules/libphonenumberjs/es6/parsePhoneNumberFromString_.js
[ { "docid": "6a33db05fd613a352e234a0bc4741216", "score": "0.503355", "text": "function parsePhoneNumberFromString_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { parsePhoneNumberFromString_defineProperty(target, key, source[key]); }); } return target; }", "title": "" } ]
[ { "docid": "24db869cba77c04f77f50729a0307700", "score": "0.66452736", "text": "function index_es6_parsePhoneNumber()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata_min_json)\r\n\treturn es6_parsePhoneNumber_parsePhoneNumber.apply(this, parameters)\r\n}", "title": "" }, { "docid": "499149e64578a85601c4d65bf123a875", "score": "0.662089", "text": "function index_es6_parsePhoneNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata_min_json)\n\treturn es6_parsePhoneNumber_parsePhoneNumber.apply(this, parameters)\n}", "title": "" }, { "docid": "608d45cdd9a75c9b312114b720678c47", "score": "0.64877456", "text": "function index_es6_parsePhoneNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata_min_json)\n\treturn parsePhoneNumber_parsePhoneNumber.apply(this, parameters)\n}", "title": "" }, { "docid": "d94f918fad809b4fe749ddda00abd4b4", "score": "0.63788074", "text": "function parsePhoneNumber() {\n var parameters = Array.prototype.slice.call(arguments);\n parameters.push(_metadata_min_json__WEBPACK_IMPORTED_MODULE_0__);\n return _es6_parsePhoneNumber__WEBPACK_IMPORTED_MODULE_1__[\"default\"].apply(this, parameters);\n}", "title": "" }, { "docid": "0ebe4d07f53f62ce07d2d934503fb904", "score": "0.59636056", "text": "function exports_parsePhoneNumberFromString_parsePhoneNumberFromString() {\r\n\treturn withMetadata(parsePhoneNumberFromString_parsePhoneNumberFromString, arguments)\r\n}", "title": "" }, { "docid": "ff2e3364f66b24802453383017933e30", "score": "0.54494655", "text": "function parsePhoneNumberFromString_parsePhoneNumberFromString() {\n\tvar _normalizeArguments = normalizeArguments(arguments),\n\t text = _normalizeArguments.text,\n\t options = _normalizeArguments.options,\n\t metadata = _normalizeArguments.metadata;\n\n\treturn parsePhoneNumberFromString(text, options, metadata);\n}", "title": "" }, { "docid": "c40f7a6a538de96a357d9fa82e943379", "score": "0.5429097", "text": "function parsePhoneNumberFromString_parsePhoneNumberFromString() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return parsePhoneNumberFromString(text, options, metadata);\n}", "title": "" }, { "docid": "c40f7a6a538de96a357d9fa82e943379", "score": "0.5429097", "text": "function parsePhoneNumberFromString_parsePhoneNumberFromString() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return parsePhoneNumberFromString(text, options, metadata);\n}", "title": "" }, { "docid": "c40f7a6a538de96a357d9fa82e943379", "score": "0.5429097", "text": "function parsePhoneNumberFromString_parsePhoneNumberFromString() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return parsePhoneNumberFromString(text, options, metadata);\n}", "title": "" }, { "docid": "fbf58ad19d40a243dab31f4a2adcc779", "score": "0.5294377", "text": "function sourceMapUrl(body) {\n var body_match = body.match(source_maps_matcher);\n if (body_match) { return body_match[1]; }\n}", "title": "" }, { "docid": "d5d0a5a79a5cac98a7bdbf8d16aef368", "score": "0.5217166", "text": "function preprocessSourceMap(sourceMap) {\n if (typeof sourceMap === 'string') {\n sourceMap = JSON.parse(sourceMap);\n }\n if (sourceMap && Array.isArray(sourceMap.sources)) {\n sourceMap.sources = sourceMap.sources.map(function (sourceUrl) {\n return urlTools.resolveUrl(assetGraph.root, sourceUrl.replace(/^\\//, ''));\n });\n }\n return sourceMap;\n }", "title": "" }, { "docid": "50404718f7a640d164220e3e853c9ffc", "score": "0.5210332", "text": "phonePattern(value) {\n if (!value) {\n return undefined;\n }\n return methods.regexMatch(value, keys.PHONENUMBERPATTERN);\n }", "title": "" }, { "docid": "33c8db83449427dac3385c3fe5d39cdc", "score": "0.5197606", "text": "function translateToSourceMessage(message) {\n // removes all digits in the end of message\n return message.replace(/[0-9]+$/, '');\n}", "title": "" }, { "docid": "ef0f095e326c6706698bd053792e1e27", "score": "0.5153659", "text": "normalizePhoneNumber(phonenumber) {\n //group number 9 is the actual number we want to use\n var regex = new Regex(/((0)+|[+])([ ]*)(([0-9]-)*)((972)*)([ ]*)(.*)/);\n //should add a +972 based on the local location\n return //group 9 of the regex above\n }", "title": "" }, { "docid": "f490d9003b66ab4edf74c5afff1f69e5", "score": "0.50545347", "text": "function getLatitudeLongitude(address) {\n var deferred = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Deferred();\n // Degrees, Minutes and Seconds: DDD° MM' SS.S\"\n var latLongDegreesMinutesSeconds = /^([0-9]{1,3})(?:°[ ]?| )([0-9]{1,2})(?:'[ ]?| )([0-9]{1,2}(?:\\.[0-9]+)?)(?:\"[ ]?| )?(N|E|S|W) ?([0-9]{1,3})(?:°[ ]?| )([0-9]{1,2})(?:'[ ]?| )([0-9]{1,2}(?:\\.[0-9]+)?)(?:\"[ ]?| )?(N|E|S|W)$/g;\n // Degrees and Decimal Minutes: DDD° MM.MMM'\n var latLongDegreesMinutes = /^([0-9]{1,3})(?:°[ ]?| )([0-9]{1,2}(?:\\.[0-9]+)?)(?:'[ ]?| )?(N|E|S|W) ?([0-9]{1,3})(?:°[ ]?| )([0-9]{1,2}(?:\\.[0-9]+)?)(?:'[ ]?| )?(N|E|S|W)$/g;\n // Decimal Degrees: DDD.DDDDD°\n var latLongDegrees = /^([-|+]?[0-9]{1,3}(?:\\.[0-9]+)?)(?:°[ ]?| )?(N|E|S|W)?,? ?([-|+]?[0-9]{1,3}(?:\\.[0-9]+)?)(?:°[ ]?| )?(N|E|S|W)?$/g;\n var latLongFormats = [latLongDegreesMinutesSeconds, latLongDegreesMinutes, latLongDegrees];\n var latLongMatches = latLongFormats.map(function (latLongFormat) {\n return address.match(latLongFormat);\n });\n\n /*\n * Select the first latitude and longitude format that is matched.\n * Ordering:\n * 1. Degrees, minutes, and seconds,\n * 2. Degrees, and decimal minutes,\n * 3. Decimal degrees.\n */\n var latLongMatch = latLongMatches.reduce(function (accumulator, value, index) {\n if (!accumulator && value) {\n var latLongResult = latLongFormats[index].exec(address);\n var lat = latLongResult.slice(1, latLongResult.length / 2 + 1);\n var lng = latLongResult.slice(latLongResult.length / 2 + 1, latLongResult.length);\n\n return {\n lat: lat,\n lng: lng\n };\n }\n\n return accumulator;\n }, null);\n\n // If we've got a match on latitude and longitude, use that and avoid geocoding\n if (latLongMatch) {\n var latDecimalDegrees = getDecimalDegrees.apply(undefined, toConsumableArray(latLongMatch.lat));\n var longDecimalDegrees = getDecimalDegrees.apply(undefined, toConsumableArray(latLongMatch.lng));\n\n deferred.resolve({\n lat: latDecimalDegrees,\n lng: longDecimalDegrees\n });\n } else {\n // Otherwise, geocode the assumed address\n var geocoder = new google.maps.Geocoder();\n\n geocoder.geocode({ address: address }, function (results, status) {\n if (status !== google.maps.GeocoderStatus.OK) {\n deferred.reject(status);\n }\n\n deferred.resolve(results[0].geometry.location);\n });\n }\n\n return deferred;\n}", "title": "" }, { "docid": "d059448e5db779351770e83111020942", "score": "0.503516", "text": "fixSourceMapSources(content) {\n try {\n var marker = '//# sourceMappingURL=data:application/json;base64,';\n var index = content.indexOf(marker);\n if (index == -1)\n return content;\n var base = content.substring(0, index + marker.length);\n var sourceMapBit = new Buffer(content.substring(index + marker.length), 'base64').toString('utf8');\n var sourceMaps = JSON.parse(sourceMapBit);\n var source = sourceMaps.sources[0];\n sourceMaps.sources = [source.substring(source.lastIndexOf('../') + 3)];\n return '' + base + new Buffer(JSON.stringify(sourceMaps)).toString('base64');\n } catch (e) {\n return content;\n }\n }", "title": "" }, { "docid": "00ea1d404f6e6faa562306f26cb39e6e", "score": "0.50340754", "text": "setupSourceMaps() {\n source_map_support_1.default.install({\n environment: 'node',\n retrieveFile: (pathOrUrl) => {\n utils_2.debug('reading source for \"%s\"', pathOrUrl);\n return this.memCache.get(pathOrUrl) || '';\n },\n });\n }", "title": "" }, { "docid": "0641dc27b84303ddc769fea221b405cb", "score": "0.50277674", "text": "test() {\n this.sourcemaps.forEach((s) => {\n this.logger.debug(s);\n this.logger.debug(this.getSource().substr(s.start, s.start + s.length));\n });\n }", "title": "" }, { "docid": "8e25aaa48f13ac3a19ddb9de558ad622", "score": "0.5026993", "text": "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "8e25aaa48f13ac3a19ddb9de558ad622", "score": "0.5026993", "text": "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "8e25aaa48f13ac3a19ddb9de558ad622", "score": "0.5026993", "text": "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "07a050add8e4c08ae4edaf61b27819f0", "score": "0.4986903", "text": "stripPhoneNumber(number) {\n\t\treturn null;\n\t}", "title": "" }, { "docid": "1b449e28feeaec911240d46681248487", "score": "0.49835664", "text": "function toComment(sourceMap) {\r\n\t// eslint-disable-next-line no-undef\r\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\r\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\r\n\r\n\treturn '/*# ' + data + ' */';\r\n}", "title": "" }, { "docid": "1b449e28feeaec911240d46681248487", "score": "0.49835664", "text": "function toComment(sourceMap) {\r\n\t// eslint-disable-next-line no-undef\r\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\r\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\r\n\r\n\treturn '/*# ' + data + ' */';\r\n}", "title": "" }, { "docid": "9741a416bad0fbd7abb63ec41c93e803", "score": "0.4983034", "text": "function cssSourceMappingURL(code, sourceMappingURL) {\n return code + `/*# sourceMappingURL=${sourceMappingURL} */`;\n}", "title": "" }, { "docid": "98ef92e3bf70a98adfb2fb9fe133f1c9", "score": "0.49825144", "text": "function getPhoneCode(country)\r\n{\r\n\treturn index_es6_getCountryCallingCode(country)\r\n}", "title": "" }, { "docid": "ad6ac9adc6bfcd177b6d3f50048df2f4", "score": "0.49566662", "text": "toStringWithSourceMap(aArgs) {\n const generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n const map = new SourceMapGenerator$1(aArgs);\n let sourceMappingActive = false;\n let lastOriginalSource = null;\n let lastOriginalLine = null;\n let lastOriginalColumn = null;\n let lastOriginalName = null;\n this.walk(function(chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if (lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (let idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function(sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map };\n }", "title": "" }, { "docid": "38f9706026141ef176ea0efe31f2ce14", "score": "0.49564168", "text": "toStringWithSourceMap(aArgs) {\n const generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n const map = new SourceMapGenerator(aArgs);\n let sourceMappingActive = false;\n let lastOriginalSource = null;\n let lastOriginalLine = null;\n let lastOriginalColumn = null;\n let lastOriginalName = null;\n this.walk(function(chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if (lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (let idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function(sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map };\n }", "title": "" }, { "docid": "fa3375794a9aa004d37bac1d39aaf617", "score": "0.49462643", "text": "function toComment(sourceMap) {\n\t var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\t var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\t\n\t return '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "9fd55ec7064eeaa8c67020d3ab8910e8", "score": "0.493901", "text": "function findPhoneNumbers() {\n var _normalizeArguments = Object(_parsePhoneNumber__WEBPACK_IMPORTED_MODULE_1__[\"normalizeArguments\"])(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return Object(_findPhoneNumbers___WEBPACK_IMPORTED_MODULE_0__[\"default\"])(text, options, metadata);\n}", "title": "" }, { "docid": "a98439c6e6896773e8a3e8272f125eac", "score": "0.49310896", "text": "usPhone(value) {\n return methods.regexMatch(value, keys.US_PHONE);\n }", "title": "" }, { "docid": "0c606d0d156578812c8f6c63b8d285b9", "score": "0.49186897", "text": "function toComment(sourceMap) {\n\t var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\t var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\t return '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "e4c8f9a06428c174b14d7c80260996f5", "score": "0.49180856", "text": "function loader(code) {\n return code.replace(/222/g, '\\'loader replace here\\'')\n}", "title": "" }, { "docid": "a61a7bfadd25a87f846785344264ae65", "score": "0.49102837", "text": "function getPhoneCode(country)\n{\n\treturn index_es6_getCountryCallingCode(country)\n}", "title": "" }, { "docid": "a61a7bfadd25a87f846785344264ae65", "score": "0.49102837", "text": "function getPhoneCode(country)\n{\n\treturn index_es6_getCountryCallingCode(country)\n}", "title": "" }, { "docid": "d9c1158034dbef8ac6c7da4d21d4cae8", "score": "0.49072805", "text": "toStringWithSourceMap(aArgs) {\n const generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n const map = new SourceMapGenerator(aArgs);\n let sourceMappingActive = false;\n let lastOriginalSource = null;\n let lastOriginalLine = null;\n let lastOriginalColumn = null;\n let lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n\n if (original.source !== null && original.line !== null && original.column !== null) {\n if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n\n for (let idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0; // Mappings end at eol\n\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n return {\n code: generated.code,\n map\n };\n }", "title": "" }, { "docid": "e3914d214565303e0dcb9ec0fcd4e500", "score": "0.49034843", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}", "title": "" }, { "docid": "e3914d214565303e0dcb9ec0fcd4e500", "score": "0.49034843", "text": "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}", "title": "" }, { "docid": "07f379e206003bee6cce38fdec67cee0", "score": "0.49001408", "text": "parseModule(relPath) {\n const codeBuffer = fs.readFileSync(__dirname + relPath);\n return esprima.parseModule(codeBuffer.toString());\n }", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.48919353", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" } ]
530db50a8b99c62ccf23e8970fb4d1c0
enforce strict type checking
[ { "docid": "ddbd9be8f37618c0a4fd76b21801a95b", "score": "0.5707503", "text": "function typeCheck(array) {\n if (array.constructor === Float64Array)\n return true;\n else if (array.constructor === Float32Array)\n return false;\n\n throw new Error('invalid type!');\n }", "title": "" } ]
[ { "docid": "f6b0784352f71dc4af65a87e82e01440", "score": "0.6291458", "text": "function dangerous(){\n var a = 3\n var b = new Number(3)\n\n // true. un-strict equality try's to coerce values\n console.log( a == b );\n\n // this will see they are different data types.\n console.log( a === b );\n\n\n}", "title": "" }, { "docid": "711c6b8d4642047cbdbb67e84de1f850", "score": "0.626856", "text": "function ensureTypeValidity(fn){\n const fish = fn(testArray[0], testArray, dt);\n assertType(fish.x, 'number');\n assertType(fish.y, 'number');\n if(isNaN(fish.x + fish.y)){\n throw 'NAN error';\n }\n}", "title": "" }, { "docid": "d5bb467727b101ed2858b924f3558842", "score": "0.60474473", "text": "_checkType(value, name, type) {\n if (typeof value !== type) {\n throw new TypeError(`${name} must be a ${type}`);\n }\n }", "title": "" }, { "docid": "e0d9b93ef2541b25ee6ed85eb7dc78a4", "score": "0.5946572", "text": "function __strict(x) {return x}", "title": "" }, { "docid": "ad7e475a0942e3803ca7052ac013e1c8", "score": "0.5917476", "text": "function isPrimitive(value){\nreturn(\ntypeof value==='string'||\ntypeof value==='number'||\n// $flow-disable-line\ntypeof value==='symbol'||\ntypeof value==='boolean');\n\n}", "title": "" }, { "docid": "85464fe03231b0896c3a7b8c11e2e84b", "score": "0.58148044", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||// $flow-disable-line\n_typeof2(value)==='symbol'||typeof value==='boolean';}", "title": "" }, { "docid": "d2f2d077275c6e25ebafbff7fe8394da", "score": "0.5804099", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "title": "" }, { "docid": "d2f2d077275c6e25ebafbff7fe8394da", "score": "0.5804099", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "title": "" }, { "docid": "d2f2d077275c6e25ebafbff7fe8394da", "score": "0.5804099", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "title": "" }, { "docid": "d2f2d077275c6e25ebafbff7fe8394da", "score": "0.5804099", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "title": "" }, { "docid": "d2f2d077275c6e25ebafbff7fe8394da", "score": "0.5804099", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "title": "" }, { "docid": "d2f2d077275c6e25ebafbff7fe8394da", "score": "0.5804099", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "title": "" }, { "docid": "d2f2d077275c6e25ebafbff7fe8394da", "score": "0.5804099", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "title": "" }, { "docid": "d2f2d077275c6e25ebafbff7fe8394da", "score": "0.5804099", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "title": "" }, { "docid": "b2ca039dce0864f2334a171d076e5d3f", "score": "0.5796649", "text": "_checkInvariants() {}", "title": "" }, { "docid": "5e3bd4cb1ff2b8b30e8ebe7cedaa2c01", "score": "0.57900614", "text": "function checkType() {\n\t\t\tvar possibleTypes = argumentsToArray(arguments).map(function(type) { return type.toLowerCase(); });\n\t\t\treturn function(value) {\n\t\t\t\tvar valueType = toType(value); \n\t\t\t\treturn possibleTypes.some(function(type) { return valueType === type; }); \n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a9fef3482be187379fe3b85384d75475", "score": "0.5731224", "text": "legalArguments(args, params) {\n doCheck(\n args.length === params.length,\n `Expected ${params.length} args in call, got ${args.length}`\n );\n args.forEach((arg, i) => this.isAssignableTo(arg, params[i].type));\n }", "title": "" }, { "docid": "7481e1f41e389d3b172363e0ff628a22", "score": "0.571903", "text": "check(val) {\n return ANY_VALUE[typeof val];\n }", "title": "" }, { "docid": "e49a1b85d0030987815853e6595eb5ef", "score": "0.5712512", "text": "function determineActualTypesStrict(env, values) {\n return Z.filter (isConsistent,\n _determineActualTypes (env, [], values));\n }", "title": "" }, { "docid": "38e7bc05715e174dd463d4af88c7b8ff", "score": "0.5694266", "text": "function Z(b){return/undefined|null|boolean|number|string/.test(a.type(b))}", "title": "" }, { "docid": "5e9aa9b2a64ba8fab2907191ebbcf42b", "score": "0.5688389", "text": "function assert(val, types, checkForCustomType) {\n for (var type of types) {\n var isType = Object.prototype.toString.call(val).slice(8, -1).toLowerCase()\n if (isType === \"object\" && checkForCustomType && val.constructor && val.constructor.name === type)\n return\n else if (isType === type)\n return\n }\n throw new TypeError(\"Incorrect value \" + toString(val) + \", needs to be \" + toHumanizedString(types))\n}", "title": "" }, { "docid": "05ad7c84f4c2da23af8e09135ce9b3c0", "score": "0.567732", "text": "function s_is(x){var t=x===null?'null':typeof x;if(t=='object'&&typeof x.length=='number')t='array';return t}", "title": "" }, { "docid": "66f4643ddfee6e0ab24c42616e0d6787", "score": "0.56604886", "text": "check(val) {\n return val == null || typeof val === 'string' || Array.isArray(val) || typeof val === 'number';\n }", "title": "" }, { "docid": "c29afa96449d229a7ed87bc821c30e00", "score": "0.55760086", "text": "function checkType(value) {\n return value ? (({}).toString.apply(value)).slice(8, -1) : null\n }", "title": "" }, { "docid": "f09d20a023cffdeac48ba1289bc6c418", "score": "0.5572219", "text": "function isPrimitive(value) {\n return value!==undefined && value!==Object(value);\n}", "title": "" }, { "docid": "71a1e7e2991bc8af2a3f27e04dc7223a", "score": "0.5566347", "text": "function typecheck(type, value) {\n // if not in dev-mode, do not even try to run typecheck. Everything is developer fault!\n if (false)\n {}\n typecheckPublic(type, value);\n}", "title": "" }, { "docid": "17b588950e5382c618d2f8374fb24ca4", "score": "0.5545658", "text": "function unsafeCoerce(a) {\n return a;\n}", "title": "" }, { "docid": "9618ff43fcfd7f8fba819bc55c611bfb", "score": "0.55259985", "text": "static safeCast (value, datatype) {\n\t\tvar existingType = typeof value;\n\t\tvar cast = _.cast(value, datatype);\n\n\t\tif (datatype == \"boolean\") {\n\t\t\tif (!value) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (value === \"true\" || value > 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn value;\n\t\t}\n\n\t\tif (datatype == \"number\") {\n\t\t\tif (/^[-+]?[0-9.e]+$/i.test(value + \"\")) {\n\t\t\t\treturn cast;\n\t\t\t}\n\n\t\t\treturn value;\n\t\t}\n\n\t\tif (value === null || value === undefined) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn cast;\n\t}", "title": "" }, { "docid": "21d86c118e6ba9f4910b56fa104e77a7", "score": "0.54971963", "text": "function isPrimitive(obj) {\r\n return obj !== Object(obj)\r\n}", "title": "" }, { "docid": "2a37b9757761ae0a147a327b285cfefe", "score": "0.5479749", "text": "function sanitize(data) {\n if(\n !isPrimitive(data) &&\n !Array.isArray(data) &&\n !isPlainObject(data)\n ) {\n return Object.prototype.toString.call(data);\n } else {\n return data;\n }\n}", "title": "" }, { "docid": "17e80a7b9b132aaf834a3d89d0c2abf0", "score": "0.545393", "text": "function isPrimitive(value) {\n return typeof value === \"string\" || typeof value === \"number\";\n }", "title": "" }, { "docid": "4822ac4dd2c5ded50e834b62d8a01604", "score": "0.5448117", "text": "function isPrimitive(item) {\n return !isObject(item) && !isArray(item);\n}", "title": "" }, { "docid": "4f7567e9d50fe8ce559c8fd0866e1565", "score": "0.5445393", "text": "function typeCheck(t1, t2) {\n\t\tfor(var i = 0; i < t1.length; i++) {\n\t\t\tfor(var j = 0; j < t2.length; j++) {\n\t\t\t\tif(t1[i] == t2[j]) {\n\t\t\t\t\t// found a compatible interpretation of the types\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "2b2ca531e42377b2ef617bd806ff8e04", "score": "0.5441567", "text": "function isPrimitive(value) {\n return value === null || typeof value !== 'object' && typeof value !== 'function';\n}", "title": "" }, { "docid": "74958928912ebbf85be85439676929a6", "score": "0.54232126", "text": "function u(e){return null!==e&&\"object\"==typeof e}", "title": "" }, { "docid": "d5eae7b23a906d0dca4bb70f2a2b2172", "score": "0.54118794", "text": "isPrimitive (val) {\n return val === 'string' || val === 'number' || val === 'boolean'\n }", "title": "" }, { "docid": "1f428e388567f28f73850e8eea88758f", "score": "0.5409311", "text": "function isPrimitive(value) {\n\t if (value === null) {\n\t return true;\n\t }\n\t if (value === undefined) {\n\t return false;\n\t }\n\t if (typeof value === 'function') {\n\t return false;\n\t }\n\t if (['boolean', 'number', 'string'].indexOf(typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) !== -1) {\n\t return true;\n\t }\n\t if (value instanceof Date || value instanceof ArrayBuffer) {\n\t return true;\n\t }\n\t return false;\n\t}", "title": "" }, { "docid": "55ab2beb594f1121fe254125801a8d34", "score": "0.5406245", "text": "function isPrimitive(data) {\r\n\t\tvar type = typeof(data);\r\n\r\n\t\tswitch ( typeof data ) {\r\n\t\t\tcase 'boolean':\r\n\t\t\tcase 'number':\r\n\t\t\tcase 'string':\r\n\t\t\tcase 'undefined':\r\n\t\t\tcase null:\r\n\t\t\t\treturn true;\t\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "a95fa46c5fcad9b21ba5f807da619800", "score": "0.5405675", "text": "function isPrimitive(value) {\n if (value === null) {\n return true;\n }\n if (value === undefined) {\n return false;\n }\n if (typeof value === 'function') {\n return false;\n }\n if (['boolean', 'number', 'string'].indexOf(typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) !== -1) {\n return true;\n }\n if (value instanceof Date || value instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "089e9966f06afd873cbfd7e758904f6d", "score": "0.5384762", "text": "function toType(obj){return{}.toString.call(obj).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();}// Check config properties for expected types", "title": "" }, { "docid": "0df21d7c8c13f4808982d76355ec0b69", "score": "0.5379989", "text": "function isPrimitive(v) {\n return (v === null ||\n v === undefined ||\n typeof v === \"boolean\" ||\n typeof v === \"number\" ||\n typeof v === \"string\" ||\n typeof v === \"symbol\");\n }", "title": "" }, { "docid": "1751b39332ba36a3961eeecf7218f598", "score": "0.5375202", "text": "function isPrimitive(val) {\n\t return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n\t}", "title": "" }, { "docid": "b575ad78b47da8aa1b158404310cd372", "score": "0.53738153", "text": "function assertMichelsonType(ex) {\r\n /* istanbul ignore else */\r\n if (assertPrimOrSeq(ex)) {\r\n if (isPrim(ex)) {\r\n if (!Object.prototype.hasOwnProperty.call(typeIDs, ex.prim)) {\r\n throw new MichelsonValidationError(ex, \"type expected\");\r\n }\r\n traverseType(ex, function (ex) { return assertMichelsonType(ex); });\r\n }\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "05e5782f7a0b187394e42fd5078e8336", "score": "0.5367344", "text": "function guardTypeArg (type) {\n if (typeof type !== 'string') {\n throw new Error('Invalid argument: type is expected to be a string');\n }\n }", "title": "" }, { "docid": "59cf87e457996014b219886b9a40dfc2", "score": "0.53600323", "text": "function isPrimitive(value) {\n return typeof value === \"string\" || typeof value === \"number\"\n }", "title": "" }, { "docid": "6f8bcdeac3b4c2c7de446dcf881e570f", "score": "0.5357331", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "title": "" }, { "docid": "6f8bcdeac3b4c2c7de446dcf881e570f", "score": "0.5357331", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "title": "" }, { "docid": "6f8bcdeac3b4c2c7de446dcf881e570f", "score": "0.5357331", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "title": "" }, { "docid": "6f8bcdeac3b4c2c7de446dcf881e570f", "score": "0.5357331", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "title": "" }, { "docid": "9db6591fe6092ef3ccc85d8204163b0b", "score": "0.5356423", "text": "function r(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "title": "" }, { "docid": "9ecc10bd4c2126d73cd88f8fb4eaeec1", "score": "0.53561604", "text": "function determineActualTypesLoose(env, values) {\n return Z.reject (function(t) { return t.type === INCONSISTENT; },\n _determineActualTypes (env, [], values));\n }", "title": "" }, { "docid": "1fd0539ac88afa90ba856a2e05957ebf", "score": "0.53558093", "text": "function foo (): number {\r\n return 100 // ok\r\n // return 'string' // error\r\n}", "title": "" }, { "docid": "388e6135615828df76d702ba6b6adf80", "score": "0.5352574", "text": "function useStrictEquality(b, a) {\n if (b instanceof a.constructor || a instanceof b.constructor) {\n // to catch short annotaion VS 'new' annotation of a\n // declaration\n // e.g. var i = 1;\n // var j = new Number(1);\n return a == b;\n } else {\n return a === b;\n }\n }", "title": "" }, { "docid": "d30c130063e0d998bff2ce21a098f992", "score": "0.5350314", "text": "function isPrimitive(value) {\n return (value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}", "title": "" }, { "docid": "95a4073c5bb60558a9f6e921a8c9ca8c", "score": "0.5343761", "text": "function useStrictEquality(b, a){\n if (b instanceof a.constructor || a instanceof b.constructor) {\n // to catch short annotaion VS 'new' annotation of a\n // declaration\n // e.g. var i = 1;\n // var j = new Number(1);\n return a == b;\n } else {\n return a === b;\n }\n }", "title": "" }, { "docid": "39684f4e0859d6cc39fb7e17daffdee2", "score": "0.5343177", "text": "function isPrimitive(value) {\n return (typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean');\n}", "title": "" }, { "docid": "f21059a5831cf6a02d0baab409e5bb39", "score": "0.5342824", "text": "function requiresAny(params, type, attrs) {\n attrs.forEach(aliases => {\n if (aliases.every(attr => typeof params[attr] === 'undefined')) {\n throw new Error(`Cast type '${type}' requires '${aliases[0]}' param`)\n }\n })\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" }, { "docid": "8b13c8100d8cf8169b83d547ce6e3501", "score": "0.53137904", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "title": "" } ]
04d65058c21e1c687711552680bfe589
GUI for the results box
[ { "docid": "6994c91bf2bf29261cffd354a64d3878", "score": "0.6754122", "text": "function initialise_results_box(){\n\n\tGUILayout.BeginArea (Rect (Screen.width - resultBoxWidth, 0, resultBoxWidth, Screen.height));\n\tGUILayout.BeginVertical();\n\tGUILayout.BeginHorizontal();\n\tGUILayout.Label(\"Time: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(timer.timer.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.Label(\"Evacuated: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(evacuated.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.EndHorizontal();\n\tGUILayout.BeginHorizontal();\n\tGUILayout.Label(\"Front left: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(front_left_count.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.Label(\"Front right: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(front_right_count.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.EndHorizontal();\n\tGUILayout.BeginHorizontal();\n\tGUILayout.Label(\"Middle left 1: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(first_middle_left_count.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.Label(\"Middle right 1: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(first_middle_right_count.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.EndHorizontal();\n\tGUILayout.BeginHorizontal();\n\tGUILayout.Label(\"Middle left 2: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(second_middle_left_count.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.Label(\"Middle right 2: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(second_middle_right_count.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.EndHorizontal();\n\tGUILayout.BeginHorizontal();\n\tGUILayout.Label(\"Rear left: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(rear_left_count.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.Label(\"Rear right: \",GUILayout.Width(labelWidth));\t\t\n\tGUILayout.Label(rear_right_count.ToString(),GUILayout.Width(counterLabelWidth));\n\tGUILayout.EndHorizontal();\n\n\n\tif (GUILayout.Button(\"Log results\",GUILayout.Width(buttonWidth),GUILayout.Height(buttonHeight))){\n\n\t\tlog_results();\n\t\tlogText = \"Results logged at \"+timer.timer +\" seconds. They are stored in \"+evacuation_results_filename + \" and \" + evacuation_doors_filename;\n\n\t}\n\n\tGUILayout.Label(logText);\n\tGUILayout.EndVertical();\n\tGUILayout.EndArea();\n\n}", "title": "" } ]
[ { "docid": "f55cd8a3dca8d0901f9adc375834699a", "score": "0.70277727", "text": "function displayResults() {\n //clean messages. \n showToolbarMessage(\"\", \"\", 100);\n $(\"#\" + btnReplaceId).css(\"display\", \"inline\");\n $(\"#btnSwapText_\").css(\"display\", \"inline\");\n if (settings.showFixAll)\n $(\"#\" + btnFixAllId).css(\"display\", \"inline\");\n if (settings.showManualCheck)\n $(\"#\" + btnRefreshId).css(\"display\", \"inline\");\n $(\"#\" + btnReplaceId).css(\"display\", \"inline\");\n //hide gif loader.\n $(\"#mainPlaceHolder_\" + acceptDialogId + \"\").find(\".loadmask\").css(\"display\", \"none\");\n \n //replacing the method checkifThereAnyMore.\n if ($acceptContainer.find('SPAN.accept-highlight').length == 0)\n $(\"#\" + btnFixAllId).css('display', 'none');\n \n $(\"#editor_\" + acceptContainerId).css(\"display\", \"block\");\n //if exist then always show checking levels.\n if (settings.checkingLevels.length > 0)\n $('div[aria-labelledby=ui-dialog-title-' + acceptDialogId + ']').find('.ui-dialog-buttonpane').find(\"#format_\" + acceptDialogId + \"\").css('display', 'block');\n }", "title": "" }, { "docid": "260229ace16fb50c2f1208bb95c54d61", "score": "0.68735576", "text": "function dispResults(){\n\t\tclearMessagesBoxes();\n\t\tcounter++;\n\t\tscore.correctlyAnswer= 0;\n\t\tscore.wrongAnswer= 0;\n\t\tscore.timeElapsed = 0;\t\n\t\tmessNote1 = \"Correctly Answered: \" + score.correctlyAnswer;\n\t\tmessNote2 = \"Incorrectly Answered:\" + score.wrongAnswer;\n\t\tmessNote3 = \"Unanswered:\" + score.timeElapsed;\n\t\t$(\"#msg1\").prepend(messNote1);\n\t\t$(\"#msg2\").prepend(messNote2);\n\t\t$(\"#msg3\").prepend(messNote3);\n\t\t$(\"#startAgainButton\").show();\n\t\t\n\t}", "title": "" }, { "docid": "23a92c7a2c50e000559f1e9d12e84af1", "score": "0.6872431", "text": "function showResults() {\n \n}", "title": "" }, { "docid": "f34e4c01e4b3d1973a16371825c5dd15", "score": "0.6856457", "text": "function displayResults(results) {\n \n // Hide update log.\n hideLog();\n \n // Display results.\n showResults(results);\n}", "title": "" }, { "docid": "547c956109a930f51cf65e168298c0cd", "score": "0.68372893", "text": "function results() {\n\t$(\".timer\").hide();\n\t$(\".question\").hide();\n\t$(\".choose\").hide();\n\t$(\".gif\").hide();\n\t$(\".trivia\").append(\"<div class='results'></div>\")\n\t$(\".results\").append(\"<br><div><u>Game Results:</u></div><br><br>\");\n\t$(\".results\").append(\"<div>Correct Guesses: \" + correctGuesses + \"</div>\");\n\t$(\".results\").append(\"<div>Wrong Guesses: \" + wrongGuesses + \"</div\");\n\t$(\".results\").append(\"<br><br><input class='reset btn btn-default' type='button' value='reset'>\");\n}", "title": "" }, { "docid": "3ab5f54000f4616f47ecc498dc1f2554", "score": "0.67771494", "text": "function displayResults() {\n\n // // Calculates all results (correct/incorrect/unanswered)\n // function calculate() {\n\n // };\n\n // calculate();\n\n $(\"#quiz-container\").html('<h2 id = \"all-done\">All done!</h2>');\n $(\"#quiz-container\").append(\"Correct answers: \" + correct + '<br>' + \"Incorrect answers: \" + incorrect + '<br>' +\n \"Unanswered: \" + unanswered);\n }", "title": "" }, { "docid": "9d2996a08909259f3ce65e12e90618e1", "score": "0.6758105", "text": "function displayResults() {\n\t\t$(\"#question\").empty();\n\t\tif (correct >= 7) { message = \"Congratulations! You have achieved expert level!\";}\n\t\telse if (correct >= 4) {message = \"Nice going! You have achieved a novice level.\";}\n\t\telse {message = \"You need to study up on your Disney Trivia and try again!\";};\n\t\tvar tempDiv = $(\"<div>\").html(message).attr(\"class\", \"resultsFirst\");\n\t\t$(\"#answers\").append(tempDiv); \n\t tempDiv = $(\"<div>\").html(\"Total Correct Answers: \" + correct).attr(\"class\", \"results\");\n\t $(\"#answers\").append(tempDiv);\n\t tempDiv = $(\"<div>\").html(\"Total Wrong Answers: \" + wrong).attr(\"class\", \"results\");\n\t $(\"#answers\").append(tempDiv);\n\t tempDiv = $(\"<div>\").html(\"Total Unanswered: \" + unanswered\t).attr(\"class\", \"results\");\n\t $(\"#answers\").append(tempDiv);\n\t begBtn.html(\"Restart\");\n\t\t$(\"#answers\").append(begBtn); \n}", "title": "" }, { "docid": "ff513957b66c87a66f171598d91cf4ba", "score": "0.67229176", "text": "function showResults() {\n // show div\n $('#result').show();\n // add scores to child elements\n $('#result').append(); // incomplete -- will fill in values later\n}", "title": "" }, { "docid": "70840621d9336bbbb30e15c88a408219", "score": "0.6719026", "text": "function results() {\n\tmainScreen = \"<p>Your results:</p>\" + \n\t\"<p>Correct: \" + correct + \"</p>\" + \n\t\"<p>Incorrect: \" + incorrect + \"</p>\" + \n\t\"<p>Unanswered: \" + unanswered + \"</p>\" + \n\t\"<p class='buttons'><a class='btn start-button'>Restart</a></p>\";\n $(\"#screen\").html(mainScreen);}", "title": "" }, { "docid": "0a420c73f4f1b144ecaeb33d7640f9e9", "score": "0.66565484", "text": "function showResult()\r\n{\r\n \r\n resultModal.className = \"hide\";\r\n rankingModal.className = \"grid\";\r\n\r\n /**\r\n * Voert ook functions uit voor het berekenen en sorteren van de eindresultaat.\r\n */\r\n CalculatePoints();\r\n SortParties();\r\n\r\n}", "title": "" }, { "docid": "8000da4e4c6dc6ff1fbd5111f671e125", "score": "0.6636909", "text": "function showResults() {\n\n\tconst container = document.querySelector('#resultsContainer');\n\n\tcontent.classList.add('content');\n\tcontent.textContent = 'Results: ' + 'AI: ' + compScore + ' Player: ' + playerScore;\n\n\tcontainer.appendChild(content);\n}", "title": "" }, { "docid": "2474e12910adca5b700cbf59edb994fa", "score": "0.66348165", "text": "function displayResults() {\n\n $(\"#timeRemaining\").html(\"<button type='button' class='btn-lg btn-primary p-3' id='start'>Start Quiz!</button>\");\n $(\"#qAndA\").html(\"<p>Game Over. Press Start to Play again.</p>\");\n $(\"#a1\").html(\"<p>You answered: \" + correctAnswers + \" (\" + ((correctAnswers / quiz.length) * 100).toFixed() + \"%) correctly!</p>\");\n $(\"#a2\").html(\"<p>You answered: \" + wrongAnswers + \" incorrectly.</p>\");\n $(\"#a3\").html(\"<p>You had \" + unanswered + \" unanswered questions (Time ran out.)</p>\");\n $(\"#a4\").empty();\n\n }", "title": "" }, { "docid": "99a035669440ed3a660c47ebc66f59d6", "score": "0.6621992", "text": "function showResults(){\n elResults.score.textContent = score;\n elResults.maxScore.textContent = pointsPerRightAnswer * questions.length;\n elResults.container.classList.remove('hidden');\n}", "title": "" }, { "docid": "d8667e4890fe76f5e92ee26457bd5c73", "score": "0.66138184", "text": "function res() {\n document.getElementById(\"results\").innerHTML = \"The sum, average, product, smallest number and largest number will be displayed here after you click submit.\";\n}", "title": "" }, { "docid": "b638e81f13b60382eddfb1c5ecdf1cf3", "score": "0.6584433", "text": "function showResults() {\r\n $(\"#correct-holder\").show();\r\n $(\"#correct-holder\").html(\"Correct: \" + correct);\r\n $(\"#incorrect-holder\").show();\r\n $(\"#incorrect-holder\").html(\"Incorrect: \" + incorrect);\r\n $(\"#unanswered-holder\").show();\r\n $(\"#unanswered-holder\").html(\"Unanswered: \" + unanswered);\r\n $(\"#restart-holder\").show();\r\n $(\"#restart-holder\").html(\"Click Start above to play again!\");\r\n }", "title": "" }, { "docid": "11564ba3aeebce2c37815550343d6a03", "score": "0.6568333", "text": "function ShowResult(result)\n\t\t{\n\t\t\tvar text = document.createElement('p');\n\t\t\tif(result.type==\"none\")\n\t\t\t{\n\t\t\t\ttext.innerHTML = \"(void) Method\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttext.innerHTML = result.value;\n\t\t\t}\n\n\t\t\tvar div = document.getElementById(\"textBoxesDiv\");\n\t\t\tdiv.appendChild(text);\n\t\t}", "title": "" }, { "docid": "0e4f876729da94a4fdf57cfac3dd94c0", "score": "0.6565444", "text": "function renderResultsPage() {\n quizPage.style.display = \"none\";\n resultDiv.style.display = \"none\";\n resetButtonPanel.style.display = \"none\";\n viewFinalScorePanel.style.display = \"block\";\n if (inputNamePanel.style.display == \"none\") {\n inputNamePanel.style.display = \"block\";\n }\n closingPage.style.display = \"block\";\n calculateScore();\n showScore.textContent = score;\n}", "title": "" }, { "docid": "c3fc2e16ba65b72a59322626d5ca16e1", "score": "0.6546438", "text": "function displayResult () {\n\t\tvar \tsMsg=\"\",\n\t\t\t\teParResult;\n\n\t\tdeleteContent(eFormContainer);\n\t\tdeleteContent(eFormHeader);\n\t\teResultsContainer.style.display=\"block\";\n\t\tsMsg= (\"Has terminado la Trivia! <br> Respuestas Correctas: \" + nCorrect + \". <br> Respuestas Incorrectas \" + nIncorrect + \". <br> Gracias por jugar!!\");\n\t\teParResult= document.getElementById(\"p-Result\").innerHTML= sMsg;\n\t} //fin de displayResult.", "title": "" }, { "docid": "6147123cac0118788647287a7abb1ccd", "score": "0.6534266", "text": "function updateUI(parsedData) {\n // Show results container that was not displayed\n document.getElementById('results-ctn').classList.remove('display-result-none');\n document.getElementById('results-ctn').classList.add('display-result-block');\n // Update results container with data\n document.getElementById(\n 'confidence'\n ).innerHTML = `<p><strong>Level of Confidence:</strong> ${parsedData.confidence}%</p>`;\n document.getElementById(\n 'subjectivity'\n ).innerHTML = `<p><strong>Subjectivity:</strong> ${parsedData.subjectivity}</p>`;\n document.getElementById(\n 'agreement'\n ).innerHTML = `<p><strong>Agreement:</strong> ${parsedData.agreement}</p>`;\n document.getElementById('irony').innerHTML = `<p><strong>Irony:</strong> ${parsedData.irony}</p>`;\n}", "title": "" }, { "docid": "3f6e78b363e603f49d8d6326dabf6d2e", "score": "0.6528799", "text": "function results() {\n\t\n\t// Hide Grid 2, show Grid 1\n\t$(\"#ceiling\").hide();\n\t$(\"#ceiling2\").show();\n\tstop_timer();\n\t$(\"#quest_text\").html(correct_answers + \" / \" + total_questions);\n\n\t\t// User lives\n\t\tif (correct_answers > 10) {\n\t\t\t$(\"#giph\").html('<img src=\"File/released.gif\">');\n\t\t\t$(\"#quest_text\").text(\"Most people are so ungrateful to be alive, but not you, not any more...\");\n\n\t\t\t\t// Reset Game\n\t\t\t\t$(\"#subtext\").html(\"Click the giph to play again.\");\n\t\t\t\t$('#giph').on(\"click\", reset);\n\n\t\t}\n\n\t\t// User dies\n\t\telse {\n\t\t\tjigsaw_laugh.play();\n\t\t\t$(\"#giph\").html('<img src=\"File/smile.gif\"/>');\n\t\t\t$(\"#quest_text\").text(\"Game Over. You Lose.\");\n\n\t\t\t\t// Reset Game\n\t\t\t\t$(\"#subtext\").html(\"Click the giph to play again.\");\n\t\t\t\t$('#giph').on(\"click\", reset);\n\n\t\t}\n}", "title": "" }, { "docid": "b29b47591a36a69e37aafcb4bf1ddbdb", "score": "0.652629", "text": "function showResults() {\n document.getElementById(\"results\").style.display = \"inline\";\n document.getElementById(\"playButton\").innerHTML = \"Play Again\";\n document.getElementById(\"resultsBet\").innerHTML = \"$\" + startingBet +\".00\";\n document.getElementById(\"resultsRollCounter\").innerHTML = rollCounter;\n document.getElementById(\"resultsHighestHeld\").innerHTML = \"$\" + highestAmount + \".00\";\n document.getElementById(\"resultsRollsFromHighest\").innerHTML = rollsFromHighest;\n }", "title": "" }, { "docid": "6359a048082dd764833377dd419c0752", "score": "0.65161276", "text": "function renderResults() {\n\t// Update the header to indicate the test completion.\n\tdocument.getElementById(\"mainHeader\").innerHTML = \"Test Completed\";\n\t\n\t// Show how the user's result.\n\tvar testCont = document.getElementById(\"testCont\");\n\ttestCont.innerHTML = \"<h2>You got \" + correct + \" of \" + NUM_OF_QUESTIONS +\" questions correct</h2>\";\n\t\n\t// Options for a retest or to view their results in more detail.\n\ttestCont.innerHTML += '<button onclick=\"showResults()\"> View Results </a>';\n\ttestCont.innerHTML += '<br><br><button onclick=\"location.reload()\"> Retest </a> ';\n}", "title": "" }, { "docid": "c79a6d1118bb6b622f553c25754ace9d", "score": "0.6515324", "text": "function setResults() {\n // Set final results\n results.show = '' +\n '<span style=\"display:block;overflow-x:auto\">' +\n '<table class=\"aIV-exQ6-table\">' +\n '<tr>' +\n '<td>' +\n '<u>Unsorted Array</u>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0 0;\">' +\n results.vals +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0 20px;\">' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>' +\n '<u>Binary Search Tree</u>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0 0;\">' +\n results.tree +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0 20px;\">' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>' +\n '<u>Doubly-Linked List</u>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0;\">' +\n results.list +\n '</td>' +\n '</tr>' +\n '</table>' +\n '</span>';\n }", "title": "" }, { "docid": "ec49bf655cc6d60c6494593b26e82e49", "score": "0.64598036", "text": "function showResult()\n{\n\tif(myRec.resultValue==true) {\n\t\tbackground(192, 255, 192) //Achtergrond wordt zoals een kladpapier geel\n\t\ttext(myRec.resultString, width/2, height/2) //Veranderd de text naar wat de microfoon ziet\n\t\tconsole.log(myRec.resultString) //Je ziet het resultaat nog een keer in de console\n\t}\n}", "title": "" }, { "docid": "4132de3b9a0b2679e0d75b28c9dedac7", "score": "0.6438337", "text": "function showResults(input) {\n\ttext = \"<ul>\";\n\tinput.forEach(addResult);\n\ttext += \"</ul>\";\n\tdocument.getElementById(\"pageResults\").innerHTML = text;\n\n collapsibleHotelInfo();\n manageSortButtons();\n}", "title": "" }, { "docid": "11eabd59c4b250a4d6eb8fc5f97dfb2c", "score": "0.6418599", "text": "function animateResults() {\n\t\t$(\"#resultsBox\").animate({\n\t\t\tmarginTop: '3em',\n\t\t\topacity: '1',\n\t\t}, 200); // <<< resultBox.animate\n\t}", "title": "" }, { "docid": "83f81a36210540b21909328eab306d63", "score": "0.641634", "text": "function gotResults(error, results) {\n if(error) {\n console.error(error);\n } else {\n //console.log(results);\n submitButton.style(\"display\", \"none\");\n let label = results[0].label;\n let confidence = round(results[0].confidence, 2);\n textP.html(\"Label: \" + label + \" - Confidence \" + confidence);\n }\n}", "title": "" }, { "docid": "82ae24418d6b81b256e199da09659eba", "score": "0.64048064", "text": "function displayResults() {\n $(\"#display\").hide();\n $(\"#displayResult\").show();\n $(\"#wins\").html(\"Total number of correct guesses: \" + correctGuess);\n $(\"#losses\").html(\"Total number of incorrect guesses: \" + wrongGuess);\n $(\"#unanswered\").html(\"Total number of unanswered guesses: \" + unanswered);\n $(\"#replay\").fadeIn();\n}", "title": "" }, { "docid": "4d2f523e9d788eb090345b301ffb685e", "score": "0.63955796", "text": "function showResults (u,c) {\n\tdocument.getElementById('results').innerHTML = 'You picked <span>' + u + '</span> and I, the Computer, picked <span>' + c + '</span>' + winnerResult + declareWinner + moreTrash;\n\t// option of putting the results in a variable too. \n}", "title": "" }, { "docid": "6fc31863d4c9c8704af6c34d392998bf", "score": "0.6391086", "text": "function displayResults(results) {\n\tvar section = $(\"#results\");\n\tvar i = 0;\n\tresults = normalizeResults(results);\n\tfor (r of results) {\n\t\tif (i==6) {\n\t\t\tdiv = document.createElement('div');\n\t\t\tdiv.innerHTML = '<h3>Other results:</h3><h6>'+ r.name + '</h6><p>';\n\t\t\tsection.append(div);\n\t\t}\n\t\tif (i > 6) {\n\t\t\tdiv = document.createElement('div');\n\t\t\tdiv.innerHTML = '<h6>'+r.name + '</h6><p>';\n\t\t\tsection.append(div);\n\t\t} else if (i < 6) {\n\t\t\tdiv = document.createElement('div');\n\t\t\t$(div).addClass('result');\n\t\t\tdiv.innerHTML = '<h3>'+r.name + '</h3><p>' + r.description+'</p><p>Score: '+ r.score +'%</p>' +\n\t\t\t'<p><b>matches you on the following features: ' + matchesToList(r.matches) + '</b></p>' +\n\t\t\t\t\t\t'<div class=\"meter\">' + '<span style=\"width: '+ r.score +'%\"></span></div>';\n\t\t\tsection.append(div);\n\t\t}\n\t\tif (i > 10) break;\n\t\ti++;\n\t}\n\n\t $(function() {\n $(\".meter > span\").each(function() {\n $(this)\n .data(\"origWidth\", $(this).width())\n .width(0)\n .animate({\n width: $(this).data(\"origWidth\")\n }, 1200);\n });\n });\n}", "title": "" }, { "docid": "64aa01b32589cd4985b36119cf26cc86", "score": "0.63881385", "text": "function showResult(results) {\n vm.result = results[0];\n if (vm.result) {\n vm.showingResult = true;\n\n // disable automatic websocket reconnect\n JhiWebsocketService.disableReconnect();\n\n // assign user score (limit decimal places to 2)\n vm.userScore = vm.submission.scoreInPoints ? Math.round(vm.submission.scoreInPoints * 100) / 100 : 0;\n\n // create dictionary with scores for each question\n vm.questionScores = {};\n vm.submission.submittedAnswers.forEach(function (submittedAnswer) {\n // limit decimal places to 2\n vm.questionScores[submittedAnswer.question.id] = Math.round(submittedAnswer.scoreInPoints * 100) / 100;\n });\n }\n }", "title": "" }, { "docid": "f2f89500a0273f12af6c81241f62fc7f", "score": "0.6384609", "text": "function quizResults() {\n $(\".quiz-results\")\n .html(generateResults())\n .css(\"display\", \"block\");\n $(\".question-form\").css(\"display\", \"none\");\n quizRetry();\n}", "title": "" }, { "docid": "a6568d61b54cf6889fe316c2d6fa5e09", "score": "0.63591385", "text": "function showResult() {\n clearAll();\n document.getElementById(\"resultsarea\").style.display = \"block\";\n var cityName = document.getElementById(\"citiesinput\").value;\n fetchData(cityName);\n fetchForecast(cityName);\n }", "title": "" }, { "docid": "54717e0284b1ac4d0da516004f553abe", "score": "0.6357026", "text": "function showFinalResults() {\n\n // Determine message to display to user\n var finalMessage = \"\";\n var pctScore = userCorrectAnswer / (userCorrectAnswer + userIncorrectAnswer + userUnanswered)\n if (pctScore == 1) {\n finalMessage = \"Lets be honest. You were googling these while taking the quiz, weren't you???\"\n } else if (pctScore >= 0.9) {\n finalMessage = \"Fantastic job! This isn't easy!\"\n } else if (pctScore >= 0.8) {\n finalMessage = \"Two thumbs up!\"\n } else if (pctScore >= 0.7) {\n finalMessage = \"You might want to read up more on the national parks...\"\n } else if (pctScore == 0) {\n finalMessage = \"You didn't get any correct. Someone randomly clicking answers is bound to get at least one right. Shame on you!!\"\n } else {\n finalMessage = \"Wikipedia is your friend. Do more reading and try again.\"\n }\n\n // Set our text to show the user\n $(\"#resultsMessage\").html(\"<h5>\" + finalMessage + \"</h5>\");\n $(\"#resultsCorrect\").text(\"Correct Answers: \" + userCorrectAnswer);\n $(\"#resultsIncorrect\").text(\"Incorrect Answers: \" + userIncorrectAnswer);\n $(\"#resultsNotAnswered\").text(\"Not Answered: \" + userUnanswered);\n\n // Display the results container div\n document.getElementById(\"resultsContainer\").style.display = \"block\";\n }", "title": "" }, { "docid": "974b46b22d4032a2a8dd4ed359bf0d33", "score": "0.63528514", "text": "function displayResults() {\n $(\"#correct\").text(\"Correct : \" + numCorrect);\n $(\"#incorrect\").text(\"Incorrect : \" + numIncorrect);\n $(\"#unanswered\").text(\"Unanswered : \" + numUnanswered);\n}", "title": "" }, { "docid": "812caa01d5e7830df1218dae8e729559", "score": "0.635204", "text": "function resultsScreen() {\n\t\tif (correctGuesses === questions.length) {\n\t\t\tvar endMessage = \"Perfection!\";\n\t\t\tvar bottomText = \"#nerdalert!\";\n\t\t}\n\t\telse if (correctGuesses > incorrectGuesses) {\n\t\t\tvar endMessage = \"Good work!\";\n\t\t\tvar bottomText = \"all your base are belong to us\";\n\t\t}\n\t\telse {\n\t\t\tvar endMessage = \"Scrub\";\n\t\t\tvar bottomText = \"#scrub\";\n\t\t}\n\t\t$(\"#gameScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p>You got <strong>\" + \n\t\t\tcorrectGuesses + \"</strong> right.</p>\" + \n\t\t\t\"<p>You got <strong>\" + incorrectGuesses + \"</strong> wrong.</p>\");\n\t\t$(\"#gameScreen\").append(\"<h1 id='start'>Start Over?</h1>\");\n\t\t$(\"#bottomText\").html(bottomText);\n\t\tgameReset();\n\t\t$(\"#start\").click(nextQuestion);\n\t}", "title": "" }, { "docid": "1523694f119397f7532fc398ee4501b9", "score": "0.63320994", "text": "function onResults( data ) {\n\n\tfor(var i=0;i<data.count;i++) \n\t\tinsertNewBox(data.items[i]);\n\n}", "title": "" }, { "docid": "e601e824f651cf6e9fee7c978a3f73c3", "score": "0.6331183", "text": "function gotResult(results) {\n // The results are in an array ordered by probability.\n // result.html(results[0].label);\n label = results[0].label.split(',')[0].toUpperCase() + '\\n' +radio.value() + ', 2018';\n // confidence.html(results[0].probability, 0, 2);\n\n // Console the results\n // console.log(results);\n\n // Start again every 250ms\n setTimeout(guess, 1000);\n}", "title": "" }, { "docid": "6a92f9d7ec1d579ddbe32ac21c50cf39", "score": "0.6322546", "text": "function updateResults() {\n $(settings.resultSelector).html(settings.currentResults.length === 0 ? settings.noResults : \"\");\n showMoreResults();\n// addSharebox();\n\n updateURL();\n}", "title": "" }, { "docid": "0d6bdb72ec9b4cd7dd21806d4daabf93", "score": "0.63224715", "text": "function outputResult() {\r\n // Change the search button label\r\n if (typeof search !== 'undefined') {\r\n search.text = LANG_WAIT;\r\n dialog.update();\r\n }\r\n\r\n listbox.removeAll(); // Clear list before search\r\n\r\n // Get named items in the document or selection\r\n if (namedItems.length == 0) {\r\n if (selItems.length > 0 && !isInDoc.value) {\r\n namedItems = getNamedItems(selItems);\r\n } else {\r\n var layersItems = [];\r\n getLayersItems(doc.layers, layersItems);\r\n namedItems = getNamedItems(layersItems);\r\n }\r\n }\r\n\r\n resItems = getByName(nameInp.text, namedItems, isInText.value);\r\n\r\n // Create listbox rows from search results\r\n var newListItem;\r\n for (var i = 0, len = resItems.length; i < len; i++) {\r\n // If search only text contents\r\n if (isInText.value) {\r\n if (nameInp.text !== '') {\r\n newListItem = listbox.add('item', resItems[i].layer.name);\r\n // Show all entered text\r\n if (hasWhiteSpace(nameInp.text)) {\r\n newListItem.subItems[0].text = nameInp.text;\r\n } else {\r\n // Show the full word\r\n var fullWord = getFirstWord(resItems[i], nameInp.text);\r\n newListItem.subItems[0].text = fullWord;\r\n }\r\n }\r\n } else {\r\n newListItem = listbox.add('item', resItems[i].layer.name);\r\n // Trick for get Symbol name\r\n if (isSymbol(resItems[i]) && resItems[i].name == '') {\r\n newListItem.subItems[0].text = resItems[i].symbol.name;\r\n } else {\r\n newListItem.subItems[0].text = resItems[i].name;\r\n }\r\n }\r\n\r\n // Show item state using Unicode icons\r\n var tmpPrntState = [false, false];\r\n checkParentState(resItems[i], layersState, tmpPrntState);\r\n newListItem.subItems[1].text = (resItems[i].hidden || tmpPrntState[0]) ? '\\u2713' : '';\r\n newListItem.subItems[2].text = (resItems[i].locked || tmpPrntState[1]) ? '\\u2713' : '';\r\n }\r\n\r\n // Restore the search button label\r\n if (typeof search !== 'undefined') {\r\n search.text = LANG_SEARCH;\r\n dialog.update();\r\n }\r\n }", "title": "" }, { "docid": "00a9436ec56d546599a9ce8ffd32d545", "score": "0.6313396", "text": "function resultsScreen() {\n\t\tif (correctGuesses === questions.length) {\n\t\t\tvar endMessage = \"Great Job! You are on top of it\";\n\t\t\tvar bottomText = \"Rock ON!\";\n\t\t}\n\t\telse if (correctGuesses > incorrectGuesses) {\n\t\t\tvar endMessage = \"Good work! Keep them wheels turnin\";\n\t\t\tvar bottomText = \"You gotta Have Faith\";\n\t\t}\n\t\telse {\n\t\t\tvar endMessage = \"Your struggling\";\n\t\t\tvar bottomText = \"Listen a little more\";\n\t\t}\n\t\t$(\"#gameScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p>You got <strong>\" +\n\t\t\tcorrectGuesses + \"</strong> right.</p>\" +\n\t\t\t\"<p>You got <strong>\" + incorrectGuesses + \"</strong> wrong.</p>\");\n\t\t$(\"#gameScreen\").append(\"<h1 id='start'>Start Over?</h1>\");\n\t\t$(\"#bottomText\").html(bottomText);\n\t\tgameReset();\n\t\t$(\"#start\").click(nextQuestion);\n\t}", "title": "" }, { "docid": "12d3d0b8b79c2f10ed2cb056054c801d", "score": "0.63086134", "text": "function showResults() {\r\n\r\n if (strokeCount == 0)\r\n return;\r\n\r\n var dictOption = $('#dict:checked').val();\r\n var dictFilePath = 'data/tegaki/' + dictOption + '/' + strokeCount + '.json';\r\n \r\n// console.log('using dictionary DB:' + dictFilePath);\r\n \r\n var charsContainer;\r\n\r\n //clear previous recogination data\r\n $('#dictContainer').html('');\r\n \r\n //get match chars by Stroke Count \r\n $.getJSON(dictFilePath, function(data) {\r\n\r\n var newDictFilePath = 'data/tegaki/' + dictOption + '/' + (strokeCount+1) + '.json';\r\n \r\n $.getJSON(newDictFilePath, function(nextData) {\r\n var dictData = data.concat(nextData);\r\n \r\n var resultData = getMatchChars(dictData);\r\n\r\n charsContainer = $('<div class=\"row\"></div>');\r\n\r\n $.each(resultData, function(index, code) {\r\n\r\n var char = $('<div></div>').attr('class', \"col-md-2\").html('<span class=\"btn btn-default\" data-button=\"char\" >' + String.fromCharCode(code.code) + '</span>');\r\n charsContainer.append(char);\r\n });\r\n\r\n $('#dictContainer').append(charsContainer);\r\n });\r\n \r\n\r\n });\r\n\r\n }", "title": "" }, { "docid": "86c0d3dee59c8ffa07caaf18f3e2312b", "score": "0.6299332", "text": "function showResults(){\n ownPercentage = (correctAnswerCount / 10) * 100;\n\n //Create Result Elements\n let questions = document.querySelectorAll(\".question\");\n let answers = document.querySelectorAll(\"select.answerSelection\");\n let answersTable = ElementCreator.createAnswerTable();\n answersTable.appendChild(ElementCreator.createAnswerTableTopRow());\n for(let i = 0; i < answers.length; i++) {\n if(answers[i].value != rightAnswers[i]){\n answersTable.appendChild(ElementCreator.createAnswerTableRow(questions[i].innerText, answers[i].value, rightAnswers[i]));\n }\n }\n\n let ownResultElem = ElementCreator.createOwnResultArticle(ownPercentage);\n let averageOutputElem = ElementCreator.createAverageResultArticle(averagePercent);\n\n ownResultElem.appendChild(answersTable);\n\n //Remove all childs of questions div\n let contentDiv = document.getElementById('questions');\n while (contentDiv.firstChild) { contentDiv.removeChild(contentDiv.firstChild); }\n\n //Add Elements\n contentDiv.appendChild(ownResultElem);\n contentDiv.appendChild(averageOutputElem);\n}", "title": "" }, { "docid": "ed4d4cd8f9b819126c4546db9f8e511a", "score": "0.62679887", "text": "function resultsScreen() {\n\t\tif (correctGuesses === questions.length) {\n\t\t\tvar endMessage = \"You have proven yourself worthy. Are you perhaps a marine biologist?\" +\n\t\t\t\"<img src='assets/images/winning.gif' class='centerimage'>\";\n\t\t\tvar bottomText = \"#octopusLife\";\n\n\t\t}\n\t\telse if (correctGuesses > incorrectGuesses) {\n\t\t\tvar endMessage = \"Not bad! But surely you can do better. Right?\" +\n\t\t\t\"<img src='assets/images/dobetter.gif' class='centerimage'>\";\n\t\t\tvar bottomText = \"What's kraken bro?\";\n\t\t}\n\t\telse {\n\t\t\tvar endMessage = \"What happened? Are you ok?\" +\n\t\t\t\"<img src='assets/images/taunt.gif' class='centerimage'>\";\n\t\t\tvar bottomText = \"DONT TAUNT THE OCTOPUS\";\n\t\t}\n\t\t$(\"#gameScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p>You got <strong>\" + \n\t\t\tcorrectGuesses + \"</strong> right.</p>\" + \n\t\t\t\"<p>You got <strong>\" + incorrectGuesses + \"</strong> wrong.</p>\");\n\t\t$(\"#gameScreen\").append(\"<h1 id='start'>Start Over?</h1>\");\n\t\t$(\"#bottomText\").html(bottomText);\n\t\tgameReset();\n\t\t$(\"#start\").click(nextQuestion);\n\t}", "title": "" }, { "docid": "c00391144d3f9a818c6b0365efc64359", "score": "0.62649286", "text": "function resultsScreen() {\n\t\tif (correctGuesses > incorrectGuesses) {\n\t\t\tvar endMessage = \"Golazoooo! You are ready to hoist the cup!\";\n\t\t}\n\t\telse {\n\t\t\tvar endMessage = \"Crash and burn just like the Englishmen...\";\n\t\t}\n\t\t$(\"#gameScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p>You got <strong>\" + \n\t\t\tcorrectGuesses + \"</strong> right.</p>\" + \n\t\t\t\"<p>You got <strong>\" + incorrectGuesses + \"</strong> wrong.</p>\");\n\t\t$(\"#gameScreen\").append(\"<h1 id='start'>Start Over?</h1>\");\n\t\tgameReset();\n\t\t$(\"#start\").click(nextQuestion);\n\t}", "title": "" }, { "docid": "56f5c4feea73ea8c2bddc248ed67f6e0", "score": "0.62524474", "text": "function showResult(rightAnswers) {\n //Updates result page with correct score\n var score = document.getElementById(\"score\");\n score.innerHTML = rightAnswers;\n \n //Shows results page\n var result = document.getElementById(\"result\");\n result.className = \"visible\";\n}", "title": "" }, { "docid": "8824b730c773d576e5c516cae0e89a7a", "score": "0.6250926", "text": "function showResults(data) {\n $results.show(100);\n $deploymentId.val(data.deploymentId);\n $adminKey.val(data.adminKey);\n\n }", "title": "" }, { "docid": "3fc02b30db6b6b6668cc4d3bbd019256", "score": "0.62502956", "text": "function displayResult(choice) {\n\t$(`.results`).html(\n\t\t`<div class=\"wrapper main\">\n\t\t\t<div class=\"resultsContent\">\n\t\t\t\t<h2>Finally!</h2>\n\t\t\t\t<p>It's going to be:</p>\n\t\t\t\t<h3 class =\"resultText\">\"${choice}\"</h3>\n\t\t\t\t<a href = \"index.html\">\n\t\t\t\t\t<button class=\"resetButton\" aria-hidden=\"true\" title=\"Reset Button!\" tabindex=\"0\">\n\t\t\t\t\t\t<span class=\"sr-only visuallyHidden\">Start Quiz!</span>Poke me to Reset!\n\t\t\t\t\t</button>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</div>`\n\t)\n\t$(`.resetButton`).on(`click`, () => {\n\t\t// Note: location.reload(true) had to be used to fresh the page. If possible relook into other methods like .remove .empty...\n\t\tlocation.reload(true);\n\t})\n}", "title": "" }, { "docid": "29276157f9ec928ef9ea0f6eeea980ab", "score": "0.62424207", "text": "function results() {\n clearInterval(timer);\n \n $(\"#score\").html(\"<p>Final Results!</p>\");\n $(\"#score\").append(\"<p>You won a total of \" + wins + \" homes!</p>\");\n reset();\n\n }", "title": "" }, { "docid": "f01304506b19b07fc5d5b7750adea251", "score": "0.6235377", "text": "function displayResults(pokeName){\n\tvar newImg = 'images/' + pokeName + '.jpg'\n\tupdateImage(newImg);\n \n \tselectedPoke = pokeName;\n\n\tvar txtPokeName = capsLetter(pokeName);\n\n\tvar addTxt = document.createTextNode('Pokemon: ' + txtPokeName);\n\t$('pName').appendChild(addTxt);\n\n\tcreateForm();\n}", "title": "" }, { "docid": "7c7d84e91eea7765f6d8e35c5daffa9d", "score": "0.6235292", "text": "function OnResult( results ) \r\n{ \r\n var s = \"\"; \r\n var len = results.rows.length; \r\n // app.ShowPopup(len);\r\n for(var i = 0; i < len; i++ ) \r\n { \r\n \r\n var item = results.rows.item(i) \r\n s += item.id + \", \" + item.red + \", \" + item.green + \"\\n\"; \r\n \r\n var step = new Object;\r\n step.red=item.red;\r\n step.grn = item.green;\r\n seq.push(step);\r\n \r\n } \r\n txt.SetText( s ); \r\n //app.ShowPopup(\"i got \" + seqs.length + \"items\");\r\n //txt1.SetText(seq.length);\r\n\r\n}", "title": "" }, { "docid": "88d4aabe945313c6b0fc0afad6d8809c", "score": "0.6225098", "text": "function displayResultText(){\n\n //get the values from each of the select options\n var positionVal = document.getElementById(positionId).value;\n var countryVal = document.getElementById(countryId).value;\n var playerNumVal = document.getElementById(playerNumId).value;\n\n //get the JSON object path for the user's choice\n var finalChoice = sabres[positionVal][countryVal][playerNumVal];\n\n //create text to display result and add it to DOM\n var resultNode = document.createElement('h1');\n resultNode.setAttribute('id','resultNode');\n\n var resultNodeText = document.createTextNode('You picked #' +finalChoice.number+ ' ' +finalChoice.name+ ' from ' +finalChoice.country);\n\n resultNode.appendChild(resultNodeText);\n document.getElementById('resultText').appendChild(resultNode);\n document.getElementById('resultText').appendChild(addResetButton());\n fadeIn('resultText',25); \n rotateImg(degrees, 1);\n\n }", "title": "" }, { "docid": "5c031cad479ecd67ee079ad23e3e491c", "score": "0.62248594", "text": "function showResults() {\n document.getElementById(\"playButton\").style.display = \"none\";\n document.getElementById(\"playAgainButton\").style.display = \"inline\";\n document.getElementById(\"resultsHeader\").style.display = \"inline\";\n document.getElementById(\"results\").style.display = \"inline\";\n\n if (startingBet < 10) {\n // Floats 3 decimals if less than $10.00\n document.getElementById(\"startingBet\").innerText = \"$\" + parseFloat(startingBet).toPrecision(3);\n }\n else {\n // Floats 4 decimals if greater than $10.00\n document.getElementById(\"startingBet\").innerText = \"$\" + parseFloat(startingBet).toPrecision(4);\n }\n\n document.getElementById(\"totalRolls\").innerText = totalRolls;\n\n if (highestWon < 10) {\n // Floats 3 decimals if less than $10.00\n document.getElementById(\"highestWon\").innerText = \"$\" + parseFloat(highestWon).toPrecision(3);\n }\n else {\n // Floats 4 decimals if greater than $10.00\n document.getElementById(\"highestWon\").innerText = \"$\" + parseFloat(highestWon).toPrecision(4);\n }\n\n document.getElementById(\"rollCountAtHighest\").innerText = rollCountAtHighest;\n // console.log(balanceArray); // This can be used to match highestWon to its index (rollCountAtHighest)\n event.preventDefault();\n }", "title": "" }, { "docid": "3c079e096d248c4ec2a4e2875ab1c2e2", "score": "0.6224227", "text": "function showResults() {\n\t// Create a table object.\n\tvar tblResults = document.createElement('table');\n\ttblResults.style.border = \"solid\";\n\t\n\t// Insert the row and columns for the headers.\n\t// NOTE: Numbers aren't really needed. Only for specific insertion spots.\n\tvar row = tblResults.insertRow();\n\tvar colQuestion = row.insertCell(0);\n\tvar colUserAnswer = row.insertCell(1);\n\tvar colCorrectAnswer = row.insertCell(2);\n\t\t\n\t// Ajust the cell boarders.\n\tcolQuestion.style.border = \"solid\";\n\tcolUserAnswer.style.border = \"solid\";\n\tcolCorrectAnswer.style.border = \"solid\";\n\t\t\n\t// Set the headers in the cells.\n\tcolQuestion.innerHTML = '<b> Question </b>';\n\tcolUserAnswer.innerHTML = '<b> Your Answer </b>';\n\tcolCorrectAnswer.innerHTML = '<b> Correct Answer </b>';\n\t\n\t// Add a row for each question.\n\tfor (var i = 0; i < NUM_OF_QUESTIONS; i++) {\n\t\tvar row = tblResults.insertRow();\n\t\t\n\t\t// Insert the columns for the row.\n\t\tvar colQuestion = row.insertCell(0);\n\t\tvar colUserAnswer = row.insertCell(1);\n\t\tvar colCorrectAnswer = row.insertCell(2);\n\t\t\n\t\t// Ajust the cell boarders.\n\t\tcolQuestion.style.border = \"solid\";\n\t\tcolUserAnswer.style.border = \"solid\";\n\t\tcolCorrectAnswer.style.border = \"solid\";\n\t\t\n\t\tcolQuestion.innerHTML = testQuestions[i][0];\n\t\tcolUserAnswer.innerHTML = userAnswer[i][0];\n\t\t\t\n\t\t// If it's a translate question, then show the first correct answer.\n\t\tif (testQuestions[i][0].indexOf(\"Translate:\") >= 0) {\n\t\t\tcolCorrectAnswer.innerHTML = testQuestions[i][1][0];\n\t\t} else {\n\t\t\tcolCorrectAnswer.innerHTML = testQuestions[i][2];\n\t\t}\n\t\t\t\n\t\t// Colour the cell based on the user's answer.\n\t\t// Colour it green if it was correct.\n\t\tif (userAnswer[i][1] == \"Correct\") {\n\t\t\tcolUserAnswer.style.border += \"#008000\";\n\t\t// Otherwise, colour it red (for incorrect).\n\t\t} else {\n\t\t\tcolUserAnswer.style.border += \"#FF0000\";\n\t\t}\n\t}\n\t\n\t// Get the tag to insert the table.\n\tvar testCont = document.getElementById('testCont');\n\n\t// Show the user's score and some text to help the user understand what's shown/highlighted on the table.\n\ttestCont.innerHTML = \"<h2>You got \" + correct + \" of \" + NUM_OF_QUESTIONS + \" questions correct</h2>\";\n\ttestCont.innerHTML += \"<h5>The answers you entered that are highlighted <span style ='color:#008000'> GREEN </span> are CORRECT. \" +\n\t\t\t\t\t \"The answers highlighted in <span style ='color:#FF0000'> RED </span> are INCORRECT.</h5>\"\n\t\n\t// Show the table on the page.\n\ttestCont.appendChild(tblResults);\n\ttestCont.innerHTML += '<br><button onclick=\"location.reload()\"> Re-Test </a>';\n}", "title": "" }, { "docid": "84105c096510a3940fad10e15f3e991f", "score": "0.6209948", "text": "function goToResults() {\n endButton.style.display = \"none\";\n quizSolutionBox.style.visibility = \"hidden\";\n questionContainer.style.display = \"none\";\n document.getElementsByClassName(\"quiz-answers\")[0].style.display = \"none\";\n quizEndContainer.style.display = \"block\";\n quizScoreContainer.innerHTML = globalScore;\n}", "title": "" }, { "docid": "b93859bc81c747670039a437cdee67e8", "score": "0.62041223", "text": "function displayResults(results) {\n\t resultList.empty();\n\t $.each(results, function(i, item) {\n\t\n\t var newResult = $(\"<div class='result'>\" +\n\t \"<div class='title'>\" + \"Name: \" + item.name + \"</div>\" +\n\t \"<div>Language: \" + item.language + \"</div>\" +\n\t \"<div>Owner: \" + item.owner.login + \"</div>\" + \n\t \"</div>\");\n\t\n\t newResult.hover(function() {\n\t // make it darker\n\t $(this).css(\"background-color\", \"lightgray\");\n\t }, function() {\n\t // reverse\n\t $(this).css(\"background-color\", \"transparent\");\n\t });\n\t\n\t resultList.append(newResult);\n\t\n\t });\n\t }", "title": "" }, { "docid": "f4686d3d7b9e6c95028397b000195fc4", "score": "0.61945564", "text": "function displayResults() {\n\n $(\"#timeLeft\").hide();\n $(\"#question1\").hide();\n $(\"#answer1\").hide();\n $(\"#question2\").hide();\n $(\"#answer2\").hide();\n $(\"#question3\").hide();\n $(\"#answer3\").hide();\n $(\"#question4\").hide();\n $(\"#answer4\").hide();\n $(\"#question5\").hide();\n $(\"#answer5\").hide();\n $(\"#doneBtn\").hide();\n\n\n $(\"#finalMessage\").html(\"<h4>All Done!!</h4>\")\n $(\"#correct\").html(\"correct answers: \" + correctAnswers);\n $(\"#incorrect\").html(\"incorrect answers: \" + incorrectAnswers);\n $(\"#notAnswered\").html(\"Not answered: \" + notAnswered);\n}", "title": "" }, { "docid": "b87bae6f6ec894db38ef7eb70d15888d", "score": "0.619085", "text": "function resultsScreen() {\n\t\tif (correctGuesses === questions.length) {\n\t\t\tvar endMessage = \"Perfection! You truly know your Buffyverse\";\n\t\t\tvar bottomText = \"'Just because you’re better than us doesn’t mean you can be all superior.' – Xander Harris\";\n\t\t}\n\t\telse if (correctGuesses > incorrectGuesses) {\n\t\t\tvar endMessage = \"Good work! Just brush up on some Chosen One facts\";\n\t\t\tvar bottomText = \"'I may be dead, but I’m still pretty. Which is more than I can say for you.' – Buffy Summers\";\n\t\t}\n\t\telse {\n\t\t\tvar endMessage = \"Try again after watching the series! It's a great show\";\n\t\t\tvar bottomText = \"'Strangely, I feel like staying at home… and doing my homework… and flossing… and dying a virgin.' – Willow Rosenberg\";\n\t\t}\n\t\t$(\"#gameScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p>You got <strong>\" + \n\t\t\tcorrectGuesses + \"</strong> right.</p>\" + \n\t\t\t\"<p>You got <strong>\" + incorrectGuesses + \"</strong> wrong.</p>\");\n\t\t$(\"#gameScreen\").append(\"<h1 id='start'>Start Over?</h1>\");\n\t\t$(\"#bottomText\").html(bottomText);\n\t\tgameReset();\n\t\t$(\"#start\").click(nextQuestion);\n\t}", "title": "" }, { "docid": "32149b6917c6724a338b2231e846bd97", "score": "0.6184684", "text": "function results() {\n if (totalVotes === 25) {\n var resultsList = document.getElementById('results');\n var title = document.createElement('h2');\n title.textContent = 'Results';\n resultsList.appendChild(title);\n displayChart();\n\n percentClicked();\n //add list items to display votes for each product\n for (var i = 0; i < Product.allProducts.length; i++) {\n var results = document.getElementById('results');\n var votes = document.createElement('li');\n votes.textContent = `${Product.allProducts[i].votes} votes for the ${Product.allProducts[i].name} with ${clicked[i]}%`;\n results.appendChild(votes);\n }\n }\n}", "title": "" }, { "docid": "a819b18644afe77b5ee0754315dc98fe", "score": "0.6183123", "text": "function displayResults3(){\r\n\t\r\n\r\n$(\"#challenge3-results1\").text(totalBytes(psinsights));\r\n$(\"#challenge3-results2\").text(ruleList(psinsights));\r\n\r\n}", "title": "" }, { "docid": "12c1c1a7e93deb6b4f27f0d0f24dfea2", "score": "0.6179744", "text": "function showResultsScreen() {\n $('#data-vis-next').addClass('d-none');\n $('#data-vis-performance').addClass('d-none');\n\n $('#data-vis-restart').removeClass('d-none');\n $('#data-vis-results-chart').removeClass('d-none');\n}", "title": "" }, { "docid": "6861678e3f55462cce60e9754784eeec", "score": "0.6178103", "text": "function results () {\n $(\"#gameDisplay\").html(\n \"<h1>Here's your score!</h1>\" +\n \"<h1>Correct Answers: \" + correctGuess + \"</h1>\" +\n \"<h1>Incorrect Answers: \" + incorrectGuess + \"<h1>\" \n );\n $(\"#gameDisplay\").append(\"<h1 id='start'>Try Again?</h1>\");\n gameReset();\n $(\"#gameDisplay\").click(nextQuestion);\n}", "title": "" }, { "docid": "362fe8e4e97278fe7ebf2fd1ef7648ab", "score": "0.6177728", "text": "function showResult(evt){\n\tconsole.log(evt.results);\n\t\ttextBox.value = evt.results[0][0].transcript;\n\n}", "title": "" }, { "docid": "4744108278d5196c096751da76481dc3", "score": "0.6175766", "text": "function animateResults(values)\n {\n $resultBox.show();\n $resultBox[0].scrollTop = 0;\n $resultBox.empty();\n\n var resultList = $('<ul />');\n $.each(values, function(i, value) {\n var li = document.createElement('li');\n li.appendChild(document.createTextNode(value));\n resultList.append(li);\n });\n\n $resultBox.append(resultList);\n\n $resultBox.animate({\n scrollTop: $resultBox[0].scrollHeight\n });\n }", "title": "" }, { "docid": "cedb79bca449d3858bfd9593c9e35234", "score": "0.61641395", "text": "function renderResultPage() {\n $('body').html(createResultsPage());\n restartQuiz();\n quizChoices();\n //render results on DOM\n}", "title": "" }, { "docid": "7eea3ed1a04cfdbfef652b19327e0df5", "score": "0.61640495", "text": "function printResults() {\r\n\t$ES('.mousepopup').each(function(el){el.setStyle('visibility','hidden')});\r\n\t\r\n\tMoCheck.sortArbeiten();\r\n\t\r\n\tTasks.add_task_queue_xhtml($('moWork_task_queue'), {hide_info_full: true});\r\n\tif(MoCheck.getAktArbeiten().length > 0) {\r\n\t\r\n\t\twindow.addEvent('domready', MoCheck.divInject.bind(Ajax,[$('moWorkList'), MoCheck.getTable()]));\r\n\t\r\n\t\t/* Buttons aktivieren */\r\n\t\t$each(MoCheck.getAktArbeiten(), function(aktJob, index) {\r\n\t\t\t//aktJob.window muss neu geladen werden, da zum Zeitpunkt der Variableninitialisierung noch nichts da war\r\n\t\t\taktJob.window = $('window_Mojob_' + aktJob.getKey());\r\n\t\t\t\r\n \t\t\taktJob.button = new Button('ok', 'normal', 'button_start_task_Mojob_'+aktJob.getKey(), aktJob.start.bind(aktJob));\r\n \t\t\t\r\n\t\t\t/* Nach jedem Klick neu Laden */\r\n\t\t\taktJob.button.el.addEvent('click',function(){\r\n\t\t\t\tMoCheck.setWayTimeInfo(aktJob);\r\n\t\t\t});\r\n\t\t});\r\n\t\tMoCheck.setWayTimeInfo();\r\n\t} else {\r\n\t\t$('moWorkList').innerHTML = \r\n\t\t\t\t\"<div style='text-align:center;'><br />\" +\r\n\t\t\t\t\"\t<h2>\" + MoCheck.getString('dialog.tab.work.nothingSelected.1') + \"</h2><br />\" +\r\n\t\t\t\t\tMoCheck.getString('dialog.tab.work.nothingSelected.2') +\r\n\t\t\t\t\"</div>\";\r\n\t}\r\n\t\r\n\twindow.addEvent('domready', AjaxWindow.setJSHTML.bind(AjaxWindow,[$('moConf'), MoCheck.getConfigurationTab()]));\r\n\twindow.addEvent('domready',function(){$('moAktListInfo').innerHTML = MoCheck.getString('dialog.aktListInfo', MoCheck.aktListe);});\r\n}", "title": "" }, { "docid": "5ed64804cfdd70a64d01d39347e76bdb", "score": "0.6159247", "text": "function renderResults(){\n\tconst resultsHTML = generateResults();\n\t$('.main-viewport').html(resultsHTML); \n}", "title": "" }, { "docid": "b21d91c2069b75a525105bc62528bc4e", "score": "0.61562866", "text": "function showResults() {\n let tests = qsa(\".test\");\n tests[testCount - 1].classList.toggle(\"hidden\");\n\n if (correctCount >= 2) {\n id(\"badge\").innerHTML = \"\";\n badgeCount++;\n let badgeImg = gen(\"img\");\n badgeImg.src = BADGE_ARRAY[testCount - 1].src;\n let badgeCap = gen(\"figcaption\");\n badgeCap.textContent = BADGE_CAP_ARRAY[testCount - 1];\n\n let badgeEl = gen(\"figure\");\n\n badgeEl.appendChild(badgeImg);\n badgeEl.appendChild(badgeCap);\n\n addToTote();\n\n id(\"badge\").appendChild(badgeEl);\n id(\"got-badge\").classList.toggle(\"hidden\");\n\n } else {\n id(\"no-badge\").classList.toggle(\"hidden\");\n }\n\n let continueBtns = qsa(\".continue\");\n for (let i = 0; i < continueBtns.length; i++) {\n continueBtns[i].addEventListener(\"click\", nextTest);\n }\n\n testCount++;\n }", "title": "" }, { "docid": "9c5f23b4e6d14c1289106cab5c9d9073", "score": "0.614927", "text": "function displayResults(){\n tilesDiv = document.createElement('div');\n var tilesPosition = document.getElementsByClassName(\"card-holder\")[0];\n tilesPosition.appendChild(tilesDiv);\n\n $(\"table\").hide();\n $(calcButton).hide();\n $(backButton).show();\n Object.keys(currencySums).forEach(function(key,index) {\n // key: the name of the object key\n // index: the ordinal position of the key within the object \n currencyValues = currencySums[key];\n var currencyTile = createTileForCoin(currencyValues);\n tilesDiv.appendChild(currencyTile);\n });\n }", "title": "" }, { "docid": "6fd48124a1f06a446a38680850df0c26", "score": "0.6146654", "text": "function displayResults(results) {\r\n resultList.empty();\r\n $.each(results, function(i, item) {\r\n\r\n var newResult = $(\"<div class='result'>\" +\r\n \"<div class='title'>\" + item.name + \"</div>\" +\r\n \"<div>Language: \" + item.language + \"</div>\" +\r\n \"<div>Owner: \" + item.owner.login + \"</div>\" +\r\n \"</div>\");\r\n\r\n\t //Add honver effects of the display result\r\n newResult.hover(function() {\r\n // make it darker\r\n $(this).css(\"background-color\", \"lightgray\");\r\n }, function() {\r\n // reverse\r\n $(this).css(\"background-color\", \"transparent\");\r\n });\r\n\r\n resultList.append(newResult);\r\n\r\n });\r\n }", "title": "" }, { "docid": "9fc42b26d4202dcb551d7f047a82f8c5", "score": "0.61421293", "text": "function renderResultsView() {\n const resultsScreen = generateFinalResultsView();\n $('.container').html(resultsScreen);\n}", "title": "" }, { "docid": "ed65729be720dd2091a00e5a6dae5dbe", "score": "0.6140877", "text": "function resultsScreen() {\n if (correctGuesses === questions.length) {\n var endMessage = \"Groovy\";\n var bottomText = \"#nerdalert!\";\n }\n else if (correctGuesses > incorrectGuesses) {\n var endMessage = \"hmmmm, try again!...\";\n var bottomText = \"come on\";\n }\n else {\n var endMessage = \"boooooo!\";\n var bottomText = \"#scrub\";\n }\n $(\"#gameScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p>You got <strong>\" +\n correctGuesses + \"</strong> right.</p>\" +\n \"<p>You got <strong>\" + incorrectGuesses + \"</strong> wrong.</p>\");\n $(\"#gameScreen\").append(\"<h1 id='start'>Start Over?</h1>\");\n $(\"#bottomText\").html(bottomText);\n gameReset();\n $(\"#start\").click(nextQuestion);\n }", "title": "" }, { "docid": "bbf14acf24b4f59cb2af1c91208da542", "score": "0.6138962", "text": "showResult() {\n const winner = document.getElementById(\"winner-name\");\n const motmName = document.getElementById(\"motm-name\");\n const motmTeam = document.getElementById(\"motm-team\");\n const motmScore = document.getElementById(\"motm-score\");\n\n this.winner = this.getWinner();\n this.motm = this.getMotm(this.winner);\n\n winner.textContent = this.winner.getTeamName();\n motmName.textContent = this.motm.getPlayerName();\n motmTeam.textContent = this.winner.getTeamName();\n motmScore.textContent = `SCORE : ${this.motm.total}`;\n }", "title": "" }, { "docid": "fed1cd840fcfb90d5f5712bbfb1ceb6a", "score": "0.61367404", "text": "function queryBox() {\n\t$.ajax(\"query_box.php\", \n\t\t{\n\t\t\tsuccess: function(data) {\n\t\t\t\t$(\"#num_box\").html(data);\n\t\t\t\tvar cnt = $(\"#num_box option\").length - 1;\n\t\t\t\t$(\"#label_box\").text(\"Box\" + (cnt > 0 ? (\" (\" + cnt + \"):\") : \":\"));\n\t\t\t},\n\t\t\terror: function(xhr, status, err) {\n\t\t\t\talert(err);\n\t\t\t},\n\t\t\tdata: currentQuery(),\n\t\t\tdataType: \"html\"\n\t\t}\n\t);\n}", "title": "" }, { "docid": "cb2b2f4a5440f001424c96df49562e21", "score": "0.6133405", "text": "function drawResults() {\n const outDiv = document.getElementById('output');\n\n const n1 = parseInt(document.getElementById('num1').value);\n const n2 = parseInt(document.getElementById('num2').value);\n if (isNaN(n1) || isNaN(n2)) {\n outDiv.innerText = 'Please enter a number for \"Number 1\" and \"Number 2\".';\n return;\n }\n\n const addChecked = document.getElementById('add').checked;\n const subChecked = document.getElementById('subtract').checked;\n const mulChecked = document.getElementById('multiply').checked;\n const divChecked = document.getElementById('divide').checked;\n if (!addChecked && !subChecked && !mulChecked && !divChecked) {\n outDiv.innerText = 'Please check at least one operation to perform.';\n return;\n }\n\n const table = generateTable(n1, n2, addChecked, subChecked, mulChecked, divChecked);\n outDiv.innerHTML = '';\n outDiv.appendChild(table);\n}", "title": "" }, { "docid": "898886a5513ebc909a4c72747fc4b688", "score": "0.61325806", "text": "function DisplayFinalResults()\n{ \n let str = \"90 A 80 B 70 C 60 D 50 F\";\n let parsed = str.split(' ');\n let grade = \"F\";\n let percentage = score / DataBase.length * 100;\n\n for(let i=0; i<parsed.length; i+=2)\n {\n if( percentage > parsed[i])\n {\n grade = parsed[i+1];\n break;\n }\n }\n\n $('#question-form').empty();\n let styles = ['finalresult'];\n let resultString = `Grade: ${grade}<br>${score} questions correct out of ${DataBase.length}`;\n let resultLabel = CreateTagString('legend', styles, resultString, [['id', 'cbquestion']]);\n $('#question-form').append(resultLabel);\n\n DisplayStartButton('Restart');\n SetBackgroundHighlight(-1, questionIndex);\n}", "title": "" }, { "docid": "9946dcf1de65488f25fbd9e6b57c4569", "score": "0.61274177", "text": "function showResults(results) {\n\t\t\t//console.log(\"Some results:\", results);\n\t\t\tif (results.features.length == 1) {\n\t\t\t\tvar featureAttributes = results.features[0].attributes;\n\t\t\t\tfor (var att in featureAttributes) {\n\t if (att == \"Short_Desc\") $(\"#legalDes\").val(featureAttributes[att]);\n\t else if (att == \"SNID\") $(\"#section\").val(featureAttributes[att]);\n\t else if (att == \"TNID\") $(\"#twp\").val(featureAttributes[att]);\n\t else if (att == \"RNID\") $(\"#range\").val(featureAttributes[att]);\n\t else if (att == \"MCD\") $(\"#townV\").val(featureAttributes[att]);\n\t }\n\t // alert user to updated fields\n\t $(\"#fieldUpdate\").text(\"Some fields have been filled in based on your Tax ID. Please fill in the remaining fields.\")\n\t\t\t} else {\n\t\t\t\tconsole.log(results.features.length);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "859c3b6939beca249ae4577837b470e2", "score": "0.6123125", "text": "function showResult () {\n\tvar tag = 'Result';\n\tvar container = $('.mainEventContainerResult');\n\tcontainer.window({closed:false,modal:false,title:tag,draggable:false,resizable:false,minimizable:false,maximizable:false,collapsible:false});\n\tcontainer.panel({\n\t\thref:tag,\n\t\t\n\t\tonLoad: function(){\n\t\t\t/*var audioElement = document.createElement('audio');\t\n\t\t\taudioElement.setAttribute('src', 'audio/location.mp3');\n\t\t\tvar audiosetting=\"false\";\n\t\t\taudiosetting=getCookie(\"audio\");\n\t\t\tif (audiosetting == \"true\") {\n\t\t\taudioElement.play();\t}*/\n\t\t\t\n\t\t\tdocument.getElementById(\"cost\").innerHTML=\"100%\";\n\t\t\tdocument.getElementById(\"time\").innerHTML=\"100%\";\n\t\t\tdocument.getElementById(\"quality\").innerHTML=\"100%\";\n\t\t\t\n\t\t\n\t\t\t$(this).find('#imprint').bind('click', function(){\n\t\t\t\tshowImprint();\n\t\t\t});\n\n\t\t\t$(this).find('#help').bind('click', function(){\n\t\t\t\tshowPdf('documents/BA_notizblock.pdf');\n\t\t\t});\n\n\t\t\t$(this).find('#logout').bind('click', function(){\n\t\t\t\tsessionStorage.removeItem('userid');\n\t\t\t\twindow.location.href = 'LogoutUser';\n\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "5dccad32cd88ee432cd155af9d005196", "score": "0.6120359", "text": "function displayResults() {\n //delete old results, if there is any\n $('#results').empty();\n //display new results\n for (i = 0; i < searchResults.length; i++) {\n var html = generateResultHTML(searchResults[i]);\n $('#results').append(html);\n// allow users to add songs to playlist\n// not placed in page_start function as search result was not loaded then\n }\n}", "title": "" }, { "docid": "f58520cda384f5439ab6fc7ab3992fc9", "score": "0.6119351", "text": "function showResults (results)\n {\n\n //console.log(\"results\");\n //console.log(results.features[0].geometry.x);\n\n //Determine the number of questions in the feature service\n resultCount = results.features.length;\n //console.log(\"results Length: \" + resultCount);\n\n for (var i = 0; i < resultCount; i++)\n {\n var featureAttributes = results.features[i].attributes;\n //console.log(featureAttributes);\n resultItems.push(results.features[i].attributes[\"Question1\"]);\n resultAnswerItems.push(results.features[i].attributes[\"Answer1\"]);\n answerPoint = new esri.geometry.Point(results.features[i].geometry.x, results.features[i].geometry.y, results.features[i].geometry.spatialReference);\n answerPointItems.push(answerPoint);\n //console.log(\"resultItems[\" + i + \"]: \" + resultItems[i]);\n //console.log(\"resultAnswerItems[\" + i + \"]: \" + resultAnswerItems[i]);\n // for (var attr in featureAttributes) {\n // console.log(\"attr: \" + attr)\n // console.log(\"feater Attributes: \" + featureAttributes[attr]);\n // resultItems.push(featureAttributes[i].attributes[\"Question1\"]);\n // }\n }\n showRes();\n }", "title": "" }, { "docid": "529eea56db052c9a2fdbf35dd4e65c3c", "score": "0.6117898", "text": "function printResults() {\n if(results.length === 0) {\n inputError();\n } else {\n generateHTML(results, resultList);\n resultItems = document.querySelectorAll('.js-serie-container');\n createEventListener(resultItems, handlerClickfavourite);\n }\n}", "title": "" }, { "docid": "fada101d9dc9eae3e1ea77ff4a1f405e", "score": "0.61120373", "text": "function inputResults() {\n let resultsHeader = document.getElementById(\"results-of-search\");\n resultsHeader.innerHTML = resultsJSON.data.results.length + \" Results for \\\"\" + inputValue + \"\\\"\";\n\n let body = document.getElementById(\"body\");\n body.style.overflowY = \"visible\";\n\n\n\n }", "title": "" }, { "docid": "749a860fbaf549de33366d99c7e4a362", "score": "0.6108478", "text": "function displayResults(playerScore, computerScore) {\n\t\t\tpScore.textContent = `Your score: ${playerScore}`;\n\t\t\tcScore.textContent = `Computer's score: ${computerScore}`;\n\t\t\tresultsContainer.appendChild(pScore);\n\t\t\tresultsContainer.appendChild(cScore);\t\n\t\t\t}", "title": "" }, { "docid": "0a72af037907dc71e8c368a167061ac2", "score": "0.61073756", "text": "function displayResultsText () {\n\n imageSpace.innerHTML = '';\n\n var displaySpace = addElement('ul', imageSpace);\n\n //Add each item as a 'li' to the page\n for (var i = 0; i < StoreItem.all.length; i++) {\n\n var currentItem = StoreItem.all[i];\n\n var content = `${currentItem.name} had ${currentItem.clicks} votes and was seen ${currentItem.views} times.`;\n\n addElement('li', displaySpace, content);\n\n }\n\n}", "title": "" }, { "docid": "22a0123e2b52916f4cd6140014c744de", "score": "0.6105242", "text": "function showResult () {\n\tvar tag = 'Result';\n\tvar container = $('.mainEventContainerResult');\n\tcontainer.window({closed:false,modal:false,title:tag,draggable:false,resizable:false,minimizable:false,maximizable:false,collapsible:false});\n\tcontainer.panel({\n\t\thref:tag,\n\t\tonLoad: function(){\n\t\t\tvar audioElement = document.createElement('audio');\t\n\t\t\taudioElement.setAttribute('src', 'audio/location.mp3');\n\t\t\tvar audiosetting=\"false\";\n\t\t\taudiosetting=getCookie(\"audio\");\n\t\t\tif (audiosetting == \"true\") {\n\t\t\taudioElement.play();\t}\n\t\t\t\n\t\t\tdocument.getElementById(\"cost\").innerHTML=gameData.imcost+\"%\";\n\t\t\tdocument.getElementById(\"time\").innerHTML=gameData.imtime+\"%\";\n\t\t\tdocument.getElementById(\"quality\").innerHTML=gameData.imqual+\"%\";\n\t\t\t\n\t\t\tsetTCQImages(gameData.imtime, gameData.imcost, gameData.imqual);\n\t\t\t$(this).find('#imprint').bind('click', function(){\n\t\t\t\tshowImprint();\n\t\t\t});\n\n\t\t\t$(this).find('#help').bind('click', function(){\n\t\t\t\tshowPdf('documents/help.pdf');\n\t\t\t});\n\n\t\t\t$(this).find('#logout').bind('click', function(){\n\t\t\t\tsessionStorage.removeItem('userid');\n\t\t\t\twindow.location.href = 'LogoutUser';\n\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1f24fc2e6595401159b09c228ab24081", "score": "0.61015725", "text": "function showResult() {\n\t\t$('#results').remove();\n\t\t$('#exportCSS').css('border', 'inset 2px #ababab');\n\t\tsetTimeout(() => {\n\t\t\t$('#exportCSS').css('border', 'outset 2px #ababab');\n\t\t}, 200);\n\t\t//build results window\n\t\tlet resultList = $('<ul id=\"results\" class=\"tool\">');\n\t\tlet allhtml = $('body').find('*');\n\t\tlet dupChecker = [];\n\t\tfor(let element of allhtml) {\n\t\t\telement=$(element);\n\t\t\t//reject toolbar css\n\t\t\tif(element.hasClass('tool')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//only add css for program-modified items (and inline styled elements)\n\t\t\tif(element.prop('style').cssText) {\n\t\t\t\t//reject duplicate tags\n\t\t\t\tif (dupChecker.indexOf(element.prop('tagName'))!== -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//append list to avoid duplicate entries\n\t\t\t\tdupChecker.push(element.prop('tagName'));\n\t\t\t\t//create new list\n\t\t\t\tlet cssRule = $('<li>' + element.prop('tagName') + ' {' + element.prop('style').cssText + '}</li>');\n\t\t\t\tresultList.append(cssRule);\n\t\t\t}\n\t\t}\n\t\t//include body if changes were made to entire document\n\t\tif($('body').prop('style').cssText) {\n\t\t\tresultList.append($('<li>BODY {' + $('body').prop('style').cssText + '}</li>'));\n\t\t}\n\t\t$('#toolbar').append(resultList);\n\t}", "title": "" }, { "docid": "774b056815701ecb6c21ba4825b92ac6", "score": "0.60941505", "text": "function displayFinalResults(correct, wrong, none) {\n $(\"#correct-answers\").html(\"Number of Correct Answers: \" + correct);\n $(\"#wrong-answers\").html(\"Number of Wrong Answers: \" + wrong);\n $(\"#unanswered\").html(\"Number of Unanswered: \" + none);\n }", "title": "" }, { "docid": "db0019a0b689c8c8e7dda89454f7df8d", "score": "0.6092589", "text": "function openResultsTotalContainer() {\n\n $scope.resultsTotalContainer.visible = true;\n //Populating with user choices\n _.each($scope.activityData.questions, function (question, key, list) {\n var fullSentence = \"\";\n _.each($scope.activityData.questions[key].userChoices, function (word, k, list) {\n fullSentence += $scope.activityData.questions[key].userChoices[k];\n });\n $scope.userAnswersTexts[key].text = key + 1 + \". \" + fullSentence;\n });\n\n }", "title": "" }, { "docid": "a6aba9090907112ac1c48eb78ba566e2", "score": "0.6091925", "text": "function displayResults(result, equation, error) {\r\n\r\n\tif (error) {\r\n\t\t$(\".inputScreen\").addClass(\"warningScreen\");\r\n\t\t$(\".currentEntry\").text(equation);\r\n\t\t$(\".totalEntry\").text(result);\r\n\t\ttotalEntry = \"\";\r\n\t\thasError = true;\r\n\t} else {\r\n\t\t$(\".currentEntry\").text(result);\r\n\t\t$(\".totalEntry\").text(equation + \"=\" + result);\r\n\t\ttotalEntry = result;\r\n\t}\r\n\tcurrentEntry = \"\";\r\n\thitEqual = true;\r\n}", "title": "" }, { "docid": "7df8d3cd43b246aea184030182f12517", "score": "0.60912335", "text": "function onResultsPostLayout() {\n $.searchResults.setVisible(true);\n $.results_contents.setVisible(true);\n $.lookup_window.setVisible(true);\n $.search_form_container.setVisible(true);\n}", "title": "" }, { "docid": "1db6d993dd4966eb35969c7c7c0af803", "score": "0.60828555", "text": "function results() {\n var result = `\n <h4>You correctly answered ${corrAnswers} questions</h4>\n <h4>You missed ${missedAnswers} questions</h4>\n <h4>The total number of question is ${triviaQuestions.length}</h4>\n <button id=\"reset-button\">Reset Game</button>\n `;\n\n $(\"#app\").html(result);\n }", "title": "" }, { "docid": "929f61f845ed84047454839b1637cb09", "score": "0.6078206", "text": "function displayResult () {\n var result = `\n <p>${score}/${availableQuestions.length} question(s) correct</p>\n <p>${lost}/${availableQuestions.length} question(s) missed</p>\n ` //end of result\n\n $(\"#score\").html(result);\n $(\"#triviaGame\").html(`<button class=\"btn btn-primary btn-choices\" id=\"reset\">Reset Game</button>`)\n}", "title": "" }, { "docid": "e59a6e3ab07d4acd277b7554a175bd0d", "score": "0.6078118", "text": "function _drawResults() {\n let template = \"\";\n STORE.state.songs.forEach(song => {\n template += song.Template;\n });\n document.getElementById(\"songs\").innerHTML = template;\n}", "title": "" }, { "docid": "fe563d8893191293aa94f2f97cad458c", "score": "0.6076351", "text": "function showResults(){\n console.log('Final Score: ', score);\n console.log('Thanks for Playing!');\n\n calculateRank();\n}", "title": "" }, { "docid": "b9d240a1585432ed916dd4268bb3acda", "score": "0.60734147", "text": "function openResultPane() { toggleResultPane(true); }", "title": "" }, { "docid": "1a8f39e7bc96ad9c190cf12d299666e4", "score": "0.607226", "text": "async function showResults() {\n\t\tconst check = checkCurrentSlide();\n\t\tif (!check) {\n\t\t\t$('#errorModal').modal();\n\t\t} else {\n\t\t\tlet numCorrect = 0;\n\n\t\t\tconst slides = quizContainer.querySelectorAll('div.slide');\n\t\t\tslides.forEach(slide => {\n\t\t\t\tconst cups = slide.querySelectorAll('div.horizontal > div.cup');\n\n\t\t\t\tconst answers = createAnwersStore(cups);\n\n\t\t\t\tconst calculatedAnswers = answers\n\t\t\t\t\t.map(x => x.reduce((p, n) => p + n, 0))\n\t\t\t\t\t.every((x, n, a) => a[n] === a[0]);\n\t\t\t\tif (calculatedAnswers) {\n\t\t\t\t\tnumCorrect += 1;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// stop the timer\n\t\t\tstartStopCounter();\n\n\t\t\t// show number of correct answers out of total and get feedback\n\t\t\tconst percent = (numCorrect / quiz.questions.length) * 100;\n\t\t\tconst rounded_number = Math.round(percent * 100) / 100;\n\t\t\tresultsContainer.innerHTML = `You scored ${numCorrect} out of ${quiz.questions.length} (${rounded_number}%)`;\n\n\t\t\t// get the user personality data from mongo\n\t\t\tconst personalityData = await getPersonalityData();\n\n\t\t\t// get feedback from alg1.js and put on page\n\n\t\t\tconst feedback = getFeedback(rounded_number, personalityData);\n\n\t\t\tfeedbackContainer.innerHTML = feedback;\n\n\t\t\t// push results to mongo\n\t\t\tpushResults(quiz._id, rounded_number, feedback, getQuizTime());\n\n\t\t\t// disable buttons to prevent user navigation\n\t\t\t$('#submit').prop('disabled', true);\n\t\t\t$('#previous').prop('disabled', true);\n\t\t}\n\t}", "title": "" }, { "docid": "0885acec58d411c458ba821fc210ac8f", "score": "0.6064609", "text": "function rd_AverageTrackers_buildUI(thisObj)\r\n\t{\r\n\t\tvar pal = new Window(\"dialog\", rd_AverageTrackersData.scriptName, undefined, {resizeable:true});\r\n\t\t\r\n\t\tif (pal !== null)\r\n\t\t{\r\n\t\t\tvar res =\r\n\t\t\t\"\"\"group { \r\n\t\t\t\torientation:'column', alignment:['fill','fill'], \r\n\t\t\t\theading: StaticText { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strHeading) + \"\"\"', alignment:['fill','top'] }, \r\n\t\t\t\tlst: ListBox { alignment:['fill','fill'], properties:{ multiselect:true } }, \r\n\t\t\t\tcap: StaticText { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strCaption) + \"\"\"', alignment:['fill','bottom'] }, \r\n\t\t\t\tcmds: Group { \r\n\t\t\t\t\talignment:['fill','bottom'], \r\n\t\t\t\t\thelp: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strHelp) + \"\"\"', maximumSize:[30,20], alignment:['left','bottom'] }, \r\n\t\t\t\"\"\";\r\n\t\t\tif (onWindows)\r\n\t\t\t\tres += \"\"\" \r\n\t\t\t\t\tokBtn: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strOK) + \"\"\"', alignment:['right','bottom'], preferredSize:[-1,20] }, \r\n\t\t\t\t\tcancelBtn: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strCancel) + \"\"\"', alignment:['right','bottom'], preferredSize:[-1,20] }, \r\n\t\t\t\t\"\"\";\r\n\t\t\telse\r\n\t\t\t\tres += \"\"\" \r\n\t\t\t\t\tcancelBtn: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strCancel) + \"\"\"', alignment:['right','bottom'], preferredSize:[-1,20] }, \r\n\t\t\t\t\tokBtn: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strOK) + \"\"\"', alignment:['right','bottom'], preferredSize:[-1,20] }, \r\n\t\t\t\t\"\"\";\r\n\t\t\tres += \"\"\" \r\n\t\t\t\t}, \r\n\t\t\t}\"\"\";\r\n\t\t\tpal.grp = pal.add(res);\r\n\t\t\t\r\n\t\t\tpal.grp.cmds.margins.top = 5;\r\n\t\t\tpal.grp.lst.preferredSize.height = 100;\r\n\t\t\t\r\n\t\t\tpal.layout.layout(true);\r\n\t\t\tpal.grp.minimumSize = pal.grp.size;\r\n\t\t\tpal.layout.resize();\r\n\t\t\tpal.onResizing = pal.onResize = function () {this.layout.resize();}\r\n\t\t\t\r\n\t\t\tpal.grp.cmds.help.onClick = function () {alert(rd_AverageTrackersData.scriptTitle + \"\\n\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strHelpText), rd_AverageTrackersData.scriptName);}\r\n\t\t\tpal.grp.cmds.okBtn.onClick = rd_AverageTrackers_doIt;\r\n\t\t}\r\n\t\t\r\n\t\treturn pal;\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// rd_AverageTrackers_getMTTrackPoints()\r\n\t// \r\n\t// Description:\r\n\t// This function retrieves the motion tracker track points on the specified layer.\r\n\t// \r\n\t// Parameters:\r\n\t// layer - The layer to check.\r\n\t// \r\n\t// Returns:\r\n\t// Array of motion tracker track points\r\n\t//\r\n\tfunction rd_AverageTrackers_getMTTrackPoints(layer)\r\n\t{\r\n\t\tvar mtPts = new Array();\r\n\t\t\r\n\t\tif (layer !== null)\r\n\t\t{\r\n\t\t\tvar mtGroup = layer(\"ADBE MTrackers\");\r\n\t\t\tif (mtGroup !== null)\r\n\t\t\t{\r\n\t\t\t\tvar mtracker;\r\n\t\t\t\t\r\n\t\t\t\tfor (var i=1; i<=mtGroup.numProperties; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tmtracker = mtGroup.property(i);\r\n\t\t\t\t\tfor (var j=1; j<=mtracker.numProperties; j++)\r\n\t\t\t\t\t\tmtPts[mtPts.length] = mtracker.property(j); \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn mtPts;\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// rd_AverageTrackers_doIt()\r\n\t// \r\n\t// Description:\r\n\t// This callback function performs the main operation.\r\n\t// \r\n\t// Parameters:\r\n\t// None.\r\n\t// \r\n\t// Returns:\r\n\t// Nothing\r\n\t//\r\n\tfunction rd_AverageTrackers_doIt()\r\n\t{\r\n\t\tvar selection = this.parent.parent.lst.selection;\r\n\t\t\r\n\t\tapp.beginUndoGroup(rd_AverageTrackersData.scriptName);\r\n\t\t\r\n\t\tvar comp = app.project.activeItem;\r\n\t\tvar layer = comp.selectedLayers[0];\r\n\t\tvar nullLayer = comp.layers.addNull();\r\n\t\t\r\n\t\tnullLayer.name = \"Average\";\r\n\t\t\r\n\t\tvar mt;\r\n\t\tvar expr = \"l = thisComp.layer(\\\"\" + layer.name + \"\\\");\\n(\";\r\n\t\tfor (var i=0; i<selection.length; i++)\r\n\t\t{\r\n\t\t\tmt = rd_AverageTrackersData.mtPts[selection[i].index];\r\n\t\t\tif (i > 0)\r\n\t\t\t\texpr += \" + \";\r\n\t\t\texpr += \"l.motionTracker(\\\"\" + mt.parentProperty.name + \"\\\")(\\\"\" + mt.name + \"\\\").attachPoint+l.motionTracker(\\\"\" + mt.parentProperty.name + \"\\\")(\\\"\" + mt.name + \"\\\").attachPointOffset\";\r\n\t\t}\r\n\t\texpr += \") / \" + selection.length + \";\";\r\n\t\t\r\n\t\tnullLayer.position.expression = expr;\r\n\t\tnullLayer.position.expressionEnabled = true;\r\n\t\t\r\n\t\tapp.endUndoGroup();\r\n\t\t\r\n\t\tthis.parent.parent.parent.close();\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// main code:\r\n\t//\r\n\t\r\n\t// Prerequisites check\r\n\tif (parseFloat(app.version) < 9.0)\r\n\t\talert(rd_AverageTrackers_localize(rd_AverageTrackersData.strMinAE90), rd_AverageTrackersData.scriptName);\r\n\telse\r\n\t{\r\n\t\t// Make sure only a single comp is selected\r\n\t\tif (app.project === null)\r\n\t\t\treturn;\r\n\t\t\r\n\t\t// Get the current (active/frontmost) comp\r\n\t\tvar comp = app.project.activeItem;\r\n\t\t\r\n\t\tif ((comp === null) || !(comp instanceof CompItem))\r\n\t\t{\r\n\t\t\talert(rd_AverageTrackers_localize(rd_AverageTrackersData.strErrNoCompSel), rd_AverageTrackersData.scriptName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// Make sure there is a selected layer with at least two motion tracker track points\r\n\t\tif (comp.selectedLayers.length !== 1)\r\n\t\t{\r\n\t\t\talert(rd_AverageTrackers_localize(rd_AverageTrackersData.strNoSelLayer), rd_AverageTrackersData.scriptName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tvar layer = comp.selectedLayers[0];\r\n\t\trd_AverageTrackersData.mtPts = rd_AverageTrackers_getMTTrackPoints(layer);\r\n\t\t\r\n\t\tif (rd_AverageTrackersData.mtPts.length < 2)\r\n\t\t{\r\n\t\t\talert(rd_AverageTrackers_localize(rd_AverageTrackersData.strNoSelLayer), rd_AverageTrackersData.scriptName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tvar dlg = rd_AverageTrackers_buildUI(thisObj);\r\n\t\tif (dlg !== null)\r\n\t\t{\r\n\t\t\t// Add the list of motion tracker track points to the UI\r\n\t\t\tfor (var i=0; i<rd_AverageTrackersData.mtPts.length; i++)\r\n\t\t\t{\r\n\t\t\t\tdlg.grp.lst.add(\"item\", rd_AverageTrackersData.mtPts[i].parentProperty.name + \" > \" + rd_AverageTrackersData.mtPts[i].name);\r\n\t\t\t\tif (rd_AverageTrackersData.mtPts[i].enabled)\r\n\t\t\t\t\tdlg.grp.lst.items[i].selected = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Show the dialog\r\n\t\t\tdlg.center();\r\n\t\t\tdlg.show();\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "57166bf64b389866ad6016298687225e", "score": "0.6063661", "text": "function result() {\n if (resultChoices.length > 1) {\n for (index in resultChoices) {\n if (resultChoices[0] == resultChoices[1]) {\n resultDiv.innerHTML = \"Empate\";\n resultDiv.style.display = 'block';\n } else if (\n ((resultChoices[0] == 1) && (resultChoices[1] == 3)) ||\n ((resultChoices[0] == 2) && (resultChoices[1] == 1)) ||\n ((resultChoices[0] == 3) && (resultChoices[1] == 2))\n ) {\n resultDiv.innerHTML = \"Vitória Player 1\";\n resultDiv.style.display = 'block';\n } else {\n resultDiv.innerHTML = \"Vitória Player 2\";\n resultDiv.style.display = 'block';\n }\n }\n }\n}", "title": "" }, { "docid": "f993ef3b9c120983f95c8605765a2b29", "score": "0.60628825", "text": "function showfinalresults(){\n document.getElementById(\"resultpage\").style.display = \"block\";\n document.getElementById(\"questionpage\").style.display = \"none\";\n whomst.innerHTML = final_results;\n}", "title": "" }, { "docid": "92725100bb30fb224e60f7b6b9b726d7", "score": "0.6057724", "text": "function displayResults(results) {\n // returned array is unsorted but gives us an index in the objects\n results.sort((a,b) => a.index - b.index);\n\n for (let i in results) {\n let resultBox =\n `<a href=\"https://en.wikipedia.org/wiki/${results[i].title.replace(/\\s/g, '_')}\"\n target=\"_blank\" rel=\"noopener\" aria-label=\"${results[i].title}\">`;\n\n // style the first returned item as it's probably the most relevant to the user\n if (i == 0) {\n resultBox += `<div class=\"mainSearchResult boxes\" title=\"go to wikipedia article\">`;\n } else {\n // secondary style for alternate articles\n resultBox += `<div class=\"altResults boxes\" title=\"go to wikipedia article\">`;\n }\n\n resultBox +=\n `<h2 class=\"heading\">\n ${results[i].title}\n </h2>`;\n\n // only add article description if defined\n if (results[i].description) {\n resultBox +=\n `<div class=\"articleDescription\">\n <i>${results[i].description}</i>\n </div>`;\n }\n\n // not every title has an extract from the article\n if (results[i].extract) {\n resultBox += `<p class=\"extract\">${results[i].extract}</p>`;\n }\n\n resultBox +=\n `</div>\n </a>`;\n\n $('.results').append(resultBox);\n }\n}", "title": "" } ]
d1b949202df74f8c4e8bfc27626adb97
UPDATE PRICING TABLE FUNCTION
[ { "docid": "285a47d592ed3e11cb156a4b0548d436", "score": "0.53761655", "text": "function update_pricing_table(thisObj){\n\tvar data = get_input();\n\t$.post(\"/portal/custom_get_started/get_rates.php\", data, function(response){\n\t\tresponse = jQuery.parseJSON(response);\n\t\tvar output = \"\";\n\t\tif (response.length > 0){\n\t\t\tvar src = jQuery(\"#pricing_table_row\").html();\n\t\t\t$.each(response, function(i, item){\n\t\t\t\titem.i = i+1;\n\t\t\t\tvar template = Handlebars.compile(src);\n\t\t\t\toutput+= template(item);\n\t\t\t});\t\t\t\n\t\t}\n\t\t$(\"#pricing_table tbody\").html(output);\n\t});\n}", "title": "" } ]
[ { "docid": "f29ccd772328597ce996583550a7445f", "score": "0.67481613", "text": "function updateTable () {\n\n}", "title": "" }, { "docid": "6190c9a1bf2ef48d3ac463b489ddcbac", "score": "0.6459935", "text": "function update_row() {\n \n}", "title": "" }, { "docid": "42c05d17653b01416e90878108d1f6d2", "score": "0.6013975", "text": "function modifyPPTable(cardId, pp) {\n console.log(`Card '${cardId}' ` + JSON.stringify(pp));\n // ... (do your modification here) ...\n}", "title": "" }, { "docid": "389ddd9aad3aadf92c1093eaf7297497", "score": "0.5868295", "text": "updatePrice() { }", "title": "" }, { "docid": "ae3eb8e91198b635296583b947d402e9", "score": "0.58466995", "text": "function updateTable(){\n\t\t//$(\"div#stock table\").trigger(\"update\");\n\t}", "title": "" }, { "docid": "ba1108cce332b71c8b1845aed9a0953f", "score": "0.5686679", "text": "function updateRate(username, Poi, newRate, oldRate){\n return new Promise(function(resolve , reject){\n DButilsAzure.execQuery(`UPDATE Users_reviews SET Rate = `+newRate+` WHERE PointName ='`+ Poi + `', Username = '`+username+`'`)\n .then(function(result){\n DButilsAzure.execQuery(`SELECT * FROM dbo.Points_of_interests WHERE PointName ='`+ Poi + `'`)\n .then(function(poiEntry) {\n var sum = poiEntry[0].SumOfRates;\n var count = poiEntry[0].NumberOfRates;\n sum = sum + newRate - oldRate;\n var updatedRate = sum/count;\n DButilsAzure.execQuery(`UPDATE dbo.Points_of_interests SET SumOfRates = ` + sum +`, Rate = ` + updatedRate + ` WHERE PointName ='`+ Poi + `'`)\n .then(function(result) {\n resolve(result);\n }).catch(function(err) {\n reject(err);\n });\n\n }).catch(function(err) {\n reject(err);\n });\n })\n .catch(function(err){\n reject(err);\n })\n });\n}", "title": "" }, { "docid": "4bfeb193d05b395ad20831e55b25e521", "score": "0.5683805", "text": "function updatePrize(prize) {\n return prize.put();\n }", "title": "" }, { "docid": "9f6576b42b6e9a405ab158d9db363ff9", "score": "0.567181", "text": "function updateTable (answer, result, qty) { \n var reaminingQuantity = (result[0].stock_quantity - qty);\n var query = connection.query( \n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: reaminingQuantity,\n },\n {\n item_id: Math.abs(answer.Item_id)\n }\n ],\n function(err, res) { \n }\n )\n buyOther();\n}", "title": "" }, { "docid": "c62b27f2b17e2ba5680838159eedf7fc", "score": "0.56561744", "text": "async update() {\n const { rows } = await db.query(`SELECT * FROM update_perfume ($1, $2, $3, $4, $5, $6, $7, $8);`, [this.id, this.name, this.creator, this.yearOfCreation, this.score, this.brandId, this.intensityId, this.genderId]);\n \n if(!rows[0]) {\n throw new Error(`Oups la modification du parfum ${id} n'a pas pu être effectuée`);\n }\n return rows[0];\n }", "title": "" }, { "docid": "08a762157b53a294a3d6792b00714f6a", "score": "0.5651101", "text": "function field_row_assign(budget_row)\n{\n\n}", "title": "" }, { "docid": "b371dcd2a196bde426cb4816a5f8e517", "score": "0.5597646", "text": "function updateProduct(amount, stockQuantity, price, ID) {\n var prevProdSale = price*amount;\n var prevStock = stockQuantity-amount;\n \n productSales = prevProdSale + productSales;\n currentStock = prevStock + currentStock;\n\n connection.query(\"UPDATE products SET stock_quantity = ?, product_sales = ? WHERE item_id = ? \"\n , [currentStock, productSales, ID],\n function (err, res) { \n if (err) throw err;\n console.log(\" \");\n } \n );\n purchaseMore();\n // readProducts();\n \n}", "title": "" }, { "docid": "c914fe4e987bb0c24b8c6fa587462813", "score": "0.5580234", "text": "function updateDept(){\r\n\t\tconnection.query('UPDATE dept_name SET ? WHERE ?', [{\r\n\t\tTotalSales: updateSales\r\n\t},{\r\n\t\tdept_name: currentDept\r\n\t}], function(err, res){});\r\n}", "title": "" }, { "docid": "5afc887092693a65a563999dd16cbe5e", "score": "0.5577722", "text": "function updateTable(name, department, price, amount, deptId) {\n let query = `UPDATE products SET id = id + 1 WHERE id >= ${deptId} ORDER BY id DESC`\n connection.query(query, function(err, res){\n if(err) throw err;\n queryNewProduct(name, department, price, amount, deptId);\n })\n}", "title": "" }, { "docid": "e9fc0926887ec51d5c003d7dbb06a867", "score": "0.5545141", "text": "function onchange() {\n table.updateTable();\n }", "title": "" }, { "docid": "eb71ac56af6dee338c53d65f925715d5", "score": "0.55384547", "text": "function updatePointForm(playground) {\n\t\n\t// alle Punkte holen und sortieren\n\tvar sortedPoints = getPointsSorted(playground);\n\t\n\t// alle Punkte löschen\n\t$('tr').remove('.pointRow');\n\t\n\t// für jeden Punkt\n\tfor(var i = 0; i < sortedPoints.length; i++) {\t\t\n\t\t// füge eine neue Zeile hinzu\n\t\tcreatePointRow(playground, sortedPoints[i]);\n\t}\n}", "title": "" }, { "docid": "4c046bd1e49b0265b83290bc9981c807", "score": "0.55230385", "text": "function User_Update_Profils_Articles_présents_dans_le_profil_7(Compo_Maitre)\n{\n var Table=\"definiprofil\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var dp_article=GetValAt(32);\n if (dp_article==\"-1\")\n dp_article=\"null\";\n if (!ValiderChampsObligatoire(Table,\"dp_article\",TAB_GLOBAL_COMPO[32],dp_article,true))\n \treturn -1;\n var dp_densite=GetValAt(33);\n if (!ValiderChampsObligatoire(Table,\"dp_densite\",TAB_GLOBAL_COMPO[33],dp_densite,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dp_densite\",TAB_GLOBAL_COMPO[33],dp_densite))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"dp_article=\"+dp_article+\",dp_densite=\"+(dp_densite==\"\" ? \"null\" : \"'\"+ValiderChaine(dp_densite)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "db3f369fd20d4ca043525a4e852d931c", "score": "0.54892874", "text": "modifyPoints(id, points, callback) {\n this.pool.getConnection((err, con) => {\n if(err){callback(err);return}\n else{\n con.query(\"UPDATE USERS SET PUNTOS = ? WHERE ID = ?\", [points,id], (err, fila) =>{\n if(err){callback(err);return}\n else\n callback(null, true);\n });\n }\n con.release();\n });\n }", "title": "" }, { "docid": "3bc278eb79a1f0c98ba48110a65001ca", "score": "0.54616356", "text": "function changeDP() { }", "title": "" }, { "docid": "e85e481e3f73abd9765ca28041b8aa44", "score": "0.54201823", "text": "function update(rawdata) {\n //PUT YOUR UPDATE CODE BELOW\n\n\n}", "title": "" }, { "docid": "c6d7fd5743806cfdbd0b5e8ae8e4d9d2", "score": "0.54076535", "text": "updateSimple(table) {\n this.query += 'UPDATE ?? ';\n this.params.push(table);\n return this;\n }", "title": "" }, { "docid": "775bd0b5a6e430ebf0b0da60a9954992", "score": "0.5405215", "text": "_update(){}", "title": "" }, { "docid": "b4c2bdbdc19b5360e6795fd41c53a839", "score": "0.5388202", "text": "function update_portfolio() {\n share_value = shares * data[cur_day];\n total = cash + share_value;\n pandl = total - start_cash;\n roi_percent = ((total/start_cash)*100) - 100;\n $_('table_share_value').innerHTML = to_comma_seperated(share_value);\n $_('table_total').innerHTML = to_comma_seperated(total);\n $_('table_pandl').innerHTML = to_comma_seperated(pandl);\n}", "title": "" }, { "docid": "3e111a09997465a3e836162bdfd03f1f", "score": "0.53802764", "text": "'submit .updatepanier'(event){\n event.preventDefault();\n nbitem = parseInt(event.target.nbitem.value);\n totalprice= this.priceitem*nbitem;\n Panier.update(this._id, {$set:{nbitem: nbitem, totalprice: totalprice}});\n Session.set('inupdate'+this._id, false);\n }", "title": "" }, { "docid": "2a327c1ad8b3dc2db8a7c1bd76f5aafe", "score": "0.5357003", "text": "function update(table, point) {\n const retTable = deepcopy(table)\n const possibleValueArryOfOnePoint = []\n if (point) {\n retTable[point.x][point.y] = point.value\n }\n const sudo = new Sudo(retTable)\n sudo.update()\n const status = sudo.getStatus()\n if (status != 1) {\n return { table: retTable, possibleValueArryOfOnePoint: [], status: status }\n }\n let min = 9\n let x = 0\n let y = 0\n for (let i = 0; i < 9; i++) {\n for (let j = 0; j < 9; j++) {\n const size = sudo.possibleSet[i][j].size\n if (size == 0) {\n continue\n }\n if (size < min) {\n min = size\n x = i\n y = j\n }\n }\n }\n if (min != 9) {\n for (const value of sudo.possibleSet[x][y]) {\n possibleValueArryOfOnePoint.push({ x: x, y: y, value: value })\n }\n }\n return { table: retTable, possibleValueArryOfOnePoint: possibleValueArryOfOnePoint, status: 1 }\n}", "title": "" }, { "docid": "56c0c393fd2ccc657a629ad3f94ef983", "score": "0.5351219", "text": "function updateFinalize(productID, quantityNew, prodCost){\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantityNew\n },\n {\n item_id: productID\n }\n ],\n function(err) {\n if (err) throw err;\n }\n );\n console.log(\"The total cost of your purchase is $\" + prodCost)\n\n}", "title": "" }, { "docid": "dccf70a19f012a9647c4a2d15b12082b", "score": "0.5345348", "text": "function click_updateTable() {\n\toffset = Number(\"0\");\n\tupdateTable();\n}", "title": "" }, { "docid": "4c8d4ad4c6eff09cb6315185b1954bfe", "score": "0.5341504", "text": "function User_Update_Application_de_profil_Lot_s__5(Compo_Maitre)\n{\n var Table=\"lot\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var lo_article=GetValAt(15);\n if (lo_article==\"-1\")\n lo_article=\"null\";\n if (!ValiderChampsObligatoire(Table,\"lo_article\",TAB_GLOBAL_COMPO[15],lo_article,true))\n \treturn -1;\n var lo_lot=GetValAt(16);\n if (!ValiderChampsObligatoire(Table,\"lo_lot\",TAB_GLOBAL_COMPO[16],lo_lot,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"lo_lot\",TAB_GLOBAL_COMPO[16],lo_lot))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"lo_article=\"+lo_article+\",lo_lot=\"+(lo_lot==\"\" ? \"null\" : \"'\"+ValiderChaine(lo_lot)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "e5534c2adec1b9cc9ff7daa350df0297", "score": "0.53410006", "text": "function globalStateUpdate(data, table) {\n \n var obj = paramsToObject(data)\n \n var match = false;\n\n table.map((t,i) => {\n if (table[i].parcelnum === obj.parcelnum) {\n table[i] = obj;\n match = true;\n }\n });\n\n if (!match) table.push(obj)\n \n return table\n}", "title": "" }, { "docid": "3c703b2e883b7d6fc880e18b14fc0172", "score": "0.53294384", "text": "function updateProduct() {\n console.log(\"Updating below: \\n\");\n if((stockquantity-orderquantity)>0){\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: stockquantity-orderquantity,\n product_sales: totalSale+=(price * orderquantity)\n },\n {\n item_id: itemID\n }\n ],\n function(err, res) {\n console.log(res.affectedRows + \" products updated!\\n\");\n }\n );\n\n console.log(query.sql);\n calculateCost();\n startOver();\n}\n\n else{\n console.log(\"Insufficient quantity!\")\n console.log(\"Your total cost is: $\", totalCost);\n connection.end();\n }\n}", "title": "" }, { "docid": "46a18e5d4f11327451ab30f8ed586f7b", "score": "0.5328053", "text": "update (oldData) { }", "title": "" }, { "docid": "0e4735dc0399a32e1054cf47f36f01b0", "score": "0.5306545", "text": "function changePriors(){\n //Update bound information\n // bound = Array($('#prior_form_lower_bound').val(), $('#prior_form_upper_bound').val())\n // priors.filter(x=> x.parameter===prior.Parameter)[0].obj.bound = bound\n \n // Update hyperparameters\n let row;\n switch(prior.Parameter) {\n case \"kappa\":\n {\n row = priors.filter(x => x.parameter===\"kappa\")[0];\n if ($(\"#Initial\").val())\n row.obj.initial = parseFloat($(\"#Initial\").val());\n if ($(\"#mu\").val())\n row.obj.mu = parseFloat($(\"#mu\").val());\n if ($(\"#sigma\").val())\n row.obj.sigma = parseFloat($(\"#sigma\").val());\n if ($(\"#Offset\").val())\n row.obj.offset = parseFloat($(\"#Offset\").val());\n break;\n }\n case \"ucld.stdev\":\n {\n row = priors.filter(x => x.parameter===\"ucld.stdev\")[0];\n if ($(\"#Initial\").val())\n row.obj.initial = parseFloat($(\"#Initial\").val());\n if ($(\"#Mean\").val())\n row.obj.mean = parseFloat($(\"#Mean\").val());\n if ($(\"#Offset\").val())\n row.obj.offset = parseFloat($(\"#Offset\").val());\n break;\n }\n case \"clock.rate\":\n case \"ucld.mean\":\n {\n row = priors.filter(x => x.parameter===prior.Parameter)[prior.Prior.split(\" \")[0] === \"Fixed\" ? 0 : 1];\n if ($(\"#Initial\").val())\n row.obj.initial = parseFloat($(\"#Initial\").val());\n break;\n }\n case \"constant.popSize\":\n {\n row = priors.filter(x => x.parameter===\"constant.popSize\")[0];\n if ($(\"#Initial\").val())\n row.obj.initial = parseFloat($(\"#Initial\").val());\n break;\n }\n case \"skyline.popSize\":\n {\n row = priors.filter(x => x.parameter===prior.Parameter)[0];\n if ($(\"#Initial\").val())\n row.obj.initial = parseFloat($(\"#Initial\").val());\n if ($(\"#Upper\").val())\n row.obj.bound[1] = parseFloat($(\"#Upper\").val());\n if ($(\"#Lower\").val())\n row.obj.bound[0] = parseFloat($(\"#Lower\").val());\n break;\n }\n }\n\n //update Table\n changeSubModel();\n changeBaseFreq();\n changeClockType();\n changeTreePrior();\n $('#priors-tab').click();\n prior_dialog.dialog( \"close\" );\n }", "title": "" }, { "docid": "ea481abf3c02607f0c4d5a05b7059491", "score": "0.5295396", "text": "function updateDB(selectId, left, totalPrice, product_sales) {\n // Once the update goes through, show the customer the total cost of their purchase.\n // function that update product stock quantity product to the database\n\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n // update product's stock_quantity column.\n stock_quantity: left,\n // update product's product_sales column.\n product_sales: product_sales\n },\n {\n item_id: selectId\n }\n ],\n function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" data updated!\\n\");\n // return the total price in console.log\n console.log(\"Total price is \" + totalPrice +\n \"\\nThank you for your purchase!\")\n // end connection\n connection.end()\n }\n );\n\n}", "title": "" }, { "docid": "97a907d7eb9e512806edcec034fa44ee", "score": "0.5289504", "text": "function updateProd(prodId,prodQty,stockQty) {\n var newStockQty = stockQty - prodQty;\n var sql = 'update products set stock_quantity =? where item_id =?';\n conn.query(sql,[newStockQty,prodId],(err,res)=>{\n if (err) throw err;\n console.log('\\nProduct quantity updated successfully!'); \n })\n}", "title": "" }, { "docid": "55400e28645bf897d1dc238da24cba52", "score": "0.5288004", "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": "c0c1061209937d851e4e32a799d52e16", "score": "0.5280043", "text": "function updatePlantStatus(){\n\n}", "title": "" }, { "docid": "52977296391a3b9bd4d2f170419e4157", "score": "0.5262319", "text": "function update(){}", "title": "" }, { "docid": "52977296391a3b9bd4d2f170419e4157", "score": "0.5262319", "text": "function update(){}", "title": "" }, { "docid": "dd99f4eaa8f2b0e992adf97de5ffaae8", "score": "0.5252852", "text": "function updateWeeklyPostureTime(month,week,get_weekly_rows){\n\n var update_wtot_p1 = 0;\n var update_wtot_p2 = 0;\n var update_wtot_p3 = 0;\n var update_wtot_p4 = 0;\n var update_wtot_p5 = 0;\n var update_wtot_sitting_time = 0;\n var uw = week;\n var um = month;\n\n //add time for each posture\n update_wtot_p1 = get_weekly_rows[get_weekly_rows.length-1].P1 + posture_totime[0];\n update_wtot_p2 = get_weekly_rows[get_weekly_rows.length-1].P2 + posture_totime[1];\n update_wtot_p3 = get_weekly_rows[get_weekly_rows.length-1].P3 + posture_totime[2];\n update_wtot_p4 = get_weekly_rows[get_weekly_rows.length-1].P4 + posture_totime[3];\n update_wtot_p5 = get_weekly_rows[get_weekly_rows.length-1].P5 + posture_totime[4];\n update_wtot_sitting_time = update_wtot_p1+update_wtot_p2+update_wtot_p3+update_wtot_p4+update_wtot_p5;\n // console.log(update_total_p5);\n\n //send to db\n //console.log(rows_get_daily);\n conn.query(\"update weeklyPostureTime set P1=? where month=\"+um+\" AND week=\"+uw,update_wtot_p1,function(err,rows){\n if(err){console.log(err)}\n else{\n //console.log(rows);\n }\n })\n conn.query(\"update weeklyPostureTime set P2=? where month=\"+um+\" AND week=\"+uw,update_wtot_p2,function(err,rows){\n if(err){console.log(err)}\n else{\n //console.log(rows);\n }\n })\n conn.query(\"update weeklyPostureTime set P3=? where month=\"+um+\" AND week=\"+uw,update_wtot_p3,function(err,rows){\n if(err){console.log(err)}\n else{\n //console.log(rows);\n }\n })\n conn.query(\"update weeklyPostureTime set P4=? where month=\"+um+\" AND week=\"+uw,update_wtot_p4,function(err,rows){\n if(err){console.log(err)}\n else{\n //console.log(rows);\n }\n })\n conn.query(\"update weeklyPostureTime set P5=? where month=\"+um+\" AND week=\"+uw,update_wtot_p5,function(err,rows){\n if(err){console.log(err)}\n else{\n //console.log(rows);\n }\n })\n conn.query(\"update weeklyPostureTime set total_sitting_time=? where month=\"+um+\" AND week=\"+uw,update_wtot_sitting_time,function(err,rows){\n if(err){console.log(err)}\n else{\n //console.log(rows);\n }\n })\n}", "title": "" }, { "docid": "e84e3e1bfbe57a2e1c2f11b36d28f0e7", "score": "0.52476215", "text": "function editRowInTable(xuatHang) {\n let oldxuatHangRow = getRowInTable(xuatHang);\n tableQuanLyxuatHang.row(oldxuatHangRow).data([\n xuatHang.maXuatHang, xuatHang.ngayGioXuat, xuatHang.maNhanVien, xuatHang.maKhachHang, xuatHang.maBan, xuatHang.ghiChu, xuatHang\n ]).draw();\n\n //Change in xuatHangs\n let xuatHangReference = xuatHangs.find(\n (item) => item.maXuatHang == xuatHang.maXuatHang\n );\n \n xuatHangReference.maXuatHang = xuatHang.maXuatHang;\n xuatHangReference.ngayGioXuat = xuatHang.ngayGioXuat;\n xuatHangReference.maNhanVien = xuatHang.maNhanVien;\n xuatHangReference.maKhachHang = xuatHang.maKhachHang;\n xuatHangReference.maBan = xuatHang.maBan;\n xuatHangReference.ghiChu = xuatHang.ghiChu;\n \n}", "title": "" }, { "docid": "b885100fe5e5918584e411b1f29c4c04", "score": "0.5247068", "text": "updateOne(table, objColsVals, condition, callback) {\n connection.query(\"UPDATE ?? SET ? WHERE ?\", [table, objColsVals, condition], (err, result) => {\n if (err) throw err;\n callback(result);\n });\n }", "title": "" }, { "docid": "259d73658bf82bf32c424aa3cda2f598", "score": "0.5215933", "text": "function updateProduct(product) {\n var query = \"UPDATE product SET ? WHERE ?\";\n connection.query(query,\n [{\n stock_quantity: product.newStockQuantity,\n product_sales: product.product_sales,\n },\n {\n item_id: product.item_id\n }],\n function(err, res) {\n if (err) throw err;\n //console.log(res.affectedRows);\n console.log(`Order Processed: Your total cost is \\$${product.orderCost}`);\n\n //connection.end();\n getInventory();\n });\n}", "title": "" }, { "docid": "4e96400baf36d8a0d5fdb44b2998a9a2", "score": "0.5210523", "text": "function updateStock(newId,newStock) {\n\n connection.query(\n\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock\n },\n {\n item_id: newId\n }\n ],\n function(err, res) {\n\n if (err) throw err;\n\n console.log(`\n ####################################################\n ITEM SOLD\n\n UPDATING PRODUCT'S TABLE\n ____________________________________________________ \n product with item id ${newId} has been updated to \n ${newStock} quantity in stock\n ####################################################`);\n\n // after stock is update, display customer's receipt \n \n displayInvoice(prize,itemUnit);\n \n connection.end();\n }\n \n \n );\n}", "title": "" }, { "docid": "368f3547c332d7aa15628b51bc22bce5", "score": "0.5209677", "text": "function addSQLstock() {\n\n // Add stock to SQL product table\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock: stock + 1\n },\n {\n product: product\n }\n ],\n function (err, results) {\n if (err) throw err;\n console.log(\"\")\n })\n\n}", "title": "" }, { "docid": "b6cd3805210021d4d1ffc3e10787b256", "score": "0.52030003", "text": "function updateDeptsFunc(dept, sales) {\n\tvar queryDBquantity = \"SELECT total_sales FROM departments WHERE ?\";\n\t// using mySQL connection to run queryDBquantity\n\tconnection.query(queryDBquantity, {\n\t department_name: dept\n\t}, function(err, res) {\n\t\tif (err) throw err;\n\t\tvar deptSalesDB = res[0].total_sales;\n\t\tvar deptSalesDB = deptSalesDB + sales; // based on current deptSales\n\t\tvar queryUpdateQuantity = \"UPDATE departments SET ? WHERE ?\";\n\t\t// using mySQL connection to run queryUpdateQuantity\n\t\tconnection.query(queryUpdateQuantity, [{\n\t\t\ttotal_sales: deptSalesDB // fills in the SET clause\n\t\t}, {\n\t\t\tdepartment_name: dept // fills in the WHERE clause\n\t\t}], function(err, res) {});\n\t});\n}", "title": "" }, { "docid": "3dd354f7d11461ee1a4a3fcab7d72be6", "score": "0.51991385", "text": "function editQuant(ev, table, tableId, fn){\n key = ev.parentNode.parentNode.children[1].innerHTML;\n if(Number(ev.value) === 0){\n delete table[key];\n }\n else{\n table[key][0] = Number(ev.value);\n }\n var ctr = document.getElementById(tableId);\n var amount = 0;\n var item = 0;\n for(var i = 0; i < Object.keys(table).length; i++){\n amount += table[Object.keys(table)[i]][0]*table[Object.keys(table)[i]][1];\n item += table[Object.keys(table)[i]][0];\n }\n ctr.children[1].lastChild.innerHTML = amount;\n ctr.children[2].firstChild.innerHTML = item;\n fn();\n\n}", "title": "" }, { "docid": "85d43b70703971e175ac649edabd0482", "score": "0.5199081", "text": "function table_update() {\n\t/*clear the table body*/\n\t$tbody.innerHTML = \"\";\t\n\t/*the outer loop fills the rows and the inner loop fills the cells for each row*/\n\tfor (var i = 0; i < filtered_data.length; i++) {\n\t var $body_row = $tbody.insertRow(i);\n\t for (var j = 0; j < 7; j++) {\n\t var $cell = $body_row.insertCell(j);\n\t $cell.innerText = Object.values(filtered_data[i])[j];\n\t };\n\t};\n\t/*refresh pagination navigation section and rows to display*/\n\tshowRows();\n\tpagination();\n}", "title": "" }, { "docid": "a458b240c0acdee7b094637cd4e20f83", "score": "0.5186584", "text": "function updateRQOneTable(pcb) {\n var RQOne = document.getElementsByName(\"RQ1\");\n RQOne[0].innerHTML = pcb.PID.toString();\n RQOne[1].innerHTML = pcb.PC.toString();\n RQOne[2].innerHTML = pcb.Acc.toString();\n RQOne[3].innerHTML = pcb.Xreg.toString();\n RQOne[4].innerHTML = pcb.Yreg.toString();\n RQOne[5].innerHTML = pcb.Zflag.toString();\n RQOne[6].innerHTML = pcb.Base.toString();\n RQOne[7].innerHTML = pcb.Limit.toString();\n RQOne[8].innerHTML = pcb.Status.toString();\n RQOne[9].innerHTML = pcb.Location.toString();\n}", "title": "" }, { "docid": "77fce3304acf5b055cbbff453bbf288b", "score": "0.51520383", "text": "function updateProduct() {\n\n console.log(\"Updating inventory...\");\n\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n item_id: answer.item\n }\n ],\n );\n \n // logs the actual query being run\n console.log(query.sql);\n }", "title": "" }, { "docid": "b50867b99ec355f31f5ffb6b3e89d87e", "score": "0.514882", "text": "async updateItem(name, description, amount_available, price, unit,id) {\n let query_str = \"UPDATE public.item set name=COALESCE(($1),name),description=COALESCE(($2),description), amount_available=COALESCE(($3),amount_available), price=COALESCE(($4),price),unit=COALESCE(($5),unit) where id=($6)\";\n return new Promise(async (resolve, reject) => {\n try {\n let result = await pg_pool.query(query_str, [name, description, amount_available, price, unit,id]);\n //console.log(rows);\n resolve(result);\n } catch (e) {\n reject(e)\n }\n })\n }", "title": "" }, { "docid": "38d5f28c07d80a5b2a5eaa2e4fa6ef26", "score": "0.51476216", "text": "function editRowInTable(chiTietNhapHang) {\n let oldchiTietNhapHangRow = getRowInTable(chiTietNhapHang);\n tableQuanLychiTietNhapHang.row(oldchiTietNhapHangRow).data([\n chiTietNhapHang.maNhapHang, chiTietNhapHang.maSanPham, chiTietNhapHang.soLuong, chiTietNhapHang.donGia, chiTietNhapHang\n ]).draw();\n\n //Change in chiTietNhapHangs\n let chiTietNhapHangReference = chiTietNhapHangs.find(\n (item) => item.maNhapHang == chiTietNhapHang.maNhapHang && item.maSanPham == chiTietNhapHang.maSanPham\n );\n \n chiTietNhapHangReference.maNhapHang = chiTietNhapHang.maNhapHang;\n chiTietNhapHangReference.maSanPham = chiTietNhapHang.maSanPham;\n chiTietNhapHangReference.soLuong = chiTietNhapHang.soLuong;\n chiTietNhapHangReference.donGia = chiTietNhapHang.donGia;\n \n}", "title": "" }, { "docid": "e37a1f966f3c986c427e2430a986f792", "score": "0.5142737", "text": "function updateTableWrapper() {\r\n getRules(updateTable).catch(reportError);\r\n}", "title": "" }, { "docid": "70299f3da5b68c6c80b7cf8e4ce32343", "score": "0.5134704", "text": "function updateTable(qty, id, total) {\n total = total.toFixed(2);\n console.log(\"Updating, one moment please!...\\n\");\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\", [{\n stock_quantity: qty\n },\n {\n item_id: id\n }\n ],\n //prints out total sale then after 5 seconds starts back Bamazon.\n function (err, res) {\n console.log(\"***$\", total, \"Total Sale***\");\n setTimeout(start, 5000);\n }\n );\n}", "title": "" }, { "docid": "e3f7d6c20772b449a6ef0f27eea9fc56", "score": "0.5134145", "text": "function reloadExtraLineTable() {\n $(table).bootstrapTable('refresh');\n\n if (options.pricing) {\n reloadTotal();\n }\n }", "title": "" }, { "docid": "943d6452a5ac8810317295cd4e53343d", "score": "0.51323605", "text": "function updateRationOnParse(id, generatedHTML, ration){\n var ListRow = Parse.Object.extend(\"ListRow\");\n var query = new Parse.Query(ListRow);\n query.equalTo(\"rowId\", id);\n query.first({\n success: function(object){\n object.set(\"imageHTML\", generatedHTML);\n object.set(\"ration\", ration);\n object.save();\n }\n });\n}", "title": "" }, { "docid": "089a686ac4e3dfa152810898b5dd0f04", "score": "0.5131797", "text": "function UpdateTable(ArrivalTime, BurstTime, Process, time) {\r\n if (Table_remaining[Process - 1].value == BurstTime[Process - 1])\r\n Table_start[Process - 1].value = time;\r\n if (Table_remaining[Process - 1].value > 0)\r\n Table_remaining[Process - 1].value--;\r\n if (Table_remaining[Process - 1].value == 0)\r\n Table_finish[Process - 1].value = time + 1;\r\n Table_turnaround[Process - 1].value++;\r\n n = ReadyQueue.length;\r\n for (i = 0; i < n; i++) {\r\n Table_turnaround[ReadyQueue[i] - 1].value++;\r\n Table_wait[ReadyQueue[i] - 1].value++;\r\n }\r\n //Table_percentage[Process - 1].value = 100 - parseInt((Table_remaining[Process - 1] / (+BurstTime[Process - 1])) * 100);\r\n total = parseInt(+BurstTime[Process - 1]);\r\n left = total - Table_remaining[Process - 1].value;\r\n perc = (left / total) * 100;\r\n Table_percentage[Process - 1].value = parseInt(perc);\r\n\r\n}", "title": "" }, { "docid": "fe9b43b52f8e1e723e030dbab4ca11fa", "score": "0.51292956", "text": "async update(id, data = {}) {\n let values = [];\n let sql;\n const globalColumns = this.columns;\n const globalTable = this.table;\n\n for (let key in data) {\n globalColumns.filter((col) => {\n if (key === col.slice(globalTable.length + 1)) {\n values.push(`${key} = '${data[key]}'`);\n }\n });\n }\n\n sql = format(\n 'UPDATE %I SET %s WHERE id = %L RETURNING *;',\n this.table,\n values,\n id\n );\n\n const { rows } = await pool.query(sql);\n\n return toCamelCase(rows)[0];\n }", "title": "" }, { "docid": "5ac00c7ee93ed7a33636300c84d30c2e", "score": "0.5125158", "text": "update_rk4(){\n //\n }", "title": "" }, { "docid": "39a803b66142c6f006d877aa298f3474", "score": "0.51173365", "text": "updateTotalMoneyInImportBill(ImportBill_ID) {\n const sql = `\n select sum(ctnk.SoLuongSP * sp.GiaMua)\n from ${table_ChiTietNhapKho} ctnk join ${table_SanPham} sp on ctnk.MaSP = sp.MaSanPham\n group by MaPhieuNhapKho \n having MaPhieuNhapKho = ${ImportBill_ID}`\n return db.load(sql);\n }", "title": "" }, { "docid": "8d7344b4b98cef6aa578d65a265a9c41", "score": "0.5116278", "text": "updateWhatIf(table, setStatement, whereStatement) {\n console.log('==========*************==========')\n console.log('-- OBSELETE WAY OF DOING THIS. --')\n console.log('-- PLEASE USE .queryRaw NOW --')\n console.log('-- QUERY USING SQL STATEMENT --')\n console.log('==========*************==========')\n let cursor = `UPDATE ${table}`;\n let dbUpdate = `${cursor} ${setStatement} ${whereStatement}`;\n debugLog(dbUpdate);\n }", "title": "" }, { "docid": "d29d71eeae2a718b6dd20cbc2a9c8ab7", "score": "0.5115479", "text": "updateProductQuan(proID, quan, maxQuan) {\r\n\r\n const newQuan = maxQuan - quan;\r\n //const data = { productQuanitity: newQuan};\r\n api.put('/OrdersProduct/' + proID, { productQuanitity: newQuan })\r\n .then(response => {\r\n console.log(\"Status: \", response.status);\r\n console.log(\"Data: \", response.data);\r\n //alert(\"Placed\");\r\n //orderPlaced=true;\r\n\r\n }).catch(error => {\r\n console.error('Something went wrong!', error);\r\n });\r\n \r\n }", "title": "" }, { "docid": "40282209ca2681c89f4f23b2645fe226", "score": "0.511477", "text": "function updateall(quantity,product,mart,obj){\r\nvar quant = quantity;\r\nif(isNaN(quant))\r\n\tquant = parseInt(quant);\r\n\t\r\nParse.Cloud.run('savepriceoff ',{obj:obj,product:product,mart:mart,quant:quant},{\r\n\t success:function(results){\r\n\t\t\tif(results==\"Done\"){\r\n\t\t\t\t\r\n\t\t\t\tconsole.log(results);\r\n\t\t\tdeducemartquantity(product,mart,quant);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror: function(error){\r\n\t\t\t\r\n\t\t\tconsole.log(error.code);\r\n\t\t\trollbackward();\r\n\t\t}\r\n});\r\n}", "title": "" }, { "docid": "3038e27b813d2190501d3ac569e44a5f", "score": "0.5114578", "text": "function updateInventory(product){\n //console.log('updateInventory');\n connection.query('UPDATE products SET ? WHERE ?', [\n {\n stock_quantity: product.qtyToBeUpdated\n },\n {\n product_name: product.choices\n }\n ],function(error, results){\n viewProductsSale();\n managerFunc();\n });\n}", "title": "" }, { "docid": "8fe658602ab55090fe68acb87ef7e404", "score": "0.5111973", "text": "function prepareUpdateStatement(pointData){\n var statement = {}\n for(var key in pointData){\n if(pointData.hasOwnProperty(key)){\n statement[\"properties.\" + key] = pointData[key];\n\n }\n }\n \n return {\"$set\" : statement};\n}", "title": "" }, { "docid": "fb1b4ec647373e9d64feacb5c4d5e5ca", "score": "0.51037526", "text": "function field_update()\n{\n\n}", "title": "" }, { "docid": "bda12a724e5a20d1c995095122ad1255", "score": "0.5103534", "text": "function updateDepTable(department, newSales) {\n connection.query(\n 'UPDATE departments SET ? WHERE ?',\n [\n {\n product_sales: newSales\n },\n {\n department_name: department\n }\n ],\n function(err, res) {\n if(err) throw err;\n\n // console.log(res.affectedRows + \" departments got updated!\");\n }\n )\n}", "title": "" }, { "docid": "1abc41903802b903e220efaeef07b757", "score": "0.50987816", "text": "update(tableName, query, updateFunction) {\n if(!query) query = null;\n if(typeof updateFunction !== \"function\") {\n console.warn(\"updateFunction is empty, but required.\")\n return [];\n }\n\n\t\tvar result = this.allTables[tableName].update(query, updateFunction);\n console.debug(\"[FileDB.update] result of update:\", result);\n return result;\n\t}", "title": "" }, { "docid": "7b9833bff3ae6c036d8be4df2abcf411", "score": "0.5097185", "text": "function User_Update_Codes_postaux_Codes_postaux0(Compo_Maitre)\n{\n var Table=\"codepostal\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var cp_code=GetValAt(203);\n if (!ValiderChampsObligatoire(Table,\"cp_code\",TAB_GLOBAL_COMPO[203],cp_code,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cp_code\",TAB_GLOBAL_COMPO[203],cp_code))\n \treturn -1;\n var cp_bureau=GetValAt(204);\n if (!ValiderChampsObligatoire(Table,\"cp_bureau\",TAB_GLOBAL_COMPO[204],cp_bureau,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cp_bureau\",TAB_GLOBAL_COMPO[204],cp_bureau))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"cp_code=\"+(cp_code==\"\" ? \"null\" : \"'\"+ValiderChaine(cp_code)+\"'\" )+\",cp_bureau=\"+(cp_bureau==\"\" ? \"null\" : \"'\"+ValiderChaine(cp_bureau)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\n\n/* table commune*/\nLstDouble_Exec_Req(GetSQLCompoAt(208),CleMaitre);\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "6da467cbf72ad83122ba4e82a7b053b6", "score": "0.50915253", "text": "async price_update() {}", "title": "" }, { "docid": "292a75676ecf6f296d9b4dc27573d840", "score": "0.5080905", "text": "static update(date, location, name, gain, lost) {\n const depID = 13\n if (name === \"RedPaw\" || name === \"BluePay\" || name === \"BlackPaw\" ||\n name === \"RedPawUPC\" || name === \"BluePayUPC\" || name === \"BlackPawUPC\" ||\n name === \"Core\" || name === \"Screw\" || name === \"ShippingEnvelope\" ||\n name === \"Blister\" || name === \"BlisterCard\")\n depID = 25\n else if (name === \"RedPlasticSheet\" || name === \"BluePlasticSheet\" || name === \"BlackPlasticSheet\" ||\n name === \"RedTruckUPC\" || name === \"BlueTruckUPC\" || name === \"BlackTruckUPC\" ||\n name === \"RedNoteboardUPC\" || name === \"BlueNoteboardUPC\" || name === \"BlackNoteboardUPC\" ||\n name === \"Grommet\" || name === \"Velcro\" || name === \"TruckStickerSet\" ||\n name === \"GrillBox\" || name === \"NoteboardSticker\")\n depID = 18\n else if (location === \"Main\")\n depID = 29\n return db.query( \n 'INSERT INTO amounts (Date, DepID, MatID, InStock, Lost) \\\n SELECT * FROM ( \\\n SELECT DISTINCT ? AS Date, ? AS Department, MaterialID, ? AS InStock, ? AS Lost \\\n FROM departments INNER JOIN amounts ON DepartmentID = DepID \\\n INNER JOIN materials ON MaterialID = MatID \\\n WHERE MaterialName LIKE ? \\\n ) AS temp \\\n ON DUPLICATE KEY UPDATE InStock = temp.InStock, Lost = temp.Lost',\n [date, depID, gain, lost, name])\n }", "title": "" }, { "docid": "64eafa332a9070dcfebfa102ae23e184", "score": "0.50715274", "text": "updateOne(nameOfTable, devoured, col, val, cb) {\n //First ?? is nameOfTable\n //First ? is if eaten\n //Second ?? is the term id\n //Second ? is the value of the id in the table\n connection.query(\"UPDATE ?? SET ? WHERE ?? = ?\", [nameOfTable, devoured, col, val], (err, result) => {\n if (err) throw err;\n cb(result);\n });\n }", "title": "" }, { "docid": "e194f5717ae3efe76ebd03f4617f1af0", "score": "0.5065772", "text": "function update(id, amount) {\n // var cus_id = res.item_id;\n // console.log(id)\n var amount = parseInt(res[0].stock_quantity - amount);\n console.log(\"Updating stock quality...\" + amount);\n var query = connection.query(\"UPDATE products SET stock_quantity - ? WHERE id = ?\", [id],\n function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" products updated!\");\n }\n );\n // Adds the total amount of the user selected product together for a final balance\n function total() {\n\n }\n\n console.log(query.sql);\n }", "title": "" }, { "docid": "91e0dd3e9f8f0a44098cef4f6c0d6de5", "score": "0.50639415", "text": "CHANGE_PRICES(state) {\n // use a forEach() because it's an array\n // otherwise if it was an object you'd for(x in y)\n state.stocks.forEach(stock => {\n // doesn't make sense for the volatility to vary between a large range,\n // so it should only be a growth or shrinkage of the original price\n const min = 0.85\n const max = 1.15\n // the tried and true rand * (max - min) + min range calculation\n stock.pps = Math.round(stock.pps * (Math.random() * (max - min) + min))\n })\n }", "title": "" }, { "docid": "a3a10a04b6a00e8d2ab2029cb0ece00f", "score": "0.50623167", "text": "Update(tablename, data, condition, callback) {\n var collection = db.collection(tablename);\n collection.update(condition, { $set: data }, { multi: true }, (function (err, result) {\n return callback(err, result);\n }));\n }", "title": "" }, { "docid": "e136feaebec254d3e58cd29ee96a3a8c", "score": "0.5060134", "text": "function tableClickFunction_PC(row_key, item_type)\n{\n var update = {}\n\n if (item_type == \"signature\") {\n // Could also be meta-data because we mix those in\n var meta_sigs = get_global_data('meta_sigs')\n if (meta_sigs.indexOf(row_key) > -1) {\n item_type = 'meta'\n }\n }\n\n update['plotted_item_type'] = item_type;\n update['plotted_item'] = row_key;\n update['enrichment'] = false;\n\n set_global_status(update);\n}", "title": "" }, { "docid": "22fff4c85d7b160ef9a69bb6c1cc9caf", "score": "0.504713", "text": "function updatePEPL(listID, changeFieldNames, changeVal){\n var updateQuery = new Array();\n var temp1 = false;\n\n updateQuery = [[\"Assy_x0023_\", changeVal.Dorigo_x0020_Assy_x0023_],\n [\"Customer\", changeVal.Customer],\n [\"Orange\", changeVal.Orange],\n [\"SMT_x002d_SS\", changeVal.SMT_x002d_B],\n [\"SMT_x002d_PS\", changeVal.SMT_x002d_T],\n [\"Wave_x002e_\", changeVal.Wave_x0020_Parts],\n [\"HS_x0020_Oper_x0020_1_x0020_Pins\", changeVal.Hand_x0020_Pins],\n [\"Mech_x0020_Oper_x0020_1\", changeVal.Mech_x0020_Items],\n [\"Test_x002d_1\", changeVal.Test_x0020_Mins],\n [\"Comments_x002d_OPS\", changeVal.Comments_x002d_Job_x0020_Schedul],\n [\"Comments_x002d_Master\", changeVal.Comments_x002d_PE],\n [\"Comments_x002d_Orange\",changeVal.Comments_x002d_Orange]];\n if(changeVal.T_x002f_CONS == \"CON\" || changeVal.T_x002f_CONS == \"CTK\") updateQuery.push([\"Kit_x0020_Up\", changeVal.Exp_x0020_Kit_x0020_Date]);\n\n for(var temp in changeFieldNames) {\n if($.inArray(changeFieldNames[temp],[\"Dorigo_x0020_Assy_x0023_\",\"Customer\",\"Orange\",\"SMT_x002d_B\",\"SMT_x002d_T\",\"Wave_x0020_Parts\",\"Hand_x0020_Pins\",\"Mech_x0020_Items\",\"Test_x0020_Mins\",\"Comments_x002d_Job_x0020_Schedul\",\"Comments_x002d_PE\",\"Comments_x002d_Orange\",\"Exp_x0020_Kit_x0020_Date\"])>-1){\n temp1 = true;\n }\n }\n\n if (typeof(listID) != \"undefined\") {\n if( temp1 == true ){\n deferreds.push(updateListItem(\"PE Prioritization List\", listID, updateQuery));\n $(\"td#loadPEPL\").text(\"PE Prioritization List Update\");\n } else { $(\"td#loadPEPL\").text(\"PE Prioritization List - No Change\"); }\n } else {\n deferreds.push(createListItem(\"PE Prioritization List\", jobNo, updateQuery));\n $(\"td#loadPEPL\").text(\"PE prioritization List created\");\n }\n\n } //End internal function updatePEPL", "title": "" }, { "docid": "682e736f622cf1fd4cb304e674cd3fbf", "score": "0.50440884", "text": "function update_issues_table(area_id, state_filter, issue_page, member_page, my_involvment, issue_sort_criteria) {\n\tvar url = 'update_issues_table?area_id=' + area_id + '&issue_state=' + state_filter\n\t + '&page=' + issue_page + '&member_page=' + member_page + '&my_involvment=' + my_involvment + '&issue_sort_criteria=' + issue_sort_criteria;\n\tvar data = {\n\t\tarea_id: area_id,\n\t\tissue_state: state_filter,\n\t\tpage: issue_page,\n\t\tmember_page: member_page,\n\t\tmy_involvment: my_involvment,\n\t\tissue_sort_criteria: issue_sort_criteria\n\t};\n\n\t$.ajax({\n\t\turl: url,\n\t\ttype: \"POST\",\n\t\tdata: data,\n\t\tdataType: \"text\",\n\t\tsuccess: function(data) {\n\t\t\tvar $table = $('#issues-table');\n\t\t\t$table.replaceWith(data);\n\t\t}\n\t});\n\n\treturn false;\n}", "title": "" }, { "docid": "50df7a8b5aa08464835647b8be3c6a0b", "score": "0.5037448", "text": "async updateDataIntoTable(table, data) {\n console.log(`|** appHelper.updateDataIntoTable **| INFO: update data into <${table}> table| `, new Date());\n if(data.length == 0) return 0;\n \n let timestamp = new Date();\n let operations = data.map(datum => {\n return {\n updateMany: {\n filter: {uri: datum.uri},\n update: {$set: {\n review_result: datum.manualreview,\n audit_date: timestamp\n }}\n }\n };\n });\n\n console.log(JSON.stringify(operations));\n let res = await DBConn.updateData(table, operations).catch(err => {console.log(err); return err});\n return res;\n }", "title": "" }, { "docid": "58dba6dcdebc539fbf2eb5368b6527ff", "score": "0.5036627", "text": "function changePplRate(rate){\n if( checkIfEmpty(rate)){\n if(checkIfNumber(rate)==rate){\n pplMarkUp = rate/100;\n }\n }\n }", "title": "" }, { "docid": "7f48fbd71b546e85ed2514e27d4ddbed", "score": "0.50346285", "text": "function update_price() {\n var row = $(this).parents('.line-item');\n var kolicina = parseFloat(row.find('.kolicina>input').val());\n var cena = parseFloat(row.find('.cena>input').val());\n var popust = parseFloat(row.find('.popust>input').val());\n var davek = parseFloat(row.find('.davek>input').val());\n popust = (100-popust)/100;\n davek = (100 + davek)/100;\n skupaj = cena*kolicina*popust*davek;\n row.find('.skupaj').html(skupaj.toFixed(2));\n //update_total();\n}", "title": "" }, { "docid": "7a7f9585166c9d4368ed7e555c115bf8", "score": "0.50136715", "text": "dsUpdateTable(table, what) {\n switch (what) {\n case \"add\":\n table.columns = [];\n table.indexes = [];\n table.partitions = [];\n table.relations = [];\n this.gMap.tables.set(table.table_id, table);\n this.gData.tables.push(table);\n\n if (this.gMap.tablesByLetter.has(this.gCurrent.letterSelected)) {\n this.gMap.tablesByLetter.get(this.gCurrent.letterSelected).tables.push(table.table_id);\n } else {\n this.gMap.tablesByLetter.set(this.gCurrent.letterSelected, {tables: [table.table_id]});\n }\n break\n case \"update\":\n this.gMap.tables.get(table.table_id).table_name = table.table_name;\n break\n case \"delete\":\n break\n default:\n break\n }\n }", "title": "" }, { "docid": "568e8222a73a7ec9eb8badd6ca549e4d", "score": "0.50121605", "text": "function editPlusOne(tableName, columnName, id) {\n let query = `UPDATE ${tableName}\n SET ${columnName} = ${columnName} + 1\n WHERE id=\"${id}\"`\n return new Promise((resolve, reject) => {\n db.query(query, (err) => {\n if (err)\n reject(err)\n else\n resolve()\n })\n })\n}", "title": "" }, { "docid": "c250aa93f145e91ccaf0493712fb382e", "score": "0.50093114", "text": "function plwNewScrUpdSave(event, data) {\n data.upload_status = 2;\n knex(\"tblScrPlw\")\n .update(data)\n .where(\"plw_scr_id\", data.plw_scr_id)\n .then(result => {\n sndMsg.sucMsg(event, \"\", \"Record updated successfully\");\n // console.log(\"func plwNewScrUpdSave success\", result);\n })\n .catch(e => {\n sndMsg.errMsg(event, \"\", \"Record not updated, plz try again or contact admin\");\n // console.log(\"func plwNewScrUpdSave error\", e);\n });\n }", "title": "" }, { "docid": "1a8e21ae1c2cec55985cebbd478503f6", "score": "0.4998336", "text": "function taxFunc(){\n return orders.price = orders.price * orders.tax\n}", "title": "" }, { "docid": "d3870d23eddf8af01f182f26b0cfae77", "score": "0.49902213", "text": "function updateAndReplicate(curPos, curIndex, updateDancer) {\n\tif (updateSelected()) {\n\t\t$('#tablePositions input:checked').each(function() {\n\t\t\tvar pos = parseInt($(this).val().replace(/p/, ''), 10);\n\t\t\tupdateDancer(theDance.positions[pos][curIndex]);\n\t\t});\n\t}\n\telse {\n\t\tupdateDancer(theDance.positions[curPos][curIndex]);\n\t\treplicateDancers(theDance.positions[curPos], curIndex);\n\t}\n}", "title": "" }, { "docid": "6634463172237191435e6624f2e31563", "score": "0.49901968", "text": "updatePoints() {\n this.prolog.countPoints(this.gameboard.toString())\n }", "title": "" }, { "docid": "8275967641456cd16bb27fa8878e6ef1", "score": "0.49890354", "text": "function sql_operation(spot_name){\n\n setCallback();\n\n rate.query('UPDATE rate SET score = score + 1 WHERE spot_name = \"'+spot_name+'\"', function (err, result) {\n if (err){\n error(err);\n }\n else{\n sql_result(result);\n }\n });\n\n }", "title": "" }, { "docid": "a01004504aba14f9126dde4e1f35f9dc", "score": "0.49881956", "text": "function updatePCBTable(pcb) {\n var PCBcontents = document.getElementsByName(\"pcbContents\");\n PCBcontents[0].innerHTML = pcb.PID.toString();\n PCBcontents[1].innerHTML = pcb.PC.toString();\n PCBcontents[2].innerHTML = pcb.Acc.toString();\n PCBcontents[3].innerHTML = pcb.Xreg.toString();\n PCBcontents[4].innerHTML = pcb.Yreg.toString();\n PCBcontents[5].innerHTML = pcb.Zflag.toString();\n}", "title": "" }, { "docid": "cb262b3ff088333f74858ae844cb7d47", "score": "0.49878776", "text": "function updateProfitChart() {\r\n\t\t\t\t\tupdateProfitChart2(profit2*100000000);\r\n\t\t\t\t}", "title": "" }, { "docid": "1373b9f7d4d895ee32d067beba63bcd2", "score": "0.4987848", "text": "function release_grade_hold(submit_id, profile_id) {\n let functionName = 'release_grade_hold';\n console.log(`****** ${functionName} ******`)\n console.log(`release_grade_hold(submit_id = ${submit_id}, profile_id = ${profile_id})`)\n console.log(`****** ${functionName} ******`)\n return new Promise(function(resolve, reject) {\n let query = `UPDATE [KA_quiz_submission] \n SET graded_by = null\n WHERE submit_id = '${submit_id}' AND graded_by = '${profile_id}'`;\n dbQueryMethod.queryRaw(query).then(result => {\n resolve(result)\n return result;\n }).catch(function(error) { reject(error); throw error; })\n }).catch(function(error) {\n log_event('WARNING', error, functionName);\n throw error;\n })\n}", "title": "" }, { "docid": "9ba461f5e515eb5625cbac55c4170212", "score": "0.49875674", "text": "function update_table()\r\n{\r\n var i;\r\n for(i=1; i<table_statistics.children.length; ++i)\r\n table_statistics.children[i].y = table_statistics.children[i].start_y - (my_scrool.position - 1) * table_statistics.koff;\r\n\r\n}", "title": "" }, { "docid": "eac1a1116b69016efd853bd7a32f609d", "score": "0.49871197", "text": "function upLocalvfIn(offpic,ct,dep,stat,up){\n db.transaction(function(t){\n console.log(\"My Query Up local vf!\");\n t.executeSql(\"UPDATE VIRTUALFORCE SET userAvatarIn = '\"+ offpic+ \"', checkInTime = '\" + ct + \"', department = '\" + dep + \"', checkstat = 'checkin', status = '\" + stat + \"', uploadedIn = 'false1' WHERE userpin ==\" + up , [], queryHome, errorCB);\n });\n }", "title": "" }, { "docid": "02d66872ab21d0832db0af047bb6b3b1", "score": "0.49755397", "text": "function updateTable (totalSeter) {\n $('#voksen_antall').html($('#select').val())\n $('#barn_antall').html($('#barn').val())\n $('#honnor_antall').html($('#honnor').val())\n\n let voksenPris = parseInt(110 * parseInt($('#select').val()))\n let barnePris = parseInt(80 * parseInt($('#barn').val()))\n let honnorPris = parseInt(80 * parseInt($('#honnor').val()))\n\n $('#voksen_pris').html(voksenPris + ' kr')\n $('#barn_pris').html(barnePris + ' kr')\n $('#honnor_pris').html(honnorPris + ' kr')\n\n $('#sum_antall').html(totalSeter)\n $('#sum_pris').html(parseInt(voksenPris + barnePris + honnorPris) + ' kr')\n }", "title": "" }, { "docid": "fc7a64b10e094ed365a5cb73253ae466", "score": "0.49708498", "text": "update(columnNames, values) {\r\n this.affected_rows = 0;\r\n if(!arguments.length){\r\n throw new Error(\"There is an error in your query => 'update()' expects atleast two arguments, zero given.\");\r\n } else if(arguments.length < 2) {\r\n throw new Error(\"update() expects atleast three arguements, an array of column and an array of values'\");\r\n } else if(!isAllArray([columnNames, values])) {\r\n throw new Error(\"column names and values must be an array\")\r\n } else if(this.tableName == undefined) {\r\n throw new Error(`table name not set, a call to 'from()' is expected`)\r\n }\r\n \r\n let db = localStorage.getItem(this.$db);\r\n db = JSON.parse(db);\r\n let columns = db[this.tableName]\r\n columnNames = to_lc(columnNames);\r\n let these = this;\r\n if(columnNames.length != values.length) {\r\n throw new Error(`column names must match number of values specified`);\r\n } else if(!columnNames.length || !values.length){\r\n throw new Error('column names or values cannot be empty!')\r\n }\r\n\r\n // let's update the table...:D\r\n if(!this.where_clause) {\r\n if(!this.like_column) {\r\n // update the whole column and show warning on console...\r\n columnNames.forEach((el, inx) => {\r\n let columnType = db[this.tableName][el]['type'];\r\n let type = isInArray(['int', 'integer'], columnType) ? 'number' : columnType;\r\n if(!db[this.tableName].hasOwnProperty(el)) {\r\n throw new Error(`unknown column name '${el}`)\r\n } else if(typeof values[inx] != type) {\r\n throw new Error(`value '${values[inx]}' does not match column type '${db[this.tableName][el][\"type\"]}'`);\r\n } else {\r\n // update columes....\r\n db[this.tableName][el]['values'].forEach((e, i) => {\r\n db[this.tableName][el]['values'][i] = values[inx];\r\n })\r\n }\r\n this.affected_rows = db[this.tableName][el]['values'].length;\r\n });\r\n console.warn(`Updating a table without a where clause will update every row of the matched column with the provided value!`);\r\n localStorage.setItem(this.$db, JSON.stringify(db));\r\n this.tableName = undefined;\r\n return true;\r\n } else {\r\n // if wildcard method is called...\r\n if(!db[this.tableName].hasOwnProperty(this.like_column)) {\r\n throw new Error(`search column '${like_column}' does not exist in your table!`);\r\n } else {\r\n let updateIndex = [];\r\n db[this.tableName][this.like_column]['values'].forEach((el, ind) => {\r\n if(this.wildcard == 'left') {\r\n if(`${to_lc(el)}`.startsWith(this.like_search)) {\r\n updateIndex.push(ind);\r\n }\r\n } else if(this.wildcard == 'right') {\r\n if(`${to_lc(el)}`.endsWith(this.like_search)) {\r\n updateIndex.push(ind);\r\n }\r\n } else if(this.wildcard == 'both') {\r\n if(`${to_lc(el)}`.startsWith(this.like_search) && `${el}`.endsWith(this.like_search)) {\r\n updateIndex.push(ind);\r\n }\r\n } else {\r\n throw new Error(`invalid wildcard, expects either 'left, right or both', '${this.wildcard}' provided!`);\r\n }\r\n })\r\n this.affected_rows = updateIndex.length\r\n columnNames.forEach((el, inx) => {\r\n if(!db[this.tableName].hasOwnProperty(el)) {\r\n throw new Error(` unknown column name '${el}'`)\r\n } else {\r\n updateIndex.forEach((elem, ind) => {\r\n db[this.tableName][el]['values'][elem] = values[inx];\r\n })\r\n }\r\n })\r\n }\r\n }\r\n this.like_column = undefined;\r\n this.tableName = undefined;\r\n if(this.affected_rows) {\r\n localStorage.setItem(this.$db, JSON.stringify(db));\r\n return true\r\n }\r\n return false;\r\n } else {\r\n // update columns using where clause\r\n if(!this.like_column) {\r\n // update columns using only where clause\r\n if(!this.where_clause.length) {\r\n throw new Error(`invalid where clause!`);\r\n } else if(!isPlainArray(this.where_clause)) {\r\n throw new Error(`where clause expects an array!`)\r\n } else if(this.where_clause.length < 2) {\r\n throw new Error(`'where expects atleast two arguments!'`)\r\n } else {\r\n let col = this.where_clause[0];\r\n let match_value = this.where_clause[2];\r\n let operator = this.where_clause[1];\r\n if(this.where_clause.length == 2) {\r\n operator = '';\r\n let __char = [this.where_clause[1][0], this.where_clause[1][1]];\r\n match_value = `${this.where_clause[1]}`.split('');\r\n if(!db[this.tableName].hasOwnProperty(col)) {\r\n throw new Error(`unknown column in your where clause! ${col}`);\r\n }\r\n let op = 0;\r\n while(op < 3) {\r\n if(isInArray(['!', '>', '<', '='], __char[op])) {\r\n operator += __char[op];\r\n match_value.splice(0,1);\r\n op++;\r\n continue;\r\n }\r\n op++;\r\n }\r\n match_value = match_value.join('');\r\n\r\n operator = operator == '' ? '==' : operator;\r\n operator = operator == '=' ? '==' : operator;\r\n }\r\n match_value = to_lc(match_value);\r\n let updateIndex = [];\r\n db[this.tableName][to_lc(col)]['values'].forEach((el, ind) => {\r\n if(eval(`${'el'}` + operator + `${'match_value'}`)) {\r\n updateIndex.push(ind);\r\n }\r\n })\r\n this.affected_rows = updateIndex.length;\r\n columnNames.forEach((elem, inx) => {\r\n if(!db[this.tableName].hasOwnProperty(elem)) {\r\n throw new Error('invalid column name');\r\n } else {\r\n let columnType = columns[elem]['type'];\r\n let type = isInArray(['int', 'integer'], columnType) ? 'number' : columnType;\r\n if(typeof values[inx] != type) {\r\n throw new Error(`column type does not match value type`);\r\n } else if(elem == db[this.tableName]['key']) {\r\n throw new Error('updating a primary key failed');\r\n } else {\r\n db[this.tableName][elem]['values'].forEach((e, i) => {\r\n updateIndex.forEach((el, ind) => {\r\n if(el == i) {\r\n db[this.tableName][elem]['values'][el] = values[inx];\r\n }\r\n });\r\n });\r\n \r\n }\r\n }\r\n });\r\n }\r\n this.where_clause = undefined;\r\n this.tableName = undefined;\r\n if(this.affected_rows) {\r\n localStorage.setItem(this.$db, JSON.stringify(db));\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "5407143c4e3f08098e821a6edd15d2c5", "score": "0.49700582", "text": "function User_Update_Composants_Date_Avant_Récolte_5(Compo_Maitre)\n{\n var Table=\"dateavantrecolte\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var da_dar=GetValAt(139);\n if (!ValiderChampsObligatoire(Table,\"da_dar\",TAB_GLOBAL_COMPO[139],da_dar,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"da_dar\",TAB_GLOBAL_COMPO[139],da_dar))\n \treturn -1;\n var da_espece=GetValAt(140);\n if (da_espece==\"-1\")\n da_espece=\"null\";\n if (!ValiderChampsObligatoire(Table,\"da_espece\",TAB_GLOBAL_COMPO[140],da_espece,true))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"da_dar=\"+(da_dar==\"\" ? \"null\" : \"'\"+ValiderChaine(da_dar)+\"'\" )+\",da_espece=\"+da_espece+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "f5aace7831810908c54addd8eab64740", "score": "0.4967687", "text": "function put_Freelances(dt) {\n // console.log(pj);\n pd = dt;\n \n let largo = $('#tblExchanges tbody tr td').html();\n largo == 'Ningún dato disponible en esta tabla'\n ? $('#tblExchanges tbody tr').remove()\n : '';\n \n let tabla = $('#tblExchanges').DataTable();\n tabla.rows().remove().draw();\n let cn = 0;\n if(dt[0].free_id){\n $.each(pd, function (v, u) {\n \n let sku = u.pjtdt_prod_sku;\n if (sku == 'Pendiente') {\n sku = `<span class=\"pending\">${sku}</sku>`;\n }\n \n var row= tabla.row\n .add({\n editable: `<i class=\"fas fa-pen modif\" id =\"md${u.free_id}\"></i><i class=\"fas fa-times-circle kill\"></i>`,\n proyname:u.pjt_name,\n freename: u.free_name,\n area:u.are_name,\n strtdate: u.ass_date_start, \n enddate:u.ass_date_end,\n comments: u.ass_coments\n })\n .draw();\n\n $(row.node()).attr('data-content', u.free_id + '|'+u.are_id+'|'+u.pjt_id+'|'+u.ass_id);\n $('#md' + u.ass_id)\n .parents('tr')\n .attr('id', u.ass_id);\n \n actionButtons();\n \n $('#k' + u.pjtdt_id)\n .parents('tr')\n .attr({\n id: u.pjtdt_id,\n data_serie: u.ser_id,\n data_proj_change: u.pjtcr_id,\n data_maintain: u.pmt_id,\n data_status: u.mts_id\n });\n //console.log(u.pmt_id);\n cn++;\n });\n }\n}", "title": "" }, { "docid": "280ebfb94bb0cd0bc8c5ffdb0f31d876", "score": "0.49676755", "text": "function updateDepartment() {\n var query = `SELECT * FROM department`;\n connection.query(query, function (err, res) {\n if (err) {\n console.log(\"Department table couldn't be updated.\");\n }\n console.table(res);\n console.log(\"Successfully viewed the updated department table.\");\n employeeSearch();\n });\n}", "title": "" }, { "docid": "4131c1f6060df666f653f4f7f422a301", "score": "0.49668184", "text": "function update(rowIndx, $grid) {\n if (!$grid.pqGrid(\"saveEditCell\")) {\n return false;\n }\n\n var rowData = $grid.pqGrid(\"getRowData\", { rowIndx: rowIndx });\n var isValid = $grid.pqGrid(\"isValid\", { rowData: rowData }).valid;\n if (!isValid) {\n return false;\n }\n var isDirty = $grid.pqGrid(\"isDirty\");\n if (isDirty) {\n var recIndx = $grid.pqGrid(\"option\", \"dataModel.id\");\n\n $grid.pqGrid(\"removeClass\", { rowIndx: rowIndx, cls: 'pq-row-edit' });\n\n //url = \"/pro/products.php?pq_update=1\";for PHP\n \n $.ajax($.extend({}, ajaxObj, {\n context: $grid,\n url: \"/appDocUpdate\",\n data: rowData,\n success: function () {\n \t $(\"#grid_IN\").pqGrid(\"refreshDataAndView\"); //reload fresh page data from server.\n \t $(\"#grid_OUT\").pqGrid(\"refreshDataAndView\"); //reload fresh page data from server.\n }\n }));\n }\n else {\n \t $grid.pqGrid(\"quitEditMode\");\n $grid.pqGrid(\"removeClass\", { rowIndx: rowIndx, cls: 'pq-row-edit' });\n $grid.pqGrid(\"refreshRow\", { rowIndx: rowIndx });\n }\n }", "title": "" }, { "docid": "59b89b87f1f1d0623635c5858bd8f737", "score": "0.49662566", "text": "function update ()\n{\n\n}", "title": "" }, { "docid": "889e40297df7b98e250ca2b5f9cbb31f", "score": "0.49635434", "text": "update(table, fieldsToUpdate) {\n this.query += 'UPDATE ?? SET ?';\n this.params.push(table, fieldsToUpdate);\n return this;\n }", "title": "" }, { "docid": "693fdc38ad9e72fefcce5e05e16c3de1", "score": "0.49590084", "text": "function fncProductUpdate(i){\n const itm = globalArr[i];\n select_id = itm.pr_id\n\n $(\"#pr_title\").val(itm.pr_title)\n $(\"#pr_buy_price\").val(itm.pr_buy_price)\n $(\"#pr_sale_price\").val(itm.pr_sale_price)\n $(\"#pcode\").val(itm.pr_code)\n $(\"#pr_tax_select\").val(itm.pr_tax)\n $(\"#pr_unit\").val(itm.pr_unit)\n $(\"#pr_quantity\").val(itm.pr_quantity)\n $(\"#pr_detail\").val(itm.pr_detail)\n}", "title": "" } ]
9a80470b9cf404c0f02fb228164c1e6c
NOTIFY PROPERTY CHANGED EVENT HANDLER
[ { "docid": "b319aed9661401d8a9e5a4631898c48d", "score": "0.0", "text": "function onViewModelChange(e) {\r\n\r\n }", "title": "" } ]
[ { "docid": "eddab4a31b3b2a7f303833b40377a936", "score": "0.75887084", "text": "_notifyProperty(propertyKey, oldValue, newValue) {\n const eventName = createEventName(propertyKey, '', 'changed');\n this.dispatchEvent(new CustomEvent(eventName, {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n property: propertyKey,\n previous: oldValue,\n current: newValue,\n },\n }));\n }", "title": "" }, { "docid": "3217f3a33842c4bcb130c97cdadf6374", "score": "0.74489313", "text": "_beforePropertyChange(name, value) { }", "title": "" }, { "docid": "b9f303c1f72bb818d2b1172f9de0dfb7", "score": "0.73131174", "text": "function handleProp(propName, prop) {\n if (prop.notify) {\n propertyConfig[propName] = [`${propName}-changed`, 'change', 'input'];\n }\n }", "title": "" }, { "docid": "53f1b236fb601fb5a06ad5be9c664f2d", "score": "0.7239602", "text": "function monitor(property){\n model.on('change:' + property, function(){\n console.log('new ' + property + ' = ' + model.get(property));\n });\n}", "title": "" }, { "docid": "d2c3836daa020482a6cc5dab9835fa19", "score": "0.71135664", "text": "onPropertyPropertyChange(value, oldValue, innerProperty) {\n // If the value of the inner Property is already the inverse of our value, we will never attempt to update our\n // own value in an attempt to limit \"ping-ponging\" cases mainly due to numerical error. Otherwise it would be\n // possible, given certain values and map/inverse, for both Properties to toggle back-and-forth.\n // See https://github.com/phetsims/axon/issues/197 for more details.\n if (this.bidirectional && this.valuePropertyProperty.value !== null && innerProperty) {\n const currentProperty = this.derive(this.valuePropertyProperty.value);\n // Notably, we only want to cancel interactions if the Property that sent the notification is still the Property\n // we are paying attention to.\n if (currentProperty === innerProperty && innerProperty.areValuesEqual(this.inverseMap(this.value), innerProperty.get())) {\n return;\n }\n }\n\n // Since we override the setter here, we need to call the version on the prototype\n super.set(this.map(value));\n }", "title": "" }, { "docid": "f2c452aedd1ddf5f48721741c3646bc7", "score": "0.7039722", "text": "function PropertyHandler() { }", "title": "" }, { "docid": "4e8918a2b37739ab62903bb4a60853e6", "score": "0.6996734", "text": "get propertyChanged() {\n return this._propertyChanged;\n }", "title": "" }, { "docid": "4e8918a2b37739ab62903bb4a60853e6", "score": "0.6996734", "text": "get propertyChanged() {\n return this._propertyChanged;\n }", "title": "" }, { "docid": "de8656453f100f6d16eb238d1acb0b9f", "score": "0.6955678", "text": "_onPropertyChanged(sender, property) {\n switch (property) {\n case 'path':\n this._path = sender.path;\n break;\n case 'name':\n this._name = sender.name;\n break;\n default:\n this._type = sender.type;\n break;\n }\n this._propertyChanged.emit(property);\n }", "title": "" }, { "docid": "bab48f8e0637936d5b81615b641a01ff", "score": "0.68744576", "text": "_notifyListeners(oldValue) {\n const newValue = this.get();\n\n // Although this is not the idiomatic pattern (since it is guarded in the phetioStartEvent), this function is\n // called so many times that it is worth the optimization for PhET brand.\n js_Tandem.PHET_IO_ENABLED && this.isPhetioInstrumented() && this.phetioStartEvent(ReadOnlyProperty.CHANGED_EVENT_NAME, {\n getData: () => {\n const parameterType = this.phetioType.parameterTypes[0];\n return {\n oldValue: types_NullableIO(parameterType).toStateObject(oldValue),\n newValue: parameterType.toStateObject(newValue)\n };\n }\n });\n\n // notify listeners, optionally detect loops where this Property is set again before this completes.\n assert && assert(!this.notifying || this.reentrant, `reentry detected, value=${newValue}, oldValue=${oldValue}`);\n this.notifying = true;\n this.tinyProperty.emit(newValue, oldValue, this); // cannot use tinyProperty.notifyListeners because it uses the wrong this\n this.notifying = false;\n js_Tandem.PHET_IO_ENABLED && this.isPhetioInstrumented() && this.phetioEndEvent();\n }", "title": "" }, { "docid": "5cc07f880f9a7ecc2114d36a36383e26", "score": "0.67753637", "text": "_fieldUpdated(e) {\n this.__sendPropChangeEvent(e.propertyName);\n }", "title": "" }, { "docid": "37e01260c4be1901447f920887e2245f", "score": "0.67502284", "text": "function observeProp() {\n var args = Array.prototype.slice.call(arguments);\n var obj = args.slice(0,1); // first argument\n var propNames = args.slice(1, -1); // everything except first and last arg\n var cb = args.slice(-1); // last argument\n\n propertyWatcher.addObserver(obj, propName, cb)\n}", "title": "" }, { "docid": "2967e5f52d5df8af278bf05c9429f44c", "score": "0.6717156", "text": "function PropObserver_notifyChanges (chglist) {\n var c;\n for (var i = 0, sz = chglist.length; sz > i; i++) {\n c = chglist[i];\n if (!c)\n continue;\n // check if we listen to this property\n if (this.props[c.name]) {\n PropObserver_notifyChange(this, c, c.name);\n }\n }\n if (this.props[ALL]) {\n PropObserver_notifyChange(this, c, ALL);\n }\n}", "title": "" }, { "docid": "d3a3edbd6b98a17a45b615fae4a5c970", "score": "0.67094344", "text": "willWatchProperty(property) {\n this.beginObservingContentKey(property);\n }", "title": "" }, { "docid": "64253144257e2c2f329baa153a1f2cd2", "score": "0.6653575", "text": "propertyUpdated(propertyName) {\n // Intentionally left empty\n // Example usage:\n //switch (propertyName) {\n //case 'myProp':\n // this.textContent = this.myProp;\n // break;\n //default:\n // break;\n //}\n }", "title": "" }, { "docid": "5783b4df06816e4b6388aa52dfd14810", "score": "0.6520816", "text": "function interpositionEventListenerProperty(obj, propName) {\n var desc = Object.getOwnPropertyDescriptor(obj, propName);\n if (desc) {\n delete desc['value'];\n delete desc['writable'];\n var set_1 = desc.set;\n desc.set = function (val) {\n set_1.call(this, val);\n this[\"$$\" + propName] = val;\n };\n Object.defineProperty(obj, propName, desc);\n }\n }", "title": "" }, { "docid": "1a07a74ba2c2f4898735128fc7caae9f", "score": "0.6500015", "text": "onPropertyChangedCallback(name, oldValue, value) {\n super.onPropertyChangedCallback(name, oldValue, value);\n if (name in properties) {\n for (const descendant of this.descendants) {\n setPropertyOnDescendant(descendant, this, name, onlyDeclaredProperties);\n }\n }\n }", "title": "" }, { "docid": "f6295e313c5af42f75d470c4981e01e0", "score": "0.64932567", "text": "handleChangedIntProperty(aItem, aProperty, aOld, aNew) {\n return false;\n }", "title": "" }, { "docid": "30cbfd55ad31d67595a1370190c71d6b", "score": "0.6470013", "text": "function PropertySupport() {\n this._listeners = {};\n this.addPropertyListener = function(propertyName, listener) {\n if (!this._listeners[propertyName]) {\n this._listeners[propertyName] = [];\n }\n this._listeners[propertyName].push(listener);\n };\n this.changeProperty = function(propertyName) {\n if (this._listeners[propertyName]) {\n this._listeners[propertyName].forEach(function (listenerFunc) {\n listenerFunc();\n });\n }\n };\n }", "title": "" }, { "docid": "7f1c891a9f4ae4f6480e56e3825f3fe9", "score": "0.64451885", "text": "function propertyModifiedHandler() {\n renderPropertyValues(about, isAbout, property_uri, propertyContainer, template, mode);\n }", "title": "" }, { "docid": "67aca238c01e2f9e22459fbc3040a8b8", "score": "0.64378524", "text": "_propertyChangeHandler(newValue) {\n this.log.debug(\n this._propertyName,\n 'of device',\n this.device.type,\n this.device.id,\n 'changed to',\n newValue\n )\n\n const nv = this._propertyGetter\n ? this._propertyGetter.call(this.device, this._propertyName)\n : newValue\n\n this.characteristic.setValue(\n this._valueToHomeKit(nv)\n )\n\n this._setStatusFault(this.service, nv)\n }", "title": "" }, { "docid": "421c9715c0cff3185aed19a6900a46db", "score": "0.64182365", "text": "notify(propertyName) {\n const subscribers = this.subscribers[propertyName];\n\n if (subscribers !== void 0) {\n subscribers.notify(propertyName);\n }\n }", "title": "" }, { "docid": "68236e001b03150fb0877c77fec71229", "score": "0.63470364", "text": "updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n if (propName == \"data\") {\n this._dataChanged(this[propName]);\n }\n if (propName == \"manifest\") {\n this._manifestChanged(this[propName]);\n }\n if (propName == \"activeItem\") {\n this.refreshActiveChildren(this[propName], oldValue);\n }\n // notify\n if ([\"manifest\", \"items\", \"selected\"].includes(propName)) {\n this.dispatchEvent(\n new CustomEvent(`${propName}-changed`, {\n detail: {\n value: this[propName],\n },\n })\n );\n }\n });\n }", "title": "" }, { "docid": "fe1b668cf3228f161d825583d6a93e30", "score": "0.63456225", "text": "propertyChangedHandler(propertyName, oldValue, newValue) {\n const that = this;\n\n super.propertyChangedHandler(propertyName, oldValue, newValue);\n\n if (propertyName === 'hidden') {\n if (!newValue) {\n that.$.removeClass('jqx-hidden');\n }\n else {\n that.$.addClass('jqx-hidden');\n }\n }\n\n if (propertyName === 'displayMode') {\n that._setDisplayMode(newValue);\n }\n\n if (propertyName === 'label') {\n const context = that.context;\n that.context = document;\n that.innerHTML = newValue;\n\n const listBox = that.getListBox();\n listBox.onItemUpdated(that);\n that.context = context;\n }\n\n if (propertyName === 'details') {\n const context = that.context;\n that.context = document;\n that.$.details.innerHTML = newValue;\n\n const listBox = that.getListBox();\n listBox.onItemUpdated(that);\n that.context = context;\n }\n\n if (propertyName === 'innerHTML') {\n const listBox = that.getListBox();\n listBox.onItemUpdated(that);\n }\n }", "title": "" }, { "docid": "c85da6e89a2288fd89c8523e4372f44c", "score": "0.62612003", "text": "handleChange(source, propertyName) {\n super.handleChange(source, propertyName);\n\n if (propertyName === \"value\") {\n this.updateValue();\n }\n }", "title": "" }, { "docid": "5ad2b9607d196da45846f929d2e1e505", "score": "0.6254637", "text": "_qpChanged(controller, _prop) {\n var dotIndex = _prop.indexOf('.[]');\n\n var prop = dotIndex === -1 ? _prop : _prop.slice(0, dotIndex);\n var delegate = controller._qpDelegate;\n var value = (0, _metal.get)(controller, prop);\n delegate(prop, value);\n }", "title": "" }, { "docid": "5ad2b9607d196da45846f929d2e1e505", "score": "0.6254637", "text": "_qpChanged(controller, _prop) {\n var dotIndex = _prop.indexOf('.[]');\n\n var prop = dotIndex === -1 ? _prop : _prop.slice(0, dotIndex);\n var delegate = controller._qpDelegate;\n var value = (0, _metal.get)(controller, prop);\n delegate(prop, value);\n }", "title": "" }, { "docid": "c655afa2494194600a02d36321ed3ebc", "score": "0.6237686", "text": "notifySubscribers(property, value) {\n for (let i = 0; i < this._observers[property].length; i++) {\n this._observers[property][i](value);\n }\n }", "title": "" }, { "docid": "cb6659c961f0be8a14ba3759b2800008", "score": "0.6206936", "text": "function propHandler() {\n var $this = $(this);\n if (window.event.propertyName == \"value\" && !$this.data(\"triggering.inputEvent\")) {\n $this.data(\"triggering.inputEvent\", true).trigger(\"input\");\n window.setTimeout(function () {\n $this.data(\"triggering.inputEvent\", false);\n }, 0);\n }\n }", "title": "" }, { "docid": "d51a99636b966eaa97d335543190295d", "score": "0.6186125", "text": "notify(propertyName) {\n var _a;\n\n const subscribers = this.subscribers[propertyName];\n\n if (subscribers !== void 0) {\n subscribers.notify(propertyName);\n }\n\n (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.notify(propertyName);\n }", "title": "" }, { "docid": "a1987ce4968be0be2a809e19c28edd33", "score": "0.6145869", "text": "function defineProperty(key,handler,value){Object.defineProperty(ctrl,key,{get:function get(){return value;},set:function set(newValue){var oldValue=value;value=newValue;handler(newValue,oldValue);}});}", "title": "" }, { "docid": "2909dc9e3908cfb816310a898976a9a9", "score": "0.61368835", "text": "function propHandler() {\n const $this = $(this);\n if (window.event.propertyName == 'value' && !$this.data('triggering.inputEvent')) {\n $this.data('triggering.inputEvent', true).trigger('input');\n window.setTimeout(() => {\n $this.data('triggering.inputEvent', false);\n }, 0);\n }\n }", "title": "" }, { "docid": "27d40a88eead53bb09135ea6a1460c3b", "score": "0.61152637", "text": "function OnChange() {\n var sufix = 'Change';\n /* tslint:disable-next-line: no-any */\n\n return function OnChangeHandler(target, propertyKey) {\n var _key = \" __\".concat(propertyKey, \"Value\");\n\n Object.defineProperty(target, propertyKey, {\n /* tslint:disable-next-line: no-any */\n get: function get() {\n return this[_key];\n },\n\n /* tslint:disable-next-line: no-any */\n set: function set(value) {\n var prevValue = this[_key];\n this[_key] = value;\n\n if (prevValue !== value && this[propertyKey + sufix]) {\n this[propertyKey + sufix].emit(value);\n }\n }\n });\n };\n }", "title": "" }, { "docid": "33b9bb7ec2a10c118c90b60fbc9e4e69", "score": "0.6113786", "text": "onPropertyChange(sender, args) {\n this.svgElement.setAttribute(args.propertyName, args.value);\n }", "title": "" }, { "docid": "2a6b11129d5da0abf018ac8a25430b9a", "score": "0.60982716", "text": "function _emitChange(propname/*, arg1, ..., argX*/) {\n var args = arguments\n var evtArgs = $util.copyArray(args)\n var kp = $normalize($join(_rootPath(), propname))\n\n args[0] = CHANGE_EVENT + ':' + kp\n _emitter.emit(CHANGE_EVENT, kp)\n emitter.emit.apply(emitter, args)\n\n evtArgs[0] = kp\n evtArgs.unshift('*')\n emitter.emit.apply(emitter, evtArgs)\n }", "title": "" }, { "docid": "0df3af71974e2ca5c454e6a398fc574a", "score": "0.6053713", "text": "attributeChangedCallback(e,t,n){t!==n&&this._attributeToProperty(e,n)}", "title": "" }, { "docid": "6a64099aa26deed235c728c30e9c4e03", "score": "0.6046061", "text": "get propertyUpdated() {\n return this._propertyUpdated;\n }", "title": "" }, { "docid": "7c009424b7ea3f8571f63aa65537afbd", "score": "0.6039876", "text": "function defineProperty(key,handler,value){Object.defineProperty(ctrl,key,{get:function get(){return value;},set:function set(newValue){var oldValue=value;value=newValue;handler&&handler(newValue,oldValue);}});}", "title": "" }, { "docid": "74e8b988ab8637d284bdc1b28d074e16", "score": "0.6026778", "text": "updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n if (propName == \"trackIcon\") {\n this._trackIconChanged(this[propName], oldValue);\n }\n if ([\"id\", \"selected\"].includes(propName)) {\n this.__selectedChanged(this.selected, this.id);\n }\n });\n }", "title": "" }, { "docid": "dd283bb6ecd5b98eca8626446bad6f5c", "score": "0.6016658", "text": "handlePropertyChange(key, value) {\n const state = this.state;\n state.configuration[key] = value;\n this.setState(state);\n this.props.onConfigurationChange(state.configuration);\n }", "title": "" }, { "docid": "3e29ba1ecfcd26ef5c5390da8f0b5106", "score": "0.59896225", "text": "write(prop, value, obj) {\n if (obj) {\n obj.dispatchEvent(\n new CustomEvent(\"hax-store-write\", {\n composed: true,\n bubbles: true,\n cancelable: false,\n detail: { property: prop, value: value, owner: obj },\n })\n );\n }\n }", "title": "" }, { "docid": "8393986503aba3df2520516e0b6c960b", "score": "0.59886515", "text": "function notify(stateful, name, oldValue) {\n\t\tObservable.getNotifier(stateful).notify({\n\t\t\t// Property is never new because setting up shadow property defines the property\n\t\t\ttype: \"update\",\n\t\t\tobject: stateful,\n\t\t\tname: name + \"\",\n\t\t\toldValue: oldValue\n\t\t});\n\t}", "title": "" }, { "docid": "01d5a331a14ebb2bda04f9be30199987", "score": "0.59885377", "text": "function property (model, key) {\n return function (val) {\n return (\n get(val) ? model.get(key) :\n set(val) ? model.set(key, val) :\n (model.on('change:'+key, val), function () {\n model.removeListener('change:'+key, val)\n })\n )}}", "title": "" }, { "docid": "e92d7e284aee119b5c9b2a14e9e23e23", "score": "0.5986361", "text": "updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n if (propName == \"opened\") {\n this._openedChanged(this[propName], oldValue);\n }\n });\n }", "title": "" }, { "docid": "868e2b3cf675222fb001eb185cc643f2", "score": "0.5968173", "text": "function p(e,t){z=e,N=t,z.attachEvent(\"onpropertychange\",h)}", "title": "" }, { "docid": "8d9fa82718a7961feb21b2df58049a7e", "score": "0.5942622", "text": "function upcaseOnPropertyChange(event) {\n var e = event || window.event;\n // If the value property changed\n if (e.propertyName === \"value\") {\n // Remove onpropertychange handler to avoid recursion\n this.onpropertychange = null;\n // Change the value to all uppercase\n this.value = this.value.toUpperCase();\n // And restore the original propertychange handler\n this.onpropertychange = upcaseOnPropertyChange;\n }\n }", "title": "" }, { "docid": "aa05c71dec159b5c8dbd1562cd3d44f7", "score": "0.59270734", "text": "function propertyChangeHandler(key, newVal) {\n switch (key) {\n case 'locations':\n onLocationsChange(newVal);\n break;\n case 'lat':\n _lat = newVal;\n _buildMap();\n break;\n case 'lng':\n _lng = newVal;\n _buildMap();\n break;\n case 'icon':\n _icon = newVal;\n _buildMap();\n break;\n case 'info':\n _info = newVal;\n _buildMap();\n break;\n case 'shade':\n _color = newVal;\n _buildMap();\n break;\n case 'radius':\n _radius = newVal;\n _buildMap();\n break;\n case 'zoom':\n if (!isNaN(newVal)) {\n $s.zoom = newVal;\n }\n break;\n case 'origin':\n $s.directionsData.origin = newVal;\n _updateDirections();\n break;\n case 'destination':\n $s.directionsData.destination = newVal;\n _updateDirections();\n break;\n case 'perimeter':\n perimeter = newVal;\n break;\n case 'trafficlayer':\n $s.trafficlayer = newVal;\n break;\n }\n }", "title": "" }, { "docid": "0e3344d9eb1a17ed5537db8a9d7b36c3", "score": "0.59188217", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "0e3344d9eb1a17ed5537db8a9d7b36c3", "score": "0.59188217", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "0e3344d9eb1a17ed5537db8a9d7b36c3", "score": "0.59188217", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "0b554fdb50d4e81fd2eda10908e64302", "score": "0.59100795", "text": "updated(_changedProperties) {}", "title": "" }, { "docid": "0b554fdb50d4e81fd2eda10908e64302", "score": "0.59100795", "text": "updated(_changedProperties) {}", "title": "" }, { "docid": "0b554fdb50d4e81fd2eda10908e64302", "score": "0.59100795", "text": "updated(_changedProperties) {}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.59084284", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "4a4df84d07e79c2b3d24a5d39c2c3328", "score": "0.5891577", "text": "propertyChangedHandler(propertyName, oldValue, newValue) {\n const that = this;\n\n super.propertyChangedHandler(propertyName, oldValue, newValue);\n\n switch (propertyName) {\n case 'allowDrag':\n case 'allowDrop':\n case 'autoLoadState':\n case 'autoSort':\n case 'editable':\n case 'filterInputPlaceholder':\n case 'loadingIndicatorPlaceholder':\n case 'selectionDisplayMode':\n case 'showLines':\n case 'showRootLines':\n case 'toggleElementPosition':\n case 'toggleMode':\n break;\n case 'autoHideToggleElement':\n if (newValue) {\n that.$mainContainer.addClass('hidden-arrows');\n }\n else {\n that.$mainContainer.removeClass('hidden-arrows');\n }\n\n break;\n case 'autoSaveState':\n if (!newValue) {\n return;\n }\n\n if (!that.id) {\n that.warn(that.localize('noId'));\n that.autoSaveState = false;\n return;\n }\n\n window.localStorage.setItem('smartTree' + that.id, JSON.stringify(that._state));\n break;\n case 'dataSource': {\n const oldSelectedIndexes = that.selectedIndexes.slice(0);\n\n that.selectedIndexes = [];\n that._menuItems = {};\n that._processDataSource();\n that._checkOverflow();\n that._expandItemsByDefault();\n that._applySelection(true, oldSelectedIndexes);\n\n const filterQuery = that._state.filter;\n\n if (filterQuery) {\n that._applyFilter(filterQuery);\n }\n\n break;\n }\n case 'disabled':\n that._setFocusable();\n that.$.scrollButtonNear.disabled = newValue;\n that.$.scrollButtonFar.disabled = newValue;\n\n if (!newValue) {\n that._updateScrollButtonVisibility();\n }\n\n break;\n case 'displayLoadingIndicator':\n if (newValue) {\n that._discardKeyboardHover(true);\n that.$loadingIndicatorContainer.removeClass('smart-hidden');\n }\n else {\n that.$loadingIndicatorContainer.addClass('smart-hidden');\n }\n\n break;\n case 'filterable':\n if (newValue === false) {\n that._applyFilter('');\n that.$.filterInput.value = '';\n }\n\n that._checkOverflow();\n break;\n case 'filterMode':\n if (that.filterable && that._state.filter) {\n that._applyFilter(that._state.filter);\n }\n\n break;\n case 'hasThreeStates':\n if (that.selectionMode !== 'checkBox') {\n return;\n }\n\n if (newValue) {\n that._applySelection(false);\n }\n else {\n const indeterminateItems = (that.enableShadowDOM ? that.shadowRoot : that).querySelectorAll('[indeterminate]');\n\n for (let i = 0; i < indeterminateItems.length; i++) {\n indeterminateItems[i].removeAttribute('indeterminate');\n }\n }\n\n break;\n case 'loadingIndicatorPosition':\n if (newValue === 'center') {\n that.$loadingIndicatorPlaceHolder.addClass('smart-hidden');\n }\n else {\n that.$loadingIndicatorPlaceHolder.removeClass('smart-hidden');\n }\n\n break;\n case 'overflow':\n if (that.scrollMode === 'scrollbar') {\n if (newValue === 'hidden') {\n that.$.scrollViewer.$.verticalScrollBar.setAttribute('aria-hidden', true);\n }\n else {\n that.$.scrollViewer.$.verticalScrollBar.removeAttribute('aria-hidden');\n }\n\n if (newValue === 'scroll') {\n that.$.scrollViewer.verticalScrollBarVisibility = 'visible';\n }\n else {\n that.$.scrollViewer.verticalScrollBarVisibility = 'auto';\n }\n\n return;\n }\n\n that.$.scrollViewer.scrollTop = 0;\n\n if (newValue === 'hidden') {\n that.$scrollViewer.removeClass('scroll-buttons-shown');\n that.$scrollButtonNear.addClass('smart-hidden');\n that.$scrollButtonFar.addClass('smart-hidden');\n }\n else {\n that.$.scrollButtonNear.disabled = that.disabled;\n that.$.scrollButtonFar.disabled = that.disabled;\n\n if (newValue === 'auto') {\n that.$scrollButtonNear.addClass('smart-hidden');\n that.$scrollButtonFar.addClass('smart-hidden');\n that._checkOverflow();\n }\n else {\n that.$scrollViewer.addClass('scroll-buttons-shown');\n that.$scrollViewer.removeClass('one-button-shown');\n that.$scrollButtonNear.removeClass('smart-hidden');\n that.$scrollButtonFar.removeClass('smart-hidden');\n that._updateScrollButtonVisibility();\n }\n }\n\n that.$.scrollViewer.refresh();\n break;\n case 'rightToLeft': {\n let oldPadding, newPadding;\n\n if (newValue) {\n oldPadding = 'paddingLeft';\n newPadding = 'paddingRight';\n }\n else {\n oldPadding = 'paddingRight';\n newPadding = 'paddingLeft';\n }\n\n for (let path in that._menuItems) {\n if (that._menuItems.hasOwnProperty(path)) {\n const item = that._menuItems[path],\n labelContainer = item.firstElementChild;\n\n labelContainer.style[oldPadding] = '';\n that._setIndentation(labelContainer, item.level, newPadding);\n }\n }\n\n break;\n }\n case 'scrollMode':\n if (that.overflow === 'hidden') {\n return;\n }\n\n that.$.scrollViewer.scrollTop = 0;\n\n if (newValue === 'scrollButtons') {\n if (that.overflow === 'scroll') {\n that.$scrollViewer.addClass('scroll-buttons-shown');\n that.$scrollButtonNear.removeClass('smart-hidden');\n that.$scrollButtonFar.removeClass('smart-hidden');\n }\n\n that.$.scrollViewer.$.verticalScrollBar.setAttribute('aria-hidden', true);\n that.$.scrollViewer.verticalScrollBarVisibility = 'auto';\n that._checkOverflow();\n return;\n }\n\n that.$.scrollViewer.$.verticalScrollBar.removeAttribute('aria-hidden');\n that.$scrollViewer.removeClass('scroll-buttons-shown');\n that.$scrollViewer.removeClass('one-button-shown');\n that.$scrollButtonNear.addClass('smart-hidden');\n that.$scrollButtonFar.addClass('smart-hidden');\n\n if (that.overflow === 'auto') {\n that.$.scrollViewer.verticalScrollBarVisibility = 'auto';\n }\n else {\n that.$.scrollViewer.verticalScrollBarVisibility = 'visible';\n }\n\n\n break;\n case 'selectedIndexes':\n that._applySelection(false, oldValue);\n break;\n case 'selectionMode':\n that.setAttribute('aria-multiselectable', ['oneOrManyExtended', 'zeroOrMany', 'oneOrMany', 'checkBox', 'radioButton'].indexOf(newValue) !== -1);\n\n if (that._menuItems['0'] === undefined) {\n return;\n }\n\n if ((oldValue === 'one' && newValue !== 'none' && newValue !== 'checkBox' && newValue !== 'radioButton') ||\n (oldValue.indexOf('oneOrMany') !== -1 && newValue.indexOf('oneOrMany') !== -1) ||\n (oldValue === 'none' && (newValue.indexOf('zero') !== -1 || newValue === 'checkBox')) ||\n (newValue === 'zeroOrMany' && oldValue !== 'checkBox') ||\n (oldValue === 'radioButton' && newValue.indexOf('Many') !== -1) ||\n (!that.hasThreeStates && (newValue === 'checkBox' ||\n oldValue === 'checkBox' && newValue === 'zeroOrMany'))) {\n\n if (newValue === 'one' || newValue === 'oneOrManyExtended') {\n that._lastSelectedItem = that._menuItems[that.selectedIndexes[that.selectedIndexes.length - 1]];\n }\n else {\n that._lastSelectedItem = undefined;\n }\n\n that._applyAriaSelected();\n return;\n }\n\n if (that.hasThreeStates && oldValue === 'checkBox') {\n const indeterminateItems = (that.enableShadowDOM ? that.shadowRoot : that).querySelectorAll('[indeterminate]');\n\n for (let i = 0; i < indeterminateItems.length; i++) {\n indeterminateItems[i].removeAttribute('indeterminate');\n }\n }\n\n that._applySelection(false);\n break;\n case 'sort': {\n if (!that.sorted) {\n return;\n }\n\n that._refreshSorting();\n break;\n }\n case 'sortDirection':\n if (that.sorted && !that.sort) {\n that._unsortItems(that.$.mainContainer);\n that._applyGrouping(that.$.mainContainer);\n }\n\n break;\n case 'sorted': {\n if (!newValue && !that.autoSort) {\n that._refreshItemPathsAndSelection();\n that._updateState('sorted', false);\n return;\n }\n\n if (newValue) {\n that._applyGrouping(that.$.mainContainer);\n }\n else {\n that._unsortItems(that.$.mainContainer);\n }\n\n const filterQuery = that._state.filter;\n\n if (filterQuery) {\n that._applyFilter(filterQuery);\n }\n\n that._updateState('sorted', newValue);\n that._checkOverflow();\n break;\n }\n case 'unfocusable':\n that._setFocusable();\n break;\n }\n }", "title": "" }, { "docid": "988c38126683dc1f73e2fbacf7a45fed", "score": "0.58863795", "text": "onPropertyChange(property, value) {\n this.svgElement.setAttribute(property, value);\n }", "title": "" }, { "docid": "988c38126683dc1f73e2fbacf7a45fed", "score": "0.58863795", "text": "onPropertyChange(property, value) {\n this.svgElement.setAttribute(property, value);\n }", "title": "" }, { "docid": "81e5d46be88dd3ca3c9f78f82d3e0026", "score": "0.58808714", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t }", "title": "" }, { "docid": "bcb844c5d01585a7523573057084f482", "score": "0.58780855", "text": "updateOnStateChangeByOref(oRefParent, property) {\n for (let element of this.receivers) {\n if (element.target._targetObject === oRefParent &&\n property == element.property) {\n element.update();\n }\n }\n }", "title": "" }, { "docid": "05aa2f3e767e2f6aeba6e3bc979f52f8", "score": "0.587315", "text": "_propertiesChanged(currentProps, changedProps, oldProps) {\n // ----------------------------\n // let c = Object.getOwnPropertyNames(changedProps || {});\n // window.debug && console.group(this.localName + '#' + this.id + ': ' + c);\n // if (window.debug) { debugger; }\n // ----------------------------\n let hasPaths = this.__dataHasPaths;\n this.__dataHasPaths = false;\n // Compute properties\n runComputedEffects(this, changedProps, oldProps, hasPaths);\n // Clear notify properties prior to possible reentry (propagate, observe),\n // but after computing effects have a chance to add to them\n let notifyProps = this.__dataToNotify;\n this.__dataToNotify = null;\n // Propagate properties to clients\n this._propagatePropertyChanges(changedProps, oldProps, hasPaths);\n // Flush clients\n this._flushClients();\n // Reflect properties\n runEffects(this, this[TYPES.REFLECT], changedProps, oldProps, hasPaths);\n // Observe properties\n runEffects(this, this[TYPES.OBSERVE], changedProps, oldProps, hasPaths);\n // Notify properties to host\n if (notifyProps) {\n runNotifyEffects(this, notifyProps, changedProps, oldProps, hasPaths);\n }\n // Clear temporary cache at end of turn\n if (this.__dataCounter == 1) {\n this.__dataTemp = {};\n }\n // ----------------------------\n // window.debug && console.groupEnd(this.localName + '#' + this.id + ': ' + c);\n // ----------------------------\n }", "title": "" }, { "docid": "604e28b782f65b3c20c2842d1188dfbe", "score": "0.5869061", "text": "_changeEventListener() {}", "title": "" }, { "docid": "01fd44047692695a7e7bd745d8bc65fc", "score": "0.58599675", "text": "addChangeListener(callback) {\n this.on('change', callback)\n }", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.58581567", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "217040ae3543047a8d0be540ef668073", "score": "0.5849122", "text": "\"on-change\"() {}", "title": "" }, { "docid": "86e7ee7de856dbd343c9b940cf37114f", "score": "0.5842813", "text": "handlePropertyValueChange(propertyName, fieldName, value) {\n const state = this.state;\n state.configuration.properties[propertyName][fieldName] = value;\n this.setState(state);\n this.props.onChange(state.configuration);\n }", "title": "" }, { "docid": "52e25b3980be6ee36a5368f9c9fef126", "score": "0.58386993", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== \"value\") return;\n if (getInstIfValueChanged(activeElementInst)) manualDispatchChangeEvent(nativeEvent);\n }", "title": "" }, { "docid": "ab670ddb0cf82bcc878810625d06ee63", "score": "0.5815003", "text": "updated(_changedProperties) { }", "title": "" }, { "docid": "2648c8090223f53a9710b7a207a78ab2", "score": "0.58075094", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== \"value\") {\n return;\n }\n if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "fd8900deca9e68df3e0c37ecd375b7a2", "score": "0.58022", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\n\t if (getInstIfValueChanged(activeElementInst)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "fd8900deca9e68df3e0c37ecd375b7a2", "score": "0.58022", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\n\t if (getInstIfValueChanged(activeElementInst)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "be1dd7a91484f37f03fe18097684ff81", "score": "0.5800056", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "e53afef792b515d1970c5b3781deafd8", "score": "0.57986575", "text": "function watchPrimitiveProperties(vueInst, propertiesToTrack, handler) {\n var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var isHandled = false;\n\n function requestHandle() {\n if (!isHandled) {\n isHandled = true;\n vueInst.$nextTick(function () {\n isHandled = false;\n handler();\n });\n }\n }\n\n propertiesToTrack.forEach(function (prop) {\n vueInst.$watch(prop, requestHandle, {\n immediate: immediate\n });\n });\n}", "title": "" }, { "docid": "805efeeaa5ca8fc57e8991925808f050", "score": "0.5781082", "text": "addProperty(name) {\n let signal = this.addSignal(`${name}Changed`);\n this[`_${name}`] = new PropertyStorage(this, signal);\n this._properties.push(name);\n\n Object.defineProperty(this, name, {\n get: function() {\n return this[`_${name}`].evaluate();\n },\n set: function(val) {\n if(val && typeof val === 'object' && val.bindingMark) {\n // expr binding\n this[`_${name}`].assign(val.expr, val.context, val.thisDep, val.globalDep);\n } else\n this[`_${name}`].assign(val);\n }\n });\n }", "title": "" }, { "docid": "8f81ff04d168c1346cfd800cfbc95c20", "score": "0.57762843", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "8f81ff04d168c1346cfd800cfbc95c20", "score": "0.57762843", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "8f81ff04d168c1346cfd800cfbc95c20", "score": "0.57762843", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" } ]
d1004cfd266dbff77ccbb4ad86d4206f
======================================== Layout ======================================== Calculate page container height Window height navbars heights
[ { "docid": "869ac245fc58f4bb1e59b05f48a01662", "score": "0.69023937", "text": "function containerHeight() {\n var availableHeight = $(window).height() - $('body > .navbar').outerHeight() - $('body > .navbar-fixed-top:not(.navbar)').outerHeight() - $('body > .navbar-fixed-bottom:not(.navbar)').outerHeight() - $('body > .navbar + .navbar').outerHeight() - $('body > .navbar + .navbar-collapse').outerHeight() - $('.page-header').outerHeight();\n\n $('.page-container').attr('style', 'min-height:' + availableHeight + 'px');\n}", "title": "" } ]
[ { "docid": "8178b5bed6a1936b5e65fab3fc8f4347", "score": "0.7592277", "text": "function runContainerHeight() {\n var $windowWidth = $(window).width();\n var $windowHeight = $(window).height();\n var $pageArea = $windowHeight - $('body > .navbar').outerHeight() - $('body > .footer').outerHeight();\n var mainContainer = $('.main-content > .container');\n var mainNavigation = $('.main-navigation');\n //if ($pageArea < 629) {\n // $pageArea = 629;\n //}\n //if (mainContainer.outerHeight() < mainNavigation.outerHeight() && mainNavigation.outerHeight() > $pageArea) {\n // mainContainer.css('height', mainNavigation.outerHeight());\n //} else {\n // mainContainer.css('height', $pageArea);\n //}\n //if ($windowWidth < 768) {\n // mainNavigation.css('height', $windowHeight - $('body > .navbar').outerHeight());\n //}\n //moduloActual.resize();\n\n if ($pageArea < 760) {\n $pageArea = 760;\n }\n if (mainContainer.outerHeight() < mainNavigation.outerHeight() && mainNavigation.outerHeight() > $pageArea) {\n mainContainer.css('min-height', mainNavigation.outerHeight());\n } else {\n mainContainer.css('min-height', $pageArea);\n }\n if ($windowWidth < 768) {\n mainNavigation.css('min-height', $windowHeight - $('body > .navbar').outerHeight());\n }\n }", "title": "" }, { "docid": "5f402a01a3c88419ab2aeb047d753527", "score": "0.7094327", "text": "function nav_page_height() {\n setHeight = $('#main').height();\n menuHeight = $.left_panel.height();\n windowHeight = $(window).height() - $.navbar_height;\n //set height\n\n if (setHeight > windowHeight) { // if content height exceedes actual window height and menuHeight\n $.left_panel.css('min-height', setHeight + 'px');\n $.root_.css('min-height', setHeight + $.navbar_height + 'px');\n\n } else {\n $.left_panel.css('min-height', windowHeight + 'px');\n $.root_.css('min-height', windowHeight + 'px');\n }\n}", "title": "" }, { "docid": "0a07ca49ccdbd2b0dde9f2d428cde301", "score": "0.7077955", "text": "function containerHeight() {\n var availableHeight = $(window).height() - $('body .top-navbar').outerHeight();\n\n $('.page-container').attr('style', 'min-height:' + availableHeight + 'px');\n }", "title": "" }, { "docid": "f7c8b2a5fec18e51af6bc4ea3074cd61", "score": "0.70715827", "text": "function sectionHeight() {\n \"use strict\";\n calcHeight.height($(window).height() - navbarHeight);\n header.height($(window).height());\n}", "title": "" }, { "docid": "2bbbdf76148a8c96cffadf954199cc50", "score": "0.70682937", "text": "function containerHeight() {\r\n var availableHeight = $(window).height() - $('.page-container').offset().top - $('.navbar-fixed-bottom').outerHeight();\r\n\r\n $('.page-container').attr('style', 'min-height:' + availableHeight + 'px');\r\n $('.content-wrapper iframe').attr('style', 'min-height:' + availableHeight + 'px');\r\n \r\n var height = $(window).height() - $('.category-content').outerHeight() - $('.navbar').outerHeight();\r\n $('.sidebar-category').attr('style', 'overflow-y:scroll;height:' + height + 'px');\r\n }", "title": "" }, { "docid": "44d994e950843ed6bc6f52412112deae", "score": "0.70626163", "text": "function calculateSizes() {\n\t windowHeight = $(window).height();\n\t $(\"html\").hasClass(\"ipad ios7\") && (windowHeight -= 20);\n\t windowWidth = $(window).width();\n\t topnavHeight = parseInt($(\"body\").css(\"paddingTop\"), 10);\n\t viewportHeight = windowHeight - topnavHeight;\n\t}", "title": "" }, { "docid": "a7a3b2fe9eb3926104ff011cb4746c18", "score": "0.7035566", "text": "function calculateHeights() {\n $('.property__intro').outerHeight($(window).height()-$('.header').outerHeight());\n }", "title": "" }, { "docid": "39eda6721d49a27b5991208b00478eab", "score": "0.6967504", "text": "function nav_page_height() {\n setHeight = $('#main').height();\n menuHeight = $.left_panel.height();\n windowHeight = $(window).height() - $.navbar_height;\n //set height\n\n if (setHeight > windowHeight) {// if content height exceedes actual window height and menuHeight\n $.left_panel.css('min-height', setHeight + 'px');\n $.root_.css('min-height', setHeight + $.navbar_height + 'px');\n $(\"#push\").css('height', 2000);\n \n } else {\n $.left_panel.css('min-height', windowHeight + 'px');\n $.root_.css('min-height', windowHeight + 'px');\n }\n}", "title": "" }, { "docid": "47a47e5213377b3765dd29764f9179bb", "score": "0.69412917", "text": "function sideBarHeight() { \n \n var docHeight = $(document).height();\n var winHeight = $(window).height();\n \n $('.slide-in').height(winHeight);\n $('#main-container').height(winHeight);\n $('#sub-container').height($('#sub-container').height());\n }", "title": "" }, { "docid": "4ad74192a3b25091354730b46128d71c", "score": "0.6914339", "text": "function sideBarHeight() { \n\t\t\tvar docHeight = $(document).height();\n\t\t\tvar winHeight = $(window).height();\n\t\t\t$('.slide-in').height(winHeight);\n\t\t\t$('#main-container').height(winHeight);\n\t\t\t$('#sub-container').height($('#sub-container').height());\n\t\t}", "title": "" }, { "docid": "36de4099b73a540190565015707439cd", "score": "0.6776581", "text": "function getHeights() {\n\t\tscroll_height = document.body.scrollHeight;\n\t\twindow_height = window.innerHeight;\n\t\tscroll_top = window.pageYOffset;\n\t\tbackground_height = background.clientHeight;\n\t}", "title": "" }, { "docid": "466d24a316fa05e83903e8bde461b31b", "score": "0.6634021", "text": "function calculateHeight() {\n var H = $(window).height();\n $(\".window_height\").css(\"height\", H);\n }", "title": "" }, { "docid": "2298c9c871b19d6e5fe5ab28c4be8355", "score": "0.659693", "text": "function autoHeight() {\n let headerHeight = $('nav').outerHeight(true);\n let footerHeight = $('footer').outerHeight(true);\n let windowHeight = $(window).height();\n let contentHeight = $('.maintenance .second-section .container').outerHeight(true);\n // console.log('headerheight', headerHeight, footerHeight, windowHeight);\n\n let pageWidth = $(window).width();\n let firstTextHeight = $('.subPage .first_section .container').outerHeight();\n let homeFirstTextHeight = $('.home .first_section .container h1').outerHeight() + $('.home .first_section .container .content').outerHeight();\n let padding = (pageWidth / 1336 * 205 - firstTextHeight) / 2;\n let homePadding = (pageWidth / 1335 * 500 - homeFirstTextHeight) / 2;\n let maintenancePadding = (windowHeight - headerHeight - footerHeight - contentHeight) / 2;\n $('.maintenance .second-section .container').css({ 'padding-top': maintenancePadding + 'px', 'padding-bottom': maintenancePadding + 'px' })\n // console.log('width', headerHeight);\n // $('.subPage .section').css({ 'position': 'relative', 'top': headerHeight + 'px' });\n // $('.subPage footer').css({ 'position': 'relative', 'top': headerHeight + 'px' });\n // $('.home .section').css({ 'position': 'relative', 'top': headerHeight + 'px' });\n // $('.home footer').css({ 'position': 'relative', 'top': headerHeight + 'px' });\n\n if (pageWidth > 481) {\n let imageHeight = $('.home .third-section .solution .image').outerHeight();\n let textHeight = $('.home .third-section .solution .text h3').outerHeight() + $('.home .third-section .solution .text p').outerHeight();\n // console.log('image height', imageHeight, textHeight);\n let textPadding = (imageHeight - textHeight) / 2;\n $('.home .third-section .solution .text').css({ 'padding-top': textPadding + 'px', 'padding-bottom': textPadding + 'px' });\n $('.home .first_section .container').css({ 'padding-top': homePadding + 'px', 'padding-bottom': homePadding + 'px' });\n }\n else {\n $('.home .first_section .container').css({ 'padding-top': '5rem', 'padding-bottom': '5rem' });\n $('.home .third-section .solution .text').css({ 'padding-top': '3rem', 'padding-bottom': '5rem' });\n }\n if (pageWidth > 981) {\n $('.subPage .first_section .container').css({ 'padding-top': padding + 'px', 'padding-bottom': padding + 'px' });\n }\n else {\n $('.subPage .first_section .container').css({ 'padding-top': '5rem', 'padding-bottom': '5rem' });\n }\n}", "title": "" }, { "docid": "278a8a0b727dcf1a4085e86a05ea9b11", "score": "0.65960777", "text": "function calcHeights() {\n\t\t\n\t\t// set height of main columns\n\t\tfullHeightMinusHeader = jQuery(window).height() - jQuery(\".app-header\").outerHeight();\n\t\tjQuery(\".main-content, .sidebar-one\").height(fullHeightMinusHeader);\n\t\t\n\t\t// set height of sidebar scroll content\n jQuery(\".sidebar-one\").height(fullHeightMinusHeader);\n\t\tsideScrollHeight = fullHeightMinusHeader / 2;\n jQuery(\".side-scroll\").height(sideScrollHeight);\n jQuery(\".side-scroll2\").height(sideScrollHeight);\n\t\t\t\t\t\n\t} // end calcHeights function", "title": "" }, { "docid": "2c7f3c77e4dbfb5e3b880f37b5368e68", "score": "0.65470326", "text": "_getNavbarHeight() {\n const layoutNavbar = this.getLayoutNavbar()\n\n if (!layoutNavbar) return 0\n if (!this.isSmallScreen()) return layoutNavbar.getBoundingClientRect().height\n\n // Needs some logic to get navbar height on small screens\n\n const clonedEl = layoutNavbar.cloneNode(true)\n clonedEl.id = null\n clonedEl.style.visibility = 'hidden'\n clonedEl.style.position = 'absolute'\n\n Array.prototype.slice.call(clonedEl.querySelectorAll('.collapse.show')).forEach(el => this._removeClass('show', el))\n\n layoutNavbar.parentNode.insertBefore(clonedEl, layoutNavbar)\n\n const navbarHeight = clonedEl.getBoundingClientRect().height\n\n clonedEl.parentNode.removeChild(clonedEl)\n\n return navbarHeight\n }", "title": "" }, { "docid": "5663cff5ed1d9d6c4c626729aab42354", "score": "0.6540528", "text": "function wrapperHeight() {\r\n\t\tvar headerHeight = $(\"#header-container\").outerHeight();\r\n\t\tvar windowHeight = $(window).outerHeight() - headerHeight;\r\n\t\t$('.full-page-content-container, .dashboard-content-container, .dashboard-sidebar-inner, .dashboard-container, .full-page-container').css({ height: windowHeight });\r\n\t\t$('.dashboard-content-inner').css({ 'min-height': windowHeight });\r\n\t}", "title": "" }, { "docid": "1deca801a5ebf6aaf1fb0579ccf66b26", "score": "0.653688", "text": "function adjustDocumentHeightAndComponents(){\n let windowInnerHeight = window.innerHeight + 'px';\n let contentMargin = window.getComputedStyle( document.querySelector('.container .content')).margin;\n let navHeight = window.getComputedStyle(navTag).height;\n let footerHeight = window.getComputedStyle(footerTag).height;\n document.querySelector('.container').style.gridTemplateRows = `${navHeight} calc(${windowInnerHeight} - (${navHeight} + ${footerHeight}) ) ${footerHeight}`;\n document.querySelector('.container .content section').style.minheight = `calc(${windowInnerHeight} - (${navHeight} + ${footerHeight} - (${contentMargin}) * 2 )} )`;\n htmlTag.style.height = window.innerHeight + \"px\";\n bodyTag.style.height = window.innerHeight + \"px\";\n asideTag.style.top = `${navHeight}`;\n asideTag.style.height = `calc(${window.innerHeight}px - ${navHeight})`;\n}", "title": "" }, { "docid": "4e4c337be70de30d503400b4e3a70c6e", "score": "0.65322214", "text": "function calculateSectionSizes() {\n var vHeight = $(window).height();\n var verticalNavBar = $(\"#vertical_nav\");\n var sectionContainer = $(\".section-container\").add(\".forward-arrow,.back-arrow\");\n var sections = $(\".nav_section\");\n\n sectionContainer.css({\n \"position\": \"relative\",\n \"top\": \"50%\",\n \"transform\": \"translateY(-50%)\"\n });\n sections.css({\n \"height\": vHeight\n });\n verticalNavBar.css({\n \"left\": sectionContainer.offset().left,\n \"border\": \"0px\"\n });\n }", "title": "" }, { "docid": "b1fadc2e70a9965687da56020c387f90", "score": "0.6473312", "text": "function set_scroll_wrapper_height() {\n // Window height - navbar height - banner height - filter bar height\n var h = $(window).height() - $('.navbar').height() - $('.banner').height() - $('.filter-container').outerHeight();\n\n $(list_container_name()).height(h);\n}", "title": "" }, { "docid": "e54c050b812207c537584292ab02522d", "score": "0.646301", "text": "function correctHeight() {\n /*\n var pageWrapper = jQuery('#page-wrapper');\n var navbarHeigh = jQuery('nav.navbar-default').height();\n var wrapperHeigh = pageWrapper.height();\n \n if (navbarHeigh > wrapperHeigh) {\n pageWrapper.css(\"min-height\", navbarHeigh + \"px\");\n }\n \n if (navbarHeigh < wrapperHeigh) {\n if (navbarHeigh < jQuery(window).height()) {\n pageWrapper.css(\"min-height\", jQuery(window).height() + \"px\");\n } else {\n pageWrapper.css(\"min-height\", navbarHeigh + \"px\");\n }\n }\n \n if (jQuery('body').hasClass('fixed-nav')) {\n if (navbarHeigh > wrapperHeigh) {\n pageWrapper.css(\"min-height\", navbarHeigh + \"px\");\n } else {\n pageWrapper.css(\"min-height\", jQuery(window).height() - 60 + \"px\");\n }\n }\n */\n}", "title": "" }, { "docid": "ff541d53a7e0e1c6bff9b18effa7bc48", "score": "0.6434574", "text": "function pageContainerSpacing (hh, iosf) {\r\n/*if( $('nav.ios-global-nav:visible').length === 0 ) {\r\n iosf = 0;\r\n}\r\n$('div.page-container').css({\r\n 'padding-top': 15 + hh + 'px',\r\n 'padding-bottom': 15 + iosf + 'px'\r\n});*/\r\n\r\n// //adjsuting height as per header and footer\r\n// var hh_ht = $(\".global-header\").height();\r\n// var ff_ht = $(\".global-footer\").height();\r\n\r\n// $('div.page-container').height($(window).height() - hh_ht - ff_ht - 30);\r\n// console.log($('div.page-container').height());\r\n}", "title": "" }, { "docid": "1a05e8575d09de05dec9fdc2258f1145", "score": "0.6367847", "text": "function containerHeight() {\n var cnt = scope.data && scope.data.length || 0;\n return cnt * theight;\n }", "title": "" }, { "docid": "07d15f57e46e9e85fb4f382a9b797a5d", "score": "0.63538074", "text": "function fixPagesHeight() {\n\t\t$('.swiper-pages').css({\n\t\t\theight: $(window).height()-nav.height\n\t\t})\n\t}", "title": "" }, { "docid": "214ad63dec28a7815cae2f65f2f7f9ff", "score": "0.6341387", "text": "function resize() {\n\trequire([\"dojo/_base/window\",\"dojo/dom-geometry\",\"dojo/dom-class\"], function(win,domGeom,domClass){\n\t\tfunction windowHeight() {\n\t\t\tvar scrollRoot = (dojo.doc.compatMode == 'BackCompat') ? dojo.body() : dojo.doc.documentElement;\n\t\t\treturn scrollRoot.clientHeight;\n\t\t}\n\t\tfunction eltHeight(c) {\n\t\t\tvar e = dojo.query(c);\n\t\t\tvar h = e && e.length>0?domGeom.getMarginBox(e[0]).h:0;\n\t\t\treturn h;\n\t\t}\n\t\tvar h = windowHeight();\n\t\tif(domClass.contains(win.body(),\"lotusui30\")) {\n\t\t\tvar hd = eltHeight(\"#nav_bar_include\")+eltHeight(\".lotusBanner\")+eltHeight(\".lotusTitleBar2\")+eltHeight(\".lotusTitleBar\")+eltHeight(\".lotusPlaceBar\");\n\t\t\tvar ft = eltHeight(\".lotusFooter\")+eltHeight(\".lotusLegal\");\n\t\t\tdojo.query(\".lotusMain\").style(\"height\",(h-hd-ft)+\"px\");\n\t\t\t//console.log(\"h=\"+h+\", hd=\"+hd+\", ft=\"+ft+\", result=\"+(h-hd-ft-25))\n\t\t\tdijit.byId(pageGlobal.borderContainer).resize()\n\t\t} else if(domClass.contains(win.body(),\"dbootstrap\")) {\n\t\t\tvar hd = eltHeight(\"#nav_bar_include\")+eltHeight(\".lotusBanner\")+eltHeight(\".lotusTitleBar2\")+eltHeight(\".lotusTitleBar\")+eltHeight(\".lotusPlaceBar\");\n\t\t\tvar ft = eltHeight(\".lotusFooter\")+eltHeight(\".lotusLegal\");\n\t\t\tdojo.query(\".container-fluid\").style(\"height\",(h-hd-ft)+\"px\");\n\t\t\tdojo.query(\".row-fluid\").style(\"height\",\"100%\");\n\t\t\tdojo.query(\".span12\").style(\"height\",\"100%\");\n\t\t\tconsole.log(\"h=\"+h+\", hd=\"+hd+\", ft=\"+ft+\", result=\"+(h-hd-ft-25))\n\t\t\tdijit.byId(pageGlobal.borderContainer).resize()\n\t\t}\n\t});\n}", "title": "" }, { "docid": "04edbd51351777188c3ffbde5ceec95d", "score": "0.6323288", "text": "function windowHeight() { \nif(dynamicBrowser.ie4||dynamicBrowser.ie5) { \nreturn height=document.body.clientHeight } \nreturn height=window.innerHeight }", "title": "" }, { "docid": "5d14c1dabb40f3bf92735723a0259f0c", "score": "0.63166374", "text": "function responsiveView() {\n\tvar win = $(window).height();\n\n\tvar n = parseInt($('.navbar').css('height').replace('px',''))\n\n\tvar s1 = parseInt($('.serviceContainer').css('padding-top').replace('px',''))\n\tvar s2 = parseInt($('.serviceContainer').css('padding-bottom').replace('px',''))\n\tvar s3 = parseInt($('.serviceContainer').css('margin-top').replace('px',''))\n\tvar s4 = parseInt($('.serviceContainer').css('margin-bottom').replace('px',''))\n\tvar sH = s1 + s2 + s3 + s4;\n\n\tvar sa1 = parseInt($('.standalone').css('height').replace('px','')) \n\n\tvar f = parseInt($('#footerwrap').css('height').replace('px',''))\n\tvar smb = parseInt($('.standalone').css('margin-bottom').replace('px',''))\n\tvar h = parseInt($('#headerwrap').css('height').replace('px',''))\n\n\tvar calc1 = (n + f + smb);\n\tvar calc2 = (n + h + f +sH);\n\n\t$('.standalone').css('min-height',(win - calc1 + 10)+\"px\");\n\t$('.serviceContainer').css('height',(win - calc2 + 10)+\"px\");\n}", "title": "" }, { "docid": "924f391a338f8e4c995d9f27781edda3", "score": "0.6316199", "text": "function adjustBoardContainer() {\n var height = window.innerHeight || window.clientHeight;\n var divs = document.getElementsByClassName('board-container');\n var nav = document.querySelector('nav[aria-label=\"main navigation\"]');\n\n for (var i = 0; i < divs.length; i++) {\n divs[i].style.height = (height - nav.clientHeight - 10) + 'px';\n }\n }", "title": "" }, { "docid": "ea9436c067683e5c82d8ef6365862c3a", "score": "0.6312941", "text": "get rootStickieSpaceHeight(){return document.body.offsetHeight-document.getElementById('header').offsetHeight;}", "title": "" }, { "docid": "8677060b8560ffe8850fc15007ad48e2", "score": "0.63120145", "text": "function setPageDimensions() {\n var bannerHeight = $('#headBannerHome').height();\n var windowHeight = $(window).height();\n var windowWidth = $(window).width();\n\n var pageHeight = windowHeight;\n if ($('#expressHomeFrame .page-row').is(\":visible\")) {\n var expressPageHeight = 0;\n $('#expressHomeFrame .page-row').each(function() {\n expressPageHeight += $(this).outerHeight();\n });\n expressPageHeight += $('#expressHomeFrame .page-break-banner').outerHeight();\n pageHeight = Math.max(expressPageHeight + bannerHeight, windowHeight);\n }\n else if ($('#applicationHomeFrame .page-row').is(\":visible\")) {\n var applicationsPageHeight = 0;\n $('#applicationHomeFrame .page-row').each(function() {\n applicationsPageHeight += $(this).outerHeight();\n });\n pageHeight = Math.max(applicationsPageHeight + bannerHeight, windowHeight);\n }\n else if ($('#processFrame .page-row').is(\":visible\")) {\n var processPageHeight = 0;\n $('#processFrame .page-row').each(function() {\n processPageHeight += $(this).outerHeight();\n });\n pageHeight = Math.max(processPageHeight + bannerHeight, windowHeight);\n }\n\n $('.page').css(\"width\", windowWidth + \"px\");\n $('.page').css(\"height\", pageHeight + \"px\");\n\n $('.task-view').css(\"width\", windowWidth + \"px\");\n $('.task-view').css(\"height\", (windowHeight - bannerHeight) + \"px\");\n}", "title": "" }, { "docid": "aa98123f84b36630da6acc8223723174", "score": "0.63037467", "text": "function setPageHeights(){\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tvar scrollHeight = null;\n\t\t\t\tconsole.log(\"starting to set height!\");\n\t\t\t\tpage.evaluate(() => window.document.body.scrollHeight).then((pageSH) => {\n\t\t\t\t\tconsole.log(pageSH);\n\t\t\t\t\tscrollHeight = pageSH;\n\t\t\t\t\treturn page.evaluate(() => window.innerHeight);\n\t\t\t\t}).then((pageIH) => {\n\t\t\t\t\tconsole.log(pageIH);\n\t\t\t\t\tpageInnerHeight = pageIH;\n\t\t\t\t\treturn page.evaluate(() => window.innerWidth);\n\t\t\t\t}).then((pageIW) => {\n\t\t\t\t\tconsole.log(pageIW);\n\t\t\t\t\tpageInnerWidth = pageIW;\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "03bc2d4157f891a9d672078945dd5034", "score": "0.62988627", "text": "function getMainAreaHeight(){\n var viewportHeight = document.getElementById('body').offsetHeight;\n if (!headerHeight){\n headerHeight = document.getElementById('header').offsetHeight;\n }\n if (!footerHeight){\n footerHeight = document.getElementById('footer').offsetHeight;\n }\n \n return (viewportHeight - headerHeight - footerHeight - 35 - 35);\n}", "title": "" }, { "docid": "6fcd36bbc1fdab121a7771fbcec9612f", "score": "0.62648743", "text": "static calcHeight() {\n $('.main_and_aside').css(\n 'min-height', \n `${Math.max(651, $(window)[0].innerHeight).toString()}px`);\n }", "title": "" }, { "docid": "b8807b621f4beaccea744fe1f01e0659", "score": "0.62298226", "text": "function height_menu_adjustments() {\n var AdminBarHeight = $('#wpadminbar').innerHeight();\n var WindowHeight = $(window).height();\n var HeaderHeight = $('header').innerHeight();\n var TitleHeight = $('.title-nav-bar').innerHeight();\n $('#photo').css('height', WindowHeight - (TitleHeight + HeaderHeight + AdminBarHeight) + 'px').css('top', AdminBarHeight + HeaderHeight);\n $('.info, .grid-outer, .content-default-wrap').not('.info .grid-outer').css('margin-bottom', TitleHeight + 'px');\n var info_padding_top = $('.info').css('padding-top');\n $('.info').css('margin-top', WindowHeight - AdminBarHeight - HeaderHeight - TitleHeight - parseInt(info_padding_top, 10) + 'px');\n $('.nav-container').css('margin-top', HeaderHeight + 'px');\n }", "title": "" }, { "docid": "309fa85dcab211cf681b83c953924785", "score": "0.6227208", "text": "function navbarToggleUpdateElements(){\n \n adjustLogo();\n adjustNavbar();\n adjustFooterFont();\n \n /*for testing*/\n getDynamicWightHeight();\n}", "title": "" }, { "docid": "7877f33c2e9998ebcfd4a807f03327a4", "score": "0.6221608", "text": "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\n var navbarHeigh = $('nav.navbar-default').height();\n var wrapperHeigh = $('#page-wrapper').height();\n\n if(navbarHeigh > wrapperHeigh){\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\n }\n\n if(navbarHeigh < wrapperHeigh){\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n }\n\n }", "title": "" }, { "docid": "4cdbba7190f784cec803b4f1f6073307", "score": "0.61992586", "text": "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\n var navbarHeigh = $('nav.navbar-default').height();\n var wrapperHeigh = $('#page-wrapper').height();\n\n if (navbarHeigh > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\n }\n\n if (navbarHeigh < wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n }\n\n if ($('body').hasClass('fixed-nav')) {\n $('#page-wrapper').css(\"min-height\", $(window).height() - 60 + \"px\");\n }\n\n }", "title": "" }, { "docid": "afd49382651397b661c6be6e8cd81ea5", "score": "0.6197256", "text": "function pageHeight() {\n return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;\n}", "title": "" }, { "docid": "1133dd01cc40b95415d4d29525226e34", "score": "0.61802757", "text": "function manageHeight(){\n\t\tlet windowHeight = $(window).height();\n\t\tlet numberSectionHeight = windowHeight-operationScreen.height();\n\t\t// set dynamic height to number section\n\t\tnumberSection.css({'height':numberSectionHeight});\n\t\tnumberBox.css({'height':numberSectionHeight/4});\n\t\tmathSymbol.css({'height':numberSectionHeight/4});\n\t}", "title": "" }, { "docid": "8403ee02dd694636625924d8f1a52b54", "score": "0.61780965", "text": "get contentHeight() {\n return this.viewState.heightMap.height + this.viewState.paddingTop + this.viewState.paddingBottom;\n }", "title": "" }, { "docid": "53f97014ed5351686dd1a8dc0e5afb51", "score": "0.6176218", "text": "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\n var navbarHeigh = $('nav.navbar-default').height();\n var wrapperHeigh = $('#page-wrapper').height();\n\n if (navbarHeigh > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\n }\n\n if (navbarHeigh < wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n }\n\n if ($('body').hasClass('fixed-nav')) {\n if (navbarHeigh > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeigh - 60 + \"px\");\n } else {\n $('#page-wrapper').css(\"min-height\", $(window).height() - 60 + \"px\");\n }\n }\n\n }", "title": "" }, { "docid": "72cba1888bb8a509c7ead845402dccd7", "score": "0.61727667", "text": "function setContentHeight() {\n var windowHeight = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height);\n /*\n * page-container\n * side-menu\n * page-content-wrapper\n */\n var contentHeight = (windowHeight - ($('#page-header').height() + 20));\n $('#page-container').css('min-height', (windowHeight - ($('#page-header').height() + 2)));\n $('#page-content-wrapper').css('min-height', (windowHeight - ($('#page-header').height() + 2)));\n }", "title": "" }, { "docid": "5a1f3651640444be2891616e7771bc11", "score": "0.61721826", "text": "function heightDetect() {\n\t\t$(\".mainHead\").css(\"height\", $(window).height());\n\t\t$(\".sectionHead\").css(\"height\", $(window).height());\n\t}", "title": "" }, { "docid": "0e63046988a53a7a5529ae1eb7d22162", "score": "0.61614835", "text": "function fix_height() {\r\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\r\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\r\n\r\n var navbarHeigh = $('nav.navbar-default').height();\r\n var wrapperHeigh = $('#page-wrapper').height();\r\n\r\n if(navbarHeigh > wrapperHeigh){\r\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\r\n }\r\n\r\n if(navbarHeigh < wrapperHeigh){\r\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\r\n }\r\n\r\n if ($('body').hasClass('fixed-nav')) {\r\n if (navbarHeigh > wrapperHeigh) {\r\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\r\n } else {\r\n $('#page-wrapper').css(\"min-height\", $(window).height() - 60 + \"px\");\r\n }\r\n }\r\n\r\n }", "title": "" }, { "docid": "0d83a13b35c8ea061a2f94e7a1bdc120", "score": "0.6150787", "text": "function getCollapsedBarHeight() {\n\t\tvar backgroundTop = 410; //Change me if wood background css is touched\n\t\tvar backgroundHeight = 348;\n\t\tvar sectionHeight = window.innerHeight - 80;\n\t\tvar offset = (sectionHeight - backgroundHeight - backgroundTop) / 2;\n\t\t//console.log('getCollapsedBarHeight: ',offset);\n\t\treturn offset > 0 ? offset + 80 : 80;\n\t}", "title": "" }, { "docid": "ea7cc03cefda7368b7fb30650e59e2c4", "score": "0.61495215", "text": "function page_home_onresize() {\n\t\t$(\".page-home .about .right\").height($(\".page-home .about .left\").outerHeight(false));\n\n\t\t// set height of tallest toolbox to all\n\t\tvar tbox_h = 0, t_cont = $(\".page-home ul.tools\");\n\t\tt_cont.children(\"li\").css(\"height\", \"auto\"); // resetting height before calculating\n\t\tt_cont.children(\"li\").each(function() {\n\t\t\tvar item = $(this), h = parseInt(item.height());\n\t\t\tif(tbox_h < h)\n\t\t\t\ttbox_h = h;\n\t\t});\n\t\tt_cont.children(\"li\").height(tbox_h);\n\n\t\tvar ptop = (win.outerHeight(true) - t_cont.outerHeight(true) )/2;\n\t\tif(ptop > 0) {\n\t\t\tt_cont.closest(\"section.page\").css(\"padding-top\", ptop).css(\"padding-bottom\", ptop);\n\t\t}\n\n\t}// page_home_onresize", "title": "" }, { "docid": "f289895516e46671cbae88b0cf8c0569", "score": "0.61476463", "text": "function homeSize(){\n\n\tif(window.location.pathname == '/creative-services/'){\n\t\tvar viewportHeight = $(window).height() - 50;\n\n\t\tif(viewportHeight <= 900 && viewportHeight > 800){\n\t\t\t$('.page-home .content-area').css('height', 900);\n\t\t\t$('.page-home .content-area').css('padding-top', '3%');\n\t\t}else if(viewportHeight <= 800 && viewportHeight > 650){\n\t\t\t$('.page-home .content-area').css('height', 900);\n\t\t\t$('.page-home .content-area').css('padding-top', '0%');\n\t\t}else if(viewportHeight <= 650){\n\t\t\t$('.page-home .content-area').css('height', 575);\n\t\t}else{\n\t\t\t$('.page-home .content-area').css('padding-top', '6.5%');\n\t\t\t$('.page-home .content-area').css('height', viewportHeight);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "14c962cecc1804c5243d9deeacec6c3a", "score": "0.614386", "text": "function accountForAppBarHeight() {\n var header = document.getElementById('sbn-header')\n var sidebar = document.getElementById('sbn-sidebar')\n var menuHandle = document.getElementById('sbn-menu-handle')\n var appBar = document.getElementById('pds-app-bar')\n if(header && sidebar && appBar && (sidebar.offsetTop <= header.offsetHeight + header.offsetTop)) {\n sidebar.style.top = (header.offsetHeight + header.offsetTop) + 'px';\n }\n if(header && menuHandle && appBar && (menuHandle.offsetTop <= header.offsetHeight + header.offsetTop)) {\n menuHandle.style.top = (header.offsetHeight + header.offsetTop) + 'px';\n }\n }", "title": "" }, { "docid": "3b90ed897bf0d21bdbfdb4bd5d3ae2ff", "score": "0.6139632", "text": "function maxHeight(){\n // Which is the window height, minus toolbar, and a margin of 25px\n return $(window).height()-$('#toolbar').height()-25;\n}", "title": "" }, { "docid": "0820c4103135f094eb0b8f3c443810a7", "score": "0.613135", "text": "function calcScrollValues() {\n\t\twindowHeight = $(window).height();\n\t\twindowScrollPosTop = $(window).scrollTop();\n\t\twindowScrollPosBottom = windowHeight + windowScrollPosTop;\n\t} // end calcScrollValues", "title": "" }, { "docid": "8dc5be9799bcd5eac4c5f02a33f8154a", "score": "0.6130612", "text": "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\n var navbarHeight = $('nav.navbar-default').height();\n var wrapperHeigh = $('#page-wrapper').height();\n\n if (navbarHeight > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeight + \"px\");\n }\n\n if (navbarHeight < wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n }\n\n if ($('body').hasClass('fixed-nav')) {\n if (navbarHeight > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeight + \"px\");\n } else {\n $('#page-wrapper').css(\"min-height\", $(window).height() - 60 + \"px\");\n }\n }\n\n }", "title": "" }, { "docid": "dc9c406061c86ec1367350d7cf23076b", "score": "0.6122149", "text": "function GetGiorGioNavHeight() {\n var o = 0;\n return 0 < $(\".navigation\").length && (o = $(\".navigation\").outerHeight(), $(\".navigation_mobile\").is(\":visible\") && (o += $(\".navigation_mobile\").outerHeight())), parseInt(o)\n}", "title": "" }, { "docid": "fe05a922627a27f82dc6cfd6a3312e9c", "score": "0.6114215", "text": "function fix_height() {\n\t\tvar heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n\t\t$(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\n\t\tvar navbarHeigh = $('nav.navbar-default').height();\n\t\tvar wrapperHeigh = $('#page-wrapper').height();\n\n\t\tif(navbarHeigh > wrapperHeigh){\n\t\t\t$('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\n\t\t}\n\n\t\tif(navbarHeigh < wrapperHeigh){\n\t\t\t$('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n\t\t}\n\n\t}", "title": "" }, { "docid": "bf8f16e9944429475b7297b935b40da0", "score": "0.6111717", "text": "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebar-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\n var navbarHeigh = $('nav.navbar-default').height();\n var wrapperHeigh = $('#page-wrapper').height();\n\n if (navbarHeigh > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\n }\n\n if (navbarHeigh < wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n }\n\n if ($('body').hasClass('fixed-nav')) {\n if (navbarHeigh > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeigh - 60 + \"px\");\n } else {\n $('#page-wrapper').css(\"min-height\", $(window).height() - 60 + \"px\");\n }\n }\n\n }", "title": "" }, { "docid": "ef9b2391de58ea69548ffe1bfb5f5101", "score": "0.6106767", "text": "function getWindowHeight(){return'innerHeight'in window?window.innerHeight:document.documentElement.offsetHeight;}", "title": "" }, { "docid": "8b48cad7806ce275b333c62b238b840f", "score": "0.6105866", "text": "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n var navbarHeigh = $('nav.navbar-default').height();\n var wrapperHeigh = $('#page-wrapper').height();\n\n if (navbarHeigh > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\n }\n\n if (navbarHeigh < wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n }\n\n if ($('body').hasClass('fixed-nav')) {\n $('#page-wrapper').css(\"min-height\", $(window).height() - 60 + \"px\");\n }\n }", "title": "" }, { "docid": "93013e46f1de017e73ef3c3f59437ea7", "score": "0.6100461", "text": "get contentHeight() {\n return this.viewState.heightMap.height + this.viewState.paddingTop + this.viewState.paddingBottom;\n }", "title": "" }, { "docid": "c06cfd8b13dc5e4342f356286ee1939a", "score": "0.60949033", "text": "function getPageScrollHeight() {\n let pageScrollHeight = [];\n\n pageScrollHeight.push(0)\n for (var i = 1; i < pages.length; i++) {\n pageScrollHeight.push(pageScrollHeight[i-1]+pages[i-1].offsetHeight-tolerance); //40px tolerance to change more rapid\n }\n return pageScrollHeight;\n}", "title": "" }, { "docid": "113004f20301b3c6e6e392f1b13c3174", "score": "0.60920924", "text": "function home(){\n var h = $( window ).outerHeight(true); // Taille de la fenetre\n // $('#section-projet').css('min-height', (h)+'px');\n $('.slide-item').css('height', (h)+'px');\n $('.image').css('height', (h)+'px');\n $('.section-ajsa').css('min-height', (h)+'px');\n //$('.zone1').css('height', (h/2)+'px');\n //$('.zone2').css('height', (h/2)+'px');\n }", "title": "" }, { "docid": "46f3e7ad36d768e5728349121bab85d6", "score": "0.60893995", "text": "function adjustHeight() {\n $section.css('height', window.innerHeight - 22);\n VIS.Env.setScreenHeight(window.innerHeight - 42 - 22);\n\n if (VIS.viewManager)\n VIS.viewManager.sizeChanged();\n }", "title": "" }, { "docid": "2c8e4f6760b992ec2fec07479f206bb3", "score": "0.6088241", "text": "function fix_height(){var heightWithoutNavbar=$(\"body > #wrapper\").height()-61;$(\".sidebard-panel\").css(\"min-height\",heightWithoutNavbar+\"px\");var navbarHeight=$('nav.navbar-default').height();var wrapperHeight=$('#page-wrapper').height();if(navbarHeight>wrapperHeight){$('#page-wrapper').css(\"min-height\",navbarHeight+\"px\");}if(navbarHeight<wrapperHeight){$('#page-wrapper').css(\"min-height\",$(window).height()+\"px\");}if($('body').hasClass('fixed-nav')){if(navbarHeight>wrapperHeight){$('#page-wrapper').css(\"min-height\",navbarHeight+\"px\");}else{$('#page-wrapper').css(\"min-height\",$(window).height()-60+\"px\");}}}", "title": "" }, { "docid": "30f2d69eeaccb5afa4612209b4e01a03", "score": "0.608795", "text": "function vpHeight() {\r\n\treturn window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n}", "title": "" }, { "docid": "37ee01b6cd29dfd6ec7a9f44fff89fa5", "score": "0.6082739", "text": "function portfoliosidebar_height() {\n\t\tvar width = $(window).width();\n\t\tvar cnt_height = $(\".portfolio-single-layout-5 .porject-details .group-image-list\").height();\n\t\tif( width >= 768 ) {\n\t\t\t$(\".portfolio-single-layout-5 .porject-details .col-md-4\").removeAttr(\"style\");\n\t\t\t$(\".portfolio-single-layout-5 .porject-details .col-md-4\").css(\"height\", cnt_height);\n\t\t} else {\n\t\t\t$(\".portfolio-single-layout-5 .porject-details .col-md-4\").css(\"height\", \"auto\");\n\t\t}\t\n\t}", "title": "" }, { "docid": "d653352d7900e72d6f5c163912239e74", "score": "0.6061227", "text": "function getDimsA(){\n if(params.display != '2up') {\n var aHeight = params.a == 'pitch' ? [width- (navWidth), height - 230] :\n [height - 180,width - (navWidth*2)];\n } else {\n var aHeight = [width-(navWidth), height - (height/2) - 230];\n }\n // console.log('getDims() result:',aHeight)\n return aHeight;\n}", "title": "" }, { "docid": "3f79876d6314da41df2dcc9c06f63e9d", "score": "0.6050509", "text": "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebar-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\n var navbarheight = $('nav.navbar-default').height();\n var wrapperHeight = $('#page-wrapper').height();\n\n if (navbarheight > wrapperHeight) {\n $('#page-wrapper').css(\"min-height\", navbarheight + \"px\");\n }\n\n if (navbarheight < wrapperHeight) {\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n }\n\n if ($('body').hasClass('fixed-nav')) {\n if (navbarheight > wrapperHeight) {\n $('#page-wrapper').css(\"min-height\", navbarheight + \"px\");\n } else {\n $('#page-wrapper').css(\"min-height\", $(window).height() - 60 + \"px\");\n }\n }\n\n }", "title": "" }, { "docid": "a9d87c9511144f2626f3b023b430e97b", "score": "0.6044996", "text": "setHeight() {\n if (this.myContainer) {\n var r = this.myContainer.nativeElement.getBoundingClientRect();\n var e = document.documentElement;\n var h = e.clientHeight - r.top - window.pageYOffset - 10;\n var newHeight = h.toString() + \"px\";\n if (this.scrollView.height != newHeight)\n this.scrollView.height = newHeight;\n }\n }", "title": "" }, { "docid": "8a2e22e4acb14d7ce2047168dadd3afe", "score": "0.6041796", "text": "function getWindowHeight(){\n\treturn $(window).height();\n}", "title": "" }, { "docid": "47bae2fbf8cb3c45225627e53932560f", "score": "0.60320026", "text": "function updateDimensions() {\n theight = templateHeight();\n cheight = containerHeight();\n vpheight = viewPortHeight();\n }", "title": "" }, { "docid": "6f403050eb734086150cbb7e04fc00fc", "score": "0.6031302", "text": "static get height() {\r\n return document.documentElement.clientHeight;\r\n }", "title": "" }, { "docid": "ffbcb1cf08d86fab6c8f03d9b1a502d1", "score": "0.6022042", "text": "function pageHeight() {\n return win.innerHeight != null ? win.innerHeight : doc.documentElement && doc.documentElement.clientHeight != null ? doc.documentElement.clientHeight : doc.body != null ? doc.body.clientHeight : null;\n}", "title": "" }, { "docid": "4d733cbc13e20059053203b4f71e19d0", "score": "0.60203683", "text": "function getDimensions()\n\t\t\t\t{\n\t\t\t\tscope.viewportHeight = $window.innerHeight;\n\t\t\t\tscope.parentElementHeight = element[0].parentElement.getBoundingClientRect()['height'];\n\t\t\t\tscope.distY = scope.viewportHeight+scope.parentElementHeight;\n\t\t\t\tscope.prev_scroll_dist = 0;\n\t\t\t\t}", "title": "" }, { "docid": "88a03e2aed3253f2dd3b260524d9bf5a", "score": "0.60056686", "text": "function GetWindowHeight() { \n\n //return window.innerHeight||\n //document.documentElement&&document.documentElement.clientHeight||\n //document.body.clientHeight||0;\n \n var windowHeight = 0;\n if (typeof(window.innerHeight) == 'number') {\n windowHeight = window.innerHeight;\n }\n else {\n if (document.documentElement && document.documentElement.clientHeight) {\n windowHeight = document.documentElement.clientHeight;\n }\n else {\n if (document.body && document.body.clientHeight) {\n windowHeight = document.body.clientHeight;\n }\n }\n }\n \n return windowHeight; \n}", "title": "" }, { "docid": "88a03e2aed3253f2dd3b260524d9bf5a", "score": "0.60056686", "text": "function GetWindowHeight() { \n\n //return window.innerHeight||\n //document.documentElement&&document.documentElement.clientHeight||\n //document.body.clientHeight||0;\n \n var windowHeight = 0;\n if (typeof(window.innerHeight) == 'number') {\n windowHeight = window.innerHeight;\n }\n else {\n if (document.documentElement && document.documentElement.clientHeight) {\n windowHeight = document.documentElement.clientHeight;\n }\n else {\n if (document.body && document.body.clientHeight) {\n windowHeight = document.body.clientHeight;\n }\n }\n }\n \n return windowHeight; \n}", "title": "" }, { "docid": "76a027529f5e52cbb37d314ea1b2a9a3", "score": "0.6005224", "text": "setHeight() {\n this.$().outerHeight(this.$(window).height() - this.get('fixedHeight'));\n }", "title": "" }, { "docid": "50922e6c624be74315cbda9bb51eb4ac", "score": "0.60006124", "text": "function getView(){\n allHeight = window.innerHeight;\n document.getElementById('body').style.height = allHeight+\"px\";\n}", "title": "" }, { "docid": "e1d8995db96ad47a9a09be857ff16928", "score": "0.5996225", "text": "getHeight() {\n if (platform.inBrowser) {\n return window.innerHeight;\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "aad120435c06cf833c22a4f396103cbe", "score": "0.59936416", "text": "function chat_module_sidebar_height() {\n var body_height = jQuery('body').height();\n var main_header_height = jQuery('.main-header').outerHeight();\n var main_footer_height = jQuery('.gx-footer').outerHeight();\n\n var main_content_padding = parseInt(jQuery('.gx-main-content').css('padding-top'));\n\n var gxwrapper_margin = parseInt(jQuery('.gx-wrapper').css('margin-bottom'));\n\n var chat_module_margin = parseInt(jQuery('.chat-module').css('margin-top')) + parseInt(jQuery('.chat-module').css('margin-bottom'));\n\n var module_sideheader_height = jQuery('.chat-sidenav-header').outerHeight();\n\n var scrollbar_height = body_height - (main_header_height + main_content_padding + gxwrapper_margin + chat_module_margin + module_sideheader_height + main_footer_height);\n jQuery('.chat-sidenav-scroll').height(scrollbar_height);\n}", "title": "" }, { "docid": "3d9a0e12f220711b58e21e18ba457c33", "score": "0.5985946", "text": "function getHeight() {\n return document.documentElement.clientHeight;\n }", "title": "" }, { "docid": "b5624f8c11e9584e6834797f2637a516", "score": "0.5985537", "text": "_calculateHeight() {\n\t\tif (this.options.height) {\n\t\t\treturn this.jumper.evaluate(this.options.height, { '%': this.jumper.getAvailableHeight() });\n\t\t}\n\n\t\treturn this.naturalHeight() + (this.hasScrollBarX() ? 1 : 0);\n\t}", "title": "" }, { "docid": "51e02389d5a45a447a14254dca0a3485", "score": "0.5983234", "text": "function fixHeight() {\n var menuHeight = $('.navbar-container').outerHeight(true);\n var parentHeight = $('.col-1').height();\n var contentHeight = parentHeight - menuHeight;\n $('.content').css('height',contentHeight);\n }", "title": "" }, { "docid": "fed5df79888d80fbbd34452807adb3a3", "score": "0.5981808", "text": "function apex_visible_menu_height() {\n\t\t\t$('body').css('paddingTop', nav_h+'px');\n\t\t}", "title": "" }, { "docid": "0df7bb529d0e19abcea3172eb5bed869", "score": "0.597966", "text": "function doDivHeight() {\n\tvar divNavs = new Array('interiorNav', 'conditionNav', 'healthyNav', 'healthyHomeNav', 'lifeNav', 'echoNav', 'familyNav', 'accountingNav', 'RecruiterNav', 'CorporateNav');\n\n\t//var divNav = document.getElementById('interiorNav');\n\t//var divNav2 = document.getElementById('conditionNav');\n\n\tvar divTD = document.getElementById('rightMain').offsetHeight;\n\tfor (i = 0; i < divNavs.length; i++) {\n\t\tvar divNav = document.getElementById(divNavs[i]);\n\t\tif (divNav != null) {\n\t\t\tdivNav.style.height = divTD + \"px\";\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "e755c835a42b6d095c7c3addc0dd5e2c", "score": "0.5979432", "text": "getWindowHeight () {\n\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\n\n }", "title": "" }, { "docid": "5fb6337bd5f37f84aa20440aad249206", "score": "0.59771305", "text": "function screenHeight() {\r\n var height = window.innerHeight;\r\n\r\n return height;\r\n}", "title": "" }, { "docid": "79964aa1876d7ca40d72d54a323d77cf", "score": "0.59633815", "text": "function getHeight() {\n\t\tdata.height = window.innerHeight;\n\n\t}", "title": "" }, { "docid": "876f750f68006afbf4c5b0309c6c02c4", "score": "0.5957753", "text": "function onloadmargin(){\r\n var topheight = admin_bar_height = header_height = 0;\r\n if( $('.navbar').hasClass('hcode-nav-margin') ){\r\n var header_height = $('.navbar').outerHeight();\r\n }\r\n if( $( '.top-header-area' ).length > 0 ){\r\n topheight = $('.top-header-area').outerHeight();\r\n }\r\n if( $('#wpadminbar').length > 0 && $('.navbar, .pull-menu-button').length < 1 ){\r\n var admin_bar_height = $('#wpadminbar').outerHeight();\r\n }\r\n if( header_height || topheight ){\r\n var margin_on_first_load = header_height + topheight + admin_bar_height;\r\n $( 'section:first' ).attr('data-nav-default-height', margin_on_first_load);\r\n }\r\n }", "title": "" }, { "docid": "44fdfd517cb5957cffdce56c1eef3048", "score": "0.59540915", "text": "function getHeight()\n{\n var y = 0;\n if (self.innerHeight){\n y = self.innerHeight;\n } else if (document.documentElement && document.documentElement.clientHeight){\n y = document.documentElement.clientHeight;\n } else if (document.body){\n y = document.body.clientHeight;\n }\n return y;\n}", "title": "" }, { "docid": "1355a687833870aea2ecf4181ab98db1", "score": "0.59520966", "text": "function pageHeight() {\n\treturn window.innerHeight != null ? window.innerHeight\n\t\t\t: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight\n\t\t\t\t\t: document.body != null ? document.body.clientHeight : null;\n}", "title": "" }, { "docid": "dee0ff0540d766dac73568dc8b078173", "score": "0.59417415", "text": "function resizelayout(){var h=$(window).height();$('.scroller').each(function(){var el=$(this);var m=el.attrd('margin');if(m)m=+m;else m=0;el.css('height',h-(el.offset().top+m))})}", "title": "" }, { "docid": "9744ffb5584a8ae18f9f4c1a370168d3", "score": "0.59321856", "text": "function getSizes() {\r\n windowWidth = $(window).width();\r\n windowHeight = $(window).height();\r\n appContainerWidth_Ls = (windowWidth > 1600) ? 960 : 960;\r\n appContainerHeight_Ls = (windowWidth > 1600) ? 500 : 500;\r\n appContainerWidth_Fs = (windowWidth > 1600) ? 1500 : windowWidth - 40;\r\n\tappContainerHeight_Fs = (windowWidth > 1600) ? windowHeight - 150 : windowHeight - 80;\r\n\tappContainer_marginTop_Ls = Math.round((windowHeight - appContainerHeight_Ls)/2); \r\n\tappContainer_marginTop_Fs = (windowWidth > 1600) ? 100 : 60;\r\n\tsearchboxWidth = $('#searchbox').width();\r\n\tappContentWidth = (appContainerWidth_Fs - searchboxWidth) - 20;\r\n\tappContentHeight = appContainerHeight_Fs -2; \r\n}", "title": "" }, { "docid": "ffd1b5a8e9bc5377b3ede408549383c4", "score": "0.59315133", "text": "function getScrollYHeightOffset() {\n var height = $(\"#top-nav-container\").outerHeight(true) +\n $(\"#sub-nav-container\").outerHeight(true) +\n $(\"#users_wrapper > .row\").outerHeight(true) +\n $(\".dataTables_scrollHead\").outerHeight(true) +\n $(\".dataTables_scrollFoot\").outerHeight(true) +\n $(\".dataTables_paginate\").outerHeight(true) +\n 1; // bInfo .row div\n return height;\n}", "title": "" }, { "docid": "5a8348ce48bc17394b85b55857549470", "score": "0.59273905", "text": "function getBodyHeight() {\n\n // Initialize height to zero\n var height = 0;\n\n // Initialize scrollHeight to zero\n var scrollHeight = 0;\n\n // Initialize offsetHeight to zero\n var offsetHeight = 0;\n\n // Initialize maxHeight to zero\n var maxHeight;\n\n // If document.height has some value then ...\n if (document.height) {\n\n // Set height to document.height\n height = document.height;\n\n } // If document.body has some value then ...\n else if (document.body) {\n\n // If document.body.scrollHeight has some value then ...\n if (document.body.scrollHeight) {\n\n // Set height & scrollHeight to document.body.scrollHeight\n height = scrollHeight = document.body.scrollHeight;\n }\n\n // If document.body.offsetHeight has some value then ...\n if (document.body.offsetHeight) {\n\n // Set height & offsetHeight to document.body.offsetHeight\n height = offsetHeight = document.body.offsetHeight;\n }\n\n\n // If scrollHeight & offsetHeight \n // both have some value then ...\n if (scrollHeight && offsetHeight) {\n\n // Set height & maxHeight to maximum value\n // among scrollHeight & offsetHeight\n height = maxHeight = Math.max(scrollHeight, offsetHeight);\n\n }\n }\n\n // If browser is Microsoft Internet Explorer then ...\n if (navigator.appName == \"Microsoft Internet Explorer\") {\n return height;\n } // If browser is NOT Microsoft Internet Explorer then ...\n else {\n\n // width to be returned is the available height\n // multiplied by\n // ratio of device-logical YDPIs\n return (window.screen.availHeight) * (screen.deviceYDPI / screen.logicalYDPI); ;\n\n }\n\n}", "title": "" }, { "docid": "9f4725b386a3f6f6f149d99a40b99b5a", "score": "0.59248936", "text": "function GetHeight()\n{\n var y = 0;\n if (self.innerHeight)\n {\n y = self.innerHeight;\n }\n else if (document.documentElement && document.documentElement.clientHeight)\n {\n y = document.documentElement.clientHeight;\n }\n else if (document.body)\n {\n y = document.body.clientHeight;\n }\n return y;\n}", "title": "" }, { "docid": "2d3efbe7413a007ae078dd79a0938dee", "score": "0.59190184", "text": "function getPageHeight() {\nvar windowHeight\n if (self.innerHeight) {\t// all except Explorer\n windowHeight = self.innerHeight;\n } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode\n windowHeight = document.documentElement.clientHeight;\n } else if (document.content) { // other Explorers\n windowHeight = document.content.clientHeight;\n }\n return windowHeight\n}", "title": "" }, { "docid": "8ca92477c12ec8cee8304fe7b9a3adc0", "score": "0.5907937", "text": "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\n var navbarHeigh = $('nav.navbar-default').height();\n var wrapperHeigh = $('#page-wrapper').height();\n\n if (navbarHeigh > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\n }\n\n if (navbarHeigh < wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n }\n\n if ($('body').hasClass('fixed-nav')) {\n if (navbarHeigh > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeigh - 60 + \"px\");\n } else {\n $('#page-wrapper').css(\"min-height\", $(window).height() - 60 + \"px\");\n }\n }\n\n}", "title": "" }, { "docid": "34ba7ec9bf2b044964b7434f27ccad81", "score": "0.59045", "text": "function setSizes() {\n var containerHeight = $(\".landing-cont\").height();\n $(\".landing-cont\").height(containerHeight - 200);\n}", "title": "" }, { "docid": "58501ce1cb9f9e360408e35c7781e898", "score": "0.5902262", "text": "function getPageHeight() {\n var windowHeight\n if (self.innerHeight) { // all except Explorer\n windowHeight = self.innerHeight;\n } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode\n windowHeight = document.documentElement.clientHeight;\n } else if (document.body) { // other Explorers\n windowHeight = document.body.clientHeight;\n } \n return windowHeight;\n }", "title": "" }, { "docid": "2bb1bb9a98ca5745f6f50bfa0b645f3b", "score": "0.5900716", "text": "function setMapHeight() {\n /* Set the map div to the height of the browser window minus the header. */\n var viewportHeight = $(window).height();\n var warningBannerHeight = $('#warning-banner').outerHeight();\n var headerHeight = $('#header').outerHeight();\n var mapHeaderHeight = $('#map-header').outerHeight();\n var combinedHeadersHeight = warningBannerHeight + headerHeight + mapHeaderHeight;\n var mapHeight = viewportHeight - combinedHeadersHeight;\n $('#map-aside').css('height', mapHeight);\n $('#map-container').css('height', mapHeight);\n if (showDataContainer) {\n $('.map-container').css({'height': (mapHeight * .5) + combinedHeadersHeight, 'overflow': 'hidden'});\n $('#map').css('height', mapHeight * .5);\n $('#map-aside').css('height', mapHeight * .5);\n $('#data-container').css('height', (mapHeight * .5) - 5);\n $('body').addClass('show-data');\n } else {\n $('#map-aside').css('height', mapHeight);\n $('.map-container').css('height', 'auto');\n $('#map').css('height', mapHeight);\n $('body').removeClass('show-data');\n }\n }", "title": "" }, { "docid": "bfee8591950c7045591856b81cee3d66", "score": "0.5900385", "text": "function get_max_grid_dimensions() {\n // height is page height minus navbar\n var height = document.documentElement.clientHeight - navbar.scrollHeight;\n\n // width is full page width\n var width = document.documentElement.clientWidth;\n return [height, width];\n}", "title": "" }, { "docid": "e4d5023d8914ad3b50690246538ddefc", "score": "0.5898399", "text": "function windowH() {\n\t\t\t\t \tvar result; \n\t\t\t\t \tif (getObject.container == window) {\n\t\t\t\t \t\tresult = ((getObject.container.height()>=parseInt($('body').css('minHeight')))?getObject.container.height():parseInt($('body').css('minHeight')));\n\t\t\t\t \t} else {\n\t\t\t\t \t\t\tresult = getObject.container.height();\n\t\t\t\t \t}\n\t\t\t\t \treturn result;\n\t\t\t\t }", "title": "" }, { "docid": "7d5a133136e1439448fae801a2ac1a1c", "score": "0.5896756", "text": "function height1(){\n var h = $( window ).outerHeight(true); // Taille de la fenetre\n $('.titre').css('height', (h*0.18)+'px');\n $('.zone1').css('height', (h*0.41)+'px');\n $('.zone2').css('height', (h*0.41)+'px');\n }", "title": "" } ]
a0614d83621001b22a9435a02f1b6b0a
Function display user data, when user click on sectionlist items
[ { "docid": "332a90c7c617061d2276a9b3c3c0d8f0", "score": "0.0", "text": "euroNdDollarConvert(devise) {\n if (devise == \"EUR\") return \"€\";\n else if (devise == \"GBP\") return \"£\";\n else if (devise == \"USD\") return \"$\";\n else return devise;\n }", "title": "" } ]
[ { "docid": "ff4df2c2bfb163ef6dffeb8521b5c8b1", "score": "0.66752315", "text": "function user_click_handler(e){\n\n let users = Model.get_users();\n\n let id = this.dataset.id;\n let user = Model.get_user(id);\n\n // views.trial(\"user-detail\", user);\n views.listUsersView(\"user-detail\", user);\n console.log(\"showed the unit\");\n // console.log(Model.get_user());\n\n}", "title": "" }, { "docid": "a48f5498307f0e63a4426136115fb387", "score": "0.6581021", "text": "function listUserClicked(evt, userData) {\n let listEl = evt.target;\n removeActiveClass(listEl.parentElement)\n listEl.classList.add('active')\n document.getElementById(\"view-data\").click();\n setFormData(userData)\n}", "title": "" }, { "docid": "72c3b59ac59bfe363057827c84a6783b", "score": "0.6559699", "text": "function showUserInfo(event){\n event.preventDefault();\n var thisUserName = $(this).attr('rel');\n var arrayPosition = userListData.map(function(arrayItem){return arrayItem.name}).indexOf(thisUserName);\n var thisUserObject = userListData[arrayPosition];\n\n $('#userInfoName').text(thisUserObject.name);\n}", "title": "" }, { "docid": "02d5217e9061297154928ee5f7a0ffc6", "score": "0.64356124", "text": "onSectionShow() {\n }", "title": "" }, { "docid": "20bbb24881f21001a68c8001eae3dded", "score": "0.62919396", "text": "function displaySection(section) {\n\t\talert(\"Section \"+section+\" clicked!\");\n\t}", "title": "" }, { "docid": "837c8f1c9a6bc07bf2e131a9f2b9e35e", "score": "0.624982", "text": "function showList(e) {\n\t// if (typeof e.index !== 'undefined' && e.index !== null) {\n\t\t// whereIndex = e.index; // TabbedBar\n\t// } else {\n\t\t// whereIndex = INDEXES[e.source.title]; // Android menu\n\t// }\n\treimburses && reimburses.fetch(e.param ? e.param : {remove:false});\n\t//reimburseDetails && reimburseDetails.fetch({remove: false});\n\t//comments && comments.fetch({remove: false});\n}", "title": "" }, { "docid": "f039d0725cf03970afc93da5ca606de8", "score": "0.6224323", "text": "_renderUsers() {\n for (let userId in this.state) {\n const name = this.state[userId].name ? this.state[userId].name : \"No name\";\n const section = $(\"<section>\", { \"class\": \"user-section\" });\n this.state[userId].list = _albumList(userId);\n section.append(_userHeader(name))\n .append(_legend())\n .append(this.state[userId].list);\n\n this.container.append(section);\n }\n }", "title": "" }, { "docid": "82533fbc57f965ab0e4aea97fdb43412", "score": "0.6190806", "text": "function doEventDisplayPageDetails() {\r\n //default variables\r\n var options = [];\r\n var eventId = getEventId();\r\n var userId = getLoginUserId();\r\n\r\n //Display Joined user lists (MGJoinEventDisplay)\r\n options = [eventId];\r\n\r\n function callbackJoinList(tx, results) {\r\n var htmlcode = \"\";\r\n for (var i = 0; i < results.rows.length; i++) {\r\n var row = results.rows[i];\r\n var nickName = \"Nick Name: \" + row['nickName'];\r\n var jdate = \"Join: \" + getFormatDate(row['joinedDate']);\r\n var title = nickName + \"\\n\" + jdate;\r\n htmlcode += \"<li><a data-role='button' title='\" + title + \"' data-transition='' data-row-id='\" + row['id'] + \"' >\" +\r\n \"<p>\" + nickName + \"</p>\" +\r\n \"<p>\" + jdate + \"</p>\" +\r\n \"</a></li>\";\r\n }\r\n\r\n var lv = $(\"#MGJoinEventDisplay\").html(htmlcode);\r\n lv.listview(\"refresh\", true);\r\n }\r\n\r\n JoinEventDB.selectJoinList(options, callbackJoinList);\r\n\r\n //Display Item List (MGEventItemDisplay)\r\n options = [eventId];\r\n\r\n function callbackEventItemList(tx, results) {\r\n var htmlcode = \"\";\r\n for (var i = 0; i < results.rows.length; i++) {\r\n var row = results.rows[i];\r\n var itemName = \"Item Name: \" + row['itemName'];\r\n var quantity = \"Quantity: \" + row['quantity'];\r\n var price = \"Price: \" + row['price'];\r\n var sdate = getFormatDate(row['startDate']) + \"~\" + getFormatDate(row['endDate']);\r\n var title = itemName + \"\\n\" + quantity + \"\\n\" + price + \"\\n\" + sdate;\r\n\r\n htmlcode += \"<li><a data-role='button' title = '\" + title + \"' data-transition='' data-row-id='\" + row['id'] + \",\" + row['price'] + \"' >\" +\r\n \"<p>\" + itemName + \"</p>\" +\r\n \"<p>\" + quantity + \"</p>\" +\r\n \"<p>\" + price + \"</p>\" +\r\n \"<p>\" + sdate + \"</p>\" +\r\n \"</a></li>\";\r\n }\r\n var lv = $(\"#MGEventItemDisplay\").html(htmlcode);\r\n lv.listview(\"refresh\", true);\r\n\r\n //row click event for saving item to event\r\n $(\"#MGEventItemDisplay a\").on(\"click\", clickHandlerEventItemDisplay);\r\n\r\n function clickHandlerEventItemDisplay() {\r\n if (confirm(\"Do you want to get this item?\")) {\r\n var rowId = $(this).attr(\"data-row-id\");\r\n var data = rowId.split(\",\");\r\n localStorage.setItem(\"itemId\", data[0]);\r\n localStorage.setItem(\"price\", data[1]);\r\n\r\n //first, check if the item is registered on event table\r\n var userId = getLoginUserId();\r\n var evntId = getEventId();\r\n var itemId = getItemId();\r\n var opts = [userId, evntId, itemId];\r\n\r\n function callbackExists(tx, results) {\r\n if (results.rows.length > 0) {\r\n alert(\"Item is already exists on Event table\");\r\n }\r\n else {\r\n //save item to event\r\n var eId = getEventId();\r\n var itmId = getItemId();\r\n var userId = getLoginUserId();\r\n var price = localStorage.getItem(\"price\");\r\n var options = [userId, eId, itmId, price, 1, new Date()];\r\n\r\n function callbackInsert() {\r\n alert(\"Item is attached on Event now!\");\r\n }\r\n\r\n UserEventItemDB.insert(options, callbackInsert);\r\n }\r\n }\r\n\r\n UserEventItemDB.existsUserEventItem(opts, callbackExists);\r\n }\r\n }\r\n }\r\n\r\n EventItemDB.selectEventItemList(options, callbackEventItemList);\r\n\r\n //Display My Items (MGGetEventItemDisplay) selectGetEventItemList\r\n options = [eventId, userId];\r\n\r\n function callbackUserEventItem(tx, results) {\r\n var htmlcode = \"\";\r\n for (var i = 0; i < results.rows.length; i++) {\r\n var row = results.rows[i];\r\n var itemName = \"Item Name: \" + row['itemName'];\r\n var quantity = \"Quantity: \" + row['quantity'];\r\n var price = \"Quantity: \" + row['price'];\r\n var sdate = \"Get: \" + getFormatDate(row['getDate']);\r\n var title = itemName + \"\\n\" + quantity + \"\\n\" + sdate;\r\n\r\n htmlcode += \"<li><a data-role='button' title = '\" + title + \"' data-transition='' data-row-id='\" + row['id'] + \"' >\" +\r\n \"<p>\" + itemName + \"</p>\" +\r\n \"<p>\" + quantity + \" \" + price + \"</p>\" +\r\n \"<p>\" + sdate + \"</p>\" +\r\n \"</a></li>\";\r\n }\r\n\r\n var lv = $(\"#MGUserEventItemDisplay\").html(htmlcode);\r\n lv.listview(\"refresh\", true);\r\n }\r\n\r\n UserEventItemDB.selectUserEventItemList(options, callbackUserEventItem);\r\n}", "title": "" }, { "docid": "02143572ddeb9dbeea39ba805bafed62", "score": "0.6076354", "text": "function showCustomerInfo(event) {\n\n\n\n // Prevent Link from Firing\n event.preventDefault();\n\n // Retrieve customername from link rel attribute\n var thisCustomerName = $(this).attr('rel');\n\n // Get Index of object based on id value BUG arrayPosition = -1\n var arrayPosition = customerListData.map(function(arrayItem) {return arrayItem.id; }).indexOf(thisCustomerName);\n // Get our User Object\n var thisCustomerObject = customerListData[arrayPosition+1];\n\n\n $('#customerInfoName').text('->'+thisCustomerObject.name+'---->'+customerListData);\n $('#customerID').text('->'+thisCustomerObject.id);\n $('#customerInfoLink').text('->'+thisCustomerObject.link);\n\n}", "title": "" }, { "docid": "a9fd2aa9d1daf364d089517f8650c114", "score": "0.6036226", "text": "function doShowItemPage() {\r\n //check admin user\r\n var loginemail = getUserEmail();\r\n\r\n var options = [loginemail];\r\n\r\n function callback(tx, result) {\r\n if (result.rows.length > 0) {\r\n var row = result.rows[0];\r\n\r\n if (row['userTypeId'] == '3') {\r\n //disabled add Item group button\r\n $(\"#MGItemAddBtnGroup\").show();\r\n\r\n //display all Item\r\n var opts = [];\r\n\r\n function callbackAll(tx, results) {\r\n var htmlcode = \"\";\r\n for (var i = 0; i < results.rows.length; i++) {\r\n var irow = results.rows[i];\r\n //make html code for list view\r\n htmlcode += \"<li><a data-role='button' data-row-id='\" + irow['id'] + \"' href='#'>\" +\r\n \"<div>Item Name: \" + irow['name'] + \" (\" + irow['id'] +\r\n \") Date: \" + irow['startDate'] + \" ~ \" + irow['endDate'] +\r\n \"</div>\" +\r\n \"<p>Category: \" + getCategoryName(irow['categoryId']) + \" \" +\r\n \" location: \" + irow['location'] + \" \" +\r\n \" Quantity: \" + irow['quantity'] + \"</p>\" +\r\n \"</a></li>\";\r\n\r\n }\r\n\r\n var lv = $(\"#MGItemList\").html(htmlcode);\r\n lv.listview(\"refresh\");\r\n\r\n $(\"#MGItemList a\").on(\"click\", clickHandler);\r\n\r\n function clickHandler() {\r\n localStorage.setItem(\"itemId\", $(this).attr(\"data-row-id\"));\r\n $.mobile.changePage(\"#MGItemEditPage\", {transition: 'none'});\r\n }\r\n }\r\n\r\n ItemDB.selectAll(opts, callbackAll);\r\n }\r\n else {\r\n //disabled add Item group button\r\n $(\"#MGItemAddBtnGroup\").hide();\r\n\r\n //display user Item\r\n var opts = [row['id']];\r\n\r\n function callbackAll(tx, results) {\r\n var htmlcode = \"\";\r\n for (var i = 0; i < results.rows.length; i++) {\r\n var irow = results.rows[i];\r\n\r\n //make html code for list view\r\n htmlcode += \"<li><a data-role='button' data-row-id='\" + irow['id'] + \"' href='#'>\" +\r\n \"<div>Item Name: \" + irow['name'] + \" (\" + irow['id'] +\r\n \") Date: \" + irow['startDate'] + \" ~ \" + irow['endDate'] +\r\n \"</div>\" +\r\n \"<p>Category: \" + getCategoryName(irow['categoryId']) + \" \" +\r\n \" location: \" + irow['location'] + \" \" +\r\n \" Quantity: \" + irow['quantity'] + \"</p>\" +\r\n \"</a></li>\";\r\n\r\n }\r\n\r\n var lv = $(\"#MGItemList\").html(htmlcode);\r\n lv.listview(\"refresh\");\r\n\r\n $(\"#MGItemList a\").on(\"click\", clickHandler);\r\n\r\n function clickHandler() {\r\n localStorage.setItem(\"itemId\", $(this).attr(\"data-row-id\"));\r\n $.mobile.changePage(\"#MGItemEditPage\", {transition: 'none'});\r\n }\r\n }\r\n\r\n ItemDB.selectByUserId(opts, callbackAll);\r\n\r\n }\r\n }\r\n }\r\n\r\n UserDB.selectByEmail(options, callback);\r\n\r\n}", "title": "" }, { "docid": "d51bcdee3acb7eeb7a2d9d5aed023499", "score": "0.59744334", "text": "function displayPersonList() {\n\tdebug(\"displayPersonList: \");\n\t$(\"#main\").empty().append(\"Choose your name to request WFH\");\n\tloadData(\"personList\",writePersonListCallback);\n}", "title": "" }, { "docid": "22044dbca352bbd544392500dcf09891", "score": "0.5974152", "text": "function display_info_user(user,state) {\n let ul = document.getElementById('mytodo-list');\n state.get_user_todos(user).map(function(task){\n createListHTML(task,ul);\n });\n}", "title": "" }, { "docid": "a60e78e32100dae825f69a80641fe694", "score": "0.59724855", "text": "function doShowEventItemListOnEventEditPage() {\r\n //display free items for event\r\n showFreeItemList();\r\n\r\n //display joined items for event\r\n showJoinedItemList();\r\n\r\n}", "title": "" }, { "docid": "b7a87f1db916ff4b9e4c78eb9e3abb88", "score": "0.5955645", "text": "function displayHousehold(name, householdID, rowID) {\n /* Creating the item space */\n var item = document.createElement('li');\n\n var chevron = document.createElement('img');\n chevron.setAttribute(\n 'src',\n odkCommon.getFileAsUrl('config/assets/img/little_arrow.png'));\n chevron.setAttribute('class', 'chevron');\n item.appendChild(chevron);\n\n\n item.setAttribute('class', 'item_space');\n item.setAttribute(\n 'onClick',\n 'handleClick(\"' + rowID + '\")');\n item.innerHTML = name + \"'s Household\";\n\n // create sub-list in item space to display members\n if (householdToPersonMap.hasOwnProperty(householdID)) {\n var members = householdToPersonMap[householdID];\n\n for (var i = 0; i < members.length; i++) {\n var member = members[i];\n var name = convertName(member.firstName, member.otherName, member.surname);\n\n var membersElement = document.createElement('li');\n membersElement.setAttribute('class', 'detail');\n membersElement.innerHTML = '*' + name + ' - ' + member.age + ' (' + member.gender + ')';\n item.appendChild(membersElement);\n }\n }\n\n document.getElementById('list').appendChild(item);\n}", "title": "" }, { "docid": "37b75c16063e8f077de6c87e75cce51f", "score": "0.5947439", "text": "function OnSuccess() {\n var enumerator = listItemCollection.getEnumerator();\n // iterating data from listItemCollection\n while (enumerator.moveNext()) {\n var results = enumerator.get_current();\n // data can be utilized here.. \n console.log(results.get_item(\"ID\") + ' -- ' + results.get_item(\"Title\"));\n }\n }", "title": "" }, { "docid": "648f3c7e3a8dea5adb6e5a3f44e6a640", "score": "0.59424704", "text": "function displayInterestedCourses(){\n\n}", "title": "" }, { "docid": "617fea623bbf1e88a0f44f37a95aadee", "score": "0.5936544", "text": "function display() {\n $(\"#list\").html(\"\");\n entries.forEach(function(entry, index) {\n $(\"#list\").append(\n \"<li><a href='#' data-id='\" +\n index +\n \"'>\" +\n entry.firstName +\n \" \" +\n entry.lastName.toUpperCase() +\n \"</a></li>\"\n ); \n });\n }", "title": "" }, { "docid": "4f5fdd57a28f9a2ccc79b2f9861fadce", "score": "0.5868778", "text": "function displayFacilities( results ) {\n\n var output = [];\n\n // display a message if there are no search results\n\n if ( !results.length ) {\n\n loading(\"hide\");\n showPopup(\"No locations found for the given search criteria.\");\n return;\n }\n\n // sort the results by division and facility name\n\n results.sort(function( a, b ) {\n\n if ( (b.division + a.title) < (a.division + b.title) ) {\n return - 1;\n } \n else {\n return ( (b.division + a.title) > (a.division + b.title) ) ? 1 : 0;\n }\n });\n\n // insert a list item for each facility in the results\n if (usingScreenReader) {\n $.each( results, function( i, facility ) {\n output.push(\"<li division='\" + facility.division + \"' style=padding:0;border:0 data-inset=false>\");\n output.push( facility.data );\n output.push(\"</li>\");\n });\n } else {\n $.each( results, function( i, facility ) {\n output.push(\"<li division='\" + facility.division + \"' style=padding:0;border:0 data-role=collapsible data-inset=false data-collapsed-icon=arrow-r data-expanded-icon=arrow-d>\");\n output.push(\"<h6 style=margin:0>\" + facility.title + \"</h6>\");\n output.push( facility.data );\n output.push(\"</li>\");\n });\n }\n \n \n\n // append the list items to the unordered list\n\n $(\"#facility-results\").append( output.join(\"\") ).trigger(\"create\");\n\n loading(\"hide\");\n \n $.mobile.changePage( $(\"#facility-details\") );\n\n // insert the list dividers by division\n \n \n $(\"#facility-results\").listview(\n {\n autodividers: true,\n autodividersSelector: function ( li ) {\n\n return li.attr(\"division\");\n }\n }\n ).listview(\"refresh\");\n}", "title": "" }, { "docid": "3921a7a43671fd2b7a0e6e26252fc0cf", "score": "0.58481675", "text": "function _showDetails( user ){\n\n konter.requireTmpl( '/users/tmpls/details.html', function(){\n $('#content-wrapper').html( '<div class=\"user-details user-details-container default-content\" data-bind=\"template: { name: \\'user-details-tmpl\\' }\"></div>' );\n ko.applyBindings( user, $(\"#content-wrapper .user-details\").get(0) );\n $('#select-user-groups').kendoMultiSelect({ change: setUserGroups }).data('kendoMultiSelect');\n $('#select-user-roles').kendoMultiSelect({ change: setUserRoles }).data(\"kendoMultiSelect\");\n });\n\n }", "title": "" }, { "docid": "cb6de7f5faef5436c5fff55f453bbcb7", "score": "0.5799823", "text": "function displayClientInfo(param, name) {\n // Determines selected client\n var clientId = name || $(param)[0].textContent;\n for (var i = 0; i < clients.length; i++) {\n if (clients[i].name === clientId) {\n client = clients[i];\n }\n }\n // Header info\n var clientInfoHtml = '<p class=\"customer-info\"> <strong>' + client.name + '</strong> <br>' + client.phone + '<br>';\n // Edit button\n clientInfoHtml += '<a href=\"#editClient\" class=\"ui-btn\" onclick=\"setupEditedClient(this)\">Manage</a></p>';\n var clientListHtml = \"\";\n\n clientListHtml += '<ul class=\"group-list\" data-role=\"listview\">';\n clientListHtml += '<li data-role=\"list-divider\">Groups</li>';\n // Populates the groups of a client\n for (var j = 0; j < client.groups.length; j++) {\n clientListHtml += '<li onclick=\"displayGroupInfo(this)\"><a href=\"#navyrotc\">' + client.groups[j] + '</a></li>';\n }\n clientListHtml += '<li data-role=\"list-divider\">Orders</li>';\n // Populates the orders of a client\n for (var j = 0; j < client.orders.length; j++) {\n clientListHtml += '<li onclick=\"displayNotification()\"><a href=\"#sendNotification\">' + client.orders[j] + '</a></li>';\n }\n clientListHtml += '</ul>';\n\n $(\".customer-img\").attr(\"src\", \"pics/johnny-appleseed.jpg\");\n $(\".customer-info2\").html(clientInfoHtml);\n $('.group-list').replaceWith(clientListHtml);\n $(\".p-content\").enhanceWithin();\n}", "title": "" }, { "docid": "9eb7ba2381a5fd87cb59addf576e6694", "score": "0.578306", "text": "function renderBookInfo(book){\n\n const user = {\"id\":1, \"username\":\"pouros\"}\n\n const div = document.querySelector('#show-panel')\n div.className = 'body'\n const h2 = document.createElement('h2')\n \n h2.innerText = book.title\n \n const img = document.createElement('img') \n img.src = book.img_url \n \n const p = document.createElement('p')\n p.innerText = book.description\n \n \n const button = document.createElement('button')\n button.innerText = \"Read\"\n button.dataset.id = user.id\n \n userUl = document.createElement(\"ul\")\n userUl.dataset.ul = book.id\n \n book.users.forEach(function(reader){\n const li = document.createElement('li')\n li.innerText = reader.username\n userUl.append(li)\n \n })\n \n\n h2.append(img)\n div.append(h2,img,p,button, userUl)\n\n\n \n //keep passing the book to different function \n button.addEventListener('click', () => readBook(book))\n \n\n \n \n }", "title": "" }, { "docid": "c127c0f2338da65a89223e68e2b857ff", "score": "0.57634515", "text": "function listItemSelect() {\n // role list\n $(\"#concert_listgroup\").on(\"click\", \"a\", function (e) {\n e.preventDefault();\n\n var listCount = $(\"#concert_listgroup\").children().length;\n for (var i = 0; i < listCount; i++) {\n $(\"#concert_listgroup\").children(i).attr('class', 'list-group-item');\n }\n $(this).toggleClass('list-group-item list-group-item active');\n\n var index = $(this).attr('id').charAt($(this).attr('id').length - 1);\n \n proxy_name = gListConcerts[index].name;\n if (gListConcerts[index].enable_authentication == true) {\n $(\"#userlogin\").show();\n $(\"#continue\").hide();\n } else {\n $(\"#userlogin\").hide();\n $(\"#continue\").show();\n }\n });\n\n}", "title": "" }, { "docid": "3978f6907de0951ca6530b096bba2f7c", "score": "0.5759182", "text": "handleSectionShow() {\n this.onSectionShow()\n }", "title": "" }, { "docid": "e6c0256715bc5ed753b70be0b178d1ae", "score": "0.5754943", "text": "function showInView() {\n var index = $(this).parent().index();\n\n $(document).find('.contacts__name').text(showList[index].firstName + ' ' + showList[index].lastName);\n $(document).find('.contacts__descr').text(showList[index].description);\n $(document).find('.contacts__streetAddress').text(showList[index].adress.streetAddress);\n $(document).find('.contacts__city').text(showList[index].adress.city);\n $(document).find('.contacts__state').text(showList[index].adress.state);\n $(document).find('.contacts__zip').text(showList[index].adress.zip);\n}", "title": "" }, { "docid": "b92792c5d64b13007045cd25aebd831c", "score": "0.57540977", "text": "function showGrowerList(e) {;\n // alert(\"Grower Crop Year Value = \" + myCropYear);\n //read the selected movie's details from the query string\n viewModel.set(\"selectedUserId\", e.view.params.userId);\n initList();\n }", "title": "" }, { "docid": "67ee041b999412afcb66c7a4bf78fbe1", "score": "0.5747746", "text": "function showStudent (ul, student) {\n\n // function to show the student details on the page\n function displayStudent (student) {\n displayImg.src = student.img;\n displayName.innerHTML = student.name;\n displayEmail.innerHTML = student.email;\n displayJoinDate.innerHTML = student.joined;\n }\n\n const li = document.createElement('li');\n li.className = 'student-item cf';\n ul.appendChild(li);\n\n const divStudent = document.createElement('div');\n divStudent.className = 'student-details';\n li.appendChild(divStudent);\n\n const displayImg = document.createElement('img');\n displayImg.className = 'avatar';\n divStudent.appendChild(displayImg);\n\n const displayName = document.createElement('h3');\n divStudent.appendChild(displayName);\n\n const displayEmail = document.createElement('span');\n displayEmail.className = 'email';\n divStudent.appendChild(displayEmail);\n\n const divStudentJoined = document.createElement('div');\n divStudentJoined.className = 'joined-details';\n li.appendChild(divStudentJoined);\n\n const displayJoinDate = document.createElement('span');\n displayJoinDate.className = 'date';\n divStudentJoined.appendChild(displayJoinDate);\n\n displayStudent(student);\n}", "title": "" }, { "docid": "56cd737c0795e2661c74a095a17c8669", "score": "0.5742296", "text": "function showSection(event){\n // changes direction of arrow\n let arrow = event.target.firstElementChild;\n arrow.innerHTML = '&uarr;';\n // finds target id\n let target = event.target.id;\n let selector = target + 'Section';\n // finds matching section-content\n let selected = document.getElementById(selector);\n // displays content\n selected.style.display = 'block';\n // finds parent holding the event listener\n let parent = event.target.parentElement\n // removes current removeEventListener\n parent.removeEventListener('click', showSection);\n // adds event listener to hide section\n parent.addEventListener('click', hideSection);\n}", "title": "" }, { "docid": "d67c327433f7b2a929d47f61cb8a71d3", "score": "0.572611", "text": "setUserListView(userList, yourAccount, interlocutorHandler, handler) {\n if (userList !== null) {\n userList.forEach(user => {\n const newUser = document.createElement('li');\n newUser.className = 'item';\n newUser.id = user\n newUser.innerHTML = user;\n\n newUser.addEventListener('click', () => {\n interlocutorHandler(user);\n });\n\n if (user !== yourAccount) {\n this.userList.append(newUser);\n }\n handler ? handler(user) : null;\n });\n }\n }", "title": "" }, { "docid": "70d7b475039091139ff42f3970940b85", "score": "0.57158446", "text": "function showGroupsAndUsers() {\n //print with details about users\n printGroups(true);\n mainMenu();\n}", "title": "" }, { "docid": "2f3b8a7fb3946fe8c4b931d5c7160d41", "score": "0.57112354", "text": "function getContacts() {\n var contacts = JSON.parse(sessionStorage.getItem(\"contacts\"));\n console.log(contacts);\n $(\"#userList\").empty();\n $.each( contacts, function(i, user) {\n $(\"#userList\").append(\"<li><a onclick=\\\"getContactDetails(\"+user.uid+\")\\\" href=\\\"#\\\">\"+user.firstname +\" \"+user.lastname+\"</a></li>\");\n console.log(user);\n });\n $('#userList').listview('refresh');\n}", "title": "" }, { "docid": "985ce9394f167f175ac4cd32d05c5f4b", "score": "0.57053035", "text": "function itemClicked(event)\n{\n \n var list = document.getElementById(\"list\").object;\n var browser = document.getElementById('browser').object;\n var selectedObjects = list.selectedObjects();\n \n if (selectedObjects && (1 == selectedObjects.length)){\n // The Browser's goForward method is used to make the browser push down to a new level.\n // Going back to previous levels is handled automatically.\n browser.goForward(document.getElementById('detailLevel'), selectedObjects[0].valueForKey(\"name\"));\n } \n}", "title": "" }, { "docid": "5c5f1eca27bbe87513403bfca60d1288", "score": "0.57029355", "text": "function displayItems(val){\n // Display Values in Selection div\n}", "title": "" }, { "docid": "f9b243782f08aab655802cae86aeff47", "score": "0.56956685", "text": "function getUsersOnPage(){\n\t\t$.getJSON(\"js/usrs_on_page.json\", function(users_json) {\n\t\t\tvar output = \"<ul>\";\n\t\t\t\t\tfor (var i in users_json.users) {\n\t\t\t\t\t\toutput+=\"<li><i class='mdi-action-perm-identity'></i> \" + users_json.users[i].f_name + \" \" + users_json.users[i].s_name + \"</li>\";\n\t\t\t\t\t}\n\t\t\t\t\toutput+=\"</ul>\";\n\n\t\t\t\t\tdocument.getElementById(\"users-online-placeholder\").innerHTML=output;\n\t\t});\n\t} //end getUsersOnPage", "title": "" }, { "docid": "559ed1ad4e2911276672ef9b42e4b8a6", "score": "0.5690728", "text": "function triggerSection(w_sect){\n removeProfileEvents();\n switch (w_sect) {\n case 1:\n clearProfile( userData ); // clear the current profile to add a new one\n initProfileEvents( userData ); // init the profile bottons event to select the new one\n break;\n case 2:\n canvasGame.startCanvasGame(userData); // start the canvas game\n break;\n case 3:\n const resultNickname = document.querySelector('.result-nickname');\n const resultLevel = document.querySelector('.result-level');\n const resultScore = document.querySelector('.result-score');\n resultNickname.innerHTML = this.userData.getNickName();\n resultLevel.innerHTML = this.userData.getLevel();\n resultScore.innerHTML = this.userData.getScore();\n stepGameManager(3, userData, null); // End section and show the history list\n break;\n }\n }", "title": "" }, { "docid": "2a80f5c512770c6e972f914e6d0ff841", "score": "0.56902665", "text": "function displayCurrentCourses(){\n\n}", "title": "" }, { "docid": "abd851e024fdcb87cd4315e2c08a630c", "score": "0.5688071", "text": "function showUsers() {\n\n\tlet user = JSON.parse(localStorage.getItem('user'));\n\n\tlet route = `users/find/${user.event}`;\n\tlet method = 'GET';\n\tquickFetch(route, method)\n\t\t.then(res => res.json())\n\t\t.then(resj => {\n\t\t\tlet users = buildUsers(resj)\n\t\t\t$('.viewWrapper').replaceWith(users)\n\t\t});\n}", "title": "" }, { "docid": "d2cadf81d0f97fb7cbeb02df381607d0", "score": "0.5685009", "text": "function showPerson () {\n let item = reviews[currentItem];\n img.src = item.img;\n auth.textContent = item.name;\n job.textContent = item.job;\n info.textContent = item.text;\n }", "title": "" }, { "docid": "753cb29e6e7219aaccb3bcc6a125a449", "score": "0.56732726", "text": "function createList()\n{\n // clear prior data\n var divUserList = document.getElementById(\"divUserList\");\n while (divUserList.firstChild) { // remove any old data so don't get duplicates\n divUserList.removeChild(divUserList.firstChild);\n };\n\n var ul = document.createElement('ul'); \n console.log(userArray);\n userArray.forEach(function (element) { // use handy array forEach method\n var li = document.createElement('li');\n li.innerHTML = \"<a data-transition='pop' class='oneList' data-parm=\" + element.ID + \" href='#listPage'> Get Details </a> \" + element.ID + \": \" + \"UserName: \"+ element.Name + \" \" + \"Hours: \" + element.UserHours + \" \" + \"Wages: \" + element.UserWage;\n ul.appendChild(li);\n });\n divUserList.appendChild(ul)\n\n //set up an event for each new li item, if user clicks any, it writes >>that<< items data-parm into the hidden html \n var classname = document.getElementsByClassName(\"oneList\");\n Array.from(classname).forEach(function (element) {\n element.addEventListener('click', function(){\n var parm = this.getAttribute(\"data-parm\"); // passing in the record.Id\n //do something here with parameter on pickbet page\n document.getElementById(\"IDparmHere\").innerHTML = parm;\n document.location.href = \"index.html#listPage\";\n });\n });\n \n}", "title": "" }, { "docid": "aa5f8adc2a120c4bba251cd91d6747ed", "score": "0.5671898", "text": "function clickTitle(e){\n const showDiv = document.querySelector(\"#show-panel\")\n showDiv.innerHTML = \"\"\n fetch(`http://localhost:3000/books/${e.target.dataset.id}`)\n .then(function(response){\n return response.json();\n })\n .then(function(json){\n //description\n const bookTitles = e.target\n // bookTitles.style.width = \"1000px\"\n const bookDescription = document.createElement(\"div\")\n bookDescription.innerHTML = json.description\n showDiv.appendChild(bookDescription)\n\n\n\n //image\n const bookImage = document.createElement(\"img\")\n bookImage.src = json.img_url\n showDiv.appendChild(bookImage)\n json.users.forEach(function(user){\n const bookUsers = document.createElement(\"li\")\n bookUsers.innerHTML = user.username\n showDiv.appendChild(bookUsers)\n })\n })\n } //end of function clickTitle()", "title": "" }, { "docid": "2a58dfcb0c61d1dbc3121d98063e938b", "score": "0.5642827", "text": "function showData() {\n\t/*se limpian todos los datos*/\n\tvar contentInyect = $(\".showDataPap\");\n\tcontentInyect.html(\"\");\n\tif (listdata.length > 0) {\n\t\tlistdata.forEach(function(item_) {\n\t\t\tinyectWithEvent(contentInyect, item_);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "84c1d7a4e497efb16dfe1901202cb001", "score": "0.5642101", "text": "function ShowSection(section) {\n $(section + ' .description', context).show();\n $(section + ' .views-widget', context).show();\n $(CompTool + ' .view-empty').show();\n $(section + ' .views-widget').after($(SubmitWrapper));\n $(SubmitButton, context).show();\n\n if ( section !== MedicalActive) {\n $(MedicalActive + ' .description', context).hide();\n $(MedicalActive + ' .views-widget', context).hide();\n }\n if ( section !== MedicalPreretirees) {\n $(MedicalPreretirees + ' .description', context).hide();\n $(MedicalPreretirees + ' .views-widget', context).hide();\n }\n if ( section !== MedicalRetirees) {\n $(MedicalRetirees + ' .description', context).hide();\n $(MedicalRetirees + ' .views-widget', context).hide();\n }\n if ( section !== DentalActive) {\n $(DentalActive + ' .description', context).hide();\n $(DentalActive + ' .views-widget', context).hide();\n }\n if ( section !== DentalRetirees) {\n $(DentalRetirees + ' .description', context).hide();\n $(DentalRetirees + ' .views-widget', context).hide();\n }\n }", "title": "" }, { "docid": "796ab0fc438f49bd3ad9c254f088a210", "score": "0.56362736", "text": "function doShowEventPage() {\r\n //check admin user\r\n var loginemail = getUserEmail();\r\n\r\n var options = [loginemail];\r\n\r\n function callback(tx, result) {\r\n if (result.rows.length > 0) {\r\n var row = result.rows[0];\r\n\r\n //display all Event\r\n var opts = [];\r\n\r\n function callbackAll(tx, results) {\r\n var htmlcode = \"\";\r\n for (var i = 0; i < results.rows.length; i++) {\r\n var irow = results.rows[i];\r\n //make html code for list view\r\n htmlcode += \"<li><a href='#MGEventDisplayPage' data-role='button' data-row-id='\" + irow['id'] + \"' href='#'>\" +\r\n \"<div>Event Name: \" + irow['name'] + \" (\" + irow['id'] + \")</div>\" +\r\n \"<p>Event Date: \" + irow['startDate'] + \" ~ \" + irow['endDate'] + \" | \" +\r\n \"Processing: \" + irow['processing'] + \" | \" +\r\n \"Descritioon: \" + irow['description'] + \"</p>\" +\r\n \"</a></li>\";\r\n\r\n }\r\n\r\n var lv = $(\"#MGEventList\").html(htmlcode);\r\n lv.listview(\"refresh\");\r\n\r\n $(\"#MGEventList a\").on(\"click\", clickHandler);\r\n\r\n function clickHandler() {\r\n localStorage.setItem(\"eventId\", $(this).attr(\"data-row-id\"));\r\n $.mobile.changePage(\"#MGEventDisPlayPage\", {transition: 'none'});\r\n }\r\n }\r\n\r\n EventDB.selectAll(opts, callbackAll);\r\n\r\n if (row['userTypeId'] == '3') {\r\n //disabled add Event group button\r\n $(\"#MGEventAddBtnGroup\").show();\r\n }\r\n else {\r\n //disabled add Event group button\r\n $(\"#MGEventAddBtnGroup\").hide();\r\n }\r\n\r\n }\r\n }\r\n\r\n UserDB.selectByEmail(options, callback);\r\n\r\n}", "title": "" }, { "docid": "2a60035272eb75efeb79faff7df7be2e", "score": "0.5634419", "text": "function displayPerson(firstName, otherName, surname, age, gender, rowID) {\n /* Creating the item space */\n var item = document.createElement('li');\n item.setAttribute('class', 'item_space');\n item.setAttribute(\n 'onClick',\n 'handleClick(\"' + rowID + '\")');\n item.innerHTML = convertName(firstName, otherName, surname);\n\n document.getElementById('list').appendChild(item);\n\n var chevron = document.createElement('img');\n chevron.setAttribute(\n 'src',\n odkCommon.getFileAsUrl('config/assets/img/little_arrow.png'));\n chevron.setAttribute('class', 'chevron');\n item.appendChild(chevron);\n\n // create sub-list in item space\n // Age information\n var ageElement = document.createElement('li');\n ageElement.setAttribute('class', 'detail');\n ageElement.innerHTML = 'Age: ' + age;\n item.appendChild(ageElement);\n\n var genderElement = document.createElement('li');\n genderElement.setAttribute('class', 'detail');\n genderElement.innerHTML = 'Gender: ' + ((gender !== null && gender !== '') ?\n gender\n : 'N/A');\n item.appendChild(genderElement);\n}", "title": "" }, { "docid": "ac8b54f2702b09eb2442afcc0f2ff828", "score": "0.5626884", "text": "function populateSavedQueryListSection(){\n}", "title": "" }, { "docid": "0ef16f303dcd8eefe8b86fb6f8c74209", "score": "0.56221944", "text": "function showPage (list, page) {\n\tlet startIndex = (page * pageItems) - pageItems;\n\tlet endIndex = page * pageItems;\n\tstudentsList.innerHTML = \"\";\n\t\tfor (let i = 0; i < list.length; i++) {\n\t\t\tif (i >= startIndex && i < endIndex) {\n\t\t\t\tlet listI = list[i];\t\n\t\t\tlet studentInfo =\t\t\n\t\t\t\t\t`<li class=\"student-item cf\">\n\t\t\t\t\t\t\t<div class=\"student-details\">\n\t\t\t\t\t\t\t\t <img class=\"avatar\" src=\"${listI.picture.large}\" alt=\"Profile Picture\">\n\t\t\t\t\t\t\t\t <h3>${listI.name.first} ${listI.name.last}</h3>\n\t\t\t\t\t\t\t\t <span class=\"email\">${listI.email}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"joined-details\">\n\t\t\t\t\t\t\t<span class=\"date\">Joined ${listI.registered.date}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t </li>`;\n\t\t\t\n\t\t\tstudentsList.insertAdjacentHTML(\"beforeend\", studentInfo);\n\t\t\t}\n\t\t}\n}", "title": "" }, { "docid": "39cc487cf7c65bef3d745d1dfff6e50e", "score": "0.56208086", "text": "optionSelectedListener(profile){\n var self = this;\n closeAllLists();\n document.getElementById(\"global-search-id\").value = profile[\"Name\"];//\n \n self.creator.profile_page.loadPoliticianInfo(profile);\n self.creator.toggleActivePage(\"news\");\n }", "title": "" }, { "docid": "192ae95880cc14a9d3367d6efab93760", "score": "0.561939", "text": "function handleSectionsListClick(hook, event) {\n const sectionButton = event.target.closest(\n `[data-element=\"sections-list-item\"]`\n );\n if (sectionButton) {\n const sectionId = sectionButton.getAttribute(\"data-section-id\");\n const section = getSectionById(sectionId);\n section.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n }\n}", "title": "" }, { "docid": "e1e2e063669c66c9531acada1780f479", "score": "0.56161207", "text": "function doShowDisplayEvent() {\r\n //get current Event id\r\n var eventId = getEventId();\r\n var options = [eventId];\r\n\r\n function callback(tx, results) {\r\n if (results.rows.length > 0) {\r\n var row = results.rows[0];\r\n var htmlcode = \"\";\r\n //make html code for list view\r\n htmlcode += \"<li><a href='#MGEventEditPage' data-role='button' data-row-id='\" + row['id'] + \"' href='#'>\" +\r\n \"<div>Event Name: \" + row['name'] + \" (\" + row['id'] + \")</div>\" +\r\n \"<p>Event Date: \" + row['startDate'] + \" ~ \" + row['endDate'] + \" | \" +\r\n \"Processing: \" + row['processing'] + \" | \" +\r\n \"Descritioon: \" + row['description'] + \"</p>\" +\r\n \"</a></li>\";\r\n\r\n var lv = $(\"#MGEventDisplay\").html(htmlcode);\r\n lv.listview(\"refresh\");\r\n\r\n }\r\n }\r\n\r\n EventDB.select(options, callback);\r\n}", "title": "" }, { "docid": "78958344c914fe07d4d963bae9089039", "score": "0.56140053", "text": "function getUserData(userId) {\n\n sprLib.list(\"inDienst\").items({\n queryFilter: \"(contactSAS eq '\" + userId + \"')\",\n queryLimit: 1,\n }).then(function (arrData) {\n\n arrData.forEach(function (arrayItem) {\n\n currentUser = arrayItem;\n // Get list of propertys\n getListOfProperties();\n\n });\n\n\n }).catch(function (strErr) {\n\n Swal.fire({\n title: 'Persoon bestaat niet.',\n text: 'Oeps, deze persoon lijkt niet te bestaan. '+strErr,\n type: 'error',\n confirmButtonText: 'Ok'\n });\n\n });\n\n}", "title": "" }, { "docid": "8a3c407a1be7b06e7894a606a2942aa0", "score": "0.56022555", "text": "static displayItemInfos(name, price, cps, owned) {\n const [displayedPrice, displayedCps, displayedOwned] = document.querySelectorAll(`[data-itemName=\"${name}\"]`);\n displayedPrice.innerHTML = price;\n displayedCps.innerHTML = cps;\n displayedOwned.innerHTML = owned;\n }", "title": "" }, { "docid": "a4af018461821e64c7cf53254446625c", "score": "0.559314", "text": "function toggleLogin() {\r\n if(sessionStorage.getItem(\"UserId\")) {\r\n uId = sessionStorage.getItem(\"UserId\");\r\n \r\n //Check if names exist\r\n if((sessionStorage.getItem(\"First_Name\")) != null && (sessionStorage.getItem(\"Last_Name\") != null)) {\r\n \r\n //Load schools into list\r\n populateData(schoolId);\r\n } else {\r\n \r\n }\r\n \r\n } else {\r\n alert('Not logged in.');\r\n window.location = '..';\r\n }\r\n }", "title": "" }, { "docid": "fdcc9018758b0b809c495b80a6cdc6fa", "score": "0.5592068", "text": "function show_section(obj) {\n var id = obj.data('id');\n\n $('.dm-item').removeClass('text-white bg-blue');\n $('.dm-content').removeClass('active');\n\n obj.addClass('text-white bg-blue');\n $('.dm-content[data-id=' + id + ']').addClass('active');\n}", "title": "" }, { "docid": "0b595713ca80230f648dc668ce06b39c", "score": "0.55853915", "text": "function navMyStories(evt) {\n hidePageComponents();\n putUserStoriesOnPage();\n $userStoriesList.show();\n}", "title": "" }, { "docid": "0eadcab9ce50eaddc4390478be2c4087", "score": "0.55774647", "text": "function showUserList() {\n userListContainer.empty();\n userList.forEach(function (element) {\n if (element.email == user) {\n return;\n }\n var el = rowTemplateEl.clone();\n el.removeClass(\"hidden\");\n el.find(\"._user_email\").html(element.email);\n userListContainer.append(el);\n });\n }", "title": "" }, { "docid": "688ed3eb7628e92d058dc6360c86a9b3", "score": "0.5574547", "text": "function showViewItem(id)\n{\n // display item details\n itemDetails(id);\n\n // show section and go to it\n document.getElementById(\"section-viewitem\").style.display = \"block\";\n document.getElementById(\"section-viewitem\").scrollIntoView(true); \n}", "title": "" }, { "docid": "923060cb36be2674cfa107614dec08cd", "score": "0.55741227", "text": "onUserClick(clickedUser) {\n this.activeUser = clickedUser;\n\n //Questa funzione formatta la data\n }", "title": "" }, { "docid": "d0d293fa0cf161df7be24e9b465d58d9", "score": "0.55638796", "text": "function addRegClickEvent(table){\n\ttable.addEventListener('click', function(e){\n\t\t/** User session**/\n\t\tvar user = Ti.App.Properties.getString('session');\n\t\tif(e.index >= 0){\n\t\t\tvar selectedSection = e.source;\n\t\t\tvar args = {\n\t\t\t\t'title' : selectedSection.titles,\n\t\t\t\t'module' : selectedSection.mod,\n\t\t\t\t'firstname' :Ti.App.Properties.getString('firstname'),\n\t\t\t\t'lastname' :Ti.App.Properties.getString('lastname'),\n\t\t\t\t'email' :Ti.App.Properties.getString('email'),\n\t\t\t\t'u_id' :Ti.App.Properties.getString('u_id')\n\t\t\t};\n\t\t\tvar win = Alloy.createController(\"editProfile\",args).getView(); \n\t\t\tCOMMON.openWindow(win); \n\t\t} \n\t});\n}", "title": "" }, { "docid": "bb9334ef9985c73a264aa6f3c4f8b1b9", "score": "0.55587924", "text": "function displayProfileListItem() {\n\ttry {\n\t\tvar profileItem = $(\"#personalization .containerProfileSelector .profileList li.selected\"); // Selected profile\n\t\n\t\t// Make sure the that UI has loaded and all dimensions have been calculated by the DOM\n\t\tif(Personalization.getWrapperHeight() !== 0 && profileItem.length > 0) {\n\t\t\tvar profileItemY = $(profileItem).position().top;\n\t\t\tvar profileItemHeight = $(profileItem).outerHeight();\n\t\t\tvar profileItemBottomY = profileItemY + profileItemHeight;\n\t\n\t\t\t// If the item selected is not being fully displayed on the top of the list, scroll the list down to fully display the list item\n\t\t\tif(profileItemBottomY > ((Personalization.getStartElementY() * -1) + Personalization.getWrapperHeight())) {\n\t\t\t\tPersonalization.setElementY((profileItemBottomY - Personalization.getWrapperHeight()) * -1);\n\t\t\t// If the item selected is not being fully displayed on the bottom of the list, scroll the list up to fully display the list item\n\t\t\t} else if(profileItemY + Personalization.getStartElementY() <= 0) {\n\t\t\t\tPersonalization.setElementY(Personalization.getStartElementY() - (profileItemY + Personalization.getStartElementY()));\n\t\t\t}\n\t\t\t// Set the starting position of the list in the global configuration object for future processes\n\t\t\tPersonalization.setStartElementY(Personalization.getElementY());\n\t\n\t\t\t// Perform a transition to move the list to the appropriate Y position\n\t\t\t$(profileItem).parent().css(\"-webkit-transform\", \"translate3d(0px, \" + Personalization.getElementY() + \"px, 0px)\");\n\t\t}\n\t} catch(err) {\n\t\tconsole.error(\"File: uiEvents.js, displayProfileListItem() - \", err);\n\t}\n}", "title": "" }, { "docid": "c97843734d010ab5a67e480842862709", "score": "0.55534947", "text": "function getAlbumData() {\n const albumID = albumIDs[$('li').index(this)]; // In this context, this is the list item the user clicked\n const albumURL = `https://api.spotify.com/v1/albums/${albumID}`;\n $.getJSON(albumURL, displayAlbumDetail);\n }", "title": "" }, { "docid": "12e76e129c69b8666d108229ab7b583d", "score": "0.555195", "text": "function populatePage(payload) {\n console.log(payload);\n payload.forEach(user => {\n let html = '';\n let li = document.createElement('li');\n html += `<li>${user.name}</li>`;\n li.innerHTML = html;\n list.appendChild(li);\n });\n}", "title": "" }, { "docid": "9198c451d6b8fee24150ca3f8b26cf11", "score": "0.5551777", "text": "function GS_display_info_when_selected(list, data_type, data, description_field) {\n\tvar info = \"\";\n\tvar first_time = true;\n\t\n\tfor (var i=0; i<list.length; i++)\n if (list.options[i].selected) {\n\t\t\tif (first_time)\n\t\t\t\tfirst_time = false;\n\t\t\telse\n\t\t\t\tinfo += \"<br><br>\";\n\t\t\t\n\t\t\tif (data_type == \"Schedule\")\n\t\t\t\tinfo += data[i][\"starttime\"].format(\"Do MMMM [(]dddd[)] YYYY [<br>] HH:mm\") + \" - \" + data[i][\"endtime\"].format(\"HH:mm\") + \"&nbsp;&nbsp;\" + (data[i][\"type\"]!=0 ? data[i][\"typename\"] : \"\") + \"<br>\" + data[i][\"user\"];\n\t\t\t\n\t\t\tif (data_type == \"Mods\")\n\t\t\t\tinfo += data[i];\n\t\t}\n\t\n\tdocument.getElementById(description_field).innerHTML = info;\n}", "title": "" }, { "docid": "5143b5c9fb37cb76ae6f0beeea715d5c", "score": "0.5551327", "text": "function doShowUserPage() {\r\n //check admin user\r\n var loginemail = getUserEmail();\r\n\r\n var options = [loginemail];\r\n\r\n function callback(tx, result) {\r\n if (result.rows.length > 0) {\r\n var row = result.rows[0];\r\n\r\n if (row['userTypeId'] == '3') {\r\n //disabled add user group button\r\n $(\"#MGUserAddBtnGroup\").show();\r\n\r\n //display all user\r\n var opts = [];\r\n\r\n function callbackAll(tx, results) {\r\n var htmlcode = \"\";\r\n for (var i = 0; i < results.rows.length; i++) {\r\n var irow = results.rows[i];\r\n //make html code for list view\r\n htmlcode += \"<li><a data-role='button' data-row-id='\" + irow['id'] + \"' href='#'>\" +\r\n \"<div>Name: \" + irow['firstName'] + \" \" + irow['lastName'] + \"</div>\" +\r\n \"<p>User Email: \" + irow['email'] + \"</p>\" +\r\n \"<p>User Type: \" + getUserTypeName(irow['userTypeId']) + \"</p>\" +\r\n \"</a></li>\";\r\n\r\n }\r\n\r\n var lv = $(\"#MGUserList\").html(htmlcode);\r\n lv.listview(\"refresh\");\r\n\r\n $(\"#MGUserList a\").on(\"click\", clickHandler);\r\n\r\n function clickHandler() {\r\n localStorage.setItem(\"userId\", $(this).attr(\"data-row-id\"));\r\n $.mobile.changePage(\"#MGUserEditPage\", {transition: 'none'});\r\n }\r\n }\r\n\r\n UserDB.selectAll(opts, callbackAll);\r\n }\r\n else {\r\n //disabled add user group button\r\n $(\"#MGUserAddBtnGroup\").hide();\r\n\r\n //display user only\r\n var htmlcode = \"\";\r\n\r\n //make html code for list view\r\n htmlcode += \"<li><a data-role='button' data-row-id='\" + row['id'] + \"' href='#'>\" +\r\n \"<div>Name: \" + row['firstName'] + \" \" + row['lastName'] + \"</div>\" +\r\n \"<p>User Email: \" + row['email'] + \"</p>\" +\r\n \"<p>User Type: \" + getUserTypeName(row['userTypeId']) + \"</p>\" +\r\n \"</a></li>\";\r\n\r\n var lv = $(\"#MGUserList\").html(htmlcode);\r\n lv.listview(\"refresh\");\r\n\r\n $(\"#MGUserList a\").on(\"click\", clickHandler);\r\n\r\n function clickHandler() {\r\n localStorage.setItem(\"userId\", $(this).attr(\"data-row-id\"));\r\n $.mobile.changePage(\"#MGUserEditPage\", {transition: 'none'});\r\n }\r\n }\r\n }\r\n }\r\n\r\n UserDB.selectByEmail(options, callback);\r\n\r\n}", "title": "" }, { "docid": "1269f248ed9aa73ac9981ab98c2adda1", "score": "0.5550262", "text": "function toggleCityData(section) {\n\t\t// To show or toggle form input elements when the section title is clicked\n\t\t$(\".\" + section).show();\n\t\t//$(\".\"+section).slideToggle();\n\t}", "title": "" }, { "docid": "bf71d5284e4ad16555424c9eed0a33f9", "score": "0.5544734", "text": "function showKurse() { \n\t\t\t\t\t\t\t\t\n\t// Alle gespeicherten Konto Personendaten auslesen\n\t//\n\trecKurse = viaJournalDB_085.query(\"Wechselkurse\");\n\t\t\t\t\n\tvar output = '';\n\t\n\tfor(var i=0 in recKurse) {\t\t\t// das gesamte gespeicherte Array durchlaufen\n\n\t\t// Laufvariable \"i\" wird als Attribut: \"rec\" übergeben\n\t\toutput += '<li>' +\n\t\t\t'<a href=\"#\" class=\"linkKurseDetail\" rec=\"' + i + '\">' +\n\t\t\t\trecKurse[i].kursVon + recKurse[i].kursNach + ' = ' + recKurse[i].kursWert +\n\t\t\t\t'</br><span style=\"font-size:.8em\">' + recKurse[i].kursVonBez + ' zu ' + recKurse[i].kursNachBez + '</span>' +\n\t\t\t'</a>' +\n\t\t'</li>';\n\t\t\n\t}\n\t\t\t\t\t\n\t// gespeicherte Berechnungen in Dashboard Listview ausgeben\t\n\t$('#archivKurse').append(output).listview('refresh');\n\n\t// Wenn keine Daten vorhanden\n\tif(recKurse === 0) { $('#message').append('Keine Daten vorhanden!'); } \n}", "title": "" }, { "docid": "ec458fc1e63c8ab6c3391e435a74d734", "score": "0.5543952", "text": "function run(){\n searchBox();\n organizeStudentList();\n showStudents(1, students); //default page number and array of student to show\n}", "title": "" }, { "docid": "30579f5551aa95b57b034751396fd33c", "score": "0.5540499", "text": "function displayMealList() {\r\n // Meal list\r\n logResponse(\"[displayMealList] displaying meal list.\");\r\n\tvar tmpl = $(\"#meal_list_tmpl\").html();\r\n\tvar output = Mustache.to_html(tmpl, meals);\r\n\t$(\"#meal-list\").html(output).listview('refresh');\r\n}", "title": "" }, { "docid": "dcdca346cd16c5fab449bce8dd14af73", "score": "0.5536942", "text": "function utmx_section(){}", "title": "" }, { "docid": "36600c3292267e7ab475902ace75d3f9", "score": "0.55226666", "text": "function load_sublist() {\n\tvar hash = window.location.hash.substring(1);\n\n\tif (USER_LIST_SETUP[hash]) {\n\t\tfetch_list(hash);\n\t\t$('#user_tabs').tabs('select', '#user_lists');\n\t}\n}", "title": "" }, { "docid": "ad536ce31ef3ae0438559382a5bd5e27", "score": "0.55157113", "text": "function displayClients() {\n var pHtml = '<ul id=\"clients-list\" data-role=\"listview\" data-filter=\"true\" data-filter-placeholder=\"search\" data-autodividers=\"true\">';\n for (var i = 0; i < clients.length; i++) {\n pHtml += '<li onclick=\"displayClientInfo(this)\"><a href=\"#appleseed\">' + clients[i].name + '</a></li>';\n }\n pHtml += '</ul>';\n $(\"#clients-list\").replaceWith(pHtml);\n $(\".p-content\").enhanceWithin();\n}", "title": "" }, { "docid": "eb2ccd6349d20536d49114e857deea62", "score": "0.5509336", "text": "function showJoinedItemList() {\r\n var eventId = getEventId();\r\n var options = [eventId];\r\n\r\n function callbackJoinedItems(tx, results) {\r\n var htmlcode = \"\";\r\n for (var i = 0; i < results.rows.length; i++) {\r\n var irow = results.rows[i];\r\n var itemId = \"Item ID: \" + irow['id'];\r\n var itemName = \"Item Name: \" + irow['name'];\r\n var sdate = \"Date: \" + irow['startDate'] + \" ~ \" + irow['endDate'];\r\n var category = \"Category: \" + getCategoryName(irow['categoryId']);\r\n var location = \"location: \" + irow['location'];\r\n var quantity = \"Quantity: \" + irow['quantity'];\r\n var title = itemId + \"\\n\" + itemName + \"\\n\" + sdate + \"\\n\" + category + \"\\n\" + location + \"\\n\" + quantity;\r\n\r\n //make html code for list view\r\n htmlcode += \"<li><a data-role='button' title='\" + title + \"' data-row-id='\" + irow['eid'] + \"' href='#'>\" +\r\n \"<p>Item Name: \" + irow['name'] + \" (\" + irow['id'] + \")</p>\" +\r\n \"<p>Date: \" + irow['startDate'] + \" ~ \" + irow['endDate'] + \"</p>\" +\r\n \"<p>Category: \" + getCategoryName(irow['categoryId']) + \"</p>\" +\r\n \"<p>location: \" + irow['location'] + \"</p>\" +\r\n \"<p>Quantity: \" + irow['quantity'] + \"</p>\" +\r\n \"</a></li>\";\r\n }\r\n\r\n var lv = $(\"#MGJoinEventItemList\").html(htmlcode);\r\n lv.listview(\"refresh\");\r\n\r\n $(\"#MGJoinEventItemList a\").on(\"click\", clickJoinedItemHandler);\r\n\r\n function clickJoinedItemHandler() {\r\n var cnfrm = confirm(\"Do you want to delete this item from Event?\");\r\n\r\n if (cnfrm) {\r\n var eid = $(this).attr(\"data-row-id\");\r\n var opts = [eid];\r\n\r\n function callbackDeleteEventItem() {\r\n console.info(\"Item is now released!\");\r\n }\r\n\r\n EventItemDB.delete(opts, callbackDeleteEventItem());\r\n showFreeItemList();\r\n showJoinedItemList();\r\n }\r\n };\r\n };\r\n\r\n ItemDB.selectJoinedItems(options, callbackJoinedItems);\r\n}", "title": "" }, { "docid": "d61cf27bb4884fafdc3e1270baec990d", "score": "0.5500896", "text": "function showPerson() {\n const item = reviews[currentItem];\n\n\n author.textContent = item.name;\n job.textContent = item.job;\n info.textContent = item.text;\n}", "title": "" }, { "docid": "9857ff23187947835d9d00637ea97d04", "score": "0.5498642", "text": "function showUsers(users) {\n users.forEach(user => {\n let li = document.createElement('li');\n let value = document.createTextNode(`${user.first_name} ${user.last_name}`);\n li.appendChild(value);\n ul_list.appendChild(li);\n });\n document.getElementsByClassName('loading')[0].style.display = 'none';\n}", "title": "" }, { "docid": "401c651c7acf1d3afdedce637e60158d", "score": "0.549649", "text": "function showUserContent(user){\n console.log(user)\n if(user.providerData[0].providerId != 'password')\n {\n emailVerified.innerHTML = 'Autenticação realizada por provedor confiável'\n hideItem(sendEmailVerificationDiv)\n }\n else\n {\n if(user.emailVerified)\n {\n emailVerified.innerHTML = 'E-mail verificado'\n hideItem(sendEmailVerificationDiv)\n } \n else\n {\n emailVerified.innerHTML = 'E-mail não verificado'\n showItem(sendEmailVerificationDiv)\n }\n }\n \n userImg.src = user.photoURL ? user.photoURL : 'img/unknownUser.img'\n userName.innerHTML = user.displayName\n\n userEmail.innerHTML = user.email\n hideItem(auth)\n dbRefUsers.child(firebase.auth().currentUser.uid).on('value', function (dataSnapshot){\n fillTodoList(dataSnapshot)\n })\n showItem(userContent)\n}", "title": "" }, { "docid": "15bba2bf41e951ef654941c066dfb70a", "score": "0.54946876", "text": "function friendList(value) {\n friendListInitialize();\n let ulSelector = document.querySelector('div.content > ul');\n //Loops for each friend and displays the data\n value.forEach(item => {\n console.log(item.firstName);\n let li = document.createElement('li');\n let a = document.createElement('a');\n a.setAttribute('class', 'pure-menu-link');\n a.setAttribute('data-id', item.id);\n let friendName = document.createTextNode(`${item.firstName} ${item.lastName}`);\n li.setAttribute('class', 'pure-menu-item');\n a.appendChild(friendName);\n li.appendChild(a);\n ulSelector.appendChild(li);\n });\n}", "title": "" }, { "docid": "a6c0a24abbe260a3c3140d4579ac7524", "score": "0.5491278", "text": "function renderUserList(data) {\n if (!data.length) {\n window.location.href = \"/users\";\n }\n $(\".hidden\").removeClass(\"hidden\");\n }", "title": "" }, { "docid": "2dcc523b108a227ab572cd11f26d2372", "score": "0.54897875", "text": "function profile(){\n\t$(\".profileList li\").live('click', (function(){\n\t\t// If the title hasn't been selected yet\n\t\tif (!$(this).hasClass('current')){\n\t\t\tvar artistInitial = $(this).attr('class');\n\t\t\tvar contents = $(\"#\" + artistInitial).contents().clone();\n\t\t\tvar description = $(this).parents('.profileContainer').find(\".profileDesc\");\n\n\t\t\t$(this).parent().find(\"li.current\").removeClass('current');\n\t\t\t$(this).addClass(\"current\");\n\n\t\t\tdescription.hide().html(contents).fadeIn(500);\n\t\t}\n\t}));\n}", "title": "" }, { "docid": "0c94ae4799281bd1d7fd2a81fdab57aa", "score": "0.5488749", "text": "function showInfo() {\n jQuery.each( info.modules, function(i, mp) {\n $('.collapsible').first().append('<li><div class=\"collapsible-header\">'+mp.code+' - '+mp.name+'</div><div class=\"collapsible-body\"><div class=\"row\"></div></div></li>');\n\n jQuery.each( mp.ufs, function(j, uf) {\n $('.row').last().append('<label><div class=\"col s6 m4\" style=\"color:black;\"><input class=\"ufs\" type=\"checkbox\"><span>'+uf.code+' - '+uf.name+'</span></div></label>');\n })\n });\n}", "title": "" }, { "docid": "686d42686d3859eb043d9d1bd36ea6e1", "score": "0.5487398", "text": "function fetchDetail(props){\n var busno =document.getElementById('Busno').value\n var printThis=\"\";\n if(data[busno]!==undefined){\n for(var i=0;i<data[busno].length;i++){\n printThis+=i+1+\". \"+\"<CollectionItem>\"+data[busno][i]+\"</CollectionItem>\"+\"<br>\";\n }\n }\n else{\n printThis=\"NO BUS FOUND\";\n }\n document.getElementById('list').innerHTML=printThis;\n}", "title": "" }, { "docid": "b2b73070fb54e9febdb049f9e2614e36", "score": "0.5483498", "text": "function displayPage(pageNo, studentList) {\n\tstudentItems.hide();\n\t$.each(studentList, function(index, list) {\n\t\tif (pageNo === index) {\n\t\t\t$.each(list, function(i,l) {\n\t\t\t\t$(l).fadeIn('slow');\n\t\t\t})\n\t\t}\t\n\t});\n}", "title": "" }, { "docid": "8ec7b11b57d54f48b217ada431d35049", "score": "0.5482481", "text": "function setInfo(){\n console.log(\"Result setInfo: \"+result);\n result ='<li>GROUPS</li>';\n for (var i=0; i<group.length; i++) {\n document.querySelector(\"#userInfo\").innerHTML = result;\n result += '<li>' + group[i].name + '</li>'\n result+= '<li>' + group[i].members + '</li>'\n \n }\n console.log(\"Result setInfo: \"+result);\n }", "title": "" }, { "docid": "33b327ed2fa0108bba50474bb121bc74", "score": "0.54805833", "text": "function toggleSectionsList(hook) {\n toggleSidePanelContent(hook, \"sections-list\");\n}", "title": "" }, { "docid": "ace310ee9605c768c025a8e5afa53d8c", "score": "0.54798657", "text": "function get_SectionLoad(s, a)\n {\n $createCheckboxDropdown('ctl00_partialPage_filtersContainer_MarketSegment_Section_ID', 'Section_ID', null, { 'defaultText': '', 'multiItemText': '--Change Selection--' }, { 'itemClicked': onMarketSegmentItemClicked }, 'moduleOptionsContainer');\n var section_id_control = $get('Section_ID').control;\n $loadPinsoListItems(section_id_control, channelsList, { 'ID': '0', 'Name': 'All', 'Value': '0' }, 0, false);\n }", "title": "" }, { "docid": "65a1ef5606890557b3badb5950780e9b", "score": "0.54762524", "text": "function showPage(list, page) {\n const startIndex = (page - 1) * itemsPerPage;\n let endIndex = page * itemsPerPage;\n if (endIndex > list.length) {\n endIndex = list.length;\n }\n const studentList = document.querySelector('ul.student-list');\n studentList.innerHTML = '';\n for (let i = startIndex; i < endIndex; i++) {\n if (i >= startIndex && i < endIndex) {\n const html = `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${list[i].picture.large} alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}\n </div>\n </li>`;\n studentList.insertAdjacentHTML('beforeend', html);\n }\n }\n if (list.length == 0) {\n studentList.innerHTML += '<h3>Uh Oh! There are no results found!!! Try again!</h3>';\n }\n}", "title": "" }, { "docid": "0c7745ced9bc2c40dce877bd40fb3d4d", "score": "0.54732686", "text": "function display(data) {\n console.log(data);\n var personContainer = '<ul class = container>';\n $.each(data.results, function(i, entry) {\n var firstName = capitalize_Words(entry.name.first);\n var lastName = capitalize_Words(entry.name.last);\n personContainer += '<li class = person>';\n personContainer += '<div class = image>';\n personContainer += '<img class = avatar src=\"' + entry.picture.medium + '\">';\n $('.avatar').attr(\"src\", entry.picture.medium);\n personContainer += '<h3 class = name>' + firstName + ' ' + lastName + '</h3>';\n\n personContainer += '<span class = e-mail>' + entry.email + '</span>';\n personContainer += '<span class = phone>' + entry.cell + '</span>';\n personContainer += '</div>';\n personContainer += '</li>';\n });\n personContainer += '</ul>';\n $('.main').html(personContainer);\n eHandler(data);\n }", "title": "" }, { "docid": "b1e704aa3eb7a672217f4156272982be", "score": "0.54723525", "text": "function showPage(studentList, page) {\n //Set the student info display to none for the students after the selection\n for (let i = (page * itemsPerPage); i < studentList.length; i++) {\n studentList[i].style.display = \"none\";\n }\n //Set the student info display to none for the students before the selection\n for (let i = 0; i < (page * itemsPerPage) - itemsPerPage; i++) {\n studentList[i].style.display = \"none\";\n }\n //Display the students in the selection\n for (let i = (page * itemsPerPage) - itemsPerPage; i < page * itemsPerPage; i++) {\n studentList[i].style.display = '';\n }\n}", "title": "" }, { "docid": "f0d307f0b73d6047fc62766c317c4e35", "score": "0.5469552", "text": "function viewListItem(id)\n{\n // save to localStorage: id is not editable\n\tlocalStorage.setItem('data-row-id', id);\n\tfindReview(id);\n}", "title": "" }, { "docid": "e7da8cd486a4edab24f112c04993db8e", "score": "0.54664063", "text": "function userData (user) {\n submitModal.addEventListener('click', function(event) {\n event.preventDefault()\n // document.getElementById(\"loginButton\").style.display=\"none\";\n createButton.style.display=\"block\";\n document.getElementById(\"addLocation\").style.display=\"block\";\n //filters user JSON object to return record that is equal to the user input for email\n displayItinerary(user)\n\n //hides original log in button\n document.getElementById(\"logIn2\").style.display = \"none\";\n\n //hides modal\n document.getElementById(\"myModal\").style.display = \"none\";\n\n //displays nav bar\n document.getElementById(\"navbar-intro\").style.display = \"block\";\n\n })\n }", "title": "" }, { "docid": "09ec3dc4f03ae9a3c6a5db4cca53e317", "score": "0.5466246", "text": "function displayRecommendedCourses(){\n\n}", "title": "" }, { "docid": "7c7aa8256f4c90d6dc0806ffa16a5752", "score": "0.5465378", "text": "function savedPeople(){\n let section = document.querySelector('.list-view');\n section.innerHTML =\"\"; \n let savedPeople = JSON.parse(sessionStorage.getItem(rightSwipesKey));\n savedPeople.forEach(item => {\n console.log(\"saved\" + item.id);\n let section = document.querySelector('.list-view'); \n let div = document.createElement(\"li\"); \n div.setAttribute('class', 'list-item');\n div.setAttribute('data-id', item.id);\n let name = document.createElement(\"p\");\n name.setAttribute('class', 'list-text');\n name.textContent = item.first + \" \" +item.last;\n let img = document.createElement(\"img\");\n img.setAttribute(\"src\", 'https:' + profileImg + item.avatar);\n img.setAttribute(\"alt\", \"avatar\");\n img.setAttribute(\"class\", \"avatar\");\n let editDiv = document.createElement(\"div\");\n editDiv.setAttribute('class', 'action-right');\n let iconEdit = document.createElement(\"i\");\n iconEdit.setAttribute('class', 'icon clear');\n iconEdit.addEventListener('click', () => removeFav(item));\n editDiv.appendChild(iconEdit);\n div.appendChild(img);\n div.appendChild(name);\n div.appendChild(editDiv);\n section.appendChild(div);\n });\n\n}", "title": "" }, { "docid": "c7ed0a1cb9b64e509013511e8960768b", "score": "0.54628193", "text": "function showProfiles(json_url){\n \n // get list of products from the API\n $.getJSON(json_url, function(data){\n \n // html for listing products\n \n readProfilesTemplate(data, \"\");\n \n // chage page title\n changePageTitle(\"View Staff Profiles1\");\n \n });\n}", "title": "" }, { "docid": "e3b66ec03a62288639f77c09307040f5", "score": "0.5461783", "text": "function showSuperHeroResults(){\n var superHeroName = document.getElementById(\"get-superhero\").value;\n heroResultsApi(superHeroName)\n .then(data => {\n clearExistingResults(document.querySelector('.list-group-a'));\n for(value in data){\n appendOnPage(data[value].name, data[value].id);\n }\n })\n \n }", "title": "" }, { "docid": "638f2a38c038f5b8bfdce368176bd7ac", "score": "0.54603255", "text": "function updateUserList(data){ \n const usernames = data['users'];\n userList = document.querySelector('#user-list');\n userList.innerHTML = '';\n // Make sure user in in room before pupulating list\n if (room){\n usernames.forEach(function(username){\n const li = document.createElement('li');\n li.setAttribute('class', 'list-group-item user-list');\n li.innerHTML = username;\n userList.append(li);\n });\n } \n }", "title": "" }, { "docid": "eb2468e73b524bded20a5eec39423407", "score": "0.54599327", "text": "function displayMembers() {\n // Get members to display\n let sortByName = document.getElementById(\"sortByName\").value;\n let filterMajor = document.getElementById(\"filterMajor\").value;\n let filterRole = document.getElementById(\"filterRole\").value;\n let search = document.getElementById(\"search\").value;\n let displyedMembers = members.filterMembers(sortByName, filterMajor, filterRole, search);\n\n // Edit the html based on gotten members\n document.getElementById(\"members\").innerHTML = \"\";\n displyedMembers.forEach((member, index) => {\n const memberDiv = HTMLMember(index, member.name, member.email, member.major, member.role, member.biography);\n document.getElementById(\"members\").innerHTML += memberDiv; \n });\n membersNumber = displyedMembers.length;\n if(membersNumber == 0 || membersNumber == 1)\n document.getElementById(\"membersNumber\").innerHTML = membersNumber + \" item\";\n else\n document.getElementById(\"membersNumber\").innerHTML = membersNumber + \" items\";\n document.getElementById(\"atIndex\").max = membersNumber;\n}", "title": "" }, { "docid": "8cf71353c5c2e0b70819a46b08d2c2df", "score": "0.5452405", "text": "function updateListUser() {\n\n activeLoader();\n var userTable = $('#user-segment');\n\n $.ajax({\n type: \"post\",\n url: urlListStaff,\n data: '',\n success: function (result, status, xhr) {\n\n if (status === 'success') {\n\n userTable.html(result);\n inactiveLoader();\n }\n },\n error: function (xhr, status, error) {\n //inactive loading\n inactiveLoader();\n }\n });\n }", "title": "" }, { "docid": "ea7520c463e56b6b49768c6fc82f01f5", "score": "0.5444217", "text": "function onShow(superOnShow) {\n //Bind listView on .pgx\n var myListView = this.children.listView1;\n //Create DB on Local\n var database = new Database({\n file: new File({path: Path.DataDirectory + \"//tavukculuk.sqlite\" })\n });\n //Define dataSet\n var myDataSet = [{}];\n //Get query Result and values on columns\n var result = database.query(\"SELECT * FROM 'F64PL001'\");\n for(var j=0; j < result.count(); j++)\n {\n var flockid = result.get(j).getInteger('ZXFLOCKID');\n var flockdsc = result.get(j).getString('ZXFLOCKDSC1');\n var farmcode = result.get(j).getInteger('FARMCODE');\n var menuItem1 = ({flockid : flockid, flockdsc1 : flockdsc, farmcode : farmcode});\n myDataSet[j] = menuItem1;\n }\n \n if(myDataSet[0].flockid != null)\n {\n listView(myListView, myDataSet);\n }\n superOnShow();\n//End onShow Function\n}", "title": "" }, { "docid": "7acb903ccc8b395697f3984910f237ca", "score": "0.5441433", "text": "function getUser() {\n $.get(\"/api/currentuser\", function(data) {\n // var rowsToAdd = [];\n // for (var i = 0; i < data.length; i++) {\n // rowsToAdd.push(createAuthorRow(data[i]));\n // }\n // renderAuthorList(rowsToAdd);\n // nameInput.val(\"\");\n console.log(\"User properties: \", data);\n userId = data[0].id_name;\n userImg = data[0].image;\n });\n}", "title": "" }, { "docid": "ba46ea6567802bba11a2ab9e8070ccd7", "score": "0.54409385", "text": "function showPage (list, page) {\n const startIndex = (page - 1) * itemsPerPage\n const endIndex = startIndex + itemsPerPage\n studentListUL.innerHTML = ''\n let studentHTML\n\n if (list.length > 0) {\n // for loop to go through data array and nested conditional to display students within specified index range\n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex && i < endIndex) {\n studentHTML =\n `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${list[i].name.title}. ${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li>`\n studentListUL.insertAdjacentHTML('beforeend', studentHTML)\n }\n }\n } else {\n studentHTML = `<li>No results for your search were found. Try again!</li>`\n studentListUL.insertAdjacentHTML('beforeend', studentHTML)\n }\n}", "title": "" }, { "docid": "95eb3a303ad3cebc1b83953b9753bd18", "score": "0.54396784", "text": "function displayName(data) {\n console.log(data);\n console.log(data.login);\n $(\"#display button\").click(function(){\n $(\"#display div p\").text(data.login);\n }) \n}", "title": "" }, { "docid": "8b6dd07484ea11f4ce3a726715a258ae", "score": "0.5432029", "text": "function showUserDetails ( id ) {\n var rows = [ ], user;\n var watch = dumpUser( id );\n console.log('dumpuser '+id);\n console.log(watch);\n var name = watch['name'], groupSpan;\n var toSet = ({ \"Name\":name,\"id\":id });\n \n var group = getGroupClassForUser(id);\n if ( group ) { // for watchlist users in default group\n groupSpan = buildTag( 'span', ({ 'html':group.replace(\"watchList_\",\"\") }) )\n $( groupSpan ).addClass(group);\n toSet['group'] = groupSpan;\n }\n\n $.each( toSet, function( key, value ) {\n var li = buildli( \"<b>\"+key+\"</b>: \");\n $( li ).append( value );\n rows.push( li ); \n });\n \n // get rid of this once we're clear on what we want to show here\n $.each( watch, function( key, value ) {\n if ( key != 'msgs' && key != 'name' && key != 'group' ) {\n var li = buildli( key+\"=\"+JSON.stringify(value) );\n rows.push( li );\n }\n });\n\n/*\n $.each( membersList[id], function( key, value ) {\n if ( key != 'msgs' && key != 'name' && key != 'group' ) {\n var li = buildli( key+\"=\"+JSON.stringify(value) );\n rows.push( li );\n }\n });\n*/\n var msgs;\n\n if ( membersList[id] ) {\n //msgs = jQuery.extend({}, membersList[id]['msgs'] );\n \n $.each( membersList[id], function( key, value ) {\n if ( key != 'msgs' && key != 'name' && key != 'group' ) {\n var li = buildli( key+\"=\"+JSON.stringify(value) );\n rows.push( li );\n }\n });\n \n }\n else {\n // msgs = false;\n user = getSavedUser(id);\n }\n \n if ( user ) {\n var li = buildli( \"lastseen=\"+JSON.stringify(user['lastMsgTime'] ) );\n rows.push( li ); \n console.log(user);\n } \n //var lastMsgTime = \n console.log('session msgs');\n console.log(msgs);\n var loggedMsgs = getUserLog( id ); \n console.log('log start');\n console.log(loggedMsgs);\n console.log('log end');\n if ( msgs ) {\n var idstr = \"(\"+id+\") &lt;\"+name+\"&gt;\";\n var li = buildli( '<b>Messages this session:</b> ' );\n rows.push( li );\n \n var msglist = buildTag( 'ul', ({ 'addClass':'msglist' }) );\n $.each( msgs, function( msgTime, msgObj ) {\n//date.format( 'yy-MM-dd hh:mm:ss' );\n //console.log(msgTime);\n var time = getTime(msgTime);\n msgTime = time.format('hh:mm:ss');\n var li = buildli( msgObj );\n $( msglist ).append( li );\n });\n rows.push( buildli( msglist ) );\n }\n \n if ( loggedMsgs ) {\n var idstr = \"(\"+id+\") &lt;\"+name+\"&gt;\";\n var li = buildli( '<b>Message history:</b> ' );\n rows.push( li );\n \n var logList = buildTag( 'ul', ({ 'addClass':'msglist' }) );\n\n $.each( loggedMsgs, function( key, value ) {\n//date.format( 'yy-MM-dd hh:mm:ss' );\n\n var time = getTime(key);\n key = time.format('hh:mm:ss');\n var li = buildli( key+\" \"+idstr+\" \"+value );\n $( logList ).append( li );\n });\n console.log(logList);\n rows.push( buildli( logList ) );\n }\n /*\n var names = membersList[id]['names'];\n\n if ( msgs ) {\n $( div ).append( \"msgs this session<br>\" );\n $.each( msgs, function( key, value ) {\n $( div ).append( key+\"=\"+value+\"<br>\" );\n });\n }*/\n \n var panel = new Panel();\n var title = \"(\"+id+\") &lt;\"+name+\">&gt;\";\n \n if ( watchList[id] )\n title += \"on watchlist\";\n \n panel.setTitle( title );\n panel.addClass( 'watchListDetails userDetails' );\n \n panel.build( rows );\n\n}", "title": "" }, { "docid": "a6085eb25bbdc503a4d53cc1168a9760", "score": "0.5431256", "text": "function showPage (list, page){\n\n const startIndex = (page * 9)-9;\n const endIndex = (page*9);\n const ul = document.getElementsByClassName(\"student-list\");\n const studentList = ul[0];\n studentList.innerHTML= \"\";\n\n for(let i =0; i<list.length; i++){\n\n if([i]>= startIndex && [i] < endIndex){\n\n const li = document.createElement('li');\n li.className = \"student-item cf\";\n\n const firstDiv = document.createElement('div');\n firstDiv.className = \"student-details\";\n\n li.appendChild(firstDiv);\n\n \n const image = document.createElement('img');\n image.className = \"avatar\";\n image.src = list[i].picture[\"large\"];\n image.alt = \"Profile Picture\"\n\n firstDiv.appendChild(image);\n\n const h3= document.createElement('h3');\n h3.textContent = list[i].name[\"first\"]+ \" \" + list[i].name[\"last\"];\n \n firstDiv.appendChild(h3);\n\n const span = document.createElement('span');\n span.className = \"email\";\n span.textContent= list[i].email;\n\n firstDiv.appendChild(span);\n\n const secondDiv = document.createElement('div');\n secondDiv.className = \"joined-details\";\n \n li.appendChild(secondDiv);\n\n const secondSpan = document.createElement('span');\n secondSpan.className = \"date\";\n secondSpan.textContent=\"Joined\" + \" \" + list[i].registered[\"date\"];\n \n secondDiv.appendChild(secondSpan);\n\n\n studentList.appendChild(li);\n\n \n\n };\n };\n return studentList;\n}", "title": "" }, { "docid": "4551712a1f59ddeaafdfc7846e36c976", "score": "0.5430053", "text": "function viewLoads(){\n document.getElementById('showdata').style.display = \"block\"\n var data = [];\n var users = JSON.parse(localStorage.getItem('users'));\n var usertodo;\n for(let i = 0; i < users[userIndex].todo.length; i++)\n {\n usertodo = users[userIndex].todo[i]; \n \n var x = getTodoObject(usertodo)\n data.push(x);\n }\n showTabularData(data);\n}", "title": "" } ]
7dd595cb2ce5fda468419619b9ec3ed0
returns size of the stack
[ { "docid": "dafbf9e27e74369abb4a7ee3b4bfe715", "score": "0.0", "text": "size() {\n return this._array.length;\n }", "title": "" } ]
[ { "docid": "c79a659ee4ad0507b076e70ddf99f576", "score": "0.8376011", "text": "size() {\n return this.stack.length\n }", "title": "" }, { "docid": "737cb2cf8f6bd6a79f898303f7ffc269", "score": "0.803474", "text": "getSize() {\n return this.stackSize;\n }", "title": "" }, { "docid": "e034e166fde2c9a52040ea92b98397de", "score": "0.7987523", "text": "stackLength() {\n for (var length = 0, _f = this._stack.fn, i = 0; i < _f.length; i++) length += _f[i].length;\n if (this._stack.start) length++; // Add to length the asynchronous function which is being executed\n return length;\n }", "title": "" }, { "docid": "0c97258f6345f0175497240732d3ca7e", "score": "0.78841", "text": "get size() {\n return this.#stack.length;\n }", "title": "" }, { "docid": "b86edc9d594fa703145d89e3667f281c", "score": "0.78450817", "text": "length() {\n const stackLen = this.stack.length;\n debug(`\\nLOG: There are total ${stackLen} data in the stack`);\n return stackLen;\n }", "title": "" }, { "docid": "6abc965a5b13720aa61d5e1100cc7ca3", "score": "0.77885836", "text": "function getStackLen() {\n if( !TypingDNA ||\n !TypingDNA.history ||\n !TypingDNA.history.stack) {\n return null;\n }\n return TypingDNA.history.stack.length\n}", "title": "" }, { "docid": "7bf30388274732b0be2022757adacd20", "score": "0.73641276", "text": "function countStack(stack){\n \n}", "title": "" }, { "docid": "7e99d76cd91b3291147bf742a94d7319", "score": "0.73364484", "text": "size(){\n console.log(`${this.count}elements in the stack`);\n return this.count\n }", "title": "" }, { "docid": "248da21f0403c5fb365e4fc1ed8f52ea", "score": "0.7177103", "text": "getStackLength() {\n return this.maskStack.length;\n }", "title": "" }, { "docid": "ddb225ae4634b9482cc51e3c1be70f4c", "score": "0.6964556", "text": "length() {\n var runner = this.top; // Start at the top of the stack\n var numNodes = 0;\n // Loop to move down stack\n while (runner != null) {\n numNodes++; // Increment number of nodes found\n runner = runner.next; // Move to next node (if there is one)\n }\n return numNodes;\n }", "title": "" }, { "docid": "76ca050c08e9c6de839d917858b468ee", "score": "0.686936", "text": "getLingeringStackCount() {\n return this._waitingStacks.size + this._interruptedStacksOfUnknownCircumstances.length;\n }", "title": "" }, { "docid": "cd95d84d84bd09c363010f1220465b67", "score": "0.6803293", "text": "function stacksize(thearray)\n{\n\tfor (i = 0 ; i < thearray.length; i++ )\n\t{\n\t\tif ( (thearray[i] == \"\") || (thearray[i] == null) || (thearray == 'undefined') )\n\t\t{\n\t\t\treturn i;\n\t\t}\n\t}\n\t\n\treturn thearray.length;\n}", "title": "" }, { "docid": "009a4e9b8ca821d6f66a274b7d136c2c", "score": "0.6446514", "text": "get capacity(){ return this.maxStackSize - this.stackSize; }", "title": "" }, { "docid": "b48ffaf41b41372abc57da32db4f1de5", "score": "0.6163827", "text": "function _size() {\n return lsize\n }", "title": "" }, { "docid": "c06ab84fcbd2903190995f6c4ecd82b3", "score": "0.61491686", "text": "function pathLength(stack) {\n let length = 0.0;\n let x = (y = 0);\n stack.forEach(function(p) {\n if (p.c == \"l\") {\n let xDiff = p.x - x;\n let yDiff = p.y - y;\n length += Math.sqrt(Math.pow(xDiff, 2) + Math.pow(yDiff, 2));\n }\n ({ x, y } = p);\n });\n return length;\n}", "title": "" }, { "docid": "aaa95f3eddf471ef960840bc4bedfa27", "score": "0.6139367", "text": "function length() {\r\n\t\treturn size;\r\n\t}", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.6129519", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.6129519", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.6129519", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "720675a1d6c4070630db79b1508d04a0", "score": "0.6092797", "text": "function size(){\n \treturn pQueue.length;\n }", "title": "" }, { "docid": "146d20e49384fa48734cee92eea5fe67", "score": "0.6084908", "text": "get queue_size() {\n // NOTE: _queue is the internal reference to pending commands\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return this.pipeline._queue.length;\n }", "title": "" }, { "docid": "43c5f6feffe40debc335ec5eb452d4de", "score": "0.60829026", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "1f480d6ba216d53386931cdd025e7acf", "score": "0.60268843", "text": "function Stack() {\r\n this._size = 0;\r\n this._storage = {};\r\n}", "title": "" }, { "docid": "64575d528811045363e792537c3ba1aa", "score": "0.59990054", "text": "function stack(){\n this.count = 0;\n this.storage = {};\n\n // Adds value at end of stack\n this.push = function(val){\n this.storage[this.count] = val;\n this.count++;\n }\n\n // Removes and returns value at end of stack\n this.pop = function(){\n if(this.count === 0){\n return undefined;\n }\n\n this.count--;\n var result = this.storage[this.count];\n delete this.storage[this.count];\n return result;\n }\n\n this.size = function(){\n return this.count;\n }\n\n // Returns value at end of stack WITHOUT REMOVING ITEM\n this.peek = function(){\n return this.storage[this.count-1];\n }\n}", "title": "" }, { "docid": "0772cf10ccaae444816c5429a39b83b1", "score": "0.59767807", "text": "function size(){\n return queue.length;\n }", "title": "" }, { "docid": "631b0e344d0d0c2b38d1efceb026cc7a", "score": "0.59682846", "text": "function Stack() {\n this.size = 0;\n this.stack = [];\n}", "title": "" }, { "docid": "b85a21c35ca65875ce87f36520c5c006", "score": "0.5967442", "text": "constructor(maxSize = 1048) { //construts with a max-size constraint of 1048\n this.top = null; //sets this stacks top to null\n this.maxSize = maxSize; //sets this stacks maxSize to the given maxSize, static in the constructor\n this.size = 0; //sets size of stack to 0, to increment/decrement as needed\n }", "title": "" }, { "docid": "ba9c1e67d7e8a7c726c21956bc30ce98", "score": "0.5963102", "text": "constructor(size) {\n this.stackSize = size;\n }", "title": "" }, { "docid": "6ce1a4467bba10f2f303ddd0193098af", "score": "0.5950843", "text": "function Stack() {\n this.storage = {};\n this.size = -1;\n\n this.push = (value) => {\n this.size++;\n this.storage[this.size] = value;\n };\n\n this.pop = () => {\n if (this.size === -1) {\n return undefined;\n }\n const result = this.storage[this.size];\n delete this.storage[this.size];\n this.size--;\n return result;\n };\n\n this.peek = () => {\n return this.storage[this.size];\n };\n\n this.length = () => {\n return this.size;\n };\n}", "title": "" }, { "docid": "0a8a4f6e326dd25faaec5e4624e1d4f3", "score": "0.5948302", "text": "loopCount() {\n return this._stack.loop;\n }", "title": "" }, { "docid": "88ad4b99a9ac1964129e2212d48322e6", "score": "0.59256583", "text": "constructor() {\n this.stack = [];\n this.size = 0;\n }", "title": "" }, { "docid": "464c8e11076be81770a46ae2f2647073", "score": "0.59125394", "text": "get size() {\n config_1.log.verbose('MemoryCard', '<%s> size', this.multiplexPath());\n if (!this.payload) {\n throw new Error('no payload, please call load() first.');\n }\n let count;\n if (this.isMultiplex()) {\n count = Object.keys(this.payload)\n .filter(key => this.isMultiplexKey(key))\n .length;\n }\n else {\n count = Object.keys(this.payload).length;\n }\n return Promise.resolve(count);\n }", "title": "" }, { "docid": "a6793f0a14d18ce35938904d40cc655f", "score": "0.5885368", "text": "size() {\n return this.heap_array.length;\n }", "title": "" }, { "docid": "4598ea08c4937d2d65eac3e633c7282e", "score": "0.5785253", "text": "size() {\n\t\tvar length = 0;\n\n\t\tthis.traverse(function(node){\n\t\t\tlength++;\n\t\t});\n\t\treturn length;\n\t}", "title": "" }, { "docid": "5d42c6ad20714e31d962b55a5a18f029", "score": "0.5780941", "text": "function maxCallStackSize0() {\r\n try {\r\n return 1 + maxCallStackSize0();\r\n } catch (e) {\r\n return 1;\r\n }\r\n}", "title": "" }, { "docid": "86aa2dd786b50486b8387c42645b6581", "score": "0.576949", "text": "function size(){\n \treturn dQueue.length;\n }", "title": "" }, { "docid": "e35ae473b0beda7f9e597108ca9819f1", "score": "0.57431203", "text": "function MyStack(){\n this.length = 0;\n}", "title": "" }, { "docid": "416fbd187c9f107fe439724e65a0376d", "score": "0.5718817", "text": "function getSize(){\n\t\treturn size;\n\t}", "title": "" }, { "docid": "6e220f6742eddcb59f64974fbd9a9763", "score": "0.5693089", "text": "estimateSize () {\n // largest possible sig size\n let sigsize = 1 + 1 + 1 + 1 + 32 + 1 + 1 + 32 + 1\n let size = this.tx.toBuffer().length\n size = size + sigsize * this.tx.txIns.length\n size = size + 1 // assume txInsVi increases by 1 byte\n return size\n }", "title": "" }, { "docid": "c4383b53671c8fe3f73ce73919fa4088", "score": "0.5659027", "text": "function size() {\n return self._queue.size();\n }", "title": "" }, { "docid": "ccce9663b922719e7f98dedb6fe11bcc", "score": "0.56306994", "text": "get size() {\n if (this._available && this._available.length > 0) {\n return this._available.length;\n }\n if (this._pending && this._pending.length > 0) {\n return -this._pending.length;\n }\n return 0;\n }", "title": "" }, { "docid": "dcddbd339af67e88da832744a19974e3", "score": "0.56297576", "text": "length() {\n return this.top;\n }", "title": "" }, { "docid": "6df6b2c390ff389473025d2e69757538", "score": "0.5627083", "text": "size() {\n if (this.isEmpty()) {\n return 0;\n }\n\n return (this.rear - this.front + 1);\n }", "title": "" }, { "docid": "bf48e15cf01c7f86027da1174254f9fc", "score": "0.5625384", "text": "function Stack() {\n this.length = 0;\n}", "title": "" }, { "docid": "7f8b8a9f809e9f8ebd7a48e62af35fe8", "score": "0.5609579", "text": "push(val) {\n // Step 1: Create a node with value passed to function\n let newNode = new Node(val);\n\n // Step 2: If there are no nodes in the stack, set the first and last property to be the newly created node\n if (!this.first) {\n this.first = newNode;\n this.last = newNode;\n } else {\n // Step 3: Otherwise,\n // create a temp variable that stores the current first property on the stack\n // Reset the first property to be the newly created node\n // Set the next property on the node to be the previously created temp variable\n let temp = this.first;\n this.first = newNode;\n this.first.next = temp;\n }\n\n // Step 4: Increment the size by 1 and return size\n this.size++;\n return this.size;\n }", "title": "" }, { "docid": "a11a9b111b6a6e018823b44735fe0c82", "score": "0.56069833", "text": "function maxCallStackSize3(s1, s2, s3, s4) {\r\n try {\r\n return 1 + maxCallStackSize3(s1, s2, s3, s4);\r\n } catch (e) {\r\n return 1;\r\n }\r\n}", "title": "" }, { "docid": "9dcb5cc7a5b53e40acda1dea4c19ba97", "score": "0.56016093", "text": "function Stack(head, tail) {\n this.head = head;\n this.tail = tail;\n this.length = tail ? tail.length + 1 : 0;\n}", "title": "" }, { "docid": "df7d98503a7bd2e785c029b028a18441", "score": "0.56000656", "text": "size() {\n return this._size(this.root)\n }", "title": "" }, { "docid": "2820fddebc6de6d3f8e3d09a5c57173b", "score": "0.5572464", "text": "function getSizeOf(thing) {\n return sizeof(thing)\n}", "title": "" }, { "docid": "bf99c36b3f01a55f32aff69bef9d014a", "score": "0.5558861", "text": "size () {\n\t\tlet count = 0;\n\t\tlet node = this.head;\n\n\t\twhile (node) {\n\t\t\tcount++;\n\t\t\tnode = node.next;\n\t\t}\n\n\t\treturn count;\n\t}", "title": "" }, { "docid": "bf99c36b3f01a55f32aff69bef9d014a", "score": "0.5558861", "text": "size () {\n\t\tlet count = 0;\n\t\tlet node = this.head;\n\n\t\twhile (node) {\n\t\t\tcount++;\n\t\t\tnode = node.next;\n\t\t}\n\n\t\treturn count;\n\t}", "title": "" }, { "docid": "775d23293c36b9ed5ff701a0fee30146", "score": "0.5552067", "text": "function size(node) {\n if (node == null) return 0; //base case\n return size(node.left) + size(node.right) + 1; //increments count by +1 each time function is called \n }", "title": "" }, { "docid": "76df65a114d0d1e72699f16074ab522f", "score": "0.5549226", "text": "function shipCount(fleet){\n\t\tvar count = 0, i = fleet.stacks.length;\n\t\twhile (i--) count += fleet.stacks[i].count;\n\t\treturn count;\n\t}", "title": "" }, { "docid": "f62f7f154e3466669866814588d58abe", "score": "0.5548278", "text": "function sizeOfFrame(\n frame,\n encoders\n) {\n encoders = encoders || _RSocketEncoding.Utf8Encoders;\n switch (frame.type) {\n case _RSocketFrame.FRAME_TYPES.SETUP:\n return sizeOfSetupFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.PAYLOAD:\n return sizeOfPayloadFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.ERROR:\n return sizeOfErrorFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.KEEPALIVE:\n return sizeOfKeepAliveFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.REQUEST_FNF:\n case _RSocketFrame.FRAME_TYPES.REQUEST_RESPONSE:\n return sizeOfRequestFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.REQUEST_STREAM:\n case _RSocketFrame.FRAME_TYPES.REQUEST_CHANNEL:\n return sizeOfRequestManyFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.REQUEST_N:\n return sizeOfRequestNFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.RESUME:\n return sizeOfResumeFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.RESUME_OK:\n return sizeOfResumeOkFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.CANCEL:\n return sizeOfCancelFrame(frame, encoders);\n case _RSocketFrame.FRAME_TYPES.LEASE:\n return sizeOfLeaseFrame(frame, encoders);\n default:\n (0, _invariant2.default)(\n false,\n 'RSocketBinaryFraming: Unsupported frame type `%s`.',\n (0, _RSocketFrame.getFrameTypeName)(frame.type)\n );\n }\n}", "title": "" }, { "docid": "817b6177ba36b11880bc09e20ee119fc", "score": "0.55411357", "text": "function size(n) {\n return n ? n.size : 0;\n}", "title": "" }, { "docid": "1482eca8608ac12514b9db8372e670a9", "score": "0.5539202", "text": "function Stack(){\n this.size = 0;\n this.stack = {};\n //console.log(this.stack);\n}", "title": "" }, { "docid": "f11474cb9440b835c1dd9d70aa78eab3", "score": "0.5528028", "text": "function Stack() {\n this.arr = [];\n this.size = function(){\n var counter = 0;\n this.arr.forEach(function(item,index){\n\t counter += 1;\n });\n return counter;\n },\n this.push = function(number){\n this.arr[this.size()] = number;\n return this.arr;\n },\n this.pop = function(){\n console.log(this.arr[this.size()-1]);\n this.arr = this.arr[0, this.size()-2];\n return this.arr;\n };\n}", "title": "" }, { "docid": "3f48889fa6709c5cbdeebd52e91b6e64", "score": "0.5525037", "text": "get size() {\n return this._node.numChildren();\n }", "title": "" }, { "docid": "8046fa34a40c941fa3675ee8f1120c94", "score": "0.55213654", "text": "function calculateSize() {\n let size = SIZE.META + SIZE.COMMAND + payload.length;\n if (envelope.contextId !== undefined) {\n size = size + SIZE.CONTEXT;\n }\n if (envelope.subSource !== undefined) {\n size = size + SIZE.SUB_CONTEXT;\n }\n if (header.length) {\n size = size + SIZE.HEADER + header.length;\n }\n return size;\n }", "title": "" }, { "docid": "b022e9723f5d1f453dcce8f30c6a8691", "score": "0.5517031", "text": "size(){\n let count = 1;\n if(this.head !== null){\n let currentNode = this.head;\n while(this.hasNext(currentNode)){\n count = count + 1;\n currentNode = this.getNextNode(currentNode);\n }\n return count;\n }\n return 0;\n }", "title": "" }, { "docid": "5d9a0be9cb1eb34627134488587f40e1", "score": "0.55116993", "text": "function size() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n}", "title": "" }, { "docid": "6bacf9b2cfc0e95f6272ef8b406926f8", "score": "0.5510669", "text": "get size() {\n let size = 0\n for (let i = 0; i < this.children.length; i++) size += this.children[i].size\n return size\n }", "title": "" }, { "docid": "6a302f6953b43130046639436542f56f", "score": "0.54935557", "text": "numberOfElements() {\n let running_size = 0;\n for (let sd in this.info) {\n running_size += sd.size;\n }\n return running_size;\n }", "title": "" }, { "docid": "22c1b70b0f77c14cf2cef5529639971a", "score": "0.5492073", "text": "size(node) {\n if (node == null)\n return 0;\n else\n return (this.size(node.left) + 1 + this.size(node.right));\n }", "title": "" }, { "docid": "6976b3a6e14dbfde094bb87607280ce3", "score": "0.54893786", "text": "size() {\n if (this.rear >= this.front) {\n //contiguous\n return this.rear - this.front + 1;\n } else {\n return this.maxSize - this.front + (this.rear + 1);\n }\n }", "title": "" }, { "docid": "85867bb138ce6af8c3a9f961682980fc", "score": "0.54839563", "text": "size() {\n this.count = this.count ?? (0, trie_util_1.countWords)(this.root);\n return this.count;\n }", "title": "" }, { "docid": "6843173fb493deb345f6be7dc67b430f", "score": "0.5478395", "text": "static get systemMemorySize() {}", "title": "" }, { "docid": "8598c057c85286c02f3dd491915683ba", "score": "0.5478265", "text": "size() {\n return this.queue.length;\n }", "title": "" }, { "docid": "f6756764d96ff066b3d3c81e1c0da6aa", "score": "0.54738957", "text": "getSize() {\n let temp = this.front;\n let count = 0;\n while (temp) {\n temp = temp.next;\n count++;\n }\n return count;\n }", "title": "" }, { "docid": "dbf9bc96f792dcba74c2032dd830c65f", "score": "0.5458809", "text": "getHeapUsage() {\n return this._client.send(\"Runtime.getHeapUsage\");\n }", "title": "" }, { "docid": "4966f341b55b8af7f73a05d195132533", "score": "0.54569405", "text": "getSize() {\n let currentNode = this.head;\n let size = 1;\n\n while (currentNode !== this.tail) {\n currentNode = currentNode.next;\n size++;\n }\n\n return size;\n }", "title": "" }, { "docid": "ab941c8e9a3adf8c74efe19d904f3534", "score": "0.5438267", "text": "get size() {\r\n return this._node.numChildren();\r\n }", "title": "" }, { "docid": "486b63f7d88660185ed0745eb1d7a90a", "score": "0.54354393", "text": "size() {\n\t\treturn this.#cons.length;\n\t}", "title": "" }, { "docid": "cb004c1d38f96ff8f7d8508c0ab09ab6", "score": "0.5433026", "text": "size() {\n if (this.head === null) { // Nothing to point to at start\n return 0;\n }\n var numNodes = 1;\n var curNode = this.head; // Start with first node\n while (curNode.next !== null) { // Loop while there are nodes to point to\n curNode = curNode.next; // Go to next node (if possible)\n numNodes++;\n }\n return numNodes;\n }", "title": "" }, { "docid": "a426778e6e8100ea535e317c2f900199", "score": "0.5428386", "text": "function peek(stack){\n return stack.top.data\n }", "title": "" }, { "docid": "4e1f8fe5d7a5b19caaccd36f38254b1f", "score": "0.5419231", "text": "get size()\n\t{\n\t\tif (!this._size) {\n\t\t\tthis._size = this.getTagValue(\"t:Size\", 0);\n\t\t}\n\t\treturn this._size;\n\t}", "title": "" }, { "docid": "f2e293558d553887f126f8fd17ec85c4", "score": "0.5409083", "text": "familySize (){\n let count = 1;\n for(let i = 0;i<this.children.length;i++){\n count ++\n }\n return count;\n }", "title": "" }, { "docid": "d9c9cc52f9264bdc559fd0930402d5cf", "score": "0.54033756", "text": "function Stack() {\n\n this.stack = new Array();\n\n Stack.prototype.push = function(value) {\n this.stack.push(value);\n }\n\n Stack.prototype.pop = function() {\n return this.stack.pop();\n }\n\n // @returns = true if stack is empty.\n Stack.prototype.empty = function() {\n return this.stack.length === 0;\n }\n}", "title": "" }, { "docid": "e71fed40d973c7b8572ea595bafc8edf", "score": "0.54032016", "text": "getSize(){\n return this.queue.length;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5402191", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5402191", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5402191", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "abd5fc8067ea1340721ce505ad180c0b", "score": "0.5397525", "text": "size() {\n let size = 0;\n while(this.current.next !== null) {\n this.current = this.current.next;\n size++;\n }\n if(this.current.next === null) {\n return size;\n }\n }", "title": "" }, { "docid": "82ab079c9802390e0860a5ecefa7a3e5", "score": "0.538526", "text": "size() {\n let size = 0;\n let node = this.head;\n\n while (node) {\n size++;\n node = node.next;\n }\n\n return size;\n }", "title": "" }, { "docid": "2d60fc11d0161bb254a130fe5d26265c", "score": "0.5384964", "text": "listSize() {\n let offset = this.bb.__offset(this.bb_pos, 4);\n return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;\n }", "title": "" }, { "docid": "7810fdca4a12ac750accf42ee7d49ee9", "score": "0.53800994", "text": "size() {\n let count = 0\n let node = this.head\n while (node) {\n count++\n node = node.next\n }\n return count\n }", "title": "" }, { "docid": "024736b6197e4504bbf45a42fb54a1ef", "score": "0.53711563", "text": "get size() {\r\n return this.payload.size;\r\n }", "title": "" }, { "docid": "8df2695aa5e5cf8edf6e81ccbaeef5a8", "score": "0.53664213", "text": "size () {\n let total = 1;\n\n if (this.isLeaf()) {\n return total;\n }\n\n util.each(this.getChildren(), (child) => {\n total += child.size();\n });\n\n return total;\n }", "title": "" }, { "docid": "39f9b74e9e6f5c41ef524a721c75040b", "score": "0.53555495", "text": "get size() {\n return this._queue.size;\n }", "title": "" }, { "docid": "39f9b74e9e6f5c41ef524a721c75040b", "score": "0.53555495", "text": "get size() {\n return this._queue.size;\n }", "title": "" }, { "docid": "f0e2230ac9765e295c9d87242d27b940", "score": "0.53478324", "text": "function getArraySize(arr) {\nreturn arr.length\n }", "title": "" }, { "docid": "4ca49c44af044011a5619a75e8f4fef0", "score": "0.5343191", "text": "get size() {\n return __privateGet(this, _size);\n }", "title": "" }, { "docid": "9d47d3965a8be01a58cbffc4f11df4c7", "score": "0.5343093", "text": "getSize() {\n let count = 0\n const queue = [this.head]\n const seenNodes = new Set()\n\n function searchEdges() {\n const node = queue.shift()\n if (seenNodes.has(node)) return\n\n seenNodes.add(node)\n count++\n\n node.edges.forEach(nextNode => {\n queue.push(nextNode)\n })\n }\n while (queue.length) {\n searchEdges()\n }\n return count\n }", "title": "" }, { "docid": "6098aeef21f3003ca57fc65d69ca56c3", "score": "0.5341194", "text": "length() {\n return this.#store.queue.length();\n }", "title": "" }, { "docid": "29dedee2e7f479e7d724fc97ef93131f", "score": "0.53397334", "text": "function getQueueCount(cache) {\n return Object.keys(cache.queue.queue).length;\n }", "title": "" }, { "docid": "a9cbd0a3bdb21552c576e83ddc19f6df", "score": "0.533565", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "3a011d6ba3bea0233d5d93509884ac54", "score": "0.533457", "text": "size() {\n return this.count - this.front;\n }", "title": "" }, { "docid": "487e583da930ed52d20b31b8ba04fc6e", "score": "0.5317824", "text": "function Stack() {\n this._stack = [];\n this._top = -1;\n}", "title": "" }, { "docid": "632db0357b98d53344384208ea60752f", "score": "0.52923536", "text": "size_of_list() {\n\t\tconsole.log(this.size);\n\t}", "title": "" }, { "docid": "b1afa3780b7255e021a917fa35bd57de", "score": "0.5268732", "text": "function numArgs() {\n return arguments.length\n}", "title": "" }, { "docid": "531484d483fe7a7ac3d74b0d81837e79", "score": "0.5268057", "text": "size() {\n let count = 0;\n let node = this.head;\n while (node) {\n count++;\n node = node.next;\n }\n return count;\n }", "title": "" } ]
6444ed9078d70f749b5814e8d8ae35e6
Onload various arrays if they do not exist or have no data within
[ { "docid": "678678dbbe55f9db76e030c306751448", "score": "0.0", "text": "function arrayOnload()\r\n{\r\n // If there are no preexisting arrays (club, gender, grade, message) with data it will create empty arrays, if false it will not\r\n if (localStorage.getItem(\"messageName\") === null)\r\n {\r\n localStorage.setItem(\"clubName\", \"[]\");\r\n localStorage.setItem(\"genderName\", \"[]\");\r\n localStorage.setItem(\"gradeName\", \"[]\");\r\n localStorage.setItem(\"messageName\", \"[]\");\r\n localStorage.setItem(\"dateName\", \"[]\"); \r\n }\r\n\r\n // Check if there is data within the array for added clubs, if not set empty array\r\n if (localStorage.getItem(\"addClub\") === null)\r\n {\r\n localStorage.setItem(\"addClub\", \"[]\"); \r\n }\r\n \r\n // Onload the new clubs inputed by the teacher if they choose to do so, adding options to the id=\"club\" <select> tag\r\n else\r\n {\r\n var option; \r\n var addClubList = JSON.parse(localStorage.getItem(\"addClub\"));\r\n var dropdown = document.getElementById(\"club\");\r\n for (var i = 0; i < addClubList.length; ++i)\r\n {\r\n dropdown[dropdown.length] = new Option(addClubList[i], addClubList[i]);\r\n }\r\n }\r\n nameEmailPrompt();\r\n}", "title": "" } ]
[ { "docid": "a1c751fd7fc9c474b1e59dd84c0a83f1", "score": "0.64553076", "text": "function checkForArrays() {\n if (!$scope.fields) {\n console.error('Fields Array is missing!');\n }\n if (!$scope.list) {\n console.error('Data Array is missing!');\n }\n }", "title": "" }, { "docid": "df4faa268c15e77595e528d66f1a02f3", "score": "0.5901856", "text": "function emptyData() {\n $('#error-container').addClass('hidden');\n $('#js-error-message').empty();\n $('.results').addClass('hidden');\n $('#results-list').empty();\n latArray.length = 0;\n lonArray.length = 0;\n nameArray.length = 0;\n gradeArray.length = 0;\n linkArray.length = 0;\n videosObj.length = 0;\n}", "title": "" }, { "docid": "255a1d64fbb57aa1505ccd3e083fe061", "score": "0.57665575", "text": "function check_load_complete ()\n\t\t{\n\t\t\tif ( $this.length == num_preloaded_images )\n\t\t\t{\n\t\t\t\toptions.oncomplete(num_preloaded_images);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5913b3da134fc24bdcaedf66fe03fe30", "score": "0.57501274", "text": "function doesNeedRefresh() {\n for(var i = 0; i < haveArraysChanged.length; i++) {\n if(haveArraysChanged[i] && arraysUsedObj[currentPage][i]) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "f540433f9c9f03f9536b3dd081314e6d", "score": "0.56908476", "text": "function populateArrays() {\n //Hero Data\n for (var i = 0; i < heroKeys.length; i++) {\n //Static Data\n heroData[i] = [];\n var impHeroData = impHer[heroKeys[i]];\n heroData[i][\"name\"] = impHeroData.name;\n heroData[i][\"baseCost\"] = impHeroData.baseCost;\n heroData[i][\"id\"] = impHeroData.id;\n if (heroData[i][\"id\"] != 1) { //Calculates base DPS\n heroData[i][\"baseDPS\"] = calculateBaseDPS(heroData[i][\"baseCost\"], heroData[i][\"id\"]);\n } else {\n heroData[i][\"baseDPS\"] = 0;\n }\n heroData[i][\"baseClickDamage\"] = impHeroData.baseClickDamage;\n //Dynamic Data\n heroData[i][\"level\"] = 0;\n heroData[i][\"gilded\"] = 0;\n heroData[i][\"currentDPS\"] = 0;\n heroData[i][\"nextCost\"] = 0;\n heroData[i][\"nextDPSChange\"] = 0;\n heroData[i][\"efficiency1\"] = 0;\n heroData[i][\"efficiency4x\"] = 0;\n heroData[i][\"efficiency10x\"] = 0;\n heroData[i][\"levelMultiplier\"] = 1;\n heroData[i][\"upgradeMultiplier\"] = 1;\n heroData[i][\"currentClickDamge\"] = 0;\n heroData[i][\"upgrades\"] = [];\n }\n //Upgrade Data\n for (var i = 0; i < upgradeKeys.length; i++) {\n //Static Data\n upgradeData[i] = [];\n var impUpgradeData = impUpg[upgradeKeys[i]];\n upgradeData[i][\"id\"] = impUpgradeData.id;\n upgradeData[i][\"heroID\"] = impUpgradeData.heroId;\n upgradeData[i][\"name\"] = impUpgradeData.name;\n upgradeData[i][\"level\"] = impUpgradeData.heroLevelRequired;\n upgradeData[i][\"type\"] = impUpgradeData.upgradeFunction;\n upgradeData[i][\"upgradeParams\"] = splitParams(impUpgradeData.upgradeParams);\n upgradeData[i][\"cost\"] = calculateUpgradeCost(upgradeData[i][\"level\"], upgradeData[i][\"heroID\"]);\n heroData[upgradeData[i][\"heroID\"] - 1][\"upgrades\"].push(i);\n //Dynamic Data\n upgradeData[i][\"owned\"] = false;\n upgradeData[i][\"totalCost\"] = 0;\n upgradeData[i][\"DPSChange\"] = 0;\n upgradeData[i][\"efficiency\"] = 0;\n }\n //Achievement Data\n for (var i = 0; i < achievKeys.length; i++) {\n //Static Data\n achievData[i] = [];\n var impAchievData = impAch[achievKeys[i]];\n achievData[i][\"name\"] = impAchievData.name;\n achievData[i][\"id\"] = impAchievData.id;\n achievData[i][\"type\"] = impAchievData.rewardFunction;\n achievData[i][\"rewardParams\"] = splitParams(impAchievData.rewardParams);\n achievData[i][\"checkFunction\"] = impAchievData.checkFunction;\n achievData[i][\"checkParams\"] = impAchievData.checkParams;\n achievData[i][\"description\"] = impAchievData.description;\n //Dynamic Data\n achievData[i][\"owned\"] = false;\n achievData[i][\"DPSChange\"] = 0;\n achievData[i][\"efficiency\"] = 0;\n }\n //Ancient Data\n for (var i = 0; i < ancientKeys.length; i++) {\n //Static Data\n ancientData[i] = [];\n var impAncientData = impAnc[ancientKeys[i]];\n ancientData[i][\"name\"] = impAncientData.name;\n ancientData[i][\"id\"] = impAncientData.id;\n ancientData[i][\"maxLevel\"] = impAncientData.maxLevel;\n ancientData[i][\"levelCostFormula\"] = impAncientData.levelCostFormula;\n ancientData[i][\"levelAmountFormula\"] = impAncientData.levelAmountFormula;\n //Dynamic Data\n ancientData[i][\"level\"] = 0;\n ancientData[i][\"nextCost\"] = 0;\n ancientData[i][\"DPSChange\"] = 0;\n }\n}", "title": "" }, { "docid": "9c52d0f6665f38849a97291d4c9ae464", "score": "0.56464326", "text": "async function loadInitialData() {\n let { data } = await API.getUserbyId()\n setFormObject({\n firstName: data.firstName,\n lastName: data.lastName,\n email: data.email,\n bio: data.bio ? data.bio : '',\n location: data.location ? data.location : '',\n tags: data.tags ? data.tags.map(tag => tag.tagName) : [],\n stateLocation: data.stateLocation ? data.stateLocation : '',\n adventureImageUrl: data.adventureImageUrl\n })\n //pre-load tags if some have already been chosen\n if (data.tags) {\n const x = data.tags.map(tag => tag.tagName)\n setTagArr(x)\n }\n }", "title": "" }, { "docid": "4b90cfeb96664e6a59a88a0ad7ee5eca", "score": "0.5575438", "text": "function initializeArrays() {\n\n function generateDisplayPointsMap ( pTemplates ) {\n\n forEachAttribute( pTemplates, function( lId, pTemplate ) {\n\n pTemplate.displayPointsMap = {};\n for ( var i = 0; i < pTemplate.displayPoints.length; i++ ) {\n pTemplate.displayPointsMap[ pTemplate.displayPoints[ i ].id ] = pTemplate.displayPoints[ i ];\n }\n\n });\n\n }; // generateDisplayPointsMap\n\n // Initialize attributes which might not be initialized because they are missing in the communication\n for ( var i in gTypes ) {\n if ( gTypes.hasOwnProperty( i )) {\n\n gTypes[ i ].id = i;\n simpleExtend( gTypes[ i ], {\n parentId: null,\n isOneToOneRelation: false,\n isPageComponent: false,\n isSharedComponent: false,\n refByProperties: [],\n childComponentTypes: []\n });\n gComponents[ i ] = {};\n\n for ( var j in gTypes[ i ].properties ) {\n if ( gTypes[ i ].properties.hasOwnProperty( j )) {\n\n gTypes[ i ].properties[ j ].propertyId = j;\n simpleExtend( gTypes[ i ].properties[ j ], {\n defaultValue: \"\",\n helpText: \"\",\n dependingOn: [],\n refByChilds: [],\n refByDependingOn: []\n });\n }\n }\n }\n }\n\n for ( var i in gProperties ) {\n if ( gProperties.hasOwnProperty( i )) {\n\n gProperties[ i ].id = i;\n simpleExtend( gProperties[ i ], {\n helpText: \"\",\n hasPlSqlCheck: false,\n isQueryOnly: false,\n isInternal: false,\n isSearchable: true,\n dataTypes: {},\n refByComponentTypes: []\n });\n\n // keep in sync with IF in wwv_flow_property_dev.emit_static_data and emit_plugins\n if ( !gProperties[ i ].hasOwnProperty( \"uiTypes\" )) {\n gProperties[ i ].uiTypes = [ UI_TYPE.DESKTOP, UI_TYPE.JQM_SMARTPHONE ];\n }\n\n // Create a lookup map for our static LOVs\n if ( gProperties[ i ].hasOwnProperty( \"lovValues\" )) {\n gProperties[ i ].lovValuesMap = {};\n for ( var j = 0; j < gProperties[ i ].lovValues.length; j++ ) {\n gProperties[ i ].lovValuesMap[ gProperties[ i ].lovValues[ j ].r ] = j;\n }\n }\n\n }\n }\n\n // Generate a lookup map for our events\n forEachAttribute( gEvents, function( pAttr, pEvent ) {\n\n if ( pAttr !== \"lookupMap\" ) {\n for ( var i = 0; i < pEvent.length; i++ ) {\n gEvents.lookupMap[ pEvent[ i ].r ] = pEvent[ i ];\n }\n }\n\n });\n\n // Generate a lookup map for our template display points\n forEachAttribute( gSharedComponents.themes, function( pThemeId, pTheme ) {\n\n generateDisplayPointsMap ( pTheme.templates[ COMP_TYPE.PAGE_TEMPLATE ]);\n generateDisplayPointsMap ( pTheme.templates[ COMP_TYPE.REGION_TEMPLATE ]);\n\n });\n\n }", "title": "" }, { "docid": "f60f3fbbf7b05c635919d3fc46ad56fc", "score": "0.5529895", "text": "doCheckExistenceData () {\n //after loading check if we have some ignored requests\n var temp = this._load_count;\n var last = this._feed_last;\n this._load_count = false;\n if (typeof temp ==\"object\" && (temp[0]!=last[0] || temp[1]!=last[1])) {\n this.data.feed.apply(this, temp);\t//load last ignored request\n }\n\n }", "title": "" }, { "docid": "5c0aa9248d4e8a108cb9a860ee655524", "score": "0.5524746", "text": "function loadData(){\n\tvar params = {\n\t\t\t\t\taction : function(){\n\t\t\t\t\t\tif(settings.type == 'documents'){\n\t\t\t\t\t\t\treturn 'getAllDocsList'\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn 'getAllProjectsList'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\n\t $.get(\"getInfo\", params, function(data){\n\t \t\treferenceArray = {}\n\t\t\t\treferenceArray = data;\n\t\t\t\t\n\t\t\t\t//this portion is just done in the begining\n\t\t\t\tif(!dataLoaded){\n\t\t\t\t\tdynamicArray = filterData();\n\t\t\t\t\tupdateView();\n\t\t\t\t\tdataLoaded = true;\n\t\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "ab724d3838de3781190482a76226c338", "score": "0.54684967", "text": "function SamplesLoaded(){\n\tcache = {}; // Clear cache\t\n\tsamples = {};\n\tfor (var chr in expData) {\n\t\tfor (var f in expData[chr]) {\n\t\t\texpData[chr][f].map(function(e){\n\t\t\t\tif (!samples[f]) samples[f] = [];\n\t\t\t\tsamples[f].push(e[0]);\n\t\t\t});\n\t\t}\n\t}\n\n\tif (location.hash == '#demo' || location.hash == '') location.hash = '#general';\n\n\t// Disable some function when number of file is lower than needed\n\tif (expNames.length > 0) $('.visible.type .btn').removeClass(\"disabled\");\n\tif (expNames.length > 1) $('.visible.mode .btn').removeClass(\"disabled\");\n\tif (expNames.length > 2) $('.samples-nav-pane .comparision').removeClass(\"disabled\");\n\tif (expNames.length > 3) $('.samples-nav-pane .showtree').removeClass(\"disabled\");\n\n\tMsg.Hide();\n\tRoute();\n}", "title": "" }, { "docid": "cab9478f2418900fdba21e8ec3a7b3a0", "score": "0.54360074", "text": "function loadIncompleted(data) {\n const incompleteData = [];\n for (let i = 0; i < data.length; i++) {\n if (!data[i].completed) {\n incompleteData.push(data[i]);\n }\n };\n // passes it to our loadCards\n loadCards(incompleteData, \"Incomplete\");\n }", "title": "" }, { "docid": "ddaa1b2eaf06d7c004aa7bc09c0ba178", "score": "0.54266644", "text": "function init_set_data_attributes(){\n\n console.log(\"Setting up data attributes!\");\n //store all images into an array\n all_img = document.getElementsByTagName(\"img\");\n //store all title text into an array\n all_titles = document.querySelectorAll(\"h1,h2,h3\");\n all_list_items = document.querySelectorAll(\"li\");\n all_paragraphs = document.querySelectorAll(\"p\");\n all_sources = document.querySelectorAll(\"source\");\n if(all_sources.length > 1){\n console.log(\"we have sources!!!!!\");\n g_sources_exist = true;\n }\n //set initial data attributes for all images\n set_img_data(true);\n //set initial data attributes for all text\n set_text_data(true);\n\n}", "title": "" }, { "docid": "b3cc598fb1d80d6dd90f85b45c90d6c7", "score": "0.5404752", "text": "function onLoad(){\n\tgetItemType();\n\thideUnwantedMainStatistics();\n\tclearAllInputs();\n\tclearAllSetInputs();\n\t\n\tloadData();\n\tloadSets();\n\t\n}", "title": "" }, { "docid": "ce4e1b0d47b28370c4fe89f33caa9023", "score": "0.5380421", "text": "function populateDataset() {\n let local_data = [];\n if (global_daysMap['fri']) {\n local_data = all_dataFri;\n }\n if (global_daysMap['sat']) {\n local_data = violin_dataset_join(all_dataSat, local_data)\n }\n if (global_daysMap['sun']) {\n local_data = violin_dataset_join(all_dataSun, local_data)\n }\n all_dataActive = local_data;\n if (undefined == all_dataActive) { all_dataActive = []; }\n}", "title": "" }, { "docid": "1e180762fb635f4c7e658cf244f78b08", "score": "0.53624475", "text": "function _setSrcs() {\n var i;\n // browser capability check\n if (checkType === 'really-old') {\n elsLength = els.length;\n for (i = 0; i < elsLength; i++) {\n if (els[i]) {\n _updateEl(els[i]);\n _removeDataAttrs(els[i]);\n }\n }\n els = [];\n } else if (checkType === 'old') {\n // debounce checking\n if (frameCount === options.maxFrameCount) {\n // update cache of this for the loop\n elsLength = els.length;\n for (i = 0; i < elsLength; i++) {\n // check if this array item exists, hasn't been loaded already and is in the viewport\n if (els[i] && els[i].lazyloaded === undefined && _elInViewport(els[i])) {\n // cache this array item\n var thisEl = els[i];\n // set this array item to be undefined to be cleaned up later\n els[i] = undefined;\n // give this element a property to stop us running twice on one thing\n thisEl.lazyloaded = true;\n // add an event listener to remove data- attributes on load\n thisEl.addEventListener('load', _loaded, false);\n // update\n _updateEl(thisEl);\n }\n }\n // clean up array\n for (i = 0; i < elsLength; i++) {\n if (els[i] === undefined) {\n els.splice(i, 1);\n }\n }\n // reset var to decide if to continue running\n elsLength = els.length;\n // will shortly be set to 0 to start counting\n frameCount = -1;\n }\n\n // run again? kill if not\n if (elsLength > 0) {\n frameCount++;\n frameLoop = window.requestAnimationFrame(_setSrcs);\n }\n } else if (checkType === 'new') {\n observer = new IntersectionObserver(_intersection, {\n rootMargin: options.rootMargin,\n threshold: options.threshold,\n });\n elsLength = els.length;\n for (i = 0; i < elsLength; i++) {\n if (els[i] && els[i].lazyloaded === undefined) {\n observer.observe(els[i]);\n }\n }\n }\n }", "title": "" }, { "docid": "f7765c2f29f064bd9fc5f20860226206", "score": "0.5355464", "text": "function missingdata(){\n\t\tif (menu_status.provider === \"null\" || menu_status.budget=== \"null\" || menu_status.circle === \"null\"){\n\t\t\treturn true\n\t\t}\n\t}", "title": "" }, { "docid": "ff6a9d364ebd8f3c3e1a08e368564f7d", "score": "0.53379756", "text": "function populateCityInfo(){\nfor (var i = 0; i < majorCitiesArray.length; i++) {\n var timeToPopulate = cityInfoArray[i].cityTime\n // ----------------error resolution for LAX time not populating---------------------------\n if (timeToPopulate === undefined) {\n timeToPopulate = cityInfoArray[i].cityTime;\n $(`#city${i + 1}`).html(`\n <p>${majorCitiesArray[i]}</p>\n <p>Time: <b>big oof</b></p>`);\n }\n // ---------------------------------------------------------------------------------------\n else{\n $(`#city${i+1}`).html(`\n <p>${majorCitiesArray[i]}</p>\n <p>Time: <b>${timeToPopulate}</b></p>`);\n }\n}}", "title": "" }, { "docid": "4ad383ead3411d2475ccf1646182a584", "score": "0.5327516", "text": "function loadData() {\n // STAND\n loadStandData();\n // PIT\n loadPitData();\n // IMAGES\n loadImageData();\n // NOTES\n loadNotesData();\n}", "title": "" }, { "docid": "f2393525b92650712687ed3ddffe8bea", "score": "0.5327071", "text": "function imagesLoaded( data, that ){\n\t\t\tthat.imageSegments = [];\n\t\t\tthat.imageSegments = data;\n\t\t\tthat.initDOM();\n\t\t}", "title": "" }, { "docid": "8bccc8907e408f097d2a77099bd7edd9", "score": "0.5301896", "text": "function dataLoaded( g ) {\n if( g == \"bc\" ) {\n factsLoaded = true;\n // End Group 0 spinner(s)\n for( var i = 0; i < spinDiv.length; i++ ) {\n if( spinner[i] != null && spinGrp[i] == \"bc\" ) {\n spinner[i].stop(spinDiv[i]);\n }\n }\n }\n if( g == \"ii\" ) {\n issueLoaded = true;\n // End Group 1 spinner(s)\n for( var i = 0; i < spinDiv.length; i++ ) {\n if( spinner[i] != null && spinGrp[i] == \"ii\" ) {\n spinner[i].stop(spinDiv[i]);\n }\n }\n }\n if( factsLoaded && issueLoaded ) {\n $(\".toggle-hidden\").toggleClass(\"hidden\");\n $(\"#lastUpdate\").livestamp(new Date());\n }\n}", "title": "" }, { "docid": "0e9f9183e8b6b23d0355e1fce3878604", "score": "0.52878034", "text": "loadIfNotAlready()\n\t{\n\n\t\tif(this.state.isLoaded === false)\n\t\t{\n\n\t\t\tthis.loadData();\n\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "bfdf8564be14de221bc8b41ae44dc5a4", "score": "0.5263736", "text": "function lazyLoadOthers(){\n var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0];\n\n //quitting when it doesn't apply\n if (!options.lazyLoading || !hasAutoHeightSections){\n return;\n }\n\n //making sure to lazy load auto-height sections that are in the viewport\n $(SECTION_SEL + ':not(' + ACTIVE_SEL + ')').forEach(function(section){\n if(isSectionInViewport(section)){\n lazyLoad(section);\n }\n });\n }", "title": "" }, { "docid": "b35499b3c5effa35cdd1ec89c416b93a", "score": "0.52582085", "text": "setAllDataNotFound(){\n this.setState({\n indicatorsDataTreeProduction:[{id:0,name:Defaults.DataNotAvailable}],\n indicatorsDataCarbon:[{id:1,name:Defaults.DataNotAvailable}],\n indicatorsDataCollectionsProducts:[{id:2,name:Defaults.DataNotAvailable}],\n indicatorsDataDiversity:[{id:3,name:Defaults.DataNotAvailable}],\n indicatorsDataOthers:[{id:4,name:Defaults.DataNotAvailable}]});\n }", "title": "" }, { "docid": "2faafb02a18733ddc1d38096b286c1d2", "score": "0.52580076", "text": "function filesLoaded() { \n for (i = 0; i < sample_data.getRowCount(); i++) {\n if (sampled_track_audio[i].isLoaded() == false) {\n return false;\n }\n }\n \n for (i = 0; i < lauryn_sampled_clips_data.getRowCount(); i++) {\n if (original_track_audio[i].isLoaded() == false) {\n return false;\n }\n } \n return true;\n}", "title": "" }, { "docid": "40f1644bde7fcde0397dba9b89820515", "score": "0.52485573", "text": "function emptyArrays() {\n textArea.value = \"\";\n xyArrayData = [];\n pcgArrayData = [];\n pcgYArrayData = [];\n yArrayData = [];\n lpfArray = [];\n qBegArray = [];\n sEndArray = [];\n xyArraySpikes = [];\n sNoiseArray = [];\n shannArr = [];\n newSNoiseArray = [];\n}", "title": "" }, { "docid": "24c53a620f5df16faecada4a9a56dc98", "score": "0.5245314", "text": "function dataLoaded() {\n regenerate();\n if (window.is_mobile === false) {\n window.initialZoom();\n }\n else {\n window.mobileAdjustTitle();\n }\n }", "title": "" }, { "docid": "dce938009e37bee4e3118e831f9d3f20", "score": "0.52408427", "text": "async function initialLoad () {\n const auxAllCountriesSummary = await appHelper.fetchSummaryData()\n setAllCountriesSummary(auxAllCountriesSummary)\n\n const auxAllCountriesTimelineData = await appHelper.fetchTimelineData()\n setAllCountriesTimelineData(auxAllCountriesTimelineData)\n }", "title": "" }, { "docid": "3cd34d5f7e57ab6d2a314a862d938217", "score": "0.5238825", "text": "function fillArrayWithValidLTGtitles(arrayParam) {\n if (global.GlobalcacheLTGsArray !== null) {\n global.GlobalcacheLTGsArray.forEach(function (item) {\n if (\n checkHasWords(item.title) === true &&\n item.shortTermGoals !== null &&\n checkMinimumOneNonemptySTGTitle(item.shortTermGoals)\n ) {\n arrayParam.push(item.title);\n }\n });\n }\n}", "title": "" }, { "docid": "a1fec193dbad09966135b3dbcbbd0762", "score": "0.5228641", "text": "function arraySetup(){\r\nstartArray = new Array();\r\nstartArray[1] = new arrayValues(parentLyr);\r\nparentArray = new Array();\r\nparentArray[1] = new arrayValues(child1Lyr);\r\nparentArray[2] = new arrayValues(child2Lyr);\r\nparentArray[3] = new arrayValues(child3Lyr);\r\nparentArray[4] = new arrayValues(child4Lyr);\r\nparentArray[5] = new arrayValues(child5Lyr);\r\nparentArray[6] = new arrayValues(child6Lyr);\r\nparentArray[7] = new arrayValues(child7Lyr);\r\nvisibilitySetup();}", "title": "" }, { "docid": "6d05d04a39006a70c23a3c7dd1011acd", "score": "0.52200854", "text": "function populate_global_arrays() {\n if (localStorage.getItem(\"HP\") === null) {\n localStorage.setItem(\"HP\", JSON.stringify({ 0: [] }));\n document.querySelector(\"#FAQ\").click();\n console.log('HP created');\n }\n if (localStorage.getItem(\"LP\") === null) {\n localStorage.setItem(\"LP\", JSON.stringify({ 0: [] }));\n console.log('LP created');\n }\n if (localStorage.getItem(\"C\") === null) {\n localStorage.setItem(\"C\", JSON.stringify({ 0: [] }));\n console.log('C created');\n }\n if (localStorage.getItem(\"A\") === null) {\n localStorage.setItem(\"A\", JSON.stringify({ 0: [] }));\n console.log('A created');\n }\n\n high_priority_array = JSON.parse(localStorage.getItem(\"HP\"))[0];\n low_priority_array = JSON.parse(localStorage.getItem(\"LP\"))[0];\n completed_array = JSON.parse(localStorage.getItem(\"C\"))[0];\n archive_array = JSON.parse(localStorage.getItem(\"A\"))[0];\n\n //If search mode is on, filter global array to meet filter queries\n if (filter_toggle == true) {\n let bullet;\n let bullet_date;\n for (let i = low_priority_array.length - 1; i >= 0; i--) {\n bullet = low_priority_array[i];\n bullet_date = new Date(bullet.deadline.substring(0, 4), bullet.deadline.substring(5, 7), bullet.deadline.substring(8, 10));\n if ((bullet_date < filter_start_date && filter_start_date != null) || (bullet_date > filter_end_date && filter_end_date != null) || (bullet.labels != filter_label && filter_label != null)) {\n low_priority_array.splice(i, 1);\n }\n }\n for (let i = high_priority_array.length - 1; i >= 0; i--) {\n bullet = high_priority_array[i];\n bullet_date = new Date(bullet.deadline.substring(0, 4), bullet.deadline.substring(5, 7), bullet.deadline.substring(8, 10));\n if ((bullet_date < filter_start_date && filter_start_date != null) || (bullet_date > filter_end_date && filter_end_date != null) || (bullet.labels != filter_label && filter_label != null)) {\n high_priority_array.splice(i, 1);\n }\n }\n for (let i = completed_array.length - 1; i >= 0; i--) {\n bullet = completed_array[i];\n bullet_date = new Date(bullet.deadline.substring(0, 4), bullet.deadline.substring(5, 7), bullet.deadline.substring(8, 10));\n if ((bullet_date < filter_start_date && filter_start_date != null) || (bullet_date > filter_end_date && filter_end_date != null) || (bullet.labels != filter_label && filter_label != null)) {\n completed_array.splice(i, 1);\n }\n }\n }\n}", "title": "" }, { "docid": "0478788eba9e0e292a1e41b8e10a6a72", "score": "0.52183884", "text": "function dataCheck() {\n let nrOfCorrectRaces = 0;\n for (let i = 0; i < raceInfo.length; i++) {\n if (raceInfo[i].competitors.length === raceInfo[i].position.length) {\n nrOfCorrectRaces++;\n }\n else {\n console.error(\"Błędny index \" + i + \" Rok \" + raceInfo[i].year + \" rajd \" + raceInfo[i].race)\n }\n }\n }", "title": "" }, { "docid": "fc4ee958a84ffbcd202c1a59f9280c2d", "score": "0.5216828", "text": "function checkAllFilesLoaded(){\r\n\t\t\t\r\n\t\t\tif(isAllFilesLoaded == true)\r\n\t\t\t\treturn(false);\r\n\t\t\t\r\n\t\t\tif(!jQuery.isEmptyObject(arrHandles))\r\n\t\t\t\treturn(false);\r\n\t\t\t\r\n\t\t\tisAllFilesLoaded = true;\r\n\t\t\t\r\n\t\t\tif(!funcOnLoaded)\r\n\t\t\t\treturn(false);\r\n\t\t\t\r\n\t\t\tfuncOnLoaded();\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "bf9be8be80a604837a539743f0b18b38", "score": "0.5189347", "text": "function loadAnomaliesData(parsedArray) {\r\n\tlet loadedItems = [];\r\n\r\n\tif(Array.isArray(parsedArray) ) {\r\n\t\tfor (let i = 0; i < parsedArray.length; i++) {\r\n\t\t\tloadAnomalie(parsedArray[i], loadedItems);\r\n\t\t}\r\n\t}\r\n\r\n\taItems = new vis.DataSet(loadedItems);\r\n}", "title": "" }, { "docid": "b9ddced1dc42cb7457567c6cd5d482e8", "score": "0.5177802", "text": "function tvReady() {\n // reset level counters\n brokenCount = 0;\n completeCount = 0;\n\n for (var i = 0; i < tvSets.length; i++) {\n tvSets[i].init();\n }\n }", "title": "" }, { "docid": "1ae2eaaab7e9281503e252029359b5fb", "score": "0.51745087", "text": "function loadYearsData() {\n Papa.parse(\"../data/sector-needs/data/ar/data.csv\", {\n download: true,\n header: true,\n skipEmptyLines: true,\n dynamicTyping: true,\n complete: function(result) {\n var rows = result.data;\n for (var i = 0; i < rows.length; i++) {\n var year = rows[i].year;\n switch (year) {\n case 'hno_2016':\n hno_2016_data.push(rows[i]);\n break;\n case 'hno_2017':\n hno_2017_data.push(rows[i]);\n break;\n case 'pmr_2017':\n pmr_2017_data.push(rows[i]);\n break;\n case 'hno_2018':\n hno_2018_data.push(rows[i]);\n break;\n\t\t\t\t\tcase 'pmr_2018':\n pmr_2018_data.push(rows[i]);\n break;\n\t\t\t\t\tcase 'hno_2019':\n hno_2019_data.push(rows[i]);\n break;\n }\n }\n var years = [hno_2016_data, pmr_2017_data, hno_2017_data, hno_2018_data, pmr_2018_data, hno_2019_data];\n for (var c = 0; c < years.length; c++) {\n if (1 > years[c].length) {\n $(\"#sector-needs-append\").empty();\n $(\"#sector-needs-timeline\").empty();\n $(\"#pin-asterisk\").empty();\n $(\"#needs-sector-name\").text(\"ERROR! a year data is missing\");\n $(\"#needs-sector-name\").removeClass('ocha-dark-blue-text');\n $(\"#needs-sector-name\").addClass('red-text');\n $.fn.fullpage.reBuild();\n return false;\n }\n }\n activeYear = 'hno_2019';\n activeYearData = hno_2019_data;\n activeYearColumnCategories = needs_column_categories_2018;\n activeSectorName = \"protection\";\n activeSectorTitle = \"الحماية\";\n activeSectorData = activeYearData.filter(function(obj) {\n return obj.sector == activeSectorName;\n })[0];\n activateNeedsSector('needs-protection');\n initiateNeedsMap(activeYear, hno_2018_classes, window['needs_protection'], 'Protection', 'Protecti_1');\n pieData = needsPieData(activeSectorData);\n initiateNeedsPie(pieData);\n columnData = needsColumnData(activeSectorData, activeYearColumnCategories);\n initiateNeedsColumn(columnData, activeYearColumnCategories);\n updateNeedsInputs(activeSectorData, activeSectorTitle);\n setCurrentSector(activeSectorName, activeSectorTitle);\n },\n error: function(err, file) {\n $(\"#sector-needs-append\").empty();\n $(\"#sector-needs-timeline\").empty();\n $(\"#pin-asterisk\").empty();\n $(\"#needs-sector-name\").text(\"ERROR! Data file can't be loaded\");\n $(\"#needs-sector-name\").removeClass('ocha-dark-blue-text');\n $(\"#needs-sector-name\").addClass('red-text');\n $.fn.fullpage.reBuild();\n }\n });\n}", "title": "" }, { "docid": "dfe17cc98c040de36eff77455eec1e62", "score": "0.51637965", "text": "function forceLoadAll() {\n checkLazyElements(true);\n }", "title": "" }, { "docid": "cf0fc143444428fd51eed2f4d79c88fd", "score": "0.5162881", "text": "function emptyArray (data) {\n\t return array(data) && data.length === 0;\n\t }", "title": "" }, { "docid": "19b631c5bb1afa5c51469819474c9882", "score": "0.5158812", "text": "function resultOnLoad() {\n\tif ($v(\"totalLines\") > 0) {\n\t\tloadRowSpans();\n\t}\n}", "title": "" }, { "docid": "78532b24d0edd3b3eddcbccecdb2f1cc", "score": "0.5149124", "text": "function initializeData() {\n if(giftPresent) {\n getGift();\n\n titleField.value = currentGift.title;\n if (currentGift.link == \"\")\n linkField.placeholder = \"No Link Was Provided\";\n else\n linkField.value = currentGift.link;\n if (currentGift.where == \"\")\n whereField.placeholder = \"No Location Was Provided\";\n else\n whereField.value = currentGift.where;\n if (currentGift.description == \"\")\n descField.placeholder = \"No Description Was Provided\";\n else\n descField.value = currentGift.description;\n }\n }", "title": "" }, { "docid": "cbf6b88c0701450b671871b3a9cead98", "score": "0.5147027", "text": "function jsonSpecials() { \r\n \t\tvar autos = [];\r\n\t\t//check if we have our global vehicle array available\r\n\t\tif(typeof vehicles !==\"undefined\"){\r\n \t\t\t autos = vehicles.autos;\r\n\t \t}\r\n\r\n\t \tif(typeof autos !== \"undefined\"){\r\n\t\t \t$(\"#unit-slider\").append(\"<div>\");\r\n\t \t\tpopulateFlexSlider(autos);\r\n\t \t}else{\r\n \t\t\t//if array is empty, hide internet spcials header\r\n \t\t\t$(\"#specials-label\").addClass('no-show');\r\n\t \t}\r\n\t }", "title": "" }, { "docid": "3c1f774d5501e9486f90918e8a1188a7", "score": "0.5143744", "text": "function updateStorageArrays () {\n //clearing the custom array so they can be \"refilled\" with what is in the local storage\n customOneArray = [];\n customTwoArray = [];\n for (var i = 1; i <= 6; i++) {\n if (siteStorage[\"name\" + i] !== \"\" && siteStorage[\"name\" + i] !== undefined) {\n var pair = [];\n pair.push(siteStorage[\"name\" + i]);\n pair.push(siteStorage[\"url\" + i]);\n if (i < 4) {\n customOneArray.push(pair);\n } else {\n customTwoArray.push(pair);\n }\n }\n }\n }", "title": "" }, { "docid": "0fb06da7d8cc89e067a32ce155a6f69f", "score": "0.5139576", "text": "function loadAllImages(){\n if(vm.images.length != IMAGES.length){\n while(IMAGES.length!=loadMoreImages());\n }\n }", "title": "" }, { "docid": "7525771da0423db312dde128ca2dc795", "score": "0.5136249", "text": "function handleArrays(res){\n res.tasks.forEach(function(task){\n setTask(task);\n });\n res.notifications.forEach(function(notification){\n setNotification(notification);\n });\n holidayArray = res.holidays;\n meetingArray = res.meetings;\n milestoneArray = res.milestones;\n timeArray = res.times;\n\n refreshCalendar();\n }", "title": "" }, { "docid": "a387b01e0184fe8e5de3a5ca52ab7946", "score": "0.5134881", "text": "function checkRender(){\n\t//tiles\n\tif(!tilesReady){\n\t tiles.onload = function(){\n\t\ttilesReady = true;\n\t };\n\t}\n\t\n\tif(!test_tilesReady){\n\t testTiles.onload = function(){\n\t\ttest_tilesReady = true;\n\t };\n\t}\n\n\t//nat\n\tif(!nat.ready){\n\t nat.img.onload = function(){nat.ready = true;}\n\t}\n\n\t//npcs\n\tfor(var a=0;a<npcs.length;a++){\n\t if(!npcs[a].ready){\n\t\tif(npcs[a].img.width !== 0){\n\t\t\tnpcs[a].ready = true;\n\t\t}\n\t }\n\t}\n\n\t//buildings\n\tfor(var b=0;b<buildings.length;b++){\n\t if(!buildings[b].ready){\n\t\tif(buildings[b].img.width !== 0){\n\t\t\tbuildings[b].ready = true;\n\t\t}\n\t }\n\t}\n\n\t//item\n\tfor(var i=0;i<items.length;i++){\n\t if(!items[i].ready){\n\t\tif(items[i].img.width !== 0){\n\t\t\titems[i].ready = true;\n\t\t}\n\t }\n\t}\n}", "title": "" }, { "docid": "8ed52655ba614963359f511baf294b2b", "score": "0.5127769", "text": "function checkData() {\n let totalCount = 0;\n \n for (let i = 0; i < endPoints.length; i++) {\n totalCount += dataCounts[endPoints[i]]; \n }\n \n if (allData.length === totalCount) {\n makeGraphs(); \n }\n}", "title": "" }, { "docid": "ca3cec146854bf944e4291042301bec0", "score": "0.51273215", "text": "function draw_empty_areas_full(){\n\t for(i=0; i<7; i++){\n\t\t var targetArray = \"day\"+i;\n\t\t var targetEmptyArray = \"emp\"+i;\n\t\t if (this[targetArray].length > 0) draw_empty_areas(this[targetArray], this[targetEmptyArray], i); \n\t }\n }", "title": "" }, { "docid": "ba10b19b537cc933898e652fec7f4441", "score": "0.512669", "text": "function onDataLoaded(error){\n\tvar filesRead = arguments.length - 1;//(0th argument is error and should be null)\n\tvar totalFilesRead = filesRead;\n\tvar currentYear = \"2008\";\n\t//console.log(filesRead);\n\n\t//make a total object\n\tvar totalWins = {};\n\tvar groupTotalWins = {};\n\t for(var key in teamWins){\n\t \t\ttotalWins[key] = [0,0,0,0,0,0,0,0];\n\t \t\tgroupTotalWins[key] = [0,0,0,0,0,0,0,0];\n\t }\n\n\t yearToWins[\"all\"] = totalWins;\n\t groupYearToWins[\"all\"] = groupTotalWins;\n\n\t//create a object from string file/year to data\n\tfor(var i = 1; i<=filesRead;i++){\n\t\tallData[currentYear] = arguments[i];\n\t\tvar yearInt = parseInt(currentYear);\n\n\n\t\tvar tempWins = {};//team to number of wins for a particular year\n\t\t //now we want year to teamWins objects\n\n\t\tvar groupTempWins = {};\n\t \tfor(var key in teamWins){\n\t \t\ttempWins[key] = [0,0,0,0,0,0,0,0];\n\t \t\tgroupTempWins[key] = [0,0,0,0,0,0,0,0];\n\t \t}\n\t \tyearToWins[currentYear] = tempWins;\n\t \tgroupYearToWins[currentYear] = groupTempWins;\n\n\t \tcalculateTableWins(currentYear,allData[currentYear]);\n\n\t \tyearInt++;\n\t\tcurrentYear = yearInt.toString();\n\t }\n\n\n\n\t //console.log(arguments);\n\t if(loadArg==\"bar\"){\n \t//console.log(loadArg);\n \tinitDropMenu();\n \tdrawBarChart();\n\n }\n else if(loadArg == \"table\"){\n console.log(\"Table is starting to execute\");\n initButtons();\n getData(); //Triggers the function for the table to grab the data from this script\n }\n}", "title": "" }, { "docid": "f9e77f7981b448829238a2ff30437f04", "score": "0.5120853", "text": "function LoadBuildingPositionData()\n{\n if( Alloy.Globals.UsersResidentsModeBuildingPosition && _.size( Alloy.Globals.UsersResidentsModeBuildingPosition ) > 0 )\n {\n // If the array isn't null or empty, we use the array as is (a previous setting was done)\n }\n else\n {\n // If current_form_id isn't -1, then we are here on modification, so we load the values from the DB\n if( current_form_id != -1 )\n {\n var UsersResidentsModeUtils = require( '/UsersResidentsModeUtils' ) ;\n var recoverBuildingsPositions = UsersResidentsModeUtils.LoadBuildingPositionQuery( current_form_id ) ;\n\n if( recoverBuildingsPositions.length > 0 )\n {\n var buildingPositionData = recoverBuildingsPositions.at( 0 ) ;\n Alloy.Globals.UsersResidentsModeBuildingPosition =\n {\n \"LATITUDE\": buildingPositionData.get( \"LATITUDE\" ) ,\n \"LONGITUDE\": buildingPositionData.get( \"LONGITUDE\" ) ,\n \"ALTITUDE\": buildingPositionData.get( \"ALTITUDE\" ) ,\n \"PROVINCE\": buildingPositionData.get( \"PROVINCE\" ) ,\n \"MUNICIPALITY\": buildingPositionData.get( \"MUNICIPALITY\" ) ,\n \"PLACE\": buildingPositionData.get( \"PLACE\" ) ,\n \"ADDRESS\": buildingPositionData.get( \"ADDRESS\" ) ,\n \"CIVIC_NO\": buildingPositionData.get( \"CIVIC_NO\" ) ,\n \"COMPILER_POS\": buildingPositionData.get( \"COMPILER_POS\" )\n } ;\n }\n else\n {\n // If there isn't a row on the DB, we create a default array\n CreateDefaultBuildingPositionArray() ;\n }\n }\n else\n {\n // If current_form_id is -1, then we are here on adding new, so we create a default array\n CreateDefaultBuildingPositionArray() ;\n }\n }\n}", "title": "" }, { "docid": "5682cd9f1cd4a3c686f276f06e5f7316", "score": "0.51160353", "text": "function checkPreload() {\n get_input_values();\n if ((publicData == true) && (locus == \"AT2G24270\") && (dumpMethod == \"simple\")) {\n populate_table(1);\n isPrecache = true;\n }\n else {\n update_all_images(0);\n isPrecache = false;\n }\n}", "title": "" }, { "docid": "cdd9d0721cf227985f5e8f5067b5a035", "score": "0.5111899", "text": "function populateData() {\n if (defaultValues.length < 1) {\n return;\n }\n $('#datetime-start').val(defaultValues.date_started);\n $('#datetime-end').val(defaultValues.date_finished);\n $('#production-code').val(defaultValues.production_code);\n $('#remarks').val(defaultValues.remarks);\n $('[name=is_approved]').prop('checked', parseInt(defaultValues.is_approved) ? true : false);\n $.each(defaultValues.details, function (i) {\n addLineDetails(defaultValues.details[i].sequence_number, defaultValues.details[i].fk_production_formulation_id, defaultValues.details[i].mix_number, defaultValues.details[i].fk_sales_customer_id, defaultValues.details[i].status, defaultValues.details[i].id);\n });\n if (defaultValues.hasOwnProperty('misc_fees') && defaultValues.misc_fees.length) {\n $.each(defaultValues.misc_fees, function (i) {\n console.log(defaultValues.misc_fees[i]);\n addLineMisc(defaultValues.misc_fees[i].description, numeral(defaultValues.misc_fees[i].amount).format('0,0.00'), defaultValues.misc_fees[i].id);\n });\n }\n }", "title": "" }, { "docid": "a16313423445649a8ab5fa44b1786cac", "score": "0.5111251", "text": "function addImagesToArrayForLoading() {\r\n if (settings.header.show == 'true')\r\n { imagesForPreload.push(settings.header.logo); }\r\n }", "title": "" }, { "docid": "f4a238394c56f5a77e1cce54d4ebe178", "score": "0.5107641", "text": "function checkResources() {\n var allLoaded = true;\n for (var n in chart.resources) {\n if (!chart.resources[n]) allLoaded = false;\n }\n if (allLoaded) resourcesLoaded();\n }", "title": "" }, { "docid": "7e634c1028108301d6974e4e9da978de", "score": "0.51073104", "text": "populateMissingMarketPopRecords() {\n CELLS.forEach(({CELL_ID}) => {\n MARKET.forEach(({MARKET_ID}) => {\n if (!this.hasRecord(MARKET_ID, CELL_ID)) {\n this.insertMarketPopRecord(MARKET_ID, CELL_ID)\n }\n });\n });\n }", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.51023364", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.51023364", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.51023364", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.51023364", "text": "loadingData() {}", "title": "" }, { "docid": "8a3a4a55b5d60c3d04dc982c604ae4ec", "score": "0.51003647", "text": "function getData(){\n let info=localStorage.getItem('products');\n let productsArr = JSON.parse(info);\n if(productsArr!==null){\n allStuff=productsArr;\n }\n renderImages();\n}", "title": "" }, { "docid": "65ce5b65eb8b06f50e8066cbee23dab9", "score": "0.5088539", "text": "function checkAssignedDataFields() {\n\t\t// //$log.log(preDebugMsg + \"checkAssignedDataFields\");\n\t\tvar needsData = [];\n\n\t\tfor(var p = 0; p < listOfPlugins.length; p++) {\n\t\t\tvar plugin = listOfPlugins[p];\n\t\t\tvar oldActive = plugin.active;\n\t\t\tvar changed = false;\n\n\t\t\tplugin.active = false;\n\n\t\t\t// //$log.log(preDebugMsg + \"plugin \" + p + \" oldActive = \" + oldActive);\n\n\t\t\t// check if some old assignments should be removed\n\t\t\tfor(var is = 0; is < plugin.format.length; is++) {\n\t\t\t\tvar inputSet = plugin.format[is].fields;\n\n\t\t\t\tfor(var f = 0; f < inputSet.length; f++) {\n\t\t\t\t\tvar inputField = inputSet[f];\n\n\t\t\t\t\tif(inputField.template && !inputField.added) {\n\t\t\t\t\t\t// this field is just a template, does not have to have anything assigned\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar toRemove = [];\n\t\t\t\t\t\tfor(var a in inputField.assigned) {\n\t\t\t\t\t\t\tvar OK = false;\n\t\t\t\t\t\t\tif(inputField.assigned.hasOwnProperty(a)) {\n\t\t\t\t\t\t\t\tvar dsID = inputField.assigned[a][0].toString();\n\n\t\t\t\t\t\t\t\tif(mapDataSourceIdToIdx.hasOwnProperty(dsID)) {\n\t\t\t\t\t\t\t\t\tvar ds = mapDataSourceIdToIdx[dsID];\n\n\t\t\t\t\t\t\t\t\tif(ds < listOfDataSources.length && inputField.assigned[a][1] < listOfDataSources[ds].dataSets.length && inputField.assigned[a][2] < listOfDataSources[ds].dataSets[inputField.assigned[a][1]].fields.length) {\n\t\t\t\t\t\t\t\t\t\tvar dataField = listOfDataSources[ds].dataSets[inputField.assigned[a][1]].fields[inputField.assigned[a][2]];\n\t\t\t\t\t\t\t\t\t\tOK = false;\n\t\t\t\t\t\t\t\t\t\tif(inputField.type !== undefined) {\n\t\t\t\t\t\t\t\t\t\t\tfor(var t = 0; t < inputField.type.length; t++) {\n\t\t\t\t\t\t\t\t\t\t\t\tif(dataField.type == inputField.type[t]) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tOK = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t//$log.log(preDebugMsg + \"no type for field \" + dataField.name);\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\tOK = false;\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\tOK = false;\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\tif(!OK) {\n\t\t\t\t\t\t\t\ttoRemove.push(a);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor(a = 0; a < toRemove.length; a++) {\n\t\t\t\t\t\t\tdelete inputField.assigned[toRemove[a]];\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\t// check if some sets are completely filled from the same data sources\n\t\t\tfor(var is = 0; is < plugin.format.length; is++) {\n\t\t\t\tvar inputSet = plugin.format[is].fields;\n\t\t\t\tvar setIsFilled = true;\n\t\t\t\tvar OKsourcesPerIdSlot = {};\n\t\t\t\tvar OK = true;\n\n\t\t\t\tfor(var f = 0; f < inputSet.length; f++) {\n\t\t\t\t\tvar inputField = inputSet[f];\n\t\t\t\t\tvar idSlot = inputField.idSlot;\n\n\t\t\t\t\tif(!OKsourcesPerIdSlot.hasOwnProperty(idSlot)) {\n\t\t\t\t\t\tOKsourcesPerIdSlot[idSlot] = [];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor(var idSlot in OKsourcesPerIdSlot) {\n\t\t\t\t\tidSetIsFilled = false;\n\t\t\t\t\tOKsources = [];\n\t\t\t\t\tfor(var f = 0; f < inputSet.length; f++) {\n\t\t\t\t\t\tvar inputField = inputSet[f];\n\t\t\t\t\t\tif(inputField.idSlot == idSlot && (!inputField.template || inputField.added)) {\n\t\t\t\t\t\t\tfirstField = inputField;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor(var a in firstField.assigned) {\n\t\t\t\t\t\tvar OK = true;\n\n\t\t\t\t\t\tfor(var f = 0; f < inputSet.length; f++) {\n\t\t\t\t\t\t\tvar inputField = inputSet[f];\n\t\t\t\t\t\t\tif(inputField.template && !inputField.added) {\n\t\t\t\t\t\t\t\t// ignore template fields\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif(inputField.idSlot == idSlot) {\n\t\t\t\t\t\t\t\t\tif(!inputField.assigned.hasOwnProperty(a)) {\n\t\t\t\t\t\t\t\t\t\tOK = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(OK) {\n\t\t\t\t\t\t\tidSetIsFilled = true;\n\t\t\t\t\t\t\tOKsources.push(a);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tOKsourcesPerIdSlot[idSlot] = OKsources;\n\t\t\t\t\tif(!idSetIsFilled) {\n\t\t\t\t\t\tsetIsFilled = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(!plugin.active && (plugin.format[is].filled != setIsFilled || JSON.stringify(plugin.format[is].sources) != JSON.stringify(OKsourcesPerIdSlot))) { // if it is already activated, a set that did not change is already used so other changes are not important\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\n\t\t\t\tplugin.format[is].filled = setIsFilled;\n\t\t\t\tif(setIsFilled) {\n\t\t\t\t\tplugin.active = true;\n\t\t\t\t\tplugin.format[is].sources = OKsourcesPerIdSlot;\n\t\t\t\t} else {\n\t\t\t\t\tplugin.format[is].sources = {};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(changed || plugin.active != oldActive) {\n\t\t\t\tneedsData.push(p);\n\t\t\t}\n\t\t}\n\n\t\tfor(p = 0; p < needsData.length; p++) {\n\t\t\tsendDataToPlugin(needsData[p]);\n\t\t}\n\n\t\tbuildNewMapping();\n\n\t\tif(needsData.length == 1) {\n\t\t\tupdateSelections(needsData[0]);\n\t\t} else if(needsData.length > 0) {\n\t\t\tupdateSelections();\n\t\t}\n\t}", "title": "" }, { "docid": "dc1de98738dae1f8fc93d0410a4889e3", "score": "0.5080113", "text": "function init() {\n $.each( includes, function ( k, v ) {\n var check = $.isFunction( v.conditional ) ? v.conditional() : v.conditional;\n\n if ( check ) {\n // used for tracking which includes are loading\n loaded.push( 'oasis.' + k );\n\n if ( v.exec ) {\n v.exec();\n }\n }\n } );\n\n // this should always be defined\n // but just in case ResourceLoader develops a quirk\n rs.loaded = ( rs.loaded || [] ).concat( loaded );\n }", "title": "" }, { "docid": "d6ee9fb875f2f09c2f6165db2d6486c1", "score": "0.50764537", "text": "function buildyesNoArr() {\n self.yesNoArr([]);\n self.yesNoArr( app.getSaaSLookup(rootViewModel.globalYesNo())); \n }", "title": "" }, { "docid": "ea35d3a0b2eb856ca46f46b201206af1", "score": "0.5076268", "text": "function init() {\n $.each( includes, function ( k, v ) {\n var check = $.isFunction( v.conditional ) ? v.conditional() : v.conditional;\n \n if ( check ) {\n // used for tracking which includes are loading\n loaded.push( 'oasis.' + k );\n \n if ( v.exec ) {\n v.exec();\n }\n }\n } );\n \n // this should always be defined\n // but just in case ResourceLoader develops a quirk\n ed.loaded = ( ed.loaded || [] ).concat( loaded );\n }", "title": "" }, { "docid": "310f7e108931538ac556abb97e1f1500", "score": "0.50753725", "text": "checkForEmptyVerticalContainer(index) {\n let undefinedCounter = 0;\n for (let i = 0; i < this.completeNumberOfStaves; i++) {\n if (this.verticalSourceStaffEntryContainers[index][i] === undefined) {\n undefinedCounter++;\n }\n }\n if (undefinedCounter === this.completeNumberOfStaves) {\n this.verticalSourceStaffEntryContainers.splice(index, 1);\n }\n }", "title": "" }, { "docid": "a5d79febe1c64e81411db7408136fdc4", "score": "0.5074585", "text": "function init() {\n var arrayNames = houseMembers.filter(function (obj) { return obj }).map(function (obj) { return obj.first_name });\n var arrayVotes = houseMembers.filter(function (obj) { return obj }).map(function (obj) { return obj.votes_with_party_pct });\n var arrayNumber = arrayNames.length\n\n var democratarray = houseMembers.filter(function (obj) { return obj.party === \"D\" }).map(function (obj) { return obj.first_name });\n var democratVotes = houseMembers.filter(function (obj) { return obj.party === \"D\" }).map(function (obj) { return obj.votes_with_party_pct });\n var democratsNumber = democratarray.length;\n\n var republicanarray = houseMembers.filter(function (obj) { return obj.party === \"R\" }).map(function (obj) { return obj.first_name });\n var republicanVotes = houseMembers.filter(function (obj) { return obj.party === \"R\" }).map(function (obj) { return obj.votes_with_party_pct });\n var republicanNumber = republicanarray.length\n\n var independentarray = houseMembers.filter(function (obj) { return obj.party === \"I\" }).map(function (obj) { return obj.first_name });\n var independentVotes = houseMembers.filter(function (obj) { return obj.party === \"I\" }).map(function (obj) { return obj.votes_with_party_pct });\n var independentNumber = independentarray.length\n /*vease que el primer grupo de variables dentro del init corresponden a elementos que filtrararn el array\n alojado en la variable houseMemebrs, usando el metodo map, para retornar objetos especificos dentro del array\n con estos retornos se determinarian variables que posteriormente seran necesarias para determinar parametros \n de funciones u otros arrays o variables necesarias */\n\n\n var arrayDem = minyArray(democratsNumber, average(democratVotes))\n var arrayRep = (minyArray(republicanNumber, average(republicanVotes)))\n var arrayInd = (minyArray(independentNumber, average(independentVotes)));\n /*este grupo de variables se les asigna una funcion llamada minyArray, la cual contiene dos paranmetros \n los cuales serian un a variable previamente determinada , y una funcion llamada average , que determina \n el promedio sobre otra variable ya previamente determinada, dando cada una de lllas un sort de mini arrays\n compuestos por dos numeros */\n var arrayTotales = tablaGlanceSumaTotales(mytotalesNum(arrayNumber), mytotalesNum(average(arrayVotes)))\n /*esta variable simplemente se le asigna el resultado de una funcion llamada tablaGlanceSumaTotales\n la cual tiene como parametros una funcion que retorna el total de elementos y otra funcion\n que resume el total de averages, y como resumen se podria decir que esta variable serian los totales\n en cuanto a numeros y promedios de las tres variables inicializadas anteriormente */\n var arrayMatrixTablaGlance = matrixTablaGlance(arrayRep, arrayDem, arrayInd, arrayTotales)\n /*ya simplemente quedaria conformar esa tabla resumen de mini arrays en cuanto a numeros y\n promedios , vease que esta variable es la encargada de dicho proceso , asignandosele una funcion que como\n parametros tine los elementos antes explicados */\n\n let resultAscending = myNewArrayAscending(houseMembers, \"missed_votes_pct\")\n var resumedHouseLeast = addingRepeatedAfter10pct(resultAscending, \"missed_votes_pct\")\n\n var resultDescending = myNewArrayDescending(houseMembers, \"missed_votes_pct\")\n var resumedHouseMost = addingRepeatedAfter10pct(resultDescending, \"missed_votes_pct\")\n\n let resultAscending1 = myNewArrayAscending(houseMembers, \"votes_with_party_pct\")\n var resumedHouseLeast1 = addingRepeatedAfter10pct(resultAscending1, \"votes_with_party_pct\")\n\n var resultDescending1 = myNewArrayDescending(houseMembers, \"votes_with_party_pct\")\n var resumedHouseMost1 = addingRepeatedAfter10pct(resultDescending1, \"votes_with_party_pct\")\n /*este grupo de variables devuelve arrays ordenados de manera ascendente , o descendente, siendo\n la funciones myNewArrayAscending/Descending y addingRepeatedAfter10pct, las cuales tienen\n como parametro eL array en si sobre el cual se realizara el mapeo, y el objeto dentro del esos arrays\n para los cuals se evalua la funcion */\n\n var btnCheckBoxRepublicans = document.getElementById(\"republicans\");\n var btnCheckBoxIndependents = document.getElementById(\"independents\");\n var btnCheckBoxDemocrats = document.getElementById(\"democrats\");\n var filteredBystates = document.getElementById(\"select\")\n /*En este caso se declaran variables que hacen referencia a un id especifico en los html, las cuales\n seran utilizadas posteriormente como elementos de una funcion en la que se ncluyen eventListeners\n para triggerear una accion*/\n\n var arrayGeneral = houseMembers.filter(function (obj) { return obj; }).map(function (obj) { return obj.state; });\n /*se declara una variable que de manera general filtara el array house members, retornando mediante metodo map el objeto\n state, para cada uno de los elementos del array , lo cual sera utilizado posteriormente para el dropdownfilter selector\n */\n\n var myNonRepeatedStatesArrayUnordered = arrayGeneral.filter(myNonRepeatedStates);\n /*esta variable simplemente se le asigna el resultado de una funcion que filtra el array general, previamente filtrado\n retornando el objeto state sobre una variable mas adelante determinada llamada myNonRepeatedStates */\n\n var myStatesOrdered = statesOrdered(myNonRepeatedStatesArrayUnordered);\n /*esta variable depende de la anterior, y simplemente se le es asignada el valor que retorne la variable anterior\n la cual es asignada como parametro a la funcion statesOrdered*/\n\n /*///////////////////////////////////////////FUNCIONES A UTILIZAR///////////////////////////////////\n En esta seccion de la funcion init se inicializan todas las funciones ademas de condicionantes que determinarian\n que funcion ejecutar ademas de que html file es el que se ejecuta en dependencia de los id expuestos, y la interaccion\n del usuario con la app */\n if (document.getElementById(\"house-attendance-atGlance-table\")) {\n tableGlanceHouse(arrayMatrixTablaGlance, \"#house-attendance-atGlance-table>tr\")\n\n createTable(resumedHouseLeast, { total: \"missed_votes\", percentage: \"missed_votes_pct\" }, \"house-attendance-least-table\")\n\n createTable(resumedHouseMost, { total: \"missed_votes\", percentage: \"missed_votes_pct\" }, \"house-attendance-most-table\")\n }\n /*vease que el primer if determinaria que en dependencia del id con el cual el usuario interactua determinaria \n la app que se dispone en pantalla , ademas de crearse tablas de resumen , y tablas de engage most y least*/\n else if (document.getElementById(\"bodyTabHouseGlance\")) {\n tableGlanceHouse(arrayMatrixTablaGlance, \"#bodyTabHouseGlance>tr\")\n\n createTable(resumedHouseLeast1, { total: \"total_votes\", percentage: \"votes_with_party_pct\" }, \"leastLoyalty\")\n\n createTable(resumedHouseMost1, { total: \"total_votes\", percentage: \"votes_with_party_pct\" }, \"mostloyalty\")\n }\n /*lo mismo pasaria con el segundo condicionante if else comoalternativa al no cumplimiento d ela primera condicion, \n aunque en este caso haria referencia a las creaciones de tablas y demas referentes al loyalty most y least del\n house ademas de la creacion de tabla glance para ese concepto */\n\n else if (document.getElementById(\"tabla-house\")) {\n fileteredCheckbox();\n\n btnCheckBoxRepublicans.addEventListener(\"click\", function () { fileteredCheckbox((myForStates(houseMembers)), { partys: \"party\", states: \"state\", senioritys: \"seniority\", percentage: \"votes_with_party_pct\" }, \"tabla-house\") })\n btnCheckBoxIndependents.addEventListener(\"click\", function () { fileteredCheckbox((myForStates(houseMembers)), { partys: \"party\", states: \"state\", senioritys: \"seniority\", percentage: \"votes_with_party_pct\" }, \"tabla-house\") })\n btnCheckBoxDemocrats.addEventListener(\"click\", function () { fileteredCheckbox((myForStates(houseMembers)), { partys: \"party\", states: \"state\", senioritys: \"seniority\", percentage: \"votes_with_party_pct\" }, \"tabla-house\") })\n filteredBystates.addEventListener(\"change\", function () { fileteredCheckbox((myForStates(houseMembers)), { partys: \"party\", states: \"state\", senioritys: \"seniority\", percentage: \"votes_with_party_pct\" }, \"tabla-house\") })\n /*en esta tercera condicionante y bajo el supuesto de que el usuario interactue con la interfaz que posse el id, a la cual se hace alusion\n se inicializaria la tercera opcion en donde como primer elemento se muestra una funcion llamada fileteredCheckbox() ade mas\n de addEventListeners sobre variables previamente inicializadas, las cuales como bien expone cada funcion se activarian\n mediante click(3 primeras) y change(en el caso de la ultima para el dropdown selector) interactuando en conjunto\n para dar un resultado combinado entre filtros de checkboxes y dropdownmenu para mostrar un resultado final sobre \n las tablas estadisticas que funciones ejecutaria */\n\n myDropDown(myStatesOrdered)\n myForStates(houseMembers)\n }\n /*estas dos funciones se inicializan pues se utilizan ppor variables previamente para el desarrollo y retorno de \n resultados que contribuyen a informaciones estadisticas de las tablas a mostrar */\n\n else {\n dots = document.getElementById(\"dots\");\n moreText = document.getElementById(\"more\");\n btnText = document.getElementById(\"myBtn\");\n\n myFunction()\n }/*por ultimo si ninguna de las condicionantes anteriores se cumple entonces se desarrolla la tercera y ultima condicionante\n la cual daria escenario el desarro de la funcion myFunction inicializada para la ecuacion de read more read less */\n}", "title": "" }, { "docid": "9fbcbfd611e2beca3195998cbc025e27", "score": "0.507166", "text": "function checkLoadingStatus() {\r\n if (allPredXML === undefined || vechLocXML === undefined || routeDataXML === undefined) {\r\n maxLoadingChecks = maxLoadingChecks - 1;\r\n } else {\r\n doneLoading = true;\r\n createPage();\r\n lastRefreshComplete = true;\r\n }\r\n}", "title": "" }, { "docid": "fe2d4ad8643cfd47ad74aa50d2205b47", "score": "0.5070902", "text": "function init() {\n if ($scope.group.studentList[0].person === undefined) {\n for (var i = 0; i < $scope.group.studentList.length; i++) {\n populateStudent(i);\n }\n }\n }", "title": "" }, { "docid": "83e50092aeea2a57adf1d4b32cf11729", "score": "0.5060307", "text": "function emptyArray (data) {\n return array(data) && data.length === 0;\n }", "title": "" }, { "docid": "83e50092aeea2a57adf1d4b32cf11729", "score": "0.5060307", "text": "function emptyArray (data) {\n return array(data) && data.length === 0;\n }", "title": "" }, { "docid": "7e3561658b34f39674a3338d7c1bf5fa", "score": "0.5045318", "text": "function clearArrays()\r\n{\r\n\t//If arrays are filled, empty them\r\n\tif (ppsArray.length > 0 || ordersArray.length > 0)\r\n\t{\r\n\t\tppsArray = new Array();\r\n\t\tppsCount = 0;\r\n\t\tordersArray = new Array();\r\n\t\tordersCount = 0;\r\n\t}\r\n}", "title": "" }, { "docid": "3d37b2f8710ecfbdbde9e4fb9543fed6", "score": "0.5043764", "text": "function init() {\n\n if( typeof temprecords !== \"undefined\") {\n\n for(var i=0; i<temprecords.length; i++){\n\n records.push(\n new Record(\n temprecords[i][0],\n temprecords[i][1],\n temprecords[i][2],\n temprecords[i][3],\n temprecords[i][4],\n temprecords[i][5],\n temprecords[i][6],\n temprecords[i][7],\n temprecords[i][8],\n temprecords[i][9],\n temprecords[i][10],\n temprecords[i][11],\n temprecords[i][12],\n temprecords[i][13],\n temprecords[i][14],\n temprecords[i][15],\n temprecords[i][16],\n temprecords[i][17],\n temprecords[i][18],\n temprecords[i][19]\n )\n );\n}\n\ntemprecords = null; // maybe save a bit of memory\n\n} // end of if(temprecords)\n\nshow_defaultview();\n\n}", "title": "" }, { "docid": "b12939bf6ce4175c7007ce97ae50f602", "score": "0.50424457", "text": "function refreshAndloadData() {\n myarry = [];\n newdata = [];\n variable_ids = [];\n pullData(id, month, year)\n }", "title": "" }, { "docid": "6021f280d130609746400856f33251f6", "score": "0.5040317", "text": "onLoaded(data) {}", "title": "" }, { "docid": "e52c996943f86c0136657a63b56da9fb", "score": "0.5037773", "text": "function calculateAll(){\n\t//everything has loaded, now to make a all data entry\n\n\n}", "title": "" }, { "docid": "a3f20e708aa7e7beb1da7334e4c39cde", "score": "0.50376445", "text": "function initOnLoad() {\n\t\t\tif (numImagesLoaded >= numImages)\n\t\t\t\tinit();\n\t\t\telse\n\t\t\t\tsetTimeout(initOnLoad, 1);\n\t\t}", "title": "" }, { "docid": "977e933a37a119f2ed06aaf91495e9f6", "score": "0.50375426", "text": "function checkImagesLoaded() {\n var p = $(\".PageContent:empty\").length;\n $(\".PageContent img\").filter(function () {\n var image = $(this);\n if (image.context.naturalWidth == 0 ||\n image.readyState == 'uninitialized') {\n return true;\n }\n return false;\n }).each(function () {\n p++;\n reloadImage($(this));\n });\n $(\"#Counters i\").html($(\"#Counters b\").html() - p);\n $(\"#NavigationCounters i\").html($(\"#NavigationCounters b\").html() - p);\n if (p > 0) {\n setTimeout(function () {\n checkImagesLoaded();\n }, 3000);\n } else {\n applyDefaultZoom();\n mConsole(\"Images Loading Completed\");\n }\n }", "title": "" }, { "docid": "63cfd9c034eb14bb3e0241d6f081ed56", "score": "0.50294286", "text": "initializeDemoData() {\n if (!Array.isArray(this.currentMoviesData)) {\n this.currentMoviesData = JSON.parse(moviesData);\n this.saveMoviesDataIntoStorage();\n }\n }", "title": "" }, { "docid": "1bc18f36a20b13d502411a39e327e8ed", "score": "0.50242424", "text": "function fill_data_array(d){\n\tif (d.properties[\"population\"][year]){\n\t\tvar name = d.id;\n\t\tif (drug){\n\t\t\tif (topic != \"prevalence\"){\n\t\t\t\tobj[name] = d.properties[topic][drug][year];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tobj[name] = d.properties[topic][drug][subsubtopic][subsubsubtopic][year];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tobj[name] = d.properties[topic][subtopic][year];\n\t\t}\n\t}\n}", "title": "" }, { "docid": "91b794943f58df90ebb4ab9293e78486", "score": "0.5017108", "text": "function checkForScreenLoadedSubareas() {\n if (screenLoaded.subareasLoaded && screenLoaded.tiposAccionLoaded) {\n screenLoaded.ready = true;\n window.clearInterval(CFSL);\n console.log(\"screenLoadedSubareas=true\");\n bcambios = false;\n }\n else {\n console.log(\"screenLoadedSubareas=false\");\n }\n }", "title": "" }, { "docid": "4186461c73abaf204bb45005877fa311", "score": "0.5016971", "text": "function fillDevicesInfo(url) {\n $.ajax({\n 'url': url || '/es/api/v1/device/?format=json&limit=1000',\n 'type': 'GET',\n 'data': {},\n success: function(data) {\n for (let i = 0; i < data.objects.length; i++) {\n let deviceLocation;\n if (!data.objects[i].rack) {\n deviceLocation = \"[null]\";\n } else {\n deviceLocation = \"[\" + data.objects[i].rack.room + \"] [\" + data.objects[i].rack.name + \"]\";\n\n devicesInfo[data.objects[i].name] = {\n id: data.objects[i].id,\n rack: data.objects[i].rack.name,\n room: data.objects[i].rack.room,\n rack_unit: data.objects[i].rack_unit\n };\n }\n\n let autosearchDeviceInfo = {\n value: data.objects[i].name,\n label: data.objects[i].name,\n desc: deviceLocation,\n }\n autosearchDevicesInfo.push(autosearchDeviceInfo);\n }\n\n // If we have not obtained all the devices, perform the next call\n if (data.meta.limit + data.meta.offset <= data.meta.total_count) {\n fillDevicesInfo(data.meta.next);\n\n /*\n I have set this condition to increase UX by reducing the initial loading page time.\n\n Although the devices arrays are not completely full, setting this conditional will considerably reduce the time to\n load the page while it also gives the necessary time for the devices arrays to get filled before the user performs\n any action that requires them.\n\n We perform the second checking so that this operation is only done once\n */\n if ((data.meta.limit + data.meta.offset > data.meta.total_count / 2) &&\n (window.getComputedStyle(document.getElementById(\"readyContainer\"), null).getPropertyValue(\"visibility\") === \"hidden\")) {\n document.getElementById(\"onLoadContainer\").style.display = \"none\";\n document.getElementsByTagName(\"html\")[0].classList.remove('loadingProcess');\n document.getElementById(\"readyContainer\").style.visibility = \"visible\";\n setPropertyDraggableToElement ($(\"#roomMenu\"), false);\n setPanzoom();\n }\n } else {\n setDeviceAutocompleteSearch();\n }\n }\n });\n}", "title": "" }, { "docid": "4c666a5401a349a4246e88de6a58bf9e", "score": "0.5016951", "text": "function dataLoaded(data) {\n dataInUse = data;\n }", "title": "" }, { "docid": "129218ae40b80f3cba65558b3c0a8cad", "score": "0.5007694", "text": "chunk_loaded(data) {\n\n // Updates only candlestick data, or\n if (Array.isArray(data)) {\n this.merge('chart.data', data)\n } else {\n // Bunch of overlays, including chart.data\n for (var k in data) {\n this.merge(k, data[k])\n }\n }\n\n this.loading = false\n if (this.last_chunk) {\n this.range_changed(...this.last_chunk, true)\n this.last_chunk = null\n }\n\n }", "title": "" }, { "docid": "7cb3a1eb4f5ff6ccc42d175837ebc465", "score": "0.50073034", "text": "function loadLights(){\n var inputLights = getJSONFile(multiple_light_loc, \"lights\");\n if(inputLights!=String.null){\n console.log(\"use multiple lights\");\n }\n}", "title": "" }, { "docid": "46e53aef88ef6fd3ede884b3f3520c40", "score": "0.5006902", "text": "function defaultLoad(){\n if ( selectedZones.length > globalConfig.zoneSize ) {\n swal(\"Zone should be maximum \"+globalConfig.zoneSize);\n } else if ( selectedCities.length > globalConfig.citySize ) {\n swal(\"Cities should be maximum \"+globalConfig.citySize);\n } else if( selectedAreas.length > globalConfig.areaSize ) {\n swal(\"Area should be maximum \"+globalConfig.areaSize);\n } else if ( selectedPlans.length > globalConfig.planSize) {\n swal(\"Plan should be maximum \"+globalConfig.planSize);\n }else if ( selectedNodes.length > globalConfig.nodeSize) {\n swal(\"Node should be maximum \"+globalConfig.nodeSize);\n } \n else{\n for (var i in $scope.tree) {\n $scope.tree[i] = false;\n }\n \n $scope.loading = true;\n $scope.dataLoaded = false;\n $scope.noData = false;\n var _url = globalConfig.pullfilterdataurl+\"a42d984klfgnxp02g89ghlzc2765\"+\"&fromDate=\"+$scope.date.start+\"T00:00:00.000Z\"+\"&toDate=\"+$scope.date.end+\n \"T23:59:59.999Z\";\n _url += buidUrl();\n _url += \"&groupby=\"+ $scope.group;\n console.log(_url);\n httpService.get(_url).then(function(res){\n console.log(res.data)\n $scope.loading = false;\n $scope.exportSubscriberThroughput= res.data\n if(res && res.data.length > 0) {\n plotData(res.data);\n $scope.dataLoaded = true;\n } else {\n $scope.noData = true;\n }\n }).catch(function(err){\n console.log('err', err);\n $scope.loading = false;\n $scope.dataLoaded = false;\n $scope.noData = true;\n });\n } \n \n }", "title": "" }, { "docid": "fd25c3607f26dae4c395137228ec7436", "score": "0.50040483", "text": "componentDidMount() {\n if (this.state.memesArray !== undefined) {\n this.setState({ allMemes: this.state.memesArray, hasLoaded: true }, () => this.setInfo())\n }\n else {\n this.getMemesByTime()\n }\n\n }", "title": "" }, { "docid": "5af1aef3bf6140850e803751fded6811", "score": "0.5002066", "text": "function checkAllCompleted() {\n\n\n if (charName !== null &&\n gender !== null && hair !== null && cap !== null) {\n\n //Loop through the objects create the images & tweens\n if (gender === \"girl\") {\n $.each(girls, function(idx, girl) {\n createBodyImage(girl);\n });\n } else {\n $.each(boys, function(idx, boy) {\n createBodyImage(boy);\n });\n }\n $.each(unisexes, function(idx, unisex) {\n createBodyImage(unisex);\n });\n\n initExtrasSounds();\n $(\"#fwd2\").show();\n } else {\n $(\"#fwd2\").hide();\n }\n\n /* For testing */\n //console.log(charName + \", \" + gender + \", \" + cap + \", \" + hair);\n}", "title": "" }, { "docid": "b08b6198bc762cf5ce1e521ee4e94e16", "score": "0.49992877", "text": "function _onLoadData(data) {\n\t\tvar item,\n\t\t\tresults = '';\n\n\t\tfor (item in data) {\n\t\t\tresults += _getDataTemplate(data[item]);\n\t\t\tlist.results[data[item].id] = data[item];\n\t\t}\n\n\t\t$dom.today_list.html(results);\n\n\t\t_loadFavorites();\n\t\t_loadUserCreated();\n\t}", "title": "" }, { "docid": "62ec577c7dc8ae39ab835f7ae2840fb7", "score": "0.4999143", "text": "function nonEmptyArray (data) {\n return array(data) && data.length > 0;\n }", "title": "" }, { "docid": "62ec577c7dc8ae39ab835f7ae2840fb7", "score": "0.4999143", "text": "function nonEmptyArray (data) {\n return array(data) && data.length > 0;\n }", "title": "" }, { "docid": "b6dfe893e516c76508255899ced35138", "score": "0.4998108", "text": "function ready() {\n var selectTerm = document.getElementById(\"terms\");\n var termData = [];\n\n var selectCourse = document.getElementById(\"courses\");\n var coursesData=[];\n\n fillSelectData(selectTerm,termData);\n fillSelectData(selectCourse,coursesData);\n\n\n\n\n}", "title": "" }, { "docid": "9a07eba852dd1a07ccacb1a1f0da0549", "score": "0.49967992", "text": "function checkImagesLoaded() {\n if (imagesLoaded === pictures.length) {\n togglePageDisplay(false)\n }\n}", "title": "" }, { "docid": "982c79a0b99fc14b403acf1976c240a7", "score": "0.4996051", "text": "function loadElements(i) {\n $('.lazy').each( function(i){\n var bottom_of_object = $(this).offset().top + 300;\n var bottom_of_window = $(window).scrollTop() + $(window).height();\n var above_the_fold = isOnScreen(this);\n if( bottom_of_window > bottom_of_object ){\n $(this).removeClass('ready');\n $(this).addClass('loaded');\n }\n if( above_the_fold === true ){\n $(this).addClass('firstContent');\n }\n });\n readyYet();\n }", "title": "" }, { "docid": "a36a52dac2589b58133d8a365f09cea9", "score": "0.49956074", "text": "function initDataTagToJsonArrayDashboard(){\n if(dataTagToJsonArray.length > 0){\n\n $('#filter-all').keyup(function() {\n filterData();\n });\n\n $('#re-init-dash').click(function() {\n $('#filter-all').val('');\n clearDataPartner();\n });\n\n }\n /* THE INIT HAS BEEN DONE IN ERB */\n // filteredDataTagToJsonArray = dataTagToJsonArray;\n runjsClientGrid();\n}", "title": "" }, { "docid": "a75f3cdb8b4d90c17000c00ecbe33afc", "score": "0.49935377", "text": "function dataLoaded_cb(survey) {\n\n console.log(survey.cases);\n\n if(survey.cases.length > 0) {\n for(i = 0; i < survey.cases.length; i++) {\n var c = survey.cases[i];\n for(k in c.data) {\n console.log(survey.labels[k]);\n console.log(c.data[k]);\n }\n }\n } else {\n console.log('Dataset empty...')\n }\n \n}", "title": "" }, { "docid": "23647efb5247368436791ae097a3cbe6", "score": "0.49922118", "text": "fill_in_data(data) {\n let q_idx = 0;\n for(let q_info of this.questions) {\n let text = q_info[0];\n let type = q_info[1];\n if (type === 'header') {\n q_idx += 1;\n continue;\n }\n let known_response = data.lookup(text, this.response_name).response;\n this.responses[q_idx] = known_response;\n q_idx += 1;\n }\n }", "title": "" }, { "docid": "fb1ca9c3ea9bfd95e94d69920b3aea92", "score": "0.49918073", "text": "_placementCheck() {\n\t\t\tvar items = this._getItems()\n\t\t\tvar current = this._items ? this._items.length : 0;\n\n\t\t\tif (items.length != current) {\n\t\t\t\tthis.setup()\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "064b7326b20bb840f0028e3531f61158", "score": "0.4988589", "text": "function initArray($array)\n\t{\n\t\t\t$checkbox.each(function() {\n\n\t\t\tvar $this=$(this);\n\n\t\t\tvar $parent=$this.parent();\n\t\t\tvar $lcheck=$parent.find('.l_check');\n\t\t\tvar $scheck=$parent.find('.s_check');\n\n\t\t\tif($lcheck.hasClass('visible') && $scheck.hasClass('visible'))\n\t\t\t{\n\t\t\t\t$array.push(1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$array.push(0);\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "874816e5b4fd5d86df0c180c0b190872", "score": "0.4983315", "text": "function checkLoads() {\n numLoads -= 1;\n if (numLoads == 0) {\n init();\n animate();\n }\n}", "title": "" }, { "docid": "0ba779982bfaf8c0759b6b857328b235", "score": "0.49816954", "text": "function watchEmptyMixlists(){\n if ( arrayMixOne.length != 0 && arrayMixTwo.length != 0){\n addMoreWrap.classList.remove(\"hide\");\n mixPlaylistsButton.classList.remove('disabled');\n } else {\n addMoreWrap.classList.add(\"hide\");\n mixPlaylistsButton.classList.add('disabled');\n }\n}", "title": "" }, { "docid": "b4350e66efec53b7634478de2a1448c3", "score": "0.49763182", "text": "function populate_data(year, month, day) {\r\n // Add year if none\r\n if (data['y' + year] === undefined) {\r\n data['y' + year] = {};\r\n }\r\n \r\n // Add month if none\r\n if (data['y' + year]['m' + month] === undefined) {\r\n data['y' + year]['m' + month] = {};\r\n }\r\n \r\n // Add date if none\r\n if (data['y' + year]['m' + month]['d' + day] === undefined) {\r\n data['y' + year]['m' + month]['d' + day] = [];\r\n }\r\n}", "title": "" }, { "docid": "7abc8d2660963b6110f27cb8594d6a8f", "score": "0.49756947", "text": "function alreadyLoaded()\n\t{\n\t\t// Set the video index based on the current video\n\t\tvideoMgr.ndx = findVideo();\n\n\t\tvw.drawList = fw.drawList(app.addToArray(app.globalDrawList({noStatus: true}), drawList));\n\t\tsetParams(vw.drawList);\n\t}", "title": "" }, { "docid": "e1ce48707eccdfab4ee4eee5e22637f9", "score": "0.49737355", "text": "function checkIfAllFileLoaded() {\n var docState;\n\n if ( nbTotalFiles > nbFilesLoaded ) {\n return;\n }\n\n insertAll( insertQueueImmediate );\n\n docState = document.readyState;\n\n if ( docState === 'interactive' || docState === 'complete' ) {\n insertAll( insertQueueDOMReady );\n }\n else {\n document.addEventListener( \"DOMContentLoaded\", function() {\n insertAll( insertQueueDOMReady );\n } );\n }\n }", "title": "" } ]
26a1d07482b33905f7189f5daaaca6ad
listen for changes in song title input
[ { "docid": "e0cc4a41392c38c07a580d39780455cf", "score": "0.0", "text": "function addLyricsToModal(data) {\n if ( !data.lyrics ) return;\n\n $('#lyrics').text( data.lyrics );\n }", "title": "" } ]
[ { "docid": "0f5dcd4e8de678b9af1e4399d4c0780e", "score": "0.73916465", "text": "function onTitleChange()\n {\n var modifiedTitle = $( \"#article-title\" )[0].value\n if( currentTitle == modifiedTitle ) return\n currentTitle = modifiedTitle\n if( currentTitle == \"\" )\n visualState( STATUS_NEW )\n else( onArticleVerify( currentTitle ) )\n }", "title": "" }, { "docid": "7f399282c6a9b84673b0b25b8f356d04", "score": "0.722236", "text": "function handleTitle(event) {\n //updates the title\n const newTitle = event.target.value;\n setTitle(newTitle);\n }", "title": "" }, { "docid": "f2f0f596efd5e5f374fe2734e57e72fd", "score": "0.71461195", "text": "titleUpdated(event) {\n this.lessonToUpdate.title = event.target.value;\n }", "title": "" }, { "docid": "fa9f6fd607585aaa1b534815764ae627", "score": "0.7078471", "text": "newTitleChanged(event) {\n this.lesson = {title: event.target.value};\n }", "title": "" }, { "docid": "c83c1179b8b5b26a678d62e12e4860a9", "score": "0.70746875", "text": "function handleTitleChanged(newTitle) {\n _title = newTitle;\n _registry.execute(\"onTitleChanged\", newTitle, resultWindow);\n }", "title": "" }, { "docid": "3af93d77a39a857a2551a19f87f3d35b", "score": "0.70591986", "text": "_titleEditableChanged(title) {\n // TODO: This does nothing yet.\n }", "title": "" }, { "docid": "44a06269ad9c29f0bb9b6a8ca59d620a", "score": "0.6891089", "text": "onChangeTitle()\n\t\t{\n\t\t\tthis.toggleTitle();\n\t\t}", "title": "" }, { "docid": "37f674037c09957b618caaeceec53df5", "score": "0.6654094", "text": "function onTitleChanged(callback) {\n callback(resultWindow.title, resultWindow);\n return _registry.add(\"onTitleChanged\", callback);\n }", "title": "" }, { "docid": "7c5d6fc1ff8eb8d4aff3979c2fb00f3e", "score": "0.6641871", "text": "onTitleChange(event) {\n\t\tthis.setState({ title: event.target.value })\n\t}", "title": "" }, { "docid": "df3e2fa2fd30c0b3ee540f1d624676c6", "score": "0.6630141", "text": "function trackName() {\n title.html(thisSong.html());\n }", "title": "" }, { "docid": "6b5f0dc8e440819d8331963c13b6426e", "score": "0.6610378", "text": "function handleChange( aEvent )\n{\n const meta = efflux.activeSong.meta;\n\n meta.title = title.value;\n meta.author = author.value;\n}", "title": "" }, { "docid": "668baaa5e2952025693c1b2ad711ed3f", "score": "0.657981", "text": "function changeTitleListener(event) {\n\t// Get the keyCode\n\tvar code = event.keyCode;\n\n\t// Check if enter was pressed\n\tif(code == 13) {\n\t\t// Call the function for changing the title\n\t\tchangeTitle();\n\t\tconsole.log(\"Changing title\");\n\t}\n}", "title": "" }, { "docid": "47a67f2a19b8bd9e0d6b413e9956a0c1", "score": "0.6451957", "text": "function updateTitle(e) {\n e.preventDefault();\n titleDOM.textContent = titleInputDOM.value;\n titleInputDOM.value = \"\";\n}", "title": "" }, { "docid": "862148812052da95e619494e9c7dedca", "score": "0.64496654", "text": "handleTodoTitleChange(listing) {\n\t\tif (!Display.handlingEvent) {\n\t\t\tDisplay.handlingEvent = true;\n\t\t\t\n\t\t\tvar title = listing.querySelector('.title');\n\t\t\tthis._interstruct.changeTitle(listing.id, title.value);\n\t\t\t\n\t\t\tDisplay.handlingEvent = false;\n\t\t}\n\t}", "title": "" }, { "docid": "8de72af79f20e62bf1258701d05dde0a", "score": "0.6413775", "text": "onChangeTitle() {\n if (this.$refs.title) {\n this.setTitle(this.$refs.title.innerText);\n }\n }", "title": "" }, { "docid": "d949bd94b9f2b550a001635f99a04a45", "score": "0.64124066", "text": "function onTitle(title, id){\n vivaldi.notes.update(id, {\n title: title\n });\n }", "title": "" }, { "docid": "6f983e62f50303ec3e6ed3b798c3ee17", "score": "0.6349275", "text": "function changeTitle() {\n\t$currenttitle.text($currenttitle.text().replace(/Currently Playing:/, TitleBarDescription_Caption));\n}", "title": "" }, { "docid": "502178e870c473586685aa9da33d27d3", "score": "0.6294966", "text": "function observePlayerEventChanges()\n{\n\tplayer.observe(models.EVENT.CHANGE, function (e) {\n\t\tconsole.log(\"Change event:\\n\" + e);\n\t\t\n\t\t// Only update the page if the track changed\n\t\tif (e.data.curtrack == true && !justChangedSong) {\n\t\t\tplayFirstSongInQueueIfExistsAndUpdateQueue();\n\t\t}\n\t\telse if (justChangedSong)\n\t\t{\n\t\t\t// Song just got changed, so update the track name\n\t\t\tupdateTrackName();\n\t\t\tjustChangedSong = false;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "f4de3c9e900c7b77dd86228ab976501e", "score": "0.62861526", "text": "changeTitleHandler(newTitle){\n document.title = `pracownia21: ${newTitle}`;\n }", "title": "" }, { "docid": "fc49c1e4f143cfb0049b07f63a46cc14", "score": "0.62826246", "text": "function afterSongChange() {\n MetaDataElements.displayMetaData();\n ContainerElements.setActive();\n TimeElements.resetDurationTimes();\n\n /*\n Run the song change callback.\n */\n Callbacks.run(\"song_change\");\n }", "title": "" }, { "docid": "5cec1a1cfdf1f6dc1a9f1b42eb697213", "score": "0.62562966", "text": "function onTitleChange(event) { \n if (event.target.value.length < 30) \n setTitle(event.target.value); \n }", "title": "" }, { "docid": "5cec1a1cfdf1f6dc1a9f1b42eb697213", "score": "0.62562966", "text": "function onTitleChange(event) { \n if (event.target.value.length < 30) \n setTitle(event.target.value); \n }", "title": "" }, { "docid": "36886b010b278561b2a016bd3454d2cd", "score": "0.6216541", "text": "changeTitle(v) {\n this.setState({titleText: v.target.value})\n }", "title": "" }, { "docid": "bcef1c247a28675185970dec50fe4800", "score": "0.62043345", "text": "titleOnChange(event) {\n this.setState({ title: event.target.value });\n }", "title": "" }, { "docid": "cf0b5051577d0317604d693f9fa397bf", "score": "0.6167072", "text": "onplay(song) { }", "title": "" }, { "docid": "24f73b4c721a960d9fc405825b40ca8b", "score": "0.61634094", "text": "handleTitleChange(event){\n this.setState({\n inputTitle: event.target.value\n })\n }", "title": "" }, { "docid": "98c1210b3941f5fb11a33188428632b1", "score": "0.6152317", "text": "function clickHandler()\r\n {\r\n setTitle('Updated'); /*This function update the value of title variable*/\r\n console.log(title); \r\n }", "title": "" }, { "docid": "e2904e73594f9891dc6f3d7b1114180e", "score": "0.61484563", "text": "onViewTitleChanged(title) {\n this.viewTitle = title;\n }", "title": "" }, { "docid": "e2904e73594f9891dc6f3d7b1114180e", "score": "0.61484563", "text": "onViewTitleChanged(title) {\n this.viewTitle = title;\n }", "title": "" }, { "docid": "4f620c1ab2701483d134aa41c4ec19a6", "score": "0.61067903", "text": "changeTitle (input) {\n this.setState({ title: input })\n }", "title": "" }, { "docid": "d10767bb64a6973ff9c91bccf8eb6356", "score": "0.6101103", "text": "onChangeTitle(e) {\n this.setState({\n Title: e.target.value\n });\n }", "title": "" }, { "docid": "f758e24cfb4c76421097c76dc49a0a07", "score": "0.6098054", "text": "handleTitleChange(e) {\n\t\tthis.setState({\n\t\t\ttaskTitle: e.target.value\n\t\t});\n\n\t\tthis.props.handleTitleChange(e.target.value);\n\t}", "title": "" }, { "docid": "2621ff99fb0ec4a03a216c3f6fe9b285", "score": "0.60950804", "text": "handleTitleChange (event){\n this.setState({\n title: event.target.value\n })\n }", "title": "" }, { "docid": "92836ff332bc14304955ef311ceab519", "score": "0.60940576", "text": "onTitleChange(event) {\n const item = this.state.item;\n item.title = event.target.value;\n this.setState({item: item});\n }", "title": "" }, { "docid": "fa71a0db64f9d381ea10139ad4197348", "score": "0.6088454", "text": "handleTitleChange(e) {\n this.setState({ title: e.target.value });\n }", "title": "" }, { "docid": "a1eb13ecf38543af5a958713659aca88", "score": "0.608387", "text": "function songPlayed(song) {\n\t\n}", "title": "" }, { "docid": "1808263153e1353c3ffaeeb4e75fa80c", "score": "0.60806274", "text": "function changeTitle() {\n\t// Get the value of the input field\n\tvar newTitle = document.getElementById(\"title\").value;\n\t// Save the value of the title to the currentList object\n\tcurrentList.title = newTitle;\n\n\t// Call the function that updates the local object and the firebase doc.\n\tupdateList();\n\n\t// Update the list of lists to display the right title\n\tdocument.getElementById(currentList.id + \"_list\").innerHTML = newTitle;\n}", "title": "" }, { "docid": "cf69a9d16016f3753babb9803554f201", "score": "0.6070385", "text": "function changeTitle(event) {\n event.preventDefault();\n console.log(\"What is an event?\", event);\n}", "title": "" }, { "docid": "decad9e5a1a765ad8cd8fad3180d4781", "score": "0.6056514", "text": "onChangeTitle(e) {\n this.setState({\n title: e.target.value,\n });\n }", "title": "" }, { "docid": "decad9e5a1a765ad8cd8fad3180d4781", "score": "0.6056514", "text": "onChangeTitle(e) {\n this.setState({\n title: e.target.value,\n });\n }", "title": "" }, { "docid": "d835ad02a12c371701ccc4b7f696cbc4", "score": "0.6048758", "text": "handleTitleChange(title) {\n\t\tthis.setState({\n\t\t\ttaskTitle: title\n\t\t});\n\t}", "title": "" }, { "docid": "e82ff966b44546528f82ac998858001e", "score": "0.6045446", "text": "onChangeTitle(e) {\n this.setState({ title: e.target.value });\n }", "title": "" }, { "docid": "3327bf15f51672edf74adef2033abe6f", "score": "0.6041171", "text": "function notifyTitleChange() {\n var pageTitleElement = $('page_title');\n var pageTitle = pageTitleElement ? pageTitleElement.innerText : '';\n pageTitle = pageTitle.strip();\n if (!pageTitle)\n return;\n\n Api.notifyTitleChanged(pageTitle);\n}", "title": "" }, { "docid": "a803c2dc52ed75b22aa9ad78cdff8e2e", "score": "0.6038706", "text": "function updateCurrentSong() {\n\tclient.sendCommand('currentsong', (err, msg) => {\n\t\tvar currentSong = mpd.parseKeyValueMessage(msg);\n\t\tvar songTitle = currentSong.Title+' - '+currentSong.Artist;\n\t\tif (songTitle !== songData.value.title && songData.value.playing)\n\t\t\tsongData.value.title = songTitle;\n\t});\n}", "title": "" }, { "docid": "62bf0f5fee091b517436b83dbdd98b4b", "score": "0.5993251", "text": "changeHandler(title) {\n this.setState({ title })\n }", "title": "" }, { "docid": "2a7f442c0099c4fdecc0ddae65ed68b9", "score": "0.59815115", "text": "changeSubTitle (input) {\n this.setState({ subTitle: input })\n }", "title": "" }, { "docid": "b42522e26172b80a04ee4a8f116764df", "score": "0.5967042", "text": "function handleStateChangeOnClient(title) {\n document.title = title || '';\n}", "title": "" }, { "docid": "1624085f6e0404d468b7ab88d66cb12e", "score": "0.59400064", "text": "function update_page_title( song_title ) {\n if ( song_title.length > 30) {\n song_title = song_title.substr(0, 27) + '...';\n }\n\n document.title = ( song_title ? song_title + ' - ' : '' ) + \"SHREDDIT PLAYER\";\n}", "title": "" }, { "docid": "c65453a3d7c04dd510acb42ff5796605", "score": "0.5933897", "text": "handleInputChange(event) {\n const target = event.target;\n const playlistId = target.name;\n this.updateRelatedPlaylists();\n this.addOrRemoveSongToExistingPlaylist(playlistId);\n }", "title": "" }, { "docid": "4fe62f8d5a32d497cbdda9c828f0cb50", "score": "0.5898467", "text": "function privateAfterSongChanges(){\n\t\t/*\n\t\t\tAfter the new song is set, we see if we need to change\n\t\t\tthe visualization. If it's different, we need to start \n\t\t\tthe new one.\n\t\t*/\n\t\tif( privateCheckSongVisualization() ){\n\t\t\tprivateStartVisualization();\n\t\t}\n\n\t\t/*\n\t\t\tAfter the new song is set, Amplitude will update the\n\t\t\tvisual elements containing information about the\n\t\t\tnew song if the user wants Amplitude to.\n\t\t*/\n\t\tif( config.handle_song_elements ){\n\t\t\tprivateDisplaySongMetadata();\n\t\t}\n\n\t\t/*\n\t\t\tSync song status sliders. Sets them back to 0 because\n\t\t\twhen the song is changing there won't be any songs currently\n\t\t\tplaying.\n\t\t*/\n\t\tprivateResetSongStatusSliders();\n\n\t\t/*\n\t\t\tWe set the current times to 0:00 when song changes\n\t\t\tso all of the page's players will be synchronized.\n\t\t*/\n\t\tprivateSyncCurrentTimes();\n\n\t\t/*\n\t\t\tRemove class from all containers\n\t\t*/\n\t\tprivateSyncVisualPlayingContainers();\n\n\t\t/*\n\t\t\tSet new active song container by applying a class\n\t\t\tto the visual element containing the visual representation\n\t\t\tof the song that is actively playing.\n\t\t*/\n\t\tprivateSetActiveContainer();\n\n\t\t/*\n\t\t\tPlays the new song.\n\t\t*/\n\t\tprivatePlay();\n\t}", "title": "" }, { "docid": "388aa15ce3faaae145bbc965e57cd90d", "score": "0.5886813", "text": "function changeListNameInAppData(event, newTitle) {\n // const newTitle = event.target.closest('.oneLists').querySelector('.inputTag').value;\n const oldTitle = event.target.closest('.oneLists').querySelector('.tagText').textContent;\n const listInAppData = appData.lists.board.find((DataTitle) => oldTitle === DataTitle.title);\n\n listInAppData.title = newTitle\n\n}", "title": "" }, { "docid": "5bd76122ac28e064d5b8f48c0652827e", "score": "0.5886474", "text": "onInputChange(event) {\n this.setState({ title: event.target.value });\n }", "title": "" }, { "docid": "76a4828f4fc60de473acd7e43f2225cd", "score": "0.58792824", "text": "titleClick(e){\n e.preventDefault();\n \n this.setState({\n titleAdded: true,\n title: this.state.titleInput,\n titleInput: ''\n });\n \n }", "title": "" }, { "docid": "23c59f0aedc8626b379a86ac37803c22", "score": "0.5870907", "text": "function displayChanger(event, newTitle) {\n const finalTitle = event.target.parentNode.querySelector('.tagText')\n\n changeListNameInAppData(event, newTitle);\n finalTitle.textContent = newTitle;\n\n event.target.style.display = 'none';\n finalTitle.style.display = 'inline-block'\n\n}", "title": "" }, { "docid": "6c144cd84d2cad280f8d144adfb3f744", "score": "0.5867667", "text": "update()\n {\n const meta = efflux.activeSong.meta;\n\n title.value = meta.title;\n author.value = meta.author;\n }", "title": "" }, { "docid": "e9992a42f38cfe3ff77319f0b9ba1fca", "score": "0.5864849", "text": "onChangeMovieTitle(e) {\n this.setState({\n Title: e.target.value\n });\n }", "title": "" }, { "docid": "53a7fa7158d4836ad8dbc4de6049b1fc", "score": "0.58510345", "text": "changeTitle() {\n this.title = \"new title\";\n }", "title": "" }, { "docid": "53982b53bc912de519fbf1a446c6a836", "score": "0.57914597", "text": "function handleDetailsEdit() {\n li.dispatchEvent(new CustomEvent(\"edit-song\", {\n detail: {\n artist: artistInput.textContent,\n album: albumInput.textContent,\n title: titleInput.textContent\n }\n }));\n }", "title": "" }, { "docid": "e267e24819cc48ef85e36187aa46fbb4", "score": "0.57895875", "text": "_onChangeText(text) {\n this.setState({\n title: text\n });\n }", "title": "" }, { "docid": "23d77daa1cad12ab8f59e99ef99d37c3", "score": "0.5781686", "text": "function mediaPlayerOpeningHandler() {\n insertText(\"playingSongTitle\",currentPlayFileName);\n}", "title": "" }, { "docid": "2532b5096d12f0767bdc66361332c55e", "score": "0.57729673", "text": "onChangeMovieTitle(e){\n this.setState({\n Title:e.target.value\n })\n }", "title": "" }, { "docid": "904d7363c63ab41dc232d5a9a67f174f", "score": "0.57676774", "text": "function updateTitle(str) {\n title.text(str)\n}", "title": "" }, { "docid": "c6ca86246a508809221607a34e417cd3", "score": "0.57652205", "text": "handleTitleChange(text) {\n this.setState({ recipeTitle: text });\n }", "title": "" }, { "docid": "2dc7bbd90ff35ca501aa3b299ad3ca6f", "score": "0.5759414", "text": "function inputUpdateTitle() {\n inputNewArticleTitle.value = inputNewArticleTitleVisible.value\n}", "title": "" }, { "docid": "33b1956c8e622360a56957704003c9af", "score": "0.57558256", "text": "function addTitleListener() {\n\n $('#current-note-title').blur(function() {\n saveTitle();\n });\n\n document.getElementById('current-note-title').addEventListener('keydown' ,function(event) {\n var targetElement = event.target || event.srcElement;\n if (event.key == \"Enter\") {\n targetElement.blur();\n }\n else if (targetElement.textContent.length > 31 && event.key != \"Backspace\" && event.key != \"ArrowLeft\" && event.key != \"ArrowRight\") {\n event.preventDefault();\n }\n });\n\n}", "title": "" }, { "docid": "55b91dee2ad1715c1c1770e6cfe1f117", "score": "0.5754231", "text": "function addSongToMyPlaylist(title) {\n console.log(title);\n let newSong =getSongByTitle(title); // Using getSongByTitle(), add the song to myPlaylist\n if(getSongByTitle === title)\n {\n addSong(newSong);\n }else{\n addSong(title);\n }\n }", "title": "" }, { "docid": "2f930c2459c7d810897803f440679287", "score": "0.5741741", "text": "function change() {\n\n\tif (this.id == 'noun') {\n\n\t\tnounsNum++;\n\t\n\t\tif (nounsNum > nouns.length - 1) {\n\t\n\t\t nounsNum = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(nouns[nounsNum]);\n\t\n\t }\n\n\t if (this.id == 'verb') {\n\n\t\tverbsNum++;\n\t\n\t\tif (verbsNum > verbs.length - 1) {\n\t\n\t\t verbsNum = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(verbs[verbsNum]);\n\t\n\t }\n\n\t if (this.id == 'adjectives') {\n\n\t\tadjectivesNum++;\n\t\n\t\tif (adjectivesNum > adjectives.length - 1) {\n\t\n\t\t adjectivesNum = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(adjectives[adjectivesNum]);\n\t\n\t }\n\n\t if (this.id == 'nouns2') {\n\n\t\tnouns2Num++;\n\t\n\t\tif (nouns2Num > nouns2.length - 1) {\n\t\n\t\t nouns2Num = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(nouns2[nouns2Num]);\n\t\n\t }\n\n\t if (this.id == 'places') {\n\n\t\tplacesNum++;\n\t\n\t\tif (placesNum > places.length - 1) {\n\t\n\t\t placesNum = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(places[placesNum]);\n\t\n\t }\n}", "title": "" }, { "docid": "2c3f3aa933373b921e92ed16dc1e638d", "score": "0.5727079", "text": "function updateTitle(text) {\n $title.text(text);\n }", "title": "" }, { "docid": "cba65be2a5b5512c88e250ec770c2d36", "score": "0.57171756", "text": "function onTitleChange(_) {\n const noNotificationTitle = get_no_notification_title(document.title);\n if (document.title !== noNotificationTitle)\n document.title = noNotificationTitle\n}", "title": "" }, { "docid": "f6332737e967d66558c6cd5940339a15", "score": "0.57089406", "text": "function onPlayerChange( event ) {\n switch( event.data ) {\n case -1:\n // unstarted\n loading( 'stop' );\n break;\n case 0:\n // ended -- reload playlist if we just played the last song\n if( ( player.getPlaylistIndex() + 1 ) == Object.keys( shredlist ).length ) {\n get_playlist_and_play();\n }\n break;\n case 1:\n // playing\n loading( 'stop' );\n break;\n case 2:\n // paused\n loading( 'stop' );\n break;\n case 3:\n // buffering\n loading( 'start' );\n break;\n case 5:\n // cued\n loading( 'stop' );\n player.playVideo();\n break;\n }\n \n // Update play button state if needed \n if( is_playing() ) {\n button_play_show( 'pause' );\n } else {\n button_play_show( 'play' );\n }\n \n // Update \"Currently playing\" if needed\n var current = player.getPlaylist() [ player.getPlaylistIndex() ];\n if( current_song != current ) {\n current_song = current;\n update_currently( shredlist[ current ] );\n }\n\n}", "title": "" }, { "docid": "e7acad13a83e761d9faca2105aa25304", "score": "0.5703214", "text": "function music(songTitle) {\n let song = songTitle || process.argv[3];\n if (song === undefined) {\n console.log(chalk.red(`\\nHave you heard my favorite song? It's called \"Pink Shoe Laces.\"\\n`))\n song = \"Pink Shoe Laces\"\n }\n spotify.search({ type: 'track', query: song, limit: 7 }, function (err, data) {\n if (err) {\n return console.log('\\nError occurred: ' + err);\n } else if (data.tracks.items.length === 0) {\n console.log(chalk.red(`\\nI'm sorry but I can't find that track. Please try another track.`))\n } else {\n console.log(chalk.green(`\\nI found a few listings for ${song}.\\n`))\n logIt(`\\n\\n${song}:\\n`)\n\n for (let i = 0; i < data.tracks.items.length; i++) {\n console.log(chalk.cyan(`• ${data.tracks.items[i].name} was recorded by ${data.tracks.items[i].artists[0].name} on ${data.tracks.items[i].album.name}.\\nPreivew at Spotify: ${data.tracks.items[i].preview_url}\\n`))\n\n logIt(`\\t• ${data.tracks.items[i].name} was recorded by ${data.tracks.items[i].artists[0].name} on ${data.tracks.items[i].album.name}`)\n }\n }\n });\n}", "title": "" }, { "docid": "5eb417af82b6850de5fcd3e1e397ca20", "score": "0.56877893", "text": "function spotifySong(title){\n // console.log(title);\n if(title === \"\"){\n spotify.search({ type: 'track', query: 'the sign ace of base' }, function(err, data) {\n if (err) {\n return logger.all('Error: ' + err);\n } \n logger.all(\"Artist(s): \" + data.tracks.items[0].artists[0].name);\n logger.all(\"Song name: \" + data.tracks.items[0].name);\n logger.all(\"Preview link: \" + data.tracks.items[0].preview_url);\n logger.all(\"Album: \" + data.tracks.items[0].album.name + \"\\n\");\n });\n }else{\n spotify.search({type: 'track', query: title }, function(err, data) {\n if (err) {\n return logger.all('Error: ' + err);\n } \n logger.all(\"Artist(s): \" + data.tracks.items[0].artists[0].name);\n logger.all(\"Song name: \" + data.tracks.items[0].name);\n\t\t\tlogger.all(\"Preview link: \" + data.tracks.items[0].preview_url);\n\t\t\tlogger.all(\"Album: \" + data.tracks.items[0].album.name + \"\\n\");\n });\n }\n\n}", "title": "" }, { "docid": "d35f5212d4f655acc7ca8eafc00e909e", "score": "0.56869024", "text": "function swapSongInfo()\r\n{\r\n\tvar artistInput = document.getElementById(\"lastfm-artist\");\r\n\tvar titleInput = document.getElementById(\"lastfm-title\");\r\n\t\r\n\tvar oldArtist = artistInput.value;\r\n\tvar oldTitle = titleInput.value;\r\n\t\r\n\tartistInput.value = oldTitle;\r\n\ttitleInput.value = oldArtist;\r\n}", "title": "" }, { "docid": "29bbe81a60633ca81cc31e88a0b0937d", "score": "0.56859136", "text": "function setListener1(title) {\n return function() {\n localStorage.setItem('currentMovieTitle', title);\n }; \n \n }", "title": "" }, { "docid": "d9f8b9f46386fa50a9d7f3b280f3039d", "score": "0.5684976", "text": "function NameChanged()\n\t\t{\n\t\t\tnameChanged = 1;\n\t\t}", "title": "" }, { "docid": "f74c02ee137eb56ec8c06c1557a4247a", "score": "0.56462103", "text": "changeTitle(title, newTitle) {\n\t\tif (!this.listed(title)) {\n\t\t\tthrow new Error(`Todo: '${title}' is not listed in the project display.`);\n\t\t}\n\n\t\tvar listing = this._listings[title];\n\t\tvar listingTitle = listing.querySelector('.title');\n\n\t\tlisting.id = newTitle;\n\t\tlistingTitle.value = newTitle;\n\n\t\tthis._listings[newTitle] = listing;\n\t\tif (title != newTitle) {\n\t\t\tdelete this._listings[title];\n\t\t}\n\t}", "title": "" }, { "docid": "7ff9903ca7117c666a48520e19c14f04", "score": "0.564548", "text": "function updateListener(tabId, changeInfo, tab) {\r\n\t//Only call this when a new original page is loaded.\r\n\tif(\r\n\t\tchangeInfo.title == undefined //not a title change. \r\n\t\t|| indexTitleRegex.test(changeInfo.title) //a title change triggered by this extension. (Not considering the rare case where an original title starting with this regex)\r\n\t\t|| isChromeUrl(tab.url) //no need update title\r\n\t\t) {\r\n\t\treturn;\r\n\t}\r\n\t//console.log(changeInfo);\r\n\t//console.log(tab);\r\n\r\n\tupdate(tab);\r\n}", "title": "" }, { "docid": "19d53a9ceb4a5b0ade3534bb5fda532f", "score": "0.564205", "text": "function enterTitle() {\n var opts = $.extend({}, popOpts);\n opts.content = '<input type=\"text\" id=\"new-track-title-input\" placeholder=\"Enter a title and hit enter\" />' +\n '<br /><span class=\"info_error\">Sorry, we need a title name</span>';;\n opts.title = 'New track title';\n $('#new-track-title a')\n .popover(opts)\n .popover('show');\n $('#new-track-title-input').val(pendingTrack.title);\n $('#new-track-title-input').focus();\n }", "title": "" }, { "docid": "43b425090de382ad6ed88ce688e63762", "score": "0.56375474", "text": "function MusicRecognitionInput() {\n }", "title": "" }, { "docid": "93f010a8be4b6643e00e78b8dfe883ca", "score": "0.5636312", "text": "function addSongNameClickEvent(songObj, position) {\n var songName = songObj.fileName; // New Variable\n var id = '#song' + position; //check for string are match or not with old played song\n $(id).click(function() {\n var audio = document.querySelector('audio');\n var currentSong = audio.src;\n if (currentSong.search(songName) != -1) {\n toggleSong();\n } else {\n audio.src = songName;\n toggleSong();\n changeCurrentSongDetails(songObj); // Function Call\n }\n });\n}", "title": "" }, { "docid": "bf5927d8aa9fc9163d0c405b410c6d98", "score": "0.5634612", "text": "function UpdateWindowTitle(result)\n {\n var strNewTitle;\n var reSongTitle;\n var matchSongTitle;\n var strSongTitle = \"\";\n var strArtist;\n var strHTML;\n var strTemp;\n var iStartPos, iEndPos;\n\n\n // If there was a problem sending our HTTP request, let user know\n // about it.\n if (result.status != '200')\n {\n document.title = '[INFO UNAVAILABLE]';\n return;\n }\n\n // Retrieve the HTML sent back to us.\n strHTML = result.responseText;\n\n // Parse the retrieved HTML looking for info about the currently\n // playing track. Info will appear similar to the following:\n //\n // <div id=\"nowplaying\"><br /><br /><a href=\"/track.asp?track=311776\" style=\"color: #000000; font-weight: normal;\">&quot;&nbsp;Nowhere To Go But Home&nbsp;&quot;</a><br /><a href=\"/artist.asp?track=311776\" style=\"color: #000000; font-weight: normal;\">Six By Seven</a></div>\n iStartPos = strHTML.indexOf('<div id=\"nowplaying\">');\n strTemp = strHTML.substring(iStartPos, strHTML.length)\n iEndPos = strTemp.indexOf('</div>');\n strTemp = strTemp.substring(0, iEndPos);\n\n // Find the song title\n reSongTitle = new RegExp(/&quot;&nbsp;.*&nbsp;&quot;/);\n matchSongTitle = reSongTitle.exec(strTemp);\n\n if (matchSongTitle == null)\n {\n strSongTitle = '[INFO UNAVAILABLE]';\n return;\n }\n else\n {\n for (i = 0; i < matchSongTitle.length; i++)\n {\n strSongTitle = strSongTitle + matchSongTitle[i];\n }\n }\n\n strSongTitle = strSongTitle.replace(/&quot;&nbsp;/, \"\");\n strSongTitle = strSongTitle.replace(/&nbsp;&quot;/, \"\");\n\n // Find the artist\n iStartPos = strTemp.indexOf('<a href=\"/artist.asp');\n strTemp = strTemp.substring(iStartPos, strTemp.length);\n iStartPos = strTemp.indexOf('>');\n iEndPos = strTemp.indexOf('</a>');\n strArtist = strTemp.substring(iStartPos + 1, iEndPos);\n strNewTitle = strArtist + ' - \"' + strSongTitle + '\"';\n\n // Set the title of the window to 'ARTIST - \"Song Title\"'\n document.title = strNewTitle;\n }", "title": "" }, { "docid": "f4aa18c085f0cc5eb09a877c7e34b5fa", "score": "0.56264323", "text": "function changeTitleSearchResults(inputText) {\n titleSearchResult.innerHTML = inputText;\n}", "title": "" }, { "docid": "9476339cdcd48ca4edb0f43c44d43797", "score": "0.5620282", "text": "function onItemChange(){\n\t\tvar objItem = g_gallery.getSelectedItem();\n\t\tt.setText(objItem.title, objItem.description);\n\t}", "title": "" }, { "docid": "9476339cdcd48ca4edb0f43c44d43797", "score": "0.5620282", "text": "function onItemChange(){\n\t\tvar objItem = g_gallery.getSelectedItem();\n\t\tt.setText(objItem.title, objItem.description);\n\t}", "title": "" }, { "docid": "57fc1045150a6192acf437276358c3af", "score": "0.5617179", "text": "function dynamicTitle(){\n var titleText = \"Title..\"; \n //default text after load \n subjectEl.value = titleText;\n\n //on focus behaviour \n subjectEl.onfocus = function() { \n if (this.value == titleText){\n \n //clear text field \n this.value = ''; }\n } \n //on blur behaviour\n subjectEl.onblur = function() { \n if (this.value == \"\") {\n \n //restore default text \n this.value = titleText; }\n };\n}", "title": "" }, { "docid": "ffb0621084dcb2de6c938efca7b6b52c", "score": "0.56169397", "text": "selectNewTitle() {\n $scope.compoData.title =\n HsSaveMapManagerService.statusData.guessedTitle;\n $scope.changeTitle = true;\n }", "title": "" }, { "docid": "1c4307683f49418945f255b62fea16ae", "score": "0.5607064", "text": "function note_button_callback(pitch) {\n songList.name = song_title_box.value;\n note_production_label.note = note;\n setProductionNotePitch(pitch);\n}", "title": "" }, { "docid": "9ecaf42d11829e199a67cfa72d2fe17b", "score": "0.55999964", "text": "function searchTrack() {\n //get user input\n const userInput = document.getElementById('searchtext')\n //if invalid input, search error msg in else stmt\n const searchError = document.getElementById('searcherror')\n // reset audio bar for new search\n const audioBar = document.getElementById('audio')\n audioBar.src = \"\"\n //get value of the user input and validate it\n const userInputValue = userInput.value\n if(userInputValue != null && userInputValue != '') {\n //reset error msg\n searchError.innerText = ''\n \n updateTracks(userInputValue)\n\n }\n else {\n searchError.innerText = \"type name of artist or song\" \n }\n}", "title": "" }, { "docid": "38897d677af35c9331dd0f4684cc3d74", "score": "0.5598785", "text": "function handleChange( aEvent )\n{\n let meta = slocum.activeSong.meta;\n\n meta.title = title.value;\n meta.author = author.value;\n meta.tempo = parseInt( Form.getSelectedOption( tempo ), 10 );\n\n let newTuning = parseInt( Form.getSelectedOption( tuning ), 10 );\n\n if ( meta.tuning !== newTuning )\n {\n if ( SongUtil.hasContent( slocum.activeSong ))\n {\n Pubsub.publish( Messages.CONFIRM, {\n message: \"You are about to change song tuning, this means all existing notes \" +\n \"that aren't available in the new tuning will be removed. Are you sure?\",\n confirm: () => {\n SongUtil.sanitizeForTuning( slocum.activeSong, TIA.table.tunings[ newTuning ]);\n meta.tuning = newTuning;\n Pubsub.publish( Messages.REFRESH_SONG, slocum.activeSong );\n },\n cancel: () => {\n Form.setSelectedOption( tuning, meta.tuning );\n }\n });\n }\n else {\n meta.tuning = newTuning;\n }\n }\n}", "title": "" }, { "docid": "c4605374178717ebbcf7dbbfc8f93199", "score": "0.55965614", "text": "function playLibrarySong(song) {\n song.addEventListener('click', () => {getQueryData(song.innerText)});\n}", "title": "" }, { "docid": "60447606b7b42e0766aa059b3cf8a72f", "score": "0.55922645", "text": "function playSong(){\n \n song.src = songs[currentSong]; //set the source of 0th song \n \n songTitle.textContent = songs[currentSong]; // set the title of song\n }", "title": "" }, { "docid": "8abf57bc5a3bcb82024c0aa43cb5376b", "score": "0.5589728", "text": "function updateTextDetails(event) {\n tempIndex = parseInt(event.target.value.substr(event.target.value.length-1)) - 1;\n indexForCurrentText = tempIndex;\n document.getElementById(\"textTitle\").innerText = currentTextArray[tempIndex].title;\n document.getElementById(\"textAuthor\").innerText = currentTextArray[tempIndex].author + \" (\" + countWords(currentTextArray[tempIndex].content) + \" words, \" + currentTextArray[tempIndex].content.length + \" chars)\";\n document.getElementById(\"textContent\").innerText = currentTextArray[tempIndex].content;\n document.getElementById(\"playButton\").value = \"start\";\n}//end function updateTextDetails", "title": "" }, { "docid": "ffbb359109c6e543fbad6f4e2ad3f9be", "score": "0.5587361", "text": "function hashChanged() {\n var title = getCurrentHash();\n title = decodeURIComponent(title);\n if (title.indexOf(\"search.aspx\") == 0)\n // Its a full text search URL\n loadUrlOnFrame(title);\n else\n // Its a section title \n selectByTitle(title);\n}", "title": "" }, { "docid": "b21531788bf9b1e35963e4a640494f8a", "score": "0.55861384", "text": "addTitle( e ) {\n this.setState({ addTitle: e.target.value });\n }", "title": "" }, { "docid": "d8ad2530e541ba67d92401f5fca482d4", "score": "0.5568191", "text": "function songclick() {}", "title": "" }, { "docid": "f8e4b0e099d0dd4b2bb19bda22acfa89", "score": "0.5566596", "text": "function update_history_title_channel(title_id, channel_id) {\n $('#search_prompt').html(\"Searching for activities with the same title on the same channel.\");\n\n if (typeof snapshot_time == \"undefined\") {\n var url = '/tvdiary/history_json.jim?title_id=' + title_id + '&channel_id=' + channel_id;\n } else {\n var url = '/tvdiary/json/history_' + title_id + '_' + channel_id + '.json?nocache=' + today_start;\n }\n update_history(url, true);\n }", "title": "" }, { "docid": "7a025872292392a76514e14da7eee722", "score": "0.5553575", "text": "function displayChanger(event, newTitle) {\n const finalTitle = event.target.parentNode.querySelector('.tagText')\n\n changeListName(event, newTitle);\n finalTitle.textContent = newTitle;\n\n event.target.style.display = 'none';\n finalTitle.style.display = 'inline-block'\n }", "title": "" }, { "docid": "2d86971f259105d0d3b20570a3cfc5cb", "score": "0.5547647", "text": "function inputLitener(event) {\n let newTitle = event.target.value;\n\n if (event.type === 'keydown') {\n if (event.keyCode === 13) {\n autoReplaceEmptyInputValue(event, newTitle)\n }\n if (event.keyCode === 27) {\n autoReplaceEmptyInputValue(event, '')\n }\n }\n if (event.type === 'blur' && event.target.style.display !== 'none') {\n autoReplaceEmptyInputValue(event, newTitle)\n }\n }", "title": "" }, { "docid": "bea80f8ac448764bf20baf7fc871428e", "score": "0.5544141", "text": "updateTitle () {\n this.titleElement.textContent = document.title\n }", "title": "" }, { "docid": "f0a93645886413926e7f08c8ed13af59", "score": "0.5537776", "text": "function inputLitener(event) {\n let newTitle = event.target.value;\n\n\n if (event.type === 'keydown') {\n if (event.keyCode === 13) {\n autoReplaceEmptyInputValue(event, newTitle)\n }\n if (event.keyCode === 27) {\n autoReplaceEmptyInputValue(event, '')\n\n }\n }\n if (event.type === 'blur' && event.target.style.display !== 'none') {\n\n autoReplaceEmptyInputValue(event, newTitle)\n }\n\n\n}", "title": "" }, { "docid": "595322c65ac1cfb32037b5e4cbe2a38e", "score": "0.5532205", "text": "function updateTitle( title )\n{\n\tvar element = null;\n\t\n\t// Set the title via HTML content\n\telement = document.querySelector( '#title' );\n\telement.innerHTML = title;\t\n}", "title": "" } ]
10030df72badedf056d4618da2138b30
r = "x^2/R mod m"; x != r
[ { "docid": "fd317f4d725bff21ddef7b6aac8bc3e9", "score": "0.0", "text": "function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }", "title": "" } ]
[ { "docid": "1e0e8908f498af6607fcb168ec36e99b", "score": "0.5633903", "text": "function createModEvaluator(leftNode, rightNode) {\n createBinaryEvaluator('mod', leftNode, rightNode);\n }", "title": "" }, { "docid": "9c008e63e4fdb4feb8d0ffc7f71926d7", "score": "0.52878743", "text": "pattern1() {\n // get ints\n let max = 50\n let num1 = getRandomInt(max)\n let num2 = getRandomInt(max)\n let den1 = num1*getRandomInt(max/5)\n let den2 = num2*getRandomInt(max/5)\n\n // determine random operand\n let op = this.getOp()\n\n // create equation\n let equation = `${num1} divided by ${den1} ${op} ${num2} divided by ${den2}`\n return equation\n }", "title": "" }, { "docid": "1286240a3817f659b1977d75df328735", "score": "0.52605623", "text": "function automorphic(n){\n let sqr = Math.pow(n,2).toString()\n // console.log(sqr)\n let numStr = n.toString()\n for(let i=0; i<numStr.length; i++){\n if (sqr[sqr.length-numStr.length+i]!==numStr[i]){\n // console.log(sqr.length-numStr.length+i)\n return \"Not!!\"\n }\n }\n return \"Automorphic\"\n}", "title": "" }, { "docid": "0fea9a7f3747d0357d6c2936667cee6e", "score": "0.52494866", "text": "function amr341952() { return 'o = n'; }", "title": "" }, { "docid": "12b3aff0deed676a1c0276926dbf72cd", "score": "0.5248115", "text": "function r(u){return u%100===11?!0:u%10!==1}", "title": "" }, { "docid": "1c01ac7ee3e609f2b8e23c6b86e484ab", "score": "0.5244908", "text": "function gmod(n, m) {\n return ((n % m) + m) % m;\n}", "title": "" }, { "docid": "b567181e5e06dae0828d6b63988e3f16", "score": "0.52158356", "text": "function modulussw(){\nlet d1 = 10;\nlet d2 = 2;\nreturn d1**d2\n}", "title": "" }, { "docid": "09b9c53ad1ca9b768aa69bf61f84eb75", "score": "0.52156025", "text": "function liftm(binary, str) {\n return function(m1, m2) {\n if (typeof m1 === 'number') {\n m1 = m(m1)\n }\n if (typeof m2 === 'number') {\n m2 = m(m2)\n }\n return m(\n binary(m1.value, m2.value),\n \"(\" + m1.source + str + m2.source + \")\"\n );\n };\n}", "title": "" }, { "docid": "b9696e49b8e70cdbb861e68d765e7ddf", "score": "0.5213292", "text": "function evalVerify (req, res, e) {\n let v;\n try {\n v = math.eval(req.body.evalequation);\n } catch (error) {\n // console.error(error);\n return false;\n }\n if (v === parseInt(e.flag)) {\n const cara = e.caracters.sort(function (a, b) {\n return b.length - a.length;\n });\n let string = req.body.evalequation;\n for (const c in cara) {\n if (string.includes(cara[c])) {\n string = string.replace(cara[c], '');\n } else {\n return false;\n }\n }\n if (string === '') {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "0e96809c8e13452cbf2adf7046afa4ce", "score": "0.5211858", "text": "function r(d,m){var h=d.split(\"_\");return m%10===1&&m%100!==11?h[0]:m%10>=2&&m%10<=4&&(m%100<10||m%100>=20)?h[1]:h[2]}", "title": "" }, { "docid": "befcd6cc524d52e4dbf351fd16e5824d", "score": "0.51895916", "text": "function mathematise(x, op, y) {\n switch(op) {\n case \"+\":\n return x + y;\n break;\n case \"-\":\n return x - y;\n break;\n case \"*\":\n return roundFix(x * y);\n break;\n case \"/\":\n if (x === 0) {\n return 0;\n break;\n }\n else if (y === 0) {\n return \"dbz\"; //Divide By Zero (Error);\n break;\n }\n return roundFix(x / y);\n break;\n default:\n err(\"Invalid operator\");\n return;\n }\n }", "title": "" }, { "docid": "03f825b92cf7dff58869310014ab883a", "score": "0.5184187", "text": "myMod(n, m) {\n \treturn ((n % m) + m) % m;\n \t}", "title": "" }, { "docid": "d12b9bb3ac9f0063208b834435a8d772", "score": "0.5183805", "text": "function operation(l, r, o) {\n\t\t\t\t\t\tvar l = parseFloat(l);\n\t\t\t\t\t\tvar r = parseFloat(r);\n\t\t\t\t\t\tif (o == '*') {return l*r}\n\t\t\t\t\t\tif (o == '/') {return l/r}\n\t\t\t\t\t\tif (o == '-') {return l-r}\n\t\t\t\t\t\tif (o == '+') {return l+r}\n\t\t\t\t\t\tif (o == '%') {return l%r}\n\t\t\t\t\t\tconsole.error('could not make number');\n\t\t\t\t\t}", "title": "" }, { "docid": "79d0f111517a728c01c1b2e91bc1ec9a", "score": "0.51475805", "text": "function Bard_mod_real( a, b )\n{\n var q = a / b;\n return a - (Math.floor(q) * b);\n}", "title": "" }, { "docid": "60cb8bb882a7d014d07eebfb49337cf9", "score": "0.51408833", "text": "function mod(i, m) {\n return ((i % m) + m) % m;\n}", "title": "" }, { "docid": "f2e745584b495216bb4598e2fff4ba71", "score": "0.51359326", "text": "function equal() {\r\n secondNum = eval(result.innerHTML);\r\n if (operator == \"/\") {\r\n output = firstNum / secondNum;\r\n lengthCheck(output);\r\n }\r\n if (operator == \"x\") {\r\n output = firstNum * secondNum;\r\n lengthCheck(output);\r\n }\r\n if (operator == \"-\") {\r\n output = firstNum - secondNum;\r\n lengthCheck(output);\r\n }\r\n if (operator == \"+\") {\r\n output = firstNum + secondNum;\r\n lengthCheck(output);\r\n }\r\n firstNum = 0;\r\n secondNum = 0;\r\n }", "title": "" }, { "docid": "5f3b4adcef063ef5eb9c337ab68a47e3", "score": "0.51132476", "text": "function areModularInverses(a,b) {\n return isComprime(a,b);\n}", "title": "" }, { "docid": "9502553d97ae0fe0d5ffc9809fd3356c", "score": "0.5101829", "text": "mod(n, m) {\n return ((n % m) + m) % m;\n }", "title": "" }, { "docid": "5b7240ca0d0813ea08e2f91f40e560e4", "score": "0.509935", "text": "function r(e,t){if(t===e)return!0;if(0===e.indexOf(t)){if(\"/\"===t.substr(-1))return!0;if(\"/\"===e.substr(t.length,1))return!0}return!1}", "title": "" }, { "docid": "87bf729dc6437c084c75a2407f84e850", "score": "0.508752", "text": "mod(x, y) {\n return x % y;\n }", "title": "" }, { "docid": "c57303addcd57c7a994414c5ad9476cb", "score": "0.5086153", "text": "function remainderMath() {\n var Remainder = 33 % 14; //declaring a variable and assigning it a number value\n document.getElementById(\"rmn\").innerHTML =\n \"When you divide 33 by 14 you have a remainder of: \" + Remainder; //putting the value of result into HTML element with 'rmn' id\n}", "title": "" }, { "docid": "c4122f03d4fb717c18591887dc40ea29", "score": "0.50780606", "text": "function isMultiplyOrDivide(operator) {\n return operator == \"x\" || operator == \"/\";\n}", "title": "" }, { "docid": "785db37c5bf0db81017044a7a54dcafa", "score": "0.5072395", "text": "function euclideanModulo( n, m ) {\n\n\treturn ( ( n % m ) + m ) % m;\n\n}", "title": "" }, { "docid": "785db37c5bf0db81017044a7a54dcafa", "score": "0.5072395", "text": "function euclideanModulo( n, m ) {\n\n\treturn ( ( n % m ) + m ) % m;\n\n}", "title": "" }, { "docid": "785db37c5bf0db81017044a7a54dcafa", "score": "0.5072395", "text": "function euclideanModulo( n, m ) {\n\n\treturn ( ( n % m ) + m ) % m;\n\n}", "title": "" }, { "docid": "c69c47b16ffa42a72fead555e526e794", "score": "0.5062936", "text": "function isRegister(operand) {\n if (/^[R][0-9A-F]$/g.test(operand))\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "b773e2cdfeac7890563ae659182017a3", "score": "0.5060185", "text": "function mod_(x, n) {\n if (s4.length != x.length) s4 = dup(x);else copy_(s4, x);\n if (s5.length != x.length) s5 = dup(x);\n divide_(s4, n, s5, x); //x = remainder of s4 / n\n}", "title": "" }, { "docid": "fff34b9e52da8241c58f7ae57e0b5bd9", "score": "0.50588495", "text": "function r(m,h){var L=m.split(\"_\");return h%10===1&&h%100!==11?L[0]:h%10>=2&&h%10<=4&&(h%100<10||h%100>=20)?L[1]:L[2]}", "title": "" }, { "docid": "035cff7a5a63b5e78d4c71459f89eb23", "score": "0.5048504", "text": "function findRemainder(a, b){\n return a % b;\n }", "title": "" }, { "docid": "726a71f65c40da42ef150c98574eb2f9", "score": "0.50431675", "text": "function bnpDivRemTo(m,q,r) {\r\n var pm = m.abs();\r\n if(pm.t <= 0) return;\r\n var pt = this.abs();\r\n if(pt.t < pm.t) {\r\n if(q != null) q.fromInt(0);\r\n if(r != null) this.copyTo(r);\r\n return;\r\n }\r\n if(r == null) r = nbi();\r\n var y = nbi(), ts = this.s, ms = m.s;\r\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\r\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\r\n else { pm.copyTo(y); pt.copyTo(r); }\r\n var ys = y.t;\r\n var y0 = y[ys-1];\r\n if(y0 == 0) return;\r\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\r\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\r\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\r\n y.dlShiftTo(j,t);\r\n if(r.compareTo(t) >= 0) {\r\n r[r.t++] = 1;\r\n r.subTo(t,r);\r\n }\r\n BigInteger.ONE.dlShiftTo(ys,t);\r\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\r\n while(y.t < ys) y[y.t++] = 0;\r\n while(--j >= 0) {\r\n // Estimate quotient digit\r\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\r\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\r\n y.dlShiftTo(j,t);\r\n r.subTo(t,r);\r\n while(r[i] < --qd) r.subTo(t,r);\r\n }\r\n }\r\n if(q != null) {\r\n r.drShiftTo(ys,q);\r\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\r\n }\r\n r.t = ys;\r\n r.clamp();\r\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\r\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\r\n }", "title": "" }, { "docid": "726a71f65c40da42ef150c98574eb2f9", "score": "0.50431675", "text": "function bnpDivRemTo(m,q,r) {\r\n var pm = m.abs();\r\n if(pm.t <= 0) return;\r\n var pt = this.abs();\r\n if(pt.t < pm.t) {\r\n if(q != null) q.fromInt(0);\r\n if(r != null) this.copyTo(r);\r\n return;\r\n }\r\n if(r == null) r = nbi();\r\n var y = nbi(), ts = this.s, ms = m.s;\r\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\r\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\r\n else { pm.copyTo(y); pt.copyTo(r); }\r\n var ys = y.t;\r\n var y0 = y[ys-1];\r\n if(y0 == 0) return;\r\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\r\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\r\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\r\n y.dlShiftTo(j,t);\r\n if(r.compareTo(t) >= 0) {\r\n r[r.t++] = 1;\r\n r.subTo(t,r);\r\n }\r\n BigInteger.ONE.dlShiftTo(ys,t);\r\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\r\n while(y.t < ys) y[y.t++] = 0;\r\n while(--j >= 0) {\r\n // Estimate quotient digit\r\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\r\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\r\n y.dlShiftTo(j,t);\r\n r.subTo(t,r);\r\n while(r[i] < --qd) r.subTo(t,r);\r\n }\r\n }\r\n if(q != null) {\r\n r.drShiftTo(ys,q);\r\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\r\n }\r\n r.t = ys;\r\n r.clamp();\r\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\r\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\r\n }", "title": "" }, { "docid": "1a099c0d16920090b9e7d481685f202b", "score": "0.5035833", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "1a099c0d16920090b9e7d481685f202b", "score": "0.5035833", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "1a099c0d16920090b9e7d481685f202b", "score": "0.5035833", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "1a099c0d16920090b9e7d481685f202b", "score": "0.5035833", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "eabf36653101ad35ffe2715d8b25cac6", "score": "0.5035006", "text": "function mod(n, m) {\n return ((n % m) + m) % m\n}", "title": "" }, { "docid": "e4c88c7536f78813f91dbf15ae913b77", "score": "0.5031308", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "e4c88c7536f78813f91dbf15ae913b77", "score": "0.5031308", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "5befab3286d2f1dc12d0090a7e7c2479", "score": "0.50293565", "text": "function complexMod2() {\n return this.re * this.re + this.im * this.im;\n}", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.5027726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "d204f876ef453c331129b6735e02f642", "score": "0.50223047", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "d204f876ef453c331129b6735e02f642", "score": "0.50223047", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "d204f876ef453c331129b6735e02f642", "score": "0.50223047", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "d204f876ef453c331129b6735e02f642", "score": "0.50223047", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "d204f876ef453c331129b6735e02f642", "score": "0.50223047", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "d204f876ef453c331129b6735e02f642", "score": "0.50223047", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "d204f876ef453c331129b6735e02f642", "score": "0.50223047", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "8983dc16cf55230b111b5464408031ba", "score": "0.5019374", "text": "function mul(str, d) {\n return d.toString(2).split('').reduceRight((obj, b) => {\n let {res, last} = obj;\n if (b === '1') res = sumStrings(res, last);\n last = sumStrings(last, last);\n return {res, last}\n }, {res: '0', last: str}).res;\n}", "title": "" }, { "docid": "ea76306e9a3e557b8c9e868b03cab384", "score": "0.50159293", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.501503", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3b622fb7c2cd3f7e8a3d0a923795e64e", "score": "0.50133574", "text": "function mod(n, m) {\n return ((n % m) + m) % m;\n }", "title": "" }, { "docid": "3ef77556d7d0967fdd9db4339d259c1e", "score": "0.50126547", "text": "function mod(n, m) {\n return ((n % m) + m) % m;\n}", "title": "" }, { "docid": "3ef77556d7d0967fdd9db4339d259c1e", "score": "0.50126547", "text": "function mod(n, m) {\n return ((n % m) + m) % m;\n}", "title": "" }, { "docid": "3ef77556d7d0967fdd9db4339d259c1e", "score": "0.50126547", "text": "function mod(n, m) {\n return ((n % m) + m) % m;\n}", "title": "" }, { "docid": "3ef77556d7d0967fdd9db4339d259c1e", "score": "0.50126547", "text": "function mod(n, m) {\n return ((n % m) + m) % m;\n}", "title": "" }, { "docid": "fe59ccd0abd9c0d0798cd10415ddba2c", "score": "0.50119716", "text": "function norm(r, b){\n b = b.split(/\\//)\n r = r.replace(/\\.\\.\\//g,function(){ b.pop(); return ''}).replace(/\\.\\//g, '')\n var v = b.join('/')+ '/' + r\n if(v.charAt(0)!='/') v = '/'+v\n return v\n }", "title": "" }, { "docid": "21038cacc14a74f9feca19a123f6c83e", "score": "0.50110805", "text": "function mod(num, m) {\n return ((num % m) + m) % m;\n }", "title": "" }, { "docid": "4dd6d9b6bc34e27538859a8ecf177bef", "score": "0.50075245", "text": "function mod(n1, n2){\n return n1 % n2\n}", "title": "" }, { "docid": "6e02c262781f80a293699a85adc936ff", "score": "0.5005737", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "6e02c262781f80a293699a85adc936ff", "score": "0.5005737", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "1ee082a907dd12d10e5de5aa80bebee7", "score": "0.5003123", "text": "function Jr(e){return\"number\"==typeof e&&e==e&&e!==1/0&&e!==-1/0}", "title": "" }, { "docid": "1589538ceba6a409fd2a397ee774bea8", "score": "0.5002575", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "c6fbb2d28a9f767f3d2390c17031669a", "score": "0.49985722", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "c6fbb2d28a9f767f3d2390c17031669a", "score": "0.49985722", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "6f925d2a6cc826da3a71e1f5efe44fee", "score": "0.4997855", "text": "function mod(input, div){\n return(input % div+div) % div;\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.49967244", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.49967244", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.49967244", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.49967244", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.49967244", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "ec53542d9d989e18ac2257be45f924d3", "score": "0.49940458", "text": "function addRad(m) {\n if (m === 0) {\n return 1;}\n return m * 4;\n }", "title": "" } ]
318736f8528d214143eb5bd870eec59f
Populate `_hostNode` on each child of `inst`, assuming that the children match up with the DOM (element) children of `node`. We cache entire levels at once to avoid an n^2 problem where we access the children of a node sequentially and have to walk from the start to our target node every time. Since we update `_renderedChildren` and the actual DOM at (slightly) different times, we could race here and see a newer `_renderedChildren` than the DOM nodes we see. To avoid this, ReactMultiChild calls `prepareToManageChildren` before we change `_renderedChildren`, at which time the container's child nodes are always cached (until it unmounts).
[ { "docid": "d99353812b4eb7ffff0f7459f442d299", "score": "0.0", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (shouldPrecacheNode(childNode, childID)) {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" } ]
[ { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65572757", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65572757", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65572757", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65572757", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "9669cac92d34e7df38a97b64114d0b36", "score": "0.65546995", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "9669cac92d34e7df38a97b64114d0b36", "score": "0.65546995", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "914f5955ab51b0b53e57fcbfaa5557ac", "score": "0.65086025", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n\n var childInst = children[name];\n\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n } // We assume the child nodes are in the same order as the child instances.\n\n\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n } // We reached the end of the DOM children without finding an ID match.\n\n\n !false ? \"development\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6501298", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "e29de4c76f5a8a227eb76e26c71a8176", "score": "0.64986664", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "e29de4c76f5a8a227eb76e26c71a8176", "score": "0.64986664", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "34910bf074de956a5ea125c6d6f61852", "score": "0.6496656", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? 'development' !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "51debe9fb3818486e767efe3f113988c", "score": "0.6492846", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? \"production\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "51debe9fb3818486e767efe3f113988c", "score": "0.6492846", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? \"production\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "51debe9fb3818486e767efe3f113988c", "score": "0.6492846", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? \"production\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.646744", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.646744", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.646744", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.646744", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.646744", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.646744", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.646744", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.646744", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.646744", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "aad2410e537739fa41ccc3c9c262918c", "score": "0.6463581", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : undefined : undefined;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.6463321", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "d3f9437483c00555bf781905f7064cc8", "score": "0.64595574", "text": "function precacheChildNodes(inst, node) {\r\n if (inst._flags & Flags.hasCachedChildNodes) {\r\n return;\r\n }\r\n var children = inst._renderedChildren;\r\n var childNode = node.firstChild;\r\n outer: for (var name in children) {\r\n if (!children.hasOwnProperty(name)) {\r\n continue;\r\n }\r\n var childInst = children[name];\r\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\r\n if (childID === 0) {\r\n // We're currently unmounting this child in ReactMultiChild; skip it.\r\n continue;\r\n }\r\n // We assume the child nodes are in the same order as the child instances.\r\n for (; childNode !== null; childNode = childNode.nextSibling) {\r\n if (shouldPrecacheNode(childNode, childID)) {\r\n precacheNode(childInst, childNode);\r\n continue outer;\r\n }\r\n }\r\n // We reached the end of the DOM children without finding an ID match.\r\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\r\n }\r\n inst._flags |= Flags.hasCachedChildNodes;\r\n}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64575267", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "37f02001d130e394327475995d61467c", "score": "0.64564055", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "37f02001d130e394327475995d61467c", "score": "0.64564055", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "37f02001d130e394327475995d61467c", "score": "0.64564055", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "37f02001d130e394327475995d61467c", "score": "0.64564055", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "37f02001d130e394327475995d61467c", "score": "0.64564055", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "37f02001d130e394327475995d61467c", "score": "0.64564055", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "37f02001d130e394327475995d61467c", "score": "0.64564055", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "37f02001d130e394327475995d61467c", "score": "0.64564055", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "37f02001d130e394327475995d61467c", "score": "0.64564055", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" } ]
a7aac160b02ad30dcec88e3e1a1b3d65
Create and return a new ReactElement of the given type. See
[ { "docid": "8b32937b5b36337992b8e06d69b1f587", "score": "0.0", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\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[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "title": "" } ]
[ { "docid": "ba89f7470e9f759722c6a227e170b58d", "score": "0.70513713", "text": "function CreateType (props) {\n const {as, children, ...remainder} = props\n return React.createElement(as || 'span', remainder, children)\n}", "title": "" }, { "docid": "8d9f98312fc7c5eb18bccc8b52e7b155", "score": "0.67765003", "text": "createPageElement(gmctx, type, props) {\n return React.createElement(type, props);\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.6745889", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "bc9e90284790cc09e4b12a270bd3f05b", "score": "0.652259", "text": "static create(type, properties, ...children) {\n if (type instanceof Function) {\n return new type(properties, children).element;\n }\n else if (typeof type === 'string') {\n const attributes = this.getProperties(properties);\n const content = this.getChildren(children);\n if (content.length) {\n return `<${type}${attributes.length ? ` ${attributes}` : ''}>${content}</${type}>`;\n }\n else {\n return `<${type}${attributes.length ? ` ${attributes}` : ''}/>`;\n }\n }\n else {\n throw new TypeError(`Unsupported element or component type \"${type}\"`);\n }\n }", "title": "" }, { "docid": "3ef97776bbac63712a54ae48f724ca14", "score": "0.6443067", "text": "function createElement(type, props, ...children) {\n return {\n type,\n props: {\n ...props,\n children: children.map(child =>\n typeof child === \"object\" ? child : createTextElement(child)\n )\n }\n };\n}", "title": "" }, { "docid": "03b94fbb31ed47c7d6acd368d4173095", "score": "0.641537", "text": "function createElement(type, props, ...children) {\n\treturn {\n\t\ttype,\n\t\tprops: {\n\t\t\t...props, // use the spread operator for the props\n\t\t\tchildren,\n\t\t},\n\t};\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.6406998", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.6406998", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.6406998", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "64b5399f145433e9b2a3509d59099b3d", "score": "0.63938147", "text": "function createElement (type, props, ...children) {\n return {\n type,\n props: {\n ...props,\n children: children.length <= 1 ? children[0] : children\n }\n }\n}", "title": "" }, { "docid": "455808d1a3e8125255262e30cfc2c2c6", "score": "0.6382126", "text": "function createElement(type, attributes, ...children) {\n if (Assert.isPlainType(type)) {\n return createPlainElement(type, attributes, children);\n }\n else if (Assert.isClassType(type)) {\n return createClassElement(type, attributes, children);\n }\n else {\n throw new TypeError(`Element type isn't supported.`);\n }\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.637205", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.6344786", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "db41dfea0c31044015006adbec743b9f", "score": "0.633522", "text": "function elt(type) {\n var node = document.createElement(type);\n for (var i = 1; i < arguments.length; i++) {\n var child = arguments[i];\n if (typeof child == \"string\")\n child = document.createTextNode(child);\n node.appendChild(child);\n }\n return node;\n}", "title": "" }, { "docid": "f158520e2f2e2fd7890557ce0b412227", "score": "0.6333873", "text": "function createElement (type, props, ...children) {\n const dom = document.createElement(type)\n if (props) Object.assign(dom, props)\n for (const child of children) {\n if (typeof child !== 'string') dom.appendChild(child)\n else dom.appendChild(document.createTextNode(child))\n }\n return dom\n}", "title": "" }, { "docid": "37967011f4f682f8c26e10460efb91eb", "score": "0.62997353", "text": "function createElement(type, config, children) {\n\t var propName;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\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[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "title": "" }, { "docid": "3a797e31dcc007c00564065b410819ac", "score": "0.62771183", "text": "function createElement(type, config, children) {\n\t var propName; // Reserved names are extracted\n\n\t var props = {};\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t {\n\t warnIfStringRefCannotBeAutoConverted(config);\n\t }\n\t }\n\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t } // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\n\n\t var childrenLength = arguments.length - 2;\n\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t } // Resolve default props\n\n\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\n\t {\n\t if (key || ref) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t }", "title": "" }, { "docid": "f143fa0a14bfd57a80332f89897f4173", "score": "0.62562907", "text": "function createElement(type, props) {\n var COMPONENTS = {\n ROOT: function ROOT() {\n return new _components.Root();\n },\n APP: function APP() {\n return new _components.App(props);\n },\n VIEW: function VIEW() {\n return new _components.View(props);\n },\n WINDOW: function WINDOW() {\n return new _components.Window(props);\n },\n VIRTUALTEXT: function VIRTUALTEXT() {\n return new _components.VirtualText(props);\n },\n ROOTTEXT: function ROOTTEXT() {\n return new _components.RootText(props);\n },\n IMAGE: function IMAGE() {\n return new _components.Image(props);\n },\n TEXTINPUT: function TEXTINPUT() {\n return new _components.TextInput(props);\n },\n PICKERINTERNAL: function PICKERINTERNAL() {\n return new _components.PickerInternal(props);\n },\n \"default\": undefined\n };\n return COMPONENTS[type]() || COMPONENTS[\"default\"];\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230123", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\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 {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" } ]
c91ecb0f398215b07205fabf767b1df3
endregion region Ember Hooks
[ { "docid": "cc343933cae324a30ee235267db7cc38", "score": "0.0", "text": "didInsertElement() {\n this._super(...arguments);\n this.registerWithMenu();\n }", "title": "" } ]
[ { "docid": "902066ef9847bc5c062fec9f23fc18e1", "score": "0.62078243", "text": "beforeAction() {\n\n }", "title": "" }, { "docid": "e1d80602a9abab12a563c010306d923e", "score": "0.61229897", "text": "bindHooks() {\n //\n }", "title": "" }, { "docid": "cdfef7f27542f785b761daa8594c82c2", "score": "0.60508686", "text": "beforeRender() { }", "title": "" }, { "docid": "282f8fcdbd591e25161abe11b012550c", "score": "0.5966181", "text": "liveReload() {\n Ember.debug('You should override this method for map layer reload');\n }", "title": "" }, { "docid": "3b4ae37c5ea871ac420b2ceda19b3b3f", "score": "0.5841668", "text": "beforeHandling() {}", "title": "" }, { "docid": "63b2689c10fe850469fb09524dd201a8", "score": "0.56887466", "text": "willRender() {\n console.log('willRender ejecutado!');\n }", "title": "" }, { "docid": "bf9033e6567a0036a4a27c5d589a39c9", "score": "0.5650425", "text": "before (instance, target) {\n\n }", "title": "" }, { "docid": "7f9b5fd7204323d6adf69b6d8fad90f2", "score": "0.55557483", "text": "beforeCreateHook () {\n // will override by prototypes\n }", "title": "" }, { "docid": "bed637fccf308a9d46846400957ae501", "score": "0.54970616", "text": "beforeHandlers (event) {\n\n }", "title": "" }, { "docid": "f80b301bf29d894545d503a7331fb7e5", "score": "0.54659283", "text": "activate() {\n }", "title": "" }, { "docid": "4321aa993481b5f666f45ae9996309f0", "score": "0.54433715", "text": "activate() {\n\n }", "title": "" }, { "docid": "3b7c801cca75783ff3f3973daeadf571", "score": "0.5422123", "text": "beforeCreate() {\n console.log('beforeCreate');\n }", "title": "" }, { "docid": "556c4c626e41ec75c2cf71226acac2e7", "score": "0.54161066", "text": "afterRender() { }", "title": "" }, { "docid": "556c4c626e41ec75c2cf71226acac2e7", "score": "0.54161066", "text": "afterRender() { }", "title": "" }, { "docid": "00875a148662a79e1ba5bd302916a35a", "score": "0.5415479", "text": "beforeCreate() {}", "title": "" }, { "docid": "7348fb72b8c4928d467f524c9146870d", "score": "0.53940654", "text": "beforeStart_() {\n throw 'Cannot call beforeStart_() in abstract BookBinder';\n }", "title": "" }, { "docid": "7c76ecfe2110c2df08d03132e830ded4", "score": "0.5384612", "text": "beforeRun() {}", "title": "" }, { "docid": "47d14775064279d2d922ae2184835399", "score": "0.53776294", "text": "didRender() {\n console.log('didRender ejecutado!');\n }", "title": "" }, { "docid": "ee88464b1bfec1fdeb7ac2102e5b1401", "score": "0.53697866", "text": "routerHooks() {\n const router = this.router;\n router.afterEach((to, from) => {\n this.historyShouldChange = true;\n // get the vm instance after render\n this.Vue.nextTick(() => {\n const current = this.currentVm;\n const pendingToPushVm = resolvePushedVm(current);\n if (this.pre === null) {\n this.onInitial(pendingToPushVm);\n } else if (this.isReplace) {\n this.onReplace(pendingToPushVm);\n } else if (this.isPush) {\n this.onPush(pendingToPushVm);\n } else {\n this.onBack(pendingToPushVm);\n }\n this.pre = current;\n this.preStateId = this.stackPointer;\n if (!isPlaceHolderVm(pendingToPushVm)) {\n setCurrentVnodeKey(router, genKey(this.stackPointer, router));\n if (!this.hacked && current) {\n this.hackKeepAliveRender(current.$vnode.parent.componentInstance);\n }\n this.historyShouldChange = false;\n }\n });\n });\n }", "title": "" }, { "docid": "a37bb406e07c72d59bad18dfdf545b32", "score": "0.5365687", "text": "updateHook() {\n return true;\n }", "title": "" }, { "docid": "e59f7c0d2815b6ae5a1e9ac930478913", "score": "0.5355232", "text": "beforeCreate() {\n\n }", "title": "" }, { "docid": "06bc524e126f33343429a1e494959811", "score": "0.5310787", "text": "_beforeChange () {\n // nop\n }", "title": "" }, { "docid": "06bc524e126f33343429a1e494959811", "score": "0.5310787", "text": "_beforeChange () {\n // nop\n }", "title": "" }, { "docid": "86cea410e042c322b016e99c226e808b", "score": "0.53022945", "text": "dispatch() {\r\n }", "title": "" }, { "docid": "8bcc6a8978ecb3aa2bbb723e78457e28", "score": "0.5291927", "text": "activate() {}", "title": "" }, { "docid": "e0442cb18532030c1899791636384e30", "score": "0.52900827", "text": "beforeUpdate(){\n console.log('beforeUpdate');\n }", "title": "" }, { "docid": "6bc2d3e2f6d28a2734294c40229efc28", "score": "0.52796364", "text": "addedToWorld() { }", "title": "" }, { "docid": "f07a27843bb4e58ad6be99741407e5e3", "score": "0.5278124", "text": "beforeMount(){\n console.log('beforeMount');\n }", "title": "" }, { "docid": "77533668c7e39dfc47b41c25c9caa820", "score": "0.52729374", "text": "callLifeCycleHooks() {\n return this.callOnBeforeSaveHook();\n }", "title": "" }, { "docid": "c3fc26af27c2725192e9fa3476b5b03a", "score": "0.52547747", "text": "_before() {\n this.world = new World();\n }", "title": "" }, { "docid": "760f2dd4db3b4e133b40c47abed67ede", "score": "0.5252357", "text": "onBeforeRendering() {}", "title": "" }, { "docid": "eaa8289765db0ffe7cff05cde04b5f05", "score": "0.52476", "text": "constructor() {\n super(...arguments);\n this.addObserver('model', this.incrementallyBuildAllHandles); // eslint-disable-line ember/no-observers\n }", "title": "" }, { "docid": "ac55c8f495e9b1b04ba115001419ebe2", "score": "0.52399784", "text": "static activate() {\n \n }", "title": "" }, { "docid": "35beb612ce15144a2cdd08e315eb35e2", "score": "0.52273947", "text": "getDefaultProps () {\n return {\n options: Ember.A([]),\n initialized: false\n }\n }", "title": "" }, { "docid": "5fa26db9f38b417208c2bfda9c2e8082", "score": "0.5217393", "text": "beforeInit() {\r\n return true;\r\n }", "title": "" }, { "docid": "650d2259c25c5fad83e3f6b9f87ff1e8", "score": "0.51992834", "text": "created() {\r\n\r\n\t}", "title": "" }, { "docid": "f0a77c422eb6530661358a55887fcfb3", "score": "0.5195867", "text": "_environmentChanged() {}", "title": "" }, { "docid": "31d39666b77e9edd803dc79624f66eb8", "score": "0.5188098", "text": "async before(ctx, args) {\n return true;\n }", "title": "" }, { "docid": "c575dc4459084e70ad77ed873f087777", "score": "0.5180942", "text": "_environmentsChanged() {}", "title": "" }, { "docid": "b286815eecb0d2fc19137cede8ad6017", "score": "0.51751083", "text": "getStateAndHelpers() {\n return {\n ...this.state,\n handleSelectItem: this.handleSelectItem\n };\n }", "title": "" }, { "docid": "4cbf8c9f120c116baf984d4edd6af75b", "score": "0.517242", "text": "haxHooks() {\n return {\n editModeChanged: \"haxeditModeChanged\",\n activeElementChanged: \"haxactiveElementChanged\",\n };\n }", "title": "" }, { "docid": "4cbf8c9f120c116baf984d4edd6af75b", "score": "0.517242", "text": "haxHooks() {\n return {\n editModeChanged: \"haxeditModeChanged\",\n activeElementChanged: \"haxactiveElementChanged\",\n };\n }", "title": "" }, { "docid": "20dff621cec32a883f365f63cbfee63a", "score": "0.5140694", "text": "$onInit() {\n \n }", "title": "" }, { "docid": "e87ab65fa11e20e233dec26793391d2b", "score": "0.51153046", "text": "patch() {\n }", "title": "" }, { "docid": "c572ca26944e002477fb6988b7a10bfc", "score": "0.5101444", "text": "render() {\r\n return;\r\n }", "title": "" }, { "docid": "512933eeba64dbcaffabe1e705958523", "score": "0.51000357", "text": "onAfterRendering() {}", "title": "" }, { "docid": "c1702092c2e47e60427d62336564e1d0", "score": "0.50989616", "text": "mount() {\r\n return null;\r\n }", "title": "" }, { "docid": "a5985edd40656b508d7dce70ade6e404", "score": "0.5097176", "text": "afterHandling() {}", "title": "" }, { "docid": "403703716a013f7a12deca61b6663fa9", "score": "0.5081596", "text": "_setHooks() {\n this.config.assign = (options, confirmed = false) => {\n return this._assign(options, confirmed);\n };\n this.config.remove = (options, confirmed = false) => {\n return this._remove(options, confirmed);\n };\n this.config.removeAllOptions = () => {\n return of(this.onRemoveAllOptions());\n };\n this.config.addAllOptions = () => {\n return of(this.onAssignAllOptions());\n };\n this.config.applyFilter = (type, filter) => {\n this.onApplyFilter(type, filter);\n };\n this.config.getAssigned = () => {\n return this.config.assigned.slice();\n };\n this.config.block = (bucket, ids) => {\n this._blockBucketOptions(bucket, ids);\n };\n this.config.unblock = (bucket, ids) => {\n this._unblockBucketOptions(bucket, ids);\n };\n }", "title": "" }, { "docid": "368246318bc9be1c1a12b36eac5fb6e3", "score": "0.5071643", "text": "willMount() {\n }", "title": "" }, { "docid": "f72908b3cb8b9129a451104b8de395f2", "score": "0.50658464", "text": "haxHooks() {\n return {\n activeElementChanged: \"haxactiveElementChanged\",\n };\n }", "title": "" }, { "docid": "42b88cee11797e630dec4a4c1135968b", "score": "0.5064269", "text": "render(){\n console.log('Render Fired')\n return(\n <div>Lifecycle Method Examples</div>\n )\n }", "title": "" }, { "docid": "a69b7f87a18927e6cbcbf2def961bdae", "score": "0.5054065", "text": "function processEmberShims() {\n var shims = {\n 'ember-application': {\n 'default': Ember.Application\n },\n 'ember-array': {\n 'default': Ember.Array\n },\n 'ember-array/mutable': {\n 'default': Ember.MutableArray\n },\n 'ember-array/utils': {\n 'A': Ember.A,\n 'isEmberArray': Ember.isArray,\n 'wrap': Ember.makeArray\n },\n 'ember-component': {\n 'default': Ember.Component\n },\n 'ember-components/checkbox': {\n 'default': Ember.Checkbox\n },\n 'ember-components/text-area': {\n 'default': Ember.TextArea\n },\n 'ember-components/text-field': {\n 'default': Ember.TextField\n },\n 'ember-controller': {\n 'default': Ember.Controller\n },\n 'ember-controller/inject': {\n 'default': Ember.inject.controller\n },\n 'ember-controller/proxy': {\n 'default': Ember.ArrayProxy\n },\n 'ember-controllers/sortable': {\n 'default': Ember.SortableMixin\n },\n 'ember-debug': {\n 'log': Ember.debug,\n 'inspect': Ember.inspect,\n 'run': Ember.runInDebug,\n 'warn': Ember.warn\n },\n 'ember-debug/container-debug-adapter': {\n 'default': Ember.ContainerDebugAdapter\n },\n 'ember-debug/data-adapter': {\n 'default': Ember.DataAdapter\n },\n 'ember-deprecations': {\n 'deprecate': Ember.deprecate,\n 'deprecateFunc': Ember.deprecateFunc\n },\n 'ember-enumerable': {\n 'default': Ember.Enumerable\n },\n 'ember-evented': {\n 'default': Ember.Evented\n },\n 'ember-evented/on': {\n 'default': Ember.on\n },\n 'ember-globals-resolver': {\n 'default': Ember.DefaultResolver\n },\n 'ember-helper': {\n 'default': Ember.Helper,\n 'helper': Ember.Helper && Ember.Helper.helper\n },\n 'ember-instrumentation': {\n 'instrument': Ember.Instrumentation.instrument,\n 'reset': Ember.Instrumentation.reset,\n 'subscribe': Ember.Instrumentation.subscribe,\n 'unsubscribe': Ember.Instrumentation.unsubscribe\n },\n 'ember-locations/hash': {\n 'default': Ember.HashLocation\n },\n 'ember-locations/history': {\n 'default': Ember.HistoryLocation\n },\n 'ember-locations/none': {\n 'default': Ember.NoneLocation\n },\n 'ember-map': {\n 'default': Ember.Map,\n 'withDefault': Ember.MapWithDefault\n },\n 'ember-metal/destroy': {\n 'default': Ember.destroy\n },\n 'ember-metal/events': {\n 'addListener': Ember.addListener,\n 'removeListener': Ember.removeListener,\n 'send': Ember.sendEvent\n },\n 'ember-metal/get': {\n 'default': Ember.get,\n 'getProperties': Ember.getProperties\n },\n 'ember-metal/mixin': {\n 'default': Ember.Mixin\n },\n 'ember-metal/observer': {\n 'default': Ember.observer,\n 'addObserver': Ember.addObserver,\n 'removeObserver': Ember.removeObserver\n },\n 'ember-metal/on-load': {\n 'default': Ember.onLoad,\n 'run': Ember.runLoadHooks\n },\n 'ember-metal/set': {\n 'default': Ember.set,\n 'setProperties': Ember.setProperties,\n 'trySet': Ember.trySet\n },\n 'ember-metal/utils': {\n 'aliasMethod': Ember.aliasMethod,\n 'assert': Ember.assert,\n 'cacheFor': Ember.cacheFor,\n 'copy': Ember.copy,\n 'guidFor': Ember.guidFor\n },\n 'ember-object': {\n 'default': Ember.Object\n },\n 'ember-owner/get': {\n 'default': Ember.getOwner\n },\n 'ember-owner/set': {\n 'default': Ember.setOwner\n },\n 'ember-platform': {\n 'assign': Ember.assign || Ember.merge,\n 'create': Ember.create,\n 'defineProperty': Ember.platform.defineProperty,\n 'hasAccessors': Ember.platform.hasPropertyAccessors,\n 'keys': Ember.keys\n },\n 'ember-route': {\n 'default': Ember.Route\n },\n 'ember-router': {\n 'default': Ember.Router\n },\n 'ember-runloop': {\n 'default': Ember.run,\n 'begin': Ember.run.begin,\n 'bind': Ember.run.bind,\n 'cancel': Ember.run.cancel,\n 'debounce': Ember.run.debounce,\n 'end': Ember.run.end,\n 'join': Ember.run.join,\n 'later': Ember.run.later,\n 'next': Ember.run.next,\n 'once': Ember.run.once,\n 'schedule': Ember.run.schedule,\n 'scheduleOnce': Ember.run.scheduleOnce,\n 'throttle': Ember.run.throttle\n },\n 'ember-service': {\n 'default': Ember.Service\n },\n 'ember-service/inject': {\n 'default': Ember.inject.service\n },\n 'ember-set/ordered': {\n 'default': Ember.OrderedSet\n },\n 'ember-string': {\n 'camelize': Ember.String.camelize,\n 'capitalize': Ember.String.capitalize,\n 'classify': Ember.String.classify,\n 'dasherize': Ember.String.dasherize,\n 'decamelize': Ember.String.decamelize,\n 'fmt': Ember.String.fmt,\n 'htmlSafe': Ember.String.htmlSafe,\n 'loc': Ember.String.loc,\n 'underscore': Ember.String.underscore,\n 'w': Ember.String.w\n },\n 'ember-utils': {\n 'isBlank': Ember.isBlank,\n 'isEmpty': Ember.isEmpty,\n 'isNone': Ember.isNone,\n 'isPresent': Ember.isPresent,\n 'tryInvoke': Ember.tryInvoke,\n 'typeOf': Ember.typeOf\n }\n };\n\n // populate `ember/computed` named exports\n shims['ember-computed'] = {\n 'default': Ember.computed\n };\n var computedMacros = [\n \"empty\",\"notEmpty\", \"none\", \"not\", \"bool\", \"match\",\n \"equal\", \"gt\", \"gte\", \"lt\", \"lte\", \"alias\", \"oneWay\",\n \"reads\", \"readOnly\", \"deprecatingAlias\",\n \"and\", \"or\", \"collect\", \"sum\", \"min\", \"max\",\n \"map\", \"sort\", \"setDiff\", \"mapBy\", \"mapProperty\",\n \"filter\", \"filterBy\", \"filterProperty\", \"uniq\",\n \"union\", \"intersect\"\n ];\n for (var i = 0, l = computedMacros.length; i < l; i++) {\n var key = computedMacros[i];\n shims['ember-computed'][key] = Ember.computed[key];\n }\n\n for (var moduleName in shims) {\n generateModule(moduleName, shims[moduleName], true);\n }\n }", "title": "" }, { "docid": "ff3a96b1a2267c995caac0795d2e3786", "score": "0.50434417", "text": "use (...handlers) { this.handlers = this.handlers.concat(handlers) }", "title": "" }, { "docid": "7d6867267e1b1918d8abbb497abf0460", "score": "0.5039071", "text": "beforeDestroy(){\n console.log('beforeDestroy');\n }", "title": "" }, { "docid": "e4f48a48c7ec55639b6f4fa88e62e6e0", "score": "0.50296104", "text": "data() {\n return {};\n }", "title": "" }, { "docid": "bfa3e236aad76e56ec541bbde5f6f942", "score": "0.50281566", "text": "actioned(){\n this.$applog('actioned: MyTaskPaneEntityDataDummyClass');\n \n }", "title": "" }, { "docid": "514861cf29f358f2f05e8a92750aad30", "score": "0.50275165", "text": "onRender () {\n\n }", "title": "" }, { "docid": "93c60105ec52b65e56de3686c4cb1bad", "score": "0.5011688", "text": "action() {}", "title": "" }, { "docid": "4d6d881edc213f7c8ea61eca7ca6a58a", "score": "0.5010819", "text": "addHook (hook) {\n this.hooks.push(hook)\n }", "title": "" }, { "docid": "9944346c34e19b6053df2b22e6e23786", "score": "0.5006772", "text": "onBeforeRender () {\n\n }", "title": "" }, { "docid": "66d4d7a3ea8225163100b8adbac9edaf", "score": "0.5005757", "text": "didReceiveAttrs() {\n\n let\n lights = this.get('lightsService'),\n id = this.get('light'),\n overlay = Ember.$('.overlay'),\n spinner = Ember.$('.loader');\n\n\n this.set('lightState', lights.getStatus(id)).then(res => {\n\n this.setProperties({\n power: res.state.on,\n lightName: res.name\n });\n\n // Only update the component if the light is on\n if (this.get('power')) {\n\n this.setProperties({\n hue: res.state.hue,\n sat: res.state.sat,\n bri: res.state.bri,\n ct: res.state.ct\n });\n\n this.updateRanges();\n\n // hide the overlay\n overlay.fadeOut('fast');\n spinner.fadeOut('fast');\n\n } else {\n\n // Set values to zero to better represent 'off' state\n this.setProperties({ power: false, sat: 0, bri: 0, hue: 0 });\n }\n });\n }", "title": "" }, { "docid": "b026dd77d7554fdd5bb405023522966c", "score": "0.5004448", "text": "woof() {\n return 'woof woof!';\n }", "title": "" }, { "docid": "6ad3b12d3308e597e5406321ee0cfff1", "score": "0.5002367", "text": "function CakePhpLayer() {\n\n}", "title": "" }, { "docid": "4f900911a26cdb7a049ac1f7312201b4", "score": "0.49998486", "text": "function processEmberShims() {\n var shims = {\n 'ember': {\n 'default': Ember\n },\n 'ember-application': {\n 'default': Ember.Application\n },\n 'ember-array': {\n 'default': Ember.Array\n },\n 'ember-array/mutable': {\n 'default': Ember.MutableArray\n },\n 'ember-array/utils': {\n 'A': Ember.A,\n 'isEmberArray': Ember.isArray,\n 'wrap': Ember.makeArray\n },\n 'ember-component': {\n 'default': Ember.Component\n },\n 'ember-components/checkbox': {\n 'default': Ember.Checkbox\n },\n 'ember-components/text-area': {\n 'default': Ember.TextArea\n },\n 'ember-components/text-field': {\n 'default': Ember.TextField\n },\n 'ember-controller': {\n 'default': Ember.Controller\n },\n 'ember-controller/inject': {\n 'default': Ember.inject.controller\n },\n 'ember-controller/proxy': {\n 'default': Ember.ArrayProxy\n },\n 'ember-controllers/sortable': {\n 'default': Ember.SortableMixin\n },\n 'ember-debug': {\n 'log': Ember.debug,\n 'inspect': Ember.inspect,\n 'run': Ember.runInDebug,\n 'warn': Ember.warn\n },\n 'ember-debug/container-debug-adapter': {\n 'default': Ember.ContainerDebugAdapter\n },\n 'ember-debug/data-adapter': {\n 'default': Ember.DataAdapter\n },\n 'ember-deprecations': {\n 'deprecate': Ember.deprecate,\n 'deprecateFunc': Ember.deprecateFunc\n },\n 'ember-enumerable': {\n 'default': Ember.Enumerable\n },\n 'ember-evented': {\n 'default': Ember.Evented\n },\n 'ember-evented/on': {\n 'default': Ember.on\n },\n 'ember-globals-resolver': {\n 'default': Ember.DefaultResolver\n },\n 'ember-helper': {\n 'default': Ember.Helper,\n 'helper': Ember.Helper && Ember.Helper.helper\n },\n 'ember-instrumentation': {\n 'instrument': Ember.Instrumentation.instrument,\n 'reset': Ember.Instrumentation.reset,\n 'subscribe': Ember.Instrumentation.subscribe,\n 'unsubscribe': Ember.Instrumentation.unsubscribe\n },\n 'ember-locations/hash': {\n 'default': Ember.HashLocation\n },\n 'ember-locations/history': {\n 'default': Ember.HistoryLocation\n },\n 'ember-locations/none': {\n 'default': Ember.NoneLocation\n },\n 'ember-map': {\n 'default': Ember.Map,\n 'withDefault': Ember.MapWithDefault\n },\n 'ember-metal/destroy': {\n 'default': Ember.destroy\n },\n 'ember-metal/events': {\n 'addListener': Ember.addListener,\n 'removeListener': Ember.removeListener,\n 'send': Ember.sendEvent\n },\n 'ember-metal/get': {\n 'default': Ember.get,\n 'getProperties': Ember.getProperties\n },\n 'ember-metal/mixin': {\n 'default': Ember.Mixin\n },\n 'ember-metal/observer': {\n 'default': Ember.observer,\n 'addObserver': Ember.addObserver,\n 'removeObserver': Ember.removeObserver\n },\n 'ember-metal/on-load': {\n 'default': Ember.onLoad,\n 'run': Ember.runLoadHooks\n },\n 'ember-metal/set': {\n 'default': Ember.set,\n 'setProperties': Ember.setProperties,\n 'trySet': Ember.trySet\n },\n 'ember-metal/utils': {\n 'aliasMethod': Ember.aliasMethod,\n 'assert': Ember.assert,\n 'cacheFor': Ember.cacheFor,\n 'copy': Ember.copy,\n 'guidFor': Ember.guidFor\n },\n 'ember-object': {\n 'default': Ember.Object\n },\n 'ember-owner/get': {\n 'default': Ember.getOwner\n },\n 'ember-owner/set': {\n 'default': Ember.setOwner\n },\n 'ember-platform': {\n 'assign': Ember.assign || Ember.merge,\n 'create': Ember.create,\n 'defineProperty': Ember.platform.defineProperty,\n 'hasAccessors': Ember.platform.hasPropertyAccessors,\n 'keys': Ember.keys\n },\n 'ember-route': {\n 'default': Ember.Route\n },\n 'ember-router': {\n 'default': Ember.Router\n },\n 'ember-runloop': {\n 'default': Ember.run,\n 'begin': Ember.run.begin,\n 'bind': Ember.run.bind,\n 'cancel': Ember.run.cancel,\n 'debounce': Ember.run.debounce,\n 'end': Ember.run.end,\n 'join': Ember.run.join,\n 'later': Ember.run.later,\n 'next': Ember.run.next,\n 'once': Ember.run.once,\n 'schedule': Ember.run.schedule,\n 'scheduleOnce': Ember.run.scheduleOnce,\n 'throttle': Ember.run.throttle\n },\n 'ember-service': {\n 'default': Ember.Service\n },\n 'ember-service/inject': {\n 'default': Ember.inject.service\n },\n 'ember-set/ordered': {\n 'default': Ember.OrderedSet\n },\n 'ember-string': {\n 'camelize': Ember.String.camelize,\n 'capitalize': Ember.String.capitalize,\n 'classify': Ember.String.classify,\n 'dasherize': Ember.String.dasherize,\n 'decamelize': Ember.String.decamelize,\n 'fmt': Ember.String.fmt,\n 'htmlSafe': Ember.String.htmlSafe,\n 'loc': Ember.String.loc,\n 'underscore': Ember.String.underscore,\n 'w': Ember.String.w\n },\n 'ember-utils': {\n 'isBlank': Ember.isBlank,\n 'isEmpty': Ember.isEmpty,\n 'isNone': Ember.isNone,\n 'isPresent': Ember.isPresent,\n 'tryInvoke': Ember.tryInvoke,\n 'typeOf': Ember.typeOf\n }\n };\n\n // populate `ember/computed` named exports\n shims['ember-computed'] = {\n 'default': Ember.computed\n };\n var computedMacros = [\n \"empty\",\"notEmpty\", \"none\", \"not\", \"bool\", \"match\",\n \"equal\", \"gt\", \"gte\", \"lt\", \"lte\", \"alias\", \"oneWay\",\n \"reads\", \"readOnly\", \"deprecatingAlias\",\n \"and\", \"or\", \"collect\", \"sum\", \"min\", \"max\",\n \"map\", \"sort\", \"setDiff\", \"mapBy\", \"mapProperty\",\n \"filter\", \"filterBy\", \"filterProperty\", \"uniq\",\n \"union\", \"intersect\"\n ];\n for (var i = 0, l = computedMacros.length; i < l; i++) {\n var key = computedMacros[i];\n shims['ember-computed'][key] = Ember.computed[key];\n }\n\n for (var moduleName in shims) {\n generateModule(moduleName, shims[moduleName]);\n }\n }", "title": "" }, { "docid": "7c599b46418fc34bec9b1fc4eb2f7b70", "score": "0.49897674", "text": "actioned(){\n this.$applog('actioned: MyTaskPaneEntityDataJsonDevClass');\n \n }", "title": "" }, { "docid": "d64258ac6068c92dc47841646ce56a9a", "score": "0.4983683", "text": "function r(e){function t(){var e=this.$options;e.store?this.$store=\"function\"==typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}if(Number(e.version.split(\".\")[0])>=2)e.mixin({beforeCreate:t});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[t].concat(e.init):t,n.call(this,e)}}}", "title": "" }, { "docid": "93beeec32e5e8a93b2dfd66e8846a88a", "score": "0.49830824", "text": "before()\n {\n }", "title": "" }, { "docid": "24e6f658173a19363f40b25648d8c231", "score": "0.4982833", "text": "afterAction(params) {\n\n }", "title": "" }, { "docid": "2b65b551345d4bf6f9aa9436aba4ec24", "score": "0.49778688", "text": "initializing () {\n require('./actions/init')(this)\n }", "title": "" }, { "docid": "5a734a01d99d9026bbfe8e32d12ae338", "score": "0.4972609", "text": "enable () {\n this.hook.enable()\n }", "title": "" }, { "docid": "d99df3f9d3b9a5d42fd4351b787bca40", "score": "0.49718693", "text": "inject(_context, _carrier) { }", "title": "" }, { "docid": "d99df3f9d3b9a5d42fd4351b787bca40", "score": "0.49718693", "text": "inject(_context, _carrier) { }", "title": "" }, { "docid": "f0b46f795690c6eeaacf62f61f37b881", "score": "0.49710825", "text": "function hooks() {\n \"use strict\";\n}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "4578e5aa2b6e675cb79a23e28c61c8aa", "score": "0.49705246", "text": "created() {\n\n\t}", "title": "" }, { "docid": "83edc09e29e12d7f82e166fe36e029ed", "score": "0.49622253", "text": "moe() {\r\n console.log('I am digesting')\r\n }", "title": "" }, { "docid": "168c8add897746f5a9d6e6eabc6c846b", "score": "0.49579242", "text": "componentDidMount(){\n AppStore.addChangeListener(this._onChange.bind(this))\n }", "title": "" }, { "docid": "400f38a9f2c9ea6235a67c93bed979da", "score": "0.49573922", "text": "@action.bound reset() {\n \n }", "title": "" }, { "docid": "934e2bb0faf68bb56b22f4efdf92f3af", "score": "0.4956536", "text": "didMount() {\n }", "title": "" }, { "docid": "021d43efde880880a1b29dae43c2658a", "score": "0.49529", "text": "render() {\n let appContainer = document.querySelector('#tabsBoxApp');\n let template = require('./views/TabsBoxComponent.hbs');\n let navigationLinks = this.navigation.getNavigationLinks();\n\n appContainer.innerHTML = template({'links': navigationLinks});\n\n this.navigation.addNavigationClickActions();\n\n }", "title": "" }, { "docid": "4fe473515b48b5c3b39cd1075bc2c336", "score": "0.49474394", "text": "beforeDestroy(){\n //Antes de destruir la instancia\n console.log('beforeDestroy')\n }", "title": "" }, { "docid": "0b2a09763013d8d04e7bb3c374b5167c", "score": "0.49288788", "text": "function viewWillMount() {\n // stub\n }", "title": "" }, { "docid": "64fc23c21010d4cb606f7e3c9d019df0", "score": "0.49223042", "text": "state() {\n return this.context.state;\n }", "title": "" }, { "docid": "5d7c0507f65c63c496897396eeb6865b", "score": "0.49219418", "text": "didFreeze() {\n Ember.debug('didFreeze', arguments);\n this.set('isFrozen', true);\n }", "title": "" }, { "docid": "9e8a35f5dbc94c9760358ec4eccf2c01", "score": "0.49194512", "text": "constructor() {\n super()\n this.store = 'hello world'\n // this.steps=[\n // { \"Id\": 1, \"Name\": \"Step 1\", \"Description\": \"Installation of pc sofware\", \"Status\": 0, \"Icon\": \"gear\", \"AccountId\": \"\", \"isOpen\": false },\n // { \"Id\": 2, \"Name\": \"Step 2\", \"Description\": \"Sync your quickbooks Data\", \"Status\": 0, \"Icon\": \"refresh\", \"AccountId\": \"\", \"isOpen\": false },\n // { \"Id\": 3, \"Name\": \"Step 3\", \"Description\": \"Who do you want to email summary to\", \"Status\": 0, \"Icon\": \"email\", \"AccountId\": \"\", \"isOpen\": false },\n // { \"Id\": 4, \"Name\": \"Step 4\", \"Description\": \"Have great day (confirmation sent / received)\", \"Status\": 0, \"Icon\": \"thumbsup\", \"AccountId\": \"\", \"isOpen\": false }\n // ];\n }", "title": "" }, { "docid": "17c606e57c781bb6272166666789a56d", "score": "0.4915304", "text": "getState() {\n\n }", "title": "" }, { "docid": "4b359d0463458a66d9486938e30bfb71", "score": "0.49124148", "text": "function h(se){var ye=Number(se.version.split(\".\")[0]);if(ye>=2)se.mixin({beforeCreate:de});else{var re=se.prototype._init;se.prototype._init=function(be){be===void 0&&(be={}),be.init=be.init?[de].concat(be.init):de,re.call(this,be)}}function de(){var be=this.$options;be.store?this.$store=typeof be.store==\"function\"?be.store():be.store:be.parent&&be.parent.$store&&(this.$store=be.parent.$store)}}", "title": "" }, { "docid": "29ed6d2ce2531d535bd85f1b2a27ae66", "score": "0.49028617", "text": "function C(A){var B=Number(A.version.split(\".\")[0]);if(B>=2)A.mixin({beforeCreate:D});else{var C=A.prototype._init;A.prototype._init=function(A){void 0===A&&(A={}),A.init=A.init?[D].concat(A.init):D,C.call(this,A)}}function D(){var A=this.$options;A.store?this.$store=\"function\"===typeof A.store?A.store():A.store:A.parent&&A.parent.$store&&(this.$store=A.parent.$store)}}", "title": "" }, { "docid": "f4b32c67e0256fea5b2b9f6ed542c47e", "score": "0.49002436", "text": "updateAction() {}", "title": "" }, { "docid": "a8a5a30f0ca78aa1b08186eaa914554a", "score": "0.48961893", "text": "activeUse() {\n }", "title": "" }, { "docid": "2fe911753e4b1e28a7874f061a08c7b4", "score": "0.48935422", "text": "function a(e){function t(){var e=this.$options;e.store?this.$store=\"function\"==typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}var a=+e.version.split(\".\")[0];if(2<=a)e.mixin({beforeCreate:t});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[t].concat(e.init):t,n.call(this,e)}}}", "title": "" } ]
d55c181edc92f5b1d28fffb80c344cdb
Event listener for HTTP server "listening" event.
[ { "docid": "b1c7025ab185580efa1870b963c2c90d", "score": "0.6965605", "text": "function onListening() {\n const addr = server.address();\n console.log(`Listening on ${addr.port}`);\n}", "title": "" } ]
[ { "docid": "51703a3a17e0eaa592e9720774710a56", "score": "0.78543603", "text": "function onListeningHTTP () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP - Listening on ' + bind)\n}", "title": "" }, { "docid": "297f8444ef6b8bfc926b30a2a1e5f958", "score": "0.7739916", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log.debug('HTTP server listening on ' + bind);\n }", "title": "" }, { "docid": "5e5cdd184d4d0ce34940a9681149f329", "score": "0.76332736", "text": "function onListening() {\n logger.info('Webserver listening on port ' + server.address().port)\n }", "title": "" }, { "docid": "baf84b483788e2dd3ec1d8bdfa8070e5", "score": "0.75365347", "text": "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n //debug('Listening on ' + bind);\n console.log('Http server is listening on ' + bind);\n}", "title": "" }, { "docid": "75a5a8530427006063d5ff9cfa06c77b", "score": "0.7531618", "text": "function onListening() {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP server listening on ' + bind)\n}", "title": "" }, { "docid": "2b9d556e4fbf5ea8a0d590a28d76e161", "score": "0.7341063", "text": "function onListening() {\n var addr = httpsServer.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "f13fe21919910cc5a64502df40fe1db5", "score": "0.733379", "text": "function onListening() {\n var addr = httpsServer.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "8325bdb0ce447eaffdabfa6b33cada7f", "score": "0.73028886", "text": "function onListening() {\n\t\tvar addr = server.address();\n\t\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\t\tvar fqdn = scheme+\"://\"+host;\n\t\tcrawl.init(fqdn,host,scheme);\n\t}", "title": "" }, { "docid": "0c27e188157e8bf5079a5f12455fecd2", "score": "0.7302802", "text": "function onListening() {\n var addr = http.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "9464d0f504738355f9e1efff057253f2", "score": "0.7282679", "text": "function onListening() {\n const address = httpServer.address().address;\n console.info(`Listening port ${port} on ${address} (with os.hostname=${os.hostname()})`);\n const entryFqdn = getEntryFqdn(address, port);\n console.info(`Use browser to open: ${entryFqdn}`);\n}", "title": "" }, { "docid": "c1a06890fe1239e91896b4ea35787f5c", "score": "0.7272048", "text": "function onListening() {\n\tdebug('Listening on port ' + server.address().port);\n}", "title": "" }, { "docid": "0c2a6d210c94b65d2b62923103dd94bd", "score": "0.72311646", "text": "function httpOnListening() {\n var addr = httpServer.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "ce28a0d69606f6c653d2441f768a3600", "score": "0.72267777", "text": "function onListening() {\n const addr = server.address()\n const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port\n mainWindow.webContents.send('listening', bind)\n}", "title": "" }, { "docid": "0b827ee68409ac24a5e60a557ad1df38", "score": "0.71615416", "text": "function onListening() {\n CALLBACK();\n const addr = server.address();\n const bind = typeof addr === 'string' ?\n `pipe ${addr}` :\n `port ${addr.port}`;\n debug(`Listening on ${bind}`);\n }", "title": "" }, { "docid": "9c7170cc3071c57a89967e15fb7f3bf6", "score": "0.71260625", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "title": "" }, { "docid": "43ddc9ce8d6cdd1d1deb62bb1b10eb34", "score": "0.7120054", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "title": "" }, { "docid": "058cac283d3f834abf611ab93af99fc2", "score": "0.7105148", "text": "function onListening()\n{\n\tvar addr\t= server.address();\n\tvar bind\t= ('string' === typeof addr) ? 'pipe ' + addr : 'port ' + addr.port;\n\n\tdebug('Listening on ' + bind);\n}", "title": "" }, { "docid": "454b9095ffc65c5d698a3ccd89aad028", "score": "0.70975953", "text": "function onListening() {\n Object.keys(httpServers).forEach(key => {\n var httpServer = httpServers[key];\n var addr = httpServer.address()||{};\n var bind = typeof addr === \"string\"\n ? \"pipe \" + addr\n : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n })\n}", "title": "" }, { "docid": "a45783962de5086352bac5945a2ed547", "score": "0.7081919", "text": "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n\tdebug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "dca4700b5b47dfad4fffbe34c334c583", "score": "0.70732343", "text": "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "title": "" }, { "docid": "1f8f1000633bd0675caba272e1171aab", "score": "0.7071961", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('http://localhost:' + addr.port);\n}", "title": "" }, { "docid": "9b115ed32d83e19e0b75b0a6d8584fc9", "score": "0.70644724", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n\n console.log(\"----- onListening\");\n}", "title": "" }, { "docid": "1bb023a7325702bba519e1e3d458704d", "score": "0.7056824", "text": "function onListening() {\n var addr = process.env.ADDRESS || http_server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "b0b8d63169812d9ddc7ee5f1625c2315", "score": "0.7052605", "text": "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug( 'Listening on ' + bind );\n}", "title": "" }, { "docid": "11470d93187c88ed03b23c97baece355", "score": "0.7047003", "text": "function onListening() {\n var addr = server.address();\n var bind = (typeof addr === 'string') ? 'pipe ' + addr : 'port ' + addr.port;\n logger.info('>> LISTENING ON ' + bind);\n}", "title": "" }, { "docid": "30699240e161a0c0164c4fe1ee7445b3", "score": "0.702555", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug_info('Listening on ' + bind);\n}", "title": "" }, { "docid": "0b73300480a752d929de4f3f1dcb9b3a", "score": "0.70165515", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n logger.debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "c7605ccc3f183d1edc2e75a1734cbcf8", "score": "0.70119435", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n console.log(\"Listening on \" + bind);\n }", "title": "" }, { "docid": "04c4cbd04dd6f7c3895b12a9b70bae95", "score": "0.7006223", "text": "function onListening() {\n debug('Listening on ' + port);\n }", "title": "" }, { "docid": "2c1d84f7f033f5765e442552b218c627", "score": "0.6999816", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n\t\t\t'pipe ' + addr : 'port ' + addr.port;\n\t\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "92b61a41a2be66e0aa9cac15c42b3e2e", "score": "0.6998805", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "title": "" }, { "docid": "4b169cffcd0910369725ae37c3999f7c", "score": "0.69984835", "text": "function onListening(): void {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? `pipe ${addr}`\n : `port ${addr.port}`;\n debug(`Listening on ${bind}`);\n console.log(`Listening on ${bind}`);\n}", "title": "" }, { "docid": "891c754a4a8f072f8c80b7e5995b1247", "score": "0.6993336", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? `pipe ${addr}`\n : `port ${addr.port}`;\n\n debug(`Server listening on ${bind}`);\n logger.info(`Server listening on ${bind}`, { tags: 'server' });\n}", "title": "" }, { "docid": "61080bde6ca7441770b55a8c673060c8", "score": "0.6992539", "text": "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string' ?\r\n 'pipe ' + addr :\r\n 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "title": "" }, { "docid": "fa592d02f102496f5fd9e3e0127fe038", "score": "0.69878", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n logger.info('Listening on ' + bind);\n}", "title": "" }, { "docid": "d0138a328aa8dedc9d2beade3c5edd15", "score": "0.69853705", "text": "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "title": "" }, { "docid": "a4924ea1ceeb3a477e18ef5502c36185", "score": "0.69834304", "text": "function onListening () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('Listening on', bind)\n }", "title": "" }, { "docid": "dd0de5d0804ef7a962fec8d2cbfa9cd5", "score": "0.69833803", "text": "_attachListeners () {\n const onListening = () => {\n const address = this._server.address()\n debug(`server listening on ${address.address}:${address.port}`)\n this._readyState = Server.LISTENING\n }\n\n const onRequest = (request, response) => {\n debug(`incoming request from ${request.socket.address().address}`)\n request = Request.from(request)\n response = Response.from(response)\n this._handleRequest(request, response)\n }\n\n const onError = err => {\n this.emit('error', err)\n }\n\n const onClose = () => {\n this._readyState = Server.CLOSED\n }\n\n this._server.on('listening', onListening)\n this._server.on('request', onRequest)\n this._server.on('checkContinue', onRequest)\n this._server.on('error', onError)\n this._server.on('close', onClose)\n this._readyState = Server.READY\n }", "title": "" }, { "docid": "70bd233b20f246139ac3d53ed6676b77", "score": "0.69730884", "text": "function onListening() {\n\tconst addr = server.address();\n\tconst bind = `${serverConfig.host}:${serverConfig.defaultPort}`;\n\t// const bind = typeof(addr) === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "title": "" }, { "docid": "8a9f6d695ba747e1b1fdbece0f63f4e8", "score": "0.69718415", "text": "onListening() {\n var addr = this.server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "title": "" }, { "docid": "7d83e7144dc85397995f2c3d4bd176f6", "score": "0.6971338", "text": "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log('Listening on ' + bind);\n}", "title": "" }, { "docid": "f32d06e5d02a01895506a382a4d05f55", "score": "0.6970686", "text": "function onListening() {\n\tconst addr = server.address();\n\tconst bind = typeof addr === 'string'\n\t\t? 'pipe ' + addr\n\t\t: 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "title": "" }, { "docid": "e962a24265ed50a25afe6dc1b7a12ac6", "score": "0.69659597", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('demo:server')('Listening on ' + bind);\n}", "title": "" }, { "docid": "635e7b0f7e9f47d383e7f36e0d12a77a", "score": "0.69622135", "text": "function onListening() {\n var serverURL = \"http://localhost:\" + config.port;\n console.log(\"server listening on \" + serverURL);\n}", "title": "" }, { "docid": "367cebed6affd006ed32020d3534a5e8", "score": "0.69610804", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "367cebed6affd006ed32020d3534a5e8", "score": "0.69610804", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "367cebed6affd006ed32020d3534a5e8", "score": "0.69610804", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "367cebed6affd006ed32020d3534a5e8", "score": "0.69610804", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "367cebed6affd006ed32020d3534a5e8", "score": "0.69610804", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "5afa7e60d1ca638e75f5fcce8832bea7", "score": "0.6959213", "text": "onListening(server) {\n const { port } = server.listeningApp.address();\n console.log('Listening on port:', port);\n }", "title": "" }, { "docid": "4fe906d5780408fcffb4490d213a0c45", "score": "0.6957496", "text": "function listener() {\r\n if (logged == 1) return;\r\n logged = 1;\r\n cfg.port = app.address().port;\r\n csl.log('Server running on port := ' + cfg.port);\r\n // Log the current configuration\r\n for (var key in cfg) {\r\n if (key != 'spdy' || key != 'https')\r\n csl.log(key + ' : ' + cfg[key]);\r\n }\r\n\r\n // If browser is true, launch it.\r\n if (cfg.browser) {\r\n var browser;\r\n switch (process.platform) {\r\n case \"win32\":\r\n browser = \"start\";\r\n break;\r\n case \"darwin\":\r\n browser = \"open\";\r\n break;\r\n default:\r\n browser = \"xdg-open\";\r\n break;\r\n }\r\n csl.warn('Opening a new browser window...');\r\n require('child_process').spawn(browser, ['http://localhost:' + app.address().port]);\r\n }\r\n }", "title": "" }, { "docid": "72b5d5df0a3eef93b052a4f4252fec91", "score": "0.695542", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "title": "" }, { "docid": "2659cd185e053eec98ad51e96c453d33", "score": "0.6953007", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "2659cd185e053eec98ad51e96c453d33", "score": "0.6953007", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "ce1d21adec860c48e8d1ed762dccb2be", "score": "0.69483477", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "a6a4fa8de2016d7e12d61fdae1b636c9", "score": "0.69388145", "text": "function on_listening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "7c48cde4a85292b07cf121ebadf61823", "score": "0.6936377", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "7295709605bf1f93f3cad6ee7066be69", "score": "0.69358873", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\"\n ? \"pipe \" + addr\n : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "4db2f181732942db8ec5b9d16cb692e8", "score": "0.6935214", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "b0463abc6e84aa00cfb7b2ef439b07aa", "score": "0.6935159", "text": "function onListening() {\n\n var addr = this.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log(\"API Listening on port : \" + addr.port);\n}", "title": "" }, { "docid": "00eb61e8b449acfa7fb3bd52e8731833", "score": "0.6935082", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "title": "" }, { "docid": "aa79bfd645da61b8cb253d83c4e77859", "score": "0.69344616", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "3e7601bceedcd28cc39e9ec0056e0f93", "score": "0.6932475", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "title": "" }, { "docid": "3e7601bceedcd28cc39e9ec0056e0f93", "score": "0.6932475", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "title": "" }, { "docid": "3e7601bceedcd28cc39e9ec0056e0f93", "score": "0.6932475", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "title": "" }, { "docid": "ecec9c9634c8f6a9d27273aea8e1b3ce", "score": "0.6931909", "text": "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "title": "" }, { "docid": "7a90c4f386f064feda72c93ff8043814", "score": "0.69296336", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "e9d002b126a033fb3b8a3cda2aa8c45c", "score": "0.6929588", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('API available on: /api/tasks');\n console.log('Socket connection available on: https://10.3.2.52:3333');\n}", "title": "" }, { "docid": "00b25e2a112f9ba7c7bf4d5dd86e7a3e", "score": "0.69258696", "text": "function onListening () {\n const addr = server.address()\n console.log(`Listening on https://localhost:${addr.port}`)\n}", "title": "" }, { "docid": "55fe06ee19b0ed3c46a819e8c1419a9f", "score": "0.69257134", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug( 'Listening on ' + bind );\n}", "title": "" }, { "docid": "2619f086c24baa398d02ec1f381d643c", "score": "0.69255424", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "2619f086c24baa398d02ec1f381d643c", "score": "0.69255424", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "2619f086c24baa398d02ec1f381d643c", "score": "0.69255424", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "2619f086c24baa398d02ec1f381d643c", "score": "0.69255424", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "2619f086c24baa398d02ec1f381d643c", "score": "0.69255424", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "2619f086c24baa398d02ec1f381d643c", "score": "0.69255424", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "2619f086c24baa398d02ec1f381d643c", "score": "0.69255424", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "2619f086c24baa398d02ec1f381d643c", "score": "0.69255424", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "217d5ec28143420bdba5f236b2ee027c", "score": "0.6924427", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n info('Listening on ' + bind);\n}", "title": "" }, { "docid": "2bcd6a3533eb04516680bad5d4e5608b", "score": "0.6921941", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "86791339c9c7ec4f7e9ec6a3e5631a66", "score": "0.6920283", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" } ]
55d811b774b93ad80d0337ecfe53cecd
function to validate the shoulders fields values in A, AH, H1,H2, H3 forms
[ { "docid": "4ccfc6883680efaeff898e259add5727", "score": "0.0", "text": "function isChkshoulder(fieldname, fieldvalue)\n{\nvar str = fieldvalue;\n//alert(str);\nif(str > 6)\n{\n alert(fieldname + ' value must not be greater than 6 ');\n return false;\n}\n\n return true;\n\n}", "title": "" } ]
[ { "docid": "c2cdf414c9b957ca93db22f49bd649f2", "score": "0.6422537", "text": "function checkFields(first, last, phone, hState, gen, hob1, hob2, hob3) {\n var firstFormat = new RegExp(/^(?=.{1,50}$)[a-z]+(?:['_.\\s][a-z]+)*$/i);\n var lastFormat = new RegExp(/^[a-z ,.'-]+$/i);\n if (first.match(lastFormat) && last.match(lastFormat) && hState != \"none\" && gen != \"none\" && hob1 != \"none\" && hob2 != \"none\") {\n // if (phone[0] != \"(\" && phone.length == 10) {\n // return true;\n // }\n // else if (phone[0] == \"(\" && phone.length == 13) {\n // return true;\n // }\n // else {\n // window.alert(\"Please input a proper phone number\");\n // return false;\n // }\n if (hob2 == \"Other\" && (hobbyIn2Other.value == null || hobbyIn2Other.value == \"\")) {\n window.alert(\"Incomplete: Please fill in the field for your other hobby\");\n return false;\n }\n if (hob3 == \"Other\" && (hobbyIn3Other.value == null || hobbyIn3Other.value == \"\")) {\n window.alert(\"Incomplete: Please fill in the field for your other hobby\");\n return false;\n }\n return true;\n }\n else {\n window.alert(\"Incomplete: Fill in all fields with proper inputs\");\n return false;\n }\n}", "title": "" }, { "docid": "cf16ec97edcb126fb59b131d539ead91", "score": "0.627265", "text": "validateFields() {\n const iban = document.querySelector(`#${this.ibanID}`);\n const clientFirstName = document.querySelector(`#${this.clientFirstNameID}`);\n const clientLastName = document.querySelector(`#${this.clientLastNameID}`);\n const clientEmail = document.querySelector(`#${this.clientEmailID}`);\n const clientCity = document.querySelector(`#${this.clientCityID}`);\n const clientZipcode = document.querySelector(`#${this.clientZipcodeID}`);\n const clientStreet = document.querySelector(`#${this.clientStreetID}`);\n const clientHouseNumber = document.querySelector(`#${this.clientHouseNumberID}`);\n const jobDescription = document.querySelector(`#${this.jobDescriptionID}`);\n const jobLocation = document.querySelector(`#${this.jobLocationID}`);\n const jobDirectedBy = document.querySelector(`#${this.jobDirectedByID}`);\n const jobStartDate = document.querySelector(`#${this.jobStartDateID}`);\n const jobEndDate = document.querySelector(`#${this.jobEndDateID}`);\n\n validate(iban, );\n validate(clientFirstName, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(clientLastName, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(clientEmail, /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/);\n validate(clientCity, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(clientZipcode, /^\\d{4}\\s*[a-zA-z]{2}$/);\n validate(clientStreet, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(clientHouseNumber, /^[0-9][^\\s]*$/);\n validate(jobDescription, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(jobLocation, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(jobDirectedBy, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(jobStartDate, /^[0-9]{4}-[0-9]{2}-[0-9]{2}/);\n validate(jobEndDate, /^[0-9]{4}-[0-9]{2}-[0-9]{2}/);\n }", "title": "" }, { "docid": "275f6cf13f708af2a811a5ee4b77a7a4", "score": "0.62447", "text": "function genericvalid(obj,minv,maxv,chk)/*chk is to get '1' from html file for alphanumeric validation,,*/\n{\nvar objtype=obj.type;\n if (objtype==\"text\" && chk==1)\n\t{\nvar reg=obj.pattern;\t\t\n\n\t\tif(obj.value==\"\")\t\t\t\t/* check the conditons */\n\n\t\t\t{\n\t\t\t\talert(obj.title);\n obj.focus();\n\t\t\t\treturn false;\n\t\n\t\t\t}\n\n\n\t\telse if(obj.value.length<minv || obj.value.length>maxv)\n\t\t\t{\n\n\t\t\t\talert(obj.title);\n obj.focus();\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\n\t\telse if(obj.value.match(reg)) \t\n\n\t\t\t{\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\n\t\n\t}\nelse if(objtype==\"text\" && chk==0)\t/*chk is to get '0' from html file for alphabets validation*/\n{\nvar regex=obj.pattern;\nvar p=obj.value;\n\tif( obj.value== \"\" )\n { \nalert(obj.title);\nobj.focus();\n return false; \n } \nelse if(obj.value.length<minv || obj.value.length>maxv) \n { \n alert(obj.title);\n obj.focus();\n return false; \n } \n\n else if(p.match(regex))\n {\n\t return true;\n } \n\n\n}\nelse\nreturn false;\n\n}", "title": "" }, { "docid": "899eefea9b24ce35869c2b24f2f28191", "score": "0.6242258", "text": "function validateFields() {\n const validators = {\n \"#txtEpisode\": hasValidEpisodeNumber,\n \"#txtTitle\": hasNonEmptyString,\n \"#txtCrawl\": hasNonEmptyString\n };\n Object.entries(validators).forEach(([sel, fn]) => {\n const fld = document.querySelector(sel);\n if (fn(fld.value)) {\n fld.parentNode.classList.remove(\"error\");\n } else {\n fld.parentNode.classList.add(\"error\");\n }\n });\n}", "title": "" }, { "docid": "d4c3fbba0fc4c75987013f264510848a", "score": "0.622907", "text": "validInput(fieldName) {\n if (fieldName === \"species\") {\n this.checkSpecies();\n } else if (fieldName === \"height\") {\n this.checkHeight();\n } else {\n this.checkDbhs();\n }\n }", "title": "" }, { "docid": "a6538622ffe9d8a7a59a3dab36eb771d", "score": "0.62146974", "text": "function validateScheduleHP() {\r\n\tvar tab = document.getElementById('scheduleHPMain');\r\n\tvar allInputTags = tab.getElementsByTagName('select');\r\n\tvar count = 0;\r\n\tfor (var i = 0; i < allInputTags.length; i++) {\r\n\t\tif (allInputTags[i].name.match(\"ifLetOut$\")) {\r\n\t\t\tif (allInputTags[i].value == \"N\") {\r\n\t\t\t\tif (++count > 1) {\r\n\t\t\t\t\tj\r\n\t\t\t\t\t\t\t.setFieldError(\r\n\t\t\t\t\t\t\t\t\tallInputTags[i].name,\r\n\t\t\t\t\t\t\t\t\t'Where there is more than one Self occupied House property(SOP) , one of them shall be treated as SOP and all other House properties shall be deemed to be let out');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "7dacfabdcb720028915dd5587706b85a", "score": "0.61918634", "text": "function validation() {\r\n var name = fI.value;\r\n var lName = lI.value;\r\n var aName = aI.value;\r\n var stName = sI.value;\r\n var cName = cI.value;\r\n\r\n if (name === '' || lName === '' || aName === '' || stName === '' || cName === '') {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "34e6a8ef6f5087e9b28893118ec51538", "score": "0.618875", "text": "function validateApartmentForm()\n{\n var nameValidation = validateName(\"post_apartment_form\",\"name\",\"apartment_name_span\");\n var houseTypeValidation = validateSelectInputField(\"post_apartment_form\",\"house_type\",\"house_type_span\");\n var conditionValidation = validateSelectInputField(\"post_apartment_form\",\"condition\",\"apartment_condition_span\");\n var locationValidation = validateSelectInputField(\"post_apartment_form\",\"location\",\"apartment_location_span\");\n var propertyTypeValidation = validateSelectInputField(\"post_apartment_form\",\"property_type\",\"property_type_span\");\n var propertyStatusValidation = validateSelectInputField(\"post_apartment_form\",\"property_status\",\"property_status_span\");\n\n var priceValidation = validateInt(\"post_apartment_form\",\"price\",\"apartment_price_span\");\n var numberOfBedroomsValidation = validateInt(\"post_apartment_form\",\"number_of_bedrooms\",\"number_of_bedrooms_span\");\n var filesValidation=validatePhoto();\n \n\n if (nameValidation & houseTypeValidation & conditionValidation & locationValidation\n & propertyTypeValidation & propertyStatusValidation & priceValidation \n & numberOfBedroomsValidation & filesValidation) \n {\n //calls the function that adds an apartment to the database\n manageApartment(\"post_apartment_form\",\"add_apartment\");\n }\n return false;\n}", "title": "" }, { "docid": "c37a20433b05fed30595a5a56811ac38", "score": "0.6093079", "text": "validate() {\n let invalid = [];\n\n const displayIDs = {\n userFirst: \"First name\",\n userLast: \"Last name\",\n orgName: \"Organization Name\",\n orgLoc: \"Organization Location\",\n cleanUpTime: \"Clean Up Time\",\n cleanUpDate: \"Clean Up Start Time\",\n beachName: \"Name of Beach\",\n latDir: \"Latitude Direction\",\n lonDir: \"Longitude Direction\",\n latDeg: \"Latitude Degrees\",\n lonDeg: \"Longitude Degrees\",\n latMin: \"Latitude Minutes\",\n lonMin: \"Longitude Minutes\",\n latSec: \"Latitude Seconds\",\n lonSec: \"Longitude Seconds\",\n compassDegrees: \"Compass Degrees\",\n riverName: \"River Name\",\n riverDistance: \"Nearest River Output Distance\",\n usage: \"Usage\",\n locChoice: \"Reason for Location Choice\",\n subType: \"Substrate Type\",\n slope: \"Slope\",\n tideHeightA: \"Next Tide Height\",\n tideTimeA: \"Next Tide Time\",\n tideTypeA: \"Next Tide Type\",\n tideHeightB: \"Last Tide Height\",\n tideTypeB: \"Last Tide Type\",\n tideTimeB: \"Last Tide Time\",\n windDir: \"Wind Direction\",\n windSpeed: \"Wind Speed\"\n\n }\n\n const requiredIDs = ['userFirst', 'userLast', 'orgName', 'orgLoc',\n 'cleanUpTime', 'cleanUpDate', 'beachName', 'compassDegrees', 'riverName',\n 'riverDistance', 'slope', 'tideHeightA', 'tideHeightB', 'tideTimeA',\n 'tideTimeB', 'tideTypeA', 'tideTypeB', 'windDir', 'windSpeed',\n 'cleanUpTime', 'cleanUpDate', 'beachName', 'riverName',\n 'latDeg', 'latMin', 'latSec', 'latDir', 'lonDeg', 'lonMin', 'lonSec', 'lonDir'\n ];\n\n\n //Check for fields that need just a single entry\n for (const id of requiredIDs) {\n if (this.state.surveyData[id] === undefined) {\n invalid.push(displayIDs[id]);\n if (document.getElementById(id))\n document.getElementById(id).classList.add('invalidInput');\n }\n }\n\n //Check for usage\n if (!this.state.surveyData.usageRecreation\n && !this.state.surveyData.usageCommercial\n && !this.state.surveyData.usageOther)\n invalid.push(displayIDs.usage);\n\n //Check if the user filled out the reason for location choice\n if (!this.state.surveyData.locationChoiceDebris && !this.state.surveyData.locationChoiceProximity\n && !this.state.surveyData.locationChoiceOther)\n invalid.push(displayIDs.locChoice);\n\n // Check if the user filled out the substrate type\n if (!this.state.surveyData.substrateTypeSand && !this.state.surveyData.substrateTypePebble && !this.state.surveyData.substrateTypeRipRap\n && !this.state.surveyData.substrateTypeSeaweed && !this.state.surveyData.substrateTypeOther)\n invalid.push(displayIDs.subType);\n\n\n return invalid;\n }", "title": "" }, { "docid": "1f1e220c9e01496213c0adac0772f8e8", "score": "0.6084818", "text": "function validateForm() {\n return facility.length > 0 && equipmentType.length > 0 && equipmentID.length > 0 && priority.length > 0 && time.length;\n }", "title": "" }, { "docid": "250c141e35d38bd73666f20ac1ac115e", "score": "0.60652804", "text": "validateForm() {\n\t\tconst {name, description, athlete, date} = this.state;\n\t\treturn (\n\t\t\t\tname.length > 0 &&\n\t\t\t\tdescription.length > 0 &&\n\t\t\t\tathlete > 0\n\t\t);\n\t}", "title": "" }, { "docid": "8507aac7509c0eb2d66999015617159b", "score": "0.60635704", "text": "function validDiaryEntry() {\n\n var v = document.getElementById(\"input_\").value;\n var w = document.getElementById(\"day_\").value;\n var x = document.getElementById(\"hour_\").value;\n var y = document.getElementById(\"minute_\").value;\n var z = document.getElementById(\"am_pm_\").value;\n\n if (v == \"\" || w == \"\" || x == \"\" || y == \"\" || z == \"\") {\n alert(\"all fields must be completed\");\n return false;\n }\n}", "title": "" }, { "docid": "4dea082b7229acf96ed779cccbb8c29b", "score": "0.6056374", "text": "validateFields() {\n const { description, amount, date } = Form.getValues() //salvando os valores dos inputs em uma variável\n\n if (description.trim() === \"\" ||\n amount.trim() === \"\" ||\n date.trim() === \"\") //ta verificando se algum campo não ta preenchido, se não tiver vai dar um erro\n {\n\n throw new Error(\"Por favor, preencha todos os campos\")\n }\n }", "title": "" }, { "docid": "12ff822a6b9925cb888941d20276b51d", "score": "0.6048787", "text": "function mandatoryCheck()\n{ \n //checks all those fields who have a mandatory attribute;\n\n input_fields = document.getElementsByTagName('input');\n select_fields = document.getElementsByTagName('select'); //for cases like DOB\n textarea_fields = document.getElementsByTagName('textarea'); //for cases like Career Objective\n\n all_fields = [input_fields,select_fields,textarea_fields]; //the total set of elements that we we want to check for mandatoriness \n\n for (var j=0;j<all_fields.length;j++)\n {\n fields = all_fields[j]; //select the set of fields.\n \n for (var i=0; i<fields.length;i++)\n {\n if (fields[i].getAttribute('type') == 'hidden' || fields[i].type == 'button')\n {\n continue; //we don't want to touch such fields!\n }\n\n if (fields[i].getAttribute('mandatory') == 'true')\n {\n\n var field_name = fields[i].id; //because a field may or may not have a name but will always hv an ID\n \n //a=fields[i].name.split('_')[0]\n /* is the field enabled and still it's value is not entered */\n if ((fields[i].value==\"\")&&(input_fields[i].disabled==false) )\n {\n alertmsg = field_name.split('_')\n //now that we know validity, mark so visually and attributely\n //and tell the user\n\n styleClass = (fields[i].getAttribute('class') == null ? ' ' : fields[i].getAttribute('class')) ;\n fields[i].setAttribute('class',styleClass + ' invalid_data');\n \n if (alertmsg.length>1) //and there is more than one component in the name of the element\n {\n alert(alertmsg[1] + ' in the ' + alertmsg[0] + ' section is not filled');\n }\n else\n {\n alert(alertmsg[0] + ' is not filled!');\n }\n \n //TODO: find out a way to retrieve the parent tab of the element and call it's select() method \n fields[i].focus();\n return false;\n }\n else //if found valid, clear any existing invalidity reference!\n {\n styleClass = fields[i].getAttribute('class');\n if (styleClass != null)\n {\n x = fields[i].getAttribute('class').indexOf('invalid_data');\n class_without_invalid_mark = fields[i].getAttribute('class').slice(0,-1*x);\n fields[i].setAttribute('class',class_without_invalid_mark);\n }\n \n \n }\n }\n //whether it's mandatory or not, we need to replace it with proper name\n //everything is good with this field now replace it's name with it's id.\n if ((fields[i].id != '' || fields[i].id != null) && (fields[i].value != '' || fields[i].value != null))\n {\n //alert('setting name of ' + fields[i].name + ' to ' + fields[i].id);\n if (fields[i].tagName != 'select')\n fields[i].name = fields[i].id; // we dont need to do this for select. ebcause we have monthyear. and of dependency checking fails, then the name also gets changed. which creates a problem later on.\n }\n }\n }\n \n \n var tables = new Array('marks','workex','certification','projects','academic','extracurricular')\n \n //dependency checking -- if content is filled and the month-year isn't OR if month-year is filled and content isn't.\n select=document.getElementsByTagName('select');\n for (var i=0;i<select.length;i++)\n {\n a=select[i].id.split('_')[0]\n if (tables.indexOf(a)>=0)\n {\n o=select[i].parentNode.parentNode.children;\n if (select[i].value)\n var filled=true;\n else\n var filled = false;\n \n for(var j=0;j<o.length;j++)\n {\n \n for (var k=0;k<o[j].children.length;k++)\n {\n \n if ((o[j].children[k].tagName==\"INPUT\" || o[j].children[k].tagName==\"SELECT\" || o[j].children[k].tagName==\"TEXTAREA\") && ((filled && !o[j].children[k].value)|| (!filled && o[j].children[k].value)))\n {\n alertmsg=o[j].children[k].id.split('_');\n alert('Check your '+ alertmsg[0] +' entry...' + alertmsg[1] +' is not filled properly'); return false;\n }\n }\n\n } \n }\n } \n //alert('returning true')\n return true;\n}", "title": "" }, { "docid": "16063e5334c663650931c6f9f18da431", "score": "0.60487336", "text": "function validationForm(fname,lname,cnumber,address,email,usertype,fieldNames,errorDivId){\n \n let val_fname=validateNameFields(fname,fieldNames[0],errorDivId[0]);\n let val_lname=validateNameFields(lname,fieldNames[1],errorDivId[1]);\n let val_cnumber=validateContactNumber(cnumber,fieldNames[2],errorDivId[2]);\n let val_address=validateAddress(address,fieldNames[3],errorDivId[3]);\n let val_email=validateEmail(email,fieldNames[4],errorDivId[4]);\n let val_usertype=validateUserType(usertype,fieldNames[5],errorDivId[5]);\n\n if(val_address && val_cnumber && val_email && val_fname && val_lname && val_usertype){\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "65fbd0f33934c91e6c7ed5bf4816a716", "score": "0.6048493", "text": "function validateTableFields(description, name, owner, predecessor, successor) {\n var provider = $(\"#overview_provider\").val();\n var version = $(\"#overview_version\").val();\n if (!description || !name || !owner || !predecessor || !successor || !provider || !version) {\n alert('Please fill all the fields');\n return false;\n }\n }", "title": "" }, { "docid": "c5347033864bfb3c6d36f430b572503c", "score": "0.60444295", "text": "function validateSupplierForm(){\n\tvar filter=/[^a-zA-Z ]+/g;\n\tvar filter2=/[^0-9.]+/g;\n\tvar filter3=/[^0-9.]+/g;\n\tvar supplier=$('#sname').val();\n\tvar ccom=$('#ccom').val();\n\tvar rcom=$('#rcom').val();\n\t\n\t\n\tif(null==supplier || supplier==\"\"){\n\t\ta=false;\n\t\t$('#sname_error').html('Supplier cannot be empty');\n\t}\n\telse if(filter.test(supplier)){\n\t\ta=false;\n\t\t$('#sname_error').html('*Should only have alphabets');\n\t}\n\telse{\n\t\ta=true;\n\t\tchecksupplier();\n\t}\n\t\n\t\n\tif(null==ccom || ccom==\"\"){\n\t\tb=false;\n\t\t$('#ccom_error').html('*Cannot be empty');\n\t}\n\telse if(filter2.test(ccom)){\n\t\tb=false;\n\t\t$('#ccom_error').html('*Should only have digits');\n\t}\n\telse{\n\t\tb=true;\n\t\t$('#ccom_error').html('');\n\t}\n\t\n\t\n\n\tif(null==rcom || rcom==\"\"){\n\t\tc=false;\n\t\t$('#rcom_error').html('*Cannot be empty');\n\t}\n\telse if(filter3.test(rcom)){\n\t\tc=false;\n\t\t$('#rcom_error').html('*Should only have digits');\n\t}\n\telse{\n\t\tc=true;\n\t\t$('#rcom_error').html('');\n\t}\n\t\n\t\n\t\n\t\n\t\n\tif(a== true && b==true && c==true && d==true){\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\t\n}", "title": "" }, { "docid": "38238d2ed465264122768edd75463891", "score": "0.6036514", "text": "function validar_11(){\n var nombrePac = document.getElementById(\"NombrePaciente\");\n var apellidoPaciente = document.getElementById(\"ApellidoPaciente\");\n var cedulaPac = document.getElementById(\"CedulaPaciente\");\n var telefonoPac = document.getElementById(\"TelefonoPaciente\");\n var correoPac = document.getElementById(\"Correo_Solicitante\");\n var estadoPac = document.getElementById(\"Estado_Res\");\n var nombreMed = document.getElementById(\"NombreMed\");\n var principioMed = document.getElementById(\"PrincipioMed\");\n var presentacionMed = document.getElementById(\"PresentacionMed\");\n var especificacionesMed = document.getElementById(\"EspecificacionMed\");\n\n if(nombrePac.value ==\"\" || nombrePac.value.indexOf(\" \") == 0 || (isNaN(nombrePac.value)==false) || nombrePac.value.length>13){\n alert (\"Indique su nombre\");\n document.getElementById(\"NombrePaciente\").value = \"\";\n document.getElementById(\"NombrePaciente\").focus();\n return false;\n }\n else if(apellidoPaciente.value ==\"\" || apellidoPaciente.value.indexOf(\" \") == 0 || (isNaN(apellidoPaciente.value)==false) || apellidoPaciente.value.length>13){\n alert (\"Indique su apellido\");\n document.getElementById(\"ApellidoPaciente\").value = \"\";\n document.getElementById(\"ApellidoPaciente\").focus();\n return false;\n }\n else if(cedulaPac.value ==\"\" || cedulaPac.value.indexOf(\" \") == 0 || (isNaN(cedulaPac.value)) || cedulaPac.value<2000000 || cedulaPac.value>99999999){\n alert (\"Indique su cedula\");\n document.getElementById(\"CedulaPaciente\").value = \"\";\n document.getElementById(\"CedulaPaciente\").focus();\n return false;\n }\n else if(telefonoPac.value ==\"\" || telefonoPac.value.indexOf(\" \") == 0 || (isNaN(telefonoPac.value)) || telefonoPac.value.length>13){\n alert (\"Indique su telefono\");\n document.getElementById(\"TelefonoPaciente\").value = \"\";\n return false;\n }\n else if(correoPac.value ==\"\" || correoPac.value.indexOf(\" \") == 0 || (isNaN(correoPac.value)==false)){\n alert (\"Indique su correo\");\n document.getElementById(\"Correo_Solicitante\").value = \"\";\n document.getElementById(\"Correo_Solicitante\").focus();\n return false;\n }\n else if(estadoPac.value ==\"\" || estadoPac.value == null || estadoPac == 0){\n alert (\"Indique su estado\");\n document.getElementById(\"Estado_Res\").value = \"\";\n document.getElementById(\"Estado_Res\").focus();\n return false;\n }\n else if(nombreMed.value ==\"\" || nombreMed.value.indexOf(\" \") == 0 || (isNaN(nombreMed.value)==false) || nombreMed.value.length>13){\n alert (\"Indique el nombre del medicamento\");\n document.getElementById(\"NombreMed\").value = \"\";\n document.getElementById(\"NombreMed\").focus();\n return false;\n }\n else if(principioMed.value ==\"\" || principioMed.value.indexOf(\" \") == 0 || (isNaN(principioMed.value)==false) || principioMed.value.length>50){\n alert (\"Indique el principio activo del medicamento\");\n document.getElementById(\"PrincipioMed\").value = \"\";\n document.getElementById(\"PrincipioMed\").focus();\n return false;\n }\n else if(presentacionMed.value ==\"\" || presentacionMed.value == null || presentacionMed == 0){\n alert (\"Indique la presentación del medicamento\");\n document.getElementById(\"PresentacionMed\").value = \"\";\n document.getElementById(\"PresentacionMed\").focus();\n return false;\n }\n else if(especificacionesMed.value ==\"\" || especificacionesMed.value.indexOf(\" \") == 0 || (isNaN(especificacionesMed.value)==false) || especificacionesMed.value.length>13){\n alert (\"Indique las especificaciones del medicamento\");\n document.getElementById(\"EspecificacionMed\").value = \"\";\n document.getElementById(\"EspecificacionMed\").focus();\n return false;\n }\n}", "title": "" }, { "docid": "2ed95711db2904f0e68dc2ab6bd86e98", "score": "0.60361946", "text": "function validateHK() { // Validation Function For House Keeper Registration Form (Added By Vidya)\n\tvalid = true;\n\tif (houseKeeperForm.name.value == \"\") {\n\t\talert(\"Please Enter Your Name\");\n\t\thouseKeeperForm.name.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.name) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.fathersName.value == \"\") {\n\t\talert(\"Please Enter Your Father's Name\");\n\t\thouseKeeperForm.fathersName.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.fathersName) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.mothersName.value == \"\") {\n\t\talert(\"Please Enter Your Mother's Name\");\n\t\thouseKeeperForm.mothersName.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.mothersName) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.birthDate.value == \"\") {\n\t\talert(\"Please Enter Your Date of Birth\");\n\t\thouseKeeperForm.birthDate.focus();\n\t\treturn false;\n\t}\n\tvar radioSelected = false;\n\tfor (i = 0; i < houseKeeperForm.gender.length; i++) {\n\t\tif (houseKeeperForm.gender[i].checked) {\n\t\t\tradioSelected = true;\n\t\t}\n\t}\n\tif (!radioSelected) {\n\t\talert(\"Please Select Gender\");\n\t\treturn (false);\n\t}\n\tif (houseKeeperForm.bloodGroup.selectedIndex == 0) {\n\t\talert(\"Please Select Blood Group\");\n\t\thouseKeeperForm.bloodGroup.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.mobileNo.value == \"\") {\n\t\talert(\"Please Enter Your Mobile No.\");\n\t\thouseKeeperForm.mobileNo.focus();\n\t\treturn false;\n\t}\n\tif (numeric(houseKeeperForm.mobileNo) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.mobileNo.value.length < 10 && houseKeeperForm.mobileNo.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\thouseKeeperForm.mobileNo.value = \"\";\n\t\thouseKeeperForm.mobileNo.focus();\n\t\treturn false;\n\t}\n\tif (numeric(houseKeeperForm.telephoneNo) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.telephoneNo.value.length < 10 && houseKeeperForm.telephoneNo.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\thouseKeeperForm.telephoneNo.value = \"\";\n\t\thouseKeeperForm.telephoneNo.focus();\n\t\treturn false;\n\t}\n//\tif (houseKeeperForm.email.value == \"\") {\n//\t\talert(\"Please Enter Your e-Mail Id\");\n//\t\thouseKeeperForm.email.focus();\n//\t\treturn false;\n//\t}\n\tif (emailValidator(houseKeeperForm.email) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.permanentAddress.value == \"\") {\n\t\talert(\"Please Enter Your Permanent Address\");\n\t\thouseKeeperForm.permanentAddress.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.permanentCountry.selectedIndex == 0) {\n\t\talert(\"Please Select Country\");\n\t\thouseKeeperForm.permanentCountry.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.permanentState.selectedIndex == 0) {\n\t\talert(\"Please Select State\");\n\t\thouseKeeperForm.permanentState.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.permanentDistrict.selectedIndex == 0) {\n\t\talert(\"Please Select District\");\n\t\thouseKeeperForm.permanentDistrict.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.permanentCity.selectedIndex == 0) {\n\t\talert(\"Please Select City\");\n\t\thouseKeeperForm.permanentCity.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.permanentPostOffice.selectedIndex == 0) {\n\t\talert(\"Please Select Post Office\");\n\t\thouseKeeperForm.permanentPostOffice.focus();\n\t\treturn false;\n\t}\n\tif (numeric(houseKeeperForm.permanentPhoneNo1) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.permanentPhoneNo1.value.length < 10 && houseKeeperForm.permanentPhoneNo1.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\thouseKeeperForm.permanentPhoneNo1.value = \"\";\n\t\thouseKeeperForm.permanentPhoneNo1.focus();\n\t\treturn false;\n\t}\n\tif (numeric(houseKeeperForm.permanentPhoneNo2) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.permanentPhoneNo2.value.length < 10 && houseKeeperForm.permanentPhoneNo2.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\thouseKeeperForm.permanentPhoneNo2.value = \"\";\n\t\thouseKeeperForm.permanentPhoneNo2.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.presentAddress.value == \"\") {\n\t\talert(\"Please Enter Your Present Address\");\n\t\thouseKeeperForm.presentAddress.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.presentCountry.selectedIndex == 0) {\n\t\talert(\"Please Select Country\");\n\t\thouseKeeperForm.presentCountry.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.presentState.selectedIndex == 0) {\n\t\talert(\"Please Select State\");\n\t\thouseKeeperForm.presentState.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.presentDistrict.selectedIndex == 0) {\n\t\talert(\"Plese Select District\");\n\t\thouseKeeperForm.presentDistrict.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.presentCity.selectedIndex == 0) {\n\t\talert(\"Please Select City\");\n\t\thouseKeeperForm.presentCity.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.presentPostOffice.selectedIndex == 0) {\n\t\talert(\"Please Select Post Office\");\n\t\thouseKeeperForm.presentPostOffice.focus();\n\t\treturn false;\n\t}\n\tif (numeric(houseKeeperForm.presentPhoneNo1) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.presentPhoneNo1.value.length < 10 && houseKeeperForm.presentPhoneNo1.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\thouseKeeperForm.presentPhoneNo1.value = \"\";\n\t\thouseKeeperForm.presentPhoneNo1.focus();\n\t\treturn false;\n\t}\n\tif (numeric(houseKeeperForm.presentPhoneNo2) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.presentPhoneNo2.value.length < 10 && houseKeeperForm.presentPhoneNo2.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\thouseKeeperForm.presentPhoneNo2.value = \"\";\n\t\thouseKeeperForm.presentPhoneNo2.focus();\n\t\treturn false;\n\t}\n//\tif (houseKeeperForm.height.value == \"\") {\n//\t\talert(\"Please Enter Height\");\n//\t\thouseKeeperForm.height.focus();\n//\t\treturn false;\n//\t}\n//\tif (houseKeeperForm.chest.value == \"\") {\n//\t\talert(\"Please Enter Chest\");\n//\t\thouseKeeperForm.chest.focus();\n//\t\treturn false;\n//\t}\n//\tif (houseKeeperForm.weight.value == \"\") {\n//\t\talert(\"Please Enter Weight\");\n//\t\thouseKeeperForm.weight.focus();\n//\t\treturn false;\n//\t}\n\tif ((houseKeeperForm.otherLanguage.selectedIndex == 0) && (houseKeeperForm.otherLanguageRead.checked == true || houseKeeperForm.otherLanguageWrite.checked == true || houseKeeperForm.otherLanguageSpeak.checked == true)) {\n\t\talert(\"Please Select Language\");\n\t\thouseKeeperForm.otherLanguage.focus();\n\t\treturn false;\n\t}\n\tif ((houseKeeperForm.otherLanguage.selectedIndex != 0) && (houseKeeperForm.otherLanguageRead.checked == false && houseKeeperForm.otherLanguageWrite.checked == false && houseKeeperForm.otherLanguageSpeak.checked == false)) {\n\t\talert(\"Please Select A Relevant Option For Other Language\");\n\t\thouseKeeperForm.otherLanguage.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.underMetricBoard.value == \"\") {\n\t\talert(\"Please Enter Your Under Metric Board\");\n\t\thouseKeeperForm.underMetricBoard.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.underMetricBoard) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.underMetricInstitute.value == \"\") {\n\t\talert(\"Please Enter the Name of Your Under Metric Institute\");\n\t\thouseKeeperForm.underMetricInstitute.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.underMetricInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.underMetricCountry.selectedIndex == 0) {\n\t\talert(\"Please Select Your Under Metric Country\");\n\t\thouseKeeperForm.underMetricCountry.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.underMetricState.selectedIndex == 0) {\n\t\talert(\"Please Select Your Under Metric State\");\n\t\thouseKeeperForm.underMetricState.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.underMetricDistrict.selectedIndex == 0) {\n\t\talert(\"Please Select Your Under Metric District\");\n\t\thouseKeeperForm.underMetricDistrict.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.underMetricCity.selectedIndex == 0) {\n\t\talert(\"Please Select Your Under Metric City\");\n\t\thouseKeeperForm.underMetricCity.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.underMetricPercentage.value == \"\") {\n\t\talert(\"Please Enter Your Under Metric Percentage\");\n\t\thouseKeeperForm.underMetricPercentage.focus();\n\t\treturn false;\n\t}\n\tif (numericPercentage(houseKeeperForm.underMetricPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.underMetricSubject.value == \"\") {\n\t\talert(\"Please Enter Your Under Metric Subject\");\n\t\thouseKeeperForm.underMetricSubject.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.highSchoolBoard) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.highSchoolInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (numericPercentage(houseKeeperForm.highSchoolPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.highSchoolSubject) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.higherSecondaryBoard) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.higherSecondaryInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (numericPercentage(houseKeeperForm.higherSecondaryPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.higherSecondarySubject) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.graduationUniversity) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.graduationInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (numericPercentage(houseKeeperForm.graduationPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.graduationSubject) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.otherBoard) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.otherInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (numericPercentage(houseKeeperForm.otherPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.otherSubject) == false) {\n\t\treturn false;\n\t}\n\tif ((document.getElementById(\"employmentYes\").checked == false) && (document.getElementById(\"employmentNo\").checked == false)) {\n\t\talert(\"Please Select A Value For Your Present Employment\");\n\t\tdocument.getElementById(\"employmentYes\").focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.employment[0].checked == true) {\n\t\tif (houseKeeperForm.experience.value == \"\") {\n\t\t\talert(\"Please Fill In Your Work Experience\");\n\t\t\thouseKeeperForm.experience.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (houseKeeperForm.nameOfOrganization.value == \"\") {\n\t\t\talert(\"Please Fill In The Name of Your Previous Organization\");\n\t\t\thouseKeeperForm.nameOfOrganization.focus();\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (houseKeeperForm.nameOne.value == \"\") {\n\t\talert(\"Please Enter the Name of a Responsible Person\");\n\t\thouseKeeperForm.nameOne.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.nameOne) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.nameTwo.value == \"\") {\n\t\talert(\"Please Enter the Name of a Responsible Person\");\n\t\thouseKeeperForm.nameTwo.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(houseKeeperForm.nameTwo) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.addressOne.value == \"\") {\n\t\talert(\"Please Enter the Address of a Responsible Person\");\n\t\thouseKeeperForm.addressOne.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.addressTwo.value == \"\") {\n\t\talert(\"Please Enter the Address of a Responsible Person\");\n\t\thouseKeeperForm.addressTwo.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.pinCodeOne.value == \"\") {\n\t\talert(\"Please Enter the PIN Code of a Responsible Person\");\n\t\thouseKeeperForm.pinCodeOne.focus();\n\t\treturn false;\n\t}\n\tif (numeric(houseKeeperForm.pinCodeOne) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.pinCodeOne.value.length < 6 && houseKeeperForm.pinCodeOne.value.length > 1) {\n\t\talert(\"Please Enter a Valid Six Digit PIN Code.\");\n\t\thouseKeeperForm.pinCodeOne.value = \"\";\n\t\thouseKeeperForm.pinCodeOne.focus();\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.pinCodeTwo.value == \"\") {\n\t\talert(\"Please Enter the PIN Code of a Responsible Person\");\n\t\thouseKeeperForm.pinCodeTwo.focus();\n\t\treturn false;\n\t}\n\tif (numeric(houseKeeperForm.pinCodeTwo) == false) {\n\t\treturn false;\n\t}\n\tif (houseKeeperForm.pinCodeTwo.value.length < 6 && houseKeeperForm.pinCodeTwo.value.length > 1) {\n\t\talert(\"Please Enter a Valid Six Digit PIN Code.\");\n\t\thouseKeeperForm.pinCodeTwo.value = \"\";\n\t\thouseKeeperForm.pinCodeTwo.focus();\n\t\treturn false;\n\t}\n\tvar temp=confirm('Please check all details for correction if any, before submit.');\n\tif(temp==true) {\n\treturn true;\n\t}else {\n\treturn false;\n\t}\n}", "title": "" }, { "docid": "ed5a2558b8f28b070e25d1b0b8344fcd", "score": "0.60350394", "text": "function validate_MandatoryFields(){\r\n\r\n}", "title": "" }, { "docid": "1892c79c60358d55bdef54e02d009f76", "score": "0.6028527", "text": "validateData(){\n if(this.refs.title.value.length < 2 || this.refs.title.value.length > 50){\n alert('Title field is invalid!');\n return false;\n }\n if(this.refs.description.value.length < 2 || this.refs.description.value.length > 300){\n alert('Description field is invalid!');\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "3ea72388c5ab5a4f45bad20e270ce7d5", "score": "0.5996534", "text": "function Validate_new_task() {\n var name = $('#taskname').val();\n var desc = $('#taskdesc').val();\n var pub = $('#datepublish').val();\n var selecteam = $('#slc_teams option:selected').text();\n var eachperiod = $('#eachperiod').val();\n \n if (check_spaces(name) || check_spaces(desc) || check_spaces(pub) || check_spaces(eachperiod) || check_spaces(selecteam)) {\n alert(\"Fill all fields!!\");\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "a74905bd86806b3ee7b6f47498ef120e", "score": "0.59932697", "text": "function validateMandatoryFields(){\r\n\terrMsg = new Array();\r\n\terrCount=0;\r\n\r\n\t//Colocar en el estado inicial al campo resaltado\r\n\tresetFields(field);\r\n\tfirstErr=null;\r\n\r\n\t//Llamado a las funciones de validacion de los campos\r\n\tvalidate_name();\r\n\tvalidate_lastname();\r\n\tcheckFields();\t\r\n\tvalidate_cont_postal_cd();\r\n\tvalidate_cont_sex_cd();\r\n\t\r\n\t\r\n\t\r\n\r\n\tif(errCount>0){\r\n\t\tfor(i=0;i<1;i++){\r\n\t\t alert(errMsg[i]);\r\n\t }\r\n\t\tfield=firstErr.id;\r\n\t\t//Resaltar el primer campo donde existe un error\r\n\t\tdocument.getElementById('title_'+firstErr.id+'_underline').style.display='block';\r\n\t\tdocument.getElementById('label_'+firstErr.id+'_underline').style.background='#FFFFCC';\r\n\t\tdocument.getElementById('input_'+firstErr.id+'_underline').style.background='#FFFFCC';\r\n\r\n\t\t//Fijar el foco en el campo en el que se presenta el primer error\r\n\t\tfirstErr.focus();\r\n\t\tdocument.getElementById('title_'+firstErr.id+'_underline').scrollIntoView(true);\r\n\t\t\r\n\t\t\r\n\t}else{\r\n\t\tdocument.forma.submit();\r\n\t}\r\n}", "title": "" }, { "docid": "013512f15f5dc1b533d04947691ea861", "score": "0.5979101", "text": "function validar_13(){\n var nombre_Med = document.getElementById(\"NombreMedSol\");\n var principio_Med = document.getElementById(\"PrincipioMedSol\");\n var presentacion_Med = document.getElementById(\"PresentacionMedSol\");\n var laboratorio_Med = document.getElementById(\"Laboratorio_MedSol\");\n var especificaciones_Med = document.getElementById(\"Especificacion_MedSol\");\n var unidades_Med = document.getElementById(\"Cantidad_MedSol\");\n var nombre_Sol= document.getElementById(\"Nombre_Solicitante\");\n var apellido_Sol = document.getElementById(\"Apellido_Solicitante\");\n var telefono_Sol= document.getElementById(\"Telefono_Solicitante\");\n var estado_Sol = document.getElementById(\"Estado_Solicitante\");\n\n if(nombre_Med.value ==\"\" || nombre_Med.value.indexOf(\" \") == 0 || (isNaN(nombre_Med.value)==false) || nombre_Med.value.length>20){\n alert (\"Indique nombre del medicamento\");\n document.getElementById(\"NombreMedSol\").value = \"\";\n document.getElementById(\"NombreMedSol\").focus();\n return false;\n }\n else if(principio_Med.value ==\"\" || principio_Med.value.indexOf(\" \") == 0 || (isNaN(principio_Med.value)==false) || principio_Med.value.length>20){\n alert (\"Indique principio activo del medicamento\");\n document.getElementById(\"PrincipioMedSol\").value = \"\";\n document.getElementById(\"PrincipioMedSol\").focus();\n return false;\n }\n else if(presentacion_Med.value ==\"\" || presentacion_Med.value.indexOf(\" \") == 0 || (isNaN(presentacion_Med.value)==false) || presentacion_Med.value.length>20){\n alert (\"Indique la presentación del medicamento\");\n document.getElementById(\"PresentacionMedSol\").value = \"\";\n document.getElementById(\"PresentacionMedSol\").focus();\n return false;\n }\n else if(laboratorio_Med.value ==\"\" || laboratorio_Med.value.indexOf(\" \") == 0 || (isNaN(laboratorio_Med.value)==false) || laboratorio_Med.value.length>20){\n alert (\"Indique el laboratorio del medicamento\");\n document.getElementById(\"Laboratorio_MedSol\").value = \"\";\n document.getElementById(\"Laboratorio_MedSol\").focus();\n return false;\n }\n else if(especificaciones_Med.value ==\"\" || especificaciones_Med.value == null || especificaciones_Med == 0){\n alert (\"Indique las especificaciones del medicamento\");\n document.getElementById(\"Especificacion_MedSol\").value = \"\";\n document.getElementById(\"Especificacion_MedSol\").focus();\n return false;\n }\n else if(unidades_Med.value ==\"\" || unidades_Med.value.indexOf(\" \") == 0 || (isNaN(unidades_Med.value)==false) || unidades_Med.value.length>20){\n alert (\"Indique la cantidad necesitada\");\n document.getElementById(\"Cantidad_MedSol\").value = \"\";\n document.getElementById(\"Cantidad_MedSol\").focus();\n return false;\n }\n else if(nombre_Sol.value ==\"\" || nombre_Sol.value.indexOf(\" \") == 0 || (isNaN(nombre_Sol.value)==false) || nombre_Sol.value.length>20){\n alert (\"Indique su nombre\");\n document.getElementById(\"Nombre_Solicitante\").value = \"\";\n document.getElementById(\"Nombre_Solicitante\").focus();\n return false;\n }\n else if(apellido_Sol.value ==\"\" || apellido_Sol.value.indexOf(\" \") == 0 || (isNaN(apellido_Sol.value)==false) || apellido_Sol.value.length>20){\n alert (\"Indique su apellido\");\n document.getElementById(\"Apellido_Solicitante\").value = \"\";\n document.getElementById(\"Apellido_Solicitante\").focus();\n return false;\n }\n else if(telefono_Sol.value ==\"\" || telefono_Sol.value.indexOf(\" \") == 0 ){\n alert (\"Indique su telefono\");\n document.getElementById(\"Telefono_Solicitante\").value = \"\";\n return false;\n }\n else if(estado_Sol.value ==\"\" || estado_Sol.value == null || estado_Sol == 0){\n alert (\"Indique su estado\");\n document.getElementById(\"Estado_Solicitante\").value = \"\";\n document.getElementById(\"Estado_Solicitante\").focus();\n return false;\n }\n}", "title": "" }, { "docid": "fa121d6dc6cd9a139e30a807a18418bc", "score": "0.5967962", "text": "function agregarVladicaciones(){\n $(\"#txtNumeropersonal\").validateNumLetter(' 0123456789');\n $(\"#txtNumerointpersonal\").validateNumLetter(' 0123456789');\n $(\"#txtNumeroempleo\").validateNumLetter(' 0123456789');\n $(\"#txtNumerointempleo\").validateNumLetter(' 0123456789');\n }", "title": "" }, { "docid": "e27928eea1bfcf25d3541aa3dfa87850", "score": "0.5966848", "text": "function validationInput() {\n\t\tif($(\"#proname\").val() == \"\"){\n\t\t\talert(\"សូមបញ្ចូល ឈ្មោះទំនិញ។\");\n\t\t\t$(\"#proname\").focus();\n\t\t\treturn true;\n\t\t}\n\t\tif($(\"#proid\").val() == \"\"){\n\t\t\talert(\"ឈ្មោះទំនិញ មិនត្រឹមត្រូវ។\");\n\t\t\t$(\"#proname\").focus();\n\t\t\treturn true;\n\t\t}\n\t\tif($(\"#proqty\").val() == \"\"){\n\t\t\talert(\"សូមបញ្ចូល ចំនួនទំនិញ។\");\n\t\t\t$(\"#proqty\").focus();\n\t\t\treturn true;\n\t\t}\n\t\tif($(\"#costprice\").val() == \"\"){\n\t\t\talert(\"សូមបញ្ចូល តំលៃដើម។\");\n\t\t\t$(\"#costprice\").focus();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "61d28c62fb2afb1428652fe686a0a66b", "score": "0.59640545", "text": "function validate_analyser_data(ref) {\n form = document.forms[ref];\n if (form.analyserData.value == \"\") {\n window.alert(\"Analyser data cannot be empty\");\n document.getElementById(\"tibialootsplitform\").reset();\n return false;\n }\n\n if (\n form.analyserData.value.length < 50 ||\n !form.analyserData.value.includes(\"Balance\") ||\n !form.analyserData.value.includes(\"Supplies\") ||\n !form.analyserData.value.includes(\"Loot\") ||\n !form.analyserData.value.includes(\"Session data\") ||\n !form.analyserData.value.includes(\"Loot Type\")\n ) {\n window.alert(\n \"Incorrect analyser data. Please copy the log and try again. \\nIf you believe this is a mistake, please raise a bug report.\"\n );\n document.getElementById(\"tibialootsplitform\").reset();\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "632264ea50bd40f25986668bbb0de0b8", "score": "0.59586406", "text": "function alphanumerikcheck(formname,alphanumtext,alpanumesg)\r\n\t{\r\n\t\t\t//alert(\"formname \"+formname);\r\n\t\t\t// alert(\"fieldstring1 \"+fieldstring1);\r\n\t\t\t//alert(\"fieldstring2 \"+fieldstring2);\r\n\tvar msg1 = \"\";\r\n\r\n\tif (eval(\"document.\"+formname+\".\"+alphanumtext+\".value.length\")== 0)\r\n\t{\r\n\t\t//alert(\" Enter \"+alpanumesg);\r\n\t\tmsg1 = msg1 + \"enter \" + alpanumesg + \"\\n\";\r\n\t\teval(\"document.\"+formname+\".\"+alphanumtext+\".focus()\");\r\n\t\treturn msg1;\r\n\t}\r\n\r\n\tif (eval(\"document.\"+formname+\".\"+alphanumtext+\".value\")== \"\")\r\n\t{\r\n\t\t//alert(\"Blank spaces are not allowed in\"+alphmsg);\r\n\t\t//alert(\" Enter \"+alpanumesg);\r\n\t\tmsg1 = msg1 + \"enter \" + alpanumesg+ \"\\n\";\r\n\t\teval(\"document.\"+formname+\".\"+alpanumesg+\".focus()\");\r\n\t\treturn msg1;\r\n\t}\r\n\r\n\tif(eval(\"document.\"+formname+\".\"+alphanumtext+\".value\")!=\"\")\r\n\t{\r\n\t\tvar checkOK6 = \"abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-_/()#\\t\\r\\n\\f\";\r\n\t\tvar checkStr6 = eval(\"document.\"+formname+\".\"+alphanumtext+\".value\");\r\n\t\tvar ckspclchar=0;\r\n\t\tfsblnk=0;\r\n\t\tfschar=\"\";\r\n\t\r\n\t\tfor (fsblnk = 0; fsblnk < checkStr6.length; fsblnk++)\r\n\t\t{\r\n\t\t\tfschar=checkStr6.charAt(0);\r\n\t\t}\t\t\t \r\n\t\r\n\t\tif(fschar==\" \")\r\n\t\t{\r\n\t\t\tmsg1 = msg1 + \"First Character should not be a space in \"+alpanumesg;\r\n\t\t\teval(\"document.\"+formname+\".\"+alphanumtext+\".focus()\");\r\n\t\t\treturn msg1;\t\t\r\n\t\t}\r\n\r\n\t\tfschar=\"\";\r\n\t\t\t\t\r\n \tvar allValid6 = true;\r\n\t\tvar cnt6 = 0;\r\n\t\tvar flag6 = 0;\r\n\t\tvar totalLen6 = eval(\"document.\"+formname+\".\"+alphanumtext+\".value.length\");\r\n\r\n\t\tvar spsalpha=0;\r\n\t\tvar overallspacecheckalncheck=\"\";\r\n\t\tfor(totsspacealpha=0;totsspacealpha<=totalLen6;totsspacealpha++)\r\n\t\t{\r\n\t\t\t//if(checkStr6[totsspacealpha]==' ')\r\n\t\t\toverallspacecheckalncheck=checkStr6.charAt(totsspacealpha);\r\n\t\t\tif(overallspacecheckalncheck==' ')\r\n\t\t\t{\r\n\t\t\t\tspsalpha=spsalpha+1;\r\n\t\t\t//alert(spsalpha+\" spsalpha\");\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//alert(spsalpha+\" spsalpha\");\r\n\t\tif(parseInt(totalLen6)==parseInt(spsalpha))\r\n\t\t{\r\n\t\t//alert(\"Enter \" +alpanumesg);\r\n\t\t\tmsg1 = msg1 + \"enter \" + alpanumesg+ \"\\n\";\r\n\t\t\teval(\"document.\"+formname+\".\"+alphanumtext+\".focus()\");\r\n\t\treturn msg1;\r\n\t\t}\r\n\r\n\t\tfor (mab = 0; mab < checkStr6.length; mab++)\r\n\t\t{\r\n\t\t\tchalph = checkStr6.charAt(mab);\r\n\t\t\tfor (nab = 0; nab < checkOK6.length; nab++)\r\n\t\t\t\tif (chalph == checkOK6.charAt(nab))\r\n\t\t\t\t\tbreak;\r\n\t\t if (nab == checkOK6.length)\r\n\t\t\t{\r\n\t\t\t allValid6 = false;\r\n\t\t\t break;\r\n\t\t\t}\r\n\t\t\r\n\t\t /*\r\n\t\tif(chalph == '.')\r\n\t\t\t{\r\n\t\t\t\tcnt6= cnt6+1;\r\n\t\t\t}\r\n\t\t\t\t\t \r\n\t\tif((chalph=='.' && mab == totalLen6-1)) // || (ch=='.' && mab == 0)) 'for initial dot\r\n\t\t\t{\r\n\t\t \tflag6 = 1;\r\n\t\t\t}*/\r\n\t\t}//end of for statement\r\n\t\t\t\t \r\n\t\tif (cnt6 > 1 || flag6 == 1 || !allValid6 )\r\n\t\t{\r\n\t\t //alert(\" Enter only alphanumeric characters in \"+alpanumesg);\r\n\t\t \r\n\t\t\tmsg1 = msg1 + \" Enter only alphanumeric characters in \" + alpanumesg+ \"\\n\";\r\n\t\t\teval(\"document.\"+formname+\".\"+alphanumtext+\".focus()\");\r\n\t\t\treturn msg1;\r\n\t\t}else{return(0);}\r\n\t}\r\n}", "title": "" }, { "docid": "ff6138b4ed76bfc07e25a157871dfb60", "score": "0.59355426", "text": "function valid(value)\n{\n //variables holding the various elements in the registration page\n var name=document.register.coll_name.value;\n var shrt_name=document.register.coll_short_name.value;\n var code=document.register.coll_code.value;\n \n var eng=document.register.eng.value;\n var mec=document.register.mec.value;\n var man=document.register.man.value;\n\n //to check whether atleast one course in engineering is selected or not\n var eng_valid=false;\n var engineering=document.getElementById(\"engineering\");\n for(var i=0; i<engineering.options.length; i++)\n {\n if(engineering.options[i].selected)\n {\n\t eng_valid=true;\n\t}\n }\n //to check whether atleast one course in engineering is selected or not\n\n //to check whether atleast one course in medical is selected or not \n var med_valid=false;\n var medical=document.getElementById(\"medicl\");\n for(var i=0; i<medical.options.length; i++)\n {\n if(medical.options[i].selected)\n {\n\t med_valid=true;\n\t}\n }\n //to check whether atleast one course in medical is selected or not\n\n //to check whether atleast one course in management is selected or not\n var man_valid=false;\n var management=document.getElementById(\"management\");\n for(var i=0; i<management.options.length; i++)\n {\n if(management.options[i].selected)\n {\n\t man_valid=true;\n\t}\n }\n //to check whether atleast one course in management is selected or not\n \n var affiliated=document.register.affiliated.value;\n var category=document.register.category.value;\n var type=document.register.type.value;\n \n var intake=document.register.students_intake.value;\n var city=document.register.city.value;\n var state=document.register.state.value;\n var pincode=document.register.pincode.value;\n \n var contact=document.register.contact.value;\n var contact2=document.register.contact2.value;\n\n var fax=document.register.fax.value;\n var fax2=document.register.fax2.value;\n \n var email=document.register.emailid.value;\n var website=document.register.website.value;\n \n var logo=document.register.file.value;\n \n var year=document.register.yoo.value;\n \n var director=document.register.director.value;\n //end of variables holding the various elements in the registration page\n\n //validating the college name\n if(/^[-a-zA-Z .,]*$/.test(name)==false)\n {\n alert(\"Invalid College Name: \"+name);\n document.register.coll_name.value=\"\";\n document.register.coll_name.focus();\n return false;\n }\n //end of validating the college name\n\n //validating the short name of the college\n else if(/^[a-zA-Z]*$/.test(shrt_name)==false)\n {\n alert(\"Invalid Short Name: \"+shrt_name);\n document.register.coll_short_name.value=\"\";\n document.register.coll_short_name.focus();\n return false; \n }\n //end of validating the short name of the college\n\n //validating the college code\n else if(code!=\"\" && /^[0-9]*$/.test(code)==false)\n {\n alert(\"Invalid College Code: \"+code);\n document.register.coll_code.value=\"\";\n document.register.coll_code.focus();\n return false; \n }\n //end of validating the college code\n\n //validating whether atlead one stream is selected or not\n else if(!document.register.eng.checked && !document.register.mec.checked && !document.register.man.checked)\n {\n alert(\"Please Select Stream!!!\");\n document.register.eng.focus();\n return false;\n }\n //end of validating whether atlead one stream is selected or not\n\n //validating whether engineering courses are selected\n else if(document.register.eng.checked && !eng_valid)\n {\n alert(\"Please Select Engineering Courses!\");\n document.getElementById(\"engineering\").focus();\n return false;\n }\n //end of validating whether engineering courses are selected\n\n //validating whether medical courses are selected\n else if(document.register.mec.checked && !med_valid)\n {\n alert(\"Please Select Medical Courses!\");\n document.getElementById(\"medicl\").focus();\n return false;\n }\n //end of validating whether medical courses are selected\n\n //validating whether management courses are selected\n else if(document.register.man.checked && !man_valid)\n {\n alert(\"Please Select Management Courses!\");\n document.getElementById(\"management\").focus();\n return false;\n }\n //end of validating whether management courses are selected\n\n //validating the affiliation field\n else if(/^[a-zA-Z]*$/.test(affiliated)==false)\n {\n alert(\"Invalid Affiliated Value: \"+affiliated);\n document.register.affiliated.value=\"\";\n document.register.affiliated.focus();\n return false;\n }\n //end of validating the affiliation field\n \n //validating the category of the college\n else if(category==-1)\n {\n alert(\"Please Select Category!\");\n document.register.category.focus();\n return false;\n }\n //end of validating the category of the college\n \n //validating the type of the college\n else if(type==-1)\n {\n alert(\"Please Select Type!\");\n document.register.type.focus();\n return false;\n }\n //end of validating the type of the college\n \n //validating the intake information\n else if(intake==-1)\n {\n alert(\"Please Choose an Intake range!!!\");\n document.register.students_intake.focus();\n return false;\n }\n //end of validating the intake information \n \n //validating the city\n else if(/^[a-zA-Z]*$/.test(city)==false)\n {\n alert(\"Invalid City: \"+city);\n document.register.city.value=\"\";\n document.register.city.focus();\n return false;\n }\n //end of validating the city\n \n //validating the state\n else if(state==-1)\n {\n alert(\"Please select State!!!\");\n document.register.state.focus();\n return false;\n }\n //end of validating the state\n \n //validating the pincode of the college\n else if(pincode!=\"\" && (/^[0-9]*$/.test(pincode)==false || pincode.length<6))\n {\n alert(\"Invalid Pincode: \"+pincode);\n document.register.pincode.value=\"\";\n document.register.pincode.focus();\n return false;\n }\n //end of validating the pincode\n \n //validating the code of contact number\n else if((contact!=\"\") && ( /^[0-9]*$/.test(contact)==false || contact.length<2))\n {\n alert(\"Invalid Contact Number: \"+contact+contact2);\n document.register.contact.value=\"\";\n document.register.contact.focus();\n return false;\n }\n //end of validating the code of contact number\n \n //validating the contact number\n else if(contact2!=\"\" && (/^[0-9]*$/.test(contact2)==false || contact2.length<8))\n {\n alert(\"Invalid Contact Number: \"+contact+contact2);\n document.register.contact2.value=\"\";\n document.register.contact2.focus();\n return false; \n }\n //end of validating the contact number\n \n //validating the code of fax number\n else if((fax!=\"\") && ( /^[0-9]*$/.test(fax)==false || fax.length<2))\n {\n alert(\"Invalid Fax Number: \"+fax+fax2);\n document.register.fax.value=\"\";\n document.register.fax.focus();\n return false;\n }\n //end of validating the code of fax number\n \n //validating the fax number\n else if(fax2!=\"\" && (/^[0-9]*$/.test(fax2)==false || fax2.length<8))\n {\n alert(\"Invalid Fax Number: \"+fax+fax2);\n document.register.fax2.value=\"\";\n document.register.fax2.focus();\n return false;\n }\n //end of validating the fax number\n \n //validating the email of the college\n else if((email!=\"\") && (email.length==0 || email.lastIndexOf('.')<email.indexOf('@')))\n {\n alert(\"Invalid EmaiId: \"+email);\n document.register.emailid.value=\"\";\n document.register.emailid.focus();\n return false;\n }\n //end of validating the email of the college\n \n //validating the college website\n else if((website!=\"\") && (website.substr(0,7)!=\"http://\" ))\n {\n alert(\"Invalid Website Address: \"+website);\n document.register.website.value=\"\";\n document.register.website.focus();\n return false;\n }\n //end of validating the college website\n \n //validating the college establishment year\n else if(year==-1)\n {\n alert(\"Please select Year!!!\");\n document.register.yoo.focus();\n return false;\n }\n //end of validating the college establishment year\n \n //validating the college director name\n else if(/^[a-zA-Z. ,]*$/.test(director)==false)\n {\n alert(\"Invalid Director Name: \"+director);\n document.register.director.value=\"\";\n document.register.director.focus();\n return false;\n }\n //end of validating the college director name\n \n //validating few things which are there in profile edit but not in registration form///////////////////////////////////////\n if(value==0)//if it is the registration form\n {\n var pass=document.register.pass.value;\n var cpass=document.register.cpass.value;\n\n //validating the college password\n if(pass.length<9)\n {\n alert(\"Password length should lie between 9 and 15!\");\n document.register.pass.value=\"\";\n document.register.pass.focus();\n return false;\n }\n //end of validating the college password\n \n //validating the confirm password details \n else if(cpass.length<9 || cpass!=pass)\n {\n alert(\"Passwords doesn't match!!!\");\n document.register.cpass.value=\"\";\n document.register.cpass.focus();\n return false;\n }\n //end of validating confirm password details\n \n else\n return true;\n }//end of if\nelse//validating the extra information on the profile edit page\n {\n if($('.cp').css('display') != 'none')\n {\n \n var crpass=document.register.crpass.value;\n var npass=document.register.npass.value;\n var cnpass=document.register.cnpass.value;\n //validating the current password\n if(crpass!=\"\" && crpass.length<9)\n {\n alert(\"Password length should lie between 9 and 15!\");\n document.register.crpass.value=\"\";\n document.register.crpass.focus();\n return false;\n }\n //end of validating the current password\n \n //validating the new password\n if(npass!=\"\" && npass.length<9)\n {\n alert(\"Password length should lie between 9 and 15!\");\n document.register.npass.value=\"\";\n document.register.npass.focus();\n return false;\n }\n //end of validating the new password\n \n //validating the confirm password details\n else if((npass!=\"\" && cnpass!=\"\") && (cnpass.length<9 || cnpass!=npass))\n {\n alert(\"Passwords doesn't match!!!\");\n document.register.cnpass.value=\"\";\n document.register.cnpass.focus();\n return false;\n }\n //end of validating the confirm password details\n \n //validating the current and new password details\n else if(npass!=\"\" && crpass==\"\")\n {\n alert(\"Please enter the current password!\");\n document.register.crpass.value=\"\";\n document.register.crpass.focus();\n return false; \n }\n //end of validating the current and new password details\n \n else\n {\n return true;\n }\n \n }\n \n }\n //validating few things which are there in profile edit but not in registration form///////////////////////////////////////\n}", "title": "" }, { "docid": "9927b102af64bb02a7dbbfd71d83a5c0", "score": "0.5921427", "text": "function validate_fields() {\n // Check that mandatory fields are filled in.\n // TODO(ryok): maybe just check full_name instead of given_name and family_name.\n var mandatory_fields = ['given_name', 'family_name', 'text', 'author_name'];\n\n if($('own_info_yes')) {\n if ($('own_info_yes').checked)\n var mandatory_fields = ['given_name', 'family_name', 'text'];\n }\n\n for (var i = 0; i < mandatory_fields.length; i++) {\n field = $(mandatory_fields[i]);\n if (field != null && field.value.match(/^\\s*$/)) {\n show($('mandatory_field_missing'));\n field.focus();\n return false;\n }\n }\n hide($('mandatory_field_missing'));\n\n //Validate email-id\n var email_field = $('author_email');\n var email_id = $('author_email').value;\n if (email_id !== \"\"){\n var emailfilter=/(?:^|\\s)[-a-z0-9_.%$+]+@(?:[-a-z0-9]+\\.)+[a-z]{2,6}(?:\\s|$)/i;\n if (!emailfilter.test(email_id)){\n show($('email_id_improper_format'));\n email_field.focus();\n return false;\n }\n }\n\n hide($('email_id_improper_format'));\n\n // Check that the status and author_made_contact values are not inconsistent.\n if ($('status') && $('status').value == 'is_note_author' &&\n $('author_made_contact_no') && $('author_made_contact_no').checked) {\n show($('status_inconsistent_with_author_made_contact'));\n return false;\n }\n hide($('status_inconsistent_with_author_made_contact'));\n\n // Check profile_urls\n for (var i = 0; i < profile_websites.length; ++i) {\n hide($('invalid_profile_url_' + profile_websites[i].name));\n }\n for (var i = 1, entry; entry = $('profile_entry' + i); ++i) {\n if (entry.style.display != 'none') {\n var input = $('profile_url' + i);\n var url = input.value;\n var website_index = parseInt($('profile_website_index' + i).value);\n var website = profile_websites[website_index];\n if (url && website && website.url_regexp &&\n !url.match(website.url_regexp)) {\n show($('invalid_profile_url_' + website.name));\n input.focus();\n return false;\n }\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "ae402e1026c9fb8c699165beb84b5ddd", "score": "0.59150517", "text": "function validateLocalBodyParentVillage()\n{ \n\t\n\tvar ddsource1= document.getElementById('tierSetupCode');\n\tvar ddsource = ddsource1.options[ddsource1.selectedIndex].value; \n\t\n\tvar temp = ddsource.split(\":\");\n\t// alert(\"Temp---2-\"+temp[0]);\n\tvar id1=temp[0];\n\tvar id2=temp[1];\n\t// alert(\"ddsource--P--\"+ddsource);\n\tvar ddSourceParentSr1=document.getElementById('ddSourceLocalBody');\n\tvar ddSourceParentSr = ddSourceParentSr1.options[ddSourceParentSr1.selectedIndex].value; \n\t// alert(\"ddSourceParentSr--1-\"+ddSourceParentSr);\n\t\n\n\tvar localGovtBodyListMain1=document.getElementById('localGovtBodyListMain');\n\tvar localGovtBodyListMain = localGovtBodyListMain1.options[localGovtBodyListMain1.selectedIndex].value; \n\tif(localGovtBodyListMain==undefined)\n\t\t{\n\t\t\n\t\tlocalGovtBodyListMain=0;\n\t\t}\n\t\t\n\t\n\tif(id2==\"V\")\n\t\t{\n\t\t// alert(\"in V but check intermediate\");\t\t\t\n\t\t\tif(!validateInterMediatePanchayat(id2, ddSourceParentSr))\n\t\t\t\t{\n\t\t\t$(\"#localGovtBodyListMain_error\").show();\n\t\t\treturn false;\n\t\t\t\t}else if(localGovtBodyListMain==0){\n\t\t\t\t//\talert(\"Village Panchayat-****************-11-\"+ddSourceParentSr1.selectedIndex);\n\t\t\t\t\t$(\"#localGovtBodyListMain_error\").show();\n\t\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\n\t\t}\n\n\t\n\t$(\"#localGovtBodyListMain_error\").hide();\n\treturn true;\n\t\t\n}", "title": "" }, { "docid": "136ffe848ea3c640e7ed4a1fdc6b6e40", "score": "0.5911674", "text": "function checkFieldValidation(rowId){ \n fNameCell = $('#'+rowId+' input[name=first_name]');\n // mNameCell = $('#'+rowId+\" input[name=middle_name]\");\n lNameCell = $('#'+rowId+\" input[name=last_name]\");\n emailCell = $('#'+rowId+\" input[name=email]\");\n employeeCell = $('#'+rowId+\" input[name=employee_code]\");\n roleCell = $('#'+rowId+' select[name=user_role_id]'); \n reportingMangCell = $('#'+rowId+' select[name=manager_id]');\n statusCell = $('#'+rowId+' #status');\n\n var role = roleCell.val();\n var reptManagerLength = $('#'+rowId+' select[name=manager_id]').find('option').length; //check if dropdown have any option\n\n // Fields Validation\n var validateFlag = false;\n if(fNameCell.validationEngine('validate') && lNameCell.validationEngine('validate') && \n emailCell.validationEngine('validate') && employeeCell.validationEngine('validate') && roleCell.validationEngine('validate') &&\n statusCell.validationEngine('validate'))\n {\n validateFlag = true;\n }\n \n if(reptManagerLength > 1 && role != 1 && validateFlag){ // If Role => DI PM User and Reporting Manager Have data \n if(reportingMangCell.validationEngine('validate')){ \n validateFlag = true; \n }else{ \n validateFlag = false; \n }\n }\n return validateFlag;\n}", "title": "" }, { "docid": "53bd89bc93349044a6fb9ed77b687e50", "score": "0.5905273", "text": "function validateForm() {\n $(\"#kandideerimise_vorm span\").remove();\n var fields_empty = false;\n var fields = [];\n var symbols = [\"!\", \"<\", \">\", \"#\", \"%\", \"@\"];\n $(':input').each(function () {\n fields.push($(this).val());\n });\n for (var i = 0 ;i < 2; i++) {\n if (fields[i] === '') {\n fields_empty = true;\n $(\":input\").eq(i).css(\"background-color\",\"#FFD6D6\");\n $(\":input\").eq(i).after(\"<span>Palun t&auml;itke v&auml;li!</span\");\n \n }\n \t\n else{\n for(var j=0;j<symbols.length;j++){\n \tif (fields[i].indexOf(symbols[j]) !== -1 && i !== 2) {\n \tfields_empty = true;\n \t$(\":input\").eq(i).css(\"background-color\",\"#FFD6D6\");\n \t$(\":input\").eq(i).after(\"<span>Ei tohi sisaldada s&uumlmboleid!</span\");\n \tbreak;\n }\n \t else{\n \t\t $(\":input\").eq(i).css(\"background-color\",\"white\");\n \t }\n \t \n }\n }\n }\n if(fields_empty){\n return false;\n \n }\n return true;\n}", "title": "" }, { "docid": "09695c5481868d6e45ad3b88bf1f353a", "score": "0.58970505", "text": "function checkFields() {\n var flag = true;\n if (select_input.value != \"1\" && select_input.value != \"2\" && select_input.value != \"3\") {\n flag = false;\n }\n\n if (title_input.value.length < 3 || des_input.value.length < 3 || (lonlat_input.value.length < 7 || lonlat_input.value.indexOf(',') < 0))\n flag = false;\n\n\n return flag;\n}", "title": "" }, { "docid": "81bcf42cf071fd3c01419111a5e6024b", "score": "0.5896992", "text": "function cpphonevalidate()\n {\n if(document.schoolRegistration.cpphone.value==\"\")\n {\n document.getElementById(\"cpphone_err\").innerHTML=\"Please enter phone number\";\n document.schoolRegistration.cpphone.focus();\n return false;\n }\n else if(document.schoolRegistration.cpphone.value.length<6)\n {\n document.getElementById(\"cpphone_err\").innerHTML=\"Please enter valid phone number\";\n\n document.schoolRegistration.cpphone.focus();\n return false;\n }\n else if(document.schoolRegistration.cpphone.value.length>15)\n {\n document.getElementById(\"cpphone_err\").innerHTML=\"Please enter valid phone number\";\n \t\n document.schoolRegistration.cpphone.focus();\n return false;\n }\n else if(document.schoolRegistration.cpphone.value!=\"\")\n {\n document.getElementById(\"cpphone_err\").innerHTML=\"\";\n }\n return true;\n }", "title": "" }, { "docid": "e3ab9d6c3b0a6507e08ddf703e5114e9", "score": "0.5895054", "text": "function customTabValidation() {\n \n var resourceCheck = $('#chkCustomPopupResource').is(':checked');\n var trackCheck = $('#chkCustomPopupTrack').is(':checked');\n var isrc = $('#ISRC').val();\n var upcCustom = $('#RepertoireFilter_UPC').val();\n var artistCustom = $('#RepertoireFilter_Artist').val();\n var resourceTitleCustom = $('#ResourceTitle').val();\n var releaseTitleCustom = $('#RepertoireFilter_ReleaseTitle').val();\n var adminCompanyCustom = $('#txtAdminCompany').val();\n var linkedContractCustom = $('#RepertoireFilter_LinkedContract').val();\n var fromDt = $('#FromDt').val();\n var toDt = $('#ToDt').val();\n var noRlsDtCustom = $('#chkNoRlsDt').is(':checked');\n var newForReview = $('#chkCustomPopupNewForReview').is(':checked');\n var finalStatus = $('#chkCustomPopupFinal').is(':checked');\n var finalForReview = $('#chkCustomPopupFinalForReview').is(':checked');\n var sampleExists = $('#chkCustomPopupSampleExist').is(':checked');\n var sideArtist = $('#chkCustomPopupSideArtist').is(':checked');\n if (!ReleaseDateValidation(fromDt, toDt)) {\n return false;\n }\n \n \n if (resourceCheck == false && trackCheck == false) {\n $('#SplitAlert').empty();\n $('#SplitAlert').append(\"Please select a Resource and/or Track\");\n $('#splitWarning').show();\n resizePopUp();\n $('#SplitAlert').show();\n return false;\n } else if ((resourceCheck || trackCheck) && (newForReview || finalStatus || finalForReview || sampleExists || sideArtist)) {\n $('#splitWarning').hide();\n resizePopUp();\n $('#SplitAlert').hide();\n return true;\n } \n else if (((resourceCheck == true || trackCheck == true) || (resourceCheck == true && trackCheck == true)) && ((newForReview == true)\n || (finalStatus == true)\n || (finalForReview == true)\n || (sampleExists == true)\n || (sideArtist == true))) {\n if ((isrc == '' || isrc == null)\n && (upcCustom == '' || upcCustom == null)\n && (artistCustom == '' || artistCustom == null)\n && (resourceTitleCustom == '' || resourceTitleCustom == null)\n && (releaseTitleCustom == '' || releaseTitleCustom == null)\n && (adminCompanyCustom == '' || adminCompanyCustom == null)\n && (linkedContractCustom == '' || linkedContractCustom == null)\n && ((fromDt == '' || fromDt == null) && (toDt == '' || toDt == null))\n && (noRlsDtCustom == false)) {\n $('#SplitAlert').empty();\n $('#SplitAlert').append(\"Please Select Any One Parameter along with this\");\n $('#splitWarning').show();\n resizePopUp();\n $('#SplitAlert').show();\n return false;\n } else {\n $('#splitWarning').hide();\n resizePopUp();\n $('#SplitAlert').hide();\n return true;\n }\n }\n\n if ((resourceCheck == true || trackCheck == true) || (resourceCheck == true && trackCheck == true)) {\n if ((isrc == '' || isrc == null)\n && (upcCustom == '' || upcCustom == null)\n && (artistCustom == '' || artistCustom == null)\n && (resourceTitleCustom == '' || resourceTitleCustom == null)\n && (releaseTitleCustom == '' || releaseTitleCustom == null)\n && (adminCompanyCustom == '' || adminCompanyCustom == null)\n && (linkedContractCustom == '' || linkedContractCustom == null)\n && ((fromDt == '' || fromDt == null) && (toDt == '' || toDt == null))\n && (noRlsDtCustom == false)\n && (newForReview == false)\n && (finalStatus == false)\n && (finalForReview == false)\n && (sampleExists == false)\n && (sideArtist == false)) {\n $('#SplitAlert').empty();\n $('#SplitAlert').append(\"Please select at least one parameter\");\n $('#splitWarning').show();\n resizePopUp();\n $('#SplitAlert').show();\n return false;\n } else if (((isrc != '' || isrc != null)\n || (upcCustom != '' || upcCustom != null)\n || (artistCustom != '' || artistCustom != null)\n || (resourceTitleCustom != '' || resourceTitleCustom != null)\n || (releaseTitleCustom != '' || releaseTitleCustom != null)\n || (adminCompanyCustom != '' || adminCompanyCustom != null)\n || (linkedContractCustom != '' || linkedContractCustom != null)) || (((fromDt != '' || fromDt != null) && (toDt != '' || toDt != null))\n || (noRlsDtCustom == true))) {\n $('#splitWarning').hide();\n resizePopUp();\n $('#SplitAlert').hide();\n return true;\n }\n }\n\n}", "title": "" }, { "docid": "8daa8fc62f058e788506f2ad75c32fe0", "score": "0.58932525", "text": "function validateFields(fname, lname, email, area, s_num) {\n\tvar invalid = \"\"\n\t\n\t// Check if fields were left blank\n\tif (fname == \"\") { invalid += \"First Name\\n\"; }\n\tif (lname == \"\") { invalid += \"Last Name\\n\"; }\n\tif (email == \"\") { invalid += \"Email Address\\n\"; }\n\tif (area == \"Please select an area\") { invalid += \"Area\\n\"; } \n\tif (s_num == \"\") { invalid += \"Student Number\\n\"; }\n\t\n\tif (invalid == \"\") {\n\t\treturn true;\n\t} else {\n\t\tinvalid = \"The following fields were not filled in:\\n\\n\" + invalid;\n\t\talert(invalid);\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "5c3e0d72f649c6a0112883ce29520b1d", "score": "0.5885782", "text": "function validar_02(){\n var nombre = document.getElementById(\"Nombre\");\n var apellido = document.getElementById(\"Apellido\"); \n var cedula= document.getElementById(\"Cedula\");\n var edad= document.getElementById(\"Edad\");\n var telefono = document.getElementById(\"Telefono\");\n var NumeroCedula = /^([7-8])*$/;\n\n if(nombre.value ==\"\" || nombre.value.indexOf(\" \") == 0 || (isNaN(nombre.value)==false) || nombre.value.length>13){\n alert (\"Indique su nombre\");\n document.getElementById(\"Nombre\").value = \"\";\n document.getElementById(\"Nombre\").focus();\n return false;\n }\n else if(apellido.value ==\"\" || apellido.value.indexOf(\" \") == 0 || (isNaN(apellido.value)==false) || apellido.value.length>13){\n alert (\"Indique su apellido\");\n document.getElementById(\"Apellido\").value = \"\";\n document.getElementById(\"Apellido\").focus();\n return false;\n }\n else if(cedula.value ==\"\" || cedula.value.indexOf(\" \") == 0 || (isNaN(cedula.value)) || NumeroCedula.exec(cedula) || cedula.value<2000000 || cedula.value>99999999){\n alert (\"Indique su cedula\");\n document.getElementById(\"Cedula\").value = \"\";\n document.getElementById(\"Cedula\").focus();\n return false;\n }\n else if(edad.value ==\"\" || edad.value.indexOf(\" \") == 0 || (isNaN(edad.value)) || edad.value.length!=2){\n alert (\"Indique su edad\");\n document.getElementById(\"Edad\").value = \"\";\n document.getElementById('Edad').focus();\n return false;\n }\n else if(telefono.value ==\"\" || telefono.value.indexOf(\" \") == 0){\n alert (\"Indique su telefono\");\n document.getElementById(\"Telefono\").value = \"\";\n //document.getElementById(\"Telefono\").focus();\n return false;\n }\n}", "title": "" }, { "docid": "818b3781bc7d9d79cb0bc622f464dab2", "score": "0.58770555", "text": "function validate_form_trolleys (element1)\n{\n\n valid = true;\n objt = document.getElementById(element1);\n if (objt.lengthT.value == \"\") {\n alert(\"Пожалуйста заполните поле 'Длина'.\");\n valid = false;\n }\n if (objt.widthS.value == \"\") {\n alert(\"Пожалуйста заполните поле 'Ширина'.\");\n valid = false;\n }\n if (objt.hight_ruch.value == \"\") {\n alert(\"Пожалуйста заполните поле 'Высота ручки'.\");\n valid = false;\n }\n if (objt.shelf_load.value == \"\") {\n alert(\"Пожалуйста заполните поле 'Нагрузка на полку'.\");\n valid = false;\n }\n\n\n //проверка полей на соответствие min max значениям\n\n\n //Проверка поля высота\n if (Number(objt.lengthT.value) > 1500) {\n alert ( \"Значение поля 'Длина' не должно быть больше 1500 мм.\" );\n valid = false;\n }\n if (Number(objt.lengthT.value) < 600) {\n alert ( \"Значение поля 'Длина' не должно быть меньше 600 мм.\" );\n valid = false;\n }\n\n //проверка поля ширина\n if (Number(objt.widthS.value) > 1200) {\n alert ( \"Значение поля 'Ширина' не должно быть больше 1200 мм.\" );\n valid = false;\n }\n if (Number(objt.widthS.value) < 500) {\n alert ( \"Значение поля 'Ширина' не должно быть меньше 500 мм.\" );\n valid = false;\n }\n\n //проверка поля глубина\n if (Number(objt.hight_ruch.value) > 1200) {\n alert(\"Значение поля 'Высота ручки' не должно быть больше 1200 мм.\");\n valid = false;\n }\n\n if (Number(objt.hight_ruch.value) < 600) {\n alert ( \"Значение поля 'Высота ручки' не должно быть меньше 600 мм.\" );\n valid = false;\n }\n\n //проверка поля Нагрузка на полку\n if (Number(objt.shelf_load.value) > 400) {\n alert ( \"Нагрузка на полку не должна превышать 400 кг.\" );\n valid = false;\n }\n if (Number(objt.shelf_load.value) < 50) {\n alert ( \"Минимальная нагрузка на полку 50 кг.\" );\n valid = false;\n }\n\n return valid;\n}", "title": "" }, { "docid": "a92847700cb03fc127b642fb26812f9c", "score": "0.5875805", "text": "function validateEditStaffForm()\n{\n var firstNameValidation = validateName(\"edit_staff_form\",\"first_name\",\"edit_staff_fname_span\");\n var middleNameValidation = validateName(\"edit_staff_form\",\"middle_name\",\"edit_staff_mname_span\");\n var lastNameValidation = validateName(\"edit_staff_form\",\"last_name\",\"edit_staff_lname_span\");\n var addressValidation = validateAddress(\"edit_staff_form\",\"address\",\"edit_staff_address_span\");\n var emailValidation = validateEmail(\"edit_staff_form\",\"email\",\"edit_staff_email_span\");\n var telephoneValidation = validateTelephone(\"edit_staff_form\",\"telephone\",\"edit_staff_telephone_span\");\n var designationValidation = validateDesignation(\"edit_staff_form\",\"designation\",\"edit_staff_designation_span\");\n var qualificationValidation = validateSelectInputField(\"edit_staff_form\",\"qualification\",\"edit_staff_qualification_span\");\n var genderValidation = validateSelectInputField(\"edit_staff_form\",\"gender\",\"edit_staff_gender_span\");\n var unitValidation = validateSelectInputField(\"edit_staff_form\",\"unit\",\"edit_staff_unit_span\");\n var regionValidation = validateSelectInputField(\"edit_staff_form\",\"region\",\"edit_staff_region_span\");\n var otherSectionValidation = validateSelectInputField(\"edit_staff_form\",\"other_section\",\"edit_staff_other_section_span\");\n var gradeValidation = validateGrade(\"edit_staff_form\",\"grade\",\"edit_staff_grade_span\");\n var payrollNumberValidation = validatePayrollNumber(\"edit_staff_form\",\"payroll_number\",\"edit_staff_payroll_number_span\");\n var appointmentDateValidation = validateDate(\"edit_staff_form\",\"date_of_appointment\",\"edit_staff_date_of_appointment_span\");\n var dateOfBirthValidation = validateDate(\"edit_staff_form\",\"date_of_birth\",\"edit_staff_date_of_birth_span\");\n\n if (firstNameValidation & middleNameValidation & lastNameValidation & addressValidation\n & emailValidation & telephoneValidation & designationValidation & qualificationValidation\n & genderValidation & unitValidation & regionValidation & otherSectionValidation & gradeValidation\n & payrollNumberValidation & appointmentDateValidation & dateOfBirthValidation) \n {\n //call the add staff funtion\n addStaff(\"edit_staff_form\",\"edit_staff\");\n }\n return false;\n}", "title": "" }, { "docid": "4f5db2fab9bcd8cdca68a83b6143e9d0", "score": "0.5861061", "text": "function testForm07()\n{\n var test = true;\n $('p').removeClass('campoInvalido').removeAttr('title'); \n \n $('#objetivoGeneral').val($('#objetivoGeneral').val().replace(/(<([^>]+)>)/ig,\"\"));\n if (trim($('#objetivoGeneral').val()).length < 4)\n {\n $('#objetivoGeneral').parent().addClass('campoInvalido') \n .attr('title','Campo inválido');\n test = false;\n } \n \n $('#producto').val($('#producto').val().replace(/(<([^>]+)>)/ig,\"\"));\n if (trim($('#producto').val()).length < 4)\n {\n $('#producto').parent().addClass('campoInvalido') \n .attr('title','Campo inválido');\n test = false;\n }\n \n $('#unidadMedida').val($('#unidadMedida').val().replace(/(<([^>]+)>)/ig,\"\"));\n if (trim($('#unidadMedida').val()).length < 1)\n {\n $('#unidadMedida').parent().addClass('campoInvalido') \n .attr('title','Campo inválido');\n test = false;\n }\n \n if (trim($('#unidadMedida').val()).length > 50)\n {\n $('#unidadMedida').parent().addClass('campoInvalido') \n .attr('title','No debe superar los 50 caracteres');\n test = false;\n } \n\n $('#indicador').val($('#indicador').val().replace(/(<([^>]+)>)/ig,\"\"));\n /*if (trim($('#indicador').val()).length < 4)\n {\n $('#indicador').parent().addClass('campoInvalido') \n .attr('title','Campo inválido');\n test = false;\n }*/\n\n $('#alcance').val($('#alcance').val().replace(/(<([^>]+)>)/ig,\"\"));\n if (trim($('#alcance').val()).length < 4)\n {\n $('#alcance').parent().addClass('campoInvalido') \n .attr('title','Campo inválido');\n test = false;\n }\n \n $('#puntoycirculo').val($('#puntoycirculo').val().replace(/(<([^>]+)>)/ig,\"\"));\n /* if (trim($('#puntoycirculo').val()).length < 4)\n {\n $('#puntoycirculo').parent().addClass('campoInvalido') \n .attr('title','Campo inválido');\n test = false;\n } */ \n \n // CHEQUEO DE CAMPOS NUMERICOS\n if (nroFormatoUS($('#meta').val())=== 0 || trim($('#meta').val())==='' )\n {\n $('#meta').parent().addClass('campoInvalido') \n .attr('title','La meta física debe ser mayor que cero'); \n test = false;\n }\n \n if ( trim($('#pobFemenina').val())==='' )\n {\n $('#pobFemenina').parent().addClass('campoInvalido') \n .attr('title','Campo inválido'); \n test = false;\n } \n \n if ( trim($('#pobMasculina').val())==='' )\n {\n $('#pobMasculina').parent().addClass('campoInvalido') \n .attr('title','Campo inválido'); \n test = false;\n }\n \n if ( trim($('#pobTotal').val())==='' )\n {\n $('#pobTotal').parent().addClass('campoInvalido') \n .attr('title','Campo inválido'); \n test = false;\n }\n \n if ( ( (parseInt(nroFormatoUS($('#pobFemenina').val())) + parseInt(nroFormatoUS($('#pobMasculina').val())))\n !== parseInt(nroFormatoUS($('#pobTotal').val())) ) &&\n ( (parseInt(nroFormatoUS($('#pobFemenina').val())) + parseInt(nroFormatoUS($('#pobMasculina').val())))!== 0) )\n { \n $('#pobTotal').parent().addClass('campoInvalido') \n .attr('title','La Población Total debe ser igual a Población Femenina + Población Masculina'); \n test = false;\n }\n\n if ( trim($('#empleosDirectosEjecucion').val())==='' )\n {\n $('#empleosDirectosEjecucion').parent().addClass('campoInvalido') \n .attr('title','Campo inválido'); \n test = false;\n }\n \n if ( trim($('#empleosDirectosOperacion').val())==='' )\n {\n $('#empleosDirectosOperacion').parent().addClass('campoInvalido') \n .attr('title','Campo inválido'); \n test = false;\n } \n \n if ( trim($('#empleosIndirectosEjecucion').val())==='' )\n {\n $('#empleosIndirectosEjecucion').parent().addClass('campoInvalido') \n .attr('title','Campo inválido'); \n test = false;\n }\n \n if ( trim($('#empleosIndirectosOperacion').val())==='' )\n {\n $('#empleosIndirectosOperacion').parent().addClass('campoInvalido') \n .attr('title','Campo inválido'); \n test = false;\n } \n \n return test;\n}", "title": "" }, { "docid": "206bdf37955a31d0adb2b90312e67eaa", "score": "0.58552635", "text": "function checkMovieForm(w, h, y) {\n var wmatch = checkPercent(w); // use a regex to check if the input is of the form ###%\n var hmatch = checkPercent(h);\n var wvalid = false; // these hold whether the width or height input has been validated\n var hvalid = false;\n\n var eitem, econtainer; // the span and div, respectively, for each dialog's error message\n var pre;\n if (y) { // determine which dialog we're in and which error span/div to populate if there's an error\n pre = '#edit-youtube';\n } else {\n pre = '#movie';\n }\n\n eitem = $(pre + '-error');\n econtainer = $(pre + '-error-container');\n\n if (w.trim() === \"\") { // empty input is ok\n wvalid = true;\n }\n\n if (h.trim() === \"\") {\n hvalid = true;\n }\n\n if (wmatch !== null && !wvalid) { // if it's of the form ###%, check if the ### is between 0 and 100\n var nw = Number(w.substring(0, w.length-1));\n if (nw < 1 || nw > 100) {\n // paint error message\n eitem.text(msg(\"simplepage.nothing-over-100-percent\"));\n econtainer.show();\n return false;\n } else {\n wvalid = true;\n }\n }\n\n if (hmatch !== null && !hvalid) {\n var nh = Number(h.substring(0, h.length-1));\n if (nh > 100) {\n // paint error message\n eitem.text(msg(\"simplepage.nothing-over-100-percent\"));\n econtainer.show();\n return false;\n } else {\n hvalid = true;\n }\n }\n\n wmatch = checkWidthHeight(w); // if it's not a percentage, check to make sure it's of the form ### or ###px\n hmatch = checkWidthHeight(h);\n\n if (wmatch === null && !wvalid) {\n // paint error message\n eitem.text(msg(\"simplepage.width-height\"));\n econtainer.show();\n return false;\n }\n\n if (hmatch === null && !hvalid) {\n // paint error message\n eitem.text(msg(\"simplepage.width-height\"));\n econtainer.show();\n return false;\n }\n econtainer.hide();\n return true;\n}", "title": "" }, { "docid": "10cd3a1003d2fff7291f10544b613afb", "score": "0.5853328", "text": "function ValidateControls()\n{\n //alert(\"Anil\");\n var ShortMessage=Errcode008;\n var LongMessage=\"\";\n //Apartment Number field is Empty.\n\t \t if(true==IstxtEmpty('txtAppartmentNo'))\n\t\t\t{\n\t\t\t if(\"\"==LongMessage)\n\t\t\t\t{\n\t\t\t\tLongMessage=Errcode003;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tLongMessage=LongMessage + '\\n' + Errcode003;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Address1 field is Empty.\n\t\t\tif(true==IstxtEmpty('txtAddress1'))\n\t\t\t{\n\t\t\t\tif(\"\"==LongMessage)\n\t\t\t\t{\n\t\t\t\tLongMessage=Errcode004;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tLongMessage=LongMessage + '\\n'+Errcode004;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Phone field is Mandatory.\n\t\t\tif(true==IstxtEmpty('txtPhone'))\n\t\t\t{\n\t\t\t\tif(\"\"==LongMessage)\n\t\t\t\t{\n\t\t\t\tLongMessage=Errcode005;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tLongMessage=LongMessage + '\\n'+ Errcode005;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//City Field is Mandatory.\n\t\t\tif(true==IstxtEmpty('txtCity'))\n\t\t\t{\n\t\t\t\tif(\"\"==LongMessage)\n\t\t\t\t{\n\t\t\t\tLongMessage=Errcode006;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tLongMessage=LongMessage + '\\n' + Errcode006;\n\t\t\t\t}\n\t\t\t}\n\t \t \n\t\t //If the Long Message doesnot contain any Value then return true. \n\t\t\tif(\"\"==LongMessage)\n\t\t\t{\n\t\t\t return true;\n\t\t\t}\n\t\t\t//Else Display both Long and short message.\n\t\t\telse\n\t\t\t{\n\t\t\t SetErrorMessage(ShortMessage,LongMessage);\n\t\t\t return false;\n\t\t\t}\n \n}", "title": "" }, { "docid": "8b26f0a335d7faa4fdd9c2d56f49d3c9", "score": "0.5852826", "text": "function validateInput() {\n\n if (userSubmittedDrink.userName != \"\" &&\n userSubmittedDrink.nameOfDrink != \"\" &&\n userSubmittedDrink.numberOfIngredients != 0 &&\n userSubmittedDrink.instructions != \"\" ) {\n\n // All fields have been populated, proceed\n return true;\n\n } else {\n\n // All fields have not been populated, do not proceed\n return false;\n }\n\n }", "title": "" }, { "docid": "97f58dd230dc9bdae72cfb8a96a88a41", "score": "0.58424175", "text": "function validarFormSubmissoes() {\n f = document.getElementById(\"formsubmissoes\");\n if (f.subTitle.value == \"\") {\n f.subTitle.style.backgroundColor = \"red\";\n f.subTitle.style.color = \"#ffffff\";\n f.subTitle.focus();\n return false;\n }\n if (f.subAbstract.value.split(' ').length < 250) {\n f.subAbstract.style.backgroundColor = \"red\";\n f.subAbstract.style.color = \"#ffffff\";\n f.subAbstract.focus();\n return false;\n }\n if (f.subAbstract.value.split(' ').length > 500) {\n f.subAbstract.style.backgroundColor = \"red\";\n f.subAbstract.style.color = \"#ffffff\";\n f.subAbstract.focus();\n return false;\n }\n if (f.subPalavras.value == \"\") {\n f.subPalavras.style.backgroundColor = \"red\";\n f.subPalavras.style.color = \"#ffffff\";\n f.subPalavras.focus();\n return false;\n }\n f.submit();\n}", "title": "" }, { "docid": "04f081c88ae1a36be284fab979097b68", "score": "0.5824768", "text": "function validateForm() {\n return title.length > 0 && description.length > 0;\n }", "title": "" }, { "docid": "0ac457098d8fc0fc4f8c445119f3a3a0", "score": "0.5824098", "text": "checkReqFields() {\n // Check the generic name field\n if (this.state.genericName == DEFAULT_GENERIC_NAME) {\n Alert.alert(\"Please enter a value for the generic name.\");\n return (false);\n }\n\n // Check the store name field\n if (this.state.storeName == DEFAULT_STORE_NAME) {\n Alert.alert(\"Please enter a value for the store name.\");\n return (false);\n }\n\n // Check the address field\n if (this.state.address == DEFAULT_ADDRESS) {\n Alert.alert(\"Please enter a value for the address.\");\n return (false);\n }\n\n // Check the department field\n if (this.state.itemDepartment == DEFAULT_ITEM_DEPARTMENT) {\n Alert.alert(\"Please enter a value for the department.\");\n return (false);\n }\n\n // Check the aisle number field\n if (this.state.aisleNum == DEFAULT_AISLE_NUM) {\n Alert.alert(\"Please enter a value for the aisle number.\");\n return (false);\n }\n\n return (true);\n }", "title": "" }, { "docid": "39aa3365abe2ddf7697293a9f17c15c3", "score": "0.57908803", "text": "function dataValidation(thanim, modelpedogogi, eikef, ramatoryanut, mashavimkaiamim){\r\n if (thanim != 0 && modelpedogogi != 0 && modelpedogogi != 0 && eikef != 0 && ramatoryanut != 0 && mashavimkaiamim != 0) {\r\n modelCalculation(thanim, modelpedogogi, eikef, ramatoryanut, mashavimkaiamim)\r\n }\r\n else {\r\n alert(\"you have to fill all the fields\")\r\n }\r\n}", "title": "" }, { "docid": "4d7c6d035de980277aa1e831542c3917", "score": "0.5783422", "text": "function validateFields(valid1, valid2){\r\n\t\t\tif(!valid1){\r\n\t\t\t\tvar fields = [\"usernamesu\", \"nicknamesu\", \"phonesu\", \"citysu\", \"streetsu\", \"housesu\", \"postalsu\", \"countrysu\",];\r\n\t\t\t\tvar names = [\"Username\", \"Nickname\", \"Phone number\", \"City\", \"Street\", \"House number\", \"Postal code\", \"Country\",];\r\n\t\t\t\tvar i, l = fields.length;\r\n\t\t\t\tvar fieldname;\r\n\t\t\t\tfor (i = 0; i < l; i++) {\r\n\t\t\t\t fieldname = fields[i];\r\n\t\t\t\t if (document.forms[\"userForm1\"][fieldname].value === \"\") {\r\n\t\t\t\t\t\tvar modal = document.getElementById('myModal');\r\n\t\t\t\t \tdocument.getElementById(\"errorLine\").innerHTML = names[i] + \" can not be empty\";\r\n\t\t\t\t modal.style.display = \"block\";\r\n\t\t\t\t \tbreak;\r\n\t\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse if(!valid2){\r\n\t\t\t\tif (document.forms[\"userForm2\"][\"passwordsu\"].value === \"\") {\r\n\t\t\t\t\tvar modal = document.getElementById('myModal');\r\n\t\t\t\t\tdocument.getElementById(\"errorLine\").innerHTML = \"Password can not be empty\";\r\n\t\t\t modal.style.display = \"block\";\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "title": "" }, { "docid": "faffad71d49b76f51c7db824f0d41d9a", "score": "0.57670397", "text": "function validateFieldsHome() {\r\n\treturn h_fields.validateUntil();\r\n}", "title": "" }, { "docid": "f72916cc86b62cd867bfbfd5adc31206", "score": "0.5765996", "text": "function checkAlphanumeric(obj,val,count)\n\t{\t\t\t\t \n\t\tvar fieldValue=trimAll(obj.value);\n\t\tvar fieldName=val;\t\t\n\t\tif(fieldValue!=null||fieldValue!='')\n\t\t{\n\t\t\tif(!isAlphaNumericValue(obj.value))\n\t \t\t{\n\t\t\t\talert(\"Please enter Alphamuneric values only.\");\n\t \t\t\tdocument.getElementById(fieldName+count).value='';\n\t \t\t\tdocument.getElementById(fieldName+count).focus();\n\t \t\t\treturn false;\n\t \t\t}\n\t \t}\n\t}", "title": "" }, { "docid": "433ba9cb0b9f4f3ae6c764f0c177c317", "score": "0.5765323", "text": "function validateFormValues() {\n\n var prop = $('#name').val();\n if (prop === undefined || prop.length < 1) {\n showPartModalErrorText('name');\n return false;\n }\n\n prop = $('#firstAcquired').val();\n if (prop === undefined || prop.length < 1) {\n showPartModalErrorText('acquired date', 'You must specify the date when you acquired this part.');\n return false;\n }\n\n prop = $('#stockCount').val();\n if (prop === undefined || prop.length < 1) {\n showPartModalErrorText('stock count');\n return false;\n }\n prop = $('#locationIds').val();\n if (prop === undefined || prop.length < 28) {\n console.log(prop);\n showPartModalErrorText('You must select a location');\n return false;\n }\n\n\n //search if all required selects contain a value\n var selectErrorFound = false;\n $('.part-form select').each(function(index) {\n var $elm = $(this);\n var required = $elm.attr('required') === 'required';\n if (required === true) {\n var value = $elm.val();\n if (value === undefined || value === null || value == '') {\n var id = $elm.attr('id');\n var capitalizeId = id.charAt(0).toUpperCase() + id.slice(1);\n showModalErrorText(capitalizeId + ' is missing', 'You must select a \"' + id + '\" for this part.');\n selectErrorFound = true;\n return false;\n }\n }\n });\n\n if (selectErrorFound === true) {\n return false;\n }\n\n setLastModifiedDate();\n\n return true;\n}", "title": "" }, { "docid": "305641648ca63e6b3362bff3186bcd74", "score": "0.5762487", "text": "function isValidData() {\r\n\r\n var cat = $(\"#categories\");\r\n if (cat.val() == \"0\") {\r\n elementHandle[0].addClass(\"error\");\r\n //If the \"Please Select\" option is selected display error.\r\n errorStatusHandle.text(\"Please select a category\");\r\n return false;\r\n }\r\n\r\n if (isEmpty(elementHandle[1].val())) {\r\n elementHandle[1].addClass(\"error\");\r\n errorStatusHandle.text(\"Please enter Cost\");\r\n elementHandle[1].focus();\r\n return false;\r\n }\r\n var ven = $(\"#vendor\");\r\n if (ven.val() == \"0\") {\r\n elementHandle[2].addClass(\"error\");\r\n //If the \"Please Select\" option is selected display error.\r\n errorStatusHandle.text(\"Please select a vendor\");\r\n return false;\r\n }\r\n\r\n if (isEmpty(elementHandle[3].val())) {\r\n elementHandle[3].addClass(\"error\");\r\n errorStatusHandle.text(\"Please enter retail price\");\r\n elementHandle[3].focus();\r\n return false;\r\n }\r\n\r\n if (isEmpty(elementHandle[4].val())) {\r\n elementHandle[4].addClass(\"error\");\r\n errorStatusHandle.text(\"Please enter ManufacturerId\");\r\n elementHandle[4].focus();\r\n return false;\r\n }\r\n\r\n if (isEmpty(elementHandle[5].val())) {\r\n elementHandle[5].addClass(\"error\");\r\n errorStatusHandle.text(\"Please enter Quantity\");\r\n elementHandle[5].focus();\r\n return false;\r\n }\r\n\r\n if (isEmpty(elementHandle[6].val())) {\r\n elementHandle[6].addClass(\"error\");\r\n errorStatusHandle.text(\"Please enter description\");\r\n elementHandle[6].focus();\r\n return false;\r\n }\r\n\r\n if (isEmpty(elementHandle[8].val())) {\r\n elementHandle[8].addClass(\"error\");\r\n errorStatusHandle.text(\"Please enter Feature\");\r\n elementHandle[8].focus();\r\n return false;\r\n }\r\n\r\n if ($.isNumeric(elementHandle[1].val())) {\r\n console.log(\"numeric\")\r\n errorStatusHandle.text(\"Please enter numeric value only for cost\");\r\n elementHandle[1].focus();\r\n return false;\r\n }\r\n\r\n if ($.isNumeric(elementHandle[3].val())) {\r\n errorStatusHandle.text(\"Please enter numeric value only for retail\");\r\n elementHandle[3].focus();\r\n return false;\r\n }\r\n if ($.isNumeric(elementHandle[5].val())) {\r\n errorStatusHandle.text(\"Please enter numeric value only for quantity\");\r\n elementHandle[5].focus();\r\n return false;\r\n }\r\n\r\n if (!validateDate()) {\r\n return false;\r\n }\r\n\r\n if (!isValidImage()) {\r\n elementHandle[16].focus();\r\n return false;\r\n }\r\n\r\n\r\n errorStatusHandle.text(\"\");\r\n return true;\r\n }", "title": "" }, { "docid": "1a1cd6ad00dcd5a64e15c187d6ff2981", "score": "0.576155", "text": "function validateCabDetails(){\r\n \r\n \t\t\t\tif(document.getElementById('cab-Model-Dropdown').selectedIndex==0)\r\n {\r\n alert(\"Please select the cab model\");\r\n return false;\r\n }\r\n \t\t\t\tif(document.getElementById('cab-num').value == undefined || document.getElementById('cab-num').value ==\"\")\r\n {\r\n alert(\"Cab Number cannot be Empty\");\r\n return false;\r\n }\r\n if(document.getElementById('no-seats').value == undefined || document.getElementById('no-seats').value ==\"\")\r\n {\r\n alert(\"Available No.Of Seats cannot be Empty\");\r\n return false;\r\n }\r\n if(document.getElementById('insurance-num').value == undefined || document.getElementById('insurance-num').value ==\"\")\r\n {\r\n alert(\"Insurance number cannot be Empty\");\r\n return false;\r\n }\r\n if(document.getElementById('ins-exp-date').value == undefined || document.getElementById('ins-exp-date').value ==\"\")\r\n {\r\n alert(\"Expiry date cannot be Empty\");\r\n return false;\r\n }\r\n if(document.getElementById('driv-name').value == undefined || document.getElementById('driv-name').value ==\"\")\r\n {\r\n alert(\"Driver name cannot be Empty\");\r\n return false;\r\n }\r\n \r\n patternValidation();\r\n \r\n }", "title": "" }, { "docid": "ad8856c987f3e307cd20c602105688ef", "score": "0.5755869", "text": "function checkSchFAMandatory() {\r\n\r\n\tvar table1 = checkRowBlank('schFADtlsFrignAssets', 2, 1);\r\n\tvar table2 = checkRowBlank('schFADtlsFinIntrest', 2, 1);\r\n\tvar table3 = checkRowBlank('schFADtlsImmvbleProp', 2, 1);\r\n\tvar table4 = checkRowBlank('schFADtlsOtherAsset', 2, 1);\r\n\tvar table5 = checkRowBlank('schFADtlsSigningAuth', 2, 1);\r\n\tvar table6 = checkRowBlank('schFADtlsTrusts', 2, 1);\r\n\tvar table7 = checkRowBlank('DetailsOthIncomeOutsideIndia', 2, 1);\r\n\r\n\tif (document.getElementsByName('partBTTI.assetOutIndiaFlag')[0].value == 'YES'\r\n\t\t\t&& document\r\n\t\t\t\t\t.getElementsByName('partAGEN1.filingStatus.residentialStatus')[0].value != 'NRI') {\r\n\t\tif (table1 && table2 && table3 && table4 && table5 && table6 && table7) {\r\n\t\t\tj.setFieldError('scheduleFA.detailsForiegnBank[0].countryCode',\r\n\t\t\t\t\t'Please enter any one table in Schedule FA.');\r\n\t\t\taddErrorXHTML('', 'Please enter any one table in Schedule FA.');\r\n\t\t}\r\n\t}\r\n\tif (document.getElementsByName('partBTTI.assetOutIndiaFlag')[0].value == 'NO'\r\n\t\t\t&& document\r\n\t\t\t\t\t.getElementsByName('partAGEN1.filingStatus.residentialStatus')[0].value != 'NRI') {\r\n\t\tif (!(table1 && table2 && table3 && table4 && table5 && table6)) {\r\n\t\t\tj\r\n\t\t\t\t\t.setFieldError('partBTTI.assetOutIndiaFlag',\r\n\t\t\t\t\t\t\t'Please correct your selection of assets outside India in Part B -TTI.');\r\n\t\t\taddErrorXHTML('',\r\n\t\t\t\t\t'Please correct your selection of assets outside India in Part B -TTI.');\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "08848c7ddb4bcd10df864a87e42b9060", "score": "0.5753984", "text": "function validFields() {\n let marca = document.getElementById(\"updMarca\").value;\n let modelo = document.getElementById(\"updModelo\").value;\n let tipo = document.getElementById(\"updTipo\").value;\n let modelo_impresora = document.getElementById(\"updImpresora\").value;\n let minima = document.getElementById(\"cantMinima\").value;\n let maxima = document.getElementById(\"cantMaxima\").value;\n\n validClass([\n \"#updMarca\",\n \"#updModelo\",\n \"#updTipo\",\n \"#updImpresora\",\n \"#cantMinima\",\n \"#cantMaxima\"\n ]);\n\n if (\n marca != \"\" &&\n modelo != \"\" &&\n tipo != \"\" &&\n modelo_impresora != \"\" &&\n isNaN(parseInt(minima)) === false &&\n isNaN(parseInt(maxima)) === false\n ) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "caf23dcbbc6b8b3ebed23214fec5a162", "score": "0.57530576", "text": "validate(values)\n {\n let error={}\n if(!values.menuName){\n error.menuName=\"Enter Menu Name\"\n }\n else if(!values.menuPrice){\n error.menuPrice=\"Enter Menu Price\"\n }\n else if(isNaN(values.menuPrice)){\n error.menuPrice=\"Enter Menu Price Properly\"\n }\n\n return error\n }", "title": "" }, { "docid": "bca9ef8b3b8f49629fbcc5d324145d46", "score": "0.5749828", "text": "validateForm() {\n try {\n if (this._qs(\"#title\").value == \"\")\n throw {\n message: \"<b>Title<b> cannot be empty.\",\n duration: 5,\n };\n\n if (this._qs(\"#rentalPeriod\").value == 0)\n throw {\n message: \"<b>Select a rental period<b>\",\n duration: 5,\n };\n\n if (this._qs(\"#price\").value == \"\")\n throw {\n message: \"<b>Price<b> cannot be empty.\",\n duration: 5,\n };\n\n switch (this._qs(\"#keyMoneyPeriod\").value) {\n case \"enter-value\":\n break;\n case \"enter-period\":\n this._qs(\"#keyMoney\").value =\n this._qs(\"#keyMoney\").value * this._qs(\"#price\").value;\n break;\n case \"0\":\n throw {\n message: \"<b>Select a rental period<b>\",\n duration: 5,\n };\n default:\n }\n\n if (\n this._qs(\"#district\").value == \"Select a district\" ||\n this._qs(\"#district\") == \"0\"\n )\n throw { message: \"Select a district\", duration: 5 };\n\n if (this._qs(\"#city\").value == \"\")\n throw { message: \"Select a city\", duration: 5 };\n\n if (!this._qs(\"#description\").value.match(/\\w+[\\s\\.]\\w+/))\n throw {\n message:\n \"Add a description about the property. (double spaces and fullstops are not allowed)\",\n duration: 5,\n };\n\n return true;\n } catch (err) {\n this.popup(err.message, \"error\");\n window.scrollTo(0, 0);\n\n return false;\n }\n }", "title": "" }, { "docid": "8ca1f6d0f4f6fbbddfc2a3dd2ccbe6e9", "score": "0.5748546", "text": "function ValidateAdminMetaData() {\r\n $(\".metaDataMsgHolder\").hide();\r\n var elem = $(\".paramtrTableContainer tr\");\r\n var isValid = true;\r\n var itemArray = new Array();\r\n if (elem != null) {\r\n // add the condition to make the metadata should be mandatory\r\n var elementsLength = $(elem).length;\r\n // check row by row and do the validation\r\n for (var index = 0; index < elementsLength; index++) {\r\n var row = $(elem).get(index);\r\n //for blank row this should not be validated\r\n if (row != null && $(row).find(\".IsBlankRow\").val() != \"True\") {\r\n var repField = $(row).find('.repField').val();\r\n var repDescription = $(row).find('.repDescription').val();\r\n var type = $(row).find('.typeSelectList');\r\n var typeValue = type.find(\":selected\").val();\r\n var rangeValue = $(row).find('.repRange').val();\r\n var mappingItem = $(row).find('.repMapping').val();\r\n\r\n //If type is range, make sure unit is there\r\n if (typeValue === \"4\" && rangeValue.length === 0) {\r\n isValid = false;\r\n $(row).find('.repRange').attr('required', true);\r\n }\r\n else {\r\n var rangeValidationResult = ValidateRangeMetaData(rangeValue);\r\n\r\n if (rangeValidationResult == \"0\") {\r\n $(row).find('.repRange').removeAttr(\"required\");\r\n }\r\n else if (rangeValidationResult == \"1\") {\r\n isValid = false;\r\n $(row).find('.repRange').attr('required', true);\r\n $(\".metaDataMsgHolder\").show();\r\n $(\"#metaDataMsg\").text(\"Invalid range data, range should be of format NtoN, ex : 10to20\");\r\n\r\n }\r\n else if (rangeValidationResult == \"2\") {\r\n isValid = false;\r\n $(row).find('.repRange').attr('required', true);\r\n $(\".metaDataMsgHolder\").show();\r\n $(\"#metaDataMsg\").text(\"Invalid range data, range should be of format NtoN, ex : 10to20\");\r\n }\r\n else if (rangeValidationResult == \"3\") {\r\n isValid = false;\r\n $(row).find('.repRange').attr('required', true);\r\n $(\".metaDataMsgHolder\").show();\r\n $(\"#metaDataMsg\").text(\"Invalid range data, Start value should be less than End value\");\r\n }\r\n }\r\n\r\n // Check the combination of unique field and mapping\r\n if (repField.length > 0) {\r\n var currentFieldAndMappingItem = \"\";\r\n if (mappingItem.length > 0) {\r\n currentFieldAndMappingItem = mappingItem.toLowerCase() + \":\" + repField.toLowerCase();\r\n }\r\n else {\r\n currentFieldAndMappingItem = repField.toLowerCase();\r\n }\r\n if (itemArray.indexOf(currentFieldAndMappingItem) < 0) {\r\n itemArray.push(currentFieldAndMappingItem);\r\n $(row).find('.repRange').removeAttr(\"required\");\r\n $(row).find('.repMapping').removeAttr(\"required\");\r\n }\r\n else {\r\n isValid = false;\r\n $(\".metaDataMsgHolder\").show();\r\n $(\"#metaDataMsg\").text(\"Duplicate Field data,combination of Field and mapping should be unique.\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return isValid;\r\n}", "title": "" }, { "docid": "5c2f5cc162defd2e0fa20eecc4b2f8c7", "score": "0.5743956", "text": "function validateNameField(obj)\n\t{\n\t str=trimVal(obj.value);\n\t var format = /^([\\w\\'\\s\\.{1}\\-]*)$/;\n\t var format0 = /^[-]+|[-]+$/\n\t var format1 = /^[']+|[']+$/;\n\t // commented for ver 2.27var format2 = /[']{2}|([']+[\\s|\\.]+[']+)|[.]{2}|([.]+[\\s|\\']+[.]+)|([']+[\\.]+)|([.]+[\\']+)/;\n\t // ver 2.27 starts here\n\t // removed var format3,format4 & format5 for resolving bug (bugzilla defect id 4712 & 4713)\t \n\t var format6 = /^[.]+|[.]+$/;//added for resolving bug (bugzilla defect id 4712 & 4713)\n\t // ver 2.27 ends here\n\t str = str.replace(/[\\s]{2,}/g,' ');\n\t if(str!='')\n\t {\n\t\t if(format.test(str))\n\t\t {\t \n\t\t for(var i=0;i<str.length;i++)\n\t\t\t { \n\t\t\t if(str.charAt(i)=='_')\n\t\t\t {\n\t\t\t alert('No other characters except alphanumerics,(.),(-) and (\\') are allowed.');\n\t\t\t\t obj.value='';\n\t\t\t\t obj.focus();\n\t\t\t\t return false;\n\t\t\t }\n\t\t\t } \n\t\t \n\t\t if(format1.test(str))\n\t\t {\n\t\t alert('Symbol (\\') is not allowed in first and last position');\n\t\t obj.value='';\n\t \t obj.focus();\n\t \t return false;\n\t\t }\n\t\t if(format0.test(str))\n\t\t {\n\t\t alert('Hyphen (-) is not allowed in first and last position');\n\t\t obj.value='';\n\t \t obj.focus();\n\t \t return false;\n\t\t }\n\t\t //block starts---- added for resolving bug (bugzilla defect id=4712,4713) \n\t\t // removed the above 3 if conditions used for bugzilla defect code 4501 \n if(format6.test(str))\n\t\t {\n\t\t alert('Symbol (.) is not allowed in first and last position');\n\t\t obj.value='';\n\t \t obj.focus();\n\t \t return false;\n\t\t }\n\t\t if(str.search(/([-.']+[\\s]?[-.']+)/)!=-1)\n\t\t {\n\t\t alert('Symbols (.),(\\') and (-) should not occur adjacently or repeat continuously');\n\t\t obj.value='';\n\t \t obj.focus();\n\t \t return false;\n\t\t }\n\t\t // block ends for resolving bug (bugzilla defect id=4712,4713)\t \t \n\t\t }\n\t\t else\n\t\t {\n\t\t alert('No other characters except alphanumerics,(.),(-) and (\\') are allowed.');\n\t\t obj.value='';\n\t\t obj.focus();\n\t\t return false;\n\t\t }\n\t\t \n\t\t obj.value = changeInitCap(str); // ver 2.33 added function changeInitCap()\n\t\t} \n\t\telse\n\t\t{\n\t\t obj.value='';\n\t return false;\n\t\t} \n\t}", "title": "" }, { "docid": "87527c93e2807616fcac42bc3a9e82e1", "score": "0.57363874", "text": "function isFieldValid(data){\n\tlet isValid = true;\n let validationRulesLenghtMoreThan0 = ['name', 'log', 'quantity', 'unit', 'crop', 'variety', 'weight', 'product', 'store', 'price'];\n validationRulesLenghtMoreThan0.forEach((rule) =>{\n if(data[rule] && !data[rule].toString().length){\n \tisValid = isValid && false\n }\n });\n return isValid;\n}", "title": "" }, { "docid": "784616df0b927dfe7ce2b7f5c9e868b8", "score": "0.5736136", "text": "function RfvFor6Field(txtBox1,txtBox2,txtBox3,txtBox4,txtBox5,txtBox6)\n{\nif(txtBox1.value.length==0 || txtBox2.value.length==0 || txtBox3.value.length==0 || txtBox4.value.length==0 || txtBox5.value.length==0 || txtBox6.value.length==0)\n{\nalert('Please Enter the mandatory Fields');\nreturn false; \n} \nreturn true;\n}", "title": "" }, { "docid": "91686668664d638b30eacd91676ee63a", "score": "0.5729947", "text": "function Form1_Validator(theForm)\n{\n\n// allow ONLY alphanumeric keys, no symbols or punctuation\n// this can be altered for any \"checkOK\" string you desire\n\n// check if first_name field is blank\nif (theForm.first_name.value == \"\")\n{\nalert(\"First Name: Enter (a to z, 0 to 9); no signs such as +, -, ( ), # , blank space\");\ntheForm.first_name.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.first_name,\"First Name\"))\nreturn false;\n}\n\n// check if last_name field is blank\n\nif (theForm.last_name.value == \"\")\n{\nalert(\"Last Name: Enter (a to z, 0 to 9); no signs such as +, -, ( ), # , blank space\");\ntheForm.last_name.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.last_name,\"Last Name\"))\nreturn false;\n}\n\n// check if job_title field is blank\n\nif (theForm.job_title.value == \"\")\n{\nalert(\"Job Title: Enter (a to z, 0 to 9); no signs such as +, -, ( ), # , blank space\");\ntheForm.job_title.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.job_title,\"Job Title\"))\nreturn false;\n}\n\n// check if company field is blank\n\nif (theForm.company.value == \"\")\n{\nalert(\"Company Name: Enter (a to z, 0 to 9); no signs such as +, -, ( ), # , blank space\");\ntheForm.company.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.company,\"Company\"))\nreturn false;\n}\n\n// check if email field is blank\nif (theForm.email.value == \"\")\n{\nalert(\"Email Id: Enter complete Email Id like [email protected]\");\ntheForm.email.focus();\nreturn (false);\n}\n\n\n/*\n// test if valid email address, must have @ and .\nvar checkEmail = \"@.\";\nvar checkStr = theForm.email.value;\nvar EmailValid = false;\nvar EmailAt = false;\nvar EmailPeriod = false;\nfor (i = 0; i < checkStr.length; i++)\n{\nch = checkStr.charAt(i);\nfor (j = 0; j < checkEmail.length; j++)\n{\nif (ch == checkEmail.charAt(j) && ch == \"@\")\nEmailAt = true;\nif (ch == checkEmail.charAt(j) && ch == \".\")\nEmailPeriod = true;\n\t if (EmailAt && EmailPeriod)\n\t\tbreak;\n\t if (j == checkEmail.length)\n\t\tbreak;\n\t}\n\t// if both the @ and . were in the string\nif (EmailAt && EmailPeriod)\n{\n\t\tEmailValid = true\n\t\tbreak;\n\t}\n}\nif (!EmailValid)\n{\nalert(\"Email Id: Enter complete Email Id like [email protected]\");\ntheForm.email.focus();\nreturn (false);\n}\n*/\n\nif (theForm.phone_no.value == \"\")\n{\nalert(\"Phone No: Enter (0 to 9); no signs such as +, -, ( ), # , blank space\");\ntheForm.phone_no.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.phone_no,\"Phone No.\"))\nreturn false;\n}\n\n/*\nvar checkOK = \"0123456789\";\nvar checkStr = theForm.phone_no.value;\nvar allValid = true;\nvar allNum = \"\";\nfor (i = 0; i < checkStr.length; i++)\n{\nch = checkStr.charAt(i);\nfor (j = 0; j < checkOK.length; j++)\nif (ch == checkOK.charAt(j))\nbreak;\nif (j == checkOK.length)\n{\nallValid = false;\nbreak;\n}\nif (ch != \",\")\nallNum += ch;\n}\nif (!allValid)\n{\nalert(\"Phone No: Enter (0 to 9); no signs such as +, -, ( ), # , blank space\");\ntheForm.phone_no.focus();\nreturn (false);\n}\n*/\n\nif (!isProper(theForm.street,\"Address\"))\nreturn false;\n\n\nif (theForm.city.value == \"\")\n{\nalert(\"City: Enter (a to z, 0 to 9); no signs such as +, -, ( ), # , blank space\");\ntheForm.city.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.city,\"City\"))\nreturn false;\n}\n\nif (theForm.state.value == \"\")\n{\nalert(\"State: Enter (a to z, 0 to 9); no signs such as +, -, ( ), # , blank space\");\ntheForm.state.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.state,\"State\"))\nreturn false;\n}\nif (theForm.country.value == \"\")\n{\nalert(\"Country: Enter (a to z, 0 to 9); no signs such as +, -, ( ), # , blank space\");\ntheForm.country.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.country,\"country\"))\nreturn false;\n}\n\n\n}", "title": "" }, { "docid": "58b161b7a66f419a7c4819a52664d1ad", "score": "0.5725563", "text": "function checkForm(form)\n{\n var vehiseat=/^[0-9]+$/;\n var modelPattern = /^[0-9a-zA-Z]+$/;\n var letters=/^[A-Za-z]+$/;\n if(form.vehiname.value==\"\")\n {\n alert( \"Please provide vehicle name!\" );\n form.vehiname.focus();\n return false;\n }\n if(!modelPattern.test(form.vehimod.value))\n {\n alert(\"should not contain special characters and vehicle Type cannot be empty!!!\");\n form.vehimod.focus();\n return false;\n }\n if(!modelPattern.test(form.vehinum.value))\n {\n alert(\"vehicle number cannot be empty\");\n form.vehinum.focus();\n return false;\n }\n if(form.vehinum.value==\"\")\n {\n alert( \"Please provide vehicle number!\" );\n form.vehiname.focus();\n return false;\n }\n if(form.vehicolor.value==\"\")\n {\n alert( \"Please provide vehicle color!\" );\n form.vehicolor.focus();\n return false;\n }\n if(!vehiseat.test(form.vehiseat.value))\n {\n alert( \"Please provide valid no of seating capacity!\" );\n form.vehiseat.focus();\n return false;\n }\n if(form.vehiseat.value==\"\")\n {\n alert( \"capacity cannotbe empty!\" );\n form.vehiseat.focus();\n return false;\n }\n \n if(!modelPattern.test(form.vehibranch.value))\n {\n alert( \"please enter the branch!\" );\n form.vehibranch.focus();\n return false;\n }\n if(form.vehibranch.value==\"\")\n {\n alert( \"Please provide vehicle branch!\" );\n form.vehibranch.focus();\n return false;\n }\n if(form.year.value==\"\")\n {\n alert( \"Please provide the insurance date\" );\n form.year.focus();\n return false;\n }\n if(form.vehirenewal.value==\"\")\n {\n alert( \"Please provide vehirenewal date\" );\n form.vehirenewal.focus();\n return false;\n }\n if(form.lastdate.value==\"\")\n {\n alert( \"Please provide Last Service date\" );\n form.lastdate.focus();\n return false;\n }\n if(form.nextservice.value==\"\")\n {\n alert( \"Please provide Next Service date\" );\n form.nextservice.focus();\n return false;\n }\n \n}", "title": "" }, { "docid": "5d11e0d037df3df08546aed6e771d4ad", "score": "0.57243663", "text": "function validate(){\n\t\n\t\n\t\n\n\tvar v_a = validate_name();\n\tvar v_b = validate_mail();\n\tvar v_c = validate_role();\n\tvar v_d =validate_item();\n\tvar v_e =validate_activities();\n\tvar v_f =validate_payment();\n\n\tconsole.log( \"name =\" + v_a );\n\tconsole.log( \"mail =\" + v_b );\n\tconsole.log( \"role =\" + v_c );\n\tconsole.log( \"item =\" + v_d );\n\tconsole.log( \"activities =\" + v_e );\n\tconsole.log( \"payment =\" + v_f );\n\tconsole.log( \"**************\");\n\n\n\tif( v_a&&v_b&&v_c&&v_d&&v_e&&v_f) {\n\t\tconsole.log(\"ALL OK\");\n\t\treturn true;\n\n\t}else return false;\n\t\n}", "title": "" }, { "docid": "80c5e7ad08a30a1a5d6691a789429efc", "score": "0.57243574", "text": "function validateMrktAnlysForm( ){\n\tvar data = { \n\t\tparams: { }, \n\t\terrors: [ ] \n\t},\n\tset_cnt = 0;\n\n\trequire( [ \"dijit/registry\" ] , function( registry ){\n\t\tvar temp;\n\n\t\tswitch( document.getElementById( \"primarysrchtype\" ).value ){\n\t\t\tcase \"0\": //jurisdiction\t\n\t\t\t\tdata.params.juris = document.getElementById( \"jurisdiction\" ).value;\n\t\t\t\tbreak;\n\t\t\tcase \"1\": //neighborhoodcode\n\t\t\t\tif( document.getElementById( \"neighborcode\" ).value.trim( ).length === 0 ){\n\t\t\t\t\tdata.errors.push( \"Enter a valid Neighborhood code.\" );\n\t\t\t\t}else{\n\t\t\t\t\tdata.params.nbc = document.getElementById( \"neighborcode\" ).value;\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"2\": //street name\n\t\t\t\tif( document.getElementById( \"stname\" ).value.trim( ).length === 0 ){\n\t\t\t\t\tdata.errors.push( \"Enter a valid Street Name.\" );\n\t\t\t\t}else{\n\t\t\t\t\tdata.params.st = document.getElementById( \"stname\" ).value;\t\t\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"3\": //buffersize\n\t\t\t\tif( selectedAddress.hasOwnProperty( \"groundpid\" ) ){\t\n\t\t\t\t\tif( document.getElementById( \"anlysbuffsize\" ).value.trim( ).length === 0 ){\n\t\t\t\t\t\tdata.errors.push( \"Enter a valid buffer size.\" );\n\t\t\t\t\t}else{\n\t\t\t\t\t\tvar buffersize = parseInt( document.getElementById( \"anlysbuffsize\" ).value.trim( ) );\n\t\t\t\t\t\n\t\t\t\t\t\tif( !isNaN( buffersize ) && ( buffersize > -1 && buffersize < 5281 ) ){\n\t\t\t\t\t\t\tdata.params.pidbuff = selectedAddress.groundpid + \"|\" + buffersize;\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdata.errors.push( \"Enter a valid buffer size.\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tdata.errors.push( \"Select a property to do market analysis using a buffer.\" );\n\t\t\t\t}\t\n\t\t\t\tbreak;\n\t\t}\n\t\t\t\t\n\t\t//property use\n\t\tdata.params.propuse = document.getElementById( \"propuse\" ).value;\n\t\t//assesment info \n\t\tdata.params.lottype = document.getElementById( \"noacre\" ).value;\n\t\t\n\t\t//acre values\t\n\t\ttemp = Utils.getRangeValues( document.getElementById( \"acrefrom\" ).value.trim( ), document.getElementById( \"acreto\" ).value.trim( ), 3, \"Enter a valid minimum and maximum Parcel Acreage.\" );\n\t\tif( temp.length > 1 ){\n\t\t\tdata.params.minacres = temp[ 0 ];\n\t\t\tdata.params.maxacres = temp[ 1 ];\n\t\t\tset_cnt += 1;\n\t\t}else if( temp.length > 0 ){\n\t\t\tdata.errors.push( temp[ 0 ] );\n\t\t}\t\n\t\t\t\n\t\t//market values\n\t\ttemp = Utils.getRangeValues( document.getElementById( \"mrktvalfrom\" ).value.trim( ), document.getElementById( \"mrktvalto\" ).value.trim( ), 2, \"Enter a valid minimum and maximum Market Value.\" );\n\t\tif( temp.length > 1 ){\n\t\t\tdata.params.minmktval = temp[ 0 ];\n\t\t\tdata.params.maxmktval = temp[ 1 ];\n\t\t\tset_cnt += 1;\n\t\t}else if( temp.length > 0 ){\n\t\t\tdata.errors.push( temp[ 0 ] );\n\t\t}\t\n\t\t\n\t\t//sale price\n\t\ttemp = Utils.getRangeValues( document.getElementById( \"salepricefrom\" ).value.trim( ), document.getElementById( \"salepriceto\" ).value.trim( ), 2, \"Enter a valid minimum and maximum Sale Price.\" );\n\t\tif( temp.length > 1 ){\n\t\t\tdata.params.minsalesprice = temp[ 0 ];\n\t\t\tdata.params.maxsalesprice = temp[ 1 ];\n\t\t\tset_cnt += 1;\n\t\t}else if( temp.length > 0 ){\n\t\t\tdata.errors.push( temp[ 0 ] );\n\t\t}\t\n\t\t\t\t\t\n\t\t//sale date\n\t\tif( registry.byId( \"saledatefrom\" ).get( \"state\" ) === \"Error\" || registry.byId( \"saledateto\" ).get( \"state\" ) === \"Error\" ){\n\t\t\tdata.errors.push( \"Enter a valid Sale Date range\" );\n\t\t}else{\n\t\t\tvar startdate = registry.byId( \"saledatefrom\" ).get( \"value\" ), \n\t\t\t\tenddate = registry.byId( \"saledateto\" ).get( \"value\" );\n\t\t\t\n\t\t\tif( startdate || enddate ){\t\t\n\t\t\t\tif( startdate && enddate && ( startdate < enddate ) ){\n\t\t\t\t\tdata.params.startdate = Format.readableDate( startdate );\n\t\t\t\t\tdata.params.enddate = Format.readableDate( enddate );\n\t\t\t\t\tset_cnt += 1;\n\t\t\t\t}else{\n\t\t\t\t\tdata.errors.push( \"Enter a valid Sale Date range\" );\n\t\t\t\t}\t\n\t\t\t} \n\t\t}\n\t\t\n\t\t//building information\n\t\tif( document.getElementById( \"propuse\" ).value !== \"Vacant\" ){\n\t\t\t//yr built\n\t\t\tvar minyrblt = document.getElementById( \"yearbuiltfrom\" ).value.trim( ),\n\t\t\t\tmaxyrblt = document.getElementById( \"yearbuiltto\" ).value.trim( );\n\t\t\t\t\n\t\t\tif( minyrblt.length > 0 || maxyrblt.length > 0 ){\n\t\t\t\tif( Validate.isCountyYear( minyrblt ) && Validate.isCountyYear( maxyrblt ) && minyrblt < maxyrblt ){\n\t\t\t\t\tdata.params.minyrblt = minyrblt;\n\t\t\t\t\tdata.params.maxyrblt = maxyrblt;\n\t\t\t\t\tset_cnt += 1;\n\t\t\t\t}else{\n\t\t\t\t\tdata.errors.push( \"Enter a valid minimum and maximum Year Built.\" );\n\t\t\t\t}\t\n\t\t\t} \n\t\t\t\n\t\t\t//sq ft\n\t\t\ttemp = Utils.getRangeValues( document.getElementById( \"sqftfrom\" ).value.trim( ), document.getElementById( \"sqftto\" ).value.trim( ), 0, \"Enter a valid minimum and maximum Square Feet.\" );\n\t\t\tif( temp.length > 1 ){\n\t\t\t\tdata.params.minsqft = temp[ 0 ];\n\t\t\t\tdata.params.maxsqft = temp[ 1 ];\n\t\t\t\tset_cnt += 1;\n\t\t\t}else if( temp.length > 0 ){\n\t\t\t\tdata.errors.push( temp[ 0 ] );\n\t\t\t}\t\n\n\t\t\t//bedrooms and bathrooms\n\t\t\tif( document.getElementById( \"propuse\" ).value === \"Condo/Townhome\" || document.getElementById( \"propuse\" ).value === \"Manufactured\" ||\n\t\t\t\tdocument.getElementById( \"propuse\" ).value === \"Multi-Family\" || document.getElementById( \"propuse\" ).value === \"Single-Family\" ) {\n\t\t\t\t\tif( document.getElementById( \"bedrooms\" ).value.trim( ).length > 0 ){\n\t\t\t\t\t\tdata.params.bdrms = document.getElementById( \"bedrooms\" ).value;\n\t\t\t\t\t\tset_cnt += 1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif( document.getElementById( \"bathrooms\" ).value.trim( ).length > 0 ){\n\t\t\t\t\t\tdata.params.btrms = document.getElementById( \"bathrooms\" ).value;\n\t\t\t\t\t\tset_cnt += 1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//exterior wall and story type\n\t\t\tif( document.getElementById( \"exteriorframe\" ).value.trim( ).length > 0 ){\n\t\t\t\tdata.params.extwall = document.getElementById( \"exteriorframe\" ).value;\n\t\t\t\tset_cnt += 1;\n\t\t\t}\n\t\t\t\n\t\t\tif( document.getElementById( \"storytype\" ).value.trim( ).length > 0 ){\n\t\t\t\tdata.params.storytype = document.getElementById( \"storytype\" ).value;\n\t\t\t\tset_cnt += 1;\n\t\t\t}\n\t\t\t\n\t\t}\t\t\n\t\t\t\t\t\t\t\n\t\t//sort \n\t\tvar sortby = document.getElementById( \"sortby\" ).value;\n\t\tdata.params.orderby = sortby.substr( 0, sortby.indexOf( \"|\" ) );\n\t\tdata.params.orderdir = sortby.substr( sortby.indexOf ( \"|\" ) + 1, sortby.length - 1 );\n\t\t\n\t\t//check if there is atleast one parameter set when non vacant propuses are searched\n\t\tif( set_cnt === 0 ){\n\t\t\tdata.errors.push( \"Select more paramerers to do a Market Analysis.\" );\n\t\t}\n\t\t\n\t} );\n\t\n\treturn data;\n\n}", "title": "" }, { "docid": "e3cc36602cf5b82b014b711c163a48df", "score": "0.5722595", "text": "function validate() {\n \n if($(\"#name\").val()==='') {\n alert(\"Name is required\");\n return false;\n }\n if($(\"#phone\").val()==='') {\n alert(\"Phone is required\");\n return false;\n }\n if($(\"#address\").val()==='') {\n alert(\"Adress is required\");\n return false;\n }\n if($(\"#addressDetails\").val()==='') {\n alert(\"More Details about the Address is required\");\n return false;\n }\n if($(\"#cuisine\").val()==='') {\n alert(\"Cuisine is required\");\n return false;\n }\n if($(\"#menu\").val()==='') {\n alert(\"Menu is required\");\n return false;\n }\n \n}", "title": "" }, { "docid": "6b6f9bd0b77d1bfb943d6ba4060c1b1f", "score": "0.5721935", "text": "validateForm( x ) {\n let doSubmit = true;\n let delim = \"\";\n let msg = \"The following field(s) \";\n if( x.pvId === null || (x.pvId === undefined) || (x.pvId === 0) ) {\n doSubmit = false;\n msg += \"PV \";\n delim = \", \";\n }\n if(x.id === null || x.id===undefined || x.id===0) {\n doSubmit = false;\n msg += delim + \"output tag \";\n delim = \", \";\n }\n if( x.blockType === \"AO\" ) {\n if( (x.spId === null) || (x.spId === undefined) || (x.spId === 0) ) {\n doSubmit = false;\n msg += delim + \"SP \";\n delim = \", \";\n }\n }\n if( ! doSubmit ) {\n msg += \" must be selected!\";\n alert(msg);\n }\n return doSubmit;\n }", "title": "" }, { "docid": "70e67609ba159215429c117fa746b0ba", "score": "0.57160234", "text": "function alphaNumericCheckWithSplChar(formName,fieldName,displayName,nullCheck)\r\n{ \r\n\tvar msg3;\r\n\tmsg3 =\"\";\t\r\n\t\t\t\r\n\tvar checkOK6 = \"abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ,-(.)#' \";\r\n\tvar pincode = eval(\"document.\"+formName+\".\"+fieldName+\".value\");\r\n\tvar checkStr6 = pincode;\r\n\t\r\n\tvar ckspclchar=0;\r\n\tfsblnk=0;\r\n\tfschar=\"\";\r\n\tif (nullCheck == 'y')\r\n\t{\r\n\t\tif (pincode == \"\" || pincode == null)\r\n\t\t{\r\n\t\t\tmsg3 = msg3 + \" Enter \"+displayName+\".\"+\"\\n\";\r\n\t\t\teval(\"document.\"+formName+\".\"+fieldName+\".focus()\");\r\n\t\t\treturn msg3;\r\n\t\t}\r\n\t}\r\n\tfor (fsblnk = 0; fsblnk < checkStr6.length; fsblnk++)\r\n\t{\r\n\t\tfschar=checkStr6.charAt(0);\r\n\t}\t\t\t \r\n\tif(fschar==\" \")\r\n\t{\r\n\t\tmsg3 = msg3 + \" Space not allowed in \"+displayName+\"\\n\";\r\n\t\teval(\"document.\"+formName+\".\"+fieldName+\".focus()\");\r\n\t\treturn msg3;\t\t\r\n\t}\r\n\t\r\n\tvar allValid6 = true;\r\n\tvar cnt6 = 0;\r\n\tvar flag6 = 0;\r\n\tvar totalLen6 = pincode.length;\r\n\tfor (mab = 0; mab < checkStr6.length; mab++)\r\n\t{\r\n\t\tchalph = checkStr6.charAt(mab);\r\n\t\tfor (nab = 0; nab < checkOK6.length; nab++)\r\n\t\t\tif (chalph == checkOK6.charAt(nab))\r\n\t\t\t\tbreak;\r\n\t\tif (nab == checkOK6.length)\r\n\t\t{\r\n\t\t allValid6 = false;\r\n\t\t break;\r\n\t\t}\r\n\t}//end of for statement\r\n\tif (!allValid6)\r\n\t{\r\n\t msg3 = msg3 + \"Please enter only alphanumeric characters in \" + displayName+\".\"+\"\\n\";\r\n\t eval(\"document.\"+formName+\".\"+fieldName+\".focus()\");\r\n\t return msg3;\r\n\t}\r\n\r\n\treturn msg3;\r\n\t\r\n}", "title": "" }, { "docid": "9b79fa707e399e638a3937a14127ed15", "score": "0.5707815", "text": "function validationCheckVan() {\n var name = $('#name').val().trim();\n\n var code = $('#code').val().trim();\n\n var vanTypeId = $('#vanTypeId').val();\n var hrEmployeeInfoId = $('#hrEmployeeInfoId').val();\n\n var vanNumber = $('#vanNumber').val().trim();\n var driverName = $('#driverName').val().trim();\n\n var registrationNumber = $('#registrationNumber').val().trim();\n\n //Error\n var name_error = $('#name_error');\n\n var code_error = $('#code_error');\n\n var vanTypeId_error = $('#vanTypeId_error');\n var hrEmployeeInfoId_error = $('#hrEmployeeInfoId_error');\n var registrationNumber_error = $('#registrationNumber_error');\n\n var vanNumber_error = $('#vanNumber_error');\n var driverName_error = $('#driverName_error');\n //Msg Error\n var msgError = \"Empty Field\";\n var msgSelect = \"NONE Selected\";\n\n\n\n//\n if (!name || !driverName|| !code || !registrationNumber || !vanNumber || vanTypeId == 0||hrEmployeeInfoId==0) {\n\n\n\n if (!name) {\n\n name_error.text(msgError);\n name_error.show();\n }\n\n if (!registrationNumber) {\n\n registrationNumber_error.text(msgError);\n registrationNumber_error.show();\n }\n\n if (!vanNumber) {\n\n vanNumber_error.text(msgError);\n vanNumber_error.show();\n }\n\n\n if (!driverName) {\n\n driverName_error.text(msgError);\n driverName_error.show();\n }\n\n\n if (!code) {\n\n code_error.text(msgError);\n code_error.show();\n }\n\n\n if (vanTypeId == 0) {\n vanTypeId_error.text(msgSelect);\n vanTypeId_error.show();\n }\n\n\n if (hrEmployeeInfoId == 0) {\n hrEmployeeInfoId_error.text(msgSelect);\n hrEmployeeInfoId_error.show();\n }\n\n return false;\n } else {\n\n if (name.length < 2) {\n\n alert(\"length\");\n name_error.text(\"size must be between 2 and 30\");\n name_error.show();\n return false;\n }\n\n if (code.length < 2) {\n code_error.text(\"size must be between 2 and 10\");\n code_error.show();\n return false;\n }\n\n if (registrationNumber.length < 2) {\n registrationNumber_error.text(\"size must be between 2 and 30\");\n registrationNumber_error.show();\n return false;\n }\n\n if (vanNumber.length < 2) {\n vanNumber_error.text(\"size must be between 2 and 30\");\n vanNumber_error.show();\n return false;\n }\n\n return true;\n\n }\n}", "title": "" }, { "docid": "a01b6f16fcf9f708aa48e9fbede5b881", "score": "0.5702981", "text": "function validateAll(){\n\tvar firstName = wordCheck('#firstName','#error_firstname');\n\tvar lastName = wordCheck('#lastName','#error_lastname');\n\tvar phoneNumber = numberCheck('#contactNumber','#error_contactnumber');\n\tif (firstName && lastName && phoneNumber)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "66eefeef80ec44456d2af4d14b486d13", "score": "0.5702304", "text": "function checkTitle() {\n var val = document.getElementById(\"surveyTitle\").value;\n\n if (!val || !val.length) {\n sc1 = false;\n su1 = false;\n $(\"#survey-create-button\").attr(\"disabled\", true);\n $(\"#survey-update-button\").attr(\"disabled\", true);\n }\n\n var regex = /^[a-zA-Z0-9]+( [a-zA-Z0-9]+)*$/;\n if (val.length < 1 || val.length > 200) {\n document.getElementById(\"surveyTitle\").classList.remove(\"valid\");\n document.getElementById(\"surveyTitle\").classList.add(\"invalid\");\n sc1 = false;\n su1 = false;\n } else {\n if (regex.test(val)) {\n document.getElementById(\"surveyTitle\").classList.remove(\"invalid\");\n document.getElementById(\"surveyTitle\").classList.add(\"valid\");\n sc1 = true;\n su1 = true;\n } else {\n document.getElementById(\"surveyTitle\").classList.remove(\"valid\");\n document.getElementById(\"surveyTitle\").classList.add(\"invalid\");\n sc1 = false;\n su1 = false;\n }\n }\n\n checkForm2();\n}", "title": "" }, { "docid": "5083c2b1e58f74f6030866d7f428f93a", "score": "0.57011414", "text": "function validateAchForm(){\n\t// alert(\"doone\");\n\tvar title = document.getElementById(\"ach_title\");\n\tvar content = document.getElementById(\"ach_content\");\n\tvar location = document.getElementById(\"ach_location\");\n\tvar photofield = document.getElementById(\"achPhotoField\");\n\t// var button = document.getElementById(\"ach_submit\");\n\n\n\tif(photofield.files.length < 1){\n\t\t$(\"#achPhotoError\").text(\"You need to select a photo ...\");\n\t\tevent.preventDefault();\n\t}else{\n\t\t$(\"#achPhotoError\").text(\"\");\n\t}\n\n\tif(location.value.trim().length > 100){\n\t\tlocation.focus();\n\t\tlocation.style.border = \"1px solid red\";\n\t\t$(\"#achLocationError\").text(\"Too long location info not allowed ...\");\n\t\tevent.preventDefault();\n\t}else if(location.value.trim().length < 1){\n\t\tlocation.focus();\n\t\tlocation.style.border = \"1px solid red\";\n\t\t$(\"#achLocationError\").text(\"The Location can not be empty ...\");\n\t\tevent.preventDefault();\n\t}else{\n\t\tlocation.style.border = \"1px solid #ced4da\";\n\t\t$(\"#achLocationError\").text(\"\");\n\t}\n\t\n\tif(content.value.trim().length > 500){\n\t\tcontent.style.border = \"1px solid red\";\n\t\tcontent.focus();\n\t\t$(\"#achContentError\").text(\"Too long description not allowed ...\");\n\t\tevent.preventDefault();\n\t}else if(content.value.trim().length < 1){\n\t\tcontent.focus();\n\t\tcontent.style.border = \"1px solid red\";\n\t\t$(\"#achContentError\").text(\"The description can not be empty ...\");\n\t\tevent.preventDefault();\n\t}else{\n\t\tcontent.style.border = \"1px solid #ced4da\";\n\t\t$(\"#achContentError\").text(\"\");\n\t}\n\t\n\n\tif(title.value.trim().length > 100){\n\t\ttitle.focus();\n\t\ttitle.style.border = \"1px solid red\";\n\t\t$(\"#achTitleError\").text(\"Too long title not allowed ...\");\n\t\tevent.preventDefault();\n\t}else if(title.value.trim().length < 1){\n\t\ttitle.focus();\n\t\ttitle.style.border = \"1px solid red\";\n\t\t$(\"#achTitleError\").text(\"The title can not be empty ...\");\n\t\tevent.preventDefault();\n\t}else{\n\t\ttitle.style.border = \"1px solid #ced4da\";\n\t\t$(\"#achTitleError\").text(\"\");\n\t}\n\n}", "title": "" }, { "docid": "ae63d364febbe8480d91591aeb5562c7", "score": "0.5695444", "text": "function RfvFor4Field(txtBox1,txtBox2,txtBox3)\n{\nif(txtBox1.value.length==0 || txtBox2.value.length==0 || txtBox3.value.length==0 || txtBox4.value.length==0)\n{\nalert('Please Enter the mandatory Fields');\nreturn false; \n} \nreturn true;\n}", "title": "" }, { "docid": "440084974bbd4fca446af4432c457bae", "score": "0.5693879", "text": "function checkValidityFormular(_e) {\n let formular_name = document.getElementById(\"formular_name\");\n let nameValue = formular_name.value;\n let formular_author = document.getElementById(\"formular_author\");\n let authorValue = formular_author.value;\n //bei speichern click inputs checken, ob alle vorhanden, wenn ja\n if (nameValue.length > 6 && authorValue.length > 3) {\n sendDataToDatabase();\n }\n //wenn nicht\n else {\n alert(\"Bitte trage alle Daten richtig ein, um sie zu speichern!\");\n }\n }", "title": "" }, { "docid": "fd88c3454fe23d63ff7df5859a650ad8", "score": "0.56909704", "text": "function elementCheck()\n{\n obj =document.forms[0].elements;\n for( var i=0;i<obj.length;i++)\n {\n \n if( obj[i].type!=\"hidden\")\n {\n if(obj[i].mandatory!=undefined &&( obj[i].mandatory.toLowerCase()=='y' ||obj[i].mandatory.toLowerCase()=='true') && mandatoryCheck(obj[i].name))\n {\n return false;\n }\n if(obj[i].specialcharcheck!=undefined &&( obj[i].specialcharcheck.toLowerCase()=='y' ||obj[i].specialcharcheck.toLowerCase()=='true') && hasSpecialChar(obj[i].name))\n {\n return false;\n }\n if(obj[i].integer!=undefined &&( obj[i].integer.toLowerCase()=='y' ||obj[i].integer.toLowerCase()=='true') && !obj[i].value.match(/^\\d+$/))\n {\n alert('Enter numeric value in '+obj[i].attrTitle);\n obj[i].focus();\n return false;\n }\n if(obj[i].float!=undefined &&( obj[i].float.toLowerCase()=='y' ||obj[i].float.toLowerCase()=='true') && !obj[i].value.match(/^\\d+\\.?\\d*$/))\n {\n alert('Enter numeric value in '+obj[i].attrTitle);\n obj[i].focus();\n return false;\n }\n if(obj[i].email!=undefined &&( obj[i].email.toLowerCase()=='y' ||obj[i].email.toLowerCase()=='true') && !obj[i].value.match(/^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i))\n {\n alert('Enter Valid Email address '+obj[i].attrTitle);\n obj[i].focus();\n return false;\n }\n if(obj[i].pincode!=undefined &&( obj[i].pincode.toLowerCase()=='y' ||obj[i].pincode.toLowerCase()=='true') && !obj[i].value.match(/^([A-Za-z]{1,2})([0-9]{2,3})([A-Za-z]{2})$/))\n {\n alert('Enter Valid Pincode '+obj[i].attrTitle);\n obj[i].focus();\n return false;\n }\n } \n }\n return true;\n}", "title": "" }, { "docid": "53d6d6db50757da21154697539b6d3fd", "score": "0.5689638", "text": "function isValidationRequiredFieldAddWidth(){\n\t\tvar widthId= $(\"#listWidth,#dialogAddWidth\").find(\"#txtWidthCode\").val();\n\t\tif(widthId.trim() == '' || widthId == null)\n\t\t\treturn false;\n\t\t\n\t\tvar widthValue = $('#listWidth,#dialogAddWidth').find('#txtWidthValue').val();\n\t\tif(widthValue == '' || widthValue == null) \n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}", "title": "" }, { "docid": "b8e4a5384044dd84c93bbef7d335eb81", "score": "0.56890523", "text": "function getInputValues() {\n\n weight = $('#weight').val().trim();\n workoutLength = $('#activity-length').val().trim();\n beerPreference = $('#beer-search').val().trim();\n\n // Tests if 'Weight' input exists.\n if(weight === \"\") {\n //alert(\"Please enter your weight\");\n $(\"#weight\").val(\"\").focus();\n return false;\n\n // Tests if 'Workout Length' exists.\n } else if (workoutLength === \"\") {\n //alert(\"Please enter the time of your workout\");\n $(\"#activity-length\").val(\"\").focus();\n return false;\n\n // Tests if 'Beer Preference' exists.\n } else if (beerPreference === \"\") {\n //alert(\"Please enter a beer preference\");\n $(\"#beer-search\").val(\"\").focus();\n return false;\n \n // If all fields are complete, go ahead.\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "6f05df3e2221e27020718b643906679b", "score": "0.568846", "text": "function prospectFieldCheck(){\n\n var err = false;\n var numeric_err = false;\n\n $(':input.required').each(function(){\n if($(this).val()==\"\"){\n $(this).addClass(\"error\");\n err = true;\n } else {\n $(this).removeClass(\"error\");\n }\n });\n \n $(':input.num').each(function(){\n if(isNaN($(this).val())){\n $(this).addClass(\"error\");\n numeric_err = err = true;\n } else {\n $(this).removeClass(\"error\");\n }\n });\n\n if(err){\n alert(\"Error: Required fields found empty\");\n if(numeric_err){\n alert(\"Error: Check highlighted fields for non numeric characters.\");\n }\n return false;\n } else {\n \n html.hidden(\"go\", \"edit_prospect_submit\");\n return true;\n }\n\n\n}", "title": "" }, { "docid": "8e1f5df17014248913892b4061543ded", "score": "0.56882316", "text": "function validateForm(bool,decision){\r\n deleteTbody();\r\n deleteLabel();\r\n setSearch();\r\n emptySpan();\r\n setShow();\r\n setSort();\r\n\r\n var spanArr=document.getElementsByClassName(\"blank-field\");\r\n var inputArr=document.getElementsByClassName(\"input-field\");\r\n var productId = inputArr[0].value;\r\n var productCategory = inputArr[6].value;\r\n \r\n if(inputArr[0].value == \"\" && inputArr[1].value != \"\" && inputArr[2].value != \"\" && inputArr[3].value != \"\" && inputArr[4].value != \"\" && inputArr[5].value != \"\" && inputArr[6].value!= \"\")\r\n {\r\n spanArr[0].innerText = \"Enter Product ID to proceed\";\r\n }\r\n else if(inputArr[0].value != \"\" && inputArr[1].value == \"\" && inputArr[2].value != \"\" && inputArr[3].value != \"\" && inputArr[4].value != \"\" && inputArr[5].value != \"\" && inputArr[6].value!= \"\")\r\n {\r\n spanArr[1].innerText = \"Enter Product Name to proceed\";\r\n }\r\n else if(inputArr[0].value != \"\" && inputArr[1].value != \"\" && inputArr[2].value == \"\" && inputArr[3].value != \"\" && inputArr[4].value != \"\" && inputArr[5].value != \"\" && inputArr[6].value!= \"\")\r\n {\r\n spanArr[2].innerText = \"Enter Product Description to proceed\";\r\n }\r\n else if(inputArr[0].value != \"\" && inputArr[1].value != \"\" && inputArr[2].value != \"\" && inputArr[3].value == \"\" && inputArr[4].value != \"\" && inputArr[5].value != \"\" && inputArr[6].value!= \"\")\r\n {\r\n spanArr[3].innerText = \"Enter Product Price to proceed\";\r\n }\r\n else if(inputArr[0].value != \"\" && inputArr[1].value != \"\" && inputArr[2].value != \"\" && inputArr[3].value != \"\" && inputArr[4].value == \"\" && inputArr[5].value != \"\" && inputArr[6].value!= \"\")\r\n {\r\n spanArr[4].innerText = \"Enter Product Url to proceed\";\r\n }\r\n else if(inputArr[0].value != \"\" && inputArr[1].value != \"\" && inputArr[2].value != \"\" && inputArr[3].value != \"\" && inputArr[4].value != \"\" && inputArr[5].value == \"\" && inputArr[6].value!= \"\")\r\n {\r\n spanArr[5].innerText = \"Enter Product Color to proceed\";\r\n }\r\n else if(inputArr[0].value != \"\" && inputArr[1].value != \"\" && inputArr[2].value != \"\" && inputArr[3].value != \"\" && inputArr[4].value != \"\" && inputArr[5].value != \"\" && inputArr[6].value== \"Select Category\")\r\n {\r\n spanArr[6].innerText = \"Select Category to proceed\";\r\n }\r\n else if(inputArr[0].value != \"\" && inputArr[1].value != \"\" && inputArr[2].value != \"\" && inputArr[3].value != \"\" && inputArr[4].value != \"\" && inputArr[5].value != \"\" && inputArr[6].value!= \"\")\r\n {\r\n if(bool == true && decision == 0){\r\n productOperations.search(callBackForAddProduct,productId,productCategory,false);\r\n }\r\n else if(bool == false && decision == 1){\r\n productOperations.search(callBackForUpdateProduct,productId,productCategory,false);\r\n }\r\n else{\r\n productObject();\r\n alert(\"Product Updated\");\r\n inputArr[0].removeAttribute(\"disabled\");\r\n emptyInput();\r\n }\r\n }\r\n else{\r\n document.getElementById(\"empty-error\").innerText = \"Enter required fields to proceed\";\r\n }\r\n}", "title": "" }, { "docid": "26507e360c1acf867f2f740087e967cd", "score": "0.5687966", "text": "function validateForm()\n{\nvar x=document.forms[\"my_form\"][\"component[name]\"].value //component name\n\t\tif (x==null || x==\"\")\n\t\t {\n\t\t alert(\"Component field is Required\");\n\t\t return false;\n\t\t }\nvar x=document.forms[\"my_form\"][\"component[title]\"].value //component title\n\t\tif (x==null || x==\"\")\n\t\t {\n\t\t alert(\"Component Title field is Required\");\n\t\t return false;\n\t\t }\nvar x=document.forms[\"my_form\"][\"componentproperty[data_string]\"].value //componenet datastring\n\t\tif (x==null || x==\"\")\n\t\t {\n\t\t alert(\"Component DataString field is Required\");\n\t\t return false;\n\t\t }\n/*var x=document.forms[\"my_form\"][\"componentproperty[partial]\"].value //componenet partial\n\t\tif (x==null || x==\"\")\n\t\t {\n\t\t alert(\"Component Partial field is Required\");\n\t\t return false;\n\t\t }*/\nvar x=document.forms[\"my_form\"][\"componentproperty[xhtml_id]\"].value //component Xhtml\nif (x==null || x==\"\")\n\t\t {\n\t\t alert(\"Component Xhtml field is Required\");\n\t\t return false;\n\t\t }\n\nvar x=document.forms[\"my_form\"][\"componentproperty[empty_message]\"].value //componenet empty message\n\t\tif (x==null || x==\"\")\n\t\t {\n\t\t alert(\"Component Empty Message field is Required\");\n\t\t return false;\n\t\t }\nvar x=document.forms[\"my_form\"][\"componentproperty[error_message]\"].value //component error message\n\t\tif (x==null || x==\"\")\n\t\t {\n\t\t alert(\"Component Error Message field is Required\");\n\t\t return false;\n\t\t }\n}", "title": "" }, { "docid": "7de01543a4b162e59d1708aacd719155", "score": "0.56853396", "text": "function validateRuleSetName(formId,eleId){\n\t \n\t var isValid=false;\n\t var minLen=readValidationProp(eleId+'.min.length');\n\t var eleVal=$(\"#\"+formId+\" #\"+eleId).val();\n\t clearError(formId+\" #\"+eleId);\n\n\t if((eleVal==null ||eleVal=='') && minLen!=0){ \n\t\tgenerateAlert(formId, eleId,eleId+\".empty\");\n\t\treturn isValid;\n\t }\t \n\t\t if( !(eleVal==null ||eleVal=='') && ( (eleVal.trim().length<minLen) || (eleVal.trim().length>readValidationProp(eleId+'.max.length'))) ){\n\t\t\t generateAlert(formId, eleId,eleId+\".length\");\n\t\t }\n\t\t else\n\t\t {\n\t\t\t clearError(formId+\" #\"+eleId);\n\t\t\t \n\t\t\t isValid=true;\n\t\t }\n\t\n\treturn isValid;\n\t \n}", "title": "" }, { "docid": "b09ff13fe6f155925d9eafead6209bb4", "score": "0.56850755", "text": "function checkFields() { \n\tif(document.getElementById(\"currentBalance\").innerHTML == \"\"\n\t\t|| document.getElementById(\"currentBudget\").innerHTML == \"\"\n\t\t|| document.getElementById(\"url\").innerHTML == \"\"\n\t\t|| document.getElementById(\"cycleCount\").innerHTML == \"\") {\n\t\talert(\"ERROR: You are missing one or more field(s)!\")\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "95aec70a7bc519166b3e81c9286cd0ac", "score": "0.5678378", "text": "function checkAlphanumeric(obj,val)\n\t{\t\t\t\t \n\t\tvar fieldValue=trimAll(obj.value);\n\t\tif(fieldValue!='')\n\t\t{\n\t\t\tvar fieldName=val;\t\t\n\t\t\tif(fieldValue!=null||fieldValue!='')\n\t\t\t{\n\t\t\t\tif(!isAlphaNumericValue(obj.value))\n\t\t \t\t{\n\t\t\t\t\talert(\"Please enter Alphamuneric values only.\");\n\t\t \t\t\tdocument.getElementById(fieldName).value='';\n\t\t \t\t\tdocument.getElementById(fieldName).focus();\n\t\t \t\t\treturn false;\n\t\t \t\t}\n\t\t \t}\n\t\t }\n\t}", "title": "" }, { "docid": "69978d32c397107e9be812ec06f84c72", "score": "0.56741834", "text": "function CheckForm() {\n let nCheck\n let tCheck\n let aCheck\n let eCheck\n \n //namevalidation\n $('#namn').keyup(() => {\n let confName = /^[a-öA-Ö\\s]{2,30}$/;\n let name = $('#namn').val()\n if (confName.test(name)) {\n nCheck = true;\n $(\"#namn\").css({\"border\": \"3px solid green\"})\n $(\"#namn\").nextUntil(\"input\").hide(100)\n }\n else {\n $(\"#namn\").css({\"border\": \"3px solid red\"})\n $(\"#namn\").nextUntil(\"input\").show(100)\n eCheck = false;\n }\n })\n //Adress validation\n $('#adress').keyup(() => {\n let confAdress = /^[a-öA-Ö0-9\\s,'-]{5,100}$/;\n let adress = $('#adress').val()\n if (confAdress.test(adress)) {\n aCheck = true;\n $(\"#adress\").css({\"border\": \"3px solid green\"})\n $(\"#adress\").nextUntil(\"input\").hide(100)\n }\n else {\n $(\"#adress\").css({\"border\": \"3px solid red\"})\n $(\"#adress\").nextUntil(\"input\").show(100)\n eCheck = false;\n }\n })\n //Phone validation\n $('#telefon').keyup(() => {\n let confTel = /^[0-9]{8,12}$/;\n let telefon = $('#telefon').val()\n\n if (confTel.test(Number(telefon))) {\n tCheck = true;\n $(\"#telefon\").css({\"border\": \"3px solid green\"})\n $(\"#telefon\").nextUntil(\"input\").hide(100) \n\n }\n else {\n $(\"#telefon\").css({\"border\": \"3px solid red\"})\n $(\"#telefon\").nextUntil(\"input\").show(100)\n eCheck = false;\n }\n })\n //email validation\n $('#mail').keyup(() => {\n let confEmail = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,3}))$/;\n\n let email = $('#mail').val()\n if (confEmail.test(email)) {\n eCheck = true;\n $(\"#mail\").css({\"border\": \"3px solid green\"})\n $(\"#mail\").nextUntil(\"button\").hide(100)\n }\n else {\n $(\"#mail\").css({\"border\": \"3px solid red\"})\n $(\"#mail\").nextUntil(\"button\").show(100)\n eCheck = false;\n }\n })\n\n //Checks if all the fields have been correctly submitted, if so the button get enabled\n $(\"#form\").keyup(() => {\n if (tCheck == true && nCheck == true && aCheck == true && eCheck == true && localStorage.getItem('order')) {\n $(\"#final-buy\").removeAttr(\"disabled\")\n } else {\n\n $(\"#final-buy\").attr(\"disabled\", \"true\");\n }\n })\n}", "title": "" }, { "docid": "73dcbf2f02a78449658505a0f67e0624", "score": "0.56704676", "text": "function checkValues() {\r\n\tif ($(\"#searchType\").val() == \"place\") {\r\n\t\tif ($(\"#name\").val().length != 0 && $(\"#location\").val().length != 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tsetMessage(\"Please provide both name and location.\", false);\r\n\t\t}\r\n\t} else if ($(\"#searchType\").val() == \"activity\") {\r\n\t\tif ($(\"#location\").val().length != 0 || $(\"#name\").val().length != 0) { \r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tsetMessage(\"Please provide an activity name.\", false);\r\n\t\t}\r\n\t} else if ($(\"#searchType\").val() == \"hotel\") {\r\n\t\treturn true;\r\n\t} else {\t\r\n\t\tsetMessage(\"Invalid search type provided.\", false);\r\n\t\treturn false;\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "dcac2552ae8095fc7fc7105d9e0c0175", "score": "0.5668083", "text": "function validateDH() { // Validation Function For Domestic Helper's Registration Form (By Vidya)\n\tvalid = true;\n\tif (domesticServantForm.category.selectedIndex == 0) {\n\t\talert(\"Please Select A Category\");\n\t\tdomesticServantForm.category.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.name.value == \"\") {\n\t\talert(\"Please Enter Your Name\");\n\t\tdomesticServantForm.name.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.name) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.fathersName.value == \"\") {\n\t\talert(\"Please Enter Your Father's Name\");\n\t\tdomesticServantForm.fathersName.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.fathersName) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.mothersName.value == \"\") {\n\t\talert(\"Please Enter Your Mother's Name\");\n\t\tdomesticServantForm.mothersName.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.mothersName) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.birthDate.value == \"\") {\n\t\talert(\"Please Enter Your Date of Birth\");\n\t\tdomesticServantForm.birthDate.focus();\n\t\treturn false;\n\t}\n\tvar radioSelected = false;\n\tfor (i = 0; i < domesticServantForm.gender.length; i++) {\n\t\tif (domesticServantForm.gender[i].checked) {\n\t\t\tradioSelected = true;\n\t\t}\n\t}\n\tif (!radioSelected) {\n\t\talert(\"Please Select Gender\");\n\t\treturn (false);\n\t}\n\tif (domesticServantForm.bloodGroup.selectedIndex == 0) {\n\t\talert(\"Please Select Blood Group\");\n\t\tdomesticServantForm.bloodGroup.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.email.value == \"\") {\n\t\talert(\"Please Enter Your e-Mail Id\");\n\t\tdomesticServantForm.email.focus();\n\t\treturn false;\n\t}\n\tif (emailValidator(domesticServantForm.email) == false) {\n\t\treturn false;\n\t}\n\tif (numeric(domesticServantForm.telephoneNo) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.telephoneNo.value.length < 10 && domesticServantForm.telephoneNo.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\tdomesticServantForm.telephoneNo.value = \"\";\n\t\tdomesticServantForm.telephoneNo.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.mobileNo.value == \"\") {\n\t\talert(\"Please Enter Your Mobile No.\");\n\t\tdomesticServantForm.mobileNo.focus();\n\t\treturn false;\n\t}\n\tif (numeric(domesticServantForm.mobileNo) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.mobileNo.value.length < 10 && domesticServantForm.mobileNo.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\tdomesticServantForm.mobileNo.value = \"\";\n\t\tdomesticServantForm.mobileNo.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.permanentAddress.value == \"\") {\n\t\talert(\"Please Enter Your Permanent Address\");\n\t\tdomesticServantForm.permanentAddress.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.permanentCountry.selectedIndex == 0) {\n\t\talert(\"Please Select Country\");\n\t\tdomesticServantForm.permanentCountry.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.permanentState.selectedIndex == 0) {\n\t\talert(\"Please Select State\");\n\t\tdomesticServantForm.permanentState.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.permanentDistrict.selectedIndex == 0) {\n\t\talert(\"Please Select District\");\n\t\tdomesticServantForm.permanentDistrict.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.permanentCity.selectedIndex == 0) {\n\t\talert(\"Please Select City\");\n\t\tdomesticServantForm.permanentCity.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.permanentPostOffice.selectedIndex == 0) {\n\t\talert(\"Please Select Post Office\");\n\t\tdomesticServantForm.permanentPostOffice.focus();\n\t\treturn false;\n\t}\n\tif (numeric(domesticServantForm.permanentPhoneNo1) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.permanentPhoneNo1.value.length < 10 && domesticServantForm.permanentPhoneNo1.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\tdomesticServantForm.permanentPhoneNo1.value = \"\";\n\t\tdomesticServantForm.permanentPhoneNo1.focus();\n\t\treturn false;\n\t}\n\tif (numeric(domesticServantForm.permanentPhoneNo2) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.permanentPhoneNo2.value.length < 10 && domesticServantForm.permanentPhoneNo2.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\tdomesticServantForm.permanentPhoneNo2.value = \"\";\n\t\tdomesticServantForm.permanentPhoneNo2.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.presentAddress.value == \"\") {\n\t\talert(\"Please Enter Your Present Address\");\n\t\tdomesticServantForm.presentAddress.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.presentCountry.selectedIndex == 0) {\n\t\talert(\"Please Select Country\");\n\t\tdomesticServantForm.presentCountry.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.presentState.selectedIndex == 0) {\n\t\talert(\"Please Select State\");\n\t\tdomesticServantForm.presentState.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.presentDistrict.selectedIndex == 0) {\n\t\talert(\"Plese Select District\");\n\t\tdomesticServantForm.presentDistrict.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.presentCity.selectedIndex == 0) {\n\t\talert(\"Please Select City\");\n\t\tdomesticServantForm.presentCity.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.presentPostOffice.selectedIndex == 0) {\n\t\talert(\"Please Select Post Office\");\n\t\tdomesticServantForm.presentPostOffice.focus();\n\t\treturn false;\n\t}\n\tif (numeric(domesticServantForm.presentPhoneNo1) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.presentPhoneNo1.value.length < 10 && domesticServantForm.presentPhoneNo1.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\tdomesticServantForm.presentPhoneNo1.value = \"\";\n\t\tdomesticServantForm.presentPhoneNo1.focus();\n\t\treturn false;\n\t}\n\tif (numeric(domesticServantForm.presentPhoneNo2) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.presentPhoneNo2.value.length < 10 && domesticServantForm.presentPhoneNo2.value.length > 1) {\n\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\tdomesticServantForm.presentPhoneNo2.value = \"\";\n\t\tdomesticServantForm.presentPhoneNo2.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.height.value == \"\") {\n\t\talert(\"Please Enter Height\");\n\t\tdomesticServantForm.height.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.chest.value == \"\") {\n\t\talert(\"Please Enter Chest\");\n\t\tdomesticServantForm.chest.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.weight.value == \"\") {\n\t\talert(\"Please Enter Weight\");\n\t\tdomesticServantForm.weight.focus();\n\t\treturn false;\n\t}\n\tif ((domesticServantForm.otherLanguage.selectedIndex == 0) && (domesticServantForm.otherLanguageRead.checked == true || domesticServantForm.otherLanguageWrite.checked == true || domesticServantForm.otherLanguageSpeak.checked == true)) {\n\t\talert(\"Please Select Language\");\n\t\tdomesticServantForm.otherLanguage.focus();\n\t\treturn false;\n\t}\n\tif ((domesticServantForm.otherLanguage.selectedIndex != 0) && (domesticServantForm.otherLanguageRead.checked == false && domesticServantForm.otherLanguageWrite.checked == false && domesticServantForm.otherLanguageSpeak.checked == false)) {\n\t\talert(\"Please Select A Relevant Option For Other Language\");\n\t\tdomesticServantForm.otherLanguage.focus();\n\t\treturn false;\n\t}\n\tif ((document.getElementById(\"employmentYes\").checked == false) && (document.getElementById(\"employmentNo\").checked == false)) {\n\t\talert(\"Please Select A Value For Your Present Employment\");\n\t\tdocument.getElementById(\"employmentYes\").focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.employment[0].checked == true) {\n\t\tif (domesticServantForm.experience.value == \"\") {\n\t\t\talert(\"Please Fill In Your Work Experience\");\n\t\t\tdomesticServantForm.experience.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.nameOfOrganization.value == \"\") {\n\t\t\talert(\"Please Fill In The Name of Your Present Organization\");\n\t\t\tdomesticServantForm.nameOfOrganization.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.fromDatePresent.value == \"\") {\n\t\t\talert(\"Please Fill In the Date\");\n\t\t\tdomesticServantForm.fromDatePresent.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.toDatePresent.value == \"\") {\n\t\t\talert(\"Please Fill In the Date\");\n\t\t\tdomesticServantForm.toDatePresent.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.designation.value == \"\") {\n\t\t\talert(\"Please Fill In the Designation\");\n\t\t\tdomesticServantForm.designation.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.currentOwnerName.value == \"\") {\n\t\t\talert(\"Please Enter The Name Of Your Present Owner\");\n\t\t\tdomesticServantForm.currentOwnerName.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (alphabet(domesticServantForm.currentOwnerName) == false) {\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.currentOwnerAddress.value == \"\") {\n\t\t\talert(\"Please Enter the Address Of Your Present Owner\");\n\t\t\tdomesticServantForm.currentOwnerAddress.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.currentOwnerCountry.selectedIndex == 0) {\n\t\t\talert(\"Please Select Country\");\n\t\t\tdomesticServantForm.currentOwnerCountry.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.currentOwnerState.selectedIndex == 0) {\n\t\t\talert(\"Please Select State\");\n\t\t\tdomesticServantForm.currentOwnerState.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.currentOwnerDistrict.selectedIndex == 0) {\n\t\t\talert(\"Please Select District\");\n\t\t\tdomesticServantForm.currentOwnerDistrict.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.currentOwnerCity.selectedIndex == 0) {\n\t\t\talert(\"Please Select City\");\n\t\t\tdomesticServantForm.currentOwnerCity.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.currentOwnerPostOffice.selectedIndex == 0) {\n\t\t\talert(\"Please Select Post Office\");\n\t\t\tdomesticServantForm.currentOwnerPostOffice.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (numeric(domesticServantForm.currentOwnerTelephoneNo) == false) {\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.currentOwnerTelephoneNo.value.length < 10 && domesticServantForm.currentOwnerTelephoneNo.value.length > 1) {\n\t\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\t\tdomesticServantForm.currentOwnerTelephoneNo.value = \"\";\n\t\t\tdomesticServantForm.currentOwnerTelephoneNo.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (numeric(domesticServantForm.currentOwnerMobileNo) == false) {\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.currentOwnerMobileNo.value.length < 10 && domesticServantForm.currentOwnerMobileNo.value.length > 1) {\n\t\t\talert(\"Please Enter a Valid Ten Digit Mobile No.\");\n\t\t\tdomesticServantForm.currentOwnerMobileNo.value = \"\";\n\t\t\tdomesticServantForm.currentOwnerMobileNo.focus();\n\t\t\treturn false;\n\t\t}\n\t}\n\tif ((document.getElementById(\"previousEmploymentYes\").checked == false) && (document.getElementById(\"previousEmploymentNo\").checked == false)) {\n\t\talert(\"Please Select A Value For Your Previous Employment\");\n\t\tdocument.getElementById(\"previousEmploymentYes\").focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.previousEmployment[0].checked == true) {\n\t\tif (domesticServantForm.experience.value == \"\") {\n\t\t\talert(\"Please Fill In Your Work Experience\");\n\t\t\tdomesticServantForm.experience.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.nameOfOrganization1.value == \"\") {\n\t\t\talert(\"Please Select the Name of Your Previous Organization\");\n\t\t\tdomesticServantForm.nameOfOrganization1.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.fromDatePrevious.value == \"\") {\n\t\t\talert(\"Please Select A Date\");\n\t\t\tdomesticServantForm.fromDatePrevious.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.toDatePrevious.value == \"\") {\n\t\t\talert(\"Please Select A Date\");\n\t\t\tdomesticServantForm.toDatePrevious.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.designation1.value == \"\") {\n\t\t\talert(\"Please Enter Designation\");\n\t\t\tdomesticServantForm.designation1.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.previousOwnerName.value == \"\") {\n\t\t\talert(\"Please Enter The Name Of Your Previous Owner\");\n\t\t\tdomesticServantForm.previousOwnerName.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (alphabet(domesticServantForm.previousOwnerName) == false) {\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.previousOwnerAddress.value == \"\") {\n\t\t\talert(\"Please Enter The Address Of Your Previous Owner\");\n\t\t\tdomesticServantForm.previousOwnerAddress.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.previousOwnerCountry.selectedIndex == 0) {\n\t\t\talert(\"Please Select Country\");\n\t\t\tdomesticServantForm.previousOwnerCountry.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.previousOwnerState.selectedIndex == 0) {\n\t\t\talert(\"Please Select State\");\n\t\t\tdomesticServantForm.previousOwnerState.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.previousOwnerDistrict.selectedIndex == 0) {\n\t\t\talert(\"Please Select District\");\n\t\t\tdomesticServantForm.previousOwnerDistrict.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.previousOwnerCity.selectedIndex == 0) {\n\t\t\talert(\"Please Select City\");\n\t\t\tdomesticServantForm.previousOwnerCity.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.previousOwnerPostOffice.selectedIndex == 0) {\n\t\t\talert(\"Please Select Post Office\");\n\t\t\tdomesticServantForm.previousOwnerPostOffice.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (numeric(domesticServantForm.previousOwnerTelephoneNo) == false) {\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.previousOwnerTelephoneNo.value.length < 10 && domesticServantForm.previousOwnerTelephoneNo.value.length > 1) {\n\t\t\talert(\"Please Enter a Valid Ten Digit Phone No.\");\n\t\t\tdomesticServantForm.previousOwnerTelephoneNo.value = \"\";\n\t\t\tdomesticServantForm.previousOwnerTelephoneNo.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (numeric(domesticServantForm.previousOwnerMobileNo) == false) {\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.previousOwnerMobileNo.value.length < 10 && domesticServantForm.previousOwnerMobileNo.value.length > 1) {\n\t\t\talert(\"Please Enter a Valid Ten Digit Mobile No.\");\n\t\t\tdomesticServantForm.previousOwnerMobileNo.value = \"\";\n\t\t\tdomesticServantForm.previousOwnerMobileNo.focus();\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (domesticServantForm.underMetricBoard.value == \"\") {\n\t\talert(\"Please Enter Your Under Metric Board\");\n\t\tdomesticServantForm.underMetricBoard.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.underMetricBoard) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.underMetricInstitute.value == \"\") {\n\t\talert(\"Please Enter the Name of Your Under Metric Institute\");\n\t\tdomesticServantForm.underMetricInstitute.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.underMetricInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.underMetricCountry.selectedIndex == 0) {\n\t\talert(\"Please Select Your Under Metric Country\");\n\t\tdomesticServantForm.underMetricCountry.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.underMetricState.selectedIndex == 0) {\n\t\talert(\"Please Select Your Under Metric State\");\n\t\tdomesticServantForm.underMetricState.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.underMetricDistrict.selectedIndex == 0) {\n\t\talert(\"Please Select Your Under Metric District\");\n\t\tdomesticServantForm.underMetricDistrict.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.underMetricCity.selectedIndex == 0) {\n\t\talert(\"Please Select Your Under Metric City\");\n\t\tdomesticServantForm.underMetricCity.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.underMetricPercentage.value == \"\") {\n\t\talert(\"Please Enter Your Under Metric Percentage\");\n\t\tdomesticServantForm.underMetricPercentage.focus();\n\t\treturn false;\n\t}\n\tif (numericPercentage(domesticServantForm.underMetricPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.underMetricSubject.value == \"\") {\n\t\talert(\"Please Enter Your Under Metric Subject\");\n\t\tdomesticServantForm.underMetricSubject.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.highSchoolBoard) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.highSchoolInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (numericPercentage(domesticServantForm.highSchoolPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.highSchoolSubject) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.higherSecondaryBoard) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.higherSecondaryInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (numericPercentage(domesticServantForm.higherSecondaryPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.higherSecondarySubject) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.graduationUniversity) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.graduationInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (numericPercentage(domesticServantForm.graduationPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.graduationSubject) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.otherBoard) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.otherInstitute) == false) {\n\t\treturn false;\n\t}\n\tif (numericPercentage(domesticServantForm.otherPercentage) == false) {\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.otherSubject) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.criminalOffence[0].checked == true) {\n\t\tif (domesticServantForm.caseRegistration.value == \"\") {\n\t\t\talert(\"Please Fill In the Details of Case Registered Against You\");\n\t\t\tdomesticServantForm.caseRegistration.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.underSection.value == \"\") {\n\t\t\talert(\"Please Fill In the IPC Section\");\n\t\t\tdomesticServantForm.underSection.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.arrested.checked == false) {\n\t\t\talert(\"Please Select a Value\");\n\t\t\tdomesticServantForm.arrested.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.caseStatus.value == \"\") {\n\t\t\talert(\"Please Select the Present Status of Your Case\");\n\t\t\tdomesticServantForm.caseStatus.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.caseDate.value == \"\") {\n\t\t\talert(\"Please Select the Case Date\");\n\t\t\tdomesticServantForm.caseDate.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (domesticServantForm.place.value == \"\") {\n\t\t\talert(\"Please Enter the Place of Case Registration\");\n\t\t\tdomesticServantForm.place.focus();\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (domesticServantForm.nameOne.value == \"\") {\n\t\talert(\"Please Enter the Name of a Responsible Person\");\n\t\tdomesticServantForm.nameOne.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.nameOne) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.nameTwo.value == \"\") {\n\t\talert(\"Please Enter the Name of a Responsible Person\");\n\t\tdomesticServantForm.nameTwo.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(domesticServantForm.nameTwo) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.addressOne.value == \"\") {\n\t\talert(\"Please Enter the Address of a Responsible Person\");\n\t\tdomesticServantForm.addressOne.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.addressTwo.value == \"\") {\n\t\talert(\"Please Enter the Address of a Responsible Person\");\n\t\tdomesticServantForm.addressTwo.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.pinCodeOne.value == \"\") {\n\t\talert(\"Please Enter the PIN Code of a Responsible Person\");\n\t\tdomesticServantForm.pinCodeOne.focus();\n\t\treturn false;\n\t}\n\tif (numeric(domesticServantForm.pinCodeOne) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.pinCodeOne.value.length < 6 && domesticServantForm.pinCodeOne.value.length > 1) {\n\t\talert(\"Please Enter a Valid Six Digit PIN Code.\");\n\t\tdomesticServantForm.pinCodeOne.value = \"\";\n\t\tdomesticServantForm.pinCodeOne.focus();\n\t\treturn false;\n\t}\n\tif (domesticServantForm.pinCodeTwo.value == \"\") {\n\t\talert(\"Please Enter the PIN Code of a Responsible Person\");\n\t\tdomesticServantForm.pinCodeTwo.focus();\n\t\treturn false;\n\t}\n\tif (numeric(domesticServantForm.pinCodeTwo) == false) {\n\t\treturn false;\n\t}\n\tif (domesticServantForm.pinCodeTwo.value.length < 6 && domesticServantForm.pinCodeTwo.value.length > 1) {\n\t\talert(\"Please Enter a Valid Six Digit PIN Code.\");\n\t\tdomesticServantForm.pinCodeTwo.value = \"\";\n\t\tdomesticServantForm.pinCodeTwo.focus();\n\t\treturn false;\n\t}\n\tvar temp=confirm('Please check all details for correction if any, before submit.');\n\tif(temp==true) {\n\treturn true;\n\t}else {\n\treturn false;\n\t}\n}", "title": "" }, { "docid": "9b178cf44497441b75e4428e85747748", "score": "0.5667983", "text": "function validateValues() {\n if (ctrl.item.kind === 'cron') {\n var scheduleAttribute = lodash.find(ctrl.selectedClass.attributes, { name: 'schedule' });\n var intervalAttribute = lodash.find(ctrl.selectedClass.attributes, { name: 'interval' });\n var intervalInputIsFilled = !lodash.isEmpty(ctrl.editItemForm.item_interval.$viewValue);\n var scheduleInputIsFilled = !lodash.isEmpty(ctrl.editItemForm.item_schedule.$viewValue);\n\n if (intervalInputIsFilled === scheduleInputIsFilled) {\n\n // if interval and schedule fields are filled or they are empty - makes these fields invalid\n ctrl.editItemForm.item_interval.$setValidity('text', false);\n ctrl.editItemForm.item_schedule.$setValidity('text', false);\n } else {\n\n // if interval or schedule filed is filled - makes these fields valid\n ctrl.editItemForm.item_interval.$setValidity('text', true);\n ctrl.editItemForm.item_schedule.$setValidity('text', true);\n scheduleAttribute.allowEmpty = intervalInputIsFilled;\n intervalAttribute.allowEmpty = scheduleInputIsFilled;\n }\n } else if (ctrl.item.kind === 'rabbit-mq') {\n var queueName = lodash.find(ctrl.selectedClass.attributes, { name: 'queueName' });\n var topics = lodash.find(ctrl.selectedClass.attributes, { name: 'topics' });\n var queueNameIsFilled = !lodash.isEmpty(ctrl.editItemForm.item_queueName.$viewValue);\n var topicsIsFilled = !lodash.isEmpty(ctrl.editItemForm.item_topics.$viewValue);\n\n // Queue Name and Topics cannot be both empty at the same time\n // at least one of them should be filled\n // if one of them is filled, the other is allowed to be empty\n queueName.allowEmpty = topicsIsFilled;\n topics.allowEmpty = queueNameIsFilled;\n\n // update validity: if empty is not allowed and value is currently empty - mark invalid, otherwise valid\n ctrl.editItemForm.item_queueName.$setValidity('text', queueName.allowEmpty || queueNameIsFilled);\n ctrl.editItemForm.item_topics.$setValidity('text', topics.allowEmpty || topicsIsFilled);\n }\n }", "title": "" }, { "docid": "575a77fff86c766c14c8c39dc05ee0b5", "score": "0.56643814", "text": "function validateMultipleDiv(formname,fieldList,divName,index)\n { \n for(var i=0;i<fieldList.length\t;i++)\n { \n \n var obj = eval('document.'+formname+'.elements[\\''+fieldList[i]+'\\']'); \n if(obj.type=='text')\n\t obj.value=trimVal(obj.value);\n\t if(trimVal(obj.value)=='')\n\t { \n\t var type='';\n\t if(obj.type=='text'||obj.type=='hidden') \n\t type='enter';\n\t else if(obj.type=='select-one'||obj.type=='select-multiple')\n\t type='select';\n\n\t var title = obj.title;\n\t showPage(divName,index);\n\t alert('Please '+type+' '+title);\t \n\t if(obj.type!='hidden')\n\t obj.focus();\n\t return false;\n\t }\n }\n return true; \n }", "title": "" }, { "docid": "fe106962981c9d7f6e4dc98cb044d5fb", "score": "0.5660917", "text": "function areFormParamsValid() {\n if (!$('id_name').getValue()) {\n alert(gettext('Please give a name to your trip.'));\n return false;\n }\n if ($('id_regular').getValue() == 0 && !$('id_date').getValue()) {\n // TODO : check date format\n alert(gettext('Please choose a date.') );\n return false;\n }\n if ($('id_regular').getValue() == 1 && areDowsEmpty()) {\n alert(gettext('Please choose a frequency.') );\n return false;\n }\n if (getTripType() != TYPE_DEMAND && !isRouteOK()) {\n alert(gettext('The route is not correctly defined.') );\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "ad3680a2dcd49510e05a47b4be2d02f9", "score": "0.5660031", "text": "function validateText(thisObj) {\r\n var fieldValue = thisObj.val();\r\n if ((fieldValue.length >= 4 && fieldValue.length < 20) || (validateCampPrice(thisObj.attr('id')) && fieldValue == 0) || (thisObj.attr('id') == \"inputLegajo\" && fieldValue >= 1)) {\r\n $(thisObj).addClass('is-valid');\r\n }\r\n else {\r\n $(thisObj).addClass('is-invalid');\r\n }\r\n }", "title": "" }, { "docid": "ed37b097cfbdd0b527d7cc4b155e928f", "score": "0.5655051", "text": "function form_validation(fields, selections){\n /* Create a validation dictionary to add validation info it, the idea is to used it to insert the validation\n info only when the data is invalid */\n var valDic = [];\n /* the validation is true unless an invalid field will change it */\n var is_valid = true;\n /* If any of the fields is empty, then the data is not valid */\n for (var i = 0; i < fields.id.length; i++) {\n if(document.querySelector(fields.id[i]).value === \"\"){\n is_valid = false;\n valDic.push({mesClass:\"invalid-feedback\", sibClass:\"is-invalid\", message:\"invalid!\", \n sibId: fields.id[i]});\n }\n else{\n valDic.push({mesClass:\"valid-feedback\", sibClass:\"is-valid\", message:\"Good\", \n sibId: fields.id[i]});\n }\n }\n for (var j = 0; j < selections.id.length; j++){\n element = document.querySelector(selections.id[j]);\n if(element.options[element.selectedIndex].text === \"\"){\n is_valid = false;\n valDic.push({mesClass:\"invalid-feedback\", sibClass:\"is-invalid\", message:\"invalid!\", \n sibId: selections.id[j]});\n }\n else{\n valDic.push({mesClass:\"valid-feedback\", sibClass:\"is-valid\", message:\"Good\", \n sibId: selections.id[j]});\n }\n }\n /* Only add validation info if the data is invalid */\n if(!is_valid){\n for(var k=0; k < valDic.length; k++){\n add_validation_info(valDic[k].mesClass, valDic[k].sibClass, valDic[k].message, valDic[k].sibId);\n }\n }\n return is_valid;\n}", "title": "" }, { "docid": "b202c9cefa84f3fb748c1eab60fc5430", "score": "0.565463", "text": "function validateTrainerForm() {\n const regex = /^[a-zA-Z ]{2,15}$/;\n if (trainerFirstName.value === null || trainerFirstName.value === '' || regex.test(trainerFirstName.value) === false) {\n trainerFirstName.classList.add('invalid');\n trainerLastName.classList.remove('invalid');\n subject.classList.remove('invalid');\n errTrainer.innerText = 'First Name up to 15 letters / no numbers';\n return false;\n }\n else if (trainerLastName.value === null || trainerLastName.value === '' || regex.test(trainerLastName.value) === false) {\n errTrainer.innerText = 'Last Name up to 15 letters / no numbers';\n trainerLastName.classList.add('invalid');\n trainerFirstName.classList.remove('invalid');\n subject.classList.remove('invalid');\n\n return false;\n }\n else if (subject.value === null || subject.value === '#') {\n subject.classList.add('invalid');\n trainerLastName.classList.remove('invalid');\n trainerFirstName.classList.remove('invalid');\n errTrainer.innerText = 'Choose a Subject';\n return false;\n }\n else {\n errTrainer.innerText = '';\n return true;\n }\n}", "title": "" }, { "docid": "f060b075b574ce776c5601cc2ade7e53", "score": "0.5650439", "text": "function validate(el)\r\n {\r\n console.log('validating: ' + el );\r\n switch(el)\r\n {\r\n case 'step1':\r\n //FORM VALIDATION\r\n var formUserName = $('#register-form .userName');\r\n var formUserEmail = $('#register-form .userEmail');\r\n var formUserCountry = $('#register-form .countries');\r\n console.log('country val: ' + $(formUserCountry).val());\r\n var isValidUserName,isValidUserEmail,isValidUserCountry;\r\n hasAccount = false;\r\n var valid;\r\n if($(formUserName).val().length > 0)\r\n {\r\n $(formUserName).removeClass('form-error')\r\n isValidUserName = true;\r\n }\r\n else {\r\n $(formUserName).addClass('form-error');\r\n isValidUserName = false;\r\n }\r\n if(validateEmail($(formUserEmail).val()) && $(formUserEmail).val().length > 0)\r\n {\r\n isValidUserEmail = true;\r\n $(formUserEmail).removeClass('form-error');\r\n } else {\r\n $(formUserEmail).addClass('form-error');\r\n isValidUserEmail = false;\r\n }\r\n\r\n if($(formUserCountry).val() !== 'ZZ')\r\n {\r\n isValidUserCountry = true;\r\n $(formUserCountry).removeClass('form-error');\r\n } else {\r\n $(formUserCountry).addClass('form-error');\r\n isValidUserCountry = false;\r\n }\r\n\r\n if(!isValidUserEmail || !isValidUserEmail || !isValidUserCountry)\r\n {\r\n alert('Please fix the invalid information highlighted in red before proceeding. Thanks!');\r\n window.location.hash = '#1';\r\n return false;\r\n } else {\r\n setUserData();\r\n\r\n return true;\r\n }\r\n break;\r\n\r\n case 'step2':\r\n break;\r\n\r\n case 'step2a':\r\n var userFullName = $('#form-broker-account input.user-full-name');\r\n var userBrokerID = $('#form-broker-account input.user-broker-id');\r\n var isValidFullName,isValidBrokerID;\r\n\r\n if($(userFullName).val().length > 0)\r\n {\r\n $(userFullName).removeClass('form-error')\r\n isValidFullName = true;\r\n } else {\r\n $(userFullName).addClass('form-error')\r\n isValidFullName = false;\r\n }\r\n\r\n if($(userBrokerID).val().length > 0)\r\n {\r\n $(userBrokerID).removeClass('form-error')\r\n isValidBrokerID = true;\r\n } else {\r\n $(userBrokerID).addClass('form-error')\r\n isValidBrokerID = false;\r\n }\r\n\r\n if(!isValidFullName || !isValidBrokerID)\r\n {\r\n alert('Please fix the invalid information highlighted in red before proceeding. Thanks!');\r\n return false;\r\n } else {\r\n setUserData();\r\n\r\n return true;\r\n }\r\n\r\n break;\r\n }\r\n }", "title": "" }, { "docid": "c310a5d79ac6713c6668ad2e739ffbef", "score": "0.5643918", "text": "function validateUrlFields(event){\n if(clicked){\n event.preventDefault();\n }\n clicked = true;\n\n // clear the red borders from tab2 and tab3\n clearBorders(\"\", \"tab2\", \"tab3\");\n // clear all the errors or warnings so that the new ones can be shown\n clearFeedback();\n\n // if there is no format selected or there is no URI inserted,\n // an error iwll be shown and the borders of the fields will be red\n if($(\".tab1Input\").val() == \"\" || $(\".formatSelectTab1\").val() == \"\"){\n // give the alert variable (error container) a message\n alert.text(\"Please fill in all the fields to validate by URL.\");\n\n // validate the different fields and give them a border color\n validateField(\".tab1Input\");\n validateField(\".formatSelectTab1\");\n\n // show the alert variable message in tab 1\n $(\"#tab1\").prepend(alert);\n }else{\n // get the value from the URI input field\n url = $(\".tab1Input\").val();\n // call the function getData which gets the source code from the inserted URI\n getData(validateUrl);\n }\n }", "title": "" }, { "docid": "8e2bcbc22cb2ab7ef139b1cb454d566f", "score": "0.5626605", "text": "function RfvFor5Field(txtBox1,txtBox2,txtBox3,txtBox4,txtBox5)\n{\nif(txtBox1.value.length==0 || txtBox2.value.length==0 || txtBox3.value.length==0 || txtBox4.value.length==0 || txtBox5.value.length==0)\n{\nalert('Please Enter the mandatory Fields');\nreturn false; \n} \nreturn true;\n}", "title": "" }, { "docid": "eb48769e5c27b5dfe444bd52fa55e80d", "score": "0.5626131", "text": "function pageValidate(frmId) {\n\tvar txtFieldIdArr = new Array();\t\n\ttxtFieldIdArr[0] = \"tf1_priority, \"+LANG_LOCALE['12342'];\n txtFieldIdArr[1] = \"tf1_helloInterval, \"+LANG_LOCALE['12281'];\n txtFieldIdArr[2] = \"tf1_deadInterval, \"+LANG_LOCALE['12247'];\n txtFieldIdArr[3] = \"tf1_cost, \"+LANG_LOCALE['12244'];\n \n if (txtFieldArrayCheck(txtFieldIdArr) == false)\n\t return false; \n\t \n\tif (isProblemCharArrayCheck(txtFieldIdArr, '\\'\" ', NOT_SUPPORTED) == false) \n return false;\n\t\n\tvar priorityObj = document.getElementById('tf1_priority');\n if (priorityObj && !priorityObj.disabled) {\n if (numericValueRangeCheck(priorityObj, 1, \"\", 0, 255, true, LANG_LOCALE['11325']+': ', \"\") == false) \n return false;\n }\n \n var helloIntervalObj = document.getElementById('tf1_helloInterval');\n if (helloIntervalObj && !helloIntervalObj.disabled) {\n if (numericValueRangeCheck(helloIntervalObj, 1, \"\", 1, 65535, true, LANG_LOCALE['11271']+': ', \"\") == false) \n return false;\n }\n\t\n\tvar deadIntervalObj = document.getElementById('tf1_deadInterval');\n if (deadIntervalObj && !deadIntervalObj.disabled) {\n if (numericValueRangeCheck(deadIntervalObj, 1, \"\", 1, 65535, true, LANG_LOCALE['11241']+': ', \"\") == false) \n return false;\n }\n\n\tvar costObj = document.getElementById('tf1_cost');\n if (costObj && !costObj.disabled) {\n if (numericValueRangeCheck(costObj, 1, \"\", 1, 65535, true, LANG_LOCALE['11238']+': ', \"\") == false) \n return false;\n } \n setHiddenChks(frmId);\n return true;\n}", "title": "" }, { "docid": "c356bd2ff0298ffd51f34b67d9c32dd0", "score": "0.56226355", "text": "function validateInputFields() {\n var msg = '';\n if ($(\"#txtCode\").val() === \"\") {\n msg += \"O campo 'Código' é obrigatório.\";\n }\n if ($(\"#txtName\").val() === \"\") {\n if (msg.length > 0) { msg += \"<br>\"; }\n msg += \"O campo 'Nome' é obrigatório.\";\n }\n if ($(\"#txtStartDate\").data(\"DateTimePicker\").date() === null) {\n if (msg.length > 0) { msg += \"<br>\"; }\n msg += \"O campo 'Data Inicial' é obrigatório.\";\n }\n if ($(\"#ddlStatus option:selected\").val() === undefined) {\n if (msg.length > 0) { msg += \"<br>\"; }\n msg += \"O campo 'Estado' é obrigatório.\";\n }\n if (msg.length > 0) {\n MessageBox.info(msg);\n return false;\n }\n MessageBox.clear();\n return true;\n }", "title": "" }, { "docid": "f26fb55af700a6ad0f5ed1f79a88bc3a", "score": "0.56199205", "text": "function validar_01(){\n var nombre = document.Contacto.nombre;\n var apellido = document.Contacto.apellido;\n var correo= document.Contacto.correo;\n var asunto= document.Contacto.asunto;\n var contenido = document.Contacto.contenido;\n\n if(nombre.value ==\"\" || nombre.value.indexOf(\" \") == 0 || (isNaN(nombre.value)==false) || nombre.value.length>13){\n alert (\"Indique su nombre\");\n document.getElementById(\"Nombre\").value = \"\";\n document.getElementById(\"Nombre\").focus();\n return false;\n }\n else if(apellido.value ==\"\" || apellido.value.indexOf(\" \") == 0 || (isNaN(apellido.value)==false) || apellido.value.length>13){\n alert (\"Indique su apellido\");\n document.getElementById(\"Apellido\").value = \"\";\n document.getElementById(\"Apellido\").focus();\n return false;\n }\n else if(correo.value ==\"\" || correo.value.indexOf(\" \") == 0 || (isNaN(correo.value)==false) || correo.value.length>40){\n alert (\"Indique su correo\");\n document.getElementById(\"Correo\").value = \"\";\n document.getElementById(\"Correo\").focus();\n return false;\n }\n else if(asunto.value ==\"\" || asunto.value.indexOf(\" \") == 0 || (isNaN(asunto.value)==false) || asunto.value.length>20){\n alert (\"Indique el asunto\");\n document.getElementById(\"Asunto\").value = \"\";\n document.getElementById(\"Asunto\").focus();\n return false;\n }\n else if(contenido.value ==\"\" || contenido.value.indexOf(\" \") == 0 || (isNaN(contenido.value)==false) || contenido.value.length>1000){\n alert (\"El contenido esta vacio o demasiado largo\");\n document.getElementById(\"Contenido\").value = \"\";\n document.getElementById(\"Contenido\").focus();\n return false;\n }\n}", "title": "" }, { "docid": "d120c9fbe9b1703c6ec30e83dd8a05ff", "score": "0.5615831", "text": "function validateAdsForm(){\n\t// alert(\"doone\");\n\tvar title = document.getElementById(\"ads_title\");\n\tvar content = document.getElementById(\"ads_content\");\n\tvar category = document.getElementById(\"ads_category\");\n\tvar photofield = document.getElementById(\"adsPhotoField\");\n\n\n\tif(photofield.value.trim().length < 1 ){\n\t\t$(\"#adsPhotoError\").text(\"Image is required ...\");\n\t\tevent.preventDefault();\n\t}\n\t\n\tif(content.value.trim().length > 500){\n\t\tcontent.style.border = \"1px solid red\";\n\t\tcontent.focus();\n\t\t$(\"#adsContentError\").text(\"Too long description not allowed ...\");\n\t\tevent.preventDefault();\n\t}else if(content.value.trim().length < 1){\n\t\tcontent.focus();\n\t\tcontent.style.border = \"1px solid red\";\n\t\t$(\"#adsContentError\").text(\"The description can not be empty ...\");\n\t\tevent.preventDefault();\n\t}else{\n\t\tcontent.style.border = \"1px solid #ced4da\";\n\t\t$(\"#adsContentError\").text(\"\");\n\t}\n\n\n\n\tif(category.value.trim().length < 1){\n\t\tcategory.style.border = \"1px solid red\";\n\t\tcategory.focus();\n\t\t$(\"#adsCategoryError\").text(\"category must be selected ...\");\n\t\tcategory.style.border = \"1px solid red\";\n\t\tevent.preventDefault();\n\t}else{\n\t\tcategory.style.border = \"1px solid #ced4da\";\n\t\t$(\"#adsCategoryError\").text(\"\");\n\n\t}\n\n\t\n\n\tif(title.value.trim().length > 100){\n\t\ttitle.focus();\n\t\ttitle.style.border = \"1px solid red\";\n\t\t$(\"#adsTitleError\").text(\"Too long title not allowed ...\");\n\t\tevent.preventDefault();\n\t}else if(title.value.trim().length < 1){\n\t\ttitle.focus();\n\t\ttitle.style.border = \"1px solid red\";\n\t\t$(\"#adsTitleError\").text(\"The title can not be empty ...\");\n\t\tevent.preventDefault();\n\t}else{\n\t\ttitle.style.border = \"1px solid #ced4da\";\n\t\t$(\"#adsTitleError\").text(\"\");\n\t}\n\n}", "title": "" }, { "docid": "ed244523410401cb55b7f3825b04e345", "score": "0.5615261", "text": "FieldValidation(key, value) {\n switch (key) {\n case 'firstName':\n if (value.length > 15) {\n return 'error';\n }\n break;\n case 'lastName':\n if (value.length > 15) {\n return 'error';\n }\n break;\n case 'email':\n if (!value.match(/^([\\w.%+-]+)@([\\w-]+\\.)+([\\w]{2,})$/i)) {\n return 'error';\n }\n break;\n case 'pec':\n if (value.match(/^([\\w.%+-]+)@([\\w-]+\\.)+([\\w]{2,})$/i)) {\n return 'error';\n }\n break;\n case 'role':\n if (value.length > 15) {\n return 'error';\n }\n case 'Passwd':\n if (value.length > 15) {\n return 'error';\n }\n break;\n case 'password2':\n if (!value.match(this.state.Passwd)) {\n return 'error';\n } else {\n return true;\n }\n break;\n case 'phoneNumber':\n if (value.length > 10) {\n return 'error';\n }\n break;\n case 'telAz':\n if (value.length > 10) {\n return 'error';\n }\n break;\n case 'nomeAzienda':\n if (value.length > 50) {\n return 'error';\n }\n break;\n case 'subCategoria':\n if (value.length > 30) {\n return 'error';\n }\n break;\n case 'piva':\n if (value.length > 11) {\n return 'error';\n }\n break;\n case 'ateco':\n if (value.length > 8) {\n return 'error';\n }\n break;\n case 'provCCIAA':\n if (value.length > 2) {\n return 'error';\n }\n break;\n case 'numREA':\n if (value.length > 6) {\n return 'error';\n }\n break;\n case 'sedeLegInd':\n if (value.length > 30) {\n return 'error';\n }\n break;\n case 'sedeLegNum':\n if (value.length > 3) {\n return 'error';\n }\n break;\n case 'capLeg':\n if (value.length > 5) {\n return 'error';\n }\n break;\n case 'sedeLegFax':\n if (value.length > 10) {\n return 'error';\n }\n break;\n case 'sedeAmmInd':\n if (value.length > 30) {\n return 'error';\n }\n break;\n case 'sedeAmmNum':\n if (value.length > 3) {\n return 'error';\n }\n break;\n case 'capAmm':\n if (value.length > 5) {\n return 'error';\n }\n break;\n case 'sedeAmmFax':\n if (value.length > 10) {\n return 'error';\n }\n break;\n }\n }", "title": "" } ]
b0f95609158c2d7210299d6967389385
pass each API call to state
[ { "docid": "45d80f9587a0f7b6a99494010c8651f4", "score": "0.0", "text": "callApi(movieId, rating){\n let res = (async () => { let response = await fetch(`https://api.themoviedb.org/3/movie/${movieId}?api_key=${util.token}&language=en-US`);\n if (response.ok) { \n let filmJson = await response.json();\n filmJson.userRating = rating\n let filmArray = this.state.ratings.concat(filmJson);\n this.setState({ ratings: filmArray })\n } else {\n alert(\"HTTP-Error: \" + response.status);\n }\n })();\n }", "title": "" } ]
[ { "docid": "d2b7cfe3eb6b9ee234e1f2d80a6c50d1", "score": "0.67256427", "text": "async refresh() {\n await this.setState({loading: true})\n let response_request = await fetch(\n 'https://snowangels-api.herokuapp.com/num_requests?uid=' + this.state.uid\n );\n let response_shovel = await fetch(\n 'https://snowangels-api.herokuapp.com/num_shovels?uid=' + this.state.uid\n );\n let response_points = await fetch(\n 'https://snowangels-api.herokuapp.com/num_points?uid=' + this.state.uid\n );\n let response1Json = await response_request.json();\n let response2Json = await response_shovel.json();\n let response3Json = await response_points.json();\n\n //Update state with result of fetch calls\n this.setState({\n num_requests: response1Json.num_requests,\n num_shovels: response2Json.num_shovels,\n points: response3Json.points,\n });\n await this.store_state(this.state);\n await this.setState({loading: false})\n }", "title": "" }, { "docid": "41f0561a82d8ac45cee17e7e97e91f28", "score": "0.67236567", "text": "getAllStates () {\n axios.get(url.api_url + 'state/?state_usps=True').then((response) => {\n this.setState({all_states: response.data})\n\n axios.get(url.api_url + `party?party_name=True`).then((response) => {\n this.setState({\n party_data: response.data\n })\n })\n }).catch((error) => {\n this.setState({all_states: -1})\n })\n }", "title": "" }, { "docid": "0996405e0c5710121b2304977980a1bc", "score": "0.6709638", "text": "callApi( url, stateItemName ) {\n\t\tconst api = new Api();\n\t\tconst headers = [];\n\t\treturn (\n\t\t\tapi\n\t\t\t\t.get( url, headers )\n\t\t\t\t.then( ( data ) => {\n\t\t\t\t\t// If status is 200-299.\n\t\t\t\t\tif ( data.ok ) {\n\t\t\t\t\t\treturn data.json().then( ( jsonData ) => \n\t\t\t\t\t\t\tthis.setState({ [stateItemName]: jsonData })\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t);\n\t}", "title": "" }, { "docid": "fbb10038eeed98cc45ace0339a4ab323", "score": "0.6442377", "text": "getAllRequest(state) {\n state.all = {loading: true}\n }", "title": "" }, { "docid": "fa23aeec54d13b38ffeca2534e8b3a25", "score": "0.6380319", "text": "async getStates(country){\n //using the API will provide us with the states of the country chosen\n const url = \"https://www.universal-tutorial.com/api/states/\" + country \n const response = await fetch(url, {\n headers:{\n 'Authorization':\"Bearer \" + this.state.authToken,\n 'Accept': 'application/json'\n }\n })\n //storing the received response data in a JSON format\n const data = await response.json()\n\n //Temporary array to store all of the states\n var states = []\n //storing all the states from the received data\n for(var x in data){\n var obj = data[x]\n states.push(obj['state_name'])\n }\n //storing the states in the state of the component\n this.setState({\n states: states\n })\n\n }", "title": "" }, { "docid": "6e4eb1ea93c13827435606745dc07985", "score": "0.6251775", "text": "loadDataFromServer(){\n\n Service.getAppIds(data => {\n this.setState({\n appIds: data\n });\n }).catch(error => {\n this.setState({\n error: true\n })\n });\n\n Service.getDownloadsByCountry(data => {\n this.setState({\n byCountry: data\n });\n }).catch(error => {\n this.setState({\n error: true\n })\n });\n\n Service.getDownloadsByTime(data => {\n this.setState({\n byTime: data\n });\n }).catch(error => {\n this.setState({\n error: true\n })\n });\n }", "title": "" }, { "docid": "5e14d69e4f7fb4a04ba340574d4029ae", "score": "0.61709553", "text": "callAPI(){\n let self = this\n axios.all([\n axios.get(self.state.apiUrl+\"/criminals\"),\n axios.get(self.state.apiUrl+\"/states\"),\n axios.get(self.state.apiUrl+\"/crimes\")\n ])\n .then(axios.spread((criminals, states, crimes) => {\n // console.log(criminals)\n let allRecords = criminals.data.results.concat(states.data.results).concat(crimes.data.results)\n this.setState({allData: allRecords})\n }))\n .catch((error) => {\n console.log(error)\n });\n }", "title": "" }, { "docid": "525e883f18ff50bbc20d10fbd2d9f331", "score": "0.6158251", "text": "callAPI() {\n console.log(\"LSKANDF\");\n fetch(`${DOMAIN}/testAPI`)\n .then(res => res.text())\n .then(res => this.setState({ apiResponse: res }));\n console.log(this.state.apiResponse);\n }", "title": "" }, { "docid": "2f097c73f903ea97e1f25981d668e6d6", "score": "0.6127302", "text": "componentDidMount() {\n this.generalStats();\n APIGet({\n onSuccess: (algorithms) => {\n this.setState({\n algorithms: algorithms.map((algorithm) => ({\n id: algorithm.id,\n name: algorithm.name\n })),\n isLoaded: this.state.metrics !== null &&\n this.state.studies !== null &&\n this.state.trials !== null\n });\n },\n onError: this.handleError,\n uri: \"/algorithms/\",\n });\n APIGet({\n onSuccess: (metrics) => {\n this.setState({\n metrics: metrics.map((metric) => ({\n id: metric.id,\n name: metric.name\n })),\n isLoaded: this.state.algorithms !== null &&\n this.state.studies !== null &&\n this.state.trials !== null\n });\n },\n onError: this.handleError,\n uri: \"/metrics/\",\n });\n }", "title": "" }, { "docid": "83e7184ed7375a02ac2455d11fa33b4c", "score": "0.6060422", "text": "async function getInformationAboutRover(state){\n\n const dataFrom_apiCaller = await Object.assign(apiCaller(state))\n\n // updating the key value pairs in the state with the corresponding data from the API call to the server. \n updateStore('data', dataFrom_apiCaller.data.photos) \n updateStore('launch_date', dataFrom_apiCaller.data.photos[0]['rover']['launch_date']) \n updateStore('landing_date', dataFrom_apiCaller.data.photos[0]['rover']['landing_date']) \n updateStore('earth_date', dataFrom_apiCaller.data.photos[0].earth_date) \n}", "title": "" }, { "docid": "8e0519213a2cf157519feae6e465b48e", "score": "0.6056107", "text": "function makeApiCall() {\n //\n // Get the current timestamp\n // This is referenced later when fetching fresh data, or data changed after this timestamp.\n //\n const fetchTime = fetchTimestamp(getState)\n .then(time => time)\n .catch((err) => {\n logger.log(err);\n });\n\n //\n // Fetch the data.\n //\n const fetchData = backoffFetch(request, responseHandler, errorHandler)\n .then((resp) => {\n //\n // Handle an OK response\n //\n if (resp.ok) {\n resp.json().then((json) => {\n //\n // Abort if there's a new request in route.\n //\n if (replace && currentFetch !== getLatestFetch()) {\n return;\n }\n\n //\n // Ensure the response data is an Array\n //\n const output = {\n data: [].concat(json.data),\n };\n\n totalFetched += output.data.length;\n\n //\n // Log network response\n //\n logger.group('network', 'response');\n logger.log(\n 'network',\n `Response: ${getTimestamp()} ${resource}`,\n json,\n );\n logger.log('network', output.data);\n logger.groupEnd('network', 'response');\n\n //\n // Process included resources.\n //\n if ('included' in json) {\n processIncludes(dispatch)(json.included);\n }\n\n //\n // Purge store if replacing.\n //\n if (replace && currentFetch === getLatestFetch()) {\n dispatch(a.purge(resource));\n // Ensure it only purges once.\n replace = false;\n }\n\n // Cancel receive action if the current fetch doesn't match the latest\n // This is to prevent paginated requests from being added to the results.\n if (currentFetch !== getLatestFetch()) {\n return;\n }\n\n //\n // Dispatch Receive action\n //\n dispatch(a.receive(output, resource));\n\n const hasMore = json.links && json.links.next;\n\n if (!hasMore) {\n // Call onDone() then exit.\n if (onDone) {\n onDone();\n }\n return;\n }\n\n //\n // Recursively fetch paginated items.\n //\n if (\n count === 0 ||\n (count > totalFetched && currentFetch === getLatestFetch())\n ) {\n dispatch(\n _fetchAll({\n ...options,\n endpoint: json.links.next.href,\n totalFetched,\n replace,\n }),\n );\n }\n else if (onNext && currentFetch === getLatestFetch()) {\n // Call onNext()\n onNext(json.links.next.href, totalFetched);\n }\n });\n }\n //\n // Handle a NOT OK response\n //\n else {\n dispatch(a.failure(\n `${resp.status}: ${resp.statusText ||\n 'No status message provided'}`,\n resource,\n ));\n }\n\n return resp;\n })\n //\n // Catch network error\n //\n .catch(handleNetworkError(dispatch, resource));\n\n return Promise.all([fetchTime, fetchData])\n .then((values) => {\n //\n // Set the collection updated timestamp.\n //\n dispatch(a.setTimestamp(resource, values[0]));\n //\n // Return the fetched data.\n //\n return values[1];\n })\n .catch((err) => {\n logger.log(err);\n });\n }", "title": "" }, { "docid": "715d4e712e3cbff54e5fd297adb2b7df", "score": "0.6047443", "text": "componentDidMount(){\n ApiService.getCurrentDog()\n .then( res => {\n //console.log(res);\n this.setState({\n dog: res\n })\n })\n .catch({error: 'An error has Occurred'})\n\n ApiService.getCurrentCat()\n .then( res => {\n //console.log(res);\n this.setState({\n cat: res\n })\n })\n .catch({error: 'An error has Occurred'})\n\n ApiService.getCurrentUser()\n .then( res => {\n //console.log(res);\n this.setState({\n user: res\n })\n })\n .catch({error: 'An error has Occurred'})\n\n ApiService.getAllUser()\n .then( res => {\n //console.log(res);\n this.setState({\n userList: res\n })\n })\n .catch({error: 'An error has Occurred'})\n }", "title": "" }, { "docid": "672be330afee7695236c0cb87fcbb030", "score": "0.60463566", "text": "getAllSuccess(state, stations) {\n state.all = {items: stations}\n }", "title": "" }, { "docid": "c1394d670f7f68feb46bed4198b79c24", "score": "0.6016301", "text": "updateExplore(callback){\n this.setState({'count':0});\n if(callback == 'empty'){\n console.log('NO POLICIES');\n }\n else{ \n var data = JSON.parse(callback);\n var policies = data['policies'];\n this.state.policies = policies;\n for(var i = 0; i < policies.length; i++) {\n this.state.coverage[i] = policies[i]['policy_color'];\n this.state.coverageId[i] = policies[i]['id'];\n this.state.coverageDesc[i] = policies[i]['desc'];\n }\n }\n this.addUser();\n }", "title": "" }, { "docid": "aa0ce3c9d1dec846a917f21eb4e0ac7f", "score": "0.59957165", "text": "async getData() {\n const { node } = this.props\n /* sets state for number of tasks active/completed if call was successful */\n const { targets } = (await callApi(`nodes/stats/completed?node=${node.node_name}`)).json\n if (targets !== null && targets !== undefined) {\n this.setState({ active: targets.active })\n this.setState({ completed: targets.completed })\n }\n\n /* sets state for historic data if */\n const { json } = await callApi(`nodes/stats/status?node=${node.node_name}`)\n if (json !== null && json !== undefined && json.filteredStats !== null\n && this.state.historicData !== json.filteredStats) {\n this.setState({ historicData: json.filteredStats })\n }\n }", "title": "" }, { "docid": "faadda078fdc1518ccb7130f01e3d21d", "score": "0.5994397", "text": "callFHAsettinsapi() {\r\n\t\tcallPostApi(GLOBAL.BASE_URL + GLOBAL.fha_va_usda_setting_api, {\r\n\t\t\tuser_id: this.state.user_id, company_id: this.state.company_id, loan_type: \"FHA\", calc_type: \"Buyer\", zip: this.state.postal_code\r\n\t\t}, this.state.access_token)\r\n\t\t\t.then((response) => {\r\n\r\n\t\t\t\tconsole.log(\"fha_va_usda_setting_api callFHAsettinsapi \" + JSON.stringify(result));\r\n\r\n\t\t\t\tif (this.state.taxservicecontractFixed == false) {\r\n\t\t\t\t\ttaxservicecontract = result.data.FHA_TaxServiceContract;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttaxservicecontract = this.state.taxservicecontract;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.underwritingFixed == false) {\r\n\t\t\t\t\tunderwriting = result.data.FHA_Underwriting;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tunderwriting = this.state.underwriting;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.processingfeeFixed == false) {\r\n\t\t\t\t\tprocessingfee = result.data.FHA_ProcessingFee;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessingfee = this.state.processingfee;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.appraisalfeeFixed == false) {\r\n\t\t\t\t\tappraisalfee = result.data.FHA_AppraisalFee;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tappraisalfee = this.state.appraisalfee;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.documentprepFixed == false) {\r\n\t\t\t\t\tdocumentprep = result.data.FHA_DocumentPreparation;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdocumentprep = this.state.documentprep;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\ttaxservicecontract: taxservicecontract,\r\n\t\t\t\t\tunderwriting: underwriting,\r\n\t\t\t\t\tprocessingfee: processingfee,\r\n\t\t\t\t\tappraisalfee: appraisalfee,\r\n\t\t\t\t\tdocumentprep: documentprep,\r\n\t\t\t\t\toriginationfactor: result.data.FHA_OriginationFactor,\r\n\t\t\t\t\toriginationFactorType: result.data.FHA_OriginationFactorType,\r\n\t\t\t\t}, this.callSalesPr);\r\n\t\t\t});\r\n\t}", "title": "" }, { "docid": "a1bf4b20499f15b22842008665ad8956", "score": "0.5968886", "text": "componentDidMount() {\n Api.getList().then((result: ApiResponse) => {\n this.setState((prevState: State) => ({\n items: result.results,\n }))\n });\n }", "title": "" }, { "docid": "40791597c088b7b68b282decd13889aa", "score": "0.5958504", "text": "setData(){\n // A variable that will hold the ip of the localhost\n var ip = 'http://localhost:3000/data';\n\n // Variables that will temporary hold the api data to transfer to the particular sstate\n var tempAdvertiserData = new Array();\n var tempPhotographerData = new Array();\n var tempJournalistData = new Array();\n\n // Fetches all the data from the API\n fetch(ip).then((response) => response.json())\n .then((responseJson) => {\n for(var i = 0; i < responseJson.length; i++){\n \n // Pushes the current object in an array depending on the responseJson[i].type\n switch(responseJson[i].type){ \n case \"Advertiser\":\n tempAdvertiserData.push(responseJson[i]);\n break;\n\n case \"Photographer\":\n tempPhotographerData.push(responseJson[i]);\n break;\n\n case \"Journalist\":\n tempJournalistData.push(responseJson[i]);\n break\n }\n }\n\n // Put data in a particular data\n this.setState({\n advertiserData: tempAdvertiserData,\n journalistData: tempJournalistData,\n photographerData: tempPhotographerData\n });\n })\n .catch((error) => {\n console.error(error);\n });\n }", "title": "" }, { "docid": "1093491bcd9bcc84e51893318e9ab1db", "score": "0.5926159", "text": "callApiOnce(apiPhrase){\n return (axios.get(apiUrl+apiPhrase, {}).then(response => {\n if (response.status === 200){\n this.setState({\n state: response.data\n });\n return Promise.resolve(response.data);\n }else{\n return Promise.reject(response);\n } \n }))\n }", "title": "" }, { "docid": "ae523b205c64a097b861b94678aa0728", "score": "0.59204936", "text": "componentDidMount(){\n this.state.points.forEach(pointer=>{\n fetch(getUrl(pointer.lat,pointer.lng)).then(response=>{\n return response.json();\n }).then((data)=>{\n this.state.info.push({data:data.response,pointer : {...pointer}});\n });\n });\n console.log(this.state.info);\n \n }", "title": "" }, { "docid": "cef37ef864018d03fb8400a8cbdd160d", "score": "0.5917337", "text": "getStateRep() {\n API.getStateReps(\"Representative\", this.state.userState)\n .then(res =>\n // Set the state representatives array so the page will be updated\n this.setState({ representatives: res.data }))\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "8b6901aeb225fdf2b365a7fcca4c4fb8", "score": "0.5912509", "text": "callUSDAsettinsapi() {\r\n\t\tcallPostApi(GLOBAL.BASE_URL + GLOBAL.fha_va_usda_setting_api, {\r\n\t\t\tuser_id: this.state.user_id, company_id: this.state.company_id, loan_type: \"USDA\", calc_type: \"Buyer\", zip: this.state.postal_code\r\n\t\t}, this.state.access_token)\r\n\t\t\t.then((response) => {\r\n\r\n\t\t\t\tconsole.log(\"fha_va_usda_setting_api callUSDAsettinsapi \" + JSON.stringify(result));\r\n\r\n\t\t\t\tif (this.state.taxservicecontractFixed == false) {\r\n\t\t\t\t\ttaxservicecontract = result.data.USDA_TaxServiceContract;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttaxservicecontract = this.state.taxservicecontract;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.underwritingFixed == false) {\r\n\t\t\t\t\tunderwriting = result.data.USDA_Underwriting;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tunderwriting = this.state.underwriting;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.processingfeeFixed == false) {\r\n\t\t\t\t\tprocessingfee = result.data.USDA_ProcessingFee;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessingfee = this.state.processingfee;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.appraisalfeeFixed == false) {\r\n\t\t\t\t\tappraisalfee = result.data.USDA_AppraisalFee;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tappraisalfee = this.state.appraisalfee;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.documentprepFixed == false) {\r\n\t\t\t\t\tdocumentprep = result.data.USDA_DocumentPreparation;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdocumentprep = this.state.documentprep;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\ttaxservicecontract: taxservicecontract,\r\n\t\t\t\t\tunderwriting: underwriting,\r\n\t\t\t\t\tprocessingfee: processingfee,\r\n\t\t\t\t\tappraisalfee: appraisalfee,\r\n\t\t\t\t\tdocumentprep: documentprep,\r\n\t\t\t\t\toriginationfactor: result.data.USDA_OriginationFactor,\r\n\t\t\t\t\t//originationFactorType : result.data.userSetting.originationFactorType,\r\n\t\t\t\t}, this.callSalesPr);\r\n\t\t\t});\r\n\t}", "title": "" }, { "docid": "a647e7f0aed03179e51f274ba7045412", "score": "0.58976424", "text": "_requestData() {\n const { token, userId } = AuthStore.getState();\n const { filters, sorters, config } = this.props;\n\n GroupActions.getUserGroupList(token, userId);\n LessonActions.getUserLessonList(token, userId, filters, sorters, config);\n }", "title": "" }, { "docid": "d388b60c1d380853bfa870b51c825c5c", "score": "0.5891565", "text": "function addSeverDataToState() {\n fetch(\"http://localhost:3000/products\")\n .then(function (response) {\n return response.json();\n })\n .then(function (items) {\n state.items = items;\n render();\n console.log(state.items);\n });\n}", "title": "" }, { "docid": "1fc246ef026789fc936fe3230065dfe8", "score": "0.5882433", "text": "getBtcBook(){\n var arrayParams=[];\n var objParam={param:'', value:''}\n objParam.param='book';\n objParam.value=SERVICE_REQUEST.book_btc_mx;\n arrayParams.push(objParam);\n callGetService(URL_SERVICES.Ticker,arrayParams).then(response => {\n this.setState({btcMxn:response.payload.last,book_btc_mx:response})\n }\n );\n\n}", "title": "" }, { "docid": "c1ffd52305bd4735879652f5ad1f8afd", "score": "0.58795005", "text": "cb(results, status) {\n this.setState({\n places: results,\n status: status\n });\n }", "title": "" }, { "docid": "becf6dbf6a95f53c0d984217fe79763a", "score": "0.5879233", "text": "onApiData(builds) {\n this.setState({ builds });\n }", "title": "" }, { "docid": "7960c13e935199e1aa83ccbce5831ab1", "score": "0.5866563", "text": "callVAsettinsapi() {\r\n\t\tcallPostApi(GLOBAL.BASE_URL + GLOBAL.fha_va_usda_setting_api, {\r\n\t\t\tuser_id: this.state.user_id, company_id: this.state.company_id, loan_type: \"VA\", calc_type: \"Buyer\", zip: this.state.postal_code\r\n\t\t}, this.state.access_token)\r\n\t\t\t.then((response) => {\r\n\r\n\t\t\t\tconsole.log(\"fha_va_usda_setting_api callVAsettinsapi \" + JSON.stringify(result));\r\n\r\n\t\t\t\tif (this.state.taxservicecontractFixed == false) {\r\n\t\t\t\t\ttaxservicecontract = result.data.VA_TaxServiceContract;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttaxservicecontract = this.state.taxservicecontract;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.underwritingFixed == false) {\r\n\t\t\t\t\tunderwriting = result.data.VA_Underwriting;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tunderwriting = this.state.underwriting;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.processingfeeFixed == false) {\r\n\t\t\t\t\tprocessingfee = result.data.VA_ProcessingFee;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessingfee = this.state.processingfee;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.appraisalfeeFixed == false) {\r\n\t\t\t\t\tappraisalfee = result.data.VA_AppraisalFee;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tappraisalfee = this.state.appraisalfee;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.documentprepFixed == false) {\r\n\t\t\t\t\tdocumentprep = result.data.VA_DocumentPreparation;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdocumentprep = this.state.documentprep;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\ttaxservicecontract: taxservicecontract,\r\n\t\t\t\t\tunderwriting: underwriting,\r\n\t\t\t\t\tprocessingfee: processingfee,\r\n\t\t\t\t\tappraisalfee: appraisalfee,\r\n\t\t\t\t\tdocumentprep: documentprep,\r\n\t\t\t\t\toriginationfactor: result.data.VA_OriginationFactor,\r\n\t\t\t\t\toriginationFactorType: result.data.VA_OriginationFactorType,\r\n\t\t\t\t}, this.callSalesPr);\r\n\t\t\t});\r\n\t}", "title": "" }, { "docid": "8e2b98e95a4659e95df3fb81794f004b", "score": "0.5863308", "text": "requestUpdateIndividualState(){\n pool.notifyIndividualState(this)\n }", "title": "" }, { "docid": "938f6e6ff4665e1865ad5eab1942385a", "score": "0.58531946", "text": "updateComponentState() {\n this.callService()\n .then(res => {\n let newState = {\n data: res.body,\n isError: false,\n allPapers: this.props.q.findAll,\n paperId: this.props.q.paperId\n }\n this.setState(newState)\n })\n .catch(err => {\n let newState = {\n data: err.response.body,\n isError: true,\n allPapers: this.props.q.findAll,\n paperId: this.props.q.paperId\n }\n this.setState(newState)\n })\n }", "title": "" }, { "docid": "44787bbb61766df642671cadb2a4a6d3", "score": "0.58457905", "text": "constructor(props) {\n super(props);\n this.state = {\n isLoaded: false,\n coinList: null,\n portfolio: [],\n }\n this.getApiData = this.getApiData.bind(this);\n this.fsyms = '';\n \n }", "title": "" }, { "docid": "9253e8a2e024c74c0162b61435585412", "score": "0.58363575", "text": "componentWillMount(){\n // .... .and make the request\n request\n .get('https://randomuser.me/api/?results=50')\n .then((apiRes)=>{\n // (APIS--3) when the data returns, set the component'\n // state w/ the new data\n this.setState({\n userList : apiRes.body.results\n })\n })\n }", "title": "" }, { "docid": "309ade00356d128517269b2238087e9e", "score": "0.5832436", "text": "constructor(props){\n super(props);\n this.state = {\n currencies: [],\n conversions: [],\n curConv: [],\n filtered: [],\n search: ''\n };\n this.makeAPICall = this.makeAPICall.bind(this);\n this.filterTable = this.filterTable.bind(this);\n }", "title": "" }, { "docid": "e6f2b6eab04ecbe8690d3a4ceab45a0d", "score": "0.58310914", "text": "setRequestState (result) {\n\t\t\tthis.setState({fetchOK : result.ok});\n\t\t\tthis.setState({fetchStatus : result.status});\n\t}", "title": "" }, { "docid": "ada343d288073aa7e01c50896aba20a7", "score": "0.58248824", "text": "getStateSen() {\n API.getStateReps(\"Senator,\", this.state.userState)\n .then(res =>\n // Set the state representatives array so the page will be updated\n this.setState({ representatives: res.data }))\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "1cb61051d5f9f2c1197088a4e502200e", "score": "0.5814534", "text": "getUserInvites(){\r\n\r\n //API call\r\n API.get('Businesses', '/items/inviteConnections')\r\n .then(apiResponse => {\r\n //console.log(apiResponse);\r\n this.setState({\r\n userInvites: apiResponse, //Place results in state\r\n });\r\n //console.log(this.state.userInvites); //Full\r\n })\r\n .then(() => {\r\n //Call convertContacts to set found property if invite exists\r\n this.convertContacts();\r\n //this.getUserConverts(); //Used with below to capture converted.\r\n })\r\n .catch(err => alert('error getting current user invites...:'+err));\r\n }", "title": "" }, { "docid": "44911a3da13d02c86d4b2632da006d2a", "score": "0.5812222", "text": "getRequests () {\r\n fetch('/api/requests')\r\n .then(res => {\r\n if (!res.ok) {\r\n throw error (res.statusText);\r\n }\r\n res.json()\r\n .then(data => {\r\n //update the requestsList with the data received\r\n this.setState({ requestsList: data })\r\n })\r\n })\r\n .catch(err => console.log(err))\r\n }", "title": "" }, { "docid": "9aac137d56cea6b4a13c9b3572ef7cd0", "score": "0.581196", "text": "async function apiCaller(state){\n\n // checking which rover has been chosen\n const nameParam = state._root.entries[0][1]\n\n // calling the server (index.js) with the chosen rover and imageDates value as params.\n const res = await fetch(`http://localhost:3000/rovers?name=${nameParam}&date=${state._root.get('imageDate')}`)\n\n const data = await res.json()\n\n // Once the reponse has been received from the server (index.js) run the following function \n // to make sure the state.data.photos is not []\n let temp = Object.assign(checkData(data))\n \n return temp\n}", "title": "" }, { "docid": "dee71e69be6dfa3bc3262eb4be2d8488", "score": "0.5810557", "text": "componentWillMount(){\n // for add-remove states(JSON objs)\n // from addState.js,project.js,projectStates.js\n this.getStates();\n // for API todo list from fakeJSON API\n this.getToDos();\n }", "title": "" }, { "docid": "3247717d42e397fdc4d2185166b3a6c4", "score": "0.58063245", "text": "setRequestState (result) {\n\t\t\tthis.setState({fetchOK : result.ok});\n\t\t\tthis.setState({fetchStatus : result.status});\n\t\t\tthis.setState({fetchRespType : result.type});\n\t\t\tthis.setState({fetchContType : result.headers.get('Content-Type')});\n\t\t\tthis.setState({fetchContLength : result.headers.get('Content-Length')});\n\t}", "title": "" }, { "docid": "eee8554f0484fbed322baa816bee294d", "score": "0.5804611", "text": "doCoordHits(state, lat, lon){\n \tvar closestcity = getClosestCity(lat, lon);\n \tvar {dbX, dbY} = this.getDBCoords(); \n\tthis.setState({\n\t\tlatitude: Math.floor(lat),\n\t\tlongitude: Math.floor(lon),\n\t\tclosestCity: closestcity\n\t});\n\t\n\t/* Filter and do db hit here */\n\tif(dbX <= 360 && dbX >= 1 && dbY <= 180 && dbY >= 1){\n\t\tvar intermediate, intermediate1, intermediate2;\n\t\tif(state === 0){\n\t\t\tintermediate = dbUrl.concat(\"precipavg/coord/\");\n\t\t\tintermediate1 = dbUrl.concat(\"precip001/coord/\");\n\t\t\tintermediate2 = dbUrl.concat(\"precip002/coord/\");\n\t\t}\n\t\telse if(state === 1){\n\t\t\tintermediate = dbUrl.concat(\"tempavg/coord/\");\n\t\t\tintermediate1 = dbUrl.concat(\"temp001/coord/\");\n\t\t\tintermediate2 = dbUrl.concat(\"temp002/coord/\");\n\t\t}\n\t\telse if(state === 2){\n\t\t\tintermediate = dbUrl.concat(\"seaiceavg/coord/\");\n\t\t\tintermediate1 = dbUrl.concat(\"seaice001/coord/\");\n\t\t\tintermediate2 = dbUrl.concat(\"seaice002/coord/\");\n\t\t}\n\t\tvar request = intermediate.concat(dbX.toString(10)).concat(\",\").concat(dbY.toString(10)).concat(\".txt\");\n\t\tconsole.log(request);\n\t\tthis.setState({waiting: 3});\n\t\tthis.coordApi(request);\n\t\trequest = intermediate1.concat(dbX.toString(10)).concat(\",\").concat(dbY.toString(10)).concat(\".txt\");\n\t\tthis.coordApi1(request);\n\t\trequest = intermediate2.concat(dbX.toString(10)).concat(\",\").concat(dbY.toString(10)).concat(\".txt\");\n\t\tthis.coordApi2(request);\n\t}\n }", "title": "" }, { "docid": "b813d9d2ce64eccebd3f0af87a2fb8f6", "score": "0.580366", "text": "getItems() {\n axios.get(APP_URL + '/app', {\n headers: {Authorization: 'Bearer ' + localStorage.getItem('token')}\n })\n .then(response => response.data)\n //update apps state with apps retrieved by request\n .then(items => {\n if (items !== null) {\n this.setState({items: items})\n }\n })\n .catch(err => console.log(err))\n }", "title": "" }, { "docid": "63c502a6ea93f0f84342c16257911a4c", "score": "0.57931256", "text": "constructor(props){\n super(props);\n this.state = {\n apiResponse: [],\n status: \"loading\",\n currentImageSize:[0,0],\n };\n }", "title": "" }, { "docid": "338213d87b9e19469ae43a7f6df0ab81", "score": "0.5786602", "text": "getExchangeRates() {\n axios\n .get('https://api.exchangerate-api.com/v4/latest/USD')\n .then((response) => {\n // console.log(response);\n this.setState({\n date: response.data.date,\n baseCurrency: response.data.base,\n rates: response.data.rates\n });\n this.extractListOfCurrencies();\n });\n }", "title": "" }, { "docid": "4235727fc32b86a228d5fce7a3a7711a", "score": "0.5783011", "text": "getBooksAPI() {BooksAPI.getAll()\n .then(allBooks => {\n this.setState({ allBooks})\n \n });\n }", "title": "" }, { "docid": "0d09405960777ced607b0f748373d121", "score": "0.5780311", "text": "_requestList(type, settings) {\n // store api url\n let url;\n \n if (type === 'nowplaying') {\n // request top 10 now playing movie list from TMDb api\n url = `${api.tmdbURL}/${api.nowPlaying}&${settings}`;\n\n fetch(url)\n .then(res => res.json())\n .then(data => {\n const topTen = [];\n for (let i = 0, l = 10; i < l; i++) {\n topTen.push(data.results[i]);\n }\n this.setState({\n movies: topTen\n });\n }).then( this._removeLoader);\n } else if (type === 'search') {\n // request search result of keyword from TMDb api\n url = `${api.tmdbURL}/${api.movieSearch}&${settings}`;\n\n fetch(url)\n .then(res => res.json())\n .then(data => this.setState({ movies: data.results }))\n .then(this._removeLoader);\n } else {\n console.error('need to mention type');\n }\n }", "title": "" }, { "docid": "764f1fdc391ad14e85dd98bd341d0109", "score": "0.57802004", "text": "callAPI(){\n fetch(\"http://localhost:9000\")\n .then(res => res.text())\n .then(res => this.setState({ apiResponse: res }));\n }", "title": "" }, { "docid": "eab3c1e3200b13be7eef30d9bef555df", "score": "0.57797474", "text": "componentDidMount() {\n axios.get(`/api`)\n .then(res => {\n const items = res.data;\n this.setState({ items });\n console.log(\"See Below\");\n })\n\n axios.get(`/api/Fundraisers`)\n .then(res => {\n const funds = res.data;\n this.setState({ funds });\n })\n }", "title": "" }, { "docid": "98b46abf8f840699b05e484682c80ba1", "score": "0.5777239", "text": "fetchAll(){\n /* Promise.all(urls.map(obj => fetch(obj.url)\n .then(response => response.json())\n .then(response => this.setState({obj.name :response}))\n .catch(e => e)\n )); */\n fetch('http://localhost/acmeproducts/api/read_all_products.php')\n .then(response => response.json())\n .then(response => this.setState({products:response}))\n .catch(e => e);\n fetch('http://localhost/acmeproducts/api/read_all_categories.php')\n .then(response => response.json())\n .then(response => this.setState({category:response}))\n .catch(e => e);\n }", "title": "" }, { "docid": "bf6b7621a19ad68a154bc03bc058d219", "score": "0.577696", "text": "emulateOldStateFormat () {\n let oldState = {};\n\n let x = (type) => {\n if (!oldState[type]) {\n oldState[type] = {\n running: [],\n pending: [],\n spotReq: [],\n };\n }\n };\n\n for (let instance of this.__apiState.instances) {\n x(instance.WorkerType);\n oldState[instance.WorkerType][instance.State.Name].push(instance);\n }\n\n for (let request of this.__apiState.requests) {\n x(request.WorkerType);\n oldState[request.WorkerType].spotReq.push(request);\n }\n\n return oldState;\n }", "title": "" }, { "docid": "7465dfab26dedea8c50538f55aede026", "score": "0.5769402", "text": "update () {\n $.ajax({\n method: 'GET',\n url: '/repos',\n success: results => {\n this.setState({\n repos: results\n });\n }\n });\n $.ajax({\n method: 'GET',\n url: '/users',\n success: results => {\n this.setState({\n users: results\n });\n }\n });\n }", "title": "" }, { "docid": "97e6a80f24591505d58c651e8b8c3f6b", "score": "0.57609385", "text": "getData() {\n //Specifies which id number in the JSON array it should fetch\n let indexArr = [1, 2, 3];\n let data = getDataFromJson(indexArr);\n this.setState({ data: data });\n }", "title": "" }, { "docid": "59c4b3dece3fd6e5e9d4cc32d1fc6925", "score": "0.5749201", "text": "componentWillMount() {\n const context = this;\n this.setState({\n loaded: false\n });\n\n //loops through each city select by the moodselector and does a post request to the express route\n this.props.cities.forEach(function(cityObj){\n context.searchFlights(context.props.constraints[0], cityObj, function(flights) {\n context.props.setFlights(flights);\n });\n });\n\n }", "title": "" }, { "docid": "d7d19acdcd300f9470e62e4c4a4a5aae", "score": "0.5748303", "text": "async componentDidMount() {\n const { data: inProgressJobs } = await Axios.get(\n \"http://ec2-54-152-230-158.compute-1.amazonaws.com:7999/api/capture/status\"\n );\n const { data: captureDomains } = await Axios.get(\n \"http://ec2-54-152-230-158.compute-1.amazonaws.com:7999/api/play\"\n );\n\n const { data: captureJobs } = await Axios.post(\n \"http://ec2-54-152-230-158.compute-1.amazonaws.com:7999/api/play/status\"\n );\n\n //Set the states\n this.setState({ inProgressJobs });\n this.setState({ captureJobs });\n this.setState({ captureDomains });\n console.log(captureJobs);\n }", "title": "" }, { "docid": "4c1416900db3c2526984aada1699b662", "score": "0.57465625", "text": "fetchAPI(numero){\n console.log(numero)\n\n getData(numero)\n .then(resultsImportados =>{\n console.log(resultsImportados);\n this.setState({items: [...this.state.items, ...resultsImportados], originales: [...resultsImportados]})\n })\n}", "title": "" }, { "docid": "81d31a5750737b2baff16a4f1998701a", "score": "0.5738776", "text": "fetchAnotherGithub() {\n this.getOtherUrl();\n let url = this.state.url;\n Axios.get(url)\n .then(response => {\n var info = response.data.items;\n this.setState({\n list: this.state.list.concat([...info]),\n fetchInProgress: false\n });\n })\n .catch(error => {\n console.log(error);\n this.setState({\n error: true\n });\n });\n }", "title": "" }, { "docid": "3cda9eaf2a7f00cd1e9be5134b4e0d22", "score": "0.57289916", "text": "constructor(){\n ProxyState.on(\"lists\", saveState)\n }", "title": "" }, { "docid": "47f68562afefc7845bc36eaf8766fb03", "score": "0.5727311", "text": "componentDidMount() {\n axios.get('track')\n .then((res)=>{\n const values = JSON.parse(res.data['tracks']);\n\n for (let i= 0;i<values.length;i++){\n this.setState(prevState=>({\n track: prevState.track.concat(values[i]['fields'])\n }));\n }\n\n })\n .catch((error)=>{\n console.log(error)\n })\n }", "title": "" }, { "docid": "04a53feac39b800ba255dfe21b5bf0c0", "score": "0.57251626", "text": "constructor(props){\n super(props);\n this.state = {\n pending_requests: {},\n }\n }", "title": "" }, { "docid": "51a3ed5730242ae3d3e8fe570510eb69", "score": "0.57217324", "text": "constructor(props) {\n super(props);\n this.state = {\n outgoing: [],\n books: [],\n incoming: [],\n incomingAccepted: [],\n }\n \n this.getUserBooks = this.getUserBooks.bind(this);\n this.getIncoming = this.getIncoming.bind(this);\n }", "title": "" }, { "docid": "3c38311272b5d7849c85855b762b2b7a", "score": "0.5721163", "text": "fetchRepos(lang) {\n this.setState( {\n loading: true,\n } )\n //Here the data is fetched from the api and the loading state and repos array are updated:\n window.API.fetchPopularRepos(lang)\n .then((repos) => {\n this.setState( {\n loading: false,\n repos,\n } )\n } )\n }", "title": "" }, { "docid": "70a7374d22bdeaae47f1b96a5f9fdc7a", "score": "0.57211566", "text": "function getStateData(state) {\n const location = 'US-' + state;\n const statsUrl = searchStatsURL + location + '/';\n const newsUrl = searchNewsURL + location + '/';\n\n const options = {\n headers: new Headers({\n 'x-rapidapi-key': '0b0af2a8e1msh81bdee91f1b3cd3p1a38f0jsnef494e8e55c3',\n 'x-rapidapi-host': 'coronavirus-smartable.p.rapidapi.com',\n }),\n };\n\n const urls = [statsUrl, newsUrl];\n\n Promise.all(\n urls.map((url) =>\n fetch(url, options)\n .then((response) => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .catch((err) => {\n // hide any results\n $('.state-results-container').addClass('hidden');\n\n // empty error message\n $('#js-error-message').empty();\n\n // add error message\n $('#js-error-message').text(`Something went wrong: ${err.message}`);\n\n // show error message\n $('.error-container').removeClass('hidden');\n })\n )\n ).then((data) => {\n // move header to the top of the page\n $('header').addClass('top');\n\n // send data to get state results\n displayStateResults(data);\n\n // variable for county information\n const countyList = data[0].stats.breakdowns;\n\n //if there are counties send them to county forma and watch the county form; otherwise, hide the county container\n if (countyList.length !== 0) {\n $('.county-container').removeClass('hidden');\n createCountyForm(countyList);\n watchCountyForm(countyList);\n } else {\n $('.county-container').addClass('hidden');\n }\n });\n}", "title": "" }, { "docid": "87428ec99cc7a5befbd19304ab3a7ee0", "score": "0.571955", "text": "componentDidMount(){\n this.apiCall(this.state.city)\n }", "title": "" }, { "docid": "04a5294fb197078ae535e49f16b1145e", "score": "0.57183874", "text": "componentDidMount() {\n\t\t/**\n\t\t * Receive brands and put it into current state\n\t\t */\n\t\tconst carmakersData = api({request: 'carmakers'});\n\t\tcarmakersData.then(result => {\n\t\t\tthis.setState({carMakers: result});\n\t\t});\n\n\t\t/**\n\t\t * Receive cars and put it into current state\n\t\t */\n\t\tconst autoData = api({request: 'auto'});\n\t\tautoData.then(result => {\n\t\t\tthis.setState({cars: result.cars});\n\t\t});\n\t}", "title": "" }, { "docid": "1f08ec0d831382a30bb765244ce61779", "score": "0.5718105", "text": "componentDidMount() {\n getData(this.user, this.endpoint).then((response) => {\n this.setState(response);\n });\n }", "title": "" }, { "docid": "c246ebb1d1561abec1ec70b63b131e23", "score": "0.57180923", "text": "fetchTwitchData(featured, games, channels) {\n\n all([api.get(featured), api.get(games), api.get(channels)]).then(\n res => {\n var featured = res[0].data.data;\n var games = res[1].data.data;\n var channels = res[2].data.data;\n\n this.setState({\n games,\n featured,\n channels,\n loader: false,\n currentStream: featured[0]\n });\n }\n )\n }", "title": "" }, { "docid": "caf50e15ea7d061581017b73c1f71670", "score": "0.5715885", "text": "getSensorList() {\n axios\n .get(\"http://localhost:5000/api/sensor\")\n .then((response) => {\n this.setState({sensors: [...response.data]});\n console.log(\"response\");\n })\n .catch((err) => {\n console.log(`error is ${err}`);\n });\n }", "title": "" }, { "docid": "30955039f501c9472fe5cdba347b854c", "score": "0.57156944", "text": "updatePieceStat() {\n axios\n .get(\"/game/getplayeronepiece\")\n .then(res => this.setState({ PlayerAStat: res.data }));\n axios\n .get(\"/game/getplayertwopiece\")\n .then(res => this.setState({ PlayerBStat: res.data }));\n }", "title": "" }, { "docid": "19f682c4d0f1bb54c43cc9337c93cba3", "score": "0.57105047", "text": "getContainers() {\n this.service.get()\n .then((response) => {\n const newState = Object.assign({}, this.state, {\n containers : response.data.data\n });\n this.setState(newState);\n })\n }", "title": "" }, { "docid": "41b3dc2afc69c0a5013a7e9ecf9dc5f5", "score": "0.5705432", "text": "fetchSearchResults(query) {\n const url = `http://localhost:5500/plant/trefle/${query}`;\n\n //if cancel token exists then call cancel to cancel prev request\n if (this.cancel){\n this.cancel.cancel();\n }\n\n //then sets up a new token \n this.cancel = axios.CancelToken.source();\n //and make a new request to the api\n axios.get(url,{cancelToken: this.cancel.token})\n .then((res)=>{\n const noResult = !res.data ? 'No Results' :'';\n const allResults = [];\n //loop through api results and set to state\n for (let i in res.data) {\n console.log(res.data[i] )\n let eachItem = {id: res.data[i]['id'], common_name: res.data[i]['common_name']};\n allResults.push(eachItem);\n }\n this.setState({\n results: allResults,\n message: noResult,\n loading: false\n }, ()=>{\n console.log('results state set')\n })\n })\n .catch((error)=> {\n if (axios.isCancel(error)){\n console.log('Request cancelled ' + error )\n }else{\n console.log('Network Error '+ error )\n }\n })\n\n\n }", "title": "" }, { "docid": "ba555fa1cabcb5307c66173695a6ae7b", "score": "0.57051814", "text": "function getCurrentState(callback) {\n stateRequestWaterfall(function(err,result) {\n async.mapSeries(result, addFaxInfo, callback);\n });\n}", "title": "" }, { "docid": "4ec8690203c0700cf1b403b4f4fc044f", "score": "0.57044584", "text": "componentWillMount() {\n axios.post(`https://mariposa.jtinker.org/api/user/events/hosting`, {username:'justin', password:'password'})\n .then(res => {\n const hostingEvents = res.data;\n this.setState({ hostingEvents });\n })\n axios.post(`https://mariposa.jtinker.org/api/user/events/invited`, {username:'justin',password:'password'})\n .then(res => {\n const privateUsrEvents = res.data;\n this.setState({ privateUsrEvents });\n })\n }", "title": "" }, { "docid": "a3c5b4b26f4ac4b871011ea22f00e3f9", "score": "0.57000786", "text": "async getData() {\n const info = await axios.get(\"https://api.covid19api.com/summary\");\n const countries = info.data.Countries\n const global = info.data.Global\n this.setState( {\n confirmed: global.TotalConfirmed,\n recovered: global.TotalRecovered,\n deaths: global.TotalDeaths,\n newConfirmed: global.NewConfirmed,\n newRecovered: global.NewRecovered,\n newDeaths: global.NewDeaths,\n date: null,\n country: \"Global\",\n countries\n });\n }", "title": "" }, { "docid": "ca7d19c5cc04349ba1e8b51afb10ea84", "score": "0.56953126", "text": "handleContactRequest(id, status) {\n this.setState(state => {\n //TODO: Remove placeholder logic when fetching real data\n for (let i = 0; i < state.testProfiles.length; i++) {\n if (state.testProfiles[i].id === id) {\n state.testProfiles[i].connectionStatus = status;\n if (status === 'noContact') {\n state.testProfiles.splice(i, 1);\n }\n break;\n }\n }\n for (let i = 0; i < state.pendingRequests.length; i++) {\n if (state.pendingRequests[i].id === id) {\n state.pendingRequests[i].connectionStatus = status;\n if (status === 'contact') {\n state.networkUsers.push(state.pendingRequests[i]);\n }\n state.pendingRequests.splice(i, 1);\n break;\n }\n }\n return {\n ...state\n };\n });\n }", "title": "" }, { "docid": "946bb92ee346d3d2b37442eaa7222a98", "score": "0.5693356", "text": "async getCounteriesDetail() {\n //loading set to true till\n this.setState({ loading: true });\n try {\n //make an http call\n const res = await axios.get(\"https://corona.lmao.ninja/v2/countries\");\n // console.log(res);\n //After getting data set the result\n this.setState({ data: res.data });\n\n const pushCountry = [];\n var count = 0;\n for (var i in this.state.data) {\n // console.log(this.state.data[i].country);\n pushCountry.push({ name: this.state.data[i].country });\n count++;\n }\n this.setState({ count });\n this.setState({ countries: pushCountry });\n //After getting data loading remains false\n\n this.setState({ loading: false });\n // const {countries} =this.state;\n // console.log(typeof countries, typeof res, res);\n } catch (error) {\n //Set loading to true if response fails\n this.setState({ loading: true });\n console.log(error);\n }\n // console.log(res.data);\n // console.log(res.data.cases);\n }", "title": "" }, { "docid": "5c6d82a94e0ab8f957efce1e166fc22d", "score": "0.5692431", "text": "componentDidMount() {\n // API.getPortfolioValue().then(((r) => {\n // this.setState({petfolioValue: r});\n // }));\n // API.getBankValue().then(((r) => {\n // this.setState({bankValue: r});\n // }));\n }", "title": "" }, { "docid": "0069dfd34befa4b0409f109eb1c4b348", "score": "0.5691814", "text": "constructor() {\n super()\n this.state = {\n isLoading: true,\n jsonFromServer: [],\n fetchingStatus: false,\n isSelected: [],\n }\n this.skip = 0\n }", "title": "" }, { "docid": "82ecb113243d7c2313684e63cb31f21d", "score": "0.56896895", "text": "constructor(props) {\n super(props);\n\n this.state = {\n //going to hold the response from the api\n cryptos: []\n };\n }", "title": "" }, { "docid": "9d247bfaf1a48aa1a02259f1841d87ca", "score": "0.5682822", "text": "_reconcileInternalState () {\n // Remove the SRs which AWS now tracks from internal state\n\n // TODO: This stuff is broken right now\n let now = new Date();\n\n // We need to know all the SpotInstanceRequestIds which are known\n // to aws state. This is mostly just the id from the requests\n let allKnownSrIds = this.knownSpotInstanceRequestIds();\n\n this.__internalState = this.__internalState.filter(request => {\n // We want to print out some info!\n if (_.includes(allKnownSrIds, request.request.SpotInstanceRequestId)) {\n // Now that it's shown up, we'll remove it from the internal state\n debug('Spot request %s for %s/%s/%s took %d seconds to show up in API',\n request.request.SpotInstanceRequestId, request.request.Region,\n request.request.LaunchSpecification.Placement.AvailabilityZone,\n request.request.LaunchSpecification.InstanceType,\n (now - request.submitted) / 1000);\n this.reportEc2ApiLag({\n provisionerId: this.provisionerId,\n region: request.request.Region,\n az: request.request.LaunchSpecification.Placement.AvailabilityZone,\n instanceType: request.request.LaunchSpecification.InstanceType,\n workerType: request.request.WorkerType,\n id: request.request.SpotInstanceRequestId,\n didShow: 0,\n lag: (now - request.submitted) / 1000,\n });\n return false;\n } else {\n debug('Spot request %s for %s/%s/%s still not in api after %d seconds',\n request.request.SpotInstanceRequestId, request.request.Region,\n request.request.LaunchSpecification.Placement.AvailabilityZone,\n request.request.LaunchSpecification.InstanceType,\n (now - request.submitted) / 1000);\n // We want to track spot requests which aren't in the API yet for a\n // maximum of 15 minutes. Any longer and we'd risk tracking these\n // forever, which could bog down the system\n\n if (now - request.submitted >= 15 * 60 * 1000) {\n this.reportEc2ApiLag({\n provisionerId: this.provisionerId,\n region: request.request.Region,\n az: request.request.LaunchSpecification.Placement.AvailabilityZone,\n instanceType: request.request.LaunchSpecification.InstanceType,\n workerType: request.request.WorkerType,\n id: request.request.SpotInstanceRequestId,\n didShow: 1,\n lag: (now - request.submitted) / 1000,\n });\n return false;\n } else {\n return true;\n }\n }\n });\n }", "title": "" }, { "docid": "2f53eea572a8f08841e3e89e9c6a31d4", "score": "0.56805974", "text": "chainInteractionRequest(fcn, projectName, key, value) {\n\n //Clean all states when calling a new requet\n this.setState({\n requestStatus: null,\n postResponse: null,\n getResponse: null,\n isLoading: true,\n });\n\n chainPostInteraction.chainPostInteractionService(fcn, projectName, key, null, value).then((chainResponse) => {\n\n this.setState({\n requestStatus : chainResponse.status,\n postResponse : chainResponse.data,\n isLoading: false,\n\n });\n\n this.resetInputs();\n\n }).catch(error => {\n\n //If an error occurs, show it on console.\n console.log(\"Error:\" + error.message);\n this.setState({\n isLoading: false,\n\n });\n\n this.resetInputs();\n\n });\n\n }", "title": "" }, { "docid": "49d2f570f43b29a52cc6efb1d7b49b6c", "score": "0.5678868", "text": "function channelState() {\n console.log(\"channel state api call: initializing\")\n var channellist = [];\n var channelid = live_event_map[pipSelector].primary_channel_id + \":\" + live_event_map[pipSelector].channel_region\n\n var param1 = \"awsaccount=master\";\n var param2 = \"&functiontorun=describeChannelState\"\n var param3 = \"&channelid=\"+channelid; // this needs to be full list of channel id's and regions\n var param4 = \"&maxresults=200\";\n var param5 = \"&bucket=\";\n var param6 = \"&input=\";\n var param7 = \"&follow=\";\n var url = apiendpointurl+\"?\"+param1+param2+param3+param4+param5+param6+param7\n\n var request = new XMLHttpRequest();\n request.open('GET', url, true);\n\n request.onload = function() {\n if (request.status === 200) {\n const state_data = JSON.parse(request.responseText);\n console.log(\"channel state api call response : \" + JSON.stringify(state_data))\n document.getElementById('channel_status').innerHTML = '<h3>Channel Status:</br>'+state_data.status+'</h3>'\n } else {\n error_message = \"Unable to get channel status\"\n document.getElementById('channel_status').innerHTML = '<h3>Channel Status:</br>'+error_message+'</h3>'\n // Reached the server, but it returned an error\n }\n }\n request.onerror = function() {\n console.error('An error occurred fetching the JSON from ' + url);\n };\n\n request.send();\n}", "title": "" }, { "docid": "0ea8db7b5cf3a864f657287f88552478", "score": "0.5661991", "text": "fetchBranches(repoUrl,repoName,repoId){\n this.setState(\n {\n branchList: [],\n currentRepo: repoName,\n currentRepoId: repoId,\n currentRepoUrl: repoUrl,\n branchVersionWindowOpen:false\n\n }\n );\n\n let data = {\n repoUrl : repoUrl,\n repoName : repoName,\n repoId : repoId\n };\n\n axios.post(getServer() + '/products/repos/branches', data\n ).then(\n (response) => {\n let datat = response.data;\n this.setState(\n {\n branchList: datat,\n branchVersionWindowOpen:false\n }\n );\n }\n )\n }", "title": "" }, { "docid": "f6a60e99c00ddf4716fa1eb5c4228a2d", "score": "0.56616056", "text": "fetchMetaData() {\n fetchOrnList()\n .then(\n (resp) => {\n if(resp) {\n let newState = {...this.state};\n newState.formData.orn.list = resp.ornList;\n this.setState(newState);\n }\n }\n )\n fetchCustomerMetaData().then(\n (resp) => {\n if(resp) {\n let newState = {...this.state};\n newState.formData.cname.list = resp.cnameList;\n newState.formData.gaurdianName.list = resp.gaurdianNameList;\n newState.formData.address.list = resp.addressList;\n newState.formData.place.list = resp.placeList;\n newState.formData.city.list = resp.cityList;\n newState.formData.pincode.list = resp.pincodeList;\n newState.formData.mobile.list = resp.mobileList;\n newState.formData.moreDetails.list = resp.moreDetailsList;\n this.setState(newState);\n }\n }\n )\n }", "title": "" }, { "docid": "95962e40be8c5b0aec8ee7413eedcacd", "score": "0.5659763", "text": "function loadSensorStates() {//Perform server request\r\n\r\n ComponentService.getAllComponentStates('sensors').then(function (statesMap) {\r\n //Iterate over all sensors in sensorList and update the states of all sensors accordingly\r\n for (let i in sensorList) {\r\n let sensorId = sensorList[i].id;\r\n sensorList[i].state = statesMap[sensorId];\r\n }\r\n }, function (response) {\r\n for (let i in sensorList) {\r\n sensorList[i].state = 'UNKNOWN';\r\n }\r\n NotificationService.notify(\"Could not retrieve sensor states.\", \"error\");\r\n }).then(function () {\r\n $scope.$apply();\r\n });\r\n }", "title": "" }, { "docid": "d1895727934c069499389ff9b1014180", "score": "0.5655726", "text": "async loadData() {\r\n let currentResponse = \"\";\r\n let forecastResponse = \"\";\r\n try {\r\n currentResponse = await fetch(`http://api.openweathermap.org/data/2.5/weather?id=${this.props.location}&APPID=${keys.weatherApi}&units=metric`);\r\n forecastResponse = await fetch(`http://api.openweathermap.org/data/2.5/forecast?id=${this.props.location}&APPID=${keys.weatherApi}&units=metric`);\r\n this.setState({\r\n currentJSON: await currentResponse.json(),\r\n forecastJSON: await forecastResponse.json()\r\n })\r\n this.modifyState();\r\n }\r\n catch (error) {\r\n console.log(error);\r\n return (`Problem calling OpenweatherAPI.`);\r\n }\r\n }", "title": "" }, { "docid": "fbcbf6078e1a1e6ecebbbdfe4f603ade", "score": "0.5652268", "text": "apiCall() {\n const location = this.props.zip;\n this.props.loadingFunc(true);\n console.log('api call');\n axios\n .get(`https://api.openweathermap.org/data/2.5/forecast/daily`, {\n params: {\n zip: location,\n appid: key\n }\n })\n .then(({ data }) => {\n this.setState({ city: data.city.name, allWeather: data.list });\n this.props.loadingFunc(false);\n // Fade in\n this.setState({ animate: true });\n })\n .catch(err => {\n console.log(err);\n this.props.loadingFunc(false);\n });\n }", "title": "" }, { "docid": "9cf6652be893fa53486f2eae63cfae8e", "score": "0.5650137", "text": "async getCitites(state){\n //getting the cities from the API\n const url = \"https://www.universal-tutorial.com/api/cities/\" + state \n const response = await fetch(url, {\n headers:{\n 'Authorization':\"Bearer \" + this.state.authToken,\n 'Accept': 'application/json'\n }\n })\n\n //storing the received data as a JSON\n const data = await response.json()\n\n //now we store all the cities in a temporary array\n var cities = []\n for(var x in data){\n var obj = data[x]\n cities.push(obj['city_name'])\n }\n //set the state with the cities that we received\n this.setState({\n cities: cities\n })\n \n }", "title": "" }, { "docid": "7fc7c68b221f8c9996564613fd43f52f", "score": "0.5647723", "text": "eventlistEvent() {\n var compID = this.props.location.state.eventId;\n var compSlug = this.props.location.state.eventSlug;\n let self = this;\n let url = \"v1/events/\" + this.props.location.state.eventSlug;\n ApiCall.getApiCall(url)\n .then(function (response) {\n let events = response.events;\n self.setState({events: events});\n console.log(\"Event Fetching from EventList\",response);\n let displayEvent = response;\n for(var j = 0; j < displayEvent.locations.length ; j++) {\n let displayLoc = displayEvent.locations;\n self.setState({displayLoc: displayLoc});\n }\n self.setState({displayEvent: displayEvent});\n self.commentFetch();\n })\n .catch(function (error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "90d774e7824ad830f015649c6b5a507f", "score": "0.5643052", "text": "authRequest(state){\n state.status = 'loading'\n }", "title": "" }, { "docid": "ee56be0c894045e4f6a7bdca24805a5d", "score": "0.5639527", "text": "constructor(props) {\n super(props);\n this.state = {\n count: 0,\n headers: null,\n results: [],\n loading: false,\n request: {},\n history:{},\n };\n }", "title": "" }, { "docid": "ba4b38fb316dd894e5f71d357a4448ed", "score": "0.5635872", "text": "datapopulatorClass(data){\n this.setState({\n data:data, \n loading:false, \n success:true})\n this.prepareWS() \n }", "title": "" }, { "docid": "dd929339484e64cb734b3ab742fdba14", "score": "0.56330067", "text": "componentDidMount() {\n this.callApi()\n .then(resp => this.setState({\n res: resp\n \n }))\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "8b1bd1ce5dde3c603bc8ee534a2119b5", "score": "0.5632506", "text": "[FETCH_START](state) {\n state.loading = true;\n }", "title": "" }, { "docid": "0ab5126a221bf56e83c2823c6e0659fe", "score": "0.5629388", "text": "async getStates(){\n return await axios.get(`${this.baseUrl}/states`);\n }", "title": "" }, { "docid": "1ee46e290838a0f7cb84c5d7c914c781", "score": "0.56267613", "text": "callApi() {\n fetch(\"http://localhost:9000/testAPI\")\n .then(res => res.text())\n .then(res => this.setState({apiResponse: res}))\n .catch(err => err);\n }", "title": "" }, { "docid": "f7be5bab8c5281d0a8f124bd20adef61", "score": "0.5619733", "text": "componentDidMount(){\n userData.getUser().then((response) =>{\n let scoreValue = 0\n if (response.data.data.score !== undefined) {\n scoreValue = [{\n name: \"a\",\n score: response.data.data.score,\n }];\n } else if (response.data.data.todayScore !== undefined) {\n scoreValue = [{\n name: \"a\",\n score: response.data.data.todayScore,\n }];\n }\n this.setState({\n firstNameState: response.data.data.userInfos.firstName,\n keyDataState: response.data.data.keyData,\n scoreDataState: scoreValue,\n });\n });\n\n userData.getActivity().then((response1) =>{\n this.setState({\n activityDataState: response1.data.data.sessions,\n });\n });\n\n userData.getAverageSession().then((response2)=>{\n this.setState({\n averageSessionDataState: response2.data.data.sessions,\n });\n });\n \n userData.getPerfData().then((response3)=>{\n this.setState({\n perfDataState: response3.data.data,\n });\n });\n }", "title": "" }, { "docid": "10623bfcb76c261591cce1fd1d64a3c8", "score": "0.5618978", "text": "async componentDidMount() {\n const response = await axios.get('https://cdn-api.co-vin.in/api/v2/admin/location/states', {\n });\n this.setState({\n stateList: response.data.states,\n });\n}", "title": "" }, { "docid": "6e9fb886032ad2d65088ac7d63c8dd1c", "score": "0.56188446", "text": "getWorkouts() {\n axios\n .get(\"/api/workouts\")\n .then((res) => {\n this.setState = { workouts: res.data };\n })\n .catch((err) => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "2bc4071c2cc174debc99927de4138a1a", "score": "0.5610037", "text": "chainInteractionRequest(fcn, projectName, key, value) {\n\n //Clean all states when calling a new requet\n this.setState({\n requestStatus: null,\n postResponse: null,\n isLoading: true,\n\n });\n\n chainPostInteraction.chainPostInteractionService(fcn, projectName, key, null, value).then((chainResponse) => {\n\n this.setState({\n requestStatus : chainResponse.status,\n postResponse : chainResponse.data,\n isLoading: false,\n\n });\n\n this.resetInputs();\n\n }).catch(error => {\n\n //If an error occurs, show it on console.\n console.log(\"Error:\" + error.message);\n this.setState({\n isLoading: false,\n\n });\n\n this.resetInputs();\n\n });\n\n }", "title": "" }, { "docid": "c1632113695073e858f611b5908bff20", "score": "0.56076217", "text": "callAPI() {\n this.setState({isLoading: true});\n\n // this component works whether a station id is passed or not\n if (this.state.stationID === \"\")\n this.setState({staionID: null});\n\n const params = (!this.state.request_stationID ? \"\" : this.state.request_stationID);\n const baseURL = url;\n\n var postReqParams = {\n stationID: this.state.request_stationID,\n\n startDate: this.state.request_startDate,\n endDate: this.state.request_endDate,\n\n endTime: this.state.request_endTime,\n startTime: this.state.request_startTime,\n\n onlyMostRecent: this.props.onlyMostRecent,\n\n isEST: true\n }\n\n console.log(postReqParams);\n\n // eg:\n // https://localhost:3000/weatherData/1\n var postReqURL = baseURL + \"/weatherData/\" + params;\n\n fetch(postReqURL, {\n method: 'post',\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify(postReqParams)\n })\n .then (response => response.json() )\n .then (res => this.setState({apiResponse: res, isLoading: false}) )\n .catch(err => this.setState({hasError:true, error:err}) );\n\n this.setState({hasSubmitted: true});\n }", "title": "" }, { "docid": "63a31fcb13c375b10e1a6dd4e52c2c26", "score": "0.5605049", "text": "function getState() {\n $table.bootstrapTable(\"destroy\");\n console.log(\"Fetching supplier table state\");\n // ajax call to suppliers api\n console.log(`API GET ${suppliers_endpoint}`);\n $.get({\n url: suppliers_endpoint\n }).then((data) => {\n // update global state\n suppliers = data.reverse();\n console.log(\"Response: \", suppliers);\n // inject html for table\n $table.bootstrapTable({data: suppliers});\n }).catch(() => {\n console.error(\"API request failed\");\n alert(\"API Request Failed\");\n });\n}", "title": "" } ]
557dd4703b6a7807571ce1eff822be66
Iterates over all valid UserTripInstances
[ { "docid": "952f9743a78f0a1dd45229ddc1ebf45f", "score": "0.5893859", "text": "function eachUti(utis, a) {\n if (!a)\n return;\n angular.forEach(utis, function(uti) {\n var skipInstance = false;\n angular.forEach($scope.model.trips, function(trip) {\n if (trip.id == uti.tripId) {\n angular.forEach(trip.userTrips, function(ut) {\n if (ut.userId == uti.userId) {\n skipInstance = !ut.attending;\n return true;\n }\n });\n return true;\n }\n });\n if (!skipInstance)\n return a(uti);\n });\n }", "title": "" } ]
[ { "docid": "c1697bc2960e333be956f8000de0b6d8", "score": "0.5645303", "text": "function createUser(err) {\n if(err) console.log(err);\n\n var to_save_count = user_json.length;\n \n models.Trip.find().exec(addUser);\n \n function addUser(err, res){\n if (err) return console.error(err);\n \n var users = [];\n \n for(var i=0; i<user_json.length; i++) {\n var json = user_json[i];\n users.push(new models.User(json));\n for (var j = 0; j < res.length; j++){\n users[i]._trips.push(res[j]._id);\n }\n }\n users[0]._friends.push(users[1]._id);\n users[1]._friends.push(users[0]._id);\n\n for (var i = 0; i < users.length; i++){\n// console.log(users[i]);\n users[i].save(function(err, user){\n if(err) return console.error(err);\n to_save_count--;\n console.log(to_save_count + ' left to save users');\n if(to_save_count <= 0) {\n console.log('DONE');\n addTripToUser();\n }\n })\n }\n \n function addTripToUser(){\n models.Trip.findOneAndUpdate({tripName: \"After-Graduation Trip\"}, {$push: {_participants: users[0]._id}}, function(err,r){\n models.Trip.findOneAndUpdate({tripName: \"After-Graduation Trip\"}, {$push: {_participants: users[1]._id}}, function(err, r){\n models.Trip.findOneAndUpdate({tripName: \"Spring-Break Trip\"}, {$push: {_participants: users[0]._id}}, function(err, r){\n models.Trip.findOneAndUpdate({tripName: \"Spring-Break Trip\"}, {$push: {_participants: users[1]._id}}, function(err, r){\n models.User.find(function(err, user){\n console.log(user);\n models.Trip.find(function(err, trip){\n console.log(trip);\n \n mongoose.connection.close();\n \n });\n });\n });\n });\n }); \n }); \n\n }\n }\n\n\n}", "title": "" }, { "docid": "baca1218866239d1d84cbcc15b2cd976", "score": "0.53287315", "text": "static all () {\n const us = users.map(user => new User(user))\n return Promise.resolve({\n total: us.length,\n objects: us\n })\n }", "title": "" }, { "docid": "2b0b04317d0ffc95bb8110727ca6a021", "score": "0.5257089", "text": "async _invalidations() {\n let schema = await this.schema();\n let pendingOps = [];\n let references = await this._findTouchedReferences();\n for (let { type, id } of references) {\n let key = `${type}/${id}`;\n if (!this._touched[key]) {\n this._touched[key] = true;\n pendingOps.push((async ()=> {\n if (type === 'user-realms') {\n // if we have an invalidated user-realms and it hasn't\n // already been touched, that's because the corresponding\n // user was delete, so we should also delete the\n // user-realms.\n await this.delete(type, id);\n } else {\n let resource = await this.read(type, id);\n if (resource) {\n let sourceId = schema.types.get(type).dataSource.id;\n let nonce = 0;\n await this.add(type, id, resource, sourceId, nonce);\n }\n }\n })());\n }\n }\n await Promise.all(pendingOps);\n }", "title": "" }, { "docid": "4b9e936b8954623b4ebff6fd90cc2697", "score": "0.5198298", "text": "getValues() {\n\n let user = {};\n var isValid = true;\n\n [...this.formEl.elements].forEach((field, index) => {\n if (['name', 'email', 'password'].indexOf(field.name) > -1 && !field.value) {\n field.parentElement.classList.add(\"has-error\");\n isValid = false;\n return false;\n }\n if (field.name == \"gender\") {\n //verificando se o gender está selecionado\n if (field.checked) {\n user[field.name] = field.value;\n }\n } else if (field.name == \"admin\") {\n if (field.checked) {\n user[field.name] = field.checked;\n }\n } else {\n // Objeto \"user\" recebe atributos de key e value dos campos de \"field\" de forma dinamica por meio das \"[]\"\n user[field.name] = field.value;\n }\n });\n\n if (!isValid) {\n return false;\n }\n\n return new User(\n user.name,\n user.gender,\n user.birth,\n user.country,\n user.email,\n user.password,\n user.photo,\n user.admin\n );\n\n }", "title": "" }, { "docid": "79c131872187d2257ce2a363ae5b8a06", "score": "0.5144104", "text": "async componentDidMount() {\n for (let i = 0; i < 10; i++) {\n this.getUser()\n }\n console.log(this.state.generatedUsers);\n }", "title": "" }, { "docid": "3e9f47185d41b11333871f60a952c3b5", "score": "0.49601385", "text": "async getUsers () {\n\t\tlet memberIds = \n\t\t(\n\t\t\tthis.attributes.$addToSet && \n\t\t\tthis.attributes.$addToSet.adminIds\n\t\t) || \n\t\t(\n\t\t\tthis.attributes.$pull && \n\t\t\tthis.attributes.$pull.adminIds\n\t\t) || \n\t\t(\n\t\t\tthis.attributes.$addToSet &&\n\t\t\tthis.attributes.$addToSet.removedMemberIds\n\t\t) || \n\t\t[];\n\t\tif (memberIds.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// only admins can perform these operations\n\t\tif (!(this.team.get('adminIds') || []).includes(this.user.id)) {\n\t\t\t// the one exception is a user removing themselves from a team\n\t\t\tif (\n\t\t\t\t!this.removingUserIds || \n\t\t\t\tthis.removingUserIds.find(id => id !== this.user.id)\n\t\t\t) {\n\t\t\t\tthrow this.errorHandler.error('adminsOnly');\n\t\t\t}\n\t\t}\n\n\t\t// all users must actually exist\n\t\tconst users = await this.request.data.users.getByIds(memberIds);\n\t\tconst foundMemberIds = users.map(user => user.id);\n\t\tconst notFoundMemberIds = ArrayUtilities.difference(memberIds, foundMemberIds);\n\t\tif (notFoundMemberIds.length > 0) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'one or more users' });\n\t\t}\n\n\t\t// all users must be a member of the team \n\t\tif (users.find(user => !user.hasTeam(this.team.id))) {\n\t\t\tthrow this.errorHandler.error('updateAuth', { reason: 'one or more users are not a member of the team' });\n\t\t}\n\n\t\t// save removed users for later use\n\t\tif (\n\t\t\tthis.attributes.$addToSet &&\n\t\t\tthis.attributes.$addToSet.removedMemberIds\n\t\t) {\n\t\t\tthis.transforms.removedUsers = users;\n\t\t}\n\t}", "title": "" }, { "docid": "af656e50da1948347bc12115c894fb0b", "score": "0.49355853", "text": "function validTweet(i) {\n if(tweets[i].user == null)\n return false;\n return true;\n }", "title": "" }, { "docid": "e5abec1f97c43c2ece3574932a739955", "score": "0.4934997", "text": "function checkUsersValid(goodUsers) {\n return function allUsersValid(submittedUsers) {\n return submittedUsers.every((sUser) => {\n return goodUsers.some((gUser) => {\n return sUser.id = gUser.id;\n })\n })\n };\n}", "title": "" }, { "docid": "169355268d0e24ce8442a8b60c8fdf8f", "score": "0.49199706", "text": "validateAll() {\n let arr = [];\n for (let key of Object.keys(this.state.formdata)) {\n arr.push(this.formValidator.validateField(key, this));\n }\n return arr.every(entry => entry);\n }", "title": "" }, { "docid": "4cae70271fa731994af6e52c1d314a74", "score": "0.49136472", "text": "iterate_all() {\n while(!this.training_done) {\n this.iterate();\n }\n }", "title": "" }, { "docid": "080e3be7f56df0380369ee70aeee41ba", "score": "0.49069571", "text": "async all() {\n l.info(`${this.constructor.name}.all()`);\n try {\n const users = await User.find().select('-password');\n return users;\n } catch (error) {\n return error;\n }\n }", "title": "" }, { "docid": "e5c368462c6023e80cba61f9b05286ab", "score": "0.4906928", "text": "function kickUsers(users) {\n for (var i in users) {\n if (users.hasOwnProperty(i)) {\n kickUser(users[i]);\n }\n }\n}", "title": "" }, { "docid": "aa13359007411c045777dfd2b87c0363", "score": "0.48997512", "text": "scanUsers() {\n logger.log('CRON JOB: Scanning Users for articles to upvote is fired');\n\n this.connection.query('SELECT * FROM `users` WHERE `active` = 1', (error, results, fields) => {\n if(error){\n logger.log(error);\n }\n\n results.forEach(user => {\n this.scanUserArticles(user);\n });\n \n });\n }", "title": "" }, { "docid": "127779ed8aecf4e956dfe19fd762deb0", "score": "0.48951703", "text": "async getAllUsers() {\n\n const userCollection = await usersList();\n const listOfUsers = await userCollection.find().toArray();\n\n\n allusers = [];\n oneUser = {};\n\n //NM - Corrected spelling of orientation, added email and contact_info attributes\n for (var val of listOfUsers) {\n oneUser = {};\n oneUser._id = val._id;\n oneUser.user_id = val.user_id;\n oneUser.name = val.name;\n oneUser.hashedPassword = val.hashedPassword;\n oneUser.dob = val.dob;\n oneUser.gender = val.gender;\n oneUser.location = val.location;\n oneUser.occupation = val.occupation;\n oneUser.orientation = val.orientation;\n oneUser.contact_info = val.contact_info;\n oneUser.email = val.email;\n oneUser.location_pref = val.location_pref;\n oneUser.connections = val.connections;\n oneUser.budget = val.budget\n\n allusers.push(oneUser);\n }\n\n return allusers;\n }", "title": "" }, { "docid": "87ac5fc7d4b325ff0b45eb80e145d460", "score": "0.48879206", "text": "function iterate(data) {\n\t$(jQuery.parseJSON(JSON.stringify(data))).each(function() { \n\t\tinsert(this.userId, this.userName, this.ini, this.cpr, this.password, this.roles);\n\t});\n}", "title": "" }, { "docid": "3bdcc7e0eeac54a11123097848539420", "score": "0.4883841", "text": "async function createUsersSeeds() {\n try {\n users.forEach(\n async ({ id, firstName, lastName, email, password, userType }) =>\n await User.findOrCreate({\n where: { id },\n defaults: { firstName, lastName, email, password, userType },\n })\n );\n console.log(\"DB precargada con users seeds\");\n } catch (err) {\n console.log(err);\n console.log(\"Error en create users seeds\");\n }\n}", "title": "" }, { "docid": "2b7c00af4e085830dac949d7f3c96ebb", "score": "0.48711497", "text": "function AddValidUsers(e) {\n e.preventDefault()\n // console.log('inside Addvalid users')\n // console.log(retrievedData)\n // console.log(enteredEmail)\n for(let i=0;i<retrievedData.length;i++){\n if(retrievedData[i].email === enteredEmail && dataObj.loggedinEmail !== enteredEmail) {\n //Addd this user to db in new table\n\n Swal.fire('Congrats',\"User added\",'success')\n \n break\n \n }\n else if(i === retrievedData.length -1){\n Swal.fire('Oops',\"User doesn't exists\",'error')\n \n \n }\n else{}\n }\n \n }", "title": "" }, { "docid": "d4e3dea1782ecaa9e19f765134a87093", "score": "0.48591623", "text": "forceValidations() {\n for (const name of Object.keys(validations)) {\n // Only validate things that aren't dirty, since dirty elements have already had a\n // validation triggered\n if (!this.state.dirty[name]) {\n this.validate(name)\n }\n }\n }", "title": "" }, { "docid": "266207b8b7c9f754bb9404fbbc84dcb3", "score": "0.48577854", "text": "getUsers() {\n const players = [];\n const inactives = [];\n const bannedUsers = [];\n const spectators = [];\n this.users.forEach(({ id, present, spectate, banned }) => {\n const user = Users.getUser(id);\n if (user) {\n if (banned) bannedUsers.push(user);\n else if (!present) inactives.push(user);\n else if (spectate) spectators.push(user);\n else players.push(user);\n }\n });\n return { players, inactives, spectators, banned: bannedUsers };\n }", "title": "" }, { "docid": "c5f03e922e0ef04cf9249d7f6db7e5f2", "score": "0.48481703", "text": "async function process_data(i) {\n //Return if done\n if (!user_data[i]) return;\n //get data\n let data = user_data[i];\n //Create new user\n let new_user = new User(data.user);\n //Extend\n new_user.follow.tags = data.tags_follow;\n //check if user fol\n let user_follow = [];\n if (data.user_follow.length) {\n user_follow = await User.find({ email: { \"$in\": data.user_follow } }).select(' _id').exec();\n }\n //Update auther\n new_user.follow._author = user_follow || [];\n //Save user\n await new_user.save();\n //Save user post\n data.posts.forEach(function(post) {\n //extend\n post.tags = data.tags_follow;\n post._author = new_user._id;\n post.created_by = {\n name: new_user.name,\n type: new_user.type\n };\n });\n //save post\n await Post.insertMany(data.posts);\n //process next\n process_data(i + 1);\n }", "title": "" }, { "docid": "6bed8c0e93a67dffb9989b53669d8786", "score": "0.48468524", "text": "function banUsers(users) {\n for (var i in users) {\n if (users.hasOwnProperty(i)) {\n banUser(users[i]);\n }\n }\n}", "title": "" }, { "docid": "92e5bdf2204ba8438191b3712188ce9a", "score": "0.48382342", "text": "function getUserInstanceList(data) {\n dataResponse = data.length || 0;\n if(dataResponse == 0) ConfService.dataResponse = 0;\n // retrieve all webhook instances\n for(var obj in data) {\n var op = data[obj].optionalProperties;\n var obj_op = JSON.parse(op);\n instanceList.push(\n {\n streams: obj_op.streams, // rooms threadId's (string) that are posting locations\n name: data[obj].name,\n configurationId: data[obj].configurationId,\n postingLocationsRooms: [], // user rooms (object) that are posting locations\n notPostingLocationsRooms: [], // user rooms (object) that are NOT posting locations\n description: '',\n instanceId: data[obj].instanceId,\n lastPostedTimestamp: obj_op.lastPostedDate,\n streamType: obj_op['streamType'],\n lastPosted: obj_op.lastPostedDate ? timestampToDate(obj_op.lastPostedDate) : 'not available',\n created: data[obj].createdDate ? timestampToDate(data[obj].createdDate) : 'not available'\n }\n );\n };\n // stores all posting locations (object) into instanceList\n var aux_rooms = [];\n instanceList.map(function(inst, i) {\n inst.streams.map(function(stream, j) {\n userChatRooms.map(function(room, k) {\n if(stream == room.threadId) {\n inst.postingLocationsRooms.push(clone(room));\n }\n });\n });\n });\n // stores all indexes of the rooms (object) that are not posting locations into an array\n var pl, idx, aux;\n instanceList.map(function(inst, i){\n pl=false;\n idx = [];\n aux=userChatRooms.slice();\n inst.streams.map(function(stream, j){\n for(var k=0,n=aux.length; k<n; k++) {\n if(aux[k].threadId == stream) {\n idx.push(k);\n }\n }\n })\n // remove from the user rooms array all those are posting locations rooms\n for(var i=0, n=aux.length; i<n; i++) {\n for(var j=0, l=idx.length; j<l; j++) {\n if(i == idx[j]) {\n aux.splice(i,1);\n idx.splice(j,1);\n for(var k=0, s=idx.length; k<s; k++) idx[k]--;\n i--;\n break;\n }\n }\n }\n inst.notPostingLocationsRooms = aux.slice();\n });\n\n ConfService.instanceList = instanceList.slice();\n \n setTimeoutError(false);\n defaultIndexRoute = instanceList.length > 0 ? ListView : CreateView;\n render((\n <Router history={hashHistory}>\n <Route path=\"/\" component={Home}>\n <IndexRoute component={ defaultIndexRoute } />\n <Route path=\"/list-view(/:status)\" component={ListView} />\n <Route path=\"/create-view\" component={CreateView} />\n <Route path=\"/save-webhook(/:instanceId)\" component={SaveWebHook} />\n <Route path=\"/edit-view/:instanceId\" component={EditView} />\n <Route path=\"/success\" component={Success} />\n <Route path=\"/remove-view/:instanceId/:name\" component={RemoveView} />\n </Route>\n </Router>\n ), document.getElementById('app')) \n }", "title": "" }, { "docid": "03943f022011792a09d9cc358087eff6", "score": "0.48372343", "text": "function validateAll()\n {\n var errors = [];\n var isValid = true, index;\n var personalValidation = [validateRequiredFields, validateName, validateEmail, validateBirthday];\n var scheduleValidation = [validateClassSelection, validateNoOverlappingClasses];\n\n for (index = 0; index < personalValidation.length; index++)\n {\n errors = personalValidation[index](errors);\n \n if (errors.length > 0)\n {\n showError(\"errorPersonal\", errors.join(\"\"));\n isValid = false;\n errors = []; // clear for each validation\n }\n }\n \n for (index = 0; index < scheduleValidation.length; index++)\n {\n errors = scheduleValidation[index](errors);\n \n if (errors.length > 0)\n {\n showError(\"errorSchedule\", errors.join(\"\"));\n isValid = false;\n errors = []; // clear for each validation\n }\n }\n \n return isValid;\n }", "title": "" }, { "docid": "1af82c9f460e723961c655ba44c7914e", "score": "0.48351023", "text": "function start_iteration() {\r\n SETTINGS = {\r\n app: `frog_cake_comment_upvoter`,\r\n version: 0.2,\r\n config: SETTINGS.config,\r\n accounts: {\r\n names: [],\r\n vote_strength: {}\r\n },\r\n valid_comments: {},\r\n valid_comments_array: [],\r\n voting: {\r\n strength: 10000, //Default voting strength.\r\n quantity: 6 //Number of votes each round.\r\n }\r\n }\r\n console.log(`Loop starting.`);\r\n let arrayOfNames = Object.getOwnPropertyNames(SETTINGS.config);\r\n arrayOfNames.forEach(name => {\r\n let vote_strength = SETTINGS.config[name].votestrength;\r\n console.log(`${name} - ${vote_strength}`);\r\n SETTINGS.accounts.names.push(name);\r\n SETTINGS.accounts.vote_strength[name] = vote_strength;\r\n });\r\n get_participants_comments(0, 0);\r\n}", "title": "" }, { "docid": "a3354722eba5ea83c9829cff59f4fb48", "score": "0.48294786", "text": "async getUsers() {\n try {\n let allUsers = [];\n let more = true;\n let paginationToken = '';\n\n while (more) {\n let params = {\n UserPoolId: process.env.REACT_APP_USER_POOL_ID,\n Limit: 60\n };\n if (paginationToken !== '') {\n params.PaginationToken = paginationToken;\n }\n\n AWS.config.update({\n region: process.env.REACT_APP_REGION,\n accessKeyId: process.env.REACT_APP_ACCESS_KEY_ID,\n secretAccessKey: process.env.REACT_APP_SECRET_KEY,\n });\n const cognito = new AWS.CognitoIdentityServiceProvider();\n const rawUsers = await cognito.listUsers(params).promise();\n allUsers = allUsers.concat(rawUsers.Users);\n console.log(allUsers);\n console.log(allUsers[3].Attributes.filter(attr => { return attr.Name === \"email\" })[0].Value)\n if (rawUsers.PaginationToken) {\n paginationToken = rawUsers.PaginationToken;\n } else {\n more = false;\n }\n }\n\n let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();\n\n for (let i = 0; i < allUsers.length; i++) {\n let params = {\n UserPoolId: process.env.REACT_APP_USER_POOL_ID,\n Username: allUsers[i].Username,\n };\n cognitoidentityserviceprovider.adminListGroupsForUser(params, function (err, data) {\n if (data.Groups.length >= 1 && data.Groups[0].GroupName === \"Administrators\") {\n allUsers[i].isUserAdmin = true;\n } else {\n allUsers[i].isUserAdmin = false;\n }\n })\n }\n //console.log(allUsers)\n this.setState({\n users: allUsers,\n })\n\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "ba38cd5d93e55e9dd8e92c24844d0cb1", "score": "0.48141864", "text": "function allAreValid () {\n return all(compose(eq(true), dot('isValid')), items);\n }", "title": "" }, { "docid": "70907aa8f05d57dc888c7d18a801e26c", "score": "0.48051062", "text": "function users() {\n vines.users.count().always(log('user: count'));\n vines.users.where().limit(10).skip(0).all().done(log('user: found first 10'));\n\n // register a new user then delete their account\n var user = {id: 'demo-user@' + vines.domain, password: 'password'};\n var signup = vines.users.save(user);\n signup.fail(log('user: signup failed'));\n signup.done(log('user: signup succeeded'));\n signup.done(deleteUser);\n }", "title": "" }, { "docid": "70f36f826beb14f7f6e9a1936c2dd255", "score": "0.4802347", "text": "function getAllUsers() {\n\n\t}", "title": "" }, { "docid": "d678ee2740fcaacc291d207e6bff45fe", "score": "0.47663757", "text": "listUsers() {\n //pegar todos os user da localStorage\n let users = User.getAllUsers()\n\n //adicionar na tela\n users.forEach(userData => {\n \n //criar um objecto do user\n let user = new User()\n\n //passar os dados para um objecto usuário\n user.loadFromJSON(userData)\n\n //adicionar na tela\n this.addLine(user)\n\n })\n }", "title": "" }, { "docid": "21e0b48e57ad5df856b7350ff157a9f7", "score": "0.47488213", "text": "async function addMoreUsers() {\n try {\n let newUsers = await client.updateUsers([{\n id: 'emi',\n name: 'Emi',\n favorite_vegetable: 'avocado',\n },{\n id: 'gil',\n name: 'Gil',\n favorite_vegetable: 'beans',\n },{\n id: 'bert',\n name: 'Bert',\n favorite_vegetable: 'tomato',\n },{\n id: 'bugs-bunny',\n name: 'Bugs Bunny',\n favorite_vegetable: 'carrot',\n },{\n id: 'old-mcdonald',\n name: 'Old McDonald',\n favorite_vegetable: 'corn'\n }]);\n for (const user in newUsers.users) {\n console.log(\"New user added: \" + user)\n }\n } catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "4987d51658513f65ac6c34bed4ec585d", "score": "0.47445807", "text": "validate() {\n this.isSubmitAllowed = true\n\n Object.keys(this.$children).map((index) => {\n if (typeof this.$children[index].invalid != 'undefined') {\n if (this.$children[index].invalid) {\n this.isSubmitAllowed = false\n } else if (this.$children[index].user_input.length == 0) {\n this.$children[index].invalid = true\n this.isSubmitAllowed = false\n }\n }\n })\n }", "title": "" }, { "docid": "6ef72740bd4836d5024d25387e1103a5", "score": "0.47405973", "text": "async validateAttributes () {\n\t\tfor (let i = 0, length = Object.keys(this.attributes).length; i < length; i++) {\n\t\t\tconst attribute = Object.keys(this.attributes)[i];\n\t\t\tif (!await this.validateAttribute(attribute)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "f25bbffd66a8420d1fd7ff959c13f392", "score": "0.4724671", "text": "function checkAllInvalidSkills() {\n\n var i = 0, allInvalid = true;\n for (i = 0; i < $scope.skillsModel.followSkills.list.length; i++) {\n\n if ($scope.skillsModel.followSkills.list[i].IsActive) {\n allInvalid = false;\n }\n\n }\n\n return allInvalid;\n }", "title": "" }, { "docid": "a1f0b844b83a94f069d50aafc23719f2", "score": "0.4722433", "text": "function addUsers () {\n for (i = 0; i < mockUsers.length; i++) {\n split = mockUsers[i].split(\" \");\n temp = split[0] + \".\" + split[1];\n usern = temp.toLowerCase() + \"@gmail.com\";\n name = mockUsers[i];\n passwd = temp.toLowerCase() + \"4321\";\n authkey = makeAuthKey();\n\n var authkey = new Authkey({email: usern});\n authkey.set('authkey', authkey);\n\n authkey.save(function(err) {\n // handle error\n });\n\n var user = new User({username:usern});\n user.set('password', encryptPassword(passwd));\n user.set('fullname', name);\n user.set('authkey', authkey);\n user.save(function(err) {\n // handle error\n });\n\n console.log(\"Added User - \" + name);\n }\n}", "title": "" }, { "docid": "b2a2f4512a0ee7f04513e1b691cf9b34", "score": "0.47206897", "text": "async function createInitialUsers() {\n console.log('Starting to create users...')\n try {\n const usersToCreate = [\n { email: '[email protected]', password: 'bertie99' },\n { email: '[email protected]', password: 'sandra123' },\n { email: '[email protected]', password: 'glamgal123' },\n ]\n const users = await Promise.all(usersToCreate.map(createUser))\n\n console.log('Users created:')\n console.log(users)\n console.log('Finished creating users!')\n } catch (error) {\n console.error('Error creating users!')\n throw error\n }\n}", "title": "" }, { "docid": "fb9d53b28145e82113f94d4c086b50ea", "score": "0.4718455", "text": "static get all() {\n return new Promise (async (resolve, reject) => {\n try {\n const userTable = await db.query(`SELECT * FROM users;`)\n const users = userTable.rows.map(d => new User(d))\n resolve(users);\n } catch (err) {\n reject(\"Error retrieving users\")\n }\n })\n }", "title": "" }, { "docid": "215143e8cff411b4fc20209aa518cd18", "score": "0.4714278", "text": "function loopThroughUsers(users) {\r\n\r\n // This function takes in two users, and adds them to each others friends list.\r\n // It returns a promise that is resolved when both users have been updated and saved.\r\n function addEachOther(user1, user2) {\r\n\r\n // This function saves us from having to write the User.findById... code twice, we write it once and then we can call it for each of the users.\r\n function addFriend(user1, user2) {\r\n return new Promise(function (resolve, reject) {\r\n User.findById(user1, (err, user) => {\r\n if (err) { return reject(\"Error\"); }\r\n user.friends.push(user2);\r\n user.save((err) => {\r\n if (err) { return reject(\"Error\"); }\r\n resolve();\r\n });\r\n });\r\n });\r\n }\r\n\r\n return new Promise(function (resolve, reject) {\r\n\r\n // This will add user2 to the user1 friends list\r\n let p1 = addFriend(user1, user2);\r\n\r\n // This will add user1 to the user2 friends list\r\n let p2 = addFriend(user2, user1);\r\n\r\n Promise.all([p1, p2]).then((val) => {\r\n resolve(\"Both friends have added each other.\");\r\n });\r\n });\r\n }\r\n\r\n // The loopThroughUsers() function will return a promise. It will only be resolved when all recursive calls have resolved. (This goes all the way down until the array size is 0, at which point the resolutions will propagate upwards until reaching this original call.)\r\n return new Promise(function (resolve, reject) {\r\n\r\n // When the array size is 0, you want to immediately resolve() the promise.\r\n if (users.length == 0) { return resolve(); }\r\n\r\n\r\n // Call loopThroughUsers() on a the current users array with the first value removed from the array. Then store that promise in a variable.\r\n\r\n // You might ask why remove the first value from the array for the next call of the function?\r\n\r\n // We will be looping through the users list and adding friends in that list.\r\n // For the first iteration, we will be checking to add friends to the first user.\r\n\r\n // So we might make the user[0] and user[1] friends.\r\n // Or user[0] and user[53] friends, etc.\r\n\r\n // By the end of the array, many users will have the first user in the array as a friend. So we don't need to worry about the first user, user[0], anymore.\r\n\r\n // In short, we remove the first user from the array so to make it impossible to have duplicates in any friend arrays.\r\n\r\n let recursionPromise = loopThroughUsers(users.slice(1));\r\n\r\n // Remember that the function that adds the friends together returns a promise, and we'll be adding many friends. We'll store those promises in an array to be used in a Promise.all().\r\n let friendRequestPromises = [];\r\n for (let i = 1; i < users.length; i++) {\r\n\r\n // There is a 50% chance of a user adding a user as a friend.\r\n if (getRandom(0, 100) > 50) {\r\n friendRequest = addEachOther(users[0]._id, users[i]._id);\r\n friendRequestPromises.push(friendRequest);\r\n }\r\n }\r\n\r\n // Finally, resolve the loopThroughUsers() function when all of it's friendRequests have been resolved, and the recursionPromise has been resolved.\r\n Promise.all([...friendRequestPromises, recursionPromise]).then((val) => {\r\n resolve(val);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "bf0e1a79fbb59f8492a2a40dcc56c863", "score": "0.47140083", "text": "generateUsers(count, contracts) {\r\n const USERS = [];\r\n for (var i = 1; i <= count; i++) {\r\n USERS.push({\r\n id: FAKER.random.uuid(),\r\n insuranceNumber: `E-000${FAKER.random.uuid()}`,\r\n firstname: CORE.randDataError(FAKER.name.firstName()),\r\n lastname: CORE.randDataError(FAKER.name.lastName()),\r\n email: CORE.randDataError(FAKER.internet.email()),\r\n password: CORE.randDataError(FAKER.internet.password()),\r\n contracts: CORE.randDataError(FAKER.random.arrayElements(contracts, FAKER.random.number({ min: 0, max: 5 }))),\r\n profilImg: CORE.randDataError(FAKER.image.cats()),\r\n address: {\r\n street: CORE.randDataError(FAKER.address.streetName()),\r\n zip: CORE.randDataError(FAKER.address.zipCode()),\r\n city: CORE.randDataError(FAKER.address.city())\r\n }\r\n });\r\n }\r\n return USERS;\r\n }", "title": "" }, { "docid": "7a6e2e6a129fc2cb361cfd9249842dc1", "score": "0.47085845", "text": "function faa_process_users() {\n\n\t// Loop through each user\n\tvar users = document.getElementsByClassName('_3y7');\n\tfor (var key in users) {\n\n\t\t// Bail out if key not numeric\n\t\tif ( isNaN( key ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// Ignoring users who are the member of too many groups (common spammer behaviour)\n\t\tvar member_of_x_groups = users[key].getElementsByClassName('_5pkb _55wp _3y9')[0].childNodes[1].innerHTML;\n\t\tif ( true == ( member_of_x_groups.indexOf(\"Member of \") > -1 ) ) {\n\t\t\tmember_of_x_groups = member_of_x_groups.replace(\"Member of \", \"\");\n\t\t\tmember_of_x_groups = member_of_x_groups.replace(\" groups\", \"\");\n\n\t\t\tignore = users[key].getElementsByClassName('_54k8 _56bs _56bt')[0];\n\n\t\t\tif ( 200 < member_of_x_groups ) {\n\n\t\t\t\t// Ignore since member of too many groups\n\t\t\t\tignore.click();\n\n\t\t\t} else {\n\n\t\t\t\t// Get required data\n\t\t\t\tvar joined_date_human_readable = users[key].getElementsByClassName('_5pkb _55wp _3y9')[0].childNodes[0].childNodes[1].innerHTML;\n\n\t\t\t\tvar joined_date = new Date(joined_date_human_readable);\n\t\t\t\tvar joined_date_unix = joined_date.getTime();\n\n\t\t\t\tvar current_time = new Date();\n\t\t\t\tvar current_time_unix = current_time.getTime();\n\n\t\t\t\tvar membership_age_in_milliseconds = current_time_unix - joined_date_unix;\n\t\t\t\tmembership_age_months = membership_age_in_milliseconds / 1000 / 60 / 60 / 24 / 30;\n\n\t\t\t\tvar approve = users[key].getElementsByClassName('_54k8 _56bs _56bu')[0];\n\n\t\t\t\t// Ignoring users newer than three months\n\t\t\t\tif ( 3 < membership_age_months ) {\n\t\t\t\t\tapprove.click();\n\t\t\t\t\tbreak; // Break out so that all members are not processed at once\n\t\t\t\t} else {\n\t\t\t\t\tignore.click();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}\n\n}", "title": "" }, { "docid": "66400190a3a22d6a111ab73061244770", "score": "0.47057623", "text": "get allUsers() {\n // Returning a freezed copy of the list of users to prevent outside changes\n return Object.fromEntries(this.users.map(user => [user.id, user]));\n }", "title": "" }, { "docid": "690a0e9932a9cdd2b0ac096fa882c11e", "score": "0.4703218", "text": "async function userValidation() {\n browser = await puppeteer.launch();\n page = await browser.newPage();\n\n await page.setRequestInterception(true);\n page.on('request', requestInterceptor(options));\n\n const dataList = [];\n const persons = JSON.parse(fs.readFileSync(options.files.scraped, 'utf8'));\n\n for (const item of persons) {\n const data = await person.get(page, item.link);\n dataList.push({ ...data, ...item });\n }\n\n await person.close(browser);\n\n fs.writeFile(options.files.approved, JSON.stringify(dataList), err => {\n if (err) return console.log(err);\n console.log(`Saved list of ${dataList.length} items`);\n });\n}", "title": "" }, { "docid": "ea3a21ee4b842bf79816456f58b58e3f", "score": "0.46971914", "text": "function attemptMatch() {\n iterations++;\n logger.info('Attempt number '+iterations);\n\n // Get a subset of users and shuffle them\n users = _.filter(db.userData, { allowed: true });\n\n logger.info(users.length + ' users to match up');\n\n // _.shuffle is deterministic, so randomly iterate\n shuffleIts = _.random(12, 300);\n var shuffledUsers;\n for (var xx = 0; xx < shuffleIts; xx++) {\n\n // get a copy of the users in a shuffled order\n shuffledUsers = _.shuffle(users);\t\n }\n\n // Loop through each eligible user\n var user;\n for (var x = 0; x < users.length; x++) {\n user = users[x];\n var userIsMatched = false;\n\n // loop through the shuffled user list\n for (var i = 0; i < shuffledUsers.length; i++) {\n // pull the first shuffled user from the list so they're not used in future\n var shuffledUser = shuffledUsers.shift();\n\n // Is this match a good match?\n if (shuffledUser.id !== user.id &&\n shuffledUser.lastName.toLowerCase() !== user.lastName.toLowerCase()) {\n // successful match, so move onto the next user in the array\n user.match = shuffledUser.id;\n userIsMatched = true;\n // break from the shuffled user loop\n break;\n }\n // bad match, so put the shuffled user back in the array\n shuffledUsers.push(shuffledUser);\n }\n\n if (!userIsMatched) {\n \n // if we got here, we couldn't match this user successfully, so try again\n if (iterations < 10) {\n return attemptMatch();\n } else {\n // bomb out, too many attempts\n logger.info(shuffledUsers,'Couldnt match '+user.displayName+' with anyone!');\n return false;\n }\n }\n }\n\n // if we got this far, then all users were matched!\n return true;\n }", "title": "" }, { "docid": "0b1e4b8550198ddc83bc2a4f17f18c8d", "score": "0.46577534", "text": "validationLoop(e) {\n let $el = $(e.target);\n settings.DEBUG_MODE && console.log(\"Validation Loop: \" + $el.attr(\"id\"));\n $el.find(supportedTag.join(',')).each((idx, e) => {\n let rules = $(e).data(nameSpaceKey + \"rules\");\n let val = $(e).val();\n rules.forEach(r => {\n let result = this.validationDelegator(val, r);\n console.log(\"Testing[\" + $(e).attr(\"name\") + \": '\" + val + \"' with rule: '\" + r + \"'] = \" + result);\n\n if (!result) {\n // Error show up\n let nameKey = $(e).attr(\"name\");\n $(e).attr(\"aria-invalid\", true);\n let errors = $el.find('error[errorFor=\"' + nameKey + '\"][data-rule=\"' + r + '\"], .error[errorFor=\"' + nameKey + '\"][data-rule=\"' + r + '\"]');\n\n if (errors.length == 1) {\n errors.addClass(\"errorShow\");\n } else if (errors.length > 1) {\n $el.find('error[data-rule=\"' + r + '\"], .error[data-rule=\"' + r + '\"]').addClass(\"errorShow\");\n } else {\n ERROR(\"Error message disappeared! Something wrong happened\");\n } // return result; // TODO: needs to handle \"errorHurdling\"\n\n }\n });\n });\n return false;\n }", "title": "" }, { "docid": "864dc96b8f5ef9e63319a8e1edfae92a", "score": "0.46504158", "text": "function createSampleDeliveryPersons(){\n for(loop = 0; loop < 3; loop++){\n var hashedPassword = generateHash(\"Comet123$\")\n db.DeliveryPerson.create({\n 'name' : \"dperson\"+loop,\n 'email' : \"dperson\"+loop+\"@dperson.com\",\n 'phone' : \"123456789\",\n 'password' : hashedPassword\n }).success(function(record) {\n\n if (!record) {\n throw err;\n } else {\n var newUser = record.values;\n console.log(\"Delivery Person Successfully created to test List Delivery Person feature\");\n }\n\n });\n }\n}", "title": "" }, { "docid": "de2070eb8d3312314824d02213c8f3aa", "score": "0.46422857", "text": "async publishNewTeamToEachUser () {\n\t\tawait Promise.all(this.users.map(async user => {\n\t\t\tawait this.publishNewTeamToUser(user);\n\t\t}));\n\t}", "title": "" }, { "docid": "e55f21d398588da5e4d860443a51643d", "score": "0.46364695", "text": "function iterator(obj) {\n\t\t\t\t\tif (!obj.data.SC_is_dm) {\n\t\t\t\t\t\tif (obj.data.user.id == blocked_userid) {\n\t\t\t\t\t\t\tMojo.Log.error(\"obj.data.user.id == %s, rejecting\", blocked_userid);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "b0af5c638e311596c954919342c76b6c", "score": "0.46332794", "text": "async loadAll() {\n let data = await PETianoFactory.query();\n await data.forEach(user => this.PETianos.set(user.Id, user));\n }", "title": "" }, { "docid": "1dff39cec839f6dbed1666200da7e057", "score": "0.46313637", "text": "function populateTestData() {\n console.info('test user data is being created');\n const testData = [];\n\n for (let i = 0; i < 1; i++) {\n testData.push(generateData());\n\n userData = testData[0];\n\n return userDataModel.insertMany(testData);\n }\n}", "title": "" }, { "docid": "cefce15a456c157b5753cc74acb1f7c0", "score": "0.46301544", "text": "async getAllUsers(){\n this.users={}\n this.setOfUsers={}\n const setUsers = function(users){\n console.log(users)\n this.users=users\n this.setOfUsers=new Set(users)\n }\n await getUsersData('all').then(setUsers.bind(this))\n }", "title": "" }, { "docid": "a68f4c86b338a7c1c195ce805408dd9b", "score": "0.46244892", "text": "findAllUsers() {\n return async function() {\n let foundUsers = await this._model.find({});\n return foundUsers;\n }.bind(this)();\n }", "title": "" }, { "docid": "61f0b6052724378a37cb1900aafca67c", "score": "0.46203178", "text": "hydrate() {\n try {\n const userIds = this.storage.getUserIds();\n this.users = userIds.map(id => User.hydrate(this, id));\n }\n catch (err) {\n // The storage was corrupted\n this.storage.clear();\n throw err;\n }\n }", "title": "" }, { "docid": "8d074af4d3e29bafe047cb077a2ea6c9", "score": "0.4617796", "text": "async populateUsers(network) {\n let userIds = {};\n for (let userName of Object.values(Users)) {\n let userId = await network.signIn({ userName: userName })\n this.players[userName].userId = userId;\n userIds[userName] = userId;\n }\n return userIds;\n }", "title": "" }, { "docid": "637b380778ef69339e5c36d38bcee921", "score": "0.46049476", "text": "componentWillMount() {\n const users = this.props.organization.users,\n validate = [];\n this.setState({\n changed: false,\n validate,\n noAdminWarning: \"\",\n saveButtonStyle: \"primary\"\n });\n users.forEach((user) => validate.push(undefined));\n }", "title": "" }, { "docid": "2bb19660d4f90c6b747792a1e7f636c9", "score": "0.46005043", "text": "function generate_users() {\n return new Promise(function(resolve, reject) {\n for (let i = 0; i < number_of_users; i++) {\n let user = null;\n randomUser()\n .then( (data) => {\n user = data;\n var username = user.username;\n return solid.web.createContainer(save_location, username);\n })\n .then(function(meta) {\n var url = meta.url;\n console.log(\"Directory was created at \" + url);\n user.directory = url;\n users.push(user);\n if (users.length == number_of_users) resolve();\n })\n .catch( (err) => {\n console.log(err);\n reject(err);\n });\n }\n });\n}", "title": "" }, { "docid": "4e861de9da1b7123a81ee81d06483ff7", "score": "0.4597733", "text": "function findNewUsers() {\n let newUserList = [];\n for (let id in db) {\n if(checkStartDate(db[id]) <= 30) {\n newUserList.push(db[id]);\n }\n }\n return newUserList; \n}", "title": "" }, { "docid": "7c60904bc757a66ad818740277c42604", "score": "0.45855752", "text": "function _all_user(cb) {\n\tasync.waterfall([\n\t\tfunction(callback) {\n\t\t\tvar sql = ' SELECT user_name_password.*, user_age.age, user_sex.sex, user_alias.alias, user_login_time.time AS login_time, user_enroll_time.time AS enroll_time, user_room.room_id FROM (user_room INNER JOIN (user_name_password INNER JOIN (user_age INNER JOIN (user_sex INNER JOIN (user_alias INNER JOIN (user_login_time INNER JOIN user_enroll_time ON user_enroll_time.user_id=user_login_time.user_id) ON user_alias.user_id=user_login_time.user_id) ON user_alias.user_id=user_sex.user_id) ON user_age.user_id=user_sex.user_id) ON user_name_password.id=user_age.user_id) ON user_room.user_id=user_name_password.id);';\n\t\t\tconnection.query(sql, callback);\n\t\t},\n\t\tfunction(result, field, callback) {\n\t\t\tvar users = [];\n\t\t\tresult.forEach(function(item) {\n\t\t\t\tvar u = new m.User().init(item);\n\t\t\t\tusers.push(u);\n\t\t\t});\n\t\t\tcallback(null, users);\n\t\t}\n\t], function(err, users) {\n\t\tif (cb) {\n\t\t\tif (err) {\n\t\t\t\tcb(err);\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcb(null, users);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "079a4cbbc3b7f82b06b2db0f60c487f0", "score": "0.45803493", "text": "function registerUsers(objects, error_function, done) {\n obj = objects.pop()\n User.register(obj, 'password', function(err, user) {\n error_function(err);\n if (objects.length > 0) registerUsers(objects, error_function, done)\n else done() \n }) \n}", "title": "" }, { "docid": "f8a6722a980c475186e08ccb2f0caea8", "score": "0.45755613", "text": "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "title": "" }, { "docid": "6b7aabef0157c49212b4188842f40106", "score": "0.45747414", "text": "validateResponse (data) {\n\t\tAssert.strictEqual(data.users.length, this.expectedUsers.length, `${this.expectedUsers.length} users should have been returned`);\n\t\tthis.expectedUsers.forEach(userType => {\n\t\t\tconst user = data.users.find(u => {\n\t\t\t\treturn u.email === this.requestData[userType].email;\n\t\t\t});\n\t\t\tAssert(user, `${userType} not found among the returned users`);\n\t\t});\n\t}", "title": "" }, { "docid": "155b888de56ae460f07ee6e54c2b3099", "score": "0.45741582", "text": "function fetchUsers(){\n fetch(`${BASE_URL}/users`)\n .then(resp => resp.json())\n .then(users => {\n \n // clear existing list\n \n for (const user of users){\n \n // let u = new User(user.id, user.name, user.username, user.email)\n let u = new User(user)\n USERS.push(u)\n // destructuring id: let user = {user.id, name: user.name, username:user.username}\n // destructuring const { id, name, username, email} = user\n u.renderUser()\n }\n \n \n })\n}", "title": "" }, { "docid": "3018b955f4e0bbb66816cbd041e38172", "score": "0.45714596", "text": "function seedUserData() {\n console.info('seeding bunky users data');\n const seedData = [];\n for (let i = 1; i <= 10; i++) {\n seedData.push({\n password: 'asssdf',\n username: 'mink76',\n EmailAddress: `${faker.name.firstName()}@asdf.com`,\n FirstName: faker.name.firstName(),\n LastName: faker.name.lastName(),\n withPlace: 'Yes',\n numRoomates: '2',\n budget: '1600+',\n culture: 'Private'\n });\n }\n // this will return a promise\n return User.insertMany(seedData);\n}", "title": "" }, { "docid": "bec405c29e95a0139ffab678fae28ea8", "score": "0.45529354", "text": "function isUserValid(user,pass){\n //database.forEach(i){ need to check the syntax\n for (i=0;i<database.length;i++){\n if (database[i].username === user\n && database[i].password === pass){\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "80c09c9fc73a9e008b8bab059490d0e2", "score": "0.4552675", "text": "async getUsers () {\n\t\tlet userIds = this.posts.reduce((accum, post) => {\n\t\t\tconst ids = this.getUserIdsByPost(post);\n\t\t\taccum.push.apply(accum, ids);\n\t\t\treturn accum;\n\t\t}, []);\n\t\tuserIds = ArrayUtilities.unique(userIds);\n\n\t\tthis.users = await this.data.users.getByIds(userIds);\n\t}", "title": "" }, { "docid": "9703437e3e6a77c430afc0988f86ee53", "score": "0.4549048", "text": "stepAll() {\r\n\t\tthis.room.instances.forEach(instance => instance.beginStep());\r\n\t\tthis.room.instances.forEach(instance => instance.step());\r\n\t\tthis.room.instances.forEach(instance => instance.endStep());\r\n\t}", "title": "" }, { "docid": "00242414fbf10f5d8a73ec91c2a84004", "score": "0.45442632", "text": "async function createInitialUsers() {\n console.log('Starting to create users...');\n try {\n\n const usersToCreate = [\n { username: 'albert', password: 'bertie99' },\n { username: 'sandra', password: 'sandra123' },\n { username: 'glamgal', password: 'glamgal123' },\n ]\n const users = await Promise.all(usersToCreate.map(createUser));\n\n console.log('Users created:');\n console.log(users);\n console.log('Finished creating users!');\n } catch (error) {\n console.error('Error creating users!');\n throw error;\n }\n}", "title": "" }, { "docid": "1b0224495e991e8434653d2a2316096d", "score": "0.45409006", "text": "function validValue() {\n for (let i = 0; i < input.length; i++) {\n if (input[i].classList.contains('js-valid-email')) {\n if (emailPattern.test(input[i].value) === false) {\n errorValid(input[i], errorMessage.invEmail)\n continueFlag = false;\n } else {\n continueFlag = true;\n resetBorderComplete(input[i])\n }\n }\n if (input[i].classList.contains('js-valid-password')) {\n if (input[i].value.length < 4) {\n errorValid(input[i], errorMessage.lengthPass);\n continueFlag = false;\n } else {\n continueFlag = true\n resetBorderComplete(input[i])\n }\n }\n }\n }", "title": "" }, { "docid": "eda74a45781f4148ac830b3c64d03f8d", "score": "0.45389926", "text": "function checkUsersValid (goodUsers) {\n return function allUsersValid (submittedUsers) {\n return submittedUsers.every(e => goodUsers.some(a => a === e));\n };\n}", "title": "" }, { "docid": "58d56d64ac8d7399b072eb1cc255e678", "score": "0.45384747", "text": "function createTrip(err) {\n if(err) console.error(err);\n\n // loop over the projects, construct and save an object from each one\n // Note that we don't care what order these saves are happening in...\n var to_save_count = trip_json.length; \n\n models.Activity.find().exec(addTrip);\n\n function addTrip(err, activities){\n var trips = [new models.Trip(trip_json[0]), new models.Trip(trip_json[1])];\n trips[0]._activityList.push(activities[0]._id);\n trips[0]._activityList.push(activities[1]._id);\n trips[1]._activityList.push(activities[2]._id);\n trips[1]._activityList.push(activities[3]._id);\n trips[0].save(saveTrip);\n trips[1].save(saveTrip);\n\n function saveTrip(err, trip) {\n if(err) return console.error(err);\n\n to_save_count--;\n console.log(to_save_count + ' left to save trip');\n// console.log(trip);\n if(to_save_count <= 0) {\n console.log('DONE');\n models.Trip.find(function(err, trip){\n console.log(trip);\n });\n }\n }\n \n models.User\n .find()\n .remove()\n .exec(createUser); // callback to continue at\n \n }\n\n}", "title": "" }, { "docid": "e020493686f47990cbdab3c3f0167940", "score": "0.45370674", "text": "function doUsersImport() {\n\n try {\n clearInterval(timer);\n\n const jsonData = fs.readFileSync(`${appRoot}/server-api/dataImports/dataFiles/${fileName}`);\n const users = JSON.parse(jsonData);\n\n // Count the total first.\n users.forEach((user) => totalNumOfUsers += 1 );\n\n users.forEach((user) => createUser(user));\n\n } catch (err) {\n logger.error(`ADMIN: Error importing the User collection into the database! Error: ${err}`);\n mongoose.disconnect();\n return;\n }\n}", "title": "" }, { "docid": "e2fc9941ffe0a0cfdec9024b78e60d68", "score": "0.45282793", "text": "async run () {\n if (this.allWallets.length) {\n await this.sync()\n }\n this.$dispatch('transaction/clearUnconfirmedVotes')\n const expiredTransactions = await this.$dispatch('transaction/clearExpired')\n for (const transactionId of expiredTransactions) {\n this.emit(`transaction:${transactionId}:expired`)\n this.$info(this.$t('TRANSACTION.ERROR.EXPIRED', { transactionId: truncateMiddle(transactionId) }))\n }\n\n await this.processUnconfirmedVotes()\n }", "title": "" }, { "docid": "7ffcdf889b6235c5d69565a6b05bcd79", "score": "0.45276558", "text": "async function createUsers() {\n await User.deleteMany({});\n await LocationBlog.deleteMany({});\n await Position.deleteMany({});\n return await db.collection('users').insertMany([\n userlist[0], userlist[1], userlist[2], userlist[3], { firstName: \"Kurt\", lastName: \"Wonnegut\", userName: \"kw\", password: \"test\", email: \"[email protected]\" }\n ,{ firstName: \"Hanne\", lastName: \"Wonnegut\", userName: \"hw\", password: \"test\", email: \"[email protected]\" }\n ]);//use foreach if more testdata needed\n}", "title": "" }, { "docid": "efbdc5b4ed7ec5ab068193db7ad3c223", "score": "0.45274743", "text": "function scanActiveUsers() {\n //console.log(\"Init: scan active users\");\n User.find({ is_active: true }, (err, users) => {\n if (err) console.log(\"Init: could not retrieve active users\");\n else {\n for (var user of users) {\n active_users.push(user.user_id);\n }\n //console.log(users);\n }\n\n // //console.log(`Active users: ${active_users}`);\n });\n}", "title": "" }, { "docid": "19cf182c5b2822a1494586cc98fa72aa", "score": "0.4527006", "text": "iterate() {\n // Flag if assignments have been changed or not\n let changed = false;\n\n // Assign each instance to the closest centroid\n for (let i = 0; i < this.data.length; i++) {\n let inst = this.data[i];\n inst.reset();\n\n // Calculate distance to each centroid\n for (let c = 0; c < this.centroids.length; c++) {\n let dist = this.dist_func(inst, this.centroids[c]);\n if (dist < inst.dist) {\n inst.centroid = c;\n inst.dist = dist;\n }\n }\n\n // Check if assignment for this instance has changed\n if (inst.centroid != inst.prev_centroid) {\n changed = true;\n }\n }\n\n // Move each centroid to mean\n for (let c = 0; c < this.centroids.length; c++) {\n let centroid = this.centroids[c];\n\n let new_x = new Array(centroid.no_attr()).fill(0);\n\n let cnt = 0;\n for (let i = 0; i < this.data.length; i++) {\n let inst = this.data[i];\n if (inst.centroid == c) {\n cnt++;\n for (let a = 0; a < centroid.no_attr(); a++) {\n new_x[a] += inst.x[a];\n }\n }\n }\n\n for (let a = 0; a < centroid.no_attr(); a++) {\n new_x[a] /= cnt;\n }\n centroid.x = new_x;\n }\n\n // Stop training if no new assignments were made\n if (!changed || this.current_iter >= this.max_iter) {\n this.training_done = true; \n }\n this.current_iter++;\n }", "title": "" }, { "docid": "bef0d8215ba2f1fe5733bab4c7b3b174", "score": "0.45268282", "text": "onSubmit(e) {\n e.preventDefault();\n let usersList = this.state.users;\n\n this.state.validate.forEach((status, idx) => {\n if (status === \"error\") {\n console.log(\"UserList: this.state.users[idx] \", this.state.users[idx]);\n // Ensure that there's at least one admin in the organization.\n for(let i = 0; i < usersList.length; i++) {\n if(usersList[i].perm === 0) {\n this.props.updateUser(this.state.users[idx]);\n return;\n } else if(i === usersList.length-1 && usersList[i].perm !== 0) {\n this.setState({\n noAdminWarning: \"Invalid Input: At least one Administrator required.\"\n });\n }\n }\n }\n });\n // As in componentWillMount, make the save button and input field higlighting invisible on successful submission.\n const users = this.props.organization.users,\n validate = [];\n this.setState({\n validate,\n changed: false\n });\n users.forEach((user) => validate.push(undefined));\n }", "title": "" }, { "docid": "fea73aebd7dec761fa2c6546e80bffef", "score": "0.45188928", "text": "async validate() {\n log.info(`Validating configuration.`);\n for (const site of this.sites) {\n await site.validate(this.base);\n }\n log.info(`Configuration validated.`);\n }", "title": "" }, { "docid": "179c52a388f9525159da0131b6da3acb", "score": "0.4515829", "text": "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "title": "" }, { "docid": "179c52a388f9525159da0131b6da3acb", "score": "0.4515829", "text": "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "title": "" }, { "docid": "179c52a388f9525159da0131b6da3acb", "score": "0.4515829", "text": "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "title": "" }, { "docid": "179c52a388f9525159da0131b6da3acb", "score": "0.4515829", "text": "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "title": "" }, { "docid": "179c52a388f9525159da0131b6da3acb", "score": "0.4515829", "text": "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "title": "" }, { "docid": "e4ab67b55c17edf580692125988d9346", "score": "0.45148304", "text": "function validatePlaneTrip() {\n\n for (var leg in $scope.planeLegs){\n var current = $scope.planeLegs[leg];\n // if StartDetails or EndDetails is false (no input), then the input was not filled\n // in from the autocomplete dropdown.\n if(!current.StartDetails || !current.EndDetails){\n toastr.error('Cities must be populated from the autocomplete dropdown. Please edit your plane trip.')\n return false;\n }\n }\n // If we get here, this means the form has been filled out correctly.\n return true;\n\n }", "title": "" }, { "docid": "59e062985884e83a60613ebafcad21f9", "score": "0.45128667", "text": "function capture_instances(resp, done_fcn){\n for (var i in resp.items){\n var instance = resp.items[i];\n done_fcn(instance);\n }\n}", "title": "" }, { "docid": "260d61d379cc7d80dad8e429fcaf8d07", "score": "0.45092484", "text": "async function seed() {\n let times = 19;\n try {\n const salt = bcrypt.genSaltSync(12);\n const hashPass = bcrypt.hashSync('test', salt);\n //create user\n const user = await User.create({\n email: '[email protected]',\n password: hashPass,\n name: 'test',\n });\n //este data es un ary\n const { data } = await axios.get(`https://fakestoreapi.com/products/`);\n console.log(data[times].image);\n do {\n // data.data.map((product) => console.log(product));\n\n const p = await Product.create({\n idUser: user.id,\n name: data[times].title,\n description: data[times].description,\n image: [data[times].image, data[times].image],\n price: data[times].price,\n // category: 'other',\n });\n // .then(console.log(data));\n\n await User.findByIdAndUpdate(user.id, { $push: { products: p._id } });\n await Product.find({ idUser: user.id }).populate('userCreator');\n times--;\n } while (times > 0);\n await mongoose.disconnect();\n console.log('done');\n } catch (error) {\n console.log(error);\n // console.log(\n // 'if MongoError: E11000 duplicate key error collection: mail, runs the seed again'\n // );\n }\n}", "title": "" }, { "docid": "5c2d259a6c5b346e8429090787df000a", "score": "0.450102", "text": "regenerateAll() { if (this.isAlive()) this._regenerateAlive(); }", "title": "" }, { "docid": "4292a31b3d85bbbea09b2b1b6464d1bf", "score": "0.44990286", "text": "async function findAllUsers() {\n try {\n const results = await user.findAll();\n console.log(results);\n } catch (error) {\n console.log(error.message);\n }\n}", "title": "" }, { "docid": "71a3e455d9b75c2dcb43a02c484472ec", "score": "0.44941288", "text": "function seedDB(){\n for(let i = 0 ; i < 20 ; i++){ \n // Insere 20 Usuarios - Senha padrão 123\n connection.query(`insert into clientes(nome_user,email_user,senha_user) values (\n ${faker.fake(\"'{{name.findName}}','{{internet.email}}','123'\")}\n )`,(err,result) => {\n if (err) throw err\n console.log(\"seeded 20 users!!!\")\n })\n // Insere 20 produtos\n connection.query(`insert into produtos(descricao,preco_unit,qtd_est,url_img) values (\n ${faker.fake(\"'{{commerce.productName}}','{{commerce.price}}',42,'https://tudoela.com/wp-content/uploads/2016/08/beneficios-da-melancia-810x540.jpg'\")}\n )`,(err,result) => {\n if (err) throw err\n console.log(\"seeded 20 users!!!\")\n })\n }\n }", "title": "" }, { "docid": "1b4c2515961f86922f34c89f8ef50ee7", "score": "0.449106", "text": "ValidateForm() {\n this.inputBoxes.forEach(ele => {ele.validate_function()});\n //loops through all input fields in the form\n return this.inputBoxes.every((ele) => {\n //loops through all error for a input field \n return ele.errorList.every((error) => {\n //returns false if validation is not correct\n return error.state;\n })\n });\n }", "title": "" }, { "docid": "f232e32ab2e8abbf7908b18a05e5ea28", "score": "0.44800267", "text": "function create_fh_users (cb) {\n // Durchläut Benutzer\n for (var i in template.users) {\n // Benutzer anlegen\n create_user_rest(template.users[i].student_id, template.users[i].firstname, template.users[i].lastname, template.users[i].student_id+\"@\"+argv.mail, argv.auth_id, i, function(data, number){\n \n g_users++;\n template.users[number].id = data.user.id;\n console.log(\"Benutzer '\"+data.user.login+\"' mit ID \"+data.user.id+\" erfolgreich angelegt.\");\n\n if (g_users == template.users.length) {\n console.log(\"Alle Benutzer angelegt.\");\n cb ();\n }\n });\n }\n}", "title": "" }, { "docid": "b015f7a35a0fd9fe30be59d04053307b", "score": "0.44773436", "text": "function createSampleAdmins(){\n for(loop = 0; loop < 3; loop++){\n var hashedPassword = generateHash(\"Comet123$\")\n db.Admin.create({\n 'name' : \"admin\"+loop,\n 'email' : \"admin\"+loop+\"@admin.com\",\n 'password' : hashedPassword\n }).success(function(record) {\n\n if (!record) {\n throw err;\n } else {\n var newUser = record.values;\n console.log(\"Admin Successfully created\");\n }\n\n });\n }\n}", "title": "" }, { "docid": "257617f782ddde7e68a3f8cbe986511a", "score": "0.4474861", "text": "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n\n this._instanceProperties = undefined;\n }", "title": "" }, { "docid": "93b6bb71fe998bcde0c4bdd3e859ae65", "score": "0.4471421", "text": "async fetchUsers() {\n const { candidates } = this.props;\n\n const availableUsers = await UserProvider.getAll();\n\n for (const candidate of candidates) {\n _.remove(availableUsers, (user) => {\n return user.id === candidate.id;\n });\n }\n\n this.setState({ availableUsers });\n }", "title": "" }, { "docid": "7930f3f4a51db96f05c7d254d6c6e024", "score": "0.44706005", "text": "function populateUsersLoop(merchants, merchants_index, merchants_length, users, forbiddenErrors) {\r\n if (merchants_index < merchants_length) {\r\n\r\n DataService.UserGetListForMerchant(merchants[merchants_index].MerchantID)\r\n .success(function (response1, status, header, config) {\r\n var new_users = response1;\r\n var merchantUsers = [];\r\n\r\n function addUserIfNotAlreadyExists(userList, newUser) {\r\n var wasFound = false;\r\n for (var index in userList) {\r\n if (userList[index].UserID == newUser.UserID) {\r\n wasFound = true;\r\n userList[index].MerchantsList.push(newUser.MerchantID);\r\n break;\r\n }\r\n }\r\n if (wasFound == false) {\r\n newUser.MerchantsList = [newUser.MerchantID];\r\n userList.push(newUser);\r\n }\r\n }\r\n\r\n for (var i = 0, len = new_users.length; i < len; i++) {\r\n new_users[i].MerchantID = merchants[merchants_index].MerchantID;\r\n addUserIfNotAlreadyExists(users, new_users[i]);\r\n\r\n var merchantUser = {\r\n UserID: new_users[i].UserID,\r\n MerchantID: new_users[i].MerchantID\r\n }\r\n merchantUsers.push(merchantUser);\r\n }\r\n\r\n //Adds the merhant id to the user object\r\n //for (var i = 0, len = new_users.length; i < len; i++) {\r\n // new_users[i].MerchantID = merchants[merchants_index].MerchantID;\r\n // users.push(new_users[i]);\r\n //}\r\n\r\n //if (users.length > 0) {\r\n // $(\"#UsersContainer\").append($(\"#UserTemplate\").render(users));\r\n // $(\"#Datalist\").append($(\"#DatalistTemplate\").render(users));\r\n //} else {\r\n // $(\"#UsersContainer\").append(\"<div class='NoUsersHeader Searchable' data-merchantid='\" + merchants[merchants_index].MerchantID + \"'>No users are available for this merchant.</div>\");\r\n //}\r\n\r\n if ($scope.MerchantUsers == undefined) {\r\n $scope.MerchantUsers = merchantUsers;\r\n } else {\r\n $scope.MerchantUsers = $scope.MerchantUsers.concat(merchantUsers);\r\n }\r\n\r\n merchants_index++;\r\n populateUsersLoop(merchants, merchants_index, merchants_length, users, forbiddenErrors);\r\n }).error(function (response, status, header, config) {\r\n if (status !== 403) {\r\n $scope.spinner.resolve();\r\n if (response == null) { response = \"\" }\r\n SMAAlert.CreateInfoAlert(\"Failed to retrieve users:<br><br>\" + response);\r\n } else {\r\n forbiddenErrors.push(merchants[merchants_index].MerchantID);\r\n merchants_index++;\r\n populateUsersLoop(merchants, merchants_index, merchants_length, users, forbiddenErrors);\r\n }\r\n });\r\n\r\n } else {\r\n if (users !== \"\") {\r\n for (var i = 0, len = users.length; i < len; i++) {\r\n if (users[i].userTeacher == undefined) {\r\n users[i].userTeacher = {\r\n TeacherID: \"\"\r\n }\r\n }\r\n if (users[i].UserName.substring(0, 9) == \"inactive-\") {\r\n users[i].userState = \"inactive\";\r\n } else {\r\n users[i].userState = \"active\";\r\n }\r\n }\r\n\r\n if (users.length > 0) {\r\n users.sort(function (a, b) {\r\n var nameA = a.LastName.toLowerCase();\r\n var nameB = b.LastName.toLowerCase();\r\n if (nameA < nameB) {\r\n return -1;\r\n } else if (nameA > nameB) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n });\r\n }\r\n $scope.userList = users.filter(function (e) {\r\n return e.Email.substring(0, 9) == \"INACTIVE-\" == false;\r\n });\r\n\r\n $scope.ArchivedUsers = users.filter(function (e) {\r\n return e.Email.substring(0, 9) == \"INACTIVE-\" == true;\r\n });\r\n }\r\n\r\n // Resolves the spinner once our psuedo loop finishes\r\n $scope.spinner.resolve();\r\n if (forbiddenErrors.length > 0) {\r\n console.log(\"Failed to retreive Users for the following Merchants:\");\r\n for (var i = 0, ii = forbiddenErrors.length; i < ii; i++) {\r\n console.log(forbiddenErrors[i]);\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "3aeaeab15ae2dab7de09c73870b22ba7", "score": "0.44678757", "text": "forEach(iterator) {\n // don't use _.each, because we can't break out of it.\n var keys = Object.keys(this._map);\n\n for (var i = 0; i < keys.length; i++) {\n var breakIfFalse = iterator.call(null, this._map[keys[i]], this._idParse(keys[i]));\n\n if (breakIfFalse === false) {\n return;\n }\n }\n }", "title": "" }, { "docid": "b3344bab41c0f9b01900b5f2a010f661", "score": "0.4466673", "text": "function run(user, test, core) {\r\n //console.log(test.trellises)\r\n var user_gates = core.get_user_gates(user);\r\n var result = new Result();\r\n\r\n for (var i in test.trellises) {\r\n var trellis_test = test.trellises[i];\r\n var trellis_gates = user_gates.filter(function (gate) {\r\n return trellis_test.is_possible_gate(gate);\r\n });\r\n if (trellis_gates.length == 0 || !core.check_trellis(user, trellis_test, trellis_gates)) {\r\n result.walls.push(new Wall(trellis_test));\r\n break;\r\n }\r\n\r\n for (var j in trellis_test.properties) {\r\n var condition = trellis_test.properties[j];\r\n if (condition.is_implicit && result.is_blacklisted(condition))\r\n continue;\r\n\r\n var property_gates = trellis_gates.filter(function (gate) {\r\n return condition.is_possible_gate(gate, trellis_test);\r\n });\r\n if (property_gates.length == 0 || !core.check_property(user, condition, property_gates)) {\r\n if (condition.is_implicit) {\r\n if (condition.property.name != condition.property.parent.primary_key)\r\n result.blacklist_implicit_property(condition);\r\n } else {\r\n result.walls.push(new Wall(condition));\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n //console.log(result)\r\n return core.post_process_result(result);\r\n}", "title": "" }, { "docid": "4b42c5946f039bfc97883c33f9c67acb", "score": "0.4464571", "text": "async function getUsers() {\n try {\n const slackUsers = await slackApi.user.list()\n if (!slackUsers.ok) {\n const err = new Error('Error in fetching users from slack')\n err.message = slackUsers.error\n throw err\n }\n for (const user of slackUsers.members) {\n const dbUser = transforUser(user)\n if (dbUser) {\n // create upsert to user table\n await userApi.upsert(dbUser)\n }\n }\n log.info('Current users saved to db')\n\n } catch (error) {\n log.log(error)\n throw error\n }\n}", "title": "" }, { "docid": "8f5ac5fb98a1953f5a35d03311ce114f", "score": "0.44640067", "text": "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n\n this._instanceProperties = undefined;\n }", "title": "" }, { "docid": "38fdbf3de664e51ab192e195c5118e81", "score": "0.44570163", "text": "validateSanitized (user, fields) {\n\t\t// because me-attributes are usually sanitized out (for other users), but not for the fetching user,\n\t\t// we'll need to filter these out before calling the \"base\" validateSanitized, which would otherwise\n\t\t// fail when it sees these attributes\n\t\tlet meAttributes = Object.keys(UserAttributes).filter(attribute => UserAttributes[attribute].forMe);\n\t\tmeAttributes.forEach(attribute => {\n\t\t\tlet index = fields.indexOf(attribute);\n\t\t\tif (index !== -1) {\n\t\t\t\tfields.splice(index, 1);\n\t\t\t}\n\t\t});\n\t\tsuper.validateSanitized(user, fields);\n\t}", "title": "" }, { "docid": "5c8f7c540da645d4493c3b31eb1a048d", "score": "0.44559273", "text": "async function getAllUsersFromDB(){\r\n\tvar data;\r\n\ttry{\r\n\t\tdata = await schemaModels.UserModel.find({})\r\n\t\tdata.forEach(function(obj){\r\n\t\t\tusersMap.set(obj.userId, obj);\r\n\t\t});\r\n\t\treturn usersMap;\r\n\t}catch(err){\r\n\t\tconsole.log(err);\r\n\t}\r\n}", "title": "" }, { "docid": "ef3c294852be4c3cef07abcd8ab99040", "score": "0.44541222", "text": "function validate() {\n\tfor (var i = 0; i < inputs.length; i++) {\n\t\tinputs[i].CustomValidation.checkInput();\n\t}\n}", "title": "" }, { "docid": "5c2f6fd47b6204e9d9f93e1b70b36bd2", "score": "0.44486377", "text": "validate() {\n for (var key in this.invalidatedProps) {\n this[prop] = this.invalidatedProps[prop];\n }\n\n for (var key in this.nextFrameCalls) {\n this.nextFrameCalls[key]();\n }\n\n this.invalidatedProps = {};\n this.nextFrameCalls = {};\n }", "title": "" } ]
16462d4645f971b27dde0e6a6ea770d2
Insert data END Weekday handler
[ { "docid": "41af0e370448cbcf4cc96266c150ce21", "score": "0.0", "text": "function WeekDay() {\n var x = 1;\n for (i = 0; i < 2; i++) {\n var d = new Date(),\n weekday = new Array(7);\n weekday[0] = \"Sunday\";\n weekday[1] = \"Monday\";\n weekday[2] = \"Tuesday\";\n weekday[3] = \"Wednesday\";\n weekday[4] = \"Thursday\";\n weekday[5] = \"Friday\";\n weekday[6] = \"Saturday\";\n weekday[7] = \"Sunday\";\n weekday[8] = \"Monday\";\n weekday[9] = \"Tuesday\";\n var n = weekday[d.getDay() + i + 2];\n x = x + 1;\n// document.getElementById('weekday' + x).innerHTML = n;\n }\n}", "title": "" } ]
[ { "docid": "c87a1a3c3cf8148e5fa05c8377f3dc2d", "score": "0.593873", "text": "function insertEvent (name, day) {\n if (name.length) {\n console.log('name is ' + name);\n } else {\n console.error('no name!');\n return;\n }\n \n console.log(day);\n \n if (day >0) {\n console.log('day is ' + day);\n } else {\n console.error('no day!');\n return;\n }\n \n \n var offset = 1;\n \n $($('td')[offset + (day - 1)]).append('<span class=\"event\">' + name + '</span>')\n \n console.log($('#eventName').val()); \n }", "title": "" }, { "docid": "00a2446fc2e1fabe5a00e4e5d7ae147e", "score": "0.5856659", "text": "nextWeek() {\n\t\tvar date = vali.getNextWeekStart();\n\t\tvar nextWeek = vali.getStartAndEnd(date);\n\t\tthis.db.insert({\n\t\t\tweekStart: new Date(nextWeek[0]).toISOString().substring(0, 10),\n\t\t\tweekEnd: new Date(nextWeek[6]).toISOString().substring(0, 10),\n\t\t\tdate: new Date(nextWeek[2]).toISOString().substring(0, 10),\n\t\t\tusername: \"[email protected]\",\n\t\t\tworkouts: {\n\t\t\t\tname: \"Morning swim\",\n\t\t\t\tdetails: \"20 mins\",\n\t\t\t\tcompleted: false,\n\t\t\t},\n\t\t});\n\t}", "title": "" }, { "docid": "416c783465647219848ef25e660c8904", "score": "0.58013725", "text": "function saveDay() {\n\t\tsources.day.save({onError: WAKL.err.handler});\n\t\tWAKL.caloriesWeightsChart.processChart(sources.day.date);\n\t}", "title": "" }, { "docid": "a91ae73bf7825026db4bdc6c411a2794", "score": "0.57664937", "text": "function next() {\n //let date = new Date(startingDate.value);\n setMonday();\n let date = new Date(currentDate);\n date.setDate(monday.getDate()+7);\n startingDate.value = getLocalDateFormat(date);\n currentDate = new Date(date);\n resetCells();\n appendWeek(date);\n fillCellsWithData();\n}", "title": "" }, { "docid": "81a7253c96b21717c2632cd9755eedc6", "score": "0.5750294", "text": "function appendtoWeekday() {\n for (let i = 0; i < $weekDayDiv.length; i++) {\n if ($weekDayDiv[i].className === fitClass.day) {\n $weekDayDiv.eq(i).append(classTemplate);\n }\n }\n }", "title": "" }, { "docid": "4627d6a9bdff658370a94248e85a4c86", "score": "0.56868863", "text": "function dropEventHandler(date, allDay, that){\n\n\t\tvar weekDays = [\"sun\", \"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\"];\n\n\t\t// Create a unique ID for the steps of the protocol to share\n\t\tvar instanceId;\n\n\t\t// Create a background color based on unique ID\n\t\t// But make sure it's a LIGHT color that can show white text! (ie 5-c hex)\n\t\tdo{\n\t\t\tinstanceId = \"xxxxxx\".replace(/[x]/g, function(c) {\n\t\t \tvar r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n\t\t \treturn v.toString(16);\n\t\t\t});\n\t\t} \n\t\twhile(parseInt(instanceId[0], 16) < 5 || parseInt(instanceId[0], 16) > 12 ||\n\t\t\t parseInt(instanceId[2], 16) < 5 || parseInt(instanceId[2], 16) > 12 ||\n\t\t\t parseInt(instanceId[4], 16) < 5 || parseInt(instanceId[4], 16) > 12 )\n\t\t\n\t\tvar instanceBgColor = instanceId[0].toString() + \n\t\t\t\t\t\t\t instanceId[2].toString() + \n\t\t\t\t\t\t\t instanceId[4].toString();\n\n\t\t// Render a single step\n\t\tif(that.getAttribute(\"data-container\") == \"false\"){\n\n\t\t\t// retrieve the dropped element's stored Event Object\n\t\t\tvar originalEventObject = $(that).data('eventObject');\n\t\t\t// we need to copy it, so that multiple events don't have a reference to the same object\n\t\t\tvar copiedEventObject = $.extend({}, originalEventObject);\n\n\t\t\t// assign it the date that was reported\n\t\t\tcopiedEventObject.start = date;\n\t\t\tcopiedEventObject.end = (new Date(date.getTime() + that.getAttribute(\"data-length\") * 1000));\n\t\t\tcopiedEventObject.allDay = that.getAttribute(\"data-allDay\") === \"true\" ? true : false;\n\n\t\t\t// Add step to database\n\t\t\tmodifyProtocolStep.enqueue(eventStep);\n\n\t\t\t// render the event on the calendar\n\t\t\t// the last `true` argument determines if the event \"sticks\" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)\n\t\t\t$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);\n\n\t\t// Read each sub-step of the DOM element to render multiple steps into a protocol\n\t\t} else {\n\n\t\t\t// retrieve the dropped element's stored Event Object\n\t\t\tvar originalEventObject = $(that).data('eventObject');\n\t\t\tvar timeTracker = date;\n\t\t\tvar i = 1;\n\n\t\t\t// Get each item in the container and add them to the calendar\n\t\t\twhile(that.getAttribute(\"data-step\"+i+\"-allDay\")){\n\t\t\t\t// Create an object to add to the calendar\n\t\t\t\tvar eventStep = {};\n\t\t\t\teventStep.eventId \t\t\t= that.getAttribute(\"data-step\"+i+\"-event-id\");\n\t\t\t\teventStep.instanceId\t\t= instanceId;\n\t\t\t\teventStep.verb \t\t\t\t= that.getAttribute(\"data-step\"+i+\"-verb\");\n\t\t\t\teventStep.allDay \t\t\t= false;\n\t\t\t\teventStep.locked \t\t\t= true;\n\t\t\t\teventStep.active \t\t\t= that.getAttribute(\"data-step\"+i+\"-active\");\n\t\t\t\teventStep.length \t\t\t= that.getAttribute(\"data-step\"+i+\"-length\");\n\t\t\t\teventStep.stepNumber \t\t= that.getAttribute(\"data-step\"+i+\"-step-number\");\n\t\t\t\teventStep.backgroundColor \t= \"#\" + instanceBgColor;\n\t\t\t\teventStep.textColor\t\t\t= \"#fff\";\n\t\t\t\teventStep.start \t\t\t= (new Date(timeTracker.getTime()));\n\t\t\t\teventStep.end \t\t\t\t= (new Date(timeTracker.getTime() + eventStep.length * 1000));\n\t\t\t\teventStep.notes = that.getAttribute(\"data-step\"+i+\"-notes\").length > 0 ? \n\t\t\t\t\t\t\t\t that.getAttribute(\"data-step\"+i+\"-notes\") : 'There are no notes for this event.';\n\n\t\t\t\t// Use this to decide the next step's .start\n\t\t\t\ttimeTracker = eventStep.end;\n\n\t\t\t\t// Send data to database\n\t\t\t\tmodifyProtocolStep.enqueue(eventStep, \"add\");\n\n\t\t\t\t// Add event to calendar\n\t\t\t\t$('#calendar').fullCalendar('renderEvent', eventStep, true);\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t// Send all the queued data\n\t\t\tmodifyProtocolStep.send();\n\n\t\t}\n\t}", "title": "" }, { "docid": "4a96f2eceb6cb1f35f296f59f0be552e", "score": "0.5587228", "text": "endOfWeek(){\n return this.addProp(this._time + ((7-this._dayOfWeek)*24*60*60*1000));\n }", "title": "" }, { "docid": "d067435b7b6cdf76abda0eff7e94d560", "score": "0.55637395", "text": "lastWeek() {\n\t\tvar date = vali.getPreviousWeekStart();\n\t\tvar previousWeek = vali.getStartAndEnd(date);\n\t\tthis.db.insert({\n\t\t\tweekStart: new Date(previousWeek[0]).toISOString().substring(0, 10),\n\t\t\tweekEnd: new Date(previousWeek[6]).toISOString().substring(0, 10),\n\t\t\tdate: new Date(previousWeek[6]).toISOString().substring(0, 10),\n\t\t\tusername: \"[email protected]\",\n\t\t\tworkouts: {\n\t\t\t\tname: \"Sunday swim\",\n\t\t\t\tdetails: \"30 mins\",\n\t\t\t\tcompleted: false,\n\t\t\t},\n\t\t});\n\t\tthis.db.insert({\n\t\t\tweekStart: new Date(previousWeek[0]).toISOString().substring(0, 10),\n\t\t\tweekEnd: new Date(previousWeek[6]).toISOString().substring(0, 10),\n\t\t\tdate: new Date(previousWeek[2]).toISOString().substring(0, 10),\n\t\t\tusername: \"[email protected]\",\n\t\t\tworkouts: {\n\t\t\t\tname: \"Afternoon Stroll\",\n\t\t\t\tdetails: \"45 mins\",\n\t\t\t\tcompleted: false,\n\t\t\t},\n\t\t});\n\t}", "title": "" }, { "docid": "169a6fbedaa88e9e9b898f7122b1b2e7", "score": "0.5552003", "text": "thisWeek() {\n\t\tvar currentWeek = vali.getDays();\n\t\tthis.db.insert({\n\t\t\tweekStart: new Date(currentWeek[0]).toISOString().substring(0, 10),\n\t\t\tweekEnd: new Date(currentWeek[6]).toISOString().substring(0, 10),\n\t\t\tdate: new Date(currentWeek[3]).toISOString().substring(0, 10),\n\t\t\tusername: \"[email protected]\",\n\t\t\tworkouts: {\n\t\t\t\tname: \"Outside jog\",\n\t\t\t\tdetails: \"45 mins\",\n\t\t\t\tcompleted: true,\n\t\t\t},\n\t\t});\n\t\tthis.db.insert({\n\t\t\tweekStart: new Date(currentWeek[0]).toISOString().substring(0, 10),\n\t\t\tweekEnd: new Date(currentWeek[6]).toISOString().substring(0, 10),\n\t\t\tdate: new Date(currentWeek[4]).toISOString().substring(0, 10),\n\t\t\tusername: \"[email protected]\",\n\t\t\tworkouts: {\n\t\t\t\tname: \"Morning swim\",\n\t\t\t\tdetails: \"20 mins\",\n\t\t\t\tcompleted: false,\n\t\t\t},\n\t\t});\n\t\tthis.db.insert({\n\t\t\tweekStart: new Date(currentWeek[0]).toISOString().substring(0, 10),\n\t\t\tweekEnd: new Date(currentWeek[6]).toISOString().substring(0, 10),\n\t\t\tdate: new Date(currentWeek[5]).toISOString().substring(0, 10),\n\t\t\tusername: \"[email protected]\",\n\t\t\tworkouts: {\n\t\t\t\tname: \"Weight Session\",\n\t\t\t\tdetails: \"20 mins\",\n\t\t\t\tcompleted: false,\n\t\t\t},\n\t\t});\n\t\tthis.db.insert({\n\t\t\tweekStart: new Date(currentWeek[0]).toISOString().substring(0, 10),\n\t\t\tweekEnd: new Date(currentWeek[6]).toISOString().substring(0, 10),\n\t\t\tdate: new Date(currentWeek[6]).toISOString().substring(0, 10),\n\t\t\tusername: \"[email protected]\",\n\t\t\tworkouts: {\n\t\t\t\tname: \"Sunday swim\",\n\t\t\t\tdetails: \"30 mins\",\n\t\t\t\tcompleted: false,\n\t\t\t},\n\t\t});\n\t}", "title": "" }, { "docid": "1c957e4c521f4e7b18351a8e14645259", "score": "0.5520397", "text": "function after_loadDay() {\n\t\tif (sources.day.length === 0) {\n\t\t\tnewDay();\n\t\t} else {\n\t\t\ttotalCalText.setValue(sources.day.totalCal);\n\t\t}\n\t\t\n\t\tWAKL.caloriesWeightsChart.processChart(sources.day.date);\n\t}", "title": "" }, { "docid": "bed58f7db74d770248c5e8983243ec00", "score": "0.5465315", "text": "function log_day( msg ) {\r\n\t\tvar index = ( DAYS_IN_WEEK * (current_week - 1) ) + current_day - 1;\r\n\t\tschedule[index] += msg + '<br>';\r\n\t}", "title": "" }, { "docid": "efcb6c1b00d3521072992db1c3ce4670", "score": "0.54022974", "text": "function addWeek(){\n var weeks = $('table#days tbody tr').size();\n\n var daysData = new Array();\n\n // starting new week\n dayCount = weeks*7;\n for(var i = 0; i < 7; i++){\n\n dayCount++;\n var dayData = new Object;\n var dayContent = $('<div class = \"workout\">');\n dayContent.append('<div class = \"day-number\">' + dayCount + '</div>');\n\n dayData.content = dayContent;\n dayData.day_number = dayCount;\n daysData[i] = dayData;\n }\n appendWeek(daysData);\n}", "title": "" }, { "docid": "790ee2f52493104c736e93e9d4c9ca19", "score": "0.5392022", "text": "function record(sheet,date,time,user_name,trigger_word,text,key){\r\n let day = check_day_of_week(key);\r\n let array = [[day,date,time]];\r\n\r\n switch(text){\r\n case \"clock-in\":\r\n clock_in(sheet,array,time,date);\r\n break;\r\n case \"clock-out\":\r\n clock_out(sheet,date,time);\r\n break;\r\n case \"overtime-in\":\r\n overtime_in(sheet,array,time,date);\r\n break;\r\n case \"overtime-out\":\r\n overtime_out(sheet,array,time,date);\r\n break;\r\n default:\r\n if (text.indexOf('confirmed:') != -1) {\r\n add_confirmed(sheet,date,text);\r\n }\r\n else{\r\n postSlack(\"insert data is invalid\");\r\n }\r\n break;\r\n }\r\n return;\r\n}", "title": "" }, { "docid": "b7724f93c6cd45704885c86dda6af077", "score": "0.5384903", "text": "function appendWeek(daysData){\n\n var week = $('<tr>');\n for(var i = 0; i < 7; i++){\n\n var day = $('<td class = \"no-pad\">');\n var dayDiv = daysData[i].content;\n\n dayDiv.data('day_number', daysData[i].day_number);\n\n day.append(dayDiv);\n week.append(day);\n }\n\n $('table#days tbody').append(week);\n}", "title": "" }, { "docid": "7c7ce91a8c5031fa184ea820029cff1b", "score": "0.5378257", "text": "function isWeekend(day) {\n\tif (day == 0 || day == 6) {\n\t\treturn true;\n\t} else {\n\t\treturn (day == 0 || day == 6);\n\t}\n\t//return (day == 0 || day == 6); <- autre syntaxe possible, écriture compacte de la même fonction\n}", "title": "" }, { "docid": "13421a18556ae4b823731a8a30f32a82", "score": "0.53721493", "text": "function dayEvent() {\n populateDataset();\n updateCanvas();\n}", "title": "" }, { "docid": "d5cb5e957ef6838eba6123b1a90e7dda", "score": "0.5366521", "text": "function endOfDay() {\n var d = new Date();\n\n var dayConfig = config.loadDay(d.getDay());\n hd.isTodayOff((isTodayOff) => { //Check if today is holidays\n global.db.each(knex.select().from('students').toString(), (err, row) => { //Iterate through students\n if (err) {\n log.error(\"Error while iterating through students in the database : \" + err);\n return;\n }\n var updateStdForTheDay = function(id, status, ntimeDiff, details) { //Function that update the students informations passed in parameter in the database\n\n if (isNaN(ntimeDiff)) {\n log.error(\"New time diff is NaN\");\n ntimeDiff = row.timeDiff;\n }\n global.db.run(knex(\"students\").where(\"id\", id).update({\n status: (status == global.STATUS.ABS) ? global.STATUS.ABS : global.STATUS.OUT,\n timeDiff: ntimeDiff,\n timeDiffToday: 0,\n details: JSON.stringify(details),\n hadLunch: 0,\n missedPause: -1\n }).toString());\n };\n var updateDetails = function(ndetails, ntimeDiff) { //Function that update student's details in the database\n ndetails.day.push({ //Days points\n time: moment().format(),\n timeDiff: ntimeDiff\n });\n if (moment(moment().format()).isSame(moment().endOf(\"week\"), 'day')) { //Week points\n\n ndetails.week.push({\n time: moment().format(),\n timeDiff: ntimeDiff\n });\n }\n if (moment(moment().format()).isSame(moment().endOf(\"month\"), 'day')) { //Month points\n ndetails.month.push({\n time: moment().format(),\n timeDiff: ntimeDiff\n });\n }\n };\n var ntimeDiff;\n if (row.status == global.STATUS.IN) { //Student's last status, is IN.\n ntimeDiff = row.timeDiff - dayConfig.timeToDo; //Substract the time to do\n log.save(global.LOGS.TIMEERROR, row.id, \"\", row.lastTagTime, \"Last status of the day was IN\", row.timeDiff, row.timeDiffToday);\n } else if (row.status == global.STATUS.ABS) {//ABSENT : Do nothing\n ntimeDiff = row.timeDiff\n } else if (!isTodayOff) { //Is not holidays\n ntimeDiff = row.timeDiff + (row.timeDiffToday - dayConfig.timeToDo);\n if (row.isBlocked) { //Check if student is blocked\n if (dayConfig.scheduleFix.length > 0) //Is today a work day ?\n if (new Date(row.lastTagTime) < new Date(math.secondsToDate(dayConfig.scheduleFix[dayConfig.scheduleFix.length - 1].end))) { //Last tag was before last schedule end time\n log.warning(\"USRID \" + row.id + \" : Left early. The accepted leaving time is \" + math.secondsToHms(dayConfig.scheduleFix[dayConfig.scheduleFix.length - 1].end));\n log.save(global.LOGS.TIMEERROR, row.id, \"\", row.lastTagTime, \"Left early (at \" + moment(row.lastTagTime).format(\"H:mm:ss\") + \")\", row.timeDiff, row.timeDiffToday);\n }\n } else {\n if (dayConfig.schedule.length > 0)//Is today a work day ?\n if (new Date(row.lastTagTime) < new Date(math.secondsToDate(dayConfig.schedule[dayConfig.schedule.length - 1].end))) {//Last tag was before last schedule end time\n log.warning(\"USRID \" + row.id + \" : Left early. The accepted leaving time is \" + math.secondsToHms(dayConfig.schedule[dayConfig.schedule.length - 1].end));\n log.save(global.LOGS.TIMEERROR, row.id, \"\", row.lastTagTime, \"Left early (at \" + moment(row.lastTagTime).format(\"H:mm:ss\") + \")\", row.timeDiff, row.timeDiffToday);\n }\n }\n\n }\n if (!row.hadLunch && row.status != global.STATUS.ABS && dayConfig.lunch && !isTodayOff) //Has he lunched ? is today a lunch day ?\n {\n log.info(\"USRID \" + row.id + \" : Missed lunch\");\n log.save(global.LOGS.NOLUNCH, row.id, \"SERVER\", null, \"\", row.timeDiff, row.timeDiffToday);\n }\n\n var ndetails;\n try {\n ndetails = JSON.parse(row.details); //Parse details\n if (ndetails == null) {\n ndetails.day = [];\n ndetails.week = [];\n ndetails.month = []\n };\n } catch (err2) {\n\n ndetails = {\n day: [],\n week: [],\n month: []\n };\n }\n if (isTodayOff) { //Is Holidays\n ntimeDiff = row.timeDiff + row.timeDiffToday;\n ntimeDiff += (row.missedPause <= 0) ? 0 : (Math.floor(row.missedPause) * (-20 * 60));\n log.save(global.LOGS.ENDOFDAY, row.id, \"\", moment().format(), \"Function executed (Holidays) \", ntimeDiff, 0);\n } else {\n if (row.status != global.STATUS.ABS) { //Check for leave req\n\n ntimeDiff -= (row.missedPause <= 0) ? 0 : (Math.floor(row.missedPause) * (20 * 60));\n lr.getTimeToRefund(row.id, (res) => { //Get time to be refunded\n ntimeDiff += res;\n if (dayConfig.lunch && !res)\n ntimeDiff -= (row.hadLunch) ? 0 : global.config.lunch.time; //Substract time in case of missed lunch\n if (res) {\n log.info(\"Time refunded to student \" + row.id + \" : \" + res + \" seconds\");\n log.save(global.LOGS.LEAVEREQ, row.id, \"\", moment().format(), \"Time refunded \" + math.secondsToHms(res) , ntimeDiff, 0);\n }\n log.save(global.LOGS.ENDOFDAY, row.id, \"\", moment().format(), \"Function executed\", ntimeDiff, 0);\n updateDetails(ndetails, ntimeDiff);\n updateStdForTheDay(row.id, row.status, ntimeDiff, ndetails);\n });\n return;\n } else {\n\n log.save(global.LOGS.ENDOFDAY, row.id, \"\", moment().format(), \"Function executed (Absent)\", ntimeDiff, 0);\n }\n\n }\n updateDetails(ndetails, ntimeDiff);\n updateStdForTheDay(row.id, row.status, ntimeDiff, ndetails);\n }, (err, nb) => {\n if (err) {\n log.error(\"Error : \" + err);\n return;\n }\n log.info(\"Function done ! \" + nb + \" students treated.\");\n });\n });\n\n}", "title": "" }, { "docid": "60d8da0cdcd85a4cc4d8597313a267fd", "score": "0.5365064", "text": "function writeEvent(et, seg, id, vt, dotw, time, sd){\n var weekdays = ['Sunday', 'Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];\n var type = ['Private', 'Comercial', 'Truck'];\n // create a JSON object\n const event = {\n \"Event_type\": et,\n \"Segment\": seg,\n \"id\" : id,\n \"vehicle_type\": type[vt],\n \"Day_of_the_week\" : weekdays[dotw],\n \"Time\": time,\n \"Special_day\": sd\n };\n // console.log(event);\n\n kafkaPublisher.publish(event);\n}", "title": "" }, { "docid": "5967e3ede6c364adcd5d06393340f8a3", "score": "0.53457105", "text": "function hc_characterdatainsertdataend() {\n var success;\n if(checkInitialization(builder, \"hc_characterdatainsertdataend\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"strong\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.insertData(15,\", Esquire\");\n childData = child.data;\n\n assertEquals(\"characterdataInsertDataEndAssert\",\"Margaret Martin, Esquire\",childData);\n \n}", "title": "" }, { "docid": "72f3e142a0a2603c711c66cc705b2028", "score": "0.5328992", "text": "function characterdatainsertdataend() {\n var success;\n if(checkInitialization(builder, \"characterdatainsertdataend\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"name\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.insertData(15,\", Esquire\");\n childData = child.data;\n\n assertEquals(\"characterdataInsertDataEndAssert\",\"Margaret Martin, Esquire\",childData);\n \n}", "title": "" }, { "docid": "bf151f49f85143ab1fcb8ccf9b7f0aa6", "score": "0.5313594", "text": "function on_day(day) {\n\t\t\t$(\"#main_temp h1\").html(max[day]+\"&#176; <span></span>\");\n\t\t\t$(\"#main_temp h1 span\").html(\"\\t\"+min[day]+\"&#176;\");\n\t\t\t$(\"#main_icon\").attr(\"src\", icon[day]);\n\t\t\t$(\"#day1\").css(\"border-color\", \"white\");\n\t\t\t$(\"#humidity\").html(\"Humidity: \"+humidity[day]+\"%\");\n\t\t\t$(\"#pressure\").html(\"Pressure: \"+pressure[day]+\" hPa\");\n\t\t\t$(\"#wind\").html(\"Wind: \"+wind[day]+\" meter/s\");\n\t\t}", "title": "" }, { "docid": "bf151f49f85143ab1fcb8ccf9b7f0aa6", "score": "0.5313594", "text": "function on_day(day) {\n\t\t\t$(\"#main_temp h1\").html(max[day]+\"&#176; <span></span>\");\n\t\t\t$(\"#main_temp h1 span\").html(\"\\t\"+min[day]+\"&#176;\");\n\t\t\t$(\"#main_icon\").attr(\"src\", icon[day]);\n\t\t\t$(\"#day1\").css(\"border-color\", \"white\");\n\t\t\t$(\"#humidity\").html(\"Humidity: \"+humidity[day]+\"%\");\n\t\t\t$(\"#pressure\").html(\"Pressure: \"+pressure[day]+\" hPa\");\n\t\t\t$(\"#wind\").html(\"Wind: \"+wind[day]+\" meter/s\");\n\t\t}", "title": "" }, { "docid": "aaf1d774575cd6ae270a9820d408c289", "score": "0.53102034", "text": "function isWeekend(){\n var week = Utilities.formatDate(new Date(), 'Asia/Tokyo', 'u');\n if (week == 6 || week == 7) {\n return true;\n }\n}", "title": "" }, { "docid": "4954406866dfa74550ad71ca8b2cd0fc", "score": "0.5288401", "text": "function newDay() {\n\t\ttotalCalText.setValue(0);\n\t\tsources.day.addNewElement();\n\t\tsources.day.date = currentDay.toDate();\n\t\tsaveDay();\n\t}", "title": "" }, { "docid": "95aa594d185391c484890d4d90fceb2e", "score": "0.5279679", "text": "function updateForecastTableBodyMobile(apiData) {\n\n let days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']\n\n $.each(apiData, function (key, val) {\n let dateObject = new Date(val.date);\n let day = days[dateObject.getDay()];\n $('#forecast-tbl-body-mobile').append('<tr><td><strong>' + day + '</strong></td><td><img src=\"' + val.day.condition.icon + '\" /></td>' +\n '<td><strong>Avg. Temp: </strong>' + val.day.avgtemp_c + '&#8451 </td>');\n });\n}", "title": "" }, { "docid": "156f8d7a4644550f7da925705ae457b0", "score": "0.5202411", "text": "writeDays(data) { \r\n const { days, dayDate, dateformat } = config;\r\n _.forEach(days, day => {\r\n let text = data.fromDate.day(day).format('dddd');\r\n if (dayDate) {\r\n const dateString = data.fromDate.day(day).format(dateformat);\r\n text = `${text} - ${dateString}`;\r\n }\r\n writeSubHeader(data, text, 3);\r\n });\r\n }", "title": "" }, { "docid": "570e7190049330b7cb7d1327317ecd62", "score": "0.51612586", "text": "function calcWeekday() {\r\n\t\t// fetch values\r\n\t\tvar m = document.getElementById(\"edit-field-event-date-und-0-value-month\");\r\n\t\tvar mid = m.options[m.selectedIndex].value;\r\n\t\t$('#edit-field-event-date-und-0-value2-month').val(mid);\r\n\t\tif (mid.length == '1') {\r\n\t\t\tmid = \"\".concat(\"0\", mid);\r\n\t\t}\r\n\t\tconsole.log(mid);\r\n\t\tvar d = document.getElementById(\"edit-field-event-date-und-0-value-day\");\r\n\t\tvar did = d.options[d.selectedIndex].value;\r\n\t\t$('#edit-field-event-date-und-0-value2-day').val(did);\r\n\r\n\t\tvar y = document.getElementById(\"edit-field-event-date-und-0-value-year\");\r\n\t\tvar yid = y.options[y.selectedIndex].value;\r\n\t\t$('#edit-field-event-date-und-0-value2-year').val(yid);\r\n\r\n\t\tvar dateString = mid.concat(\"/\", did, \"/\", yid);\r\n\r\n\t\tvar date = new Date(dateString);\r\n\r\n\t\tvar weekdays = new Array(7);\r\n\t\tweekdays[0] = \"Sunday\";\r\n\t\tweekdays[1] = \"Monday\";\r\n\t\tweekdays[2] = \"Tuesday\";\r\n\t\tweekdays[3] = \"Wednesday\";\r\n\t\tweekdays[4] = \"Thursday\";\r\n\t\tweekdays[5] = \"Friday\";\r\n\t\tweekdays[6] = \"Saturday\";\r\n\t\tvar wid = date.getDay();\r\n\t\tvar weekday = weekdays[wid];\r\n\t\tconsole.log(weekday);\r\n\t\t$('head').append('<style>.form-item-field-event-date-und-0-all-day:before{content:\"' + weekday + '\"; text-transform: uppercase; color: #767676; font-weight: bold; padding: 0px 5px 0px 5px; }</style>');\r\n\t}", "title": "" }, { "docid": "ab3a1c85080b487530c97cac3622d76f", "score": "0.5160183", "text": "function newDatabase() {\r\n var userId = firebase.auth().currentUser.uid;\r\n firebase.database().ref(\"users/\" + userId).update({\r\n \"calendar\": {\r\n \"week48\": {\r\n \"day0\": {\r\n \"morning\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T06:00:00.000\",\r\n \"end\": \"2018-12-02T11:00:00.000\"\r\n },\r\n \"afternoon\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T12:00:00.000\",\r\n \"end\": \"2018-12-02T17:00:00.000\"\r\n },\r\n \"night\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T18:00:00.000\",\r\n \"end\": \"2018-12-02T23:00:00.000\"\r\n }\r\n },\r\n \"day1\": {\r\n \"morning\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T06:00:00.000\",\r\n \"end\": \"2018-12-02T11:00:00.000\"\r\n },\r\n \"afternoon\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T12:00:00.000\",\r\n \"end\": \"2018-12-02T17:00:00.000\"\r\n },\r\n \"night\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T18:00:00.000\",\r\n \"end\": \"2018-12-02T23:00:00.000\"\r\n }\r\n },\r\n \"day2\": {\r\n \"morning\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T06:00:00.000\",\r\n \"end\": \"2018-12-02T11:00:00.000\"\r\n },\r\n \"afternoon\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T12:00:00.000\",\r\n \"end\": \"2018-12-02T17:00:00.000\"\r\n },\r\n \"night\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T18:00:00.000\",\r\n \"end\": \"2018-12-02T23:00:00.000\"\r\n }\r\n },\r\n \"day3\": {\r\n \"morning\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T06:00:00.000\",\r\n \"end\": \"2018-12-02T11:00:00.000\"\r\n },\r\n \"afternoon\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T12:00:00.000\",\r\n \"end\": \"2018-12-02T17:00:00.000\"\r\n },\r\n \"night\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T18:00:00.000\",\r\n \"end\": \"2018-12-02T23:00:00.000\"\r\n }\r\n },\r\n \"day4\": {\r\n \"morning\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T06:00:00.000\",\r\n \"end\": \"2018-12-02T11:00:00.000\"\r\n },\r\n \"afternoon\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T12:00:00.000\",\r\n \"end\": \"2018-12-02T17:00:00.000\"\r\n },\r\n \"night\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T18:00:00.000\",\r\n \"end\": \"2018-12-02T23:00:00.000\"\r\n }\r\n },\r\n \"day5\": {\r\n \"morning\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T06:00:00.000\",\r\n \"end\": \"2018-12-02T11:00:00.000\"\r\n },\r\n \"afternoon\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T12:00:00.000\",\r\n \"end\": \"2018-12-02T17:00:00.000\"\r\n },\r\n \"night\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T18:00:00.000\",\r\n \"end\": \"2018-12-02T23:00:00.000\"\r\n }\r\n },\r\n \"day6\": {\r\n \"morning\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T06:00:00.000\",\r\n \"end\": \"2018-12-02T11:00:00.000\"\r\n },\r\n \"afternoon\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T12:00:00.000\",\r\n \"end\": \"2018-12-02T17:00:00.000\"\r\n },\r\n \"night\": {\r\n \"event\": false,\r\n \"eventName\": \"null\",\r\n \"eventLocation\": \"null\",\r\n \"eventFriends\": \"null\",\r\n \"eventNotes\": \"null\",\r\n \"start\": \"2018-12-02T18:00:00.000\",\r\n \"end\": \"2018-12-02T23:00:00.000\"\r\n }\r\n }\r\n }\r\n },\r\n\r\n });\r\n}", "title": "" }, { "docid": "24656f0bc1c6f6f2ca48cf8d1bbc7487", "score": "0.51522255", "text": "function printDayWeek(thisData){\n //convert the date into a moment obj\n var dataMoment = moment(thisData);\n //get the day of the week\n var weekDay = moment(dataMoment).day();\n console.log(weekDay);\n //check which day of week is\n var dayWeek = $('#weekDay');\n switch(weekDay) {\n case 0:\n dayWeek.text('Sunday');\n break;\n case 1:\n dayWeek.text('Monday');\n break;\n case 2:\n dayWeek.text('Tuesday');\n break;\n case 3:\n dayWeek.text('Wednesday');\n break;\n case 4:\n dayWeek.text('Thursday');\n break;\n case 5:\n dayWeek.text('Friday');\n break;\n case 6:\n dayWeek.text('Saturday');\n break;\n default:\n dayWeek.text('Error');\n }\n}", "title": "" }, { "docid": "d9af1c41d441aca4e032e72d356f01e7", "score": "0.51164967", "text": "function insertDataToWeekdayChart(responseSpeed,ResponseClock){\n let weekdayCounter = [0,0,0,0,0,0,0];\n\n let weekdayResponseTimeSum = [0,0,0,0,0,0,0];\n\n let i=0;\n let b=0;\n let newDate;\n while(ResponseClock[i] != null){\n newDate = new Date(ResponseClock[i]*1000);\n b=0;\n for(b;b<7;b++){\n\n if(weekday[newDate.getDay()] == weekday[b]){\n weekdayCounter[b]++;\n weekdayResponseTimeSum[b] += responseSpeed[i];\n break;\n }\n }\n \n i++;\n } \n let chartDataLabels =[];\n let chartDataAvarageTime =[];\n\n for(let a=0;a<7;a++){\n if(weekdayResponseTimeSum[a] != 0){\n weekdayResponseTimeSum[a] /= weekdayCounter[a];\n weekdayResponseTimeSum[a] = Math.round(weekdayResponseTimeSum[a] * Math.pow(10, 4)) / Math.pow(10, 4);\n chartDataLabels.push(weekday[a]);\n chartDataAvarageTime.push(weekdayResponseTimeSum[a]);\n }\n } \n\n weekDayChart.data.datasets[0].data = chartDataAvarageTime;\n weekDayChart.data.labels = chartDataLabels;\n weekDayChart.update();\n weekDayChart.resize();\n }", "title": "" }, { "docid": "2b6c9be857b5143af4a408d8bdf994d4", "score": "0.51090544", "text": "function createEvents() {\n // Refer to the JavaScript quickstart on how to setup the environment:\n// https://developers.google.com/google-apps/calendar/quickstart/js\n// Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any\n// stored credentials.\n\nlogToOutput(\"Kurse werden aus dem Vorlesungsverzeichnis geparst, bitte warten...\");\n\nvar batch = gapi.client.newBatch();\n\nvar calendar = {\n 'summary' : 'FHP Vorlesungen',\n 'timeZone': \"Europe/Berlin\"\n};\n\nvar request = gapi.client.calendar.calendars.insert({resource: calendar});\nrequest.execute(function(fhpCalendar){\n console.log(fhpCalendar.id);\n logToOutput(\"Neuer FHP Kalender erstellt.\");\n\n $.get('vz-reader.php', {source: $(\"#vz-selector\").val()}).done(function(data) {\n\n $.each(data, function(index, value){\n console.log(value[\"titel\"]);\n logToOutput(\"Kurs gefunden: \\\"\"+value[\"titel\"]+\"\\\"\");\n\n var dateValue = 'dateTime';\n\n if (value['begin'].length <= 10) {\n dateValue = 'date';\n }\n\n var event = {\n 'summary': value[\"modul\"]+\" | \"+value[\"titel\"],\n 'location': value[\"raum\"],\n 'description': value[\"titel\"],\n 'colorId': value[\"colorId\"],\n 'start': {\n 'timeZone': 'Europe/Berlin'\n },\n 'end': {\n 'timeZone': 'Europe/Berlin'\n },\n 'recurrence': [\n 'RRULE:FREQ=WEEKLY;COUNT=1'\n ],\n 'reminders': {\n 'useDefault': true\n }\n };\n\n event['start'][dateValue] = value['begin'];\n event['end'][dateValue] = value['end'];\n\n //console.log(event);\n\n //if (index == 2) return false;\n\n var request = gapi.client.calendar.events.insert({\n 'calendarId': fhpCalendar.id,\n 'resource': event\n });\n\n batch.add(request);\n\n });\n\n console.log(\"executing\");\n logToOutput(\"Kurse werden als Ereignis eingetragen...\");\n\n batch.execute(function(responseMap,rawBatchResponse) {\n console.log(responseMap);\n logToOutput('Fertig! Die Kurse sollten jetzt in <a href=\"https://calendar.google.com/\" title=\"Meinen Google Kalender Anzeigne\">deinem Google Kalender</a> zu sehen sein!');\n });\n\n });\n});\n}", "title": "" }, { "docid": "017003b50810cd17e66bc0b79d182a24", "score": "0.50989085", "text": "function isDay_lastWeek(day){\n\t\t\tvar now = new Date();\n\t\t\tif (Math.round((now - day) / (24 * 60 * 60 * 1000)) < 8) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "692288efb96c80f1c47a2d9f3ed8bfc8", "score": "0.50758296", "text": "function updateEvent(data){\n switch(data.type){\n case \"Holiday\":\n holidayArray = data.array;\n break;\n case \"Meeting\":\n meetingArray = data.array;\n break;\n case \"Milestone\":\n milestoneArray = data.array;\n break;\n default: \n console.log(\"Event not found.\");\n }\n refreshCalendar();\n }", "title": "" }, { "docid": "afba417fc640c5e414440368c71671a2", "score": "0.50748813", "text": "handle7DayRecords() {\n HabitRecord.getFilteredRecords(\"last7\", this).then(json => {\n HabitRecord.initializeRecords(json, this);\n HabitRecord.render7DayProgress(json, this);\n })\n }", "title": "" }, { "docid": "5e6ea2a9de765730e0430bbd3811ab61", "score": "0.5066139", "text": "static saveDay(day, onCompletionCallback) {\n this.dayExists(day.date, function (foundData, index) {\n let localData = DailyReconciliationAPI.getLocalData();\n localData[index] = day;\n DailyReconciliationAPI.setLocalData(localData);\n onCompletionCallback();\n });\n }", "title": "" }, { "docid": "37f350e43a2315148f645b23aaf91e63", "score": "0.50317115", "text": "handleCalendarClick(clickEvent, week, day, meal) {\n // just adds to the calendar so it doesn't return anything\n console.log(\"week=\", week, \"day=\", day, \"meal=\", meal);\n addRecipeToCalendar(this.state._id, '000000000000000000000001', week, day, meal, (data) => {});\n alert(\"Recipe added to calendar!\");\n }", "title": "" }, { "docid": "0930ab5537f22cbe32841d20bbc52566", "score": "0.5025154", "text": "function calAddEvents() {\n var cal = CalendarApp.getDefaultCalendar(),\n ss = \n SpreadsheetApp.getActiveSpreadsheet(),\n sh = ss.getSheetByName('Holidays'),\n holDates = \n sh.getRange('A1:A9').getValues().map(\n function (row) {\n return row[0];\n });\n holDates.forEach(\n function (holDate) {\n var calEvent;\n calEvent = \n cal.createAllDayEvent('Holiday',\n holDate);\n calEvent.setDescription(\n 'Forget about work')\n });\n}", "title": "" }, { "docid": "a6b58bcb4f128e6a3e0ddbd22fbbd07f", "score": "0.50118", "text": "function weekend (day) {\n day = day.toLowerCase()\n let weekend = [\"saturday\",\"sunday\"]\n let week = [\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\"]\n if(weekend.includes(day)){\n alert(\"weekend\")\n } else if(week.includes(day)){\n alert(\"week day\")\n } else {\n alert(\"try again\")\n }\n}", "title": "" }, { "docid": "1f45625599faef77a77f7928d46f616e", "score": "0.50055796", "text": "function deleteEvent(data){\n switch(data.type){\n case \"Holiday\":\n holidayArray = data.array;\n break;\n case \"Meeting\":\n meetingArray = data.array;\n break;\n case \"Milestone\":\n milestoneArray = data.array;\n break;\n case \"Time\":\n timeArray = data.array;\n default: \n console.log(\"Event not found.\");\n }\n refreshCalendar();\n }", "title": "" }, { "docid": "e98fc7e65d018d1f00219d975194adab", "score": "0.50055796", "text": "function isValidDay() { return current_day <= DAYS_IN_WEEK; }", "title": "" }, { "docid": "c681be0ca152054ba6c7a82d00899e1d", "score": "0.49921495", "text": "function createEvent(day, url) {\n var calendarId = 'primary';\n var start = getRelativeDate(day, 0);\n var end = getRelativeDate(day, 23);\n var colour = -1;\n var desc = \"\";\n \n /* days start from index #1\n * day index 1 - 27 (27 days)\n * day index 28- 54 (27 days)\n */\n if((day+1) <= 27){\n // Used in description\n\tdesc = \"Błaganie\";\n\tcolour = 8;\n }else{\n\tdesc = \"Dziękczynienie\";\n\tcolour = 2;\n }\n \n var sd = Utilities.formatDate(start, 'Australia/Melbourne', 'yyyy-MM-dd');\n var ed = Utilities.formatDate(end, 'Australia/Melbourne', 'yyyy-MM-dd');\n \n Logger.log('sd: ' + sd);\n var message = \"\";\n if(url==\"no_video\"){\n\t// When there is no video available\n\tmessage = desc +\"<br>\" +\"Keep going\";\n }else{\n\tmessage = desc +\"<br>\" +\"Video: http://youtube.com\" +url;\n }\n var event = {\n summary: 'Day ' +(day+1),\n location: '',\n description: message +'<br><br>' +prayer,\n start: {\n date: sd,\n },\n end: {\n date: ed,\n },\n\treminders: {\n\t\tuseDefault: false\n\t},\n // Use Calendar.Colors.get() for the full list.\n colorId: colour\n };\n event = Calendar.Events.insert(event, calendarId);\n Logger.log('Event ID: ' + event.id);\n}", "title": "" }, { "docid": "8350699fc4e5e6576ba05f362ee5a707", "score": "0.49848542", "text": "function liveTrigger() {\n // Sunday Services\n checkLive(date, sundayStartS1, sundayEndS1, sundayDay);\n checkLive(date, sundayStartS2, sundayEndS2, sundayDay);\n}", "title": "" }, { "docid": "477e67ba54a5133081efbaed48660cef", "score": "0.49799767", "text": "function updateCalendar() {\n var chemSchedDoc = DocumentApp.openByUrl(schedUrl);\n var chemHWDoc = DocumentApp.openByUrl(HWUrl);\n var schedTable = chemSchedDoc.getBody().getTables()[0]; // there's only one table in each document\n var HWTable = chemHWDoc.getBody().getTables()[0];\n var calendar = CalendarApp.getCalendarById(calendarId);\n \n var todaysRowIndex = schedTable.getChildIndex(schedTable.findText(dateTableNotation(new Date())).getElement().getParent().getParent().getParentRow());\n \n for (var i = todaysRowIndex; i < schedTable.getNumRows(); i++) { // Start from today and work down the table\n var currentRow = schedTable.getRow(i);\n var currentDate = new Date(currentRow.getCell(0).getText());\n clearEventsOnDay(calendar, currentDate);\n var HWTitles = HWTitlesFromRow(currentRow);\n for (var j = 0; j < HWTitles.length; j++) {\n var HWTitle = HWTitles[j];\n var currentHW = HWTableQueryStringFromTitle(HWTitle);\n var HWContent = HWFromQueryString(currentHW, HWTable);\n if (!HWContent) {\n HWContent = HWNotFoundMessage + HWUrl;\n }\n var ev = calendar.createAllDayEvent(HWTitle, currentDate);\n ev.setDescription(HWContent);\n }\n }\n}", "title": "" }, { "docid": "76b19b6d043db6b835b80b9f99e447fd", "score": "0.49666244", "text": "function WeekDay(day) {\n\t\t// the original day\n\t\tthis.origin = day;\n\t\t\n\t\t/*\n\t\t * PRIVATE\n\t\t * set events to match type, null if don't have\n\t\t */\n\t\tthis.setEvent = function(type) {\n\t\t\tif (!isNull( this.origin ) && !isNull( this.origin.events )) {\n\t\t\t\tvar event = [];\n\t\t\t\tvar j=0;\n\t\t\t\t// not normal\n\t\t\t\tif (isNull( type )) {\n\t\t\t\t\tfor (var i=0; i < this.origin.events.length; i++) {\n\t\t\t\t\t\tswitch (this.origin.events[i].type) {\n\t\t\t\t\t\t\tcase \"all\": \n\t\t\t\t\t\t\t\tevent[j++] = new AllEvent(this.origin.events[i]); break;\n\t\t\t\t\t\t\tcase \"over\": \n\t\t\t\t\t\t\t\tvar start = this.origin.events[i].origin.start.dateTime;\n\t\t\t\t\t\t\t\t// the first day OR first day of the week (the event across week)\n\t\t\t\t\t\t\t\tvar date = this.origin.date;\n\t\t\t\t\t\t\t\tvar year = this.origin.year;\n\t\t\t\t\t\t\t\tvar month = this.origin.month;\n\t\t\t\t\t\t\t\tif (start.getFullYear() == year && start.getMonth() == month && \n\t\t\t\t\t\t\t\tstart.getDate() == date || this.origin.day == eSettings.sFirstDay.slice(0,3)) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tevent[j++] = new OverEvent(this.origin.events[i], this.origin);\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} else {\n\t\t\t\t\tfor (var i=0; i < this.origin.events.length; i++) {\n\t\t\t\t\t\tif (this.origin.events[i].type == type) {\n\t\t\t\t\t\t\tevent[j++] = new NorEvent(this.origin.events[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tif (j === 0) return null;\n\t\t\t\treturn event;\n\t\t\t} else return null;\n\t\t};\n\t\t\n\t\t// array of allday, overday and empty events\n\t\tthis.events = this.setEvent();\n\t\t// array of normal event\n\t\tthis.norEvent = this.setEvent( \"normal\" );\n\t}", "title": "" }, { "docid": "f7640bffb2176a6724d52320b869a140", "score": "0.49648896", "text": "function addAlarm() {\n get_data('https://carew.oudgenoeg.nl/php/alarms.php', handle_data);\n}", "title": "" }, { "docid": "8b84a2f1c7bd35fae4009ae1bf4aea78", "score": "0.49623507", "text": "function setDayByDay() {\n for (i = 1; i < 6; i++) {\n var advDate = \"( \" + mm + \"/\" + (dd + i) + \"/\" + yyyy + \" )\";\n $(weekBoxes[i - 1])\n .children()\n .remove()\n .end();\n\n weekBoxes[i - 1].append(\n \"<p class='bold'>\" +\n currentCity.name +\n advDate +\n \"</p><img src='http://openweathermap.org/img/w/\" +\n currentCityInfo.daily[i].weather[0].icon +\n \".png' alt='Weather icon'><br>\"\n );\n weekBoxes[i - 1].append(\n \"<p>temp: \" + currentCityInfo.daily[i].temp.day + \"</p>\"\n );\n weekBoxes[i - 1].append(\"<br>\");\n weekBoxes[i - 1].append(\n \"<p>wind: \" + currentCityInfo.daily[i].wind_speed + \"</p>\"\n );\n weekBoxes[i - 1].append(\"<br>\");\n weekBoxes[i - 1].append(\n \"<p>humidity:\" + currentCityInfo.daily[i].humidity + \"</p>\"\n );\n weekBoxes[i - 1].append(\"<br>\");\n }\n saveCity();\n}", "title": "" }, { "docid": "514276fcddea20517ef9c932fd05ed47", "score": "0.49607545", "text": "function weekly() {\r\n\tconfig.data.labels=[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"];\r\n\ttime=[];\r\n\tclearInterval(int);\r\n\tget_weekly_values();\r\n\tint =setInterval(get_weekly_values, 5000);\r\n\tconfig.data.datasets[0].data = tempWeekly;\r\n\tconfig.data.datasets[1].data = humWeekly;\r\n\twindow.myLine.update();\r\n}", "title": "" }, { "docid": "d796ba95f3c67812e161812be3289bc8", "score": "0.49594998", "text": "function saveDayEffort() {\n\t\t\tvm.add = true;\n\t\t\tvm.task.timings[vm.rowIndx].time < vm.day.time ? (vm.task.totalTime += (vm.day.time) - (vm.task.timings[vm.rowIndx].time)) : (vm.task.totalTime -= ((vm.task.timings[vm.rowIndx].time) - (vm.day.time)));\n\t\t\tvm.day.date = convertToDateString(vm.day.date);\n\t\t\tvm.task.timings[vm.rowIndx] = vm.day;\n\t\t\tallTimings[vm.rowIndx] = vm.day;\n\t\t\temptySelectedDateFileds();\n\t\t}", "title": "" }, { "docid": "aad9915ca5fc672b9830302489ddb27a", "score": "0.49563265", "text": "function addMultiday(eventdate) {\n var eventName = document.getElementById(\"eventName\").value,\n multDay = 1,\n eventDetails = document.getElementById(\"eventDetails\").value;\n //insert to database\n $.ajax({\n url: 'calendar_provider.php',\n type: 'GET',\n async: false,\n data: {method: \"addEvent\", name : eventName, description : eventDetails, event_date : eventdate, isMultiday: multDay},\n success: function (response) {\n },\n error: function () {\n }\n });\n}", "title": "" }, { "docid": "7f5f1a03f399300a567db6390a77f9db", "score": "0.4952849", "text": "function dayPunch(days) {\n GM_log(\"--> dayPunch()\");\n\n days = typeof days != undefined ? days : 1;\n\n var sched = JSON.parse(GM_getValue(\"schedule\", false));\n\n// var observer = new WebKitMutationObserver(function(mutations) {\n// mutations.forEach(function(mutation) {\n// for (var i = 0; i < mutation.addedNodes.length; i++) {\n// if (mutation.addedNodes[i].id == \"ACE_width\") {\n// if (days > 0) {\n// setStartDate();\n// setMostRecentDate();\n// addRow();\n// days -= 1;\n// break;\n// } else {\n// return;\n// }\n// }\n// }\n// });\n// });\n// observer.observe(document.body, { childList: true, subtree: true });\n\n oFormObject = document.forms['win0'];\n\n setStartDate();\n setMostRecentDate();\n thisPunchDate = GM_getValue(\"mostRecentDate\", false);\n oFormObject.elements[\"PUNCH_DATE$\" + getMostRecentPunchNum()].value = thisPunchDate;\n addchg_win0(\"PUNCH_DATE$\" + getMostRecentPunchNum());\n oFormObject.elements[\"DERIVED_TL_PNCH_PUNCH_TIME$0\"].value = \"8a\";\n GM_log(thisPunchDate);\n var d = new Date(thisPunchDate);\n GM_log(d.getDay());\n //addRow();\n days -= 1;\n}", "title": "" }, { "docid": "8da12c213bed9e7779252431e2b9cb32", "score": "0.49486747", "text": "function renderWeeklyCalendar() {\n var i = 0;\n var selectedDate = new Date(selectedYear, selectedMonth - 1, selectedDay);\n var day = selectedDate.getDay();\n var startDay = selectedDay - day + 1;\n if (day == 0) {\n startDay -= 7;\n }\n renderControls('weekly');\n var bodyRow = '<tr class=\"pCalendar-bodyRow\">';\n for (i = 0; i < 7; i++) {\n bodyRow += '<td class=\"pCalendar-active\" data-cellid=\"' + (parseInt(startDay) + i) + '\">' +\n '<div class=\"pCalendar-eventInfo\">' +\n GetCalendarEvents(new Date(selectedYear, parseInt(selectedMonth) - 1, (parseInt(startDay) + i))) +\n '</div>' +\n '</td>';\n }\n bodyRow += '</tr>';\n $(divName + ' .pCalendar-Main').append(bodyRow);\n $('span[data-toggle=\"tooltip\"]').tooltip();\n }", "title": "" }, { "docid": "f3f4e2d7195a159016c95fd8f12b72f8", "score": "0.49475697", "text": "function cleanupData(d) {\n d.week = +d.week\n return d\n}", "title": "" }, { "docid": "71caef2eeeeb0bbb236202ff1c196526", "score": "0.4945585", "text": "function addSchedule() {\n var cohort_id = $(\"#cohort-id\").val();\n var data;\n var resend_quantity = parseInt($(\"#resend-number\").val().trim(), 10);\n var resend_hour = 20;\n var resend_type = $(\"input[name='resend-radio']:checked\").val();\n var schedule_id = $(\"#schedule-id\").val();\n var subtype = $(\"#add-schedule .nav-tabs .active a\").data(\"subtype\");\n if (isNaN(resend_quantity)) {\n alert('Please enter a number for \"Resend how many times?\"');\n return false;\n }\n if (resend_type == \"hours\") { \n resend_hour = parseInt($(\"#resend-interval\").val().trim());\n } else {\n resend_hour = parseInt($(\"#resend-hour\").val().trim());\n }\n data = {\n \"cohort_id\": cohort_id,\n \"resend_hour\": resend_hour,\n \"resend_quantity\": resend_quantity,\n \"resend_type\": resend_type,\n \"subtype\": subtype\n };\n // get data\n if (subtype == \"recurring\") {\n var day_numbers = [];\n var send_hour_recurring = $(\"#send-hour-recurring\").val();\n // get days of week\n for (var i = 0, len = DAYS_OF_WEEK.length; i < len; i++) {\n if ($(\"#\" + DAYS_OF_WEEK[i]).prop(\"checked\") == true) {\n day_numbers.push(i);\n }\n }\n // check if no days have been selected\n if (day_numbers.length == 0) {\n alert(\"Please select which days of the week you would like the schedule to run.\");\n return false;\n }\n data = $.extend(data, {\n \"send_hour\": parseInt(send_hour_recurring, 10),\n \"question_days_of_week\": day_numbers\n });\n } else if (subtype == \"one_time\") {\n var date = $(\"#schedule-date\").val();\n var send_hour_one_time = $(\"#send-hour-one-time\").val();\n // check that they entered a date\n if (date == \"\") {\n alert(\"Please select a date.\")\n return false;\n }\n // check date/time is after current time\n if (validateDateTime(true) == \"invalid\") {\n return false;\n };\n data = $.extend(data, {\n \"send_hour\": parseInt(send_hour_one_time, 10),\n \"date\": date\n });\n } else if (subtype == \"on_user_creation\") {\n // no data to add\n } else {\n alert(\"Error: No schedule subtype found\");\n return false;\n }\n showStatus(function() {\n // hide add schedule modal and show loading modal\n $(\"#add-schedule\").modal(\"hide\");\n // submit data\n if (schedule_id) {\n post(\"/modify_item\", {\n \"cohort_id\": cohort_id,\n \"data\": JSON.stringify(data),\n \"type\": \"schedule\",\n \"item_id\": schedule_id\n }, true);\n } else {\n post(\"/create_new_item\", {\n \"cohort_id\": cohort_id,\n \"data\": JSON.stringify(data),\n \"type\": \"schedule\"\n }, true);\n }\n return $.Deferred();\n }, \"Creating new schedule\", \"New schedule created\", \"Error: unable to create new schedule\");\n}", "title": "" }, { "docid": "ba564e2976655f8977fc4f62fcff4f14", "score": "0.49452984", "text": "function addData(data) {\n console.log(` Adding: ${data.title} (${data.owner})`);\n UpcomingEvents.insert(data);\n}", "title": "" }, { "docid": "a4f1ef443b52f71e989f8f2b73d82083", "score": "0.49323514", "text": "function update_timelog(){\n \t\t\tvar date = moment().format('YYYY-MM-DD');\n \t\t\tvar day = moment().day();\n \t\t\tconsole.log(day);\n \t\t\tvar data = {\n \t\t\t\tdate:date,\n \t\t\t\tday:day\n \t\t\t};\n \t\t\t// alert('success');\n \t\t\t//this will tally and select the last in and first out of employee\n \t\t\t//this will get all the data from timelog WHERE the date is not yet in the time record summary. GROUP BY date\n \t\t\t$.ajax({\n \t\t\t\ttype: 'POST',\n \t\t\t\turl: base_url + 'time_record/Timerecordsummary/Get_timerecord',\n \t\t\t\tdata:data,\n \t\t\t\tsuccess:function(data){\n \t\t\t\t}\n \t\t\t});\n \t\t\t//this will input the date on time record summary\n \t\t}", "title": "" }, { "docid": "88af2fed8b9ddda98c6c7552a16bcc83", "score": "0.49168608", "text": "function addDay() {\n // console.log('addDay:', data.day);\n return authFactory.getIdToken()\n .then(function(currentUser) {\n data.day.user_id = authData.currentUser.id;\n return $http({\n method: 'POST',\n url: '/day',\n headers: {\n id_token: authData.currentUser.authIdToken\n },\n data: data.day\n })\n .then(function(response) {\n // console.log('Day added');\n data.day = response.data;\n return;\n },\n function(err) {\n console.log('Unable to add new Day', err);\n return;\n }\n );\n\n });\n } // End addDay", "title": "" }, { "docid": "38ffb9e2271c69154b1d3d828051b70f", "score": "0.490289", "text": "async function addWeek() {\n document.getElementById('add-a-week').classList.remove('hidden');\n document.getElementById('save-week-button').addEventListener('click', saveWeek);\n document.getElementById('cancel-week-button').addEventListener('click', cancelWeek);\n}", "title": "" }, { "docid": "2d79450ae163ac8fe85a981381c11900", "score": "0.4900732", "text": "function addDay () {\n if (this && this.blur) this.blur();\n var newDay = new Day();\n if (days.length === 1) currentDay = newDay;\n newDay.switchTo();\n\n $.ajax({\n method: 'POST',\n url: '/api/days',\n data: {number: currentDay.number},\n success: function (responseData) {\n console.log(responseData)\n },\n error: function (errorObj) {\n console.log(\"error!\")\n }\n });\n\n }", "title": "" }, { "docid": "c7cd25d42ab8bf660f84228f10e68a0c", "score": "0.48929682", "text": "function DayLoop(i) {\n var today = new Date();\n for (j = 0; j < 7; j++){\n \n msg += '<div class=\"day ';\n \n if (TDAY.getYear() == today.getYear() &&\n TDAY.getMonth() == today.getMonth() &&\n dayIndex == today.getDate() && \n (j == MONTHSTARTSON.getDay() || monthStarted == true)){\n // Red BG color for today\n msg += 'today '; \n }\n else if (dayIndex == TDAY.getDate() && (j == MONTHSTARTSON.getDay() || monthStarted == true)){\n // Red border color for TDAY\n msg += 'selectedDay '; \n };\n if (j == 0 || j == 6){\n // Dark gray BG for weekend day\n msg += 'weekend'\n };\n msg += '\" data-day=\"'+ dayIndex +'\">';\n \n if(j == MONTHSTARTSON.getDay() || monthStarted == true){\n monthStarted = true; // The month has started\n if (dayIndex > MONTHENDSON.getDate()){\n // We've exceeded the number of days in the month\n msg += \"&nbsp;\";\n }\n else{\n msg += dayIndex + \"<br><small>\";\n msg += Appointments.day();\n msg += \"</small>\"; // End of appointments block\n dayIndex++;\n };\n CURRENTDATE = new Date(TDAY.getFullYear(), TDAY.getMonth(), dayIndex);\n };\n msg += \"</div>\"; // End of day cell\n \n // If we're at the end of the loops and haven't made it to the last day of the month, \n // add one more week to finish it off.\n if (i == 4 && j == 6 && CURRENTDATE <= MONTHENDSON)\n {\n msg += '</div>'; // End of week row\n WEEKNUMBER++;\n \n // Start the new week\n msg += '<div class=\"wk\" id=\"Week'+ (i+1) +'\">';\n DayLoop(i+1);\n }\n }\n }", "title": "" }, { "docid": "89c311bd74f91c3ad9d4208134f0b426", "score": "0.48880932", "text": "function bump_week_end_range(end_date) {\n if (end_date.weekday() == 0) {\n end_date.add(6, 'days'); // Sunday + 6 days = Saturday\n }\n else {\n end_date.endOf('isoWeek').subtract(1, 'days');\n }\n}", "title": "" }, { "docid": "c1822acf720e45e12dd76578db8fe56b", "score": "0.48796618", "text": "static createBlankDay(date, dayType) {\n let localData = this.getLocalData();\n\n let dateAsString = moment(date).format(\"DD/MM/YYYY\");\n\n\n //TODO create object, call toJSON func\n localData.push({\n date: dateAsString,\n dayType: dayType,\n amManager: null,\n pmManager: null,\n sales: null,\n customerCount: null,\n cashVariance: null,\n notes: null,\n data: []\n });\n //TODO data integrity, check if exists first\n this.setLocalData(localData);\n // TODO insert the data\n }", "title": "" }, { "docid": "bb391230449bd6247bfc91cba5aad9b6", "score": "0.48726517", "text": "function getDayOfWeek(data) {\n const days = [\n 'Неділя',\n 'Понеділок',\n 'Вівторок',\n 'Середа',\n 'Четвер',\n \"П'ятниця\",\n 'Субота',\n ];\n const day = days[data.getDay()];\n return day;\n}", "title": "" }, { "docid": "909516b9be15de3f9e16d816b28b45db", "score": "0.48713645", "text": "function updateWeek() {\n wateringChart.options.scales.xAxes[0] = {\n type: 'time',\n time: {unit: 'week'}\n };\n wateringChart.update();\n}", "title": "" }, { "docid": "c9acd797a692915c16a972c7da76f1ed", "score": "0.48694116", "text": "function week_withdays(d, da) {\n this.day = d;\n this.date = da;\n }", "title": "" }, { "docid": "70ca865364b16f93ca3b26ad5d4dced9", "score": "0.4868717", "text": "function setExtraDays(dailyData) {\n const extraDaysNames = getWeekDay();\n console.log(extraDaysNames);\n for (let extraDay = 0; extraDay < 3; extraDay++) {\n let dayIndexInHtml = extraDay + 1;\n let dayData = dailyData[extraDay + 1];\n //set the day name\n document.querySelector(`#day${dayIndexInHtml}`).textContent = extraDaysNames[extraDay];\n //set the extra day icon\n setIcons(dayData.icon, document.querySelector(`#day${dayIndexInHtml}_icon`));\n }\n\n}", "title": "" }, { "docid": "ccf6e772d0f65dd95d9a0c5e33348840", "score": "0.48585773", "text": "function calend(triger, dicAulas){\n var MesAnoDeHojeManipuladaSTR= \"/09/2018\";\n var DiaDeHojeCerto= new Date().getDate();\n var DataDeHojeManipuladaSTR= DiaDeHojeCerto + MesAnoDeHojeManipuladaSTR;\n var d = DataDeHojeManipuladaSTR.split(\"/\");\n var DataDeHojeManipulada= new Date(d[2], parseInt(d[1])-1, d[0]);\n \n\n\n if (triger == undefined){\n var mes = DataDeHojeManipulada.getMonth();\n var ano = DataDeHojeManipulada.getFullYear();\n\n }else{\n var mesActual= meses.indexOf(document.getElementById(\"mes\").innerHTML.split(\"<br>\")[0]);\n var anoActual= parseInt(document.getElementById(\"ano\").innerHTML);\n \n if (triger == \"anterior\"){\n if (mesActual == 0) {\n var mes= 11;\n var ano= anoActual - 1;\n }else{\n var mes= mesActual - 1;\n var ano= anoActual;\n }\n }\n\n if (triger == \"proximo\"){\n if (mesActual == 11) {\n var mes= 0;\n var ano= anoActual + 1;\n }else{\n var mes= mesActual + 1;\n var ano= anoActual;\n }\n }\n }\n\n buildCalendar(mes, ano, DataDeHojeManipulada);\n inserirAulas(dicAulas,mes,ano);\n responsiveModel();\n\n}", "title": "" }, { "docid": "7ae4006c6f9bdbb8036de1f852de3f25", "score": "0.48497215", "text": "function putNewEventsOnSheet(eF) {\n var newEventCount = eF.length;\n if (newEventCount === 0) {\n return;\n }\n Logger.log('new event count: ' + newEventCount);\n var lastRow = sheet.getRange('D:D').getValues().filter(String).length;\n Logger.log('last row: ' + lastRow);\n var newRow = sheet.insertRowsAfter(lastRow, newEventCount);\n setFormulas()\n var newEventsArray = []\n for (var i = 0; i < newEventCount; i++) {\n var tempArray = [\n eF[i].id,\n eF[i].startTime,\n \"Published\",\n eF[i].title,\n eF[i].description\n ];\n newEventsArray.push(tempArray);\n }\n var newEventsRange = sheet.getRange('A' + (lastRow + 1) + ':E' + (lastRow + newEventCount));\n newEventsRange.setValues(newEventsArray);\n}", "title": "" }, { "docid": "75dfb65e919090240add1851507f6c44", "score": "0.48441455", "text": "function isWeekDay() { return (Math.floor(nTime / 288) % 7) < 5; }", "title": "" }, { "docid": "f977fe32de691f94602e086e3a81a6ee", "score": "0.48437935", "text": "createEvent(json, callback){\n let val = [json.name, json.date, json.description, json.zipcode, json.address, json.venue];\n super.query(\n \"INSERT into Events (name, date, description, zipcode, address, venue) VALUES (?, ?, ?, ?, ?, ?)\",\n val,\n callback\n );\n }", "title": "" }, { "docid": "f546e3063c524618b5ff7dff99966623", "score": "0.48389298", "text": "function set5daysWeather(msg){\n // the wether card\n console.log(msg);\n var w_cart ='<div class=\"forecast\" style=\"width: 194px;\">'+\n '<div class=\"forecast-header\">'+\n '<div class=\"day\">%day%</div>'+\n '</div> '+\n '<div class=\"forecast-content\">'+\n '<div class=\"forecast-icon\">'+\n '<img src=\"../static/images/icons/%icon%.svg\" alt=\"\" width=48>'+\n '</div>'+\n '<div class=\"degree\">%tempr%<sup>o</sup>C</div>'+\n '</div>'+\n '</div>';\n // to insert the w_cart(html) in the div class .weather-days after replace the data\n var day = 1;\n $.each(msg.list, function(i, val) {\n if(val['dt_txt'].includes(\"12:00:00\")){\n var newHtml = w_cart.replace('%day%', dateInfo('dayS',day));\n newHtml = newHtml.replace('%icon%', val['weather'][0]['icon']);\n newHtml = newHtml.replace('%tempr%', Math.round(val['main']['temp']));\n console.log(val['weather'][0]['description'])\n document.querySelector('.weather-days').insertAdjacentHTML('beforeend', newHtml);\n day++;\n }\n });\n}", "title": "" }, { "docid": "9020d66e5d1964d277bd448664102edb", "score": "0.48375756", "text": "function after_AddRemoveFood() {\n\t\tsources.day.getTotalCal({\n\t\t\tonSuccess: function(event) {\n\t\t\t\ttotalCalText.setValue(event.result);\n\t\t\t\tWAKL.caloriesWeightsChart.processChart(sources.day.date);\n\t\t\t},\n\t\t\tonError: WAKL.err.handler\n\t\t});\n\t}", "title": "" }, { "docid": "a4711e82ae99656a7d2921ed5c32993d", "score": "0.48291093", "text": "function showNextWeek() {\n\t\t\tevent.preventDefault();\n\t\t\tvar currentMonday = getDisplayedWeekDate();\n\t\t\tvar nextMonday = currentMonday;\n\t\t\tnextMonday.setDate(currentMonday.getDate() + 7);\n\t\t\tdisplayHomepage(nextMonday);\n\t\t}", "title": "" }, { "docid": "c6b191d14c758425230b016ea4828f0c", "score": "0.48273802", "text": "function upsertDayExpositors() {\n require('../mfPortal').importDayExpositors((0, _moment[\"default\"])().subtract(1, 'days').format('YYYYMMDD')); // qua verranno aggiornati tutti gli utenti + userprofiles. inseriti se miss su una chiave\n\n}", "title": "" }, { "docid": "8d8c51c717b5a3ced9c31ea6d44c1a5f", "score": "0.48269916", "text": "to_next_week() {\n if ( this.current_week < this.max_week ) {\n this.current_week += 1;\n this.data = this.week_x_data[this.current_week - 1];\n }\n }", "title": "" }, { "docid": "49e5dde00c7e3cd0cd6d595fbaa76e5b", "score": "0.48269513", "text": "function addPeriod(day, start, end) {\n var program = getWeekProgram()[day];\n program.push([start, end]);\n sortMergeProgram(day);\n setWeekProgram();\n}", "title": "" }, { "docid": "fbf70bd92bdc1ff563e8b30528eac491", "score": "0.48135895", "text": "function newDay() {\r\n const d = Date();\r\n const d_string = d.toString();\r\n const d_array = d_string.split(\" \");\r\n const day = Number(d_array[2]);\r\n\r\n chrome.storage.sync.get(\"saved_day\", (response) => {if (day !== response.saved_day) initializeVars()})\r\n}", "title": "" }, { "docid": "1752ba4c701f9aeb074fd8c689cb82ab", "score": "0.48056343", "text": "function schedule_add(data)\n\t{\n\t\t// data = get_data();\n\t\turl = \"/schedule_add/\";\n\t\t$.post(url, data,\n\t\t\t\tfunction(result)\n\t\t\t\t{\n\t\t\t\t\tshow_info(result);\n\t\t\t\t});\n\t}", "title": "" }, { "docid": "a701dcacd6235e3e6707d756150e02e8", "score": "0.48029828", "text": "function LSSHandleDays(days)\n{\n\n}", "title": "" }, { "docid": "a1e8a0c8d49bea234ac82b88ec5fa6a2", "score": "0.479938", "text": "function pjt_register_exercise( exercise ) {\r\n\r\n\t// Is day not beyond days in a week?\r\n\tfunction isValidDay() { return current_day <= DAYS_IN_WEEK; }\r\n\r\n\t// Is week within defined max\r\n\tfunction isValidWeek() { return current_week <= MAX_WEEKS; }\r\n\r\n\t// Cycle to next day\r\n\tfunction nextDay() {\r\n\t\tcurrent_day = current_day + 1;\r\n\t\tcurrent_day_raw = current_day_raw + 1;\r\n\r\n\t\tif ( !isValidDay() ) {\r\n\t\t\tcurrent_day = 1;\r\n\t\t\tcurrent_week = current_week + 1;\r\n\t\t}\r\n\r\n\t\tif ( !isValidWeek() )\r\n\t\t\treturn false;\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// Log msg to day\r\n\tfunction log_day( msg ) {\r\n\t\tvar index = ( DAYS_IN_WEEK * (current_week - 1) ) + current_day - 1;\r\n\t\tschedule[index] += msg + '<br>';\r\n\t}\r\n\r\n\r\n\t\r\n\r\n\t// For cycling\r\n\tvar current_week = 1;\r\n\tvar current_day = 1;\r\n\tvar current_day_raw = current_day;\r\n\tvar prev_exercise_day;\r\n\r\n\tvar ignore_gap = false;\r\n\r\n\t\r\n\r\n\t// While day and week are vaild\r\n\twhile ( isValidDay() && isValidWeek() ) {\r\n\r\n\t\t// Build the exercise\r\n\t\texercise.build();\r\n\r\n\t\t// Exercise routine\r\n\t\tvar routine = exercise.routine_schedule;\r\n\r\n\t\t// Cycle through days\r\n\t\tfor ( var i = 0; i < routine.length; i++ ) {\r\n\t\t\t\r\n\t\t\t// Current Day exercise\r\n\t\t\tvar day = routine[i];\r\n\r\n\t\t\t// Current Day gap\r\n\t\t\tvar gap = day.gap;\r\n\r\n\t\t\t// Apply a one-time offset to gap\r\n\t\t\tgap += exercise.routine_offset;\r\n\t\t\texercise.routine_offset = 0;\r\n\r\n\t\t\t// Current Day sets\r\n\t\t\tvar sets = day.sets;\r\n\r\n\t\t\tif ( !ignore_gap ) {\r\n\t\t\t\t// Cycle through gap days\r\n\t\t\t\tfor ( var j = 0; j < gap; j++ ) {\r\n\t\t\t\t\tnextDay();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Cycle through ignored days (ex, sunday)\r\n\t\t\twhile ( exercise.ignore_days.includes( current_day ) ) {\r\n\r\n\t\t\t\tnextDay();\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t// If day and week are valid\r\n\t\t\tif ( isValidDay() && isValidWeek() ) {\r\n\r\n\t\t\t\tif ( exercise.routine_fastforward > 0 ) {\r\n\t\t\t\t\texercise.routine_fastforward--;\r\n\t\t\t\t\tignore_gap = true;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse {\r\n\t\t\t\t\tignore_gap = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If minimum exercise rest days haven't been met\r\n\t\t\t\tif ( (current_day_raw - prev_exercise_day) <= exercise.min_rest_day ) {\r\n\t\t\t\t\tnextDay();\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Opening exercise div\r\n\t\t\t\t\tlog_day( '<div class=\"exercise\">' )\r\n\r\n\t\t\t\t\t// Log exercise name\r\n\t\t\t\t\tlog_day( '<b>{0}</b>'.format( exercise.name ) )\r\n\r\n\t\t\t\t\t// Cycle through sets\r\n\t\t\t\t\tfor ( var j = 0; j < sets.length; j++ ) {\r\n\r\n\t\t\t\t\t\t// Current set\r\n\t\t\t\t\t\tvar set = sets[j];\r\n\r\n\t\t\t\t\t\t// Log set\r\n\t\t\t\t\t\tlog_day( set.log_msg );\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Log exercise close div\r\n\t\t\t\t\tlog_day( '</div>' );\r\n\r\n\t\t\t\t\t// Keep track of last exercise day\r\n\t\t\t\t\tprev_exercise_day = current_day_raw;\r\n\t\t\t\t}\r\n\t\t\t} \r\n\r\n\t\t\t// Next day\r\n\t\t\tnextDay();\r\n\t\t}\r\n\r\n\t\tif ( !exercise.loop_exercise )\r\n\t\t\tbreak;\r\n\t}\r\n}", "title": "" }, { "docid": "a938c52d8b37e438d698c67e327a663d", "score": "0.47984836", "text": "function getLastDayOfWeek(date){\n return lastDayOfWeek = new Date(date.getTime() + (6 * 86400000));\n}", "title": "" }, { "docid": "88af0c3bb41b0cf1176e7d088c3259ff", "score": "0.47960567", "text": "function WeekCalendar() {\n\t\t/* \n\t\t * PRIVATE\n\t\t * set hours to display in calendar \n\t\t */\n\t var setHours = function () {\n\t\t\tvar hours = [];\n\t\t\tfor (var i = 0; i < 24; i++) {\n\t\t\t\tif (i === 0) {\n\t\t\t\t\thours[i] = \"12AM\";\n\t\t\t\t} else if (i < 12) {\n\t\t\t\t\thours[i] = i + \"AM\";\n\t\t\t\t} else if (i == 12) { \n\t\t\t\t\thours[i] = i + \"PM\";\n\t\t\t\t} else {\n\t\t\t\t\thours[i] = (i - 12) + \"PM\";\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn hours;\n\t\t};\n\t\t\n\t\t/* \n\t\t * PRIVATE\n\t\t * set navigate month\n\t\t */\n\t\tvar setNavMonth = function(month1, month2) {\n\t\t\tif (month1 == month2) {\n\t\t\t\treturn eCalendar.months[month1];\n\t\t\t} else {\n\t\t\t\treturn eCalendar.months[month1] + \"-\" +eCalendar.months[month2];\n\t\t\t}\n\t\t};\n\t\t\n\t\t/* \n\t\t * PRIVATE\n\t\t * set navigate year\n\t\t */\n\t\tvar setNavYear = function(year1, year2) {\n\t\t\tif (year1 == year2) {\n\t\t\t\treturn year1;\n\t\t\t} else {\n\t\t\t\treturn year1 + \"-\" + year2;\n\t\t\t}\n\t\t};\n\t\t\n\t\t/* \n\t\t * convert navDays from array of Object Day\n\t\t * to array of Object WeekDay\n\t * most important function\n\t */\n\t this.setNavDays = function () {\n\t \t// go through all day in navWeek;\n\t \tfor (var i=0; i < 7; i++) {\n\t\t\t\t// convert object Event to Event\n\t\t\t\tthis.navDays[i] = new WeekDay(this.navDays[i]);\t// object WeekDay\n\t \t}\n\n\t\t\t// very complicate. Insert the EmptyEvent\n\t\t\tfor (var i=0; i < 7; i++) {\n\t\t\t\tif (!isNull( this.navDays[i].events )) {\n\t\t\t\t\tvar length = this.navDays[i].events.length;\n\t\t\t\t\tfor (var j=0; j < length; j++) {\n\t\t\t\t\t\tif (this.navDays[i].events[j].event.type == \"over\") {\n\t\t\t\t\t\t\tvar dur = this.navDays[i].events[j].duration;\n\t\t\t\t\t\t\tfor (var k=i+1; k < i + dur; k++) {\n\t\t\t\t\t\t\t\tif (!isNull( this.navDays[k].events ) && !isNull( this.navDays[k].events[j] )) {\n\t\t\t\t\t\t\t\t\tfor (var t=length; t > j; t--) {\n\t\t\t\t\t\t\t\t\t\tthis.navDays[k].events[t] = this.navDays[k].events[t-1];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tthis.navDays[k].events[j] = new EmptyEvent(this.navDays[i].events[j]);\n\t\t\t\t\t\t\t\t} else if (!isNull( this.navDays[k].events )) {\n\t\t\t\t\t\t\t\t\tvar kLength = this.navDays[k].events.length;\n\t\t\t\t\t\t\t\t\tfor (var t=kLength; t <= j; t++) {\n\t\t\t\t\t\t\t\t\t\tthis.navDays[k].events[t] = new EmptyEvent(this.navDays[i].events[j]);\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\tthis.navDays[k].events = [];\n\t\t\t\t\t\t\t\t\tfor (var t=0; t <= j; t++) {\n\t\t\t\t\t\t\t\t\t\tthis.navDays[k].events[t] = new EmptyEvent(this.navDays[i].events[j]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// set height for the week content\n\t\t\tthis.setContentHeight();\n\t };\n\t\t\n\t\t/*\n\t\t * PRIVATE\n\t\t * Set Navigation Time function\n\t\t * week is object Week\n\t\t */\n\t\tthis.setNavTime = function (week) {\n\t\t\tthis.navWeek = week;\n\t\t\tthis.navDays = angular.copy(week.days); //object Day\n\t\t\tthis.setNavDays();\n\t\t\tthis.navMonth = setNavMonth(week.month1, week.month2);\t// 0 - 11\n\t\t\tthis.navYear = setNavYear(week.year1, week.year2);\n\t\t\t\n\t\t\tthis.navBackground = \"easi-\" + eCalendar.shortMonths[week.month2] + \"-bkg\";\n\t\t};\n\t\t\n\t\t/* hours to display in calendar\n\t\t * 0 - 23\n\t\t */\n\t\tthis.hours = setHours();\n\t\t\n\t\t// current week\n\t\tthis.curWeek = new Week(null, eSettings.sFirstDay.slice(0,3)); \n\n\t\t// current month \n\t\tthis.curMonth1 = this.curWeek.month1; // 0 - 11\n\t\tthis.curMonth2 = this.curWeek.month2; // 0 - 11\n\t\t\n\t\t// current year\n\t\tthis.curYear1 = this.curWeek.year1;\n\t\tthis.curYear2 = this.curWeek.year2;\n\t\t\n\t\t// Navigation time\n\t\tthis.navDays = angular.copy(this.curWeek.days);\t// object Day\n\t\tthis.navWeek = this.curWeek;\n\t\tthis.navMonth = setNavMonth(this.curWeek.month1, this.curWeek.month2);\t// 0 - 11\n\t\tthis.navYear = setNavYear(this.curWeek.year1, this.curWeek.year2);\n\t\t\t\n\t\tthis.navBackground = \"easi-\" + eCalendar.shortMonths[this.curWeek.month2] + \"-bkg\";\n\t\t\n\t\t// week-content height\n\t\tthis.contentHeight = {\n\t\t\t\"height\": \"80%\",\n\t\t};\n\t\t// set content height function\n\t\tthis.setContentHeight = function() {\n\t\t\tvar max = 0;\n\t\t\tfor (var i=0; i < 7; i++) {\n\t\t\t\tif (this.navDays[i].events !== null) {\n\t\t\t\t\tif(this.navDays[i].events.length > max) {\n\t\t\t\t\t\tmax = this.navDays[i].events.length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar height = HEIGHT_OF_DAYTAG + max * HEIGHT_OF_OVERDAY;\n\t\t\tthis.contentHeight = {\n\t\t\t\t\"height\": 'calc(100% - ' + height + 'px)',\n\t\t\t};\n\t\t};\n\t\t\n\t\t/* go to next week */\n\t\tthis.nextWeek = function() {\n\t\t\tthis.setNavTime(this.navWeek.nextWeek());\n\t\t};\n\t\t\n\t\t/* go to previous week */\n\t\tthis.prevWeek = function() {\n\t\t\tthis.setNavTime(this.navWeek.prevWeek());\n\t\t};\n\t}", "title": "" }, { "docid": "9e2a7ac166116a152ef84ad3939c7da6", "score": "0.4793423", "text": "JUMP_TO_WEEK (state, payload) {\n state.dateFrom = moment(payload).startOf('isoWeek')\n state.dateTo = moment(payload).endOf('isoWeek')\n }", "title": "" }, { "docid": "f678acb416c76b299b6b24b031c1ea68", "score": "0.47919613", "text": "function new_event_json(name, location, start, end, date, day) {\n\n\t\tif (end == \"\") {\n\t\t\tend = \"\";\n\t\t}\n var event = {\n \"name\": name,\n\t\t\t\t\"location\": location,\n \"start\": start,\n\t\t\t\t\"end\": end,\n \"year\": date.getFullYear(),\n \"month\": date.getMonth()+1,\n \"day\": day\n };\n event_data[\"events\"].push(event);\n\n\t\tevent = JSON.stringify(event)\n\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: $('#dialog').attr('url'),\n\t\t\tdata: {\n\t\t\t\tevent_data: event,\n\t\t\t\taction: 'get',\n\t\t\t\ttask: 'add',\n\t\t\t},\n\t\t});\n\n}", "title": "" }, { "docid": "9e013c90e9b02fce66e44b05a0f65ae1", "score": "0.47905624", "text": "function newWeatherData(e){\n let zipCodeValue = zipCode.value;\n let userFeelingsValue = userFeelings.value;\n\n weatherReport(`${sourceUrl}${zipCodeValue}${apiKey}`).then(\n function (data){\n postData('http://localhost:3000/add', {temperature:data.main.temp, date:newDate, userResponse:userFeelingsValue})\n }).then(\n function () {\n updateUi()\n }) \n}", "title": "" }, { "docid": "92266d4d531e30d44bd15d282540a2bf", "score": "0.47902143", "text": "function isWeekend(dateString) {\n // Write code here...\n var date = new Date(dateString);\n // console.log(date);\n var day = date.getDay();\n if (day === 5 || day === 6) {\n return console.log('true');\n } else return console.log('false');\n }", "title": "" }, { "docid": "54133f338cf441271ce3b0e2301ca427", "score": "0.47900525", "text": "function isDay0(){\n if(daily[0].dt === 1619982000){\n\n //Checks What time of day it is and prints coresponding temp data\n\n //==========================================================================//\n //This is for the Basic Info\n\n if(time <= 6){\n $timeOfDay.append(`${daily[0].temp.morn}°f`);\n }if(time > 7 && time <= 14){\n $timeOfDay.append(`${daily[0].temp.day}°f`);\n }if(time > 14 && time <= 20){\n $timeOfDay.append(`${daily[0].temp.eve}°f`);\n }if(time > 20){\n $timeOfDay.append(`${daily[0].temp.night}°f`);\n }\n\n //Check time and prints feels like data\n if(time <= 6){\n $feelsLike.append(`Feels like ${daily[0].feels_like.morn}°f`);\n }if(time > 7 && time <= 14){\n $feelsLike.append(`Feels like ${daily[0].feels_like.day}°f`);\n }if(time > 14 && time <= 20){\n $feelsLike.append(`Feels like ${daily[0].feels_like.eve}°f`);\n }if(time > 20){\n $feelsLike.append(`Feels like ${daily[0].feels_like.night}°f`);\n }\n\n $headerDay.prepend(\"Today\");\n let location = `${daily[8].timezone}`\n if(location === \"America/Phoenix\"){\n $location.append(\"Phoenix\");\n }\n \n $discription.append(`${daily[0].weather[0].description}`);\n $minMax.append(`<p>Min ${daily[0].temp.min}°f | Max ${daily[0].temp.max}°f</p>`);\n\n //=====================================================================================//\n\n //This is for the extra data\n\n $pressure.append(`${daily[0].clouds} %`);\n\n $huminity.append(`${daily[0].humidity}%`);\n $drewPoint.append(`${daily[0].dew_point}°`);\n $pop.append(`${daily[0].pop}%`);\n $windSpeed.append(`${daily[0].wind_speed} mph`);\n\n let windDegree = `${daily[0].wind_deg}`;\n if(windDegree < 90){\n $windDeg.append(`${daily[0].wind_deg}° NE`);\n }if(windDegree < 180 && windDegree > 90){\n $windDeg.append(`${daily[0].wind_deg}° SE`);\n }if(windDegree < 270 && windDegree > 180){\n $windDeg.append(`${daily[0].wind_deg}° SW`);\n }if(windDegree < 360 && windDegree > 270){\n $windDeg.append(`${daily[0].wind_deg}° NW`);\n }\n\n $windGust.append(`${daily[0].wind_gust} mph`);\n let uVIndex = `${daily[0].uvi}`;\n if(uVIndex <= 2){\n $uvi.append(`${daily[0].uvi} Low`).addClass(\"text-success\")\n }if(uVIndex <= 5){\n $uvi.append(`${daily[0].uvi} Moderate`).addClass(\"text-warning\")\n }if(uVIndex <= 7){\n $uvi.append(`${daily[0].uvi} High`).addClass(\"text-orange\")\n }if(uVIndex > 7){\n $uvi.append(`${daily[0].uvi} Very High`).addClass(\"text-danger\")\n }\n\n }\n }", "title": "" }, { "docid": "8b23dda4dd3a1b857060a43c2105ad7c", "score": "0.47853872", "text": "function updateWeekDisplay() {\n\tvar start_date_parts = startWeek.split(\"-\");\n\tvar start_week = start_date_parts[0]+\"/\"+start_date_parts[1]+\"/\"+start_date_parts[2].substring(2,4)\n\tvar end_week = \"\";\n\tvar end_day;\n\tvar end_month;\n\tvar end_year;\n\tvar last_day;\n\n\tswitch(parseInt(start_date_parts[0], 10)) {\n\t\tcase 1: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 31) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 31;\n\t\t\t\tlast_day = 31;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 2: {\n\t\t\tif((parseInt(start_date_parts[1], 10)%4) == 0) {\n\t\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 29) {\n\t\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 29;\n\t\t\t\t\tlast_day = 29;\n\t\t\t\t} else {\n\t\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 28) {\n\t\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 28;\n\t\t\t\t\tlast_day = 28;\n\t\t\t\t} else {\n\t\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 3: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 31) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 31;\n\t\t\t\tlast_day = 31;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 4: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 30) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 30;\n\t\t\t\tlast_day = 30;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 5: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 31) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 31;\n\t\t\t\tlast_day = 31;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 6: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 30) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 30;\n\t\t\t\tlast_day = 30;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 7: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 31) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 31;\n\t\t\t\tlast_day = 31;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 8: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 31) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 31;\n\t\t\t\tlast_day = 31;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 9: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 30) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 30;\n\t\t\t\tlast_day = 30;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 10: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 31) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 31;\n\t\t\t\tlast_day = 31;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 11: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 30) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 30;\n\t\t\t\tlast_day = 30;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 12: {\n\t\t\tif((parseInt(start_date_parts[1], 10)+4) > 31) {\n\t\t\t\tend_day = (parseInt(start_date_parts[1], 10)+4) - 31;\n\t\t\t\tlast_day = 31;\n\t\t\t} else {\n\t\t\t\tend_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t\tlast_day = parseInt(start_date_parts[1], 10)+4;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif((parseInt(start_date_parts[0], 10) == 12) && (end_day < last_day)) {\n\t\tvar yr = \"\" + (parseInt(start_date_parts[2], 10)+1);\n\t\tend_week = \"1\"+\"/\"+end_day+\"/\"+yr.substring(2,4);\n\t\tendWeek = \"1\"+\"-\"+end_day+\"-\"+yr;\n\t} else {\n\t\tif(end_day < last_day) {\n\t\t\tvar newMon = parseInt(start_date_parts[0], 10)+1;\n\t\t\tend_week = newMon+\"/\"+end_day+\"/\"+start_date_parts[2].substring(2,4);\n\t\t\tendWeek = newMon+\"-\"+end_day+\"-\"+start_date_parts[2];\n\t\t} else {\n\t\t\tend_week = start_date_parts[0]+\"/\"+end_day+\"/\"+start_date_parts[2].substring(2,4);\n\t\t\tendWeek = start_date_parts[0]+\"-\"+end_day+\"-\"+start_date_parts[2];\n\t\t}\n\t}\n\n\tvar nxtDay = parseInt(start_date_parts[1], 10);\n\tvar colmon;\n\tvar colday;\n\tvar days = new Array();\n\tdays[0] = \"MON\";\n\tdays[1] = \"TUE\";\n\tdays[2] = \"WED\";\n\tdays[3] = \"THU\";\n\tdays[4] = \"FRI\";\n\tfor(var i = 0; i < 5; i++) {\n\t\tif(end_day < last_day) {\n\t\t\tif(nxtDay > last_day) {\n\t\t\t\tif(parseInt(start_date_parts[0], 10) == 12) {\n\t\t\t\t\tcolmon = 1;\n\t\t\t\t\tcolyear = parseInt(start_date_parts[2], 10)+1;\n\t\t\t\t} else {\n\t\t\t\t\tcolmon = parseInt(start_date_parts[0], 10)+1;\n\t\t\t\t\tcolyear = parseInt(start_date_parts[2], 10);\n\t\t\t\t}\n\t\t\t\tcolday = nxtDay - last_day;\n\t\t\t} else {\n\t\t\t\tcolmon = start_date_parts[0];\n\t\t\t\tcolyear = parseInt(start_date_parts[2], 10);\n\t\t\t\tcolday = nxtDay;\n\t\t\t}\n\t\t} else {\n\t\t\tif(nxtDay <= last_day) {\n\t\t\t\tcolmon = start_date_parts[0];\n\t\t\t\tcolyear = parseInt(start_date_parts[2], 10);\n\t\t\t\tcolday = nxtDay;\n\t\t\t}\n\t\t}\n\t\tvar col = (i+1);\n\n\t\t$('.'+col+'_col:first').html(days[i]+\"<br />\"+colmon+\"/\"+colday+'<span class=\"days_full_date\">'+colmon+\"/\"+colday+\"/\"+colyear+'</span>');\n\n\t\tnxtDay += 1;\n\t}\n\n\t//$('.week_label').html(\"for \"+start_week+\" - \"+end_week);\n\n\tlastDay = last_day;\n\n}", "title": "" }, { "docid": "59d58cba0233d9bef72a6e46f49fffdf", "score": "0.47816798", "text": "function addEvent(){\n\tif(uid && uid!=null && uid != 'null' && state ==1){\n\t\tvar neDtPts = document.getElementById('neDate').value.split('/');\n\t\tvar neData = {};\n\t\tneData[\"uid\"] = uid;\n\t\tneData[\"a\"] = 0;//0 - add new 1-edit 2-delete\n\t\tneData[\"neT\"] = document.getElementById('neTitle').value + '';\n\t\tneData[\"neN\"] = document.getElementById('neNote').value + '';\n\t\tneData[\"neDM\"] = parseInt(neDtPts[0])-1;\n\t\tneData[\"neDD\"] = parseInt(neDtPts[1]);\n\t\tneData[\"neDY\"] = parseInt(neDtPts[2]);\n\t\tneData[\"neH\"] = parseInt(document.getElementById('neHour').value);\n\t\tneData[\"neM\"] = parseInt(document.getElementById('neMin').value);\n\t\tneData[\"neA\"] = document.getElementById('neAMPM').value + '';\n\t\tneData[\"neC\"] = document.getElementById('neTag').value + '';\n\t\t$.post(\"eventActions.php\", neData, function(r){\n\t\t\tif(parseInt(r) == 0){\n\t\t\t\talert(\"there was an error saving your event\");\n\t\t\t}else if(parseInt(r) == 1){\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}else{\n\t\talert(\"you must be logged in to post an event\");\n\t}\n\tflip();\n}", "title": "" }, { "docid": "04939025d5927d10a88d6d2d1fbf38a6", "score": "0.47792858", "text": "function widgetEventChanged(/*string*/eventId, /*day id */ dayId, /*object*/eventObject){\r\n\t\t oCalendar.updateUserMessage(\"Saving Event Please wait....\");\r\n\t\t \t //console.log(\"[ (L161) widgetEventChanged script.js] Save course......................\");\r\n \r\n\t\t//alert(sReturn);\r\n\t\tsaveToDB(eventObject);\r\n\t\t//saveToXMLFile(sReturn);\r\n\t\t//oCalendar.refreshScreen();\r\n\t}", "title": "" }, { "docid": "b03a1e2deadd6e4b669aa3471600728b", "score": "0.47691694", "text": "function setEnding(day){\n switch (day){\n case 1:\n case 21:\n case 31:\n return day + \"st\";\n case 2:\n case 22:\n return day + \"nd\";\n case 3:\n case 23:\n return day + \"rd\";\n default:\n return day + \"th\";\n }\n }", "title": "" }, { "docid": "9753a788f2f8280ff73bb5953b9a348b", "score": "0.47585577", "text": "function setWeek(count) {\n // Setzt die neue Woche\n iCWeek = iCWeek + count;\n\n // Lädt den Stundenplan mit der ClassID\n getStundenplan(iClassID);\n\n //Zeigt die Woche und das Jahr an \n $(\"#weekDate\").empty().append(iCWeek + \"-\" + iYear);\n}", "title": "" }, { "docid": "3789052d7dea51272a394768131f1060", "score": "0.47569063", "text": "function week(ctx, events) {\n ctx.reply(\"Events in the next week:\");\n const nextWeekEvents = Object.values(events)\n .filter((e) => {\n return dateUtils.eventIsInTheNextDays(e, 7);\n })\n for(const i in nextWeekEvents) {\n const event = nextWeekEvents[i];\n const msg = event[\"summary\"][\"val\"] + \": \" + dateUtils.formatForMessage(event[\"start\"]);\n ctx.reply(msg);\n }\n}", "title": "" }, { "docid": "eb1048c64473b16fb0786ccabcf5abe8", "score": "0.47553685", "text": "function skip(cdate){\n day_count++\n var logic = _holidays['M'][moment(cdate).format('MM/DD')] || \n _holidays['W'][moment(cdate).format('M/'+ (memorial || diff) +'/d')]\n var new_date = moment(cdate)\n var dow = new_date.day()\n \n //If the function goes more than 7 days then there is an error and it should be stopped\n if(day_count < 7){\n //if Saturday\n if(dow === 6 && !dateObject.weekend) {\n c_date = moment(cdate).add(2, 'days')\n //Check to see if new date is not a FH\n skip(c_date)\n }else\n //if Sunday \n if(dow === 0 && !dateObject.weekend) {\n c_date = moment(cdate).add(1, 'days')\n //Check to see if new date is not FH\n skip(c_date)\n }else if(logic !== undefined && !dateObject.weekend) {\n //if FH\n c_date = moment(cdate).add(1, 'days')\n // check to see if new date is not a weekend\n skip(c_date) \n }\n }\n \n }", "title": "" }, { "docid": "78f5039bc979e1869036ee7dea91675d", "score": "0.47534743", "text": "isWeekday(day) {\n var _day = this.dayOfWeek(this.displayMonth, day, this.displayYear);\n \n if(_day > 0 && _day < 6) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "e8c051774d0a4394ecee61ee368107ed", "score": "0.47504446", "text": "function updateDay() {\n console.log('updateDay:', data.day);\n return authFactory.getIdToken()\n .then(function(currentUser) {\n data.day.user_id = authData.currentUser.id;\n return deleteDay(data.day._id)\n .then(function(response) {\n console.log('response:', response);\n delete data.day._id;\n return addDay()\n .then(function(response) {\n return;\n },\n function(err) {\n console.log('Unable to update (add) day', err);\n return;\n });\n },\n function(err) {\n console.log(\"Unable to update (delete) day\", err);\n }\n );\n });\n } // End updateDay", "title": "" }, { "docid": "aa227adb2543ba2322183b07407db5bc", "score": "0.4744784", "text": "function PopulateSchedule(async) {\n\n var async = (async == false) ? false : true;\n\n $.ajax({\n url: getApi + \"/api/Claim/GetSchedule/\" + ClaimID,\n beforeSend: function (request) {\n request.setRequestHeader(\"Authentication\", window.token);\n },\n async: async,\n success: function (data) {\n var results = ReplaceDFValues( JSON.parse(data) );\n\n if (results.length > 0) {\n for (var i = 2; i <= results.length; i++) {\n $('.AddWeek').trigger('click');\n }\n\n //only the first record contains the scheduleType value\n $('.schedule-type').val(results[0][\"ScheduleType\"]);\n\n for (var i = 0; i < results.length; i++) {\n\n var rowN = i + 1;\n var totalHours = parseInt(results[i][\"TotalHours\"]);\n var daysOn = parseInt(results[i][\"DaysOn\"]);\n var hoursPerShift = (daysOn > 0 && totalHours > 0) ? (totalHours / daysOn).toFixed(1) : 0.0;\n\n //using rowN because AddWeek event handler will append name attribute with next row number\n SetIsoDateFormat('[name=WeekStart' + rowN + ']', results[i][\"WeekStart\"])\n SetIsoDateFormat('[name=WeekEnd' + rowN + ']', results[i][\"WeekEnd\"])\n $('[name=Sunday' + rowN + ']').val(results[i][\"Sunday\"]);\n $('[name=Monday' + rowN + ']').val(results[i][\"Monday\"]);\n $('[name=Tuesday' + rowN + ']').val(results[i][\"Tuesday\"]);\n $('[name=Wednesday' + rowN + ']').val(results[i][\"Wednesday\"]);\n $('[name=Thursday' + rowN + ']').val(results[i][\"Thursday\"]);\n $('[name=Friday' + rowN + ']').val(results[i][\"Friday\"]);\n $('[name=Saturday' + rowN + ']').val(results[i][\"Saturday\"]);\n $('[name=DaysOn' + rowN + ']').val(results[i][\"DaysOn\"]);\n $('[name=DaysOff' + rowN + ']').val(results[i][\"DaysOff\"]);\n $('[name=HrsperShift' + rowN + ']').val(hoursPerShift);\n\n };\n }\n }\n });\n}", "title": "" }, { "docid": "797eda41c57609c5a7130c62f2b13582", "score": "0.47447473", "text": "handlePreviousWeek() {\n this.handleChangeWeek(-7);\n }", "title": "" }, { "docid": "5e6a295afb91f5728e7aca1657a88f50", "score": "0.47427475", "text": "beforeEnd() {\n this.d = this.d.day('friday');\n return this;\n }", "title": "" }, { "docid": "8e0bf7e67c82745f119a0a1451fa832f", "score": "0.47416866", "text": "function daySelected(event) {\n if ($(this).attr(\"data-day\") && $(this).text()) {\n // reset the selected day\n selCaledarDay.css(\"background-color\", \"white\");\n\n // clear the rows text\n $(\".event-text\").text(\"\");\n\n selCaledarDay = $(this);\n selCaledarDay.css(\"background-color\", \"rgb(41, 166, 197)\");\n var day = parseInt($(this).text()); // gets day number\n\n // set editableMoment to current day\n editableMoment.startOf(\"month\").add(day - 1, \"days\");\n\n // change lead text to selected day\n lead.text(editableMoment.format(\"dddd, MMMM Do YYYY\"));\n\n // call function to load any data\n //after loading all elements place text in appropriate rows\n dateKey = editableMoment.format(\"MM-DD-YYYY\");\n if (Object.keys(todos).includes(dateKey) && todos[dateKey].length) {\n for (var i = 0; i < todos[dateKey].length; i++) {\n $(`[data-hour=${todos[dateKey][i].hour}]`).text(todos[dateKey][i].note);\n }\n }\n }\n}", "title": "" }, { "docid": "8ec3478ad22a13156c2ba6daed2b23a1", "score": "0.4741178", "text": "function nextDaysForecast(tablerow, h) {\n // tablerow selects all the td in the table row\n //Reminder Note: arrayOfMeteo[1][1] = weather at 1am tomorrow / h=1; arrayOfMeteo[13][2] = weather at 1PM the day after tomorrow / h=13\n let t, b; \n for (t = 1, b = 1; t<tablerow.length, b<arrayOfMeteo[h].length;t++, b++) {\n let meteoIcon_nextDays = document.createElement('img');\n meteoIcon_nextDays.setAttribute('title', arrayofHours[h])\n meteoIcon_nextDays.className = 'meteoiconhour';\n let meteoIconSrc_nextDays = document.createAttribute('src');\n meteoIcon_nextDays.setAttributeNode(meteoIconSrc_nextDays);\n meteoIconSrc_nextDays.value = arrayOfMeteo[h][b].ICON;\n tablerow[t].innerHTML = arrayOfMeteo[h][b].TMP2m + '<span class=\"celsius\">' + '℃' + '</span>';\n tablerow[t].insertAdjacentElement('beforeend', meteoIcon_nextDays);\n }\n }", "title": "" }, { "docid": "e688de7749b13bafc7b79c901d2dbed6", "score": "0.4736106", "text": "async function saveWeek() {\n const token = gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse().id_token;\n const fetchOptions = {\n method: 'POST',\n headers: {'Authorization': 'Bearer ' + token}\n };\n\n const weekTitleEl = document.getElementById('week-title-input');\n const numEl = document.getElementById('week-num-input');\n if (!weekTitleEl.checkValidity()) {\n return;\n }\n\n let url = '/data/weeks/';\n url += '?title=' + encodeURIComponent(weekTitleEl.value);\n url += '&unitid=' + encodeURIComponent(currentUnit);\n const response = await fetch(url, fetchOptions);\n\n if (!response.ok) {\n console.log(response.status);\n return;\n }\n\n document.getElementById('add-a-week').classList.add('hidden');\n document.getElementById('add-week-form').reset();\n isSelected = false;\n displayWeeks();\n}", "title": "" } ]
9cd76bc630a7b8ec22b28039c9a7d405
[MSXLS] 2.5.198.66 ; [MSXLSB] 2.5.97.49
[ { "docid": "d54e4687cec14def9122feb130b92c00", "score": "0.0", "text": "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "title": "" } ]
[ { "docid": "18c9f3a8a45febf5393a356e3bc14173", "score": "0.577946", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "18c9f3a8a45febf5393a356e3bc14173", "score": "0.577946", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "26c30dbc09874a2d3cec1cfad80d0a3c", "score": "0.57548344", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "26c30dbc09874a2d3cec1cfad80d0a3c", "score": "0.57548344", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "26c30dbc09874a2d3cec1cfad80d0a3c", "score": "0.57548344", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "26c30dbc09874a2d3cec1cfad80d0a3c", "score": "0.57548344", "text": "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "700b5658bf6e78b5d75967903fde824c", "score": "0.5634576", "text": "function check_get_mver(blob) {\n if (blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0]; // header signature 8\n\n blob.chk(HEADER_SIGNATURE, 'Header Signature: '); // clsid 16\n //blob.chk(HEADER_CLSID, 'CLSID: ');\n\n blob.l += 16; // minor version 2\n\n var mver = blob.read_shift(2, 'u');\n return [blob.read_shift(2, 'u'), mver];\n }", "title": "" }, { "docid": "da227530e80494cbfedbfe018effbcc2", "score": "0.5568936", "text": "function parse_XLSBCellParsedFormula(data, length) {\n\tvar cce = data.read_shift(4);\n\treturn parsenoop(data, length-4);\n}", "title": "" }, { "docid": "da227530e80494cbfedbfe018effbcc2", "score": "0.5568936", "text": "function parse_XLSBCellParsedFormula(data, length) {\n\tvar cce = data.read_shift(4);\n\treturn parsenoop(data, length-4);\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5522901", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5522901", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5522901", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5522901", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5522901", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5522901", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "cdcdb949e8a092652ca113d4e5bfe82a", "score": "0.5522901", "text": "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.5521137", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.5521137", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.5521137", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.5521137", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.5521137", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.5521137", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.5493953", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.5493953", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.5493953", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.5493953", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "590fa96209262be37bb63c9dfe3f710b", "score": "0.5493953", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "40dd6794a403df75ffb3229aa058f502", "score": "0.543527", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar end = data.l + length;\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "40dd6794a403df75ffb3229aa058f502", "score": "0.543527", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar end = data.l + length;\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "40dd6794a403df75ffb3229aa058f502", "score": "0.543527", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar end = data.l + length;\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "40dd6794a403df75ffb3229aa058f502", "score": "0.543527", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n\tvar end = data.l + length;\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}", "title": "" }, { "docid": "4d8ac33e1a76881b9106eb463ac04a7b", "score": "0.5397695", "text": "function parse_XLSBParsedFormula(data, length, opts) {\n var cce = data.read_shift(4);\n var rgce = parse_Rgce(data, cce, opts);\n var cb = data.read_shift(4);\n var rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n return [rgce, rgcb];\n }", "title": "" }, { "docid": "1d4fcd7d47ca4f09e168b72919c55f7c", "score": "0.52788043", "text": "function parse_ExternSheet(blob, length, opts) {\n\tvar o = parslurp2(blob,length,parse_XTI);\n\tvar oo = [];\n\tif(opts.sbcch === 0x0401) {\n\t\tfor(var i = 0; i != o.length; ++i) oo.push(opts.snames[o[i][1]]);\n\t\treturn oo;\n\t}\n\telse return o;\n}", "title": "" }, { "docid": "00871b7ac2f8762568502d9afcd5b450", "score": "0.52016747", "text": "oclass() { return this.buffer.readIntLE (16, 6); }", "title": "" }, { "docid": "2f681fd7002fec7e1afc734d9c75f647", "score": "0.5197649", "text": "function parse_SupBook(blob, length, opts) {\n var end = blob.l + length;\n var ctab = blob.read_shift(2);\n var cch = blob.read_shift(2);\n opts.sbcch = cch;\n if (cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n if (cch < 0x01 || cch > 0xff) throw new Error(\"Unexpected SupBook type: \" + cch);\n var virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n /* TODO: 2.5.277 Virtual Path */\n\n var rgst = [];\n\n while (end > blob.l) {\n rgst.push(parse_XLUnicodeString(blob));\n }\n\n return [cch, ctab, virtPath, rgst];\n }", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51568687", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51568687", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51568687", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51568687", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51568687", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51568687", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "0d37bfe7be157d7d1b85fb78130da8cc", "score": "0.51568687", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.5152919", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.5152919", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.5152919", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.5152919", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.5152919", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "6c8afc2377d18bbbfc893dd967fed3fd", "score": "0.51293695", "text": "function discoverVersion()\n{\n\tvar fso, cf, vf, ln, s, m;\n\tfso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\tverCvs = \"\";\n\tcf = fso.OpenTextFile(configFile, 1);\n\tif (compiler == \"msvc\")\n\t\tversionFile = \".\\\\config.msvc\";\n\telse if (compiler == \"mingw\")\n\t\tversionFile = \".\\\\config.mingw\";\n\tvf = fso.CreateTextFile(versionFile, true);\n\tvf.WriteLine(\"# \" + versionFile);\n\tvf.WriteLine(\"# This file is generated automatically by \" + WScript.ScriptName + \".\");\n\tvf.WriteBlankLines(1);\n\twhile (cf.AtEndOfStream != true) {\n\t\tln = cf.ReadLine();\n\t\ts = new String(ln);\n\t\tif (m = s.match(/^m4_define\\(\\[MAJOR_VERSION\\], \\[(.*)\\]\\)/)) {\n\t\t\tvf.WriteLine(\"LIBXSLT_MAJOR_VERSION=\" + m[1]);\n\t\t\tverMajorXslt = m[1];\n\t\t} else if(m = s.match(/^m4_define\\(\\[MINOR_VERSION\\], \\[(.*)\\]\\)/)) {\n\t\t\tvf.WriteLine(\"LIBXSLT_MINOR_VERSION=\" + m[1]);\n\t\t\tverMinorXslt = m[1];\n\t\t} else if(m = s.match(/^m4_define\\(\\[MICRO_VERSION\\], \\[(.*)\\]\\)/)) {\n\t\t\tvf.WriteLine(\"LIBXSLT_MICRO_VERSION=\" + m[1]);\n\t\t\tverMicroXslt = m[1];\n\t\t} else if (s.search(/^LIBEXSLT_MAJOR_VERSION=/) != -1) {\n\t\t\tvf.WriteLine(s);\n\t\t\tverMajorExslt = s.substring(s.indexOf(\"=\") + 1, s.length);\n\t\t} else if(s.search(/^LIBEXSLT_MINOR_VERSION=/) != -1) {\n\t\t\tvf.WriteLine(s);\n\t\t\tverMinorExslt = s.substring(s.indexOf(\"=\") + 1, s.length);\n\t\t} else if(s.search(/^LIBEXSLT_MICRO_VERSION=/) != -1) {\n\t\t\tvf.WriteLine(s);\n\t\t\tverMicroExslt = s.substring(s.indexOf(\"=\") + 1, s.length);\n\t\t} else if(s.search(/^LIBXML_REQUIRED_VERSION=/) != -1) {\n\t\t\tvf.WriteLine(s);\n\t\t\tverLibxmlReq = s.substring(s.indexOf(\"=\") + 1, s.length);\n\t\t}\n\t}\n\tcf.Close();\n\tvf.WriteLine(\"WITH_TRIO=\" + (withTrio? \"1\" : \"0\"));\n\tvf.WriteLine(\"WITH_DEBUG=\" + (withXsltDebug? \"1\" : \"0\"));\n\tvf.WriteLine(\"WITH_MEM_DEBUG=\" + (withMemDebug? \"1\" : \"0\"));\n\tvf.WriteLine(\"WITH_DEBUGGER=\" + (withDebugger? \"1\" : \"0\"));\n\tvf.WriteLine(\"WITH_ICONV=\" + (withIconv? \"1\" : \"0\"));\n\tvf.WriteLine(\"WITH_ZLIB=\" + (withZlib? \"1\" : \"0\"));\n\tvf.WriteLine(\"WITH_CRYPTO=\" + (withCrypto? \"1\" : \"0\"));\n\tvf.WriteLine(\"WITH_MODULES=\" + (withModules? \"1\" : \"0\"));\n\tvf.WriteLine(\"WITH_PROFILER=\" + (withProfiler? \"1\" : \"0\"));\n\tvf.WriteLine(\"WITH_PYTHON=\" + (withPython? \"1\" : \"0\"));\n\tvf.WriteLine(\"DEBUG=\" + (buildDebug? \"1\" : \"0\"));\n\tvf.WriteLine(\"STATIC=\" + (buildStatic? \"1\" : \"0\"));\n\tvf.WriteLine(\"PREFIX=\" + buildPrefix);\n\tvf.WriteLine(\"BINPREFIX=\" + buildBinPrefix);\n\tvf.WriteLine(\"INCPREFIX=\" + buildIncPrefix);\n\tvf.WriteLine(\"LIBPREFIX=\" + buildLibPrefix);\n\tvf.WriteLine(\"SOPREFIX=\" + buildSoPrefix);\n\tif (compiler == \"msvc\") {\n\t\tvf.WriteLine(\"INCLUDE=$(INCLUDE);\" + buildInclude);\n\t\tvf.WriteLine(\"LIB=$(LIB);\" + buildLib);\n\t\tvf.WriteLine(\"CRUNTIME=\" + cruntime);\n\t\tvf.WriteLine(\"VCMANIFEST=\" + (vcmanifest? \"1\" : \"0\"));\n\t} else if (compiler == \"mingw\") {\n\t\tvf.WriteLine(\"INCLUDE+=;\" + buildInclude);\n\t\tvf.WriteLine(\"LIB+=;\" + buildLib);\n\t}\n\tvf.Close();\n}", "title": "" }, { "docid": "2d697e9ae47f29fb80508f3679790cc4", "score": "0.5121333", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_ShortXLUnicodeString(blob, length, opts);\n\tvar o = parslurp2(blob,length,parse_XTI);\n\tvar oo = [];\n\tif(opts.sbcch === 0x0401) {\n\t\tfor(var i = 0; i != o.length; ++i) oo.push(opts.snames[o[i][1]]);\n\t\treturn oo;\n\t}\n\telse return o;\n}", "title": "" }, { "docid": "2d697e9ae47f29fb80508f3679790cc4", "score": "0.5121333", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_ShortXLUnicodeString(blob, length, opts);\n\tvar o = parslurp2(blob,length,parse_XTI);\n\tvar oo = [];\n\tif(opts.sbcch === 0x0401) {\n\t\tfor(var i = 0; i != o.length; ++i) oo.push(opts.snames[o[i][1]]);\n\t\treturn oo;\n\t}\n\telse return o;\n}", "title": "" }, { "docid": "2d697e9ae47f29fb80508f3679790cc4", "score": "0.5121333", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_ShortXLUnicodeString(blob, length, opts);\n\tvar o = parslurp2(blob,length,parse_XTI);\n\tvar oo = [];\n\tif(opts.sbcch === 0x0401) {\n\t\tfor(var i = 0; i != o.length; ++i) oo.push(opts.snames[o[i][1]]);\n\t\treturn oo;\n\t}\n\telse return o;\n}", "title": "" }, { "docid": "103943c9efce4ea248d063ee5896494e", "score": "0.50863016", "text": "function extractBinaryFields(target,spec,data){var offset=0;for(var x=0;x<spec.length;x++){var item=spec[x];if(item.label){if(item.type==='string'){var bytes=new DataView(data.buffer,offset,item.size);var str=textDecoder.decode(bytes);target[item.label]=str.replace(/\\0/g,'');}else{target[item.label]=data['get'+item.type+item.size*8](offset);}}offset+=item.size;}return offset;}", "title": "" }, { "docid": "9e08654093870cf655fac3f9910937f3", "score": "0.507761", "text": "getVersion() {\n return this.buffer.readUInt8(0) >> 6;\n }", "title": "" }, { "docid": "b3562788825610190e13d4e95166c908", "score": "0.50696844", "text": "function _0x40df2e(_0x503d61,_0x1e0723){0x0;}", "title": "" }, { "docid": "7d362d8da60302dee74f31b75ccb9be9", "score": "0.5011458", "text": "function format7revision() {\r\n fso = new ActiveXObject(\"Scripting.FileSystemObject\");\r\n f = fso.openTextFile(entriesPath, ForReading, false);\r\n format = f.ReadLine();\r\n if (Number(format) < 7) throw new Error();\r\n f.ReadLine();\r\n f.ReadLine();\r\n rline = f.ReadLine();\r\n f.close();\r\n return Number(rline);\r\n}", "title": "" }, { "docid": "aee21740bbd32ef7e36e30d6465c53c9", "score": "0.5009038", "text": "function no_overlib() { return ver3fix; }", "title": "" }, { "docid": "6575b64388c2506fb1bc854df3cd977e", "score": "0.49924034", "text": "function ObjFile$CVTN() {\n}", "title": "" }, { "docid": "66e1c047e006a198d0ba35abb8d5164c", "score": "0.49621916", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tvar oo = [];\n\treturn o;\n}", "title": "" }, { "docid": "66e1c047e006a198d0ba35abb8d5164c", "score": "0.49621916", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tvar oo = [];\n\treturn o;\n}", "title": "" }, { "docid": "dd581b07dd89382918c579591ecfbbef", "score": "0.4959138", "text": "firstOffset() { return this.buffer.readIntLE (24, 6); }", "title": "" }, { "docid": "1efbdbafb1d385b3cdf2d889bb7f6714", "score": "0.4950018", "text": "function parse_PtgSxName(blob) {\n blob.l += 2;\n return [blob.read_shift(4)];\n }", "title": "" }, { "docid": "3a8a8ded65e8379e784c6ce084ed340a", "score": "0.49285963", "text": "function parse_Xnum(data) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.4906398", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.4906398", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.4906398", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.4906398", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "6d19d0433ca006326334f0ae3381744d", "score": "0.4906398", "text": "function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }", "title": "" }, { "docid": "b36870915304629d2c44ca9b0c395e24", "score": "0.48925337", "text": "static getVersion() { return 1; }", "title": "" }, { "docid": "11ca7e1b9563c9e39ed1db58c4d518e3", "score": "0.48861694", "text": "function configureExslt()\n{\n\tvar fso, ofi, of, ln, s;\n\tfso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\tofi = fso.OpenTextFile(optsFileInExslt, 1);\n\tof = fso.CreateTextFile(optsFileExslt, true);\n\twhile (ofi.AtEndOfStream != true) {\n\t\tln = ofi.ReadLine();\n\t\ts = new String(ln);\n\t\tif (s.search(/\\@VERSION\\@/) != -1) {\n\t\t\tof.WriteLine(s.replace(/\\@VERSION\\@/, \n\t\t\t\tverMajorExslt + \".\" + verMinorExslt + \".\" + verMicroExslt));\n\t\t} else if (s.search(/\\@LIBEXSLT_VERSION_NUMBER\\@/) != -1) {\n\t\t\tof.WriteLine(s.replace(/\\@LIBEXSLT_VERSION_NUMBER\\@/, \n\t\t\t\tverMajorExslt*10000 + verMinorExslt*100 + verMicroExslt*1));\n\t\t} else if (s.search(/\\@LIBEXSLT_VERSION_EXTRA\\@/) != -1) {\n\t\t\tof.WriteLine(s.replace(/\\@LIBEXSLT_VERSION_EXTRA\\@/, verCvs));\n\t\t} else if (s.search(/\\@WITH_CRYPTO\\@/) != -1) {\n\t\t\tof.WriteLine(s.replace(/\\@WITH_CRYPTO\\@/, withCrypto? \"1\" : \"0\"));\n\t\t} else if (s.search(/\\@WITH_MODULES\\@/) != -1) {\n\t\t\tof.WriteLine(s.replace(/\\@WITH_MODULES\\@/, withModules? \"1\" : \"0\"));\n\t\t} else\n\t\t\tof.WriteLine(ln);\n\t}\n\tofi.Close();\n\tof.Close();\n}", "title": "" }, { "docid": "e3ff8f42604ee4f85d4d906c8c1bdf62", "score": "0.485176", "text": "function BranchNumberClientPbxBL() {\n\n}", "title": "" }, { "docid": "479f8866cbefa3f12a79b452bf5953e1", "score": "0.48501766", "text": "function get_version_numbers()\n{\n\tvar cin = file_get_contents(\"configure.ac\");\n\n\tif (cin.match(new RegExp(\"PHP_MAJOR_VERSION=(\\\\d+)\"))) {\n\t\tPHP_VERSION = RegExp.$1;\n\t}\n\tif (cin.match(new RegExp(\"PHP_MINOR_VERSION=(\\\\d+)\"))) {\n\t\tPHP_MINOR_VERSION = RegExp.$1;\n\t}\n\tif (cin.match(new RegExp(\"PHP_RELEASE_VERSION=(\\\\d+)\"))) {\n\t\tPHP_RELEASE_VERSION = RegExp.$1;\n\t}\n\tPHP_VERSION_STRING = PHP_VERSION + \".\" + PHP_MINOR_VERSION + \".\" + PHP_RELEASE_VERSION;\n\n\tif (cin.match(new RegExp(\"PHP_EXTRA_VERSION=\\\"([^\\\"]+)\\\"\"))) {\n\t\tPHP_EXTRA_VERSION = RegExp.$1;\n\t\tif (PHP_EXTRA_VERSION.length) {\n\t\t\tPHP_VERSION_STRING += PHP_EXTRA_VERSION;\n\t\t}\n\t}\n\tDEFINE('PHP_VERSION_STRING', PHP_VERSION_STRING);\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.48491353", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.48491353", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.48491353", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.48491353", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "94658e7fd1bc3877a69f822b3d0dc2d4", "score": "0.48491353", "text": "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}", "title": "" }, { "docid": "3490d043570816809f1cee7f9ee2c720", "score": "0.48336434", "text": "function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3490d043570816809f1cee7f9ee2c720", "score": "0.48336434", "text": "function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3490d043570816809f1cee7f9ee2c720", "score": "0.48336434", "text": "function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3490d043570816809f1cee7f9ee2c720", "score": "0.48336434", "text": "function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3490d043570816809f1cee7f9ee2c720", "score": "0.48336434", "text": "function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "3490d043570816809f1cee7f9ee2c720", "score": "0.48336434", "text": "function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }", "title": "" }, { "docid": "e587c118a97145aa64f80d2fbd773141", "score": "0.48316264", "text": "function parse_ExternSheet(blob, length, opts) {\n if (opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n var o = [],\n target = blob.l + length,\n len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\n while (len-- !== 0) {\n o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n } // [iSupBook, itabFirst, itabLast];\n\n\n if (blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n return o;\n }", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.48272982", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dad081b06d9044bbf81479ea7a943d53", "score": "0.48210028", "text": "function ibmCommonDesignVersion() {\nvar a;\nvar ibmv11, ibmv14, lenovo;\n\nibmv11 = ibmv14 = lenovo = false;\n\nif (document.getElementsByTagName) {\nfor (var i = 0; (a = document.getElementsByTagName(\"link\")[i]); i++) {\nif (a.getAttribute(\"rel\").indexOf(\"style\") != -1) {\nif (a.getAttribute(\"href\").indexOf(\"//www.lenovo.com/common/v14/\") != -1) { lenovo = \"lenovo-think-v14\"; }\nelse if (a.getAttribute(\"href\").indexOf(\"//www.lenovo.com/common/l14/\") != -1) { lenovo = lenovo || \"lenovo-v14\"; break; }\nelse if (a.getAttribute(\"href\").indexOf(\"//www.ibm.com/common/v14/\") != -1) { ibmv14 = \"ibm-v14\"; }\nelse if (a.getAttribute(\"href\").indexOf(\"//www.ibm.com/data/css/v11/\") != -1) { ibmv11 = \"ibm-v11\"; }\n}\n}\n}\nreturn (lenovo || ibmv14 || ibmv11 || \"unknown\");\n}", "title": "" }, { "docid": "4822bc7ea4d57a4403a7e25360f8c812", "score": "0.4804987", "text": "function parseDownloadSdb(x)\n{\n\tdata = x.split(';');\n\t\n\t// Type class definition from the 3S documentation\n\t// Unsupported data types are commented out.\n\tvar typeClass = new Array();\n\ttypeClass[0] = 'BOOL';\n\ttypeClass[1] = 'INT';\n\ttypeClass[2] = 'BYTE';\n\ttypeClass[3] = 'WORD';\n\ttypeClass[4] = 'DINT';\n\ttypeClass[5] = 'DWORD';\n\ttypeClass[6] = 'REAL';\n\ttypeClass[7] = 'TIME';\n\ttypeClass[8] = 'STRING';\n\t//typeClass[9] = 'ARRAY';\n\t//typeClass[10] = 'ENUM';\n\t//typeClass[11] = 'USERDEF';\n\t//typeClass[12] = 'BITORBYTE';\n\t//typeClass[13] = 'POINTER';\n\ttypeClass[14] = 'SINT';\n\ttypeClass[15] = 'USINT';\n\ttypeClass[16] = 'UINT';\n\ttypeClass[17] = 'UDINT';\n\ttypeClass[18] = 'DATE';\n\ttypeClass[19] = 'TOD';\n\ttypeClass[20] = 'DT';\n\t//typeClass[21] = 'VOID';\n\ttypeClass[22] = 'LREAL';\n\t//typeClass[23] = 'REF';\n\ttypeClass[28] = 'LWORD';\n\n\t// Global header \n\tvar headerSize = getUlong(4);\n\t\n\t// Type list header\n\tvar typeListSize = getUlong(headerSize + 4);\n\tvar typeListCount = getUlong(headerSize + 12);\n\t\n\t// Type elements\n\tvar types = new Array();\n\tvar next = headerSize + 16;\n\tfor (i = 0; i<typeListCount; i++)\n\t{\n\t\ttypes[i] = getUlong(next + 8);\n\t\tnext = next + getUlong(next + 4);\n\t}\n\t\n\t// Var list header \n\tnext = headerSize + typeListSize;\n\tvar varListSize = getUlong(next + 4);\n\tvar varListCount = getUlong(next + 12);\n\t\n\t// Var elements\n\tnext = next + 16;\n\tvar vars = new Array();\n\tfor (var i=0; i<varListCount; i++)\n\t{\n\t\tvar tmptype = getUlong(next + 8);\n\t\tvars[i] = new Array();\n\t\tvars[i][0] = tmptype\n\t\tvar tmpStr = '';\n\t\tvar tmpSize = parseInt(data[(next + 24)/2], 16);\n\t\tfor (var j=0; j<tmpSize; j++)\n\t\t\ttmpStr += getChar(next + 26 + j);\n\t\tvars[i][1] = tmpStr;\n\t\tnext = next + getUlong(next + 4);\n\t}\n\t\n\t// Inject results to document\n\tvar result = '';\n\tfor (var i=0; i<vars.length; i++)\n\t{\n\t\tif (typeof(typeClass[types[vars[i][0]]]) != 'undefined') result += '<tr class=\"varRow\"><td>' + vars[i][1] + '</td><td>' + typeClass[ types[ vars[i][0] ] ] + '</td><td><input class=\"varUse\" type=\"checkbox\" /></td></tr>';\n\t}\n\tif (result.length > 0)\n\t{\n\t\t$(\"#replaceMe\").replaceWith(result);\n\t\t$(\"#varTable\").css(\"display\", \"\");\n\t\t$(\"#loading\").css(\"display\", \"none\");\n\t}\n\telse\n\t{\n\t\t$(\"#loading\").html(\"<p><img src='../images/Error.gif' style='margin-right: 3px;'/>Symbol file is empty or does not exist!</p>\");\n\t}\n}", "title": "" }, { "docid": "b7dd8b8fc29ac6a2c988e9e071948f73", "score": "0.47973344", "text": "function getMSXMLVersion() \r\n\t{\r\n\t\tif (window.ActiveXObject)\r\n\t {\r\n\t\t\tvar aVersions = // [\"MSXML2.DOMDocument.5.0\", \"MSXML2.DOMDocument.4.0\",\"MSXML2.DOMDocument.3.0\",\r\n\t \t\t\t\t\t[ \"MSXML2.DOMDocument\",\"Microsoft.DOMDocument\"];\r\n\t\t\tfor (var i = 0; i < aVersions.length; i++)\r\n\t\t\t{\r\n\t \ttry \r\n\t \t{\r\n\t \tvar oXmlHttp = new ActiveXObject(aVersions[i]);\r\n\t \treturn aVersions[i];\r\n\t \t} catch(e){}\r\n\t \t}\r\n\t }\r\n\t}", "title": "" }, { "docid": "033884424ba3b71afda1d7f99e4ad68f", "score": "0.47820944", "text": "function parse_Ref8U(blob, length) {\n\tvar rwFirst = blob.read_shift(2);\n\tvar rwLast = blob.read_shift(2);\n\tvar colFirst = blob.read_shift(2);\n\tvar colLast = blob.read_shift(2);\n\treturn {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};\n}", "title": "" }, { "docid": "033884424ba3b71afda1d7f99e4ad68f", "score": "0.47820944", "text": "function parse_Ref8U(blob, length) {\n\tvar rwFirst = blob.read_shift(2);\n\tvar rwLast = blob.read_shift(2);\n\tvar colFirst = blob.read_shift(2);\n\tvar colLast = blob.read_shift(2);\n\treturn {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};\n}", "title": "" }, { "docid": "033884424ba3b71afda1d7f99e4ad68f", "score": "0.47820944", "text": "function parse_Ref8U(blob, length) {\n\tvar rwFirst = blob.read_shift(2);\n\tvar rwLast = blob.read_shift(2);\n\tvar colFirst = blob.read_shift(2);\n\tvar colLast = blob.read_shift(2);\n\treturn {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};\n}", "title": "" } ]
65a5778dc8c8d0785d1a431db8ae1270
responsive code begin you can remove responsive code if you don't want the slider scales while window resizing
[ { "docid": "502c9a94bd53bd2fe68b8b2a228492a2", "score": "0.73095286", "text": "function ScaleSlider() {\r\n var refSize = jssor_2_slider.$Elmt.parentNode.clientWidth;\r\n if (refSize) {\r\n refSize = Math.min(refSize, 1920);\r\n jssor_2_slider.$ScaleWidth(refSize);\r\n }\r\n else {\r\n window.setTimeout(ScaleSlider, 30);\r\n }\r\n }", "title": "" } ]
[ { "docid": "09679ae15168ac189b00518e79226bbd", "score": "0.7292206", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1920);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "09679ae15168ac189b00518e79226bbd", "score": "0.7292206", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1920);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "619ab1a534d7a633c04213be81bedd27", "score": "0.7290001", "text": "function ScaleSlider() {\n var bodyWidth = document.body.clientWidth;\n if (bodyWidth)\n jssor_slider1.$ScaleWidth(Math.min(bodyWidth, 1920));\n else\n window.setTimeout(ScaleSlider, 30);\n }", "title": "" }, { "docid": "b518dabbf03ffcb607774ac231571592", "score": "0.7273492", "text": "function ScaleSlider() {\r\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\r\n if (refSize) {\r\n refSize = Math.min(refSize, 1920);\r\n jssor_1_slider.$ScaleWidth(refSize);\r\n }\r\n else {\r\n window.setTimeout(ScaleSlider, 30);\r\n }\r\n }", "title": "" }, { "docid": "e63b3c3e59641f627f31ffa1d44eb2c3", "score": "0.722528", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 640);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "58e021cb4525fc7cb5167a456f83b313", "score": "0.72208124", "text": "function responsive(){\n if(options.responsive){\n var isResponsive = container.hasClass(RESPONSIVE);\n if ($window.width() < options.responsive ){\n if(!isResponsive){\n FP.setAutoScrolling(false, 'internal');\n FP.setFitToSection(false, 'internal');\n $(SECTION_NAV_SEL).hide();\n container.addClass(RESPONSIVE);\n }\n }else if(isResponsive){\n FP.setAutoScrolling(originals.autoScrolling, 'internal');\n FP.setFitToSection(originals.autoScrolling, 'internal');\n $(SECTION_NAV_SEL).show();\n container.removeClass(RESPONSIVE);\n }\n }\n }", "title": "" }, { "docid": "af7c3f419eac69ec5900bafdcecb201c", "score": "0.7207543", "text": "function resizeSlider() {\n let widthD = Number($(window).width()); // in px\n let widthW = parseInt($(\":root\").css('--widthSlider')); // in vw\n let widthT = parseInt($(\":root\").css('--widthT')); // in vw\n let wW = widthW / 100 * widthD; // in px\n let wT = widthT / 100 * widthD; // in px\n let leftEdge = $(\"#sendB\").offset().left - wT/2;\n let rightEdge = $(\"#sendB\").offset().left + wW - wT/2;\n let val = Number($(\"#slider-wrapper\").attr('val'));\n let max = Number($(\"#slider-wrapper\").attr('max'));\n let f = val / max;\n let widthLNew = Math.max(0, f * wW - wT);\n let marginTNew = Math.max(0, f * wW - wT);\n let widthRNew = Math.min((1-f) * wW, wW-wT);\n let marginRNew = Math.max(wT, widthLNew+wT);\n $(\"#slider-left\").css('width', widthLNew);\n $(\"#slider-thumb\").css('marginLeft', marginTNew);\n $(\"#slider-right\").css('width', widthRNew);\n $(\"#slider-right\").css('marginLeft', marginRNew); \n }", "title": "" }, { "docid": "eef030b4862ddba2366ede40c8029bd4", "score": "0.7167941", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1200);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "fd6cc87a970e74ed1cdd0b8dcf58e689", "score": "0.7165131", "text": "function responsiveCarousel(){\n\t\tif (window.innerWidth >= 992) {\n\t\t\tcarouselFix(7);\n\t\t\tanimationingIconsOfCarousel();\n\t\t\thideHeader();\n\t\t\tjQuery(\".column, .soonOnTheSiteContent\").removeClass('flex-column');\n\t\t}\n\n\t\tif (window.innerWidth >= 768 && window.innerWidth < 992) {\n\t\t\tcarouselFix(5);\n\t\t\tanimationingIconsOfCarousel();\n\t\t\thideHeader();\n\t\t\tjQuery(\".column, .soonOnTheSiteContent\").removeClass('flex-column');\n\t\t}\n\t\t\n\t\tif (window.innerWidth >= 531 && window.innerWidth <= 767) {\n\t\t\tcarouselFix(3);\n\t\t\tanimationingIconsOfCarousel();\n\t\t\tjQuery(\".column, .soonOnTheSiteContent\").removeClass('flex-column');\t\n\t\t}\n\n\t\tif (window.innerWidth <= 530) {\n\t\t\tcarouselFix(1);\n\t\t\tjQuery(\"#desktop .d-flex\").attr('class', 'sl');\n\t\t\tjQuery(\".sl img\").attr('class', 'd-block');\n\t\t\t\t/*proportions for responsive img*/\n\t\t\tvar imgSize = jQuery(\"#desktop .sl\").width();\n\t\t\tjQuery(\"#desktop img\").width(imgSize);\n\t\t\tjQuery(\"#desktop img\").height(imgSize / (200 / 300));\n\t\t\tanimationingIconsOfCarousel(\"transparent\");\n\t\t\tjQuery(\".column, .soonOnTheSiteContent\").addClass('flex-column');\n\t\t}\n\t}", "title": "" }, { "docid": "452e8a8273a99b3b1a43aae63eefe2ea", "score": "0.71495205", "text": "onWindowResize() {\n\t\tfor (const res in this.options.responsive) {\n\t\t\tif (window.innerWidth >= res) {\n\t\t\t\tthis.options.slidesToScroll = this.options.responsive[res].slidesToScroll;\n\t\t\t\tthis.options.slidesVisible = this.options.responsive[res].slidesVisible;\n\t\t\t}\n\t\t}\n\n\t\tif (this.options.pagination) this.createPagination();\n\t\tthis.setStyle();\n\t\tthis.moveCallBacks.forEach((cb) => cb(this.currentItem));\n\t}", "title": "" }, { "docid": "54e95dadab87f4f1f98b862269d5006b", "score": "0.7149431", "text": "function ScaleSlider() {\n var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;\n if (parentWidth) {\n jssor_slider1.$ScaleWidth(parentWidth - 30);\n }\n else\n window.setTimeout(ScaleSlider, 30);\n }", "title": "" }, { "docid": "f126b7a5cd6cb632951cb0031fb5fc5c", "score": "0.7144641", "text": "function ScaleSlider() {\r\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\r\n if (refSize) {\r\n refSize = Math.min(refSize, 1920);\r\n jssor_1_slider.$ScaleWidth(refSize);\r\n } else {\r\n window.setTimeout(ScaleSlider, 30);\r\n }\r\n }", "title": "" }, { "docid": "ed7f2a77e7cae09e9ef596784dff1e47", "score": "0.7137142", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 980);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "010befbe1fe1f9bb289c3564f6119e43", "score": "0.71357876", "text": "function ScaleSlider() {\r\n var parentWidth = jssor_slider.$Elmt.parentNode.clientWidth;\r\n if (parentWidth)\r\n jssor_slider.$ScaleWidth(Math.min(parentWidth*0.45,480));\r\n else\r\n window.setTimeout(ScaleSlider, 30);\r\n }", "title": "" }, { "docid": "bc9aa3ea6d2b8b327b2fa2944197d5ca", "score": "0.7112951", "text": "function ScaleSlider() {\n var refSize = jssor_2_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 568);\n jssor_2_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "9d0e6b1cbdd297d4d603bde168b37783", "score": "0.71021485", "text": "function ScaleSlider() {\n var refSize = jssor_3_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 568);\n jssor_3_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "93b3b3467699c3b62bd0d31b4c5aa0ae", "score": "0.7100888", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 960);\n refSize = Math.max(refSize, 300);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "9ef64e5858792cefa8be03a96ab9f28f", "score": "0.7097763", "text": "function ScaleSlider() {\n var refSize = jssor_4_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 568);\n jssor_4_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "514185089a7aa392eb86d065e167fc58", "score": "0.7085001", "text": "function ScaleSlider() {\n var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;\n if (parentWidth) {\n jssor_slider1.$ScaleWidth(parentWidth - 30);\n }\n else\n window.setTimeout(ScaleSlider, 30);\n }", "title": "" }, { "docid": "31c4955efea78cbd1186549a52eabb7b", "score": "0.70836264", "text": "function reCalculateSliderParams() {\n //if ($('.bxslider-img li').length > 1) {\n // isAuto = true;\n //}\n\n var wd = window.innerWidth || $(window).width();\n if (wd < 1200) {\n if (wd > 767) {\n slides = 2;\n slideMode = 'vertical';\n }\n else if (wd <= 767 && wd > 600) {\n slideMode = 'horizontal';\n }\n else if (wd <= 600 && wd > 500) {\n slideMode = 'horizontal';\n slides = 2;\n }\n else {\n slideMode = 'horizontal';\n slides = 2;\n }\n }\n}", "title": "" }, { "docid": "01635cd073326719a7984627406c6c8c", "score": "0.7082319", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 568);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "ecc2b9214741830f7c52ca56b7879bfb", "score": "0.70692265", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1400);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 40);\n }\n }", "title": "" }, { "docid": "f8ff6e0f662f7b87147b2a69e9acc71c", "score": "0.70582306", "text": "function responsive() {\n\t\t\tif (options.responsive) {\n\t\t\t\tvar isResponsive = container.hasClass('fp-responsive');\n\t\t\t\tif ($(window).width() < options.responsive) {\n\t\t\t\t\tif (!isResponsive) {\n\t\t\t\t\t\tFP.setAutoScrolling(false, 'internal');\n\t\t\t\t\t\tFP.setFitToSection(false, 'internal');\n\t\t\t\t\t\t$('#fp-nav').hide();\n\t\t\t\t\t\tcontainer.addClass('fp-responsive');\n\t\t\t\t\t}\n\t\t\t\t} else if (isResponsive) {\n\t\t\t\t\tFP.setAutoScrolling(originals.autoScrolling, 'internal');\n\t\t\t\t\tFP.setFitToSection(originals.autoScrolling, 'internal');\n\t\t\t\t\t$('#fp-nav').show();\n\t\t\t\t\tcontainer.removeClass('fp-responsive');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c7e9dab8ace4f56cb4ce56c6abe4bce3", "score": "0.7056734", "text": "function ScaleSlider() {\n var parentWidth = $('#slider1_container').parent().width();\n if (parentWidth) {\n jssor_slider1.$ScaleWidth(parentWidth);\n }\n else\n window.setTimeout(ScaleSlider, 30);\n }", "title": "" }, { "docid": "1616d6476da347fa5e68b834116e60d1", "score": "0.7037724", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 800);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "34b5f56f7766af8c7abdfb1ca0d440d6", "score": "0.7031013", "text": "function ResizeSliderHome() {\n if($('#slide-home')) {\n var parentWidth = $('.slide-cn._1').innerWidth(),\n imgWidth = $('.item-inner').width(),\n imgHeight = $('.item-inner').height(),\n scale = parentWidth/imgWidth,\n ratio = imgWidth/imgHeight,\n heightItem = parentWidth/ratio;\n\n $('.slide-item').css({'height': heightItem});\n\n if ($(window).width() <= 1200) {\n\n $('.item-inner').css({\n '-webkit-transform': 'scale(' + scale + ')',\n '-moz-transform': 'scale(' + scale + ')',\n '-ms-transform': 'scale(' + scale + ')',\n 'transform': 'scale(' + scale + ')'\n });\n\n } else {\n\n $('.item-inner').css({\n '-webkit-transform': 'scale(1)',\n '-moz-transform': 'scale(1)',\n '-ms-transform': 'scale(1)',\n 'transform': 'scale(1)'\n });\n\n }\n }\n }", "title": "" }, { "docid": "490b80e563d1136df602171f9b83830a", "score": "0.7027378", "text": "function ScaleSlider() {\n \n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n \n if (refSize) {\n \n refSize = Math.min(refSize, 600);\n \n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n \n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "56ace9937796eaa62e49e83bde4f2c70", "score": "0.7026543", "text": "function ScaleSlider1() {\r\n var refSize1 = jssor_1_slider.$Elmt.parentNode.clientWidth;\r\n \r\n if (refSize1) {\r\n refSize1 = Math.min(refSize1, 800);\r\n jssor_1_slider.$ScaleWidth(refSize1);\r\n }\r\n else {\r\n window.setTimeout(ScaleSlider1, 30);\r\n }\r\n }", "title": "" }, { "docid": "648935fca6a0bd85c0bd4a28a7a71570", "score": "0.7022965", "text": "resizeHandler() {\n this.slidesAmount();\n\n if ((this.curSlide + this.visibleSlides) > this.innerItems.length) {\n this.curSlide = this.innerItems.length <= this.visibleSlides ? 0 : this.innerItems.length - this.visibleSlides;\n }\n this.selectorWidth = this.selector.offsetWidth;\n\n this.sliderContainerCreate();\n\n if (this.config.arrows) {\n this.arrowsVisibility();\n this.arrowsInit();\n }\n\n if (this.config.useCssFile && this.config.activeClass) {\n this.activeClass();\n }\n\n if (this.config.pagination) {\n this.paginationVisibility();\n this.paginationInit();\n this.paginationUpdate();\n }\n }", "title": "" }, { "docid": "a8390a4cd52a42b6b119710c17465899", "score": "0.7016697", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n jssor_1_slider.$ScaleWidth(refSize);\n } else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "c3b55539ff52f38bda3c6b79e514be5d", "score": "0.7012814", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1160);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "b94444b4dc9447ebf10f2a83abbdba5b", "score": "0.70032066", "text": "function ScaleSlider() {\n var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;\n if (parentWidth)\n jssor_slider1.$SetScaleWidth(Math.min(parentWidth, 600));\n else\n window.setTimeout(ScaleSlider, 30);\n }", "title": "" }, { "docid": "d3df22a9ea50dc53c44b6b6f7e895c81", "score": "0.6985633", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "8ca59d81c408f33f97c0f2beae7dda71", "score": "0.6981066", "text": "function ScaleSlider() {\n\t\tvar parentWidth = $('#slider1_container').parent().width();\n\t\tif (parentWidth < 600) {\n\t\t\tjssor_slider1.$ScaleWidth(parentWidth);\n\t\t} else\n\t\twindow.setTimeout(ScaleSlider, 30);\n\t}", "title": "" }, { "docid": "69accbc7ecc4c85c348eb0c0eead00c5", "score": "0.69774234", "text": "function responsive(){\n\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n\n var heightLimit = options.responsiveHeight;\n\n\n\n //only calculating what we need. Remember its called on the resize event.\n\n var isBreakingPointWidth = widthLimit && window.innerWidth < widthLimit;\n\n var isBreakingPointHeight = heightLimit && window.innerHeight < heightLimit;\n\n\n\n if(widthLimit && heightLimit){\n\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n\n }\n\n else if(widthLimit){\n\n setResponsive(isBreakingPointWidth);\n\n }\n\n else if(heightLimit){\n\n setResponsive(isBreakingPointHeight);\n\n }\n\n }", "title": "" }, { "docid": "41afb59e89b6900b6dcc7ba12af6341e", "score": "0.6970091", "text": "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 600);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "title": "" }, { "docid": "a8efc54bf4172b31ae47635af85a2695", "score": "0.69667494", "text": "function dslc_carousel_responsive() {\n\n\t// Loop through each carousel\n\tjQuery( '.dslc-carousel' ).each( function() {\n\n\t\t// Variables\n\t\tvar carousel, container;\n\n\t\t// Elements\n\t\tcarousel = jQuery( this );\n\t\tcontainer = carousel.closest( '.dslc-module-front' );\n\n\t\tcarousel.css({ 'margin-left' : 0, 'width' : 'auto' });\n\n\t\tif ( container.closest('.dslc-modules-section').hasClass('dslc-no-columns-spacing') ) {\n\n\t\t\tvar margin = 0;\n\t\t} else {\n\n\t\t\tvar margin = ( container.width() / 100 * 2.12766 ) / 2;\n\t\t}\n\n\t\tif ( carousel.hasClass('dslc-carousel') ) {\n\n\t\t\tcarousel.find('.dslc-col').css({ 'margin-left' : margin, 'margin-right' : margin });\n\t\t\tcarousel.css({ 'margin-left' : margin * -1, 'width' : carousel.width() + margin * 2 });\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a80e588467b28d3d1290dca2256855d1", "score": "0.6916472", "text": "function init(){if(window.innerWidth<990){var e=document.querySelector(\".slider\"),t=window.innerWidth,n,o,r=document.querySelector(\".slide.active\").querySelector(\".slide__content\").offsetHeight+t+200;e.style.height=r+\"px\"}//Hide all slide that aren't active\nslides.forEach(function(e){hasClass(e,\"active\")||TweenLite.set(e,{autoAlpha:0})}),// Disable arrow on page load\nTweenLite.set(prevSlide,{autoAlpha:.2})}", "title": "" }, { "docid": "0a2a689d302f7c9a99348c3c678339f2", "score": "0.6884381", "text": "function updateOnResize() {\r\n /* remove height from slide's element which has class \"content-wrapper\" */\r\n var width = $(window).width();\r\n if (width > 991) {\r\n $('.sub-slides').children('li').find('.content-wrapper').css(\"height\", \"\");\r\n }\r\n mq = windowWidth(slideshow.get(0));\r\n bindEvents(mq, bindToggle);\r\n if (mq == 'mobile') {\r\n bindToggle = true;\r\n\r\n /* set translateX to 0 if browser widht is less than or equal to 767 */\r\n var windowwidthforSwipe = $(window).width();\r\n if (windowwidthforSwipe <= 767) {\r\n setTimeout(function () {\r\n for (var i = 0; i < slides.length; i++) {\r\n if ($(slides[i]).children('.sub-slides').length > 0) {\r\n setTransformValue($(slides[i]).children('.sub-slides').get(0), 'translateX', 0 + 'px');\r\n }\r\n }\r\n\r\n }, 200);\r\n }\r\n\r\n slideshow.attr('style', '').children('.visible').removeClass('visible');\r\n\r\n } else {\r\n bindToggle = false;\r\n }\r\n\r\n\r\n initSlideshow(slideshow);\r\n\r\n /* set height for slide's element which has class \"content-wrapper\" */\r\n setTimeout(function () {\r\n SetSlideHeights();\r\n }, 1000);\r\n\r\n resizing = false;\r\n\r\n /* if menu is open on resize and browser width is greater than 767 then unbind DOMMouseScroll and mousewheel events from window*/\r\n if (navigation.hasClass('nav-open') && mq == 'desktop') {\r\n setTimeout(function () {\r\n $(window).off('DOMMouseScroll mousewheel', updateOnScroll);\r\n }, 1000);\r\n }\r\n\r\n }", "title": "" }, { "docid": "d235c028e71b3737a0eba252bc2df9ab", "score": "0.68690425", "text": "function resize() {\n\n let windowWidth = window.innerWidth;\n const el = document.querySelectorAll(\".article-container\");\n \n if (windowWidth > 738){\n articleContainer.css('width', '738px');\n sliderContainer.css('width', numberOfArticles * articleContainerWidth);\n\n el.forEach(function (val, i) {\n el[i].setAttribute('data-pos', i * -738 + 'px'); \n });\n }else{ \n articleContainer.css('width', windowWidth); \n sliderContainer.css('width', numberOfArticles * windowWidth);\n //reset positon of slider\n sliderContainer.css('transform', 'translate3d(0 ,0, 0)');\n \n el.forEach(function (val, i) {\n el[i].setAttribute('data-pos', i * -windowWidth + 'px'); \n });\n };\n }", "title": "" }, { "docid": "ccd5748e21b8a21f3aa55b058329d165", "score": "0.68590254", "text": "function brandSlider() {\n const slider = $('.brand-slider-one-active');\n\n slider.slick({\n infinite: true,\n dots: false,\n arrows: false,\n speed: 500,\n slidesToShow: 5,\n slidesToScroll: 1,\n autoplay: false,\n autoplaySpeed: 5000,\n responsive: [\n {\n breakpoint: 1200,\n settings: {\n slidesToShow: 4,\n }\n },\n {\n breakpoint: 992,\n settings: {\n slidesToShow: 3,\n }\n },\n {\n breakpoint: 500,\n settings: {\n slidesToShow: 2,\n }\n },\n ]\n });\n }", "title": "" }, { "docid": "3c8d8cb96661e1e940c681af5bc95384", "score": "0.68501073", "text": "function responsive(){\r\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\r\n var heightLimit = options.responsiveHeight;\r\n\r\n //only calculating what we need. Remember its called on the resize event.\r\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\r\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\r\n\r\n if(widthLimit && heightLimit){\r\n FP.setResponsive(isBreakingPointWidth || isBreakingPointHeight);\r\n }\r\n else if(widthLimit){\r\n FP.setResponsive(isBreakingPointWidth);\r\n }\r\n else if(heightLimit){\r\n FP.setResponsive(isBreakingPointHeight);\r\n }\r\n }", "title": "" }, { "docid": "d784b51cc39f1b68b777098b31e9d83f", "score": "0.68216956", "text": "function responsiveResize()\n\t{\n\t\tvar compensante = scrollCompensate();\n\t\tif (($(window).width()+scrollCompensate()) <= 767 && responsiveflag == false) {\n\t\t\taccordion('enable');\n\t\t\taccordionFooter('enable');\n\t\t\tresponsiveflag = true;\n\t\t} else if (($(window).width()+scrollCompensate()) >= 768) {\n\t\t\taccordion('disable');\n\t\t\taccordionFooter('disable');\n\t\t\tresponsiveflag = false;\n\t\t\tif (typeof bindUniform !=='undefined')\n\t\t\t\tbindUniform();\n\t\t}\n\t}", "title": "" }, { "docid": "3aa8571110a43507937cc3e9719242c5", "score": "0.6819853", "text": "function responsive(){\r\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\r\n var heightLimit = options.responsiveHeight;\r\n\r\n //only calculating what we need. Remember its called on the resize event.\r\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\r\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\r\n\r\n if(widthLimit && heightLimit){\r\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\r\n }\r\n else if(widthLimit){\r\n setResponsive(isBreakingPointWidth);\r\n }\r\n else if(heightLimit){\r\n setResponsive(isBreakingPointHeight);\r\n }\r\n }", "title": "" }, { "docid": "2e228723ac3d2c075a2b374ee7652a10", "score": "0.6819594", "text": "function resizeEvent() {\r\n\t\t\t\tvar wWidth,\r\n\t\t\t\t\twHeight,\r\n\t\t\t\t\tmode,\r\n\t\t\t\t\tpcMode;\r\n\r\n\t\t\t\tchkWidth();\r\n\r\n\t\t\t\t$(window).resize(function(e) {\r\n\t\t\t\t\t//visual 레이아웃 체인지\r\n\t\t\t\t\tchkWidth();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfunction chkWidth() {\r\n\r\n\t\t\t\t\twWidth = window.innerWidth;\r\n\t\t\t\t\tif (wWidth < 768) {\r\n\t\t\t\t\t\t//mobile\r\n\t\t\t\t\t\tif (mode != \"mobile\") {\r\n\t\t\t\t\t\t\t//100% 레이아웃 제거\r\n\t\t\t\t\t\t\tmyLayout.removeLayout();\r\n\t\t\t\t\t\t\t//모션 스탑\r\n\t\t\t\t\t\t\tmVisual.setMotionType(\"mobile\");\r\n\t\t\t\t\t\t\tmVisual.visualUnfixed();\r\n\t\t\t\t\t\t\tmVisual.objOpacity(1);\r\n\t\t\t\t\t\t\tmVisual.dimmedOpacity(0);\r\n\t\t\t\t\t\t\tmVisual.stopVideo();\r\n\r\n\t\t\t\t\t\t\tmyPhotoWall.resetParallex();\r\n\t\t\t\t\t\t\t//PC일때 bg생성 - 768~1280사이에서 제거한 이미지 복구\r\n\t\t\t\t\t\t\tif( mobileCheck() == \"pc\")mVisual.addImage();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//스크롤 관련 이벤트 제거 - visual play, parallax\r\n\t\t\t\t\t\t\tmyScroll.removeEvent(\"parallax\");\r\n\t\t\t\t\t\t\tmyScroll.update();\r\n\t\t\t\t\t\t\tmode = \"mobile\";\r\n\r\n\t\t\t\t\t\t\tmyPhotoWall.visualMode(\"mobile\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.hidden-image').remove();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (767 <= wWidth) {\r\n\t\t\t\t\t\tmyLayout.changeLayout();\r\n\t\t\t\t\t\tif (pcMode != true) {\r\n\t\t\t\t\t\t\tvod = $(\"#container section:eq(0) video\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tmVisual.setMotionType(\"pc\");\r\n\t\t\t\t\t\t\tmVisual.visualFixed();\r\n\t\t\t\t\t\t\t//mVisual.playVideo();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// 페이지 로딩시 동영상이 좀 늦게 나오도록 처리\r\n\t\t\t\t\t\t\t$(\"#container .img img:first\").show();\r\n\t\t\t\t\t\t\tvod.filter(':first').hide();\r\n\t\t\t\t\t\t\tvod.filter(':first')[0].pause();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvod.filter(':first')[0].onloadedmetadata = function() {\r\n\t\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\t\tvod.filter(':first').show();\r\n\t\t\t\t\t\t\t\t\t$(\"#container .img img:first\").hide();\r\n\t\t\t\t\t\t\t\t\tvod.filter(':first')[0].play();\r\n\t\t\t\t\t\t\t\t\t$('.hidden-image').remove();\r\n\t\t\t\t\t\t\t\t}, 1000);\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//타블렛일때 영상 제거\r\n\t\t\t\t\t\t\tif( mobileCheck() != \"pc\")mVisual.removeVideo();\r\n\r\n\t\t\t\t\t\t\tmyScroll.addEvent(\"parallax\");\r\n\t\t\t\t\t\t\tmyScroll.update();\r\n\t\t\t\t\t\t\tpcMode = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpcMode = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (768 <= wWidth && wWidth < 1280) {\r\n\t\t\t\t\t\t//pc1\r\n\t\t\t\t\t\tif (mode != \"mid\") {\r\n\t\t\t\t\t\t\tmyPhotoWall.visualMode(\"mid\");\r\n\t\t\t\t\t\t\t//PC일때 bg제거-video가 보이기 때문\r\n\t\t\t\t\t\t\tif( mobileCheck() == \"pc\")mVisual.removeImage();\r\n\t\t\t\t\t\t\tmode = \"mid\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (wWidth > 1280) {\r\n\t\t\t\t\t\t//pc2\r\n\t\t\t\t\t\tif (mode != \"big\") {\r\n\t\t\t\t\t\t\tmyPhotoWall.visualMode(\"big\");\r\n\t\t\t\t\t\t\tmode = \"big\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "title": "" }, { "docid": "c1a97186de694296fe2c9691cf4339a7", "score": "0.6789954", "text": "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\n }\n }", "title": "" }, { "docid": "c1a97186de694296fe2c9691cf4339a7", "score": "0.6789954", "text": "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\n }\n }", "title": "" }, { "docid": "c1a97186de694296fe2c9691cf4339a7", "score": "0.6789954", "text": "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\n }\n }", "title": "" }, { "docid": "c1a97186de694296fe2c9691cf4339a7", "score": "0.6789954", "text": "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\n }\n }", "title": "" }, { "docid": "c1a97186de694296fe2c9691cf4339a7", "score": "0.6789954", "text": "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\n }\n }", "title": "" }, { "docid": "3cbae28fdffbab37f7390ad55f7ea0b1", "score": "0.67353404", "text": "function sliderPhone(sliderName, slideCount) {\n $(sliderName).each(function() {\n $(this).slick({\n responsive: [{\n breakpoint: 99999,\n settings: \"unslick\"\n }, {\n breakpoint: 768,\n settings: {\n infinite: true,\n slidesToShow: slideCount,\n slidesToScroll: 1,\n dots: false,\n arrows: false\n }\n }]\n });\n });\n }", "title": "" }, { "docid": "01d3472633a527e43176c4e9d17267a6", "score": "0.67281556", "text": "function ScaleSlider() {\n\n //reserve blank width for margin+padding: margin+padding-left (10) + margin+padding-right (10)\n var paddingWidth = 0;\n\n //minimum width should reserve for text\n var minReserveWidth = 150;\n\n var parentElement = jssor_slider1.$Elmt.parentNode;\n\n //evaluate parent container width\n var parentWidth = parentElement.clientWidth;\n\n if (parentWidth) {\n\n //exclude blank width\n var availableWidth = parentWidth - paddingWidth;\n\n //calculate slider width as 70% of available width\n var sliderWidth = availableWidth ;\n\n //slider width is maximum 600\n sliderWidth = Math.min(sliderWidth, 1366);\n\n //slider width is minimum 200\n sliderWidth = Math.max(sliderWidth, 320);\n\n //evaluate free width for text, if the width is less than minReserveWidth then fill parent container\n if (availableWidth - sliderWidth < minReserveWidth) {\n\n //set slider width to available width\n sliderWidth = availableWidth;\n\n //slider width is minimum 200\n sliderWidth = Math.max(sliderWidth, 320);\n }\n\n jssor_slider1.$ScaleWidth(sliderWidth);\n }\n else\n window.setTimeout(ScaleSlider, 30);\n }", "title": "" }, { "docid": "0d03bed77c03a15e09a864ab6ae7aeca", "score": "0.67262745", "text": "function infContentResize() {\n homeSliderInit();\n}", "title": "" }, { "docid": "0878f6615339f2485012cad7ed9313b6", "score": "0.6700595", "text": "function slides() {\n if (window.innerWidth <= 650) {\n setSettings({ ...settings, slidesToShow: 1, slidesToScroll: 1 });\n } else if (window.innerWidth <= 870) {\n setSettings({ ...settings, slidesToShow: 2 });\n } else if (window.innerWidth <= 1150) {\n setSettings({ ...settings, slidesToShow: 3 });\n } else if (window.innerWidth > 1150) {\n setSettings({ ...settings, slidesToShow: 4 });\n }\n }", "title": "" }, { "docid": "b45bfbed5743cc0587c048e2a9839cc1", "score": "0.6675425", "text": "function resizeCall(){\n\t\tpageCalculations();\n\t\t$('.swiper-container.initialized[data-slides-per-view=\"responsive\"]').each(function(){\n\t\t\tvar thisSwiper = swipers['swiper-'+$(this).attr('id')], $t = $(this), slidesPerViewVar = updateSlidesPerView($t);\n\t\t\tthisSwiper.params.slidesPerView = slidesPerViewVar;\n\t\t\tthisSwiper.reInit();\n\t\t\tvar paginationSpan = $t.find('.pagination span');\n\t\t\tpaginationSpan.hide().slice(0,(paginationSpan.length+1-slidesPerViewVar)).show();\n\t\t});\t}", "title": "" }, { "docid": "2a710be29ff05d7249acdbcb4e6aa2ab", "score": "0.6663817", "text": "function slider_resize() {\n\n if ($(window).width() > 991 && $('.header-style1').length > 0 ) {\n \n setTimeout(function () {\n var header_style_outer_height = $('.header-style1').outerHeight();\n $(\".slider-content\").attr(\"style\", \"margin-top: \" + parseInt((header_style_outer_height-24)/2, 10) + \"px;\");\n $('.owl-nav div').attr(\"style\", \"margin-top: \" + parseInt((header_style_outer_height-24) / 2, 10) + \"px;\");\n \n },500);\n \n } else {\n\n $(\".slider-content\").first().attr(\"style\", \"margin-top: 0px;\");\n\n }\n }", "title": "" }, { "docid": "da819decac3487d22045eb7ce4b8d0a8", "score": "0.6636956", "text": "function resizeCall(){\n\t\tpageCalculations();\n\t\tvideoRezise();\n\t\tinitFullPage();\n\t\tupdateFullPage();\n\t\ttpEntryHover();\n\n\t\t$('.swiper-container.initialized[data-slides-per-view=\"responsive\"]').each(function(){\n\t\t\tvar thisSwiper = swipers['swiper-'+$(this).attr('id')], $t = $(this), slidesPerViewVar = updateSlidesPerView($t);\n\t\t\tthisSwiper.params.slidesPerView = slidesPerViewVar;\n\t\t\tthisSwiper.reInit();\n\t\t\tvar paginationSpan = $t.find('.pagination span');\n\t\t\tvar paginationSlice = paginationSpan.hide().slice(0,(paginationSpan.length+1-slidesPerViewVar));\n\t\t\tif(paginationSlice.length<=1 || slidesPerViewVar>=$t.find('.swiper-slide').length) $t.addClass('pagination-hidden');\n\t\t\telse $t.removeClass('pagination-hidden');\n\t\t\tpaginationSlice.show();\n\t\t});\n\t}", "title": "" }, { "docid": "d35de65b56c2bb96ab2ae873a7aeabd3", "score": "0.6632946", "text": "function responsiveJS() {\n sizingJS()\n if ( $(window).width() < 1440 ){\n private.jumbotron.css(\"min-height\", '793px');\n } else {\n private.jumbotron.css('min-height', '500px');\n }\n }", "title": "" }, { "docid": "1fa7b2ca13bfb191947326169b95e767", "score": "0.6624324", "text": "function setResponsiveSlideshow() {\n var $slideshow = $('div.view.dl-slideshow > div.view-content');\n $slideshow.each(function(){\n var countItems = $(\".group-slide-content\", this).length;\n if (countItems > 1) {\n $(this).slick({\n \t dots: false,\n //adaptiveHeight: true,\n \t autoplay: true,\n autoplaySpeed: 7000,\n \t responsive: true,\n infinite: true,\n speed: 500,\n //fade: true,\n slide: 'div.views-row',\n cssEase: 'linear'\n \t});\n }\n });\n }", "title": "" }, { "docid": "c2b5f41e25c7f7670dfe4168f8fe5147", "score": "0.6620313", "text": "function resizeCall(){\n pageCalculations();\n $('.swiper-container.initialized[data-slides-per-view=\"responsive\"]').each(function(){\n var thisSwiper = swipers['swiper-'+$(this).attr('id')], $t = $(this), slidesPerViewVar = updateSlidesPerView($t), centerVar = thisSwiper.params.centeredSlides;\n thisSwiper.params.slidesPerView = slidesPerViewVar;\n thisSwiper.reInit();\n if(!centerVar){\n var paginationSpan = $t.find('.pagination span');\n var paginationSlice = paginationSpan.hide().slice(0,(paginationSpan.length+1-slidesPerViewVar));\n if(paginationSlice.length<=1 || slidesPerViewVar>=$t.find('.swiper-slide').length) $t.addClass('pagination-hidden');\n else $t.removeClass('pagination-hidden');\n paginationSlice.show();\n }\n }); \n }", "title": "" }, { "docid": "6c748543bf74c9534155c327568d98b8", "score": "0.6588638", "text": "function product_slider_init($product_list_slider){\n\n // init\n $product_list_slider.slick({\n slidesToShow: 5,\n slidesToScroll: 1,\n speed: 1000,\n autoplay: true,\n autoplaySpeed: 2500,\n arrows: false,\n infinite: true,\n responsive: [\n {\n breakpoint: 1280,\n settings: {\n slidesToShow: 3\n }\n },\n {\n breakpoint: 800,\n settings: {\n slidesToShow: 2\n }\n },\n {\n breakpoint: 541,\n settings: {\n slidesToShow: 1\n }\n }\n ]\n });\n\n}", "title": "" }, { "docid": "2d23f2b0cc3ba867b11c62f2e39f1749", "score": "0.6586802", "text": "function setResponsiveCarousel() {\n $carousel = $('div.view.dl-slider-carousel > div.view-content .slide-list');\n\n $carousel.each(function(){\n $(this).slick({\n arrow: true,\n centerMode: false,\n centerPadding: '9px',\n infinite: true,\n slide: \"li\",\n slidesToShow: 3,\n slidesToScroll: 3,\n speed: 300,\n touchMove: true,\n useTransform: false,\n useCSS: false,\n responsive: [\n {\n breakpoint: 980,\n settings: {\n slidesToShow: 2,\n slidesToScroll: 2,\n infinite: true,\n centerPadding: '8px',\n centerMode: false,\n arrow: true,\n }\n },\n {\n breakpoint: 660,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n infinite: true,\n centerPadding: '7px',\n centerMode: false,\n arrow: true,\n }\n }\n ]\n });\n });\n }", "title": "" }, { "docid": "1db0007ba1f3dde67c0a3bbf5efd2ce5", "score": "0.6565472", "text": "onResize() {\n setTimeout(() => {\n this.positionConfig();\n this.navSlide(this.index.active);\n }, 1000);\n }", "title": "" }, { "docid": "b07bb40f9fc7980c2aae17bd360fae15", "score": "0.65557283", "text": "function mainSlider() {\n \n var BasicSlider = $('.slider-active');\n \n BasicSlider.on('init', function(e, slick) {\n var $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]');\n doAnimations($firstAnimatingElements);\n });\n \n BasicSlider.on('beforeChange', function(e, slick, currentSlide, nextSlide) {\n var $animatingElements = $('.single-slider[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\n doAnimations($animatingElements);\n });\n \n BasicSlider.slick({\n // autoplay: true,\n autoplaySpeed: 10000,\n pauseOnHover: false,\n dots: false,\n fade: true,\n\t\t\tarrows: true,\n prevArrow:'<span class=\"prev\"><i class=\"fal fa-chevron-left\"></i></span>',\n nextArrow: '<span class=\"next\"><i class=\"fal fa-chevron-right\"></i></span>',\n responsive: [\n { breakpoint: 767, settings: {} }\n ]\n });\n\n function doAnimations(elements) {\n var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n elements.each(function() {\n var $this = $(this);\n var $animationDelay = $this.data('delay');\n var $animationType = 'animated ' + $this.data('animation');\n $this.css({\n 'animation-delay': $animationDelay,\n '-webkit-animation-delay': $animationDelay\n });\n $this.addClass($animationType).one(animationEndEvents, function() {\n $this.removeClass($animationType);\n });\n });\n }\n }", "title": "" }, { "docid": "41ea9e110a95fc97f0ede6cae243d22e", "score": "0.65519375", "text": "function homeSliderInit() {\n var slideBaseWidth = $('.top-slider .inner-slide:first').width();\n var slideBaseHeight = $('.top-slider .inner-slide:first').height();\n var vpWidth = $(window).width();\n var vpHeight = $(window).height() - $('#header').height() - $('#footer').height();\n \n var slideItems = 5;\n var sliderWidth = '125%';\n var slideCenter = 2;\n \n //choose appropriate slide number, 5, 7 or 9\n //slide height is greater than viewable space, use more slides\n var topSlider = $('.top-slider');\n if (slideBaseHeight > vpHeight) {\n //if (vpHeight <= 500) { slideItems = 7; sliderWidth = '118%'; slideCenter = 3; topSlider.addClass('seven').removeClass('nine'); }\n //if (vpHeight <= 250) { slideItems = 9; sliderWidth = '114%'; slideCenter = 4; topSlider.addClass('nine').removeClass('seven'); }\n slideItems = 7; sliderWidth = '118%'; slideCenter = 3; topSlider.addClass('seven').removeClass('nine');\n }\n //browser width is greater than 4 x slideBaseWidth, use more slides\n var maxWidth = slideBaseWidth*(slideItems-1);\n if (vpWidth > maxWidth) {\n //if (vpWidth <= (slideBaseWidth*6)) { slideItems = 7; sliderWidth = '118%'; slideCenter = 3; topSlider.addClass('seven').removeClass('nine'); }\n //else { slideItems = 9; sliderWidth = '114%'; slideCenter = 4; topSlider.addClass('nine').removeClass('seven'); }\n slideItems = 7; sliderWidth = '118%'; slideCenter = 3; topSlider.addClass('seven').removeClass('nine');\n }\n \n $('.top-slider .slides').carouFredSel({\n width : sliderWidth,\n align: 'center',\n items: slideItems,\n responsive: true,\n prev: '.top-slider .prev',\n next: '.top-slider .next',\n onCreate: function() {\n $('.top-slider .loader').fadeOut();\n $('.top-slider .slides').find('li:eq('+slideCenter+')').addClass('current').siblings().removeClass('current');\n //set slider height\n var slideHeight = $('.top-slider .inner-slide:first').height();\n $('.top-slider').css({'height': slideHeight+'px'});\n },\n scroll: {\n pauseOnHover : true,\n items: 1,\n onAfter: function() {\n $('.top-slider .slides').find('li:eq('+slideCenter+')').addClass('current').siblings().removeClass('current');\n }\n },\n auto: 6000\n });\n }", "title": "" }, { "docid": "a84b3e2d6a27f137d43cb850f425c287", "score": "0.65494037", "text": "function resizeCall(){\r\n winW = $(window).width();\r\n winH = $(window).height();\r\n $('.swiper-container[data-slides-per-view=\"responsive\"]').each(function(){\r\n swipers[$(this).attr('data-init')].reInit();\r\n });\r\n is_visible = $('.menu-button').is(':visible');\r\n if(is_visible) {\r\n $('.s-header').addClass('fixed').removeClass('fixed-bottom fixed-top');\r\n }\r\n filterHeight();\r\n }", "title": "" }, { "docid": "f571fa9ab2afc71efeb68f9003dd3995", "score": "0.65278685", "text": "function window_resize() {\n\n var responsive_viewport = $(window).width() + $.app.scrollbar_width;\n\n window_scroll();\n\n }", "title": "" }, { "docid": "ae9092dd1f5fa777c0096e179adb0258", "score": "0.65218496", "text": "function home_slider2(){\r\n if ( $('#main_slider').length ){\r\n $(\"#main_slider\").revolution({\r\n sliderType:\"fullscreen\",\r\n sliderLayout:\"fullwidth\",\r\n dottedOverlay:\"none\",\r\n disableProgressBar:\"on\",\r\n delay:12000,\r\n navigation: {\r\n keyboardNavigation:\"off\",\r\n keyboard_direction: \"horizontal\",\r\n mouseScrollNavigation:\"off\",\r\n mouseScrollReverse:\"default\",\r\n onHoverStop:\"off\",\r\n touch:{\r\n touchenabled:\"on\"\r\n },\r\n arrows: {\r\n style:\"Gyges\",\r\n enable:false,\r\n }\r\n },\r\n responsiveLevels:[1920,1199,991,767,480],\r\n visibilityLevels:[1920,1199,991,767,480],\r\n gridwidth:[1140,970,900,767,480],\r\n gridheight:[800,700,600,580,580],\r\n spinner:\"on\",\r\n stopLoop:\"off\",\r\n shuffle:\"off\",\r\n hideThumbsOnMobile:\"on\",\r\n hideSliderAtLimit:0,\r\n hideCaptionAtLimit:0,\r\n hideAllCaptionAtLilmit:0,\r\n debugMode:false,\r\n fallbacks: {\r\n simplifyAll:\"off\",\r\n nextSlideOnWindowFocus:\"off\",\r\n disableFocusListener:true,\r\n },\r\n lazyType:\"none\",\r\n parallax: {\r\n type:\"mouse\",\r\n origo:\"slidercenter\",\r\n speed:2000,\r\n levels:[2,3,4,5,6,7,12,16,10,50],\r\n },\r\n });\r\n }\r\n }", "title": "" }, { "docid": "b012351527fcceafe0b0b0f2a33a781c", "score": "0.65201133", "text": "function resizeCall(){\n\n\t\tpageCalculations();\n\n\n\n\t\tvar swiperResponsive = $('.swiper-container.initialized[data-slides-per-view=\"responsive\"]');\n\n\n\n\t\tfor (var i = 0; i < swiperResponsive.length; i++) {\n\n\t\t\tvar thisSwiper = swipers['swiper-'+$(swiperResponsive[i]).attr('id')], $t = $(swiperResponsive[i]), slidesPerViewVar = updateSlidesPerView($t);\n\n\t\t\tthisSwiper.params.slidesPerView = slidesPerViewVar;\n\n\t\t\tthisSwiper.reInit();\n\n\t\t\tvar paginationSpan = $t.find('.pagination span');\n\n\t\t\tvar paginationSlice = paginationSpan.hide().slice(0,(paginationSpan.length+1-slidesPerViewVar));\n\n\t\t\tif(paginationSlice.length<=1 || slidesPerViewVar>=$t.find('.swiper-slide').length) $t.addClass('pagination-hidden');\n\n\t\t\telse $t.removeClass('pagination-hidden');\n\n\t\t\tpaginationSlice.show();\n\n\t\t};\n\n\t}", "title": "" }, { "docid": "89b5e3cc679ed6fb6e1516d0a89c983b", "score": "0.65149146", "text": "function adjustResponsiveLayout() {\n if (cantDoAdjustments()) {\n return;\n }\n var oldWidth = allSlides.width();\n var newWidth = getResponsiveWidth();\n allSlides.width(newWidth);\n\n if (oldWidth != newWidth) {\n stopAnimation();\n adjustPositionTo(t);\n autoadjust(t, 0);\n }\n }", "title": "" }, { "docid": "e74cdc8a38e82ece68d3e133dfd069bc", "score": "0.6498632", "text": "function sliders() {\n\n var $sliderSelector = $('.slider');\n\n $sliderSelector.each(function (slide) {\n $(this).slick({\n dots: false,\n infinite: false,\n speed: 600,\n slidesToShow: 3,\n slidesToScroll: 1,\n responsive: [{\n breakpoint: 769,\n settings: {\n slidesToShow: 2\n }\n }, {\n breakpoint: 321,\n settings: {\n slidesToShow: 1\n }\n }]\n });\n });\n\n /** Disable/enable mouse wheel when inside/outside slider. */\n $sliderSelector.on('mouseover touchstart', function () {\n insideScrollableArea = true;\n });\n $sliderSelector.on('mouseout touchend', function () {\n insideScrollableArea = false;\n });\n}", "title": "" }, { "docid": "d6f8967e87c0e59214856d1ecbb8eb6a", "score": "0.6481703", "text": "resize() {\n const itemsCollection = this.itemsBox.getElementsByTagName('LI');\n this.sliderWrapWidth = this.sliderWrap.offsetWidth;\n // console.log(this.sliderWrap.offsetWidth, itemsCollection[2].offsetWidth)\n\n if (window.innerWidth >= 1200 & window.innerWidth < 1600) {\n // Array.from(itemsCollection, item => item.style.width = this.sliderWrapWidth + \"px\");\n this.x = -this.sliderWrapWidth * this.pos;\n\n this.itemsBox.style.transition = 'all 0s';\n this.itemsBox.style.marginLeft = `${this.x}px`;\n const x = setTimeout(() => {\n this.itemsBox.style.transition = 'all 0.4s ease';\n }, 15);\n } else if (window.innerWidth < 768) {\n // Array.from(itemsCollection, item => item.style.width = this.sliderWrapWidth + \"px\");\n this.x = -this.sliderWrapWidth * this.pos;\n this.itemsBox.style.transition = 'all 0s';\n\n this.itemsBox.style.marginLeft = `${this.x}px`;\n\n setTimeout(() => {\n this.itemsBox.style.transition = 'all 0.4s ease';\n }, 15);\n } else if (window.innerWidth < 1200) {\n // Array.from(itemsCollection, item => item.style.width = this.sliderWrapWidth + \"px\");\n this.x = -this.sliderWrapWidth * this.pos;\n this.itemsBox.style.transition = 'all 0s';\n\n this.itemsBox.style.marginLeft = `${this.x}px`;\n\n setTimeout(() => {\n this.itemsBox.style.transition = 'all 0.4s ease';\n }, 15);\n } else if (window.innerWidth > 1600) {\n // Array.from(itemsCollection, item => item.style.width = this.sliderWrapWidth + \"px\");\n this.x = -this.sliderWrapWidth * this.pos;\n\n this.itemsBox.style.transition = 'all 0s';\n\n this.itemsBox.style.marginLeft = `${this.x}px`;\n\n setTimeout(() => {\n this.itemsBox.style.transition = 'all 0.4s ease';\n }, 15);\n }\n }", "title": "" }, { "docid": "205d88d64884d4118b1f956f3a9c1c11", "score": "0.6453113", "text": "function setSliderWidth() {\n var sliderWidth = fm.sliderWrap.parent().width();\n fm.slideWidth = (options.sliderWidth * sliderWidth) / 100;\n //con(options.sliderWidth);\n }", "title": "" }, { "docid": "be9861f8b800e5b2d44bbc6772aab056", "score": "0.64464444", "text": "function setPosterSize() {\n // main page background size\n $(function() {\n if ($(window).width() >= 1100) {\n $(\"#slideshow img\").each(function() {\n $(this).attr(\"src\", $(this).attr(\"data-src\"));\n });\n }\n });\n // position and visible main page background for different browsers\n if ($(window).width() > 1500 || $(window).width() < 1100) {\n $(\"#slideshow > div\").css(\"left\", 0);\n } else {\n var left = ($(window).width() - 1140) / 2;\n $(\"#slideshow > div\").css(\"left\", left);\n }\n if ($(window).width() < 1100) {\n $(\"#dslideshow\").remove();\n }\n // hide slider for images in portfolio for small screens\n if ($(window).width() < 640) {\n $(\".about-item #portfolio\").removeAttr(\"id\");\n }\n }", "title": "" }, { "docid": "43ed0b6e5e6558955e74eea81b64083c", "score": "0.6443028", "text": "function _readjustSlideshow() {\n\n var new_slidesPerView;\n var new_slidesPerGroup;\n var changeAction = false;\n\n for(var key in responsive_swipers) {\n smallDesktopState = responsive_swipers[key].smallDesktop;\n break;\n }\n\n // Resize event nothing to do here\n if (_isLoadedSmallDesktop() == true && smallDesktopState == false) {\n changeAction= true;\n }\n else if (_isLoadedSmallDesktop() == false && smallDesktopState == true) {\n changeAction = true;\n }\n\n if (changeAction) {\n for(var key in responsive_swipers) {\n \n var parentWidth = $(responsive_swipers[key].container).outerWidth(true);\n var instanceWidth = $(responsive_swipers[key].container).find('.swiper-slide:first').outerWidth(true);\n\n if (responsive_swipers[key].pageRenderOne == true) {\n // Some page one containers might keep the same width no need to reset.\n if (responsive_swipers[key].originalContainerWidth !== parentWidth) {\n // recalculation needed\n instanceWidth = parentWidth; \n responsive_swipers[key].originalContainerWidth = parentWidth;\n $(responsive_swipers[key].container).find('.swiper-slide').css('width', instanceWidth).css('padding', '0px').css('margin','0px').css('display','inline');\n var swiperWrapperWidth = instanceWidth * responsive_swipers[key].slideshowItems;\n $(responsive_swipers[key].container).find('.swiper-wrapper').css('width',swiperWrapperWidth+'px');\n Drupal.settings.article_swiper_responsive[key].smallDesktop = _isLoadedSmallDesktop();\n }\n }\n\n else {\n \n var newItems = parentWidth/instanceWidth;\n Drupal.settings.article_swiper_responsive[key].params.slidesPerView = newItems;\n Drupal.settings.article_swiper_responsive[key].params.slidesPerGroup = parseInt(newItems);\n // Object to be given to pagination to re-display pagination items\n var newSwiperConf = {\n carousel_slideshow_items: responsive_swipers[key].slideshowItems,\n carousel_slides_per_view: newItems,\n carousel_slides_per_group: parseInt(newItems),\n } \n }\n\n smallDesktopState = _isLoadedSmallDesktop(); \n Drupal.settings.article_swiper_responsive[key].smallDesktop = _isLoadedSmallDesktop(); \n }\n changeAction = false;\n }\n \n }", "title": "" }, { "docid": "b6185926ae150d5f024187942105923c", "score": "0.64422566", "text": "function positionSlider() {\r\n\r\n\tif (slides.length < 3) {\r\n\t\tscreens[0].style.display = \"block\";\r\n\t\tscreens[0].className = \"col-xl-6 screen-three screens\";\r\n\r\n\t\tscreens[1].style.display = \"block\";\r\n\t\tscreens[1].className = \"col-xl-6 screen-four screens\";\r\n\r\n\t} else {\r\n\r\n\t\tif (e == 0) {\r\n\t\t\tscreens[e].style.display = \"block\";\r\n\t\t\tscreens[screens.length - 2].style.display = \"none\";\r\n\t\t\tif (side == true) {\r\n\t\t\t\tscreens[screens.length - 2].className = \"screens\"\r\n\t\t\t\tscreens[e].className = \"col-xl-6 screen-three screens\";\r\n\t\t\t\tside = false;\r\n\t\t\t} else {\r\n\t\t\t\tscreens[screens.length - 2].className = \"screens\"\r\n\t\t\t\tscreens[e].className = \"col-xl-6 screen-four screens\";\r\n\t\t\t\tside = true;\r\n\t\t\t}\r\n\t\t\te++;\r\n\t\t} else if (e == 1) {\r\n\t\t\tscreens[e].style.display = \"block\";\r\n\t\t\tscreens[screens.length - 1].style.display = \"none\";\r\n\t\t\tif (side == true) {\r\n\t\t\t\tscreens[screens.length - 1].className = \"screens\"\r\n\t\t\t\tscreens[e].className = \"col-xl-6 screen-three screens\";\r\n\t\t\t\tside = false;\r\n\t\t\t} else {\r\n\t\t\t\tscreens[screens.length - 1].className = \"screens\"\r\n\t\t\t\tscreens[e].className = \"col-xl-6 screen-four screens\";\r\n\t\t\t\tside = true;\r\n\t\t\t}\r\n\t\t\te++;\r\n\t\t} else {\r\n\t\t\tscreens[e].style.display = \"block\";\r\n\t\t\tscreens[e - 2].style.display = \"none\";\r\n\t\t\tif (side == true) {\r\n\t\t\t\tscreens[e - 2].className = \"screens\"\r\n\t\t\t\tscreens[e].className = \"col-xl-6 screen-three screens\";\r\n\t\t\t\tside = false;\r\n\t\t\t} else {\r\n\t\t\t\tscreens[e - 2].className = \"screens\"\r\n\t\t\t\tscreens[e].className = \"col-xl-6 screen-four screens\";\r\n\t\t\t\tside = true;\r\n\t\t\t}\r\n\t\t\te++;\r\n\t\t}\r\n\t\tif (e == screens.length) {\r\n\t\t\te = 0;\r\n\t\t}\r\n\r\n\t}\r\n}", "title": "" }, { "docid": "ca0e7628ca6a35d31663fb5577048e27", "score": "0.64355296", "text": "function onResizeHandler() \n{\n // Elemente fuer kleine Bildschirme\n if (window.matchMedia(\"(max-width: 56em)\").matches)\n {\n if(window.location.href.indexOf(\"hauptseite\")>=0){\n $(\".r-suche_etwas_label\").show();\n $(\".r-kk-inhaltsvz-toggle\").hide();\n $(\".r-kk-inhaltsvz-toggle-screensize-m\").hide();\n }\n else if(window.location.href.indexOf(\"veranstaltungsseite\")>=0){\n $(\".r-kk-inhaltsvz-toggle-screensize-m\").removeAttr(\"style\");\n $(\".r-kk-inhaltsvz-toggle\").removeAttr(\"style\");\n $(\".r-suche_etwas_label\").hide();\n }\n else\n {\n $(\".r-suche_etwas_label\").hide();\n $(\".r-kk-inhaltsvz-toggle\").hide();\n $(\".r-kk-inhaltsvz-toggle-screensize-m\").hide();\n }\n }\n else if (window.matchMedia(\"(max-width: 80em)\").matches)\n {\n if(window.location.href.indexOf(\"hauptseite\")>=0){\n $(\".r-suche_etwas_label\").hide();\n $(\".r-kk-inhaltsvz-toggle\").hide();\n $(\".r-kk-inhaltsvz-toggle-screensize-m\").hide();\n }\n else if(window.location.href.indexOf(\"veranstaltungsseite\")>=0){\n $(\".r-kk-inhaltsvz-toggle-screensize-m\").removeAttr(\"style\");\n $(\".r-kk-inhaltsvz-toggle\").hide();\n $(\".r-suche_etwas_label\").hide();\n }\n else\n {\n $(\".r-suche_etwas_label\").hide();\n $(\".r-kk-inhaltsvz-toggle\").hide();\n $(\".r-kk-inhaltsvz-toggle-screensize-m\").hide();\n }\n }\n else\n {\n $(\".r-suche_etwas_label\").hide();\n $(\".r-kk-inhaltsvz-toggle\").hide();\n $(\".r-kk-inhaltsvz-toggle-screensize-m\").hide();\n }\n}", "title": "" }, { "docid": "1e8929d658c2b9a0d84e2972a9276ef0", "score": "0.6432047", "text": "function mainSlider() {\n var bannerSlider = $('.slider-active')\n bannerSlider.on('init', function (e, slick) {\n var $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]');\n doAnimations($firstAnimatingElements);\n });\n bannerSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) {\n var $animatingElements = $('.single-slider[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\n doAnimations($animatingElements);\n });\n bannerSlider.slick({\n autoplay: true,\n autoplaySpeed: 7000,\n dots: true,\n arrows: false,\n responsive: [{\n breakpoint: 1024,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n infinite: true,\n }\n },\n {\n breakpoint: 991,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false\n }\n },\n {\n breakpoint: 767,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false\n }\n }\n ]\n });\n\n function doAnimations(elements) {\n var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'\n elements.each(function () {\n var $this = $(this);\n var $animationDelay = $($this).data('delay');\n var $animationType = 'animated ' + $this.data('animation');\n $this.css({\n 'animation-delay': $animationDelay,\n '-webkit-animation-delay': $animationDelay\n });\n $this.addClass($animationType).one(animationEndEvents, function () {\n $this.removeClass($animationType);\n });\n });\n };\n\n }", "title": "" }, { "docid": "d03dad8243d53a0c5633f96dd9da8818", "score": "0.64303386", "text": "resizeHook()\n\t{\n\t\t\n\t\tthis.width = $(window).width();\n\t\tthis.initJSMediaQueries();\n\t\t\n\t}", "title": "" }, { "docid": "4810c7aef8d271d74fe5c62bbcd508b2", "score": "0.64219487", "text": "function setSize(img,opt) {\n\n\n\t\t\t\topt.container.parent().find('.tp-fullwidth-forcer').css({'height':opt.container.height()});\n\t\t\t\topt.container.closest('.rev_slider_wrapper').css({'height':opt.container.height()});\n\n\n\t\t\t\topt.width=parseInt(opt.container.width(),0);\n\t\t\t\topt.height=parseInt(opt.container.height(),0);\n\n\n\n\t\t\t\topt.bw= (opt.width / opt.startwidth);\n\t\t\t\topt.bh = (opt.height / opt.startheight);\n\n\t\t\t\tif (opt.bh>opt.bw) opt.bh=opt.bw;\n\t\t\t\tif (opt.bh<opt.bw) opt.bw = opt.bh;\n\t\t\t\tif (opt.bw<opt.bh) opt.bh = opt.bw;\n\t\t\t\tif (opt.bh>1) { opt.bw=1; opt.bh=1; }\n\t\t\t\tif (opt.bw>1) {opt.bw=1; opt.bh=1; }\n\n\n\t\t\t\t//opt.height= opt.startheight * opt.bh;\n\t\t\t\topt.height = Math.round(opt.startheight * (opt.width/opt.startwidth));\n\n\n\n\n\n\t\t\t\tif (opt.height>opt.startheight && opt.autoHeight!=\"on\") opt.height=opt.startheight;\n\n\n\n\t\t\t\tif (opt.fullScreen==\"on\") {\n\t\t\t\t\t\topt.height = opt.bw * opt.startheight;\n\t\t\t\t\t\tvar cow = opt.container.parent().width();\n\t\t\t\t\t\tvar coh = jQuery(window).height();\n\t\t\t\t\t\tif (opt.fullScreenOffsetContainer!=undefined) {\n\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\tvar offcontainers = opt.fullScreenOffsetContainer.split(\",\");\n\t\t\t\t\t\t\t\tjQuery.each(offcontainers,function(index,searchedcont) {\n\t\t\t\t\t\t\t\t\tcoh = coh - jQuery(searchedcont).outerHeight(true);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} catch(e) {}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\topt.container.parent().height(coh);\n\t\t\t\t\t\topt.container.css({'height':'100%'});\n\n\t\t\t\t\t\topt.height=coh;\n\n\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\topt.container.height(opt.height);\n\t\t\t\t}\n\n\n\t\t\t\topt.slotw=Math.ceil(opt.width/opt.slots);\n\n\t\t\t\tif (opt.fullSreen==\"on\")\n\t\t\t\t\topt.sloth=Math.ceil(jQuery(window).height()/opt.slots);\n\t\t\t\telse\n\t\t\t\t\topt.sloth=Math.ceil(opt.height/opt.slots);\n\n\t\t\t\tif (opt.autoHeight==\"on\")\n\t\t\t\t \topt.sloth=Math.ceil(img.height()/opt.slots);\n\n\n\n\n\t\t}", "title": "" }, { "docid": "fac35c4fd0cd52d8f176f4b7ca780981", "score": "0.6420903", "text": "function windowUpdate() {\n // Check window width has actually changed and it's not just iOS triggering a resize event on scroll\n if (window.innerWidth != windowWidth) {\n // Update the window width for next time\n windowWidth = window.innerWidth;\n\n // Do stuff here\n $sliderDefault.each(function () {\n if ($(this).length > 0) {\n // check grid size on resize event\n var dataShowItems = $(this).data('my-multiple-items');\n if ((0,esm_typeof/* default */.Z)(dataShowItems) != ( true ? \"undefined\" : 0) && dataShowItems != '' && dataShowItems != 0) {\n var gridSize = getGridSize(dataShowItems);\n flexslider.vars.minItems = gridSize;\n flexslider.vars.maxItems = gridSize;\n }\n $(this).data('flexslider').setup();\n }\n });\n }\n }", "title": "" }, { "docid": "fa82808a41e3ed69165a32da96899314", "score": "0.6416226", "text": "function mainSlider() {\n var BasicSlider = $('.slider-active');\n BasicSlider.on('init', function (e, slick) {\n var $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]');\n doAnimations($firstAnimatingElements);\n });\n BasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) {\n var $animatingElements = $('.single-slider[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\n doAnimations($animatingElements);\n });\n BasicSlider.slick({\n autoplay: true,\n autoplaySpeed: 10000,\n dots: true,\n fade: true,\n prevArrow: '<button type=\"button\" class=\"slick-prev\"> <i class=\"fas fa-angle-left\"></i> </button>',\n nextArrow: '<button type=\"button\" class=\"slick-next\"> <i class=\"fas fa-angle-right\"></i> </button>',\n arrows: true,\n responsive: [\n { breakpoint: 767, settings: { dots: false, arrows: false } }\n ]\n });\n\n function doAnimations(elements) {\n var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n elements.each(function () {\n var $this = $(this);\n var $animationDelay = $this.data('delay');\n var $animationType = 'animated ' + $this.data('animation');\n $this.css({\n 'animation-delay': $animationDelay,\n '-webkit-animation-delay': $animationDelay\n });\n $this.addClass($animationType).one(animationEndEvents, function () {\n $this.removeClass($animationType);\n });\n });\n }\n }", "title": "" }, { "docid": "85a2a26c1a802043828a44bba229605e", "score": "0.6402159", "text": "function slickMobile(carousel, breakpoint, slidesToShow, slidesToScroll) {\n\t\t\t\tif (carousel.length) {\n\t\t\t\t\tvar windowWidth = window.innerWidth || $window.width();\n\t\t\t\t\tif (windowWidth < breakpoint + 1) {\n\t\t\t\t\t\tcarousel.slick({\n\t\t\t\t\t\t\tmobileFirst: true,\n\t\t\t\t\t\t\tslidesToShow: slidesToShow,\n\t\t\t\t\t\t\tslidesToScroll: slidesToScroll,\n\t\t\t\t\t\t\tinfinite: true,\n\t\t\t\t\t\t\tautoplay: true,\n\t\t\t\t\t\t\tautoplaySpeed: 3000,\n\t\t\t\t\t\t\tarrows: false,\n\t\t\t\t\t\t\tdots: true,\n\t\t\t\t\t\t\tresponsive: [{\n\t\t\t\t\t\t\t\tbreakpoint: breakpoint,\n\t\t\t\t\t\t\t\tsettings: \"unslick\"\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}", "title": "" }, { "docid": "437e2b69ce3720a7f8064d3052c18088", "score": "0.6396664", "text": "function sizeSlider() {\n // Stop the slider from moving\n if (isSliderStill(qSliderContainer)) {\n clearInterval(slideInterval);\n return false;\n\n // Start the slider\n } else {\n var INTERVAL = 1000 * 10 * 2; // twenty seconds\n slideInterval = setInterval(moveToNextSlide, INTERVAL);\n }\n\n // forEach doesn't work with querySelector, so we have to convert it\n // to a proper list for everything to work\n numOfSlides = qSlider.children.length;\n var slidesList = Array.prototype.slice.call(qSlider.children);\n\n // Calculate and set the amount each slides needs to move to be visible\n slidesList.forEach(function(slide, index) {\n var distance = \"-\" + (index * 100) + \"%\";\n\n // Remove the negative value for the first value\n if (index === 0) {\n distance = distance.substring(1);\n }\n\n // Set the distance each slide needs to move\n slide.dataset.pos = distance;\n });\n}", "title": "" }, { "docid": "2896308dba2c1443783ac444950e45a8", "score": "0.63943386", "text": "function minimizeCarousel() {\n $(VIDEO_THUMBNAIL).addClass('small-video-thumbnail');\n $(RESULT_CAROUSEL).addClass('small-carousel');\n $('.slick-track').addClass('small-slick-track');\n $('.slick-slide').addClass('small-slick-slide');\n\n var currentSlide = $('.responsive').slick('slickCurrentSlide');\n $('.responsive').slick('slickGoTo', currentSlide, true);\n}", "title": "" }, { "docid": "ffb78aed55098e4a5532efb95255418b", "score": "0.6385495", "text": "function startSlideShow(){\n\tif((\".rslides\").length > 0){\n $(\".rslides\").responsiveSlides({\n auto: false,\n pager: true,\n nav: true,\n speed: 500,\n maxwidth: 'auto',\n namespace: \"large-btns\"\n }); \n }\n}", "title": "" }, { "docid": "b82540044f46b142f5668f96d0ce451e", "score": "0.6373196", "text": "function updateHeWiSlider() {\n $('#slider').css({\n 'height': windowHeight*1/2\n });\n }", "title": "" }, { "docid": "501cfbe6c6b6e42a580b28d1669994c8", "score": "0.63727605", "text": "function panel_resize(){\n\t\tvar width = $(window).width();\n\t\tif( width > 991 ) {\n\t\t\tif($(\"[id*='slidepanel-']\").length ) {\n\t\t\t\t$(\"[id*='slidepanel-']\").removeAttr(\"style\");\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "87a57ba769b98be1580d7c3bfde91aec", "score": "0.6371438", "text": "onResize() {\n this.updateSlidesOffsets();\n }", "title": "" }, { "docid": "3b281d44e44276e9d37fbdbeb8b090e9", "score": "0.6369823", "text": "function documentResolutionSetup() {\n\tvar docWidth = document.width ? document.width\n\t\t\t: document.documentElement.offsetWidth - 25;\n\tvar docHeight = document.height ? document.height\n\t\t\t: document.documentElement.offsetHeight;\n\tif (docWidth < 1024 && docHeight < 768) {\n\t\tjQUISlider.css( {\n\t\t\t'height' : '0.7em'\n\t\t});\n\t\tjQSliderHandle.css( {\n\t\t\t'height' : '0.9em',\n\t\t\t'width' : '0.9em',\n\t\t\t'margin-top' : '0.2em'\n\t\t});\n\t\tjQZoomingOptions.css( {\n\t\t\t'width' : '70%',\n\t\t\t'font-size' : '70%'\n\t\t});\n\t\tjQZoomingSlider.css( {\n\t\t\t'width' : '30%'\n\t\t});\n\t\tthumbAdv.css( {\n\t\t\t'font-size' : '60%'\n\t\t});\n\t\tjQControls.css( {\n\t\t\t'font-size' : '60%'\n\t\t});\n\t} else {\n\t\tjQUISlider.css( {\n\t\t\t'height' : '0.8em'\n\t\t});\n\t\tjQSliderHandle.css( {\n\t\t\t'height' : '1.2em',\n\t\t\t'width' : '1.2em',\n\t\t\t'margin-top' : '0.0em'\n\t\t});\n\t\tjQZoomingOptions.css( {\n\t\t\t'width' : '50%',\n\t\t\t'font-size' : 'smaller'\n\t\t});\n\t\tjQZoomingSlider.css( {\n\t\t\t'width' : '50%'\n\t\t});\n\t\tthumbAdv.css( {\n\t\t\t'font-size' : 'smaller'\n\t\t});\n\t\tjQControls.css( {\n\t\t\t'font-size' : '80%'\n\t\t});\n\t\tJQ(\"#prev-photo\").attr( {\n\t\t\tsrc : pathToHandler + '/img/prev-min.png'\n\t\t});\n\t\tJQ(\"#next-photo\").attr( {\n\t\t\tsrc : pathToHandler + '/img/next-min.png'\n\t\t});\n\t\tJQ(\"#desc-img\").attr( {\n\t\t\tsrc : pathToHandler + '/img/desc-img.png'\n\t\t});\n\t}\n}", "title": "" }, { "docid": "d1702293208476ce4d7b11ded2993f8d", "score": "0.6368373", "text": "function fix_slider() {\n if ($('#wpadminbar').css('position') != 'fixed') {\n admin_bar_height = 0;\n }\n sl_offset = $window.scrollTop();\n $top = $('#top');\n\n top_height = 0;\n $top.find('#branding > .wrap').children().each(function() {\n $this = $(this);\n //if we get to one of these we are done\n if (!$this.hasClass('image') && $this.css('position') != 'absolute') {\n //fix-menu doesnt count, but we dont want to escape\n if (!$this.hasClass('fix-menu')) {\n top_height += $this.outerHeight();\n }\n } else {\n return false;\n }\n });\n window_width = $window.width();\n window_height = $window.height();\n available_height = $body.hasClass('constrict-header') ? window_height - admin_bar_height : window_height - top_height - admin_bar_height - main_showing_by;\n $body.attr('data-available_height', window_height - top_height - admin_bar_height - main_showing_by);\n //only 991px and wider\n if ($('#dont-edit-this-element').css('z-index') == 20 && window_width > window_height) {\n $body.addClass('full_image_wide');\n $body.removeClass('full_image_narrow');\n //jma-header-item wraps around jma-header-image\n available_ratio = available_height / window_width;\n\n if ($body.hasClass('constrict-header')) {\n $jma_header_image_item.css({\n 'top': admin_bar_height + 'px',\n 'height': available_height + 'px'\n });\n $site_main.css({\n 'margin-top': (window_height - top_height - admin_bar_height - main_showing_by) + 'px'\n });\n $('.soliloquy-caption').css('margin-top', ((top_height - main_showing_by) / 2) + 'px');\n } else {\n im_pos = $jma_header_image_item.prev().offset().top + $jma_header_image_item.prev().outerHeight();\n\n if (sl_offset > im_pos - admin_bar_height) {\n $site_main.css('margin-top', (window_height - top_height - admin_bar_height - main_showing_by) + 'px');\n $jma_header_image_item.addClass('fix-image');\n $jma_header_image_item.css({\n 'top': admin_bar_height + 'px',\n 'height': available_height + 'px'\n });\n } else {\n $jma_header_image_item.removeClass('fix-image');\n $jma_header_image_item.css('top', '');\n $site_main.css('margin-top', '');\n }\n $jma_header_image_item.css({\n 'height': available_height + 'px'\n });\n }\n //cut off image left and right use all of height\n if (image_ratio < available_ratio) {\n $jma_header_image.css({\n 'width': (available_height * (1 / image_ratio)) + 'px',\n 'max-width': (available_height * (1 / image_ratio)) + 'px'\n });\n } else //cut off image top and bottom use all of width\n {\n $jma_header_image.css({\n 'width': window_width + 'px',\n 'max-width': ''\n });\n }\n } else {\n $body.removeClass('full_image_wide');\n $body.addClass('full_image_narrow');\n $('.image.jma-header-content').css('height', '');\n $site_main.css('margin-top', '');\n $jma_header_image.css({\n 'top': '',\n 'height': ''\n });\n $jma_header_image.css({\n 'width': '',\n 'max-width': ''\n });\n }\n }", "title": "" }, { "docid": "3cdfd29451b12c09d0bdcb99cfec45de", "score": "0.6366499", "text": "function resizeEnd() {\r\n initial = true;\r\n windowWidth = window.innerWidth;\r\n initSlider();\r\n hideTimer = setTimeout(() => {\r\n sliderCanvas.classList.remove('pieces-slider__canvas--hidden');\r\n }, 500);\r\n }", "title": "" }, { "docid": "7b8c140f1f51b6b292b0b76f88d57f19", "score": "0.63618326", "text": "function applyToResize() {\n var resizeTimer;\n $(window).on(\"resize\", function() {\n clearTimeout(resizeTimer);\n resizeTimer = setTimeout(initAllCarousel, 100);\n });\n }", "title": "" }, { "docid": "edb0d0c34ae29ca449f4777652fdc37f", "score": "0.6354856", "text": "function sliderCustom(sliderName, slideCountDesktop, slideCountTablet) {\n $(sliderName).each(function() {\n $(this).slick({\n infinite: true,\n slidesToShow: slideCountDesktop,\n slidesToScroll: 1,\n prevArrow: '<div class=\"icon icon--arrow-slider icon--arrow-left\"></div>',\n nextArrow: '<div class=\"icon icon--arrow-slider icon--arrow-right\"></div>',\n responsive: [\n {\n breakpoint: 1024,\n settings: {\n slidesToShow: slideCountTablet\n }\n },\n {\n breakpoint: 768,\n settings: {\n slidesToShow: 2,\n arrows: false\n }\n }\n ]\n });\n });\n }", "title": "" }, { "docid": "7724c0ae99ca273f14bb6ebd284594b1", "score": "0.6350062", "text": "function homeMediaSmall() {\n\tif (!$(\"body\").hasClass(\"home\")) return false;\n\t$(document).ready(function() {\t\n\t\t$('#carousel').responsiveSlides({\n\t\t\tauto: false,\n\t\t\tpager: true,\n\t\t});\n\t\t\t\t\n\t});\n}", "title": "" }, { "docid": "d069b00d1217ec1660aaf564baf30ce6", "score": "0.63268375", "text": "function resizeIt(){\n\t\tlet viewport = window.innerWidth;\n\t\tlet scaleFactor = 1.25;\n\n\t\tif(viewport >= 1924){\n\t\t\tscaleFactor = 1.8;\n\t\t} else if(viewport <=1280){\n\t\t\tscaleFactor = 1;\n\t\t}\n\t\tdocument.getElementsByClassName(\"background\")[0].style.transform = \"scale(\"+scaleFactor+\")\";\n\t\tface_container.style.transform = \"scale(\"+scaleFactor+\")\";\n\t}", "title": "" }, { "docid": "4e1335f8b7d07c7650ecf1a47ecd89f5", "score": "0.63247174", "text": "function SnapSlider() {\n\t\t\n\t\n\t\tif( $('.snap-slider-holder').length > 0 ){\n\t\t\t\n\t\t\tconst snapSlider = document.querySelector(\".snap-slider-container\");\t\t\t\n\t\t\t\n\t\t\tconst snapImages = gsap.utils.toArray(\".snap-slide\");\n\t\t\tvar snapImagesHeight = 0\n\t\t\tsnapImages.forEach(function( snapImage ) {\n\t\t\t\tsnapImagesHeight += $(snapImage).outerHeight(true);\n\t\t\t});\n\t\t\tconsole.log(snapImagesHeight)\n\t\t\t\n\t\t\tconst snapCaptions = gsap.utils.toArray(\".snap-slide-caption\");\t\n\t\t\tconst snapCaption = document.querySelector('.snap-slide-caption');\t\t\t\n\t\t\tvar snapCaptionsHeight = 0\n\t\t\tsnapCaptions.forEach(function( snapCaption ) {\n\t\t\t\tsnapCaptionsHeight += $(snapCaption).outerHeight(true);\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\t$('.snap-slide').each(function(){\n\t\t\t\tvar $this = $(this);\n\t\t\t\tgsap.to($this, {\t\t\t \n\t\t\t\t scrollTrigger: {\n\t\t\t\t\ttrigger: $this,\n\t\t\t\t\tstart: \"top 50%\",\n\t\t\t\t\tend: \"+=\" + innerHeight,\n\t\t\t\t\tonEnter: function() { \n\t\t\t\t\t\t$(\".snap-slider-captions\").children().eq($this.index()).addClass(\"in-view\");\n\t\t\t\t\t\t$this.find('video').each(function() {\n\t\t\t\t\t\t\t$(this).get(0).play();\n\t\t\t\t\t\t});\t\t\t\t\t\n\t\t\t\t\t},\n\t\t\t\t\tonLeave: function() { \n\t\t\t\t\t\t$(\".snap-slider-captions\").children().eq($this.index()).removeClass(\"in-view\");\n\t\t\t\t\t\t$this.find('video').each(function() {\n\t\t\t\t\t\t\t$(this).get(0).pause();\n\t\t\t\t\t\t});\t\t\t\t\t\t\n\t\t\t\t\t},\n\t\t\t\t\tonEnterBack: function() { \n\t\t\t\t\t\t$(\".snap-slider-captions\").children().eq($this.index()).addClass(\"in-view\");\n\t\t\t\t\t\t$this.find('video').each(function() {\n\t\t\t\t\t\t\t$(this).get(0).play();\n\t\t\t\t\t\t});\n\t\t\t\t\t}, \n\t\t\t\t\tonLeaveBack: function() { \n\t\t\t\t\t\t$(\".snap-slider-captions\").children().eq($this.index()).removeClass(\"in-view\");\n\t\t\t\t\t\t$this.find('video').each(function() {\n\t\t\t\t\t\t\t$(this).get(0).pause();\n\t\t\t\t\t\t});\t\t\t\t\t\t\n\t\t\t\t\t},\n\t\t\t\t }\n\t\t\t\t});\t\t\t\n\t\t\t});\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tgsap.fromTo(snapCaptions, {\n\t\t\t\ty: (window.innerHeight - snapCaption.offsetHeight)/2\n\t\t\t},{\n\t\t\t\ty: snapImagesHeight - snapCaptionsHeight - ((window.innerHeight - snapCaption.offsetHeight)/2),\n\t\t\t\tscrollTrigger: {\n\t\t\t\t\ttrigger: snapSlider,\n\t\t\t\t\tscrub: true,\t\t\t\t\t\n\t\t\t\t\tstart: \"top top\",\n\t\t\t\t\tend: \"+=\" + innerHeight*(snapImages.length - 1),\n\t\t\t\t},\n\t\t\t\tease: 'none'\n\t\t\t})\n\t\t\t\n \t\t\n\t\t\tgsap.set(snapImages, { height:window.innerHeight});\n\t\t\t\n\t\t\tconst snap = gsap.utils.snap(1/(snapImages.length - 1));\n\t\t\n\t\t\tScrollTrigger.create({\n\t\t\t\ttrigger: snapImages,\n\t\t\t\tstart: \"top top\",\n\t\t\t\tend: \"+=\" + innerHeight*(snapImages.length - 1),\n\t\t\t\tsnap: {\n\t\t\t\t\tsnapTo: snap,\n\t\t\t\t\tduration: {min: 0.2, max: 0.7},\n\t\t\t\t\tdelay: 0,\n\t\t\t\t\tease: \"power4.inOut\"\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\tsnapImages.forEach((slide, i) => {\n\t\t\t\tlet imageWrappers = slide.querySelectorAll('.img-mask');\t\t\t\t\n\t\t\t\tgsap.fromTo(imageWrappers, {\n\t\t\t\t\ty: - window.innerHeight * snapSlider.dataset.parallax,\n\t\t\t\t},{\n\t\t\t\t\ty: window.innerHeight * snapSlider.dataset.parallax,\n\t\t\t\t\tscrollTrigger: {\n\t\t\t\t\t\ttrigger: slide,\n\t\t\t\t\t\tscrub: true,\n\t\t\t\t\t\tstart: \"top bottom\",\n\t\t\t\t\t},\n\t\t\t\t\tease: 'none'\n\t\t\t\t})\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\tif (!isMobile()) {\n\t\t\t\t\n\t\t\t\t$(\".slide-title-wrapper\").mouseenter(function(e) {\n\t\t\t\t\tvar $this = $(this);\t\t\t\t\t\n\t\t\t\t\tgsap.to('#ball', {duration: 0.3, borderWidth: '2px', scale: 1.2, borderColor:$this.parents(\".snap-slide-caption\").data('color'), backgroundColor:$this.parents(\".snap-slide-caption\").data('color')});\n\t\t\t\t\tgsap.to('#ball-loader', {duration: 0.2, borderWidth: '2px', top: 2, left: 2});\n\t\t\t\t\t$( \"#ball\" ).addClass(\"with-icon\").append( '<i class=\"arrow-icon\"></i>' );\n\t\t\t\t\t$this.closest('.item').find('video').each(function() {\n\t\t\t\t\t\t$(this).get(0).play();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t$(\".slide-title-wrapper\").mouseleave(function(e) {\n\t\t\t\t\tvar $this = $(this);\t\t\t\t\t\n\t\t\t\t\tgsap.to('#ball', {duration: 0.2, borderWidth: '4px', scale:0.5, borderColor:'#999999', backgroundColor:'transparent'});\n\t\t\t\t\tgsap.to('#ball-loader', {duration: 0.2, borderWidth: '4px', top: 0, left: 0});\n\t\t\t\t\t$(\"#ball\").removeClass(\"with-icon\");\n\t\t\t\t\t$('#ball i').remove();\t\n\t\t\t\t\t$this.closest('.item').find('video').each(function() {\n\t\t\t\t\t\t$(this).get(0).pause();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Snap Slider Project Load Events\n\t\t\tif (!$(\"body\").hasClass(\"disable-ajaxload\")) {\n\t\t\t\t$('.snap-slider-holder .slide-title').on('click', function() {\n\t\t\t\t\tlet parent_slide = $(this).closest( '.snap-slide-caption' );\n\t\t\t\t\tparent_slide.addClass('above');\t\t\t\t\t\n\t\t\t\t\t$(\"body\").addClass(\"load-project-thumb\").addClass(\"show-loader\");\n\t\t\t\t\tif (!$(\"#page-content\").hasClass(\"light-content\")) {\n\t\t\t\t\t\tsetTimeout( function(){\n\t\t\t\t\t\t\t$(\"header\").removeClass(\"white-header\");\n\t\t\t\t\t\t} , 100 );\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\tgsap.to('.snap-slider-holder, #hero, #page-nav, footer, .fadeout-element', {duration: 0.5, opacity:0, delay:0.2, ease:Power4.easeInOut});\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tgsap.to('.slide-title span', {duration: 0.5, y:-120, opacity:0, stagger: 0.02, ease:Power2.easeInOut});\n\t\t\t\t\tgsap.to('.slide-subtitle span', {duration: 0.5, y:-60, opacity:0, stagger: 0.02, ease:Power2.easeInOut});\n\t\t\t\t\t\t\n\t\t\t\t\t$(this).delay(300).queue(function() {\n\t\t\t\t\t\tvar link = $(\".above\").find('a');\n\t\t\t\t\t\tlink.trigger('click');\n\t\t\t\t\t});\n\t\t\t\t\tgsap.to('#ball', {duration: 0.2, borderWidth: '4px', scale:0.5, borderColor:'#999999', backgroundColor:'transparent'});\n\t\t\t\t\tgsap.to('#ball-loader', {duration: 0.2, borderWidth: '4px', top: 0, left: 0});\n\t\t\t\t\t$(\"#ball\").removeClass(\"with-icon\");\n\t\t\t\t\t$('#ball p').remove();\n\t\t\t\t\t$('#ball i').remove();\t\t\t\t\n\t\t\t\t});\n\t\t\t} else {\t\t\t\t\n\t\t\t\tgsap.to('#ball', {duration: 0.2, borderWidth: '4px', scale:0.5, borderColor:'#999999', backgroundColor:'transparent'});\n\t\t\t\tgsap.to('#ball-loader', {duration: 0.2, borderWidth: '4px', top: 0, left: 0});\n\t\t\t\t$(\"#ball\").removeClass(\"with-icon\");\n\t\t\t\t$('#ball p').remove();\n\t\t\t\t$('#ball i').remove();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "a29e64f1f991ee324552a874e3410dfa", "score": "0.63230616", "text": "function sizeIt() {\n offsets = [];\n iw = window.innerWidth;\n gsap.set(\"#panelWrap\", { width: slides.length * iw });\n gsap.set(slides, { width: iw });\n for (let i = 0; i < slides.length; i++) {\n offsets.push(-slides[i].offsetLeft);\n }\n gsap.set(container, { x: offsets[activeSlide] });\n dragMe[0].vars.snap = offsets;\n }", "title": "" }, { "docid": "e61f4ee967998cee64f6063c77278e0e", "score": "0.6298336", "text": "function fixSliderSizes() {\n var maxHeight = 0,\n paginationHeight = $pagination.outerHeight( true ),\n $swiperContainer = $testimonial.find( '.swiper-container' );\n\n $swiperContainer.height( 'auto' );\n\n $slides.each(function() {\n maxHeight = Math.max( jQuery( this ).outerHeight( true ), maxHeight );\n });\n\n $swiperContainer.height( maxHeight + paginationHeight );\n\n if ( isLargeScreen() ) {\n jQuery( '.testimonial-nav' ).css( 'width', 'calc( 50% - ' + jQuery( '.slider-content' ).width() / 2 + 'px )' );\n }\n }", "title": "" }, { "docid": "e29e8821206dd223f60c17e23486d85b", "score": "0.6288131", "text": "function initiate_homepage_slider(){\n\t\t\t$('.main-frame') .css({ width: inch40w + 00/*20*/, \t height: inch40h,\t});\n\t\t\t$('.second-frame').css({ width: inch40w + 00,\t });\n\t\t\t$('.third-frame') .css({ width: inch40w + 40,\t });\t\n\t\t\t$('.third-frame') .removeClass('remove-border');\t\n\t\t\t//$('.third-frame') .animate({ opacity: 1 });\n\t\t\n\t\t$('.inch-35').click(function(){\n\t\t\t$('.main-frame') .animate({ width: inch35w + 00/*20*/,\t height: inch35h,\t});\n\t\t\t$('.second-frame').animate({ width: inch35w + 00,\t });\n\t\t\t$('.third-frame') .animate({ width: inch35w + 40,\t });\t\n\t\t\t$('.third-frame') .removeClass('remove-border');\n\t\t\t$('.resolutions a').removeClass('active-resolution');\n\t\t\t$(this).addClass('active-resolution');\t\t\n\t\t});\n\n\t\t$('.inch-40').click(function(){\n\t\t\t$('.main-frame') .animate({ width: inch40w + 00/*20*/, \t height: inch40h,\t});\n\t\t\t$('.second-frame').animate({ width: inch40w + 00,\t });\n\t\t\t$('.third-frame') .animate({ width: inch40w + 40,\t });\t\n\t\t\t$('.third-frame') .removeClass('remove-border');\t\n\t\t\t$('.resolutions a').removeClass('active-resolution');\n\t\t\t$(this).addClass('active-resolution');\t\t\n\t\t});\n\t\t\n\t\t$('.inch-50').click(function(){\n\t\t\t$('.main-frame') .animate({ width: inch50w + 00/*20*/, \t height: inch50h,\t});\n\t\t\t$('.second-frame').animate({ width: inch50w + 00,\t });\n\t\t\t$('.third-frame') .animate({ width: inch50w + 40,\t });\n\t\t\t$('.third-frame') .removeClass('remove-border');\t\n\t\t\t$('.resolutions a').removeClass('active-resolution');\n\t\t\t$(this).addClass('active-resolution');\t\t\n\t\t});\n\t\t\n\t\t$('.inch-60').click(function(){\n\t\t\t$('.main-frame') .animate({ width: inch60w + 00/*20*/, \t height: inch60h,\t});\n\t\t\t$('.second-frame').animate({ width: inch60w + 00,\t });\n\t\t\t$('.third-frame') .animate({ width: inch60w + 40,\t });\n\t\t\t$('.third-frame') .removeClass('remove-border');\t\t\n\t\t\t$('.resolutions a').removeClass('active-resolution');\n\t\t\t$(this).addClass('active-resolution');\t\t\n\t\t});\n\t\t\n\t\t$('.inch-70').click(function(){\n\t\t\t$('.main-frame') .animate({ width: inch70w + 00/*20*/, \t height: inch70h,\t});\n\t\t\t$('.second-frame').animate({ width: inch70w + 00,\t });\n\t\t\t$('.third-frame') .animate({ width: inch70w + 40,\t });\n\t\t\t$('.third-frame') .removeClass('remove-border');\n\t\t\t$('.resolutions a').removeClass('active-resolution');\n\t\t\t$(this).addClass('active-resolution');\t\t\t\n\t\t});\n\n\t\t$('.inch-80').click(function(){\n\t\t\t$('.main-frame') .animate({ width: inch80w + 00/*20*/, \t height: inch80h,\t});\n\t\t\t$('.second-frame').animate({ width: inch80w + 00,\t });\n\t\t\t$('.third-frame') .animate({ width: inch80w + 40,\t });\n\t\t\t$('.third-frame') .removeClass('remove-border');\n\t\t\t$('.resolutions a').removeClass('active-resolution');\n\t\t\t$(this).addClass('active-resolution');\t\t\t\n\t\t});\n\t\n\t\t$('.inch-00').click(function(){\n\t\t\t$('.third-frame') .addClass('remove-border');\t\t\n\t\t});\n\t}", "title": "" } ]
aa4b087392cc11f7d82884762cf92383
Declare Function for Random Number generation used for random Array Index and random Background Color.
[ { "docid": "d8f42eeac4e9638f1b57a0e6da446035", "score": "0.7005251", "text": "function getRandomNumber( quoteIndex, backgroundColor ) {\n return Math.floor((Math.random()) * quoteIndex, backgroundColor);\n}", "title": "" } ]
[ { "docid": "f63abaf119954bcb967bed29e11bd71c", "score": "0.78266525", "text": "function randomNumberGenerator() {\n var ranNum = Math.floor(Math.random() * colors.length)\n return colors[ranNum];\n}", "title": "" }, { "docid": "39c38ccdd3056c267fc2f193363a23ab", "score": "0.7741813", "text": "function getColorNum() {\n \n //variable to set array index to select color from array\n colorNum = Math.floor(Math.random() * 4);\n \n return colorNum;\n \n}", "title": "" }, { "docid": "cf2dfdde1eefe47c73ee7c57a92a711c", "score": "0.77265877", "text": "function gen(){\n randomNumber= Math.floor((Math.random() * 100) + 1);\n red = Math.floor((Math.random() * 10) + 1);\n green = Math.floor((Math.random() * 12) + 1);\n blue = Math.floor((Math.random() * 10) + 2);\n yellow = Math.floor((Math.random() * 12) + 2);\n }", "title": "" }, { "docid": "7d5d035cc0e7d44574faf56564744819", "score": "0.7641107", "text": "function randomColorIndex() {\n return Math.round(Math.random() * 3);\n}", "title": "" }, { "docid": "751071bde63c5d4975e7dd66b2b42fde", "score": "0.7551396", "text": "function randNumber() {\n return Math.floor(Math.random() * colors.length);\n}", "title": "" }, { "docid": "264629b66b554de3c668db46c692d5d6", "score": "0.7464271", "text": "function gen3(){\n randomNumber= Math.floor((Math.random() * 10000) + 1);\n red = Math.floor((Math.random() * 10000) + 1);\n green = Math.floor((Math.random() * 1000) + 1);\n blue = Math.floor((Math.random() * 100) + 1);\n yellow = Math.floor((Math.random() * 10) + 1);\n }", "title": "" }, { "docid": "75d86a07f602bff1e5c12971100d2f90", "score": "0.7451649", "text": "function randomIndex() {\n\treturn Math.floor(Math.random() * colors.length);\n}", "title": "" }, { "docid": "4fb7dc8fe7d91201d3668339dcae053b", "score": "0.73882", "text": "function gen2(){\n randomNumber= Math.floor((Math.random() * 1000) + 1);\n red = Math.floor((Math.random() * 1000) + 1);\n green = Math.floor((Math.random() * 100) + 1);\n blue = Math.floor((Math.random() * 100) + 1);\n yellow = Math.floor((Math.random() * 10) + 1);\n }", "title": "" }, { "docid": "da1466639a6430f630ccae5deeca6dd8", "score": "0.7379961", "text": "function getRandomColor(){\n let index_c = Math.floor(Math.random() * 7 );\n return index_c;\n}", "title": "" }, { "docid": "c6cea101e9edf19f7caa9c5fefa4d36d", "score": "0.736193", "text": "function randNumber() {\r\n let random = Math.floor(Math.random() * colors.length);\r\n return colors[random];\r\n}", "title": "" }, { "docid": "c6cf3c26694aa54af9a968cb0c20ea0a", "score": "0.73558396", "text": "static generateRandom() {\n return new Color([\n Math.random() * 360,\n Math.random() * 100,\n Math.random() * 100,\n ]);\n }", "title": "" }, { "docid": "d85d42d48f8b4993a8a1ff98461e5daa", "score": "0.7339523", "text": "function randomNumbers(){\r\n let newColor = Math.random().toString(16);\r\n newColor = \"#\" + newColor.slice(2, 8);\r\n return newColor;\r\n}", "title": "" }, { "docid": "4ae56847831c2bf74e5dbd561ec0cb07", "score": "0.72984856", "text": "function colorGenerator(num){\n\tvar arr=[];\n\tfor(var i=0;i<num;i++){\n\t\tarr.push(colorRandom());\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "4e06dbbb8d4e5207405a7f35554c69cd", "score": "0.7287533", "text": "function generateRandomColor(num){\n\t//make an array\n\tvar arr = [];\n\t//repeat num times\n\tfor (var i = 0; i < num; i++){\n\t\t// Get a random color fron function and push it to the array\n\t\tarr.push(randomColor());\n\t}\n\t//return the array\n\treturn arr;\n}", "title": "" }, { "docid": "987d585e6adbb57ae9a933e4d7703381", "score": "0.7261326", "text": "function gen1(){\n randomNumber= Math.floor((Math.random() * 100) + 1);\n red = Math.floor((Math.random() * 100) + 1);\n green = Math.floor((Math.random() * 10) + 1);\n blue = Math.floor((Math.random() * 10) + 1);\n yellow = Math.floor((Math.random() * 10) + 1);\n }", "title": "" }, { "docid": "1e899737aaf43cc7cda6db38a73014f6", "score": "0.7257867", "text": "function getRandomNumber(){\n return Math.floor(Math.random()*colors.length);\n }", "title": "" }, { "docid": "b9c9fbb30ba1e98561934f54187a260b", "score": "0.72540724", "text": "generateColor() {\n let color = [];\n\n let red = speedColorRand(\"color\"),\n green = speedColorRand(\"color\"),\n blue = speedColorRand(\"color\");\n const alpha = 1.0;\n\n for (let j = 0; j < this.indices.length; ++j) {\n color = color.concat(red, green, blue, alpha); //R G B A\n }\n\n return color;\n }", "title": "" }, { "docid": "1fd8fadd50c7780e6896918de19692ea", "score": "0.7245022", "text": "genCode() {\n return new Array(4).fill().map(() => Math.floor(Math.random() * colors.length));\n // NOTE: we are HARD CODING the length of the array; this will need to change as we \n // implement higher difficulties\n }", "title": "" }, { "docid": "f965a2a7b092e2ccd56a420c0421170b", "score": "0.7242062", "text": "function randomColorGenerator() {\n return '#' + Math.random().toString(16).slice(-6);\n}", "title": "" }, { "docid": "54ce68fec401c79fecf2e000148e32a7", "score": "0.7231619", "text": "function genrancolor(num){\n\tvar arr=[];\n\tfor(var i=0;i<num;i++){\n\t\tarr.push(randomcolor());\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "a4b7ca996cf3fe7c1da610881e556af3", "score": "0.7231013", "text": "function p4() {\n let rainbowText = document.getElementById('rainbowText');\n rainbowText.addEventListener(\"click\", function () {\n let ranColor = '#' + (Math.random() * 0xFFFFFF << 0).toString(16); //// I cheated and copied this from online\n rainbowText.style.color = ranColor;\n })\n\n // function giveColor () { //////// my attempt at color generator\n // let r = genNums(); \n // let g = genNums();\n // let b = genNums();\n // let colorGen = \"rgb(\" + r + \",\" + g + \",\" + b + \");\";\n // return colorGen;\n // }\n\n\n // function genNums (){\n // return Math.floor(Math.random()* 256)\n // }\n\n\n }", "title": "" }, { "docid": "cff552051fea5c4753d5169e3c6f504b", "score": "0.7196126", "text": "function colorRandom(){\n//pick random number\n\tvar random = Math.floor(Math.random() * colors.length); //floor- chops decimal //random()-generate <1 decimal\n\treturn colors[random]; //return colors[i]\n}", "title": "" }, { "docid": "1da8ac09f7c0cf0f6721095ee44617ee", "score": "0.71878994", "text": "function generateRandomColors(num){\r\n\t//ARGUMENT IS THE NUMBER OF ITEMS IN THE ARRAY \t\r\n\t//INTIALIZING AN EMPTY ARRAY\r\n\tvar arr=[];\r\n\r\n\t//LOOP TO PUSH A NEW COLOR TO EVERY CELL OF THE ARRAY\r\n\tfor(var i=0;i<num;i++){\r\n\t\t//arraynName.push() IS USED TO ADD NEW ELEMENTS TO THE ARRAY\r\n\t\t//ARRGUMENT TAKEN BY push() IS THE CONTENT IN THE ARRAY CELL\r\n\t\t//HERE THE CONTENT IS COLOR NAME\r\n\t\t//THIS COLOR NAME IS RETURNED BY A FUNCTION randoColor()\r\n\t\tarr.push(randomColor());\r\n\t}\r\n\r\n\t//RETURNING THE BUILT ARRAY TO THE VAR COLORS\r\n\treturn arr;\r\n}", "title": "" }, { "docid": "fc8358667ef34220a3561644da7956fb", "score": "0.7185428", "text": "function colorRandom(){\nvar red = Math.floor(Math.random()*205)+50;\nvar green = Math.floor(Math.random()*205)+50;\nvar blue = Math.floor(Math.random()*205)+50;\nreturn \"#\"+Converter(red, green, blue);\n}", "title": "" }, { "docid": "3d1a7e9dcbd09cea7d8e5a0bdef03a23", "score": "0.7180416", "text": "function generateRandomColors(num){\n//make an array\n var arr=[]\n//repeat num times\n for (var i= 0; i<num ; i++) {\n //get random color and push into arr\n arr.push(randomColor())\n}\n//return that array\nreturn arr;\n\n}", "title": "" }, { "docid": "9dfb09ab7fd209edbab6889c07730d30", "score": "0.71791255", "text": "function rgbNumGen() {\n\t\treturn Math.floor(Math.random() * 256);\n\t}", "title": "" }, { "docid": "99051daa8440f46fdac66ee46bae6ca1", "score": "0.7169355", "text": "function generateRandomColor(num){\r\n\t\tvar arr = [];\r\n\r\n\t\tfor(var i = 0 ; i<num; i++){\r\n\t\t\tarr.push(randomColor());\r\n\t\t}\r\n\r\n\t\treturn arr;\r\n\r\n\t\tfunction randomColor(){\r\n\t\t\t//generate random red color\r\n\t\t\tvar r = Math.floor(Math.random()*256);\r\n\t\t\t//generate random green color\r\n\t\t\tvar g = Math.floor(Math.random()*256);\r\n\t\t\t//generate random blue color\r\n\t\t\tvar b = Math.floor(Math.random()*256);\r\n\r\n\t\t\treturn \"rgb(\" + r +\", \" + g + \", \" + b + \")\";\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "17df537968ff084aadf03c323a1d450c", "score": "0.71604824", "text": "function randomcolor(){\n //store colors in an array\n var colorArray = ['#FF6633', '#FFB399', '#FF33FF', '#FFFF99', '#00B3E6', \n\t\t '#E6B333', '#3366E6', '#999966', '#99FF99', '#B34D4D',\n\t\t '#80B300', '#809900', '#E6B3B3', '#6680B3', '#66991A', \n\t\t '#FF99E6', '#CCFF1A', '#FF1A66', '#E6331A', '#33FFCC',\n\t\t '#66994D', '#B366CC', '#4D8000', '#B33300', '#CC80CC', \n\t\t '#66664D', '#991AFF', '#E666FF', '#4DB3FF', '#1AB399',\n\t\t '#E666B3', '#33991A', '#CC9999', '#B3B31A', '#00E680', \n\t\t '#4D8066', '#809980', '#E6FF80', '#1AFF33', '#999933',\n\t\t '#FF3380', '#CCCC00', '#66E64D', '#4D80CC', '#9900B3', \n'#E64D66', '#4DB380', '#FF4D4D', '#99E6E6', '#6666FF'];\n \n \n var num=Math.floor(Math.random() * colorArray.length);\n \n\n return colorArray[num];\n \n}", "title": "" }, { "docid": "2173ecd376564ec3d064ab83128b5b88", "score": "0.715624", "text": "function randomColorGenerator(){\n color1.value = \"#\" + generateRandomNumber();\n color2.value = \"#\" + generateRandomNumber();\n setGradient();\n}", "title": "" }, { "docid": "98c96a3ced1eb8e7164ac31bf59a5976", "score": "0.71543854", "text": "function generateRandomColors(num){\n\t//make an array\nvar arr =[];\n// add num random colors to array\nfor(i=0; i < num; i++){\narr.push(randomColor()); \n}\n//return an array\nreturn arr;\n}", "title": "" }, { "docid": "34507ee0e6b65e687f3e4485bc4ff069", "score": "0.71508193", "text": "function genrateRandomColor(n){\n\tvar arr=[];\n\tfor (var i = 0; i < n; i++) {\n\t\t arr.push(randomColor());\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "becab46e7f04d4f0a31db8511cefedcc", "score": "0.71276927", "text": "function generateColor() {\n //red - blue\n return \"rgba(\"+ (Math.floor(Math.random() * 120) + 50) + \",\" + 15 + \",\" + (Math.floor(Math.random() * 165) + 90) + \", 0.5)\";\n}", "title": "" }, { "docid": "d571b72aafd698d26b205e143ef49484", "score": "0.7110268", "text": "function colorRandom() {\n // Escoge un numero al azar entre 0 y el tamanio del arreglo de los colores porque varia en los modos facil y normal\n var random = Math.floor(Math.random() * colores.length);\n // Regresa el elemento del arreglo de colores que fue generado con el indice al azar\n return colores[random];\n}", "title": "" }, { "docid": "ba6a70bb2e835d2f9c55f524d73da20f", "score": "0.7109644", "text": "function colorGenerator() {\n\t\t\t\tvar letters = '0123456789ABCDEF';\n\t\t\t\tvar color = '#';\n\t\t\t\tfor (var i = 0; i < 6; i++) {\n\t\t\t\t\tcolor += letters[Math.floor(Math.random() * 16)];\n\t\t\t\t}\n\t\t\t\treturn color;\n\t\t}", "title": "" }, { "docid": "f8c8df4106c16ebc75c07c6567f5c6b2", "score": "0.70841163", "text": "function generateRandomColors(num) {\n let arr = [];\n//repeat num times\n for ( i = 0; i < num; i++ ) {\n arr.push(randomColor());\n }\n//add num numbers\n return arr;\n\n}", "title": "" }, { "docid": "6ab75d04efa6f65f5c0afb0bcab06f48", "score": "0.7083259", "text": "function colorGenerator(num){\n // The array to be filled\n const arr = [];\n // The array will be filled num times\n for(var i = 0; i < num; i++){\n arr.push(randomColor());\n };\n\n return arr;\n}", "title": "" }, { "docid": "6cd2927f4d091ecd593f2a2cf78f7529", "score": "0.7081056", "text": "function generateColor() {\r\n color = \"#\";\r\n for (var i = 0; i < 6; i++) {\r\n color += hexa[getRandom(0, 15)];\r\n }\r\n return color;\r\n}", "title": "" }, { "docid": "5b803a9ec01f479dc118b63cc298269d", "score": "0.7080887", "text": "function genRandomColors(num) {\n\tvar arr = [];\n //loop through the array and push a random color from the function makecolor\n\tfor (var i = 0; i < num; i++) {\n\t\tarr.push(makeColor());\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "52ef1bcc20343c440251c612dd37a68f", "score": "0.7073759", "text": "function RandomColorGenerator(){this.hue=Math.random();this.goldenRatio=0.618033988749895;this.hexwidth=2;}", "title": "" }, { "docid": "1209509f657655f123c1f0bb331465b2", "score": "0.7070905", "text": "function generateRandomColor(num){\n\tvar arr = []\n\t//add num random colors to array\n\tfor(var i = 0; i < num; i++){\n\t\tarr.push(randomRGB());\n\t}\n\t//return that array\n\treturn arr;\n}", "title": "" }, { "docid": "c285fa3c9e810d522392373636c139fe", "score": "0.7055606", "text": "function randomNumber() {\r\n\t// Mozilla Developer Network documentation for Math.random() and Math.floor()\r\n\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random\r\n\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor\r\n\tx = (colors.length * Math.random());\r\n\treturn Math.floor(x);\r\n}", "title": "" }, { "docid": "56565c37c380d22d7c7d8ce00858be8e", "score": "0.7051134", "text": "function generateRandomColors(num){\r\n //make an array\r\n var arr = [];\r\n //add num colors\r\n for(var i = 0 ; i < num ; i++){\r\n arr.push(randomColor());\r\n }\r\n //return the array\r\n return arr;\r\n}", "title": "" }, { "docid": "5c202f782c4bfbb51c6e76b3cb7802db", "score": "0.70269775", "text": "function randomRGB () {\n \n return Math.floor(Math.random() *200);\n }", "title": "" }, { "docid": "0af77a0635dab1dd859f467839f9052c", "score": "0.7020613", "text": "randomRGBNum() {\n return Math.floor(Math.random() * 256)\n }", "title": "" }, { "docid": "4719198f7bd103cf548ae17aa610c429", "score": "0.70197135", "text": "function generateNewColors(num){\r\n\t// create an empty colors array\r\n\tvar arr=[];\r\n\t// push is the created random colors in the array\r\n\tfor(var i=0;i<num;i++){\r\n\tarr.push(randomColors());\r\n\t}\r\n\t// return the array\r\n\treturn arr;\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "c39ad23eaa6a79d4487412ba9065352f", "score": "0.70194614", "text": "function randomColor() {\n        return Math.floor(Math.random()*16777215).toString(16);\n    }", "title": "" }, { "docid": "9b7ba9979730685770c464ed5b96ffb7", "score": "0.7015878", "text": "function generateColor() {\n return '#' + Math.random().toString(16).substr(-6);\n}", "title": "" }, { "docid": "07f4a8bfb6f751761f3e784ccb375092", "score": "0.7012495", "text": "function generateRandomColors(num){\r\n\t//make an array\r\n\tvar arr = []\r\n\t//repeat num times\r\n\tfor(var i = 0; i < num; i++){\r\n\t\t//get random color and push into arr\r\n\t\tarr.push(randomColor())\r\n\t}\r\n\t//return that array\r\n\treturn arr;\r\n}", "title": "" }, { "docid": "ce650f9a2d08ba8778dca957fe8a0b75", "score": "0.70099646", "text": "function getRandomNumber(){\r\nfunction broj(){\r\n return Math.floor(Math.random()*boje.length); \r\n}\r\nconst randomNumber=broj();\r\ndocument.body.style.backgroundColor= boje[randomNumber];\r\ndocument.getElementById('color').textContent=boje[randomNumber];\r\n}", "title": "" }, { "docid": "a5f9765119aadb2f897fd4db92a9965c", "score": "0.70080215", "text": "function pickRandom(){\r\nvar random =Math.floor(Math.random()*numgenerated);\r\nreturn colors[random];\r\n\r\n}", "title": "" }, { "docid": "32cea65d51740e70966d28ad346fbe30", "score": "0.69982857", "text": "function randomColor(){ \n\treturn Math.floor(((Math.random() + 1) * 96)).toString(16);\n}", "title": "" }, { "docid": "8fcc05d51492ea76611a18053d3b8fc9", "score": "0.69974875", "text": "_forgeneratingrandomcolor() {\r\n let letters = '0123456789ABCDEF';\r\n let color = '#';\r\n for (let i = 0; i < 6; i++) {\r\n color += letters[Math.floor(Math.random() * 16)]; //Math.floor to round it off, Math.random to choose a random number and multiplied by 16 as their are only 16 elemts in letters.\r\n }\r\n return color;\r\n }", "title": "" }, { "docid": "798d8c0fe2a07a16b594fad32edecca4", "score": "0.6996107", "text": "randColor() {\n return '#' + Math.random().toString(16).substr(2, 6);\n }", "title": "" }, { "docid": "21a76a883f4df3872d540cfd9abfd997", "score": "0.69939315", "text": "function randomColor1(){\n function c(){\n return Math.floor(Math.random()*256);\n }\n let a=new Array();\n for(let i=0;i<3;i++)\n a.push(c());\n return a;\n }", "title": "" }, { "docid": "30dbd2b16d9dfda3500261ffb28951ec", "score": "0.69929004", "text": "function randomColorGenerator() {\n var hashTag = '#';\n var randomNum = Math.random().toString(16).slice(2, 8);\n\n return hashTag + randomNum;\n}", "title": "" }, { "docid": "b93fbb8324dbef073f8ed75fc1878b2b", "score": "0.69895387", "text": "function random_num() {\n \tvar tmp, party_color = \"0x000000\";\n\n \tfor (var i=0; i<6; i++) {\n \t\ttmp = (Math.round( (Math.random()*15) )).toString();\n \t\ttmp = slider_to_hex(tmp);\n\n \t\tparty_color = char_replace(party_color, (i+2), tmp);\n \t}\n\n \treturn party_color;\n }", "title": "" }, { "docid": "db4b1af987a608c67db690484f04540f", "score": "0.69877493", "text": "function randomColor(){\n return `rgb(${randomNumber(256)} ,${randomNumber(256)}, ${randomNumber(256)})`;\n}", "title": "" }, { "docid": "3530079a437a40b03e4e2726a76444b0", "score": "0.69874555", "text": "function generateRandomColor() {\n let colorArray = Array();\n\n for(i = 0; i < 3; i++) {\n let value = generateRandomNo(255);\n colorArray.push(value);\n }\n\n let colorValue = colorArray.join();\n\n document.getElementsByTagName('BODY')[0].style.backgroundColor = 'rgb('+ colorValue +')';\n}", "title": "" }, { "docid": "82418ac943d727885758267728154df4", "score": "0.6987275", "text": "function rgbColorGenerator (){\n var r = Math.random() * 245;\n r = Math.floor(r);\n var g = Math.random() * 255;\n g = Math.floor(g);\n var b = Math.random() * 255;\n b = Math.floor(b);\n\n \n return `rgb(${r},${g},${b})`;\n}", "title": "" }, { "docid": "68d16eebbf607eb742b1ff0fa959ac53", "score": "0.6983212", "text": "function randColor(){\n return Math.floor(Math.random()*(7-2+1)+2);\n}", "title": "" }, { "docid": "2574863be20641af24ed9c34b73fba50", "score": "0.69785225", "text": "function randomColors(){\r\n\t// generate r\r\n\tvar r=Math.floor(Math.random()*256);\r\n\r\n\t// generate g\r\n\tvar g=Math.floor(Math.random()*256);\r\n\t// generate b\r\n\tvar b=Math.floor(Math.random()*256);\r\n\r\n\treturn \"rgb(\"+r+\", \"+g+\", \"+b+\")\";\r\n\r\n\r\n}", "title": "" }, { "docid": "19dd9745f054e5cbd7e75fa9f0364812", "score": "0.69761443", "text": "function random(){\r\n \tvar k=Math.floor(Math.random()*color.length);\r\n \treturn color[k];\r\n }", "title": "" }, { "docid": "603117b8149949d70dee2f796ed2aade", "score": "0.6973485", "text": "randomColor()\n {\n function r()\n {\n return Math.floor(Math.random() * 255)\n }\n return 'rgba(' + r() + ',' + r() + ',' + r() + ', 0.2)'\n }", "title": "" }, { "docid": "5f617a1ea3758f09602826dddbfb1abb", "score": "0.69614047", "text": "function generateRandomColors(num){\n\t//make an array\n\tvar arr = [];\n\t//ulang sebanyak num kali\n\tfor(var i=0; i<num; i++){\t\t\n\t\t//mendapatkan warna random dan push ke array\n\t\tarr.push(randomColor());\n\t}\n\t//sudah generate 6 warna random, return value\n\treturn arr;\n}", "title": "" }, { "docid": "6a5be38699e70f50257a75b99593ce1b", "score": "0.69581527", "text": "function generateRandomColor(num) {\r\n\tvar arr = [];\r\n\t// loop num times\r\n\tfor (var i = 0; i < num; i++) {\r\n\t\t//generate random number and push it to arr\r\n\t\tarr.push(randomColor());\r\n\t}\r\n\treturn arr;\r\n}", "title": "" }, { "docid": "91b740a56f64d6279cace8f50ae201dc", "score": "0.6953229", "text": "function createColor() {\n return Math.floor(Math.random() * 256);\n }", "title": "" }, { "docid": "46e100419ecc4f47c145140c39c9249c", "score": "0.6944788", "text": "function GenerateColor() {\n r = Math.floor(Math.random() * 200);\n g = Math.floor(Math.random() * 200);\n b = Math.floor(Math.random() * 200);\n color = 'rgb(' + r + ', ' + g + ', ' + b + ')';\n return color;\n }", "title": "" }, { "docid": "33b1a2f4bb6e4386310622f1ffbf9e00", "score": "0.69361013", "text": "function random_color() {\n return Math.floor(Math.random() * colors.length);\n}", "title": "" }, { "docid": "2043354cfffc130739e4b3d2293ef7df", "score": "0.6923503", "text": "function generateRandomColor(num) {\n var randomColors = [];\n for (var i = 0; i < num; i++) {\n randomColors.push(randomColor());\n }\n return randomColors;\n}", "title": "" }, { "docid": "f438c34cf6bfde674a1a44f6e9e0e142", "score": "0.6919537", "text": "function colorGenerator() {\n const randomColor = '#' + Math.floor(Math.random() * 16777215).toString(16);\n return randomColor;\n}", "title": "" }, { "docid": "75d5584955d5269e847ce14e47e46bf8", "score": "0.6916153", "text": "function randomRGB() {\n colorNumber = Math.floor(Math.random() * 256 + 1)\n return colorNumber;\n}", "title": "" }, { "docid": "f76f97c7b9acb1381c56bb7d13c2e6ee", "score": "0.69121003", "text": "generateRandomColor() {\n let rgbSet = [0, 0, 0].map(val => {\n return Math.floor(Math.random()*256);\n })\n return `rgb(${rgbSet[0]}, ${rgbSet[1]}, ${rgbSet[2]})`\n }", "title": "" }, { "docid": "e88a052050886715edb7eef312887681", "score": "0.6911869", "text": "function randomColor() {\n return `#${Math.floor(Math.random() * 0xffffff).toString(16)}`;\n}", "title": "" }, { "docid": "b4a840543d9309ca77c99dc18fe20e57", "score": "0.69106185", "text": "function generatecolor(num){\n let noofcolors=3*num;\n let j;\n let colors=[];\n for(j=0;j<noofcolors;j++){\n colors[j]=randomrgb()\n }\n console.log(colors)\n return colors\n }", "title": "" }, { "docid": "61b0d930ca575117fe0feb933a08ecd3", "score": "0.6909233", "text": "function randomColor(){\n return Math.floor(Math.random()*16777215).toString(16);\n}", "title": "" }, { "docid": "bf075a03ed06948744f76f3a1c1489a7", "score": "0.6907275", "text": "function createRandomColor() {\n const rgb = [ 0, 0, 0 ];\n\n // choose two random indexes that are not the same\n const i = Math.floor(Math.random() * 3);\n let j;\n do {\n j = Math.floor(Math.random() * 3);\n } while (j === i);\n\n rgb[i] = 0xff;\n rgb[j] = Math.floor(Math.random() * 256);\n console.log(rgb);\n\n return '#' + rgb.map(value => value.toString(16).padStart(2, '0')).join('');\n }", "title": "" }, { "docid": "a946b8d6d8eb555c490215cd5aefc3c0", "score": "0.69026613", "text": "function generateColor() {\r\n\tvar c = \"#\";\r\n\tfor(var i = 0; i < 6; i++) {\r\n\t\tc += hex[Math.floor(Math.random() * 16)];\r\n\t}\r\n\r\n\treturn c;\r\n}", "title": "" }, { "docid": "e6d13c15ca823dd60f9a93b4f880c540", "score": "0.69013137", "text": "function generaterandomcolors(n){\n var arr=[];\n for(var i=0;i<n;i++){\n arr.push(randomcolor());\n }\n return arr;\n}", "title": "" }, { "docid": "a1fcecac0c6314b06657553a3d29b213", "score": "0.6896274", "text": "function randomColor(){\r\n\treturn Math.round(Math.random()*255);\r\n}", "title": "" }, { "docid": "3f745f413fda53f7ab72f35b5f6727e4", "score": "0.6885198", "text": "function randomColorGenerator() {\n\tvar randomColor;\n\tred = Math.floor(Math.random() * 256 );\n\tgreen = Math.floor(Math.random() * 256 );\n\tblue = Math.floor(Math.random() * 256 );\n\trandomColor = 'rgb(' + red + ',' + green + ',' + blue + ')';\n\treturn randomColor;\n}", "title": "" }, { "docid": "8643dc01295b0dbed6312a1df54108ce", "score": "0.68810624", "text": "function randomColor() {\n\treturn '#' + Math.random().toString(16).slice(-6);\n}", "title": "" }, { "docid": "59ba10576dc6172529d22c21a63401cc", "score": "0.68761355", "text": "function GenerateColour()\n{\n return '#'+(Math.random()*0xFFFFFF<<0).toString(16);\n}", "title": "" }, { "docid": "caf26db7daf94b1ad5ab35c47b082dc3", "score": "0.68760234", "text": "function colorGenerator() {\n\tvar golden_ratio = 0.618033988749895;\n\tvar h = Math.random();\n\n\tthis.getNext = function() {\n\t\th += golden_ratio;\n\t\th %= 1;\n\t\treturn this.hsvToRgb(h, 0.5, 0.95);\n\t}\n}", "title": "" }, { "docid": "15d5791c8d74e6e9163284a39e636127", "score": "0.6868652", "text": "function generateRandomColors(num) {\n\t// make an array\n\tvar arr = []\n\t// add num random colors to array\n\tfor(var i = 0; i < num; i++) {\n\t\tarr.push(colorRandom());\n\t}\n\t// retun that array\n\treturn arr;\n}", "title": "" }, { "docid": "ce4bc466a4395732ab8810b0f61a28ed", "score": "0.6865298", "text": "function randomColor(){\n \n let r = randomNums(150,210); \n let g = randomNums(150,210); \n let b = randomNums(140,200); \n bodyElement.style.backgroundColor = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n return bodyElement;\n}", "title": "" }, { "docid": "f961f393b7287facd1cdc7c7a71d6871", "score": "0.68638474", "text": "function generateRandomColors(num)\r\n{\r\n // create empty array\r\n var arr = [];\r\n \r\n // add num random colors to array\r\n for(var i = 0; i < num; i++){\r\n // get random color and push into array\r\n arr.push(randomColor()); \r\n }\r\n\r\n //return array\r\n return arr;\r\n}", "title": "" }, { "docid": "d89227355645fde66aed7253615bff33", "score": "0.6862457", "text": "function RandomColorGenerator() {\n this.hue = Math.random();\n this.goldenRatio = 0.618033988749895;\n this.hexwidth = 2;\n }", "title": "" }, { "docid": "d404c778eb42a18cf109daa504b163df", "score": "0.6857026", "text": "function theNumbers() {\n number = Math.floor(Math.random() * 120) +19;\n greenNumber = Math.ceil(Math.random() * 12);\n blueNumber = Math.ceil(Math.random() * 12);\n redNumber = Math.ceil(Math.random() * 12);\n purpleNumber = Math.ceil(Math.random() * 12);\n }", "title": "" }, { "docid": "29826bd03fe6d95e3fd20f46c8b0116f", "score": "0.6855524", "text": "function makeColor() {\n var arr = [];\n for (var i = 0; i < 3; i++) {\n var num = Math.floor(Math.random() * 256);\n arr.push(num);\n }\n return arr;\n}", "title": "" }, { "docid": "d68c3393410174183b0a85cb870ebafa", "score": "0.68520105", "text": "function generateRandomColors(num){\n\t// It is use to generate colors for Squares \n\t// create a empty array\n\tvar arr = [];\n\t// add num random colors to array\n\tfor(var i = 0; i<num; i++){\n\t\tarr.push(generator());\n\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "882236d085bdbe3724adebc05261add0", "score": "0.68516666", "text": "function randomColor(){\n\tvar nums = [];\n\tvar str =\"\";\n\tvar color;\n\tfor (var j = 0; j< 3; j++) {\n\t\t\tnums.push(Math.floor(Math.random() * (255 + 1)));\n\t\t}\n\n\tcolor = str.concat(\n\t\t\"rgb(\", \n\t\tnums[0],\", \", \n\t\tnums[1],\", \", \n\t\tnums[2], \")\");\n\treturn color;\n}", "title": "" }, { "docid": "812e0318370be4688d712e5659a036a8", "score": "0.6842144", "text": "function randomColor(){\r\n\r\n\t//GETTING A VALUE FOR R AND STORING IT IN VARIABLE USING Math.random()\r\n\tvar r=Math.floor(Math.random()*256);\r\n\t//GETTING A VALUE FOR R AND STORING IT IN VARIABLE USING Math.random()\r\n\tvar g=Math.floor(Math.random()*256);\r\n\t//GETTING A VALUE FOR R AND STORING IT IN VARIABLE USING Math.random()\r\n\tvar b=Math.floor(Math.random()*256);\t\t\r\n\r\n\t//RETURNING THE RGB COMBINED STRING TO THE generateRandonColors() FUNCTION\r\n\t//CAREFULLYOBSERVE THE SPACING\r\n\t//THE SPACING SHOULD BE ACCURATE AS COMPUTER GENERATED RGB IS IN THIS FORM ONLY\r\n\treturn \"rgb(\"+r+\", \"+g+\", \"+b+\")\";\r\n}", "title": "" }, { "docid": "a289e7310acf6a5d05f78ca53e1e41cb", "score": "0.6841034", "text": "function randomColor(){\n return Math.floor(Math.random() * 255);\n }", "title": "" }, { "docid": "39b27ddd28dd12ce9ded99eea64c30e8", "score": "0.68352056", "text": "GenerateColor() {\n let baloonColors = ['red', 'blue', 'yellow', 'orange', 'green', \"purple\"] \n return this.ChooseRandom(baloonColors);}", "title": "" }, { "docid": "9946d1326ad3f12b0ae5188f65bafe59", "score": "0.68351793", "text": "function randomrgb(){\n return[Math.floor(Math.random()*256),Math.floor(Math.random()*256),Math.floor(Math.random()*256)] \n }", "title": "" }, { "docid": "763a417f437bfa7d37e8aa8b235f2c37", "score": "0.68339944", "text": "function createColors(num) {\r\n var arr = [];\r\n for (var i = 0 ; i < num; i++){\r\n var r = Math.floor(Math.random() *256);\r\n var g = Math.floor(Math.random() *256);\r\n var b = Math.floor(Math.random() *256);\r\n arr.push(\"rgb(\" + r + \", \" + g + \", \" + b + \")\");\r\n }\r\n return arr;\r\n}", "title": "" }, { "docid": "0fa812c74bab00ebcdb4fa6e3659d9d5", "score": "0.6829093", "text": "function generateRandomColors(num){\n var arr = [];\n for (var i = 0; i < num; i++) {\n arr.push(randomColor());\n }\n return arr;\n}", "title": "" }, { "docid": "ffd7e633ab67684bde6d248579a3e8b4", "score": "0.6822495", "text": "function random_rgba() {\n return randomColor(); //Random Color Library\n}", "title": "" }, { "docid": "e61fca76cd4b46debdc424af6ebb2a46", "score": "0.68192506", "text": "function randomColors() {\n function color() {\n let c = Math.floor(Math.random() * 256);\n return c;\n }\n return \"rgb(\" + color() + \",\" + color() + \",\" + color() + \")\";\n}", "title": "" }, { "docid": "a5807fde11bb8a6f536ce6ace9e06a1c", "score": "0.68152463", "text": "function getRandomColor() {\n \t\t\tvar letters = '0123456789ABCDEF'.split('');\n \t\t\tvar color = '#';\n \t\t\tfor (var i = 0; i < 6; i++ ) {\n \t\t\tcolor += letters[Math.floor(Math.random() * 15)];\n \t\t\t}\n \t\t\treturn color;\n\t\t\t}//end randomColor", "title": "" } ]
76fb49f8e71d173a88cd5a94a29cd72e
additional funcs to tikTak
[ { "docid": "77e2098282a5a55d4a764f23bca86d5f", "score": "0.0", "text": "function tikTakReadOut(parent, targetDate, ReadOutID, days, hours, minutes, seconds) {\n\t\tvar now = new Date();\n\t\tvar timeLeft = (targetDate - now) / 1000;\n\n\t\tif (timeLeft < 1) {\n\t\t\twindow.clearInterval(ReadOutID); //to do something after timer ends\n\n\t\t\t$(parent).fadeOut();\n\t\t}\n\n\t\tdays.innerHTML = Math.floor(timeLeft / 60 / 60 / 24);\n\t\ttimeLeft = (timeLeft / 60 / 60 / 24 - Math.floor(timeLeft / 60 / 60 / 24)) * 60 * 60 * 24;\n\t\thours.innerHTML = Math.floor(timeLeft / 60 / 60);\n\t\ttimeLeft = (timeLeft / 60 / 60 - Math.floor(timeLeft / 60 / 60)) * 60 * 60;\n\t\tminutes.innerHTML = Math.floor(timeLeft / 60);\n\t\ttimeLeft = (timeLeft / 60 - Math.floor(timeLeft / 60)) * 60;\n\t\tseconds.innerHTML = Math.floor(timeLeft);\n\t}", "title": "" } ]
[ { "docid": "72d5ff2125a97f5b5b4f90c59119c61b", "score": "0.5802073", "text": "function Tc(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}", "title": "" }, { "docid": "bcb36daacce1aa6e15635866300bfad3", "score": "0.57989466", "text": "function tm_test_metier1(){\n\t\t\n\t}", "title": "" }, { "docid": "13df25260e4440a35d55566645faf853", "score": "0.5491923", "text": "function mifuncion(){}", "title": "" }, { "docid": "a0eb2271ad07f7297a29d14a260da21f", "score": "0.54504085", "text": "function tf_test_fonctionnel1(){\n\t\t\n\t}", "title": "" }, { "docid": "9d62d7178bcf7d7270c453c6af6ed220", "score": "0.5328284", "text": "function va(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}", "title": "" }, { "docid": "81ce7b35f386a316a9536a89ce9f65b0", "score": "0.5309747", "text": "function wa(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}", "title": "" }, { "docid": "a340198213d3885c496473c941f14dbc", "score": "0.52855253", "text": "function at(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}", "title": "" }, { "docid": "1a132fd5e13a439579ff3c9939355a0a", "score": "0.51856077", "text": "function a(n,t){Object.keys(n).forEach(function(e){return t(n[e],e)})}", "title": "" }, { "docid": "0cfb626ee922dcb1dafecba5848638df", "score": "0.5150508", "text": "function akeytt( doId ) {\n}", "title": "" }, { "docid": "c570f29409acc0008df82fde56299b21", "score": "0.51315796", "text": "function Wt(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}", "title": "" }, { "docid": "6401d928cec14b0919dd6a4e1782d6ef", "score": "0.5110497", "text": "function TrackByFunction(){}", "title": "" }, { "docid": "e38edb5dd151abf14bec4bb78bd9efb2", "score": "0.5021227", "text": "function _fn(){ /*...*/ }\t//Funzioni private", "title": "" }, { "docid": "2243e9fb55b5cbda9f5aab926ab34311", "score": "0.500409", "text": "function TrackByFunction() { }", "title": "" }, { "docid": "2243e9fb55b5cbda9f5aab926ab34311", "score": "0.500409", "text": "function TrackByFunction() { }", "title": "" }, { "docid": "2243e9fb55b5cbda9f5aab926ab34311", "score": "0.500409", "text": "function TrackByFunction() { }", "title": "" }, { "docid": "2243e9fb55b5cbda9f5aab926ab34311", "score": "0.500409", "text": "function TrackByFunction() { }", "title": "" }, { "docid": "2023bf7c7b8a5509492678755ef847ca", "score": "0.49890792", "text": "function K(){t.call(this)}", "title": "" }, { "docid": "3c3765e8f4430bdfaa1e11047cfd65ed", "score": "0.4989069", "text": "function ttMouseOver(foo) {\nif (tooltipsOn && getCookie(\"wiki-tiploader\") != \"no\") {\n$(\"#WikiaArticle\").mouseover(hideTip);\n$(\"#WikiaArticle\").append('<div id=\"tfb\" class=\"htt\"></div><div id=\"templatetfb\" class=\"htt\"><div>');\n$tfb = $(\"#tfb\");\n$ttfb = $(\"#templatetfb\");\n$htt = $(\"#tfb,#templatetfb\");\nif(foo==1){\n$(\"#WikiaArticle span.ajaxttlink\").each(bindTT);\n}\n$(\"#WikiaArticle span.tttemplatelink\").mouseover(showTemplateTip).mouseout(hideTemplateTip).mousemove(moveTip);\n}\n}", "title": "" }, { "docid": "a1073e63ff7b0f18207238fb58ab4e3e", "score": "0.49840242", "text": "function Scrapper() {}", "title": "" }, { "docid": "b2b962ec6c3bfff5e0bfbb39dac476d6", "score": "0.4975158", "text": "function e36bjRxQJTKxhL2I_aKPoYg(){}", "title": "" }, { "docid": "8fcc83393fb0e7709b477ae081e7e33b", "score": "0.49563587", "text": "function TrackByFunction() {}", "title": "" }, { "docid": "8fcc83393fb0e7709b477ae081e7e33b", "score": "0.49563587", "text": "function TrackByFunction() {}", "title": "" }, { "docid": "75da049525b22d447acdef7d713cadaf", "score": "0.49431732", "text": "function ag(){}", "title": "" }, { "docid": "20e6323e7285dee43b2a006c33651cdf", "score": "0.493309", "text": "function ti(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,a=Qn.writeFeatureObject(t,{featureProjection:n,dataProjection:i});Array.isArray(Object(B[\"h\"])(a,\"properties.features\"))&&(a.properties.features=Mn()(e=a.properties.features).call(e,(function(t){return t instanceof V[\"a\"]?ti(t,n,i):t})));return a}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.49260768", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.49260768", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.49260768", "text": "function miFuncion(){}", "title": "" }, { "docid": "7e882d8ef965d2e6faf2075ea0c57b94", "score": "0.4916471", "text": "function b(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}", "title": "" }, { "docid": "c830dfd5bb1fa34c01b18740fcd930c5", "score": "0.490938", "text": "function Tire () {}", "title": "" }, { "docid": "1f925e0050fa158fb86fa9a92b49850f", "score": "0.4886056", "text": "function chooOpbeat () {\n}", "title": "" }, { "docid": "db7e1b0668c63f3244d920e58b041970", "score": "0.48664752", "text": "function qgAzysV_bHje7HMBqh73wBw(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.4856382", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.4856382", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.4856382", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.4856382", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.4856382", "text": "function TMP(){}", "title": "" }, { "docid": "4d6695225ff7bd4aaf834c3efee21511", "score": "0.48455125", "text": "function kr(){}", "title": "" }, { "docid": "f4182c7ece22fb7f06f19ca5815df5da", "score": "0.48297143", "text": "function XY27_a3uEfjuPVlzJ1epT7g(){}", "title": "" }, { "docid": "7e4949317f8ded77d6fb1e672922538f", "score": "0.4813165", "text": "function kahuna_onGearsMapreduce()\n{\n\n}", "title": "" }, { "docid": "7c1bcc63bd85d9cde052efe81bdf80a6", "score": "0.4807001", "text": "function Pact() {}", "title": "" }, { "docid": "f2f016aa16f9b0fd9d6d0122871238c8", "score": "0.47995442", "text": "function explain_k()\n{\n\n}", "title": "" }, { "docid": "ecf865a471664103513b86e6ecc751d9", "score": "0.47993022", "text": "function ri(t,e){Object.keys(t).forEach(function(i){return e(t[i],i)})}", "title": "" }, { "docid": "90ce89e805e195285e984a5713a7b897", "score": "0.4792839", "text": "function whatHappened(fn){// fn = tealogger\n const result =\n \"Four nations lived together in harmony but everything changed when the fire nation attacked.\";\n fn(result); // teaLogger(result)\n}", "title": "" }, { "docid": "ec6f311188dbfdb45bee1c3cbc1b671b", "score": "0.47888002", "text": "function t(){}", "title": "" }, { "docid": "ec6f311188dbfdb45bee1c3cbc1b671b", "score": "0.47888002", "text": "function t(){}", "title": "" }, { "docid": "ec6f311188dbfdb45bee1c3cbc1b671b", "score": "0.47888002", "text": "function t(){}", "title": "" }, { "docid": "5da4a485fe9039c3a5caba6235ebcd8d", "score": "0.47729477", "text": "function transformation (){\r\n }", "title": "" }, { "docid": "57a2a2adb225f3c7b9b133363d795f0d", "score": "0.4764552", "text": "function extraerDinero() {\n\n}", "title": "" }, { "docid": "7a0d1772fcc3c1f33a91877a72ea55aa", "score": "0.47615865", "text": "static onThisNode(cbk) {\n return (node) => {\n };\n }", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.47539902", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.47539902", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.47539902", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.47539902", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.47539902", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.47539902", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.47539902", "text": "function TMP() {}", "title": "" }, { "docid": "7e92ea26bcd45b0fcdfb2328e753c733", "score": "0.4737826", "text": "function KL() {\n\n}", "title": "" }, { "docid": "2fe5b993fbcc79dbaab0a97631bd4b53", "score": "0.47350448", "text": "function r(e,t){Object.keys(e).forEach(function(a){return t(e[a],a)})}", "title": "" }, { "docid": "2623d98cd8f4584817ca3517dd764b63", "score": "0.47278327", "text": "function setup(ctx) {}", "title": "" }, { "docid": "c816b15b8eb5a57e34e9702938e6cd00", "score": "0.47237676", "text": "function hooks(){return hookCallback.apply(null,arguments)}", "title": "" }, { "docid": "b6181e020bed9c31443c4869b9b44026", "score": "0.4717394", "text": "function AddTransformer() {}", "title": "" }, { "docid": "58dc827a69a4387057ed99b416fc81a6", "score": "0.47127062", "text": "hit() {\n }", "title": "" }, { "docid": "f0754b8e59c113e5db66b7be9d68f8a3", "score": "0.471215", "text": "function _6yZECZP9ozm5xQDaInToeg() {}", "title": "" }, { "docid": "75333c213b8214b688abeb7b114dcbee", "score": "0.46833563", "text": "function configurar_thumnail(){\n $(\"[rel='tooltip']\").tooltip();\n $('.thumbnail').hover(\n function(){\n $(this).find('.caption').slideDown(350); //.fadeIn(250)\n },\n function(){\n $(this).find('.caption').slideUp(250); //.fadeOut(205)\n }\n );\n }", "title": "" }, { "docid": "8b49b512b926c8719cdfd3a3b703fccd", "score": "0.46809983", "text": "function r(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}", "title": "" }, { "docid": "8b49b512b926c8719cdfd3a3b703fccd", "score": "0.46809983", "text": "function r(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}", "title": "" }, { "docid": "4f28de4301d68d73dce84d795152e3fb", "score": "0.4677821", "text": "function rqen1WoNYTG_bP1KupTgpsw() {}", "title": "" }, { "docid": "127b148233c6b22a1f515be3d1dddaed", "score": "0.4670054", "text": "function walkthrough() {\n\n}", "title": "" }, { "docid": "716b3f43ce5dfadcd50c440469facf56", "score": "0.46553886", "text": "function wut() { }", "title": "" }, { "docid": "48fcac54bfa377471ae4573d25c7e35f", "score": "0.46518582", "text": "expressive() {\n \n }", "title": "" }, { "docid": "55343269dec7615104d5cc93ec5ab3c9", "score": "0.46515498", "text": "function keys(callback,context) {}", "title": "" }, { "docid": "b528c80c389e346fcbda7eef9016f459", "score": "0.4650558", "text": "prolog(mode=\"turtle\"){\n switch(mode){}\n if (mode === \"turtle\"){\n return this.turtle(this.prefixMap)\n }\n if (mode === \"sparql\"){\n return this.sparql(this.prefixMap)\n }\n if (mode === \"json\"){\n return JSON.stringify(this.prefixMap)\n } \n if (mode === \"js\"){\n return JSON.assign({},this.prefixMap);\n } \n }", "title": "" }, { "docid": "9417dbd75168df45c4ab4093e3809a13", "score": "0.46486777", "text": "updateFunc(tetresse) {}", "title": "" }, { "docid": "3c2e846a4bf0b6ee7a7c801487fd5453", "score": "0.46459812", "text": "function Wi(){}", "title": "" }, { "docid": "3b17f2d9fff074be26c5689c0cbfa9a1", "score": "0.4644012", "text": "function TF(){}", "title": "" }, { "docid": "2803084cc651bcab91a79646253515bc", "score": "0.46325314", "text": "getTtsExtensions() {}", "title": "" }, { "docid": "8c5af4aae96bfd01181c91102a3ac3a3", "score": "0.4629976", "text": "function JeHOowsSMTebt9kMJXYf5w() {}", "title": "" }, { "docid": "aa6cc895e1a0b7a9f786715ecc6df758", "score": "0.46267143", "text": "function HTP(){\n\n}", "title": "" }, { "docid": "4e1e5bf210ab3933686d70366602c068", "score": "0.46249464", "text": "function Er(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}", "title": "" }, { "docid": "071aafe6494c15a3a76060d5555e9ea2", "score": "0.46180534", "text": "function kf(e,t){return Af.call(e,t)}", "title": "" }, { "docid": "73a750f0bf7174043ac43fdfb329b392", "score": "0.46169406", "text": "function Fp3EngineUtils() {}", "title": "" }, { "docid": "80f5732df82cb179fe87c547c43cf6b9", "score": "0.46168682", "text": "function Ordenes(){ }", "title": "" }, { "docid": "8bd6ab85cbadaa5101eb42ae6205f89c", "score": "0.46157184", "text": "hit() {\n }", "title": "" }, { "docid": "3c15660c492e6d58fa9e156bef4d782b", "score": "0.45991024", "text": "function Ti(e,t){for(var l in t)e[l]=t[l];return e}", "title": "" }, { "docid": "a51806e19cd664af14e60981069cb22f", "score": "0.45962253", "text": "extract() {\n\n }", "title": "" }, { "docid": "0a6899c713078a304f757a9f8ab28180", "score": "0.45949823", "text": "function heena() {}", "title": "" }, { "docid": "be7e116e0af3f2b01cb26467b4fbfb0a", "score": "0.45801762", "text": "function crawl() {\n crawl_controller.crawler(cekmutasi => {\n crawl_controller.transaksi(cekmutasi, sudah => {\n crawl_controller.topup(cekmutasi, sudah2 => {\n \n });\n });\n })\n}", "title": "" }, { "docid": "6dc95f6f296cb2d8330c70a6ca95c603", "score": "0.45759007", "text": "function klikni() {\n console.log(\"klinuti TRI\");\n}", "title": "" }, { "docid": "adaff84e15a3aa8d1ed1435c42750ab8", "score": "0.45682487", "text": "function ut(t,e){T[t]=T[t]||[],T[t].push(e),\"update\"===t.split(\".\")[0]&&p.forEach(function(t,e){lt(\"update\",e)})}", "title": "" }, { "docid": "ea93081152849b3dd5bd675ad7e9c4d1", "score": "0.45647943", "text": "function GraFlicUtil(paramz){\n\t\n}", "title": "" }, { "docid": "c2ab77f5ef828a7079c80a72326c9b96", "score": "0.4564214", "text": "_map_data() { }", "title": "" }, { "docid": "04aac5dd2387c49c5c8ea91efc56853e", "score": "0.45607322", "text": "function kahuna_init()\n{\n \n}", "title": "" }, { "docid": "a2dc4e3db981156d0fa2b83ae70d83a4", "score": "0.45553997", "text": "function alleEingabenSpeichern(){\n ausgewählteIsinSpeichern()\n ausgewählteStrategieSpeichern()\n \n}", "title": "" }, { "docid": "7455d9b0a96cf9b561f1cc507f523b5d", "score": "0.45551345", "text": "function km(){for(var t,e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];(t=console).log.apply(t,Xd()(e=[\"[VueLayers]\"]).call(e,i))}", "title": "" }, { "docid": "e2329a25e62e3100d9db7597f4de49a2", "score": "0.4554777", "text": "function setup() {}", "title": "" }, { "docid": "9385a287a0374470ea244120cc58ce0c", "score": "0.4551365", "text": "function ttMouseOver(foo) {\n if (tooltipsOn && getCookie(\"wiki-tiploader\") != \"no\") {\n $(\"#WikiaArticle\").mouseover(hideTip);\n $(\"#WikiaArticle\").append('<div id=\"tfb\" class=\"htt\"></div><div id=\"templatetfb\" class=\"htt\"><div>');\n $tfb = $(\"#tfb\");\n $ttfb = $(\"#templatetfb\");\n $htt = $(\"#tfb,#templatetfb\");\n if (foo == 1) {\n $(\"#WikiaArticle span.ajaxttlink\").each(ttBind);\n }\n $(\"#WikiaArticle span.tttemplatelink\").mouseover(showTemplateTip).mouseout(hideTemplateTip).mousemove(moveTip);\n }\n}", "title": "" }, { "docid": "8a49e116a7dcc0f284bd64853bdd7c32", "score": "0.454714", "text": "function myT() {\n return true\n }", "title": "" }, { "docid": "74b3cc85e942cbbabe15251cd54d1a05", "score": "0.4544118", "text": "function addTroll() {\n\n }", "title": "" }, { "docid": "77e3fc354c2b0df38fe047039af311b7", "score": "0.4538923", "text": "function Helicopter() {}", "title": "" }, { "docid": "aec4653715c8850d03f509e13489787e", "score": "0.45387492", "text": "function helperFunction() { // only usable in myfunc1\n\n }", "title": "" }, { "docid": "ecb52e2543c0f919cf4f845b56c34c7e", "score": "0.4538586", "text": "function lancer () {\n \n}", "title": "" } ]
d398c0210e2785afc804900eebb26445
If errorEvent has 1 listener, outputs the error message to the web console.
[ { "docid": "5bb95335f5e74da50db4a0dd1fc3748a", "score": "0.0", "text": "function CommandQueue() {\n var _this = this;\n this._queue = [];\n this._paused = true;\n /**\n * An error event.\n */\n this.errorEvent = new Event();\n this.errorEvent.addEventListener(function (error) {\n if (_this.errorEvent.numberOfListeners === 1) console.error(error);\n });\n }", "title": "" } ]
[ { "docid": "32eefd1ac06c19c333c7b9caebbb86c7", "score": "0.6901485", "text": "function onError(evt)\r\n{\r\n\twriteToScreen('<span style=\"color: red;\">ERROR: </span> ' + evt.data);\r\n}", "title": "" }, { "docid": "7d211ff46abc7f4caad228fcba136824", "score": "0.6777306", "text": "function onError(message){\n\tconsole.log(\"Error... \\n\");\n}", "title": "" }, { "docid": "147dc4a6c0371ecfba1cc495dde07257", "score": "0.66529495", "text": "function onError(e) {\n console.log(\"Error!\");\n console.log(e);\n }", "title": "" }, { "docid": "8c794af758c5e21c878d293fb665621b", "score": "0.6612596", "text": "function onError(error) {\r\n console.error(`Error: ${error}`);\r\n}", "title": "" }, { "docid": "94971c9134e8b1d3555a5e30e7fe40c8", "score": "0.66078717", "text": "function onError(error) {\n console.log(error);\n }", "title": "" }, { "docid": "bf13e2dac9fa585e4ae7dbc65625338e", "score": "0.65567327", "text": "function onError(error) {\n console.log(`Error: ${error}`);\n}", "title": "" }, { "docid": "bf13e2dac9fa585e4ae7dbc65625338e", "score": "0.65567327", "text": "function onError(error) {\n console.log(`Error: ${error}`);\n}", "title": "" }, { "docid": "3f8f8de838d9b652c9bfa04002cd62a3", "score": "0.6547257", "text": "function onError(error) {\n console.log(error);\n }", "title": "" }, { "docid": "ed4cdff9ec5bd0fcfcdfc5b9728c65cf", "score": "0.6546074", "text": "function onError(message){\n console.log(message);\n}", "title": "" }, { "docid": "8c66f4a9e9ff70dbdf9167aa12f8fc7c", "score": "0.6545434", "text": "function onError(e) {\n console.log(\"error \" + JSON.stringify(e));\n}", "title": "" }, { "docid": "71814531dd3d8ed5957d8fd9a245e372", "score": "0.6537543", "text": "function onError() {\r\n console.log('onError!');\r\n }", "title": "" }, { "docid": "d2abf321abf34540da23b7eb66ad5d27", "score": "0.6519845", "text": "function onError(err) {\n //logger(\"ERROR: \" + JSON.stringify(err));\n console.log(\"ERROR: \" + JSON.stringify(err));\n alert(\"ERROR: \" + JSON.stringify(err));\n}", "title": "" }, { "docid": "ed3326427c4542d86da2d5f20045ce6f", "score": "0.6518739", "text": "function onError(e) {\n console.log(e);\n }", "title": "" }, { "docid": "82c776e605a8092102acecef747efe65", "score": "0.65139586", "text": "function errorHandler(){\n var html;\n //isProcessAborted = true;\n if(arguments.length === 3){\n //window.onerror\n html = '<p class=\"failed\">' + arguments[0] + '</p><p>File: ' +\n arguments[1] + '</p><p>Line: ' + arguments[2] + '</p>';\n } else {\n //catch(e)\n html = '<p class=\"failed\">An error occurred, \"' + arguments[0] +\n '\" and all further processing has been terminated. Please check your browser console for additional details.</p>';\n }\n document.getElementById('preamble-status-container').innerHTML = html;\n }", "title": "" }, { "docid": "19104419c2bdb203c1da87038aeef42d", "score": "0.65119404", "text": "function onError(evt) {\n console.log(`got error: ${JSON.stringify(evt)}\n`);\n}", "title": "" }, { "docid": "08070df2f63ffb5451105c753ad55fe1", "score": "0.6463226", "text": "function onError(error) {\r\n console.log(error);\r\n}", "title": "" }, { "docid": "40299b34032f2c67550bc4f8c6ff2f2b", "score": "0.64379936", "text": "function errHandler(error) {\n console.log(error);\n}", "title": "" }, { "docid": "20def1695429394d56bb3b567e51ca01", "score": "0.6437926", "text": "function errorMessage(error) {\r\n // if we don't get data from the server the server symbol be red\r\n let serverResponse = document.querySelector(\".serverResponse\");\r\n serverResponse.style.color = \"#f4200b\";\r\n console.error(error);\r\n }", "title": "" }, { "docid": "d45afa42139221c591086f900b4e2a2b", "score": "0.6435663", "text": "function error_handler(e){\n error_div.style.display = 'block';\n }", "title": "" }, { "docid": "eef479cb92588110571a3add094f063e", "score": "0.6415598", "text": "function onError(error) {\n\tconsole.error(error);\n}", "title": "" }, { "docid": "483e5581b42c24b6daf11934bd140f32", "score": "0.6402499", "text": "function onError(e) {\n console.log(e);\n}", "title": "" }, { "docid": "b934de39136891136d7470b382e2da9f", "score": "0.639872", "text": "function onError(error) {\n console.log(error);\n }", "title": "" }, { "docid": "f68089485dd4e4ea19480d5f40cf9851", "score": "0.63809335", "text": "function onError(e) \n\t{\n //console.log(e);\n }", "title": "" }, { "docid": "1dfb973b4a07a9750290f60fa27c13aa", "score": "0.6380326", "text": "function onError(error){\n\talert('ERROR!! - ' + error);\n}", "title": "" }, { "docid": "cc42adbd7441f7c2cfadfd7d2b18ba7b", "score": "0.637003", "text": "function errorlog(error){\n\tconsole.error.bind(error);\n\tthis.emit('end');\n}", "title": "" }, { "docid": "efbaf84a8e4b59f04f50fccfdcf1ec29", "score": "0.63696283", "text": "function onError(error){\r\n console.log(error);\r\n}", "title": "" }, { "docid": "57dd5c1c471aba8eab5b226bc827e16c", "score": "0.6358129", "text": "function errorCallback(err) {\n console.error(err)\n module.errorView.initErrorPage(err)\n }", "title": "" }, { "docid": "b3122292be39fe78d389bfca68b7a921", "score": "0.63578993", "text": "function onError(error) {\n console.log(error);\n}", "title": "" }, { "docid": "0f40abfe8ec17e4f08130929d4d7e8bf", "score": "0.6353294", "text": "function onError(event) {\n console.log(event.target.error.stack || event.target.error);\n}", "title": "" }, { "docid": "1b907034de4e8fba9c412df2e69f215c", "score": "0.63514423", "text": "function errorLog(error){\n\tconsole.error.bind(error);\n\tthis.emit('end');\n}", "title": "" }, { "docid": "20c688583e720d0185fc5d9e786009cf", "score": "0.6346475", "text": "function onError(error) {\r\n onMessageReceived('ERROR: ' + error);\r\n}", "title": "" }, { "docid": "e334608860f854ecd7c5063fd56bb527", "score": "0.6341317", "text": "function printError(e) {\n console.error(\"ERROR ERROR ERROR: \" + e.message);\n}", "title": "" }, { "docid": "4eae2b98964b6d2740a33f7e3ba4dd52", "score": "0.63380367", "text": "function error(){} // Funcion para mostrar error", "title": "" }, { "docid": "ca3b435e7470f82ed64c630d32b04c4b", "score": "0.6334093", "text": "function errorCallback(err) {\n console.error(err);\n module.errorView.initErrorPage(err);\n }", "title": "" }, { "docid": "c5b52dd0392fa443aad7d564b5d2e5e0", "score": "0.63273156", "text": "function onError(error) {\nconsole.log(error);\n}", "title": "" }, { "docid": "7d31b1f74c281729853dc9582fe5d954", "score": "0.63219357", "text": "function showError (error) {\n console.error(error.message);\n }", "title": "" }, { "docid": "efa1b136cbfa263b5222a4ab1947d59b", "score": "0.6308142", "text": "function onError(error){\n\t\t alert(\"Error occured... Try again!\");\n\t\t }", "title": "" }, { "docid": "d952932df13a8073aa2f2f02d0349cb2", "score": "0.63079727", "text": "function error(error) {\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "d952932df13a8073aa2f2f02d0349cb2", "score": "0.63079727", "text": "function error(error) {\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "f16adcef0c2e77c3dd61f4039746f61a", "score": "0.62904346", "text": "function errorLog(error){\n console.error.bind(error);\n this.emit('end');\n}", "title": "" }, { "docid": "0a06aaa348d04bf42d66ee1c00188ae0", "score": "0.6288979", "text": "function errorlog (error) { \n console.error.bind(error); \n this.emit('end'); \n}", "title": "" }, { "docid": "92dc5dc0c657d9d7ece369fbf876b105", "score": "0.6275632", "text": "function handleError(event) {\n log(\"Error:\" + event.data);\n}", "title": "" }, { "docid": "8b8570f5993c92d3e34d6066c66ee594", "score": "0.6271934", "text": "get EVENT_ERROR() {return \"Error\";}", "title": "" }, { "docid": "db5f92afdf619a972e9ee1e8f8c45e11", "score": "0.62710303", "text": "onError(e) {\n console.log('error =>', e.message);\n }", "title": "" }, { "docid": "0f56a58498f238601e87eb91097f9c0d", "score": "0.62707055", "text": "function errorCallback(err){\n console.error(err);\n module.errorView.initErrorPage(err);\n }", "title": "" }, { "docid": "a755bf70d4c08ffcd0189f32e71e8713", "score": "0.62705475", "text": "function errorHandler(error) {\n console.log(error);\n }", "title": "" }, { "docid": "392f9422011eb1947cf9267cd1e84836", "score": "0.62699294", "text": "function onError(error) {\n console.log(error.stack);\n this.emit('end');\n}", "title": "" }, { "docid": "e7941a0254ba0c98d889879d746c38ab", "score": "0.6262326", "text": "function errorAlert(err) {\n log(c.red(err.toString()));\n this.emit(\"end\");\n}", "title": "" }, { "docid": "d497f1e5acf8bd58c90a1fc911cc44bb", "score": "0.6259462", "text": "function on_error() {\n\t\tnl_alert(\"Websocket.onerror function called! \\nBecause this never happened during development, it is hard to say exactly what is going wrong now.\");\n\t\tdebug(\"Websocket.onerror function called! \\nBecause this never happened during development, it is hard to say exactly what is going wrong now.\");\n\t\traise_exception(\"network-error\", \"Websocket.onerror function called - unspecified networking error!\");\n\t}", "title": "" }, { "docid": "cf20c23ef34c20d75e7ce41173988303", "score": "0.62389845", "text": "function logError (error) {\n console.log(error.toString());\n this.emit('end');\n}", "title": "" }, { "docid": "65d3a4e2adf4d4b2260990258fd11697", "score": "0.62389165", "text": "function errorLog (error){\r\n\t\t// console.error.bind(error);\r\n\t\t// this.emit('end');\r\n\t\tconsole.error(error.message);\r\n\t}", "title": "" }, { "docid": "3681ebc4c5c22b998e79ce0220502a30", "score": "0.6224056", "text": "function errorLog(error) {\n\tconsole.error.bind(error);\n\tthis.emit('end');\n}", "title": "" }, { "docid": "c2b5f3026cb750dce26e2dfb35dc5317", "score": "0.62235564", "text": "function errorHandler(error) {\n alert('error = ' + error);\n }", "title": "" }, { "docid": "a53c055f3ccb2b9cb3135b0a5598e90b", "score": "0.6217175", "text": "function errorLog(error) {\n console.error.bind(error);\n this.emit('end');\n}", "title": "" }, { "docid": "72e2c568d1be67336d020a42ac6f7081", "score": "0.62123215", "text": "function error(error)\n{\n\t// BELLs when something goes wrong!\n\tconsole.log(\"\\x07\" + error)\n}", "title": "" }, { "docid": "bd97c49e1f041dd0dccdad1126b6ce6b", "score": "0.6200179", "text": "function onError (error) {\n this.debug(error.message)\n this.error = error.message\n}", "title": "" }, { "docid": "fd0270e00d0e1bf4a540b82386ab003c", "score": "0.6190277", "text": "function onError(error) {\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error('Port : ' + port + ' requires elevated privileges.');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error('Port : ' + port + ' is already in use.');\n process.exit(1);\n break;\n default:\n console.log(error.toString());\n process.exit(1);\n }\n}", "title": "" }, { "docid": "cef06398256d92814e36921aed828e6f", "score": "0.618857", "text": "function errorLog (error) {\n\tconsole.error.bind(error);\n\tthis.emit('end');\n}", "title": "" }, { "docid": "b29b74508bdc328b272bde4772c13f7f", "score": "0.618015", "text": "function errorCallback(error){\n\tconsole.log(error);\n}", "title": "" }, { "docid": "7b842ecd0ba91e366aaa11687336d2cd", "score": "0.616346", "text": "function errorHandler(error) {\r\n console.log(error);\r\n}", "title": "" }, { "docid": "3ad200a88851a436093905c9bf2a5567", "score": "0.6162987", "text": "function onError()\n {\n\n }", "title": "" }, { "docid": "3ad200a88851a436093905c9bf2a5567", "score": "0.6162987", "text": "function onError()\n {\n\n }", "title": "" }, { "docid": "893fdc49dc1151d7b642de9b448333af", "score": "0.61421555", "text": "function errorMsg(msg, error) {\n errorMessage.innerHTML += '<p>' + msg + '</p>';\n if (typeof error !== 'undefined') {\n console.error(error);\n }\n}", "title": "" }, { "docid": "c36de99abbeb04e9668cb69a03078e3f", "score": "0.61196214", "text": "function error(error) {\n console.log(error);\n}", "title": "" }, { "docid": "38f48b2cfeee5ad53a267b1863ff5466", "score": "0.61173606", "text": "function errorLogger(error) {\r\n log('*** Start of Error ***');\r\n log(error);\r\n log('*** End of Error ***');\r\n this.emit('end');\r\n}", "title": "" }, { "docid": "3b0783c60de5c3895e2911239072960b", "score": "0.6116809", "text": "async onError(e) {\n let errors = e.originalEvent.detail[0].errors;\n let message = Object.keys(errors).map(attribute => {\n return errors[attribute].map(error => {\n if (attribute === \"base\") {\n return `${error}`;\n } else {\n return `${capitalize(attribute)} ${error}`;\n }\n });\n }).join(\"; \");\n\n Utility.error(message);\n }", "title": "" }, { "docid": "b6c76bb734b431b33c2f949d41873430", "score": "0.6107198", "text": "function error() {\n var message = concateArgs('[error]', arguments);\n console.error(message);\n queueLog(message);\n\n addCriticalLog(message);\n }", "title": "" }, { "docid": "b65e9081b3561958a18662bbca738edb", "score": "0.6105896", "text": "function onError() {\n const $errorMessage = $(\n `<li class=\"error\"><div ><h3>No matching results</h3></div></li>`\n );\n $errorMessage.appendTo(eventsList);\n}", "title": "" }, { "docid": "c81c674c3d630621aaf70393494c83ea", "score": "0.60995215", "text": "function showEventError(error) {\n $('#create-event-error').text(error)\n $('#create-event-error').show();\n}", "title": "" }, { "docid": "391d765c43bd3f9fec03c3ddf6535447", "score": "0.6094139", "text": "function displayError(err) {\n console.error(err);\n document.getElementById('error-message').innerText = err.message;\n window.scrollTo(0, document.body.scrollHeight);\n}", "title": "" }, { "docid": "ab14d539a5545fd4daacd2bcfcbdfd8d", "score": "0.60933274", "text": "function onError(error) {\n console.log(\"CONNECTION FAILED\");\n connectingElement.textContent = 'Could not connect to WebSocket server. Please refresh this page to try again!';\n connectingElement.style.display = \"block\";\n connectingElement.style.color = 'red';\n}", "title": "" }, { "docid": "2bbba9a762c85670d33a631450b030fc", "score": "0.609023", "text": "_onError(error){\n\t\tthis._setStatus(this.STATUS_STATES.ERRORD);\n\t\tif (error && error.syscall === 'listen') {\n\t\t\tswitch (error.code) {\n\t\t\tcase 'EACCES':\n\t\t\t\tlog.error(`Api Server ({{serverName}}) on Address: requires elevated privileges.`);\n\t\t\t\tthis.shutdown(error,1);\n\t\t\t\tbreak;\n\t\t\tcase 'EADDRINUSE':\n\t\t\t\tlog.error(`Api Server ({{serverName}}) on Address: cannot start port is already in use.`);\n\t\t\t\tthis.shutdown(error,1);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlog.error({error:error},`Api Server ({{serverName}}) internal http server encountered an error.`);\n\t\t\t\tthis.shutdown(error,1);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tthrow error; //this will be caught by the uncaughtException handler see ../index.js\n\t\t}\n\t}", "title": "" }, { "docid": "053a17262e1a40899c00dfa65a54fc7c", "score": "0.6087589", "text": "function errorHandler(error) {\n console.log(error);\n}", "title": "" }, { "docid": "0698b553bed8c3c7c1b56e15e687e8ba", "score": "0.6062648", "text": "addError(context, error) {\n\t\tcontext.commit(\"ADD_ERROR\", error);\n\n\t\tsetTimeout(() => {\n\t\t\tcontext.commit(\"CLEAR_ALERT\")\n\t\t}, 3000);\n\t}", "title": "" }, { "docid": "14679fba6c2aefe9f61ac0590126a43e", "score": "0.6058067", "text": "function outputError(field, messageToOutput, event){\n alert(messageToOutput);\n field.focus();\n event.preventDefault();\n return false;\n}", "title": "" }, { "docid": "5d9325b67e5ced752a47ae71e887515a", "score": "0.60579145", "text": "function printError(error) {\r\n console.error(error.message);\r\n}", "title": "" }, { "docid": "517f8e04d76ef342140c883d2e11cd0a", "score": "0.6051369", "text": "handleError(error) {\n //update output\n this.output.full_text = error;\n this.output.short_text = error;\n\n //emit updated event to i3Status\n this.emit('updated', this, this.output);\n }", "title": "" }, { "docid": "c3fcafdc49eb274fde49e7b560f2426b", "score": "0.604581", "text": "function errorLogger(error) {\n log('*** Start of Error ***');\n log(error);\n log('*** End of Error ***');\n this.emit('end');\n}", "title": "" }, { "docid": "452194926e2326b9d7c2d5b7e6f4bbe5", "score": "0.6040595", "text": "function errorHandler() {\r\n\t\t\r\n document.write( \"There was a problem retrieving the forecast.\" );\r\n \r\n\t\t}", "title": "" }, { "docid": "b164195875a67ec1b8eef2e40b99b85c", "score": "0.6038554", "text": "function error() {\n\t\talert(\"ERROR!\");\n\t}", "title": "" }, { "docid": "b696c45d18c7faedd90a2b1714eb008c", "score": "0.6035379", "text": "function ErrorHandler() {}", "title": "" }, { "docid": "4387008672694a37e599c88038ec095f", "score": "0.6023648", "text": "function printError(error) {\r\n console.error('Problem with request: ' + error.message);\r\n}", "title": "" }, { "docid": "aace255c3c20f6d636c37bfba9b0a179", "score": "0.60166097", "text": "function handleError() {\n let errorText = gen(\"p\");\n errorText.textContent = \"Something went wrong. Please try selecting a year again.\";\n id(\"movie-output\").appendChild(errorText);\n }", "title": "" }, { "docid": "0c7533a68509e9d472255d04d6af0cc7", "score": "0.60090744", "text": "function onerror(error) {\n self.emit(\"error\", error);\n }", "title": "" }, { "docid": "ef6f24fd6b8543da7bf3ce6b58bf5e26", "score": "0.6006221", "text": "function showError(error) {\n console.log('Serial port error: ' + error);\n}", "title": "" }, { "docid": "ef6f24fd6b8543da7bf3ce6b58bf5e26", "score": "0.6006221", "text": "function showError(error) {\n console.log('Serial port error: ' + error);\n}", "title": "" }, { "docid": "ff1e9eda61364efc928248c415ec3bdc", "score": "0.60057974", "text": "function onError(err, info) {\n statusElt.innerText = 'Error: ' + JSON.stringify(err);\n responseElt.parentNode.hidden = true;\n infoElt.parentNode.hidden = false;\n infoElt.value = JSON.stringify(info, undefined, 2);\n}", "title": "" }, { "docid": "ba1f593994aa0afe697ad14a36686bd8", "score": "0.6004403", "text": "function errorHandler(error)\n{\n console.log(error);\n alert(\"Something is wrong with the server! Please try after sometime\");\n}", "title": "" }, { "docid": "453b1a488f0a24c3e70f861dd0bc6a27", "score": "0.6004401", "text": "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n $('#temp').html(`ERROR(${err.code}): ${err.message}`);\n}", "title": "" }, { "docid": "c9e2bf2ae03e3a8b99c5ffc978b0abbc", "score": "0.59949654", "text": "function errorHandler(error)\r\n {\r\n mustCancelOperations = true;\r\n Template.unloadTemplate();\r\n\r\n // Unable to send message to event page (which sets the url),\r\n // or failed fetching local file (url == chrome://).\r\n if (typeof error.url!==\"undefined\" && \r\n error.url===\"\" || \r\n error.url.indexOf(\"chrome\")===0) // 20170214 Axon 2.6.21 FIXME-----------> Error in event handler for (unknown): TypeError: Cannot read property 'indexOf' of undefined\r\n { // at errorHandler (chrome-extension://ncclemcnoahbhleaeplejkppaelipfmk/Content/Main.js:155:22)\r\n error.info = DomHelper.stripHtml(error.info); // at checkForError (chrome-extension://ncclemcnoahbhleaeplejkppaelipfmk/Content/Main.js:242:27)\r\n var msg = error.title + \"\\n\\n\" + error.info; // at wordSearchHandler (chrome-extension://ncclemcnoahbhleaeplejkppaelipfmk/Content/Main.js:326:9)\r\n if (error.url!==\"\") // at chrome-extension://ncclemcnoahbhleaeplejkppaelipfmk/Content/Main.js:318:21\r\n msg += \"\\n\\nRequested URL: \" + error.url; // at Request.updateDictionaryData (chrome-extension://ncclemcnoahbhleaeplejkppaelipfmk/Content/Lib/Request.js:449:9)\r\n console.log(msg); // at chrome-extension://ncclemcnoahbhleaeplejkppaelipfmk/Content/Lib/Request.js:282:35\r\n } // at chrome-extension://ncclemcnoahbhleaeplejkppaelipfmk/Content/Lib/Request.js:156:39\r\n else\r\n {\r\n Template.loadMainTemplate(function() {\r\n var dictionaryData = new DictionaryData();\r\n dictionaryData.definitionText = \"<b>\"+error.title+\"</b><div style='margin:5px 0;'></div>\";\r\n dictionaryData.definitionText += error.info;\r\n // Wiki API error structure: see https://www.mediawiki.org/wiki/API:Errors_and_warnings\r\n if (typeof error[\"*\"] !== \"undefined\") dictionaryData.definitionText += \" \"+error[\"*\"];\r\n Template.Bubble.showAnnotationBubble(dictionaryData, selectedTextPosition);\r\n });\r\n }\r\n }", "title": "" }, { "docid": "b68d33e598c64d52113c5b77ac830c3b", "score": "0.5992651", "text": "function onError(error) {\n self.error('Error: ' + error.status + ' ' + error.statusText);\n }", "title": "" }, { "docid": "181d7a267e70a5052f5f75732e2990c6", "score": "0.59901905", "text": "function onPlayerError(e){\n console.log('ERROR YouTube API \"onPlayerError\"');\n console.log(e);\n}", "title": "" }, { "docid": "984157b62f5d9aaae6a3b98d852ec8d5", "score": "0.59901446", "text": "function errorLogger(error) {\n\t\t\tlog('*** Start of Error ***');\n\t\t\tlog(error);\n\t\t\tlog('*** End of Error ***');\n\t\t\tthis.emit('end');\n\t}", "title": "" }, { "docid": "430044bd8fdb92e59cddec9dd249b472", "score": "0.5988594", "text": "function printError(error){\n console.error(error.message);\n}", "title": "" }, { "docid": "5e57a317bf4235519a86f503b368c50e", "score": "0.59885556", "text": "function err_log(error) {\n\tconsole.error(error);\n\talert(\"Кажеться что-то пошло не так, попробуйте повторить позже...\");\n}", "title": "" }, { "docid": "6986cf5ff4c73d6c1e62eeb8132d9cc1", "score": "0.59871876", "text": "function addJSErrorListener() {\n 'use strict';\n /**\n * Catches JavaScript errors from the editor that bubble up to the\n * window and passes them on to GA\n */\n window.onerror = function(msg, url, lineNo, columnNo, error) {\n var errorDetails = [\n 'URL: ' + url,\n 'Line: ' + lineNo,\n 'Column: ' + columnNo,\n 'Error object: ' + JSON.stringify(error)\n ].join(' - ');\n\n mceAnalytics.trackEvent({\n category: 'Interactive Example - JavaScript Errors',\n action: errorDetails,\n label: msg\n });\n };\n}", "title": "" }, { "docid": "99cc54d8c5c2f310515dc1e90a8be4bc", "score": "0.59867805", "text": "function printError(error){\n console.error(error.message);\n}", "title": "" }, { "docid": "99cc54d8c5c2f310515dc1e90a8be4bc", "score": "0.59867805", "text": "function printError(error){\n console.error(error.message);\n}", "title": "" }, { "docid": "99cc54d8c5c2f310515dc1e90a8be4bc", "score": "0.59867805", "text": "function printError(error){\n console.error(error.message);\n}", "title": "" }, { "docid": "99cc54d8c5c2f310515dc1e90a8be4bc", "score": "0.59867805", "text": "function printError(error){\n console.error(error.message);\n}", "title": "" }, { "docid": "a3ee5a94e71285aa61b180b8b51c6ac7", "score": "0.59849906", "text": "function OnError( msg ) \r\n{ \r\n app.Alert( \"Error: \" + msg ); \r\n console.log( \"Error: \" + msg ); \r\n}", "title": "" } ]
6be1cabb6092a02199274846a54b073e
run other threads synchronously until the blackhole is 'freed' returns true for success, false for failure, a thread blocks
[ { "docid": "6ed997a9c33225b9573effd5507778ed", "score": "0.7165193", "text": "function h$runBlackholeThreadSync(bh) {\n ;\n var ct = h$currentThread;\n var sp = h$sp;\n var success = false;\n var bhs = [];\n var currentBh = bh;\n // we don't handle async exceptions here,\n // don't run threads with pending exceptions\n if(((bh).d1).excep.length > 0) {\n ;\n return false;\n }\n h$currentThread = ((bh).d1);\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n\n\n\n var c = (h$currentThread.status === (0))?h$stack[h$sp]:h$reschedule;\n ;\n try {\n while(true) {\n while(c !== h$reschedule && (typeof (currentBh) === 'object' && (currentBh) && (currentBh).f && (currentBh).f.t === (5))) {\n c = c();\n c = c();\n c = c();\n c = c();\n c = c();\n }\n if(c === h$reschedule) {\n // perhaps new blackhole, then continue with that thread,\n // otherwise fail\n if((typeof (h$currentThread.blockedOn) === 'object' && (h$currentThread.blockedOn) && (h$currentThread.blockedOn).f && (h$currentThread.blockedOn).f.t === (5))) {\n ;\n bhs.push(currentBh);\n currentBh = h$currentThread.blockedOn;\n h$currentThread = ((h$currentThread.blockedOn).d1);\n if(h$currentThread.excep.length > 0) {\n break;\n }\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n\n\n\n c = (h$currentThread.status === (0))?h$stack[h$sp]:h$reschedule;\n } else {\n ;\n break;\n }\n } else { // blackhole updated: suspend thread and pick up the old one\n ;\n ;\n h$suspendCurrentThread(c);\n if(bhs.length > 0) {\n ;\n currentBh = bhs.pop();\n h$currentThread = ((currentBh).d1);\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n\n\n\n } else {\n ;\n success = true;\n break;\n }\n }\n }\n } catch(e) { }\n // switch back to original thread\n h$sp = sp;\n h$stack = ct.stack;\n h$currentThread = ct;\n\n\n\n return success;\n}", "title": "" } ]
[ { "docid": "0cc630c570e4e25c83e0293a98072535", "score": "0.71856076", "text": "function h$runBlackholeThreadSync(bh) {\n ;\n var ct = h$currentThread;\n var sp = h$sp;\n var success = false;\n var bhs = [];\n var currentBh = bh;\n // we don't handle async exceptions here,\n // don't run threads with pending exceptions\n if(((bh).d1).excep.length > 0) {\n ;\n return false;\n }\n h$currentThread = ((bh).d1);\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n var c = (h$currentThread.status === (0))?h$stack[h$sp]:h$reschedule;\n ;\n try {\n while(true) {\n while(c !== h$reschedule && (typeof (currentBh) === 'object' && (currentBh) && (currentBh).f && (currentBh).f.t === (5))) {\n c = c();\n c = c();\n c = c();\n c = c();\n c = c();\n }\n if(c === h$reschedule) {\n // perhaps new blackhole, then continue with that thread,\n // otherwise fail\n if((typeof (h$currentThread.blockedOn) === 'object' && (h$currentThread.blockedOn) && (h$currentThread.blockedOn).f && (h$currentThread.blockedOn).f.t === (5))) {\n ;\n bhs.push(currentBh);\n currentBh = h$currentThread.blockedOn;\n h$currentThread = ((h$currentThread.blockedOn).d1);\n if(h$currentThread.excep.length > 0) {\n break;\n }\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n c = (h$currentThread.status === (0))?h$stack[h$sp]:h$reschedule;\n } else {\n ;\n break;\n }\n } else { // blackhole updated: suspend thread and pick up the old one\n ;\n ;\n h$suspendCurrentThread(c);\n if(bhs.length > 0) {\n ;\n currentBh = bhs.pop();\n h$currentThread = ((currentBh).d1);\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n } else {\n ;\n success = true;\n break;\n }\n }\n }\n } catch(e) { }\n // switch back to original thread\n h$sp = sp;\n h$stack = ct.stack;\n h$currentThread = ct;\n return success;\n}", "title": "" }, { "docid": "0cc630c570e4e25c83e0293a98072535", "score": "0.71856076", "text": "function h$runBlackholeThreadSync(bh) {\n ;\n var ct = h$currentThread;\n var sp = h$sp;\n var success = false;\n var bhs = [];\n var currentBh = bh;\n // we don't handle async exceptions here,\n // don't run threads with pending exceptions\n if(((bh).d1).excep.length > 0) {\n ;\n return false;\n }\n h$currentThread = ((bh).d1);\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n var c = (h$currentThread.status === (0))?h$stack[h$sp]:h$reschedule;\n ;\n try {\n while(true) {\n while(c !== h$reschedule && (typeof (currentBh) === 'object' && (currentBh) && (currentBh).f && (currentBh).f.t === (5))) {\n c = c();\n c = c();\n c = c();\n c = c();\n c = c();\n }\n if(c === h$reschedule) {\n // perhaps new blackhole, then continue with that thread,\n // otherwise fail\n if((typeof (h$currentThread.blockedOn) === 'object' && (h$currentThread.blockedOn) && (h$currentThread.blockedOn).f && (h$currentThread.blockedOn).f.t === (5))) {\n ;\n bhs.push(currentBh);\n currentBh = h$currentThread.blockedOn;\n h$currentThread = ((h$currentThread.blockedOn).d1);\n if(h$currentThread.excep.length > 0) {\n break;\n }\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n c = (h$currentThread.status === (0))?h$stack[h$sp]:h$reschedule;\n } else {\n ;\n break;\n }\n } else { // blackhole updated: suspend thread and pick up the old one\n ;\n ;\n h$suspendCurrentThread(c);\n if(bhs.length > 0) {\n ;\n currentBh = bhs.pop();\n h$currentThread = ((currentBh).d1);\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n } else {\n ;\n success = true;\n break;\n }\n }\n }\n } catch(e) { }\n // switch back to original thread\n h$sp = sp;\n h$stack = ct.stack;\n h$currentThread = ct;\n return success;\n}", "title": "" }, { "docid": "0cc630c570e4e25c83e0293a98072535", "score": "0.71856076", "text": "function h$runBlackholeThreadSync(bh) {\n ;\n var ct = h$currentThread;\n var sp = h$sp;\n var success = false;\n var bhs = [];\n var currentBh = bh;\n // we don't handle async exceptions here,\n // don't run threads with pending exceptions\n if(((bh).d1).excep.length > 0) {\n ;\n return false;\n }\n h$currentThread = ((bh).d1);\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n var c = (h$currentThread.status === (0))?h$stack[h$sp]:h$reschedule;\n ;\n try {\n while(true) {\n while(c !== h$reschedule && (typeof (currentBh) === 'object' && (currentBh) && (currentBh).f && (currentBh).f.t === (5))) {\n c = c();\n c = c();\n c = c();\n c = c();\n c = c();\n }\n if(c === h$reschedule) {\n // perhaps new blackhole, then continue with that thread,\n // otherwise fail\n if((typeof (h$currentThread.blockedOn) === 'object' && (h$currentThread.blockedOn) && (h$currentThread.blockedOn).f && (h$currentThread.blockedOn).f.t === (5))) {\n ;\n bhs.push(currentBh);\n currentBh = h$currentThread.blockedOn;\n h$currentThread = ((h$currentThread.blockedOn).d1);\n if(h$currentThread.excep.length > 0) {\n break;\n }\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n c = (h$currentThread.status === (0))?h$stack[h$sp]:h$reschedule;\n } else {\n ;\n break;\n }\n } else { // blackhole updated: suspend thread and pick up the old one\n ;\n ;\n h$suspendCurrentThread(c);\n if(bhs.length > 0) {\n ;\n currentBh = bhs.pop();\n h$currentThread = ((currentBh).d1);\n h$stack = h$currentThread.stack;\n h$sp = h$currentThread.sp;\n } else {\n ;\n success = true;\n break;\n }\n }\n }\n } catch(e) { }\n // switch back to original thread\n h$sp = sp;\n h$stack = ct.stack;\n h$currentThread = ct;\n return success;\n}", "title": "" }, { "docid": "6e2339ada37b88ecd52e82ab8ab0fecd", "score": "0.6256109", "text": "function h$blockOnBlackhole(c) {\n ;\n if(((c).d1) === h$currentThread) {\n ;\n return h$throw(h$baseZCControlziExceptionziBasezinonTermination, false); // is this an async exception?\n }\n ;\n if(((c).d2) === null) {\n ((c).d2 = ([h$currentThread]));\n } else {\n ((c).d2).push(h$currentThread);\n }\n return h$blockThread(h$currentThread,c,[h$resumeBlockOnBlackhole,c]);\n}", "title": "" }, { "docid": "6e2339ada37b88ecd52e82ab8ab0fecd", "score": "0.6256109", "text": "function h$blockOnBlackhole(c) {\n ;\n if(((c).d1) === h$currentThread) {\n ;\n return h$throw(h$baseZCControlziExceptionziBasezinonTermination, false); // is this an async exception?\n }\n ;\n if(((c).d2) === null) {\n ((c).d2 = ([h$currentThread]));\n } else {\n ((c).d2).push(h$currentThread);\n }\n return h$blockThread(h$currentThread,c,[h$resumeBlockOnBlackhole,c]);\n}", "title": "" }, { "docid": "6e2339ada37b88ecd52e82ab8ab0fecd", "score": "0.6256109", "text": "function h$blockOnBlackhole(c) {\n ;\n if(((c).d1) === h$currentThread) {\n ;\n return h$throw(h$baseZCControlziExceptionziBasezinonTermination, false); // is this an async exception?\n }\n ;\n if(((c).d2) === null) {\n ((c).d2 = ([h$currentThread]));\n } else {\n ((c).d2).push(h$currentThread);\n }\n return h$blockThread(h$currentThread,c,[h$resumeBlockOnBlackhole,c]);\n}", "title": "" }, { "docid": "d30a1ec76614e8f70fc10452da01a829", "score": "0.6254765", "text": "function h$blockOnBlackhole(c) {\n ;\n if(((c).d1) === h$currentThread) {\n ;\n return h$throw(h$baseZCControlziExceptionziBasezinonTermination, false); // is this an async exception?\n }\n ;\n if(((c).d2) === null) {\n ((c).d2 = ([h$currentThread]));\n } else {\n ((c).d2).push(h$currentThread);\n }\n return h$blockThread(h$currentThread,c,[h$resumeBlockOnBlackhole,c]);\n}", "title": "" }, { "docid": "d30a1ec76614e8f70fc10452da01a829", "score": "0.6254765", "text": "function h$blockOnBlackhole(c) {\n ;\n if(((c).d1) === h$currentThread) {\n ;\n return h$throw(h$baseZCControlziExceptionziBasezinonTermination, false); // is this an async exception?\n }\n ;\n if(((c).d2) === null) {\n ((c).d2 = ([h$currentThread]));\n } else {\n ((c).d2).push(h$currentThread);\n }\n return h$blockThread(h$currentThread,c,[h$resumeBlockOnBlackhole,c]);\n}", "title": "" }, { "docid": "d30a1ec76614e8f70fc10452da01a829", "score": "0.6254765", "text": "function h$blockOnBlackhole(c) {\n ;\n if(((c).d1) === h$currentThread) {\n ;\n return h$throw(h$baseZCControlziExceptionziBasezinonTermination, false); // is this an async exception?\n }\n ;\n if(((c).d2) === null) {\n ((c).d2 = ([h$currentThread]));\n } else {\n ((c).d2).push(h$currentThread);\n }\n return h$blockThread(h$currentThread,c,[h$resumeBlockOnBlackhole,c]);\n}", "title": "" }, { "docid": "a63aee4de0885c748218a11c82c82227", "score": "0.5904553", "text": "function h$runSync(a, cont) {\n var t = new h$Thread();\n ;\n h$runSyncAction(t, a, cont);\n if(t.resultIsException) {\n if(t.result instanceof h$WouldBlock) {\n return false;\n } else {\n throw t.result;\n }\n }\n return t.status === (16);\n}", "title": "" }, { "docid": "a63aee4de0885c748218a11c82c82227", "score": "0.5904553", "text": "function h$runSync(a, cont) {\n var t = new h$Thread();\n ;\n h$runSyncAction(t, a, cont);\n if(t.resultIsException) {\n if(t.result instanceof h$WouldBlock) {\n return false;\n } else {\n throw t.result;\n }\n }\n return t.status === (16);\n}", "title": "" }, { "docid": "a63aee4de0885c748218a11c82c82227", "score": "0.5904553", "text": "function h$runSync(a, cont) {\n var t = new h$Thread();\n ;\n h$runSyncAction(t, a, cont);\n if(t.resultIsException) {\n if(t.result instanceof h$WouldBlock) {\n return false;\n } else {\n throw t.result;\n }\n }\n return t.status === (16);\n}", "title": "" }, { "docid": "1bef861c07feb9ab800fc7e22ada3202", "score": "0.5888731", "text": "function h$runSync(a, cont) {\n var t = new h$Thread();\n ;\n h$runSyncAction(t, a, cont);\n if(t.resultIsException) {\n if(t.result instanceof h$WouldBlock) {\n return false;\n } else {\n throw t.result;\n }\n }\n return t.status === (16);\n}", "title": "" }, { "docid": "1bef861c07feb9ab800fc7e22ada3202", "score": "0.5888731", "text": "function h$runSync(a, cont) {\n var t = new h$Thread();\n ;\n h$runSyncAction(t, a, cont);\n if(t.resultIsException) {\n if(t.result instanceof h$WouldBlock) {\n return false;\n } else {\n throw t.result;\n }\n }\n return t.status === (16);\n}", "title": "" }, { "docid": "1bef861c07feb9ab800fc7e22ada3202", "score": "0.5888731", "text": "function h$runSync(a, cont) {\n var t = new h$Thread();\n ;\n h$runSyncAction(t, a, cont);\n if(t.resultIsException) {\n if(t.result instanceof h$WouldBlock) {\n return false;\n } else {\n throw t.result;\n }\n }\n return t.status === (16);\n}", "title": "" }, { "docid": "f459f5f5ba06d1185109608f1b60e756", "score": "0.587685", "text": "function h$resolveDeadlocks() {\n ;\n var kill, t, iter, bo, mark = h$gcMark;\n do {\n h$markWeaks();\n // deal with unreachable blocked threads: kill an unreachable thread and restart the process\n kill = null;\n iter = h$blocked.iter();\n while((t = iter.next()) !== null) {\n // we're done if the thread is already reachable\n if(((typeof t.m === 'number' && (t.m & 3) === mark) || (typeof t.m === 'object' && ((t.m.m & 3) === mark)))) continue;\n\n // check what we're blocked on\n bo = t.blockedOn;\n if(bo instanceof h$MVar) {\n // blocked on MVar\n if(bo.m === mark) throw \"assertion failed: thread should have been marked\";\n // MVar unreachable\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnMVar;\n break;\n } else if(t.blockedOn instanceof h$TVarsWaiting) {\n // blocked in STM transaction\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnSTM;\n break;\n } else {\n // blocked on something else, we can't do anything\n }\n }\n if(kill) {\n h$killThread(t, kill);\n h$markThread(t);\n }\n } while(kill);\n}", "title": "" }, { "docid": "f459f5f5ba06d1185109608f1b60e756", "score": "0.587685", "text": "function h$resolveDeadlocks() {\n ;\n var kill, t, iter, bo, mark = h$gcMark;\n do {\n h$markWeaks();\n // deal with unreachable blocked threads: kill an unreachable thread and restart the process\n kill = null;\n iter = h$blocked.iter();\n while((t = iter.next()) !== null) {\n // we're done if the thread is already reachable\n if(((typeof t.m === 'number' && (t.m & 3) === mark) || (typeof t.m === 'object' && ((t.m.m & 3) === mark)))) continue;\n\n // check what we're blocked on\n bo = t.blockedOn;\n if(bo instanceof h$MVar) {\n // blocked on MVar\n if(bo.m === mark) throw \"assertion failed: thread should have been marked\";\n // MVar unreachable\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnMVar;\n break;\n } else if(t.blockedOn instanceof h$TVarsWaiting) {\n // blocked in STM transaction\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnSTM;\n break;\n } else {\n // blocked on something else, we can't do anything\n }\n }\n if(kill) {\n h$killThread(t, kill);\n h$markThread(t);\n }\n } while(kill);\n}", "title": "" }, { "docid": "f459f5f5ba06d1185109608f1b60e756", "score": "0.587685", "text": "function h$resolveDeadlocks() {\n ;\n var kill, t, iter, bo, mark = h$gcMark;\n do {\n h$markWeaks();\n // deal with unreachable blocked threads: kill an unreachable thread and restart the process\n kill = null;\n iter = h$blocked.iter();\n while((t = iter.next()) !== null) {\n // we're done if the thread is already reachable\n if(((typeof t.m === 'number' && (t.m & 3) === mark) || (typeof t.m === 'object' && ((t.m.m & 3) === mark)))) continue;\n\n // check what we're blocked on\n bo = t.blockedOn;\n if(bo instanceof h$MVar) {\n // blocked on MVar\n if(bo.m === mark) throw \"assertion failed: thread should have been marked\";\n // MVar unreachable\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnMVar;\n break;\n } else if(t.blockedOn instanceof h$TVarsWaiting) {\n // blocked in STM transaction\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnSTM;\n break;\n } else {\n // blocked on something else, we can't do anything\n }\n }\n if(kill) {\n h$killThread(t, kill);\n h$markThread(t);\n }\n } while(kill);\n}", "title": "" }, { "docid": "5162b1a8dc73f1ce35ff538dbf07d6f3", "score": "0.57916886", "text": "function h$resolveDeadlocks() {\n ;\n var kill, t, iter, bo, mark = h$gcMark;\n do {\n h$markWeaks();\n // deal with unreachable blocked threads: kill an unreachable thread and restart the process\n kill = null;\n iter = h$blocked.iter();\n while((t = iter.next()) !== null) {\n // we're done if the thread is already reachable\n if(((typeof t.m === 'number' && (t.m & 3) === mark) || (typeof t.m === 'object' && ((t.m.m & 3) === mark)))) continue;\n // check what we're blocked on\n bo = t.blockedOn;\n if(bo instanceof h$MVar) {\n // blocked on MVar\n if(bo.m === mark) throw \"assertion failed: thread should have been marked\";\n // MVar unreachable\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnMVar;\n break;\n } else if(t.blockedOn instanceof h$TVarsWaiting) {\n // blocked in STM transaction\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnSTM;\n break;\n } else {\n // blocked on something else, we can't do anything\n }\n }\n if(kill) {\n h$killThread(t, kill);\n h$markThread(t);\n }\n } while(kill);\n}", "title": "" }, { "docid": "5162b1a8dc73f1ce35ff538dbf07d6f3", "score": "0.57916886", "text": "function h$resolveDeadlocks() {\n ;\n var kill, t, iter, bo, mark = h$gcMark;\n do {\n h$markWeaks();\n // deal with unreachable blocked threads: kill an unreachable thread and restart the process\n kill = null;\n iter = h$blocked.iter();\n while((t = iter.next()) !== null) {\n // we're done if the thread is already reachable\n if(((typeof t.m === 'number' && (t.m & 3) === mark) || (typeof t.m === 'object' && ((t.m.m & 3) === mark)))) continue;\n // check what we're blocked on\n bo = t.blockedOn;\n if(bo instanceof h$MVar) {\n // blocked on MVar\n if(bo.m === mark) throw \"assertion failed: thread should have been marked\";\n // MVar unreachable\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnMVar;\n break;\n } else if(t.blockedOn instanceof h$TVarsWaiting) {\n // blocked in STM transaction\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnSTM;\n break;\n } else {\n // blocked on something else, we can't do anything\n }\n }\n if(kill) {\n h$killThread(t, kill);\n h$markThread(t);\n }\n } while(kill);\n}", "title": "" }, { "docid": "5162b1a8dc73f1ce35ff538dbf07d6f3", "score": "0.57916886", "text": "function h$resolveDeadlocks() {\n ;\n var kill, t, iter, bo, mark = h$gcMark;\n do {\n h$markWeaks();\n // deal with unreachable blocked threads: kill an unreachable thread and restart the process\n kill = null;\n iter = h$blocked.iter();\n while((t = iter.next()) !== null) {\n // we're done if the thread is already reachable\n if(((typeof t.m === 'number' && (t.m & 3) === mark) || (typeof t.m === 'object' && ((t.m.m & 3) === mark)))) continue;\n // check what we're blocked on\n bo = t.blockedOn;\n if(bo instanceof h$MVar) {\n // blocked on MVar\n if(bo.m === mark) throw \"assertion failed: thread should have been marked\";\n // MVar unreachable\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnMVar;\n break;\n } else if(t.blockedOn instanceof h$TVarsWaiting) {\n // blocked in STM transaction\n kill = h$ghcjszmprimZCGHCJSziPrimziInternalziblockedIndefinitelyOnSTM;\n break;\n } else {\n // blocked on something else, we can't do anything\n }\n }\n if(kill) {\n h$killThread(t, kill);\n h$markThread(t);\n }\n } while(kill);\n}", "title": "" }, { "docid": "586662553a72bb0a67dd16740fe93e4c", "score": "0.56790215", "text": "doBlockingWork(time) {}", "title": "" }, { "docid": "07add6d2e761697b94e1c024828ee18b", "score": "0.5648063", "text": "async function run() {\n let attempt = 0;\n\n while (attempt < 25) {\n try {\n let ready = await check_readiness();\n\n if (!ready) break;\n } catch(e) {\n }\n\n await sleep(10000);\n\n attempt++;\n }\n}", "title": "" }, { "docid": "43cf2c2045210a3b7d8ff3996cb9c5e4", "score": "0.54757965", "text": "function mainLoop() {\n var toConnect = stats.pending;\n if(toConnect > 0)\n {\n for(var i=0;i<toConnect;i++) {\n --stats.pending;\n connectOne(i);\n }\n }\n}", "title": "" }, { "docid": "d490d1273f16894fa57ef5452af9371d", "score": "0.540921", "text": "function waiting() { return (wait > 0) ? !wait-- : true; }", "title": "" }, { "docid": "8f6fc3926509acf656966c093b419e28", "score": "0.53832424", "text": "_loop () {\n if (!this.isRunning) {\n this.logger.warn('Not running, so exiting loop');\n \n return;\n }\n\n // if not connected\n if (!this.isConnected) {\n this.logger.warn('Connection lost, waiting for connection');\n \n return this._waitForConnection();\n }\n \n new Promise((resolve) => {\n const numBlocks = this._blocks.length;\n \n if (!numBlocks) {\n return resolve();\n }\n \n this.logger.info(`Got ${numBlocks} block(s) to process`);\n \n // remove blocks from backlog array\n const blockIds = this._blocks.splice(0, numBlocks);\n \n let __nextBlock = () => {\n if (!blockIds.length) {\n return resolve();\n }\n \n this._processBlock(blockIds.shift()).then(__nextBlock);\n };\n __nextBlock();\n \n })\n .then(() => {\n if (!this.isRunning) {\n this.logger.warn('Not running, so exiting loop');\n \n return;\n }\n \n this._loopTimeout = setTimeout(this._loop, this.loopInterval);\n }); \n }", "title": "" }, { "docid": "de6302377e50892541d6956be35caac3", "score": "0.5267819", "text": "isFinished() {\n return this.cpuTimeNeeded === 0 && this.blockingTimeNeeded === 0;\n }", "title": "" }, { "docid": "fbf62b7a48cae843785753c55507e45a", "score": "0.5240257", "text": "function run() {\n var done, k = 0;\n while (++k < 50 && !(done = exploreFrontier()));\n return done;\n}", "title": "" }, { "docid": "fd7ac32b0b2800a8a11a7d71013d4b00", "score": "0.5226588", "text": "function waitingFlag()\n{\n dis_wait = false;\n}", "title": "" }, { "docid": "f1bfc0e7e5d8b34f2bc3c8fdfbb8fc07", "score": "0.52237064", "text": "function flush() {\n release();\n\n var task = undefined;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "9a980999e68cd2a9cf7cc7c0be3c4a53", "score": "0.5220967", "text": "function workLoopSync() {\n\t // Already timed out, so perform work without checking if we need to yield.\n\t while (workInProgress !== null) {\n\t workInProgress = performUnitOfWork(workInProgress);\n\t }\n\t}", "title": "" }, { "docid": "7e7631688c94fb8c6f88dc77b09492c9", "score": "0.52134013", "text": "function drain(){\n async = false;\n while(true){\n settled = false;\n if(action) asyncContext = action.context;\n if(action = nextCold()){\n cancel = future._interpret(exception, rejected, resolved);\n if(!settled) warmupActions();\n }else if(action = nextHot()){\n cancel = future._interpret(exception, rejected, resolved);\n }else break;\n if(settled) continue;\n async = true;\n return;\n }\n cancel = future._interpret(exception, rej, res);\n }", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5198138", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5198138", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5198138", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5198138", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5198138", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5198138", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5198138", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "3a6ea67f1d5f420eb89cee58fd7fd8d1", "score": "0.5178853", "text": "function h$forceWakeupThread(t) {\n ;\n if(t.status === (1)) {\n h$removeThreadBlock(t);\n h$wakeupThread(t);\n }\n}", "title": "" }, { "docid": "3a6ea67f1d5f420eb89cee58fd7fd8d1", "score": "0.5178853", "text": "function h$forceWakeupThread(t) {\n ;\n if(t.status === (1)) {\n h$removeThreadBlock(t);\n h$wakeupThread(t);\n }\n}", "title": "" }, { "docid": "3a6ea67f1d5f420eb89cee58fd7fd8d1", "score": "0.5178853", "text": "function h$forceWakeupThread(t) {\n ;\n if(t.status === (1)) {\n h$removeThreadBlock(t);\n h$wakeupThread(t);\n }\n}", "title": "" }, { "docid": "c8e96c5a3188645adc388425bfe30618", "score": "0.51685965", "text": "function flush() {\n release();\n var task = void 0;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "d65265ab8704698791888365f5be0c30", "score": "0.5166421", "text": "function flush() {\n release();\n var task;\n \n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n }", "title": "" }, { "docid": "c7a5a7a3cfae7a35d99986ea85518a5c", "score": "0.5162703", "text": "function h$forceWakeupThread(t) {\n ;\n if(t.status === (1)) {\n h$removeThreadBlock(t);\n h$wakeupThread(t);\n }\n}", "title": "" }, { "docid": "c7a5a7a3cfae7a35d99986ea85518a5c", "score": "0.5162703", "text": "function h$forceWakeupThread(t) {\n ;\n if(t.status === (1)) {\n h$removeThreadBlock(t);\n h$wakeupThread(t);\n }\n}", "title": "" }, { "docid": "c7a5a7a3cfae7a35d99986ea85518a5c", "score": "0.5162703", "text": "function h$forceWakeupThread(t) {\n ;\n if(t.status === (1)) {\n h$removeThreadBlock(t);\n h$wakeupThread(t);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "cbe150b25ab23f680b584bf15443c29a", "score": "0.5153245", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "5e4e5763bb3b7134319122f9e4766080", "score": "0.514916", "text": "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "5e4e5763bb3b7134319122f9e4766080", "score": "0.514916", "text": "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.51447815", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "52b5f3b4670294b73a4b832f0d1339f7", "score": "0.5143459", "text": "function check(callback){\n if (acquired < 4){\n acquired+=2;\n callback();\n } else\n waiting.push(callback);\n }", "title": "" }, { "docid": "c2901d290da2f59cb8f74766c53d120b", "score": "0.5136671", "text": "async function lock_immediately()\n {\n try { await browser.bookmarks.removeTree(pop_front().id); }\n finally { events.emitEvent(\"lock\"); }\n }", "title": "" }, { "docid": "d89dbb113151381d881714ea7142654c", "score": "0.5134994", "text": "run() {\n setInterval(() => {\n this.checkCollisions();\n }, 1000 / 25);\n setInterval(() => {\n this.checkThrowObjects();\n }, 200);\n }", "title": "" }, { "docid": "c9a2fcbe98ea512139c64f1b0afde3d1", "score": "0.5133886", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d23e8ef0b269ca638ec3635dd4130f99", "score": "0.5128147", "text": "async function shareLoop () {\n\n isLooping = true;\n\n const sleep = (milliseconds) => {\n return new Promise(resolve => setInterval(resolve, milliseconds))\n }\n\n //main counter variable to mark the current iterration\n var i = 0;\n\n var currentEl = document.getElementsByClassName('tile');\n\n var endCycle = false;\n\n //share loop that continues firing until \"active\" returns false\n async function doSomething() {\n while (active === true) {\n\n var captchaEl = document.getElementById(\"captcha-popup\");\n\n //stop share loop if captcha appears, pause main share loop\n //until captcha is cleared\n if (captchaEl) {\n if (captchaEl.style.display == 'block') {\n endCycle = true;\n\n var isCaptcha = false;\n \n const testCaptcha = async () => {\n \n isCaptcha = true;\n\n while (isCaptcha) {\n await sleep(3000);\n if (captchaEl.style.display == 'none') {\n isCaptcha = false;\n break;\n }\n }\n }\n const captchaContinue = () => {\n endCycle = false;\n }\n await testCaptcha().then(captchaContinue);\n }\n }\n\n var totalEls = currentEl.length;\n\n listingsConfirm();\n\n async function statusChecker() {\n\n //sets delay speed to input\n speed = 4000;\n\n //just for kicks, and to make it obvious which one is selected\n if (currentEl[i]) {\n currentEl[i].style.boxShadow = selectedStyle\n } else {\n //if there is no element selected, end the cycle\n endCycle = true;\n isLooping = false;\n active = false;\n btnDisplay(active);\n return false; \n }\n\n //put this somewhere that will trigger or not trigger the loop\n //depending on which condition is selected by the user in the UI\n let thisItem = currentEl[i].querySelector('i');\n\n if (thisItem.classList.contains('sold-tag') == false &&\n thisItem.classList.contains('not-for-sale-tag') == false) {\n document.getElementsByClassName('share')[i].click();\n //delay for slowing down the process until a promise can be\n //implimented to confirm the 'share' element was clicked\n //after waiting, fire sharePopupFunction() to select where to share\n await sleep(800).then(sharePopupFunction());\n } else {\n //slows delay speed to skip through faster\n speed = 300;\n }\n }\n\n //selects share link based on which itteration of the loop(i) is\n //currently selected. Forces popup window with option to share to\n //followers or party\n if (i < totalListings && i < totalEls && endCycle === false) {\n statusChecker();\n } else if ((i <= totalListings || i <= totalEls) && continuous === true && endCycle === false) {\n i = 0;\n statusChecker(); \n } else {\n endCycle = true;\n --i;\n }\n\n i++;\n await sleep(speed);\n \n //remove \"selected\" style from previous element\n if (endCycle === false) {\n currentEl[i - 1].style.boxShadow = \"none\";\n } else if (endCycle === true && active === true) {\n currentEl[i - 1].style.boxShadow = \"none\";\n active = false;\n running = false;\n btnDisplay(active)\n }\n //indicator that the loop is no longer running, and it's safe to \n //start a new iteration \n isLooping = false;\n }\n //^this marks the end of the \"while\" loop\n }\n //initiates share loop\n doSomething();\n}", "title": "" }, { "docid": "107d3716a3b078b2bc28a11f0c1d36d2", "score": "0.5124506", "text": "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n }", "title": "" }, { "docid": "9c8049ae6b22735bfa587030b74f092a", "score": "0.51188666", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "5ca5998d1408331d49ac585dd38e782c", "score": "0.5104045", "text": "_wait() {}", "title": "" }, { "docid": "ac7b3208c68d5bf17c4f28d4bfb1c54a", "score": "0.50965786", "text": "async function check() {\n self._check();\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5095544", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5095544", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5095544", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" } ]
f0b4e657a6ed1b5b10f049df551c6515
Juuston animointi koko: cheese 260 x 130 kuvia: 2
[ { "docid": "d2a3a796c0e75ab140e7a04596d2bb66", "score": "0.0", "text": "function cheeseDrawingDelay () {\n\tif (timeC == 10) {\n\t\tif (delayC == 1) {\n\t\t\tcheese.srcX = 0;\n\t\t\t//console.log(\"1\");\n\t\t} else if (delayC == 2) {\n\t\t\tcheese.srcX = 130;\n\t\t\tdelayC = 0;\n\t\t\t//console.log(\"2\");\n\t\t} \n\t\ttimeC = 0;\n\t\tdelayC++;\n\t\t//console.log(delayC);\n\t}\n\ttimeC++;\n}", "title": "" } ]
[ { "docid": "d7f9cd2a7b6818789a0b3f133320b473", "score": "0.6228302", "text": "function dugme11(){//trazim magijska stvorenja u zamku i duhove\r\n gryffindorpts+=10;\r\n slytherinpts+=0;\r\n hufflepuffpts+=50;\r\n ravenclawpts+=40;\r\n ispisiPoene();\r\n pitanje1nestaje();\r\n}", "title": "" }, { "docid": "457a77b4c9a77fea50e96fe9fb279681", "score": "0.6065761", "text": "function precioSandwich(tomate,papa,huevo) {\n let precioBase = 150;\n let precioFinal = precioBase;\n let ingredientes = [\"tomate\", \"papa\", \"huevo\"];\n\n for (let i = 0; i < ingredientes.length; i++) {\n const elemento = ingredientes[i];\n switch (elemento) {\n case \"tomate\":\n tomate ? precioFinal += 20 : precioFinal;\n break;\n case \"papa\":\n papa ? precioFinal += 50 : precioFinal;\n break;\n default:\n huevo ? precioFinal += 60 : precioFinal;\n } \n }\n\n return \"El precio final del sandwich es $\" + precioFinal;\n}", "title": "" }, { "docid": "b13c3e7bfd544ae07e89841a1b4d684b", "score": "0.60594463", "text": "function dugme71(){// grif\r\n gryffindorpts+=70;\r\n slytherinpts+=10;\r\n hufflepuffpts+=10;\r\n ravenclawpts+=10;\r\n ispisiPoene();\r\n pitanje7nestaje();\r\n}", "title": "" }, { "docid": "af4098854f954a92c19288587061ee36", "score": "0.59667516", "text": "function dugme41(){// stvorenja\r\n gryffindorpts+=40;\r\n slytherinpts+=30;\r\n hufflepuffpts+=40;\r\n ravenclawpts+=0;\r\n ispisiPoene();\r\n pitanje4nestaje();\r\n}", "title": "" }, { "docid": "014eaef916e4ed9e2702d2ce7b3dbc3c", "score": "0.5870445", "text": "function sixteenthNote(attack) {\n return $(\"#main\").position().left + attack / 16 * $(\"#main\").width();\n }", "title": "" }, { "docid": "dab59c5c62aad4bcd3f484af8a2250c8", "score": "0.58305025", "text": "function ws_seven(t, e, i) {\n function a(t, e) {\n return Math.abs((e % 2 ? 1 : 0) + (e - e % 2) / 2 - t) / e\n }\n\n function n(t, e, i, a) {\n var n = e >= a ? a / e : 1,\n o = t >= i ? i / t : 1;\n return {\n l: o,\n t: n,\n m: Math.min(o, n)\n }\n }\n\n function o(t, e, i, o, r) {\n \tdebugger\n var s = M.width(),\n h = M.height(),\n c = l * s / f,\n w = l * h / g,\n u = p * (o ? 4 : 5) / (f * g),\n m = o ? \"easeInExpo\" : \"easeOutQuart\",\n v = T.h + T.t - h / g,\n x = T.w + T.l - s / f,\n b = M.offset().top + M.height(),\n y = M.offset().left + M.width();\n console.log('s:'+s+';h:'+h+';c:'+c+';w:'+w+';u:'+u+';m:'+m+';v:'+v+';x:'+x+';b:'+b+';y:'+y+';l:'+l+';g:'+g);\n\n return b > v && (v = b), y > x && (x = y), d(t).each(function(t) {\n var e = t % f, //行\n r = Math.floor(t / f), //列\n b = .2 * p * (45 * a(e, f) + 4 * r) / (f * g),\n y = M.offset().left + T.l + c * e - s * l / 2 + c,\n I = M.offset().top + T.t + w * r - h * l / 2 + w,\n z = n(y, I, x, v),\n C = {\n opacity: 1,\n left: s * e / f,\n top: h * r / g,\n width: s / f,\n height: h / g,\n zIndex: Math.ceil(100 - 100 * a(e, f))\n },\n E = {\n opacity: 0,\n left: (c * e - s * l / 2) * z.l,\n top: (w * r - h * l / 2) * z.t,\n width: c * z.m,\n height: w * z.m\n },\n L = {\n left: -(s * e / f) + i.marginLeft,\n top: -(h * r / g) + i.marginTop,\n width: i.width,\n height: i.height\n },\n Q = {\n left: -l * (s / f * e - i.marginLeft) * z.m,\n top: -l * (h / g * r - i.marginTop) * z.m,\n width: l * i.width * z.m,\n height: l * i.height * z.m\n };\n if (!o) {\n var _ = C;\n C = E, E = _, _ = L, L = Q, Q = _\n }\n console.log('e:'+e+';r:'+r+';b:'+b+';y:'+y+';z:'+z+';C:'+C+';El:'+E.left+';ET:'+E.top+';Ll:'+L.left+';LT:'+L.top+';l:'+l+';g:'+g);\n d(this).css(C).delay(b).animate(E, u, m, o ? function() {\n d(this).hide()\n } : {}), d(this).find(\"img\").css(L).delay(b).animate(Q, u, m)\n }), o && (d(e).each(function(t) {\n debugger\n var e = t % f,\n n = Math.floor(t / f),\n o = .2 * p + .15 * p * (35 * a(e, f) + 4 * n) / (f * g);\n d(this).css({\n left: s / 2,\n top: h / 2,\n width: 0,\n height: 0,\n zIndex: Math.ceil(100 - 100 * a(e, f))\n }).delay(o).animate({\n left: s * e / f,\n top: h * n / g,\n width: s / f + 1,\n height: h / g + 1\n }, 4 * p / (f * g), \"easeOutBack\"), d(this).find(\"img\").css({\n left: 0,\n top: 0,\n width: 0,\n height: 0\n }).delay(o).animate({\n left: -s * e / f + i.marginLeft,\n top: -h * n / g + i.marginTop,\n width: i.width,\n height: i.height\n }, 4 * p / (f * g), \"easeOutBack\")\n }), I.delay(.1 * p).animate({\n opacity: 1\n }, .2 * p, \"easeInCirc\")), setTimeout(r, o ? .5 * p : .4 * p), {\n stop: function() {\n r()\n }\n }\n }\n\n function r(t, e, i, a) {\n debugger\n var n = (parseInt(t.parent().css(\"z-index\")) || 0) + 1;\n if (y) {\n var o = a.getContext(\"2d\");\n return o.drawImage(t.get(0), 0, 0, e.width, e.height), s(o, 0, 0, a.width, a.height, i) ? d(a) : 0\n }\n for (var r = d(\"<div></div>\").css({\n position: \"absolute\",\n \"z-index\": n,\n left: 0,\n top: 0,\n overflow: \"hidden\"\n }).css(e).appendTo(x), h = (Math.sqrt(5) + 1) / 2, c = 1 - h / 2, l = 0; i > c * l; l++) {\n var f = Math.PI * h * l,\n g = c * l + 1,\n p = g * Math.cos(f),\n w = g * Math.sin(f);\n d(document.createElement(\"img\")).attr(\"src\", t.attr(\"src\")).css({\n opacity: 1 / (l / 1.8 + 1),\n position: \"absolute\",\n \"z-index\": n,\n left: Math.round(p) + \"px\",\n top: Math.round(w) + \"px\",\n width: \"100%\",\n height: \"100%\"\n }).appendTo(r)\n }\n return r\n }\n\n function s(t, e, i, a, n, o) {\n if (!(isNaN(o) || 1 > o)) {\n o |= 0;\n var r;\n try {\n r = t.getImageData(e, i, a, n)\n } catch (s) {\n return console.log(\"error:unable to access image data: \" + s), !1\n }\n var d, c, l, f, g, p, w, u, m, v, x, b, y, M, I, T, z, L, Q, _, O = r.data,\n j = o + o + 1,\n D = a - 1,\n k = n - 1,\n q = o + 1,\n A = q * (q + 1) / 2,\n B = new h,\n F = B;\n for (l = 1; j > l; l++)\n if (F = F.next = new h, l == q) var N = F;\n F.next = B;\n var P = null,\n G = null;\n w = p = 0;\n var H = C[o],\n J = E[o];\n for (c = 0; n > c; c++) {\n for (M = I = T = u = m = v = 0, x = q * (z = O[p]), b = q * (L = O[p + 1]), y = q * (Q = O[p + 2]), u += A * z, m += A * L, v += A * Q, F = B, l = 0; q > l; l++) F.r = z, F.g = L, F.b = Q, F = F.next;\n for (l = 1; q > l; l++) f = p + ((l > D ? D : l) << 2), u += (F.r = z = O[f]) * (_ = q - l), m += (F.g = L = O[f + 1]) * _, v += (F.b = Q = O[f + 2]) * _, M += z, I += L, T += Q, F = F.next;\n for (P = B, G = N, d = 0; a > d; d++) O[p] = u * H >> J, O[p + 1] = m * H >> J, O[p + 2] = v * H >> J, u -= x, m -= b, v -= y, x -= P.r, b -= P.g, y -= P.b, f = w + ((f = d + o + 1) < D ? f : D) << 2, M += P.r = O[f], I += P.g = O[f + 1], T += P.b = O[f + 2], u += M, m += I, v += T, P = P.next, x += z = G.r, b += L = G.g, y += Q = G.b, M -= z, I -= L, T -= Q, G = G.next, p += 4;\n w += a\n }\n for (d = 0; a > d; d++) {\n for (I = T = M = m = v = u = 0, p = d << 2, x = q * (z = O[p]), b = q * (L = O[p + 1]), y = q * (Q = O[p + 2]), u += A * z, m += A * L, v += A * Q, F = B, l = 0; q > l; l++) F.r = z, F.g = L, F.b = Q, F = F.next;\n for (g = a, l = 1; o >= l; l++) p = g + d << 2, u += (F.r = z = O[p]) * (_ = q - l), m += (F.g = L = O[p + 1]) * _, v += (F.b = Q = O[p + 2]) * _, M += z, I += L, T += Q, F = F.next, k > l && (g += a);\n for (p = d, P = B, G = N, c = 0; n > c; c++) f = p << 2, O[f] = u * H >> J, O[f + 1] = m * H >> J, O[f + 2] = v * H >> J, u -= x, m -= b, v -= y, x -= P.r, b -= P.g, y -= P.b, f = d + ((f = c + q) < k ? f : k) * a << 2, u += M += P.r = O[f], m += I += P.g = O[f + 1], v += T += P.b = O[f + 2], P = P.next, x += z = G.r, b += L = G.g, y += Q = G.b, M -= z, I -= L, T -= Q, G = G.next, p += a\n }\n return t.putImageData(r, e, i), !0\n }\n }\n\n function h() {\n this.r = 0, this.g = 0, this.b = 0, this.a = 0, this.next = null\n }\n var d = jQuery,\n c = d(this),\n l = t.distance || 5,\n f = t.cols,\n g = t.rows,\n p = 2 * t.duration,\n w = t.blur || 50,\n u = (i.find(\".ws_list\"), []),\n m = [],\n v = d(\"<div>\").css({\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n overflow: t.responsive > 1 ? \"hidden\" : \"visible\"\n }),\n x = v.clone().css(\"overflow\", \"hidden\");\n v.addClass(\"ws_effect\"), i = i.parent();\n var b, y = !t.noCanvas && !window.opera && !!document.createElement(\"canvas\").getContext,\n M = d(\"<div>\").addClass(\"ws_parts\"),\n I = d(\"<div>\").addClass(\"ws_zoom\");\n v.append(M, I, x).appendTo(i);\n var T = {\n t: d(window).scrollTop(),\n l: d(window).scrollLeft(),\n w: d(window).width(),\n h: d(window).height()\n };\n jQuery.extend(jQuery.easing, {\n easeOutQuart: function(t, e, i, a, n) {\n return -a * ((e = e / n - 1) * e * e * e - 1) + i\n },\n easeInExpo: function(t, e, i, a, n) {\n return 0 == e ? i : a * Math.pow(2, 10 * (e / n - 1)) + i\n },\n easeInCirc: function(t, e, i, a, n) {\n return -a * (Math.sqrt(1 - (e /= n) * e) - 1) + i\n }\n });\n var z;\n this.go = function(a, n) {\n \tdebugger\n if (z) return n;\n var s = 0 == n && a != n + 1 || a == n - 1 ? !1 : !0;\n T.t = d(window).scrollTop(), T.l = d(window).scrollLeft(), T.w = d(window).width(), T.h = d(window).height();\n var h = Math.max((t.width || M.width()) / (t.height || M.height()) || 3, 3);\n f = f || Math.round(1 > h ? 3 : 3 * h), g = g || Math.round(1 > h ? 3 / h : 3);\n var l = d(e.get(n));\n l = {\n width: l.width(),\n height: l.height(),\n marginTop: parseFloat(l.css(\"marginTop\")),\n marginLeft: parseFloat(l.css(\"marginLeft\"))\n }, M.css({\n position: \"absolute\",\n width: i.width(),\n height: i.height(),\n left: 0,\n top: 0,\n zIndex: 8,\n transform: \"translate3d(0,0,0)\"\n }), I.css({\n position: \"absolute\",\n width: i.width(),\n height: i.height(),\n top: 0,\n left: 0,\n zIndex: 2,\n transform: \"translate3d(0,0,0)\"\n });\n for (var p = 0; f * g > p; p++) {\n {\n Math.floor(p / f)\n }\n d(u[p] = document.createElement(\"div\")).css({\n position: \"absolute\",\n overflow: \"hidden\",\n transform: \"translate3d(0,0,0)\"\n }).appendTo(M).append(d(\"<img>\").css({\n position: \"absolute\",\n transform: \"translate3d(0,0,0)\"\n }).attr(\"src\", e.get(s ? n : a).src)), s && d(m[p] = document.createElement(\"div\")).css({\n position: \"absolute\",\n overflow: \"hidden\",\n transform: \"translate3d(0,0,0)\"\n }).appendTo(I).append(d(\"<img>\").css({\n position: \"absolute\",\n transform: \"translate3d(0,0,0)\"\n }).attr(\"src\", e.get(a).src))\n }\n u = d(u), s && (m = d(m));\n var C = 0;\n if (s) {\n if (I.css(\"opacity\", 0), y) {\n try {\n document.createElement(\"canvas\").getContext(\"2d\").getImageData(0, 0, 1, 1)\n } catch (E) {\n y = 0\n }\n b = '<canvas width=\"' + v.width + '\" height=\"' + v.height + '\"/>', b = d(b).css({\n \"z-index\": 1,\n position: \"absolute\",\n left: 0,\n top: 0\n }).css(l).appendTo(x), C = r(d(e.get(n)), l, w, b.get(0))\n }\n y && C || (y = 0, C = r(d(e.get(n)), l, 8), b && (b.remove(), b = 0))\n } else I.append(d(\"<img>\").css({\n position: \"absolute\",\n top: 0,\n left: 0\n }).css(l).attr(\"src\", e.get(n).src));\n z = new o(u, m, l, s, function() {\n c.trigger(\"effectEnd\"), M.empty().removeAttr(\"style\"), I.empty().removeAttr(\"style\"), b ? b.remove() : C && C.remove(), z = 0\n })\n };\n var C = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259],\n E = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24]\n}", "title": "" }, { "docid": "08c07aab8eb157d18a9251e15a056313", "score": "0.5799707", "text": "function initStage010(stage){\r\n\r\nvar item;\r\n\r\n// Percent of one unit. if you want to change unit size, change this.\r\nvar u=8;\r\n\r\n/////Animation Parameter/////\r\n//\r\n//dsp :display (true/false) startIndex.... display or hide\r\n//x : position x (percent)\r\n//y : position y (percent)\r\n//w : width (percent)\r\n//h : height (percent)\r\n//bgc : background-color\r\n//bdc : border-color\r\n//img : background-image (filename)\r\n//opc : opacity (0.0....1.0) default=1.0\r\n//z : z-index (default=2)\r\n//wd : character of word\r\n\r\n//Answer String\r\n//helper original string=hhhkkw\"word jump\"jjlljjb\"now\"b\"back \"jj$\"move tail\"jljj^\"  mv head\"j\r\nstage.setAnsStr(\"hhhkkwjjlljjbbjj$jljj^j\");\r\nitem=stage.createNewItem();\r\n\r\n//class name\r\nitem.setName(\"vimrio\");\r\n\r\n//frame offset. default startindex=0\r\nitem.setFrameStartIndex(0);\r\nstage.addItem(item);\r\n\r\n//first frame\r\n//1 start\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":3*u,\"w\":u,\"h\":u,\"bgc\":\"transparent\",\"bdc\":\"blue\",\"img\":\"vimrio01.png\",\"z\":5,\"opc\":1.0,\"wd\":\"\"});\r\n//following next frames\r\n\r\n//2 h\r\nitem.addAnimation({\"x\":4*u});\r\n//3 h\r\nitem.addAnimation({\"x\":3*u});\r\n//4 h\r\nitem.addAnimation({\"x\":2*u});\r\n//5 k\r\nitem.addAnimation({\"y\":2*u});\r\n//6 k\r\nitem.addAnimation({\"y\":1*u});\r\n//7 w\r\nitem.addAnimation({\"x\":7*u});\r\n//8 j\r\nitem.addAnimation({\"y\":2*u});\r\n//9 j\r\nitem.addAnimation({\"y\":3*u});\r\n//10 l\r\nitem.addAnimation({\"x\":8*u});\r\n//11 l\r\nitem.addAnimation({\"x\":9*u});\r\n//12 j\r\nitem.addAnimation({\"y\":4*u});\r\n//13 j\r\nitem.addAnimation({\"y\":5*u});\r\n//14 b\r\nitem.addAnimation({\"x\":7*u});\r\n//15 b\r\nitem.addAnimation({\"x\":2*u});\r\n//16 j\r\nitem.addAnimation({\"y\":6*u});\r\n//17 j\r\nitem.addAnimation({\"y\":7*u});\r\n//18 $\r\nitem.addAnimation({\"x\":10*u});\r\n//19 j\r\nitem.addAnimation({\"y\":8*u});\r\n//20 l\r\nitem.addAnimation({\"x\":11*u});\r\n//21 j\r\nitem.addAnimation({\"y\":9*u});\r\n//22 j\r\nitem.addAnimation({\"y\":10*u});\r\n//23 ^\r\nitem.addAnimation({\"x\":5*u});\r\n//24 j\r\nitem.addAnimation({\"y\":11*u});\r\n\r\n//1 goal\r\nitem=stage.createNewItem();\r\nitem.setName(\"goal\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"goal01.png\",\"bgc\":\"yellow\",\"bdc\":\"yellow\"});\r\nstage.addItem(item);\r\n\r\n//word \"word jump\" [w] 1\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"w\"});\r\nstage.addItem(item);\r\n\r\n//word \"word jump\" [o] 2\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"o\"});\r\nstage.addItem(item);\r\n\r\n//word \"word jump\" [r] 3\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"r\"});\r\nstage.addItem(item);\r\n\r\n//word \"word jump\" [d] 4\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"d\"});\r\nstage.addItem(item);\r\n\r\n//word \"word jump\" [ ] 5\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\r\nstage.addItem(item);\r\n\r\n//word \"word jump\" [j] 6\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"j\"});\r\nstage.addItem(item);\r\n\r\n//word \"word jump\" [u] 7\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"u\"});\r\nstage.addItem(item);\r\n\r\n//word \"word jump\" [m] 8\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"m\"});\r\nstage.addItem(item);\r\n\r\n//word \"word jump\" [p] 9\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"p\"});\r\nstage.addItem(item);\r\n\r\n//word \"now\" [w] 1\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"w\"});\r\nstage.addItem(item);\r\n\r\n//word \"now\" [o] 2\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"o\"});\r\nstage.addItem(item);\r\n\r\n//word \"now\" [n] 3\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"n\"});\r\nstage.addItem(item);\r\n\r\n//word \"back \" [ ] 1\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\r\nstage.addItem(item);\r\n\r\n//word \"back \" [k] 2\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"k\"});\r\nstage.addItem(item);\r\n\r\n//word \"back \" [c] 3\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"c\"});\r\nstage.addItem(item);\r\n\r\n//word \"back \" [a] 4\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"a\"});\r\nstage.addItem(item);\r\n\r\n//word \"back \" [b] 5\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"b\"});\r\nstage.addItem(item);\r\n\r\n//word \"move tail\" [m] 1\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"m\"});\r\nstage.addItem(item);\r\n\r\n//word \"move tail\" [o] 2\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"o\"});\r\nstage.addItem(item);\r\n\r\n//word \"move tail\" [v] 3\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"v\"});\r\nstage.addItem(item);\r\n\r\n//word \"move tail\" [e] 4\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"e\"});\r\nstage.addItem(item);\r\n\r\n//word \"move tail\" [ ] 5\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\r\nstage.addItem(item);\r\n\r\n//word \"move tail\" [t] 6\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"t\"});\r\nstage.addItem(item);\r\n\r\n//word \"move tail\" [a] 7\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"a\"});\r\nstage.addItem(item);\r\n\r\n//word \"move tail\" [i] 8\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"i\"});\r\nstage.addItem(item);\r\n\r\n//word \"move tail\" [l] 9\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"l\"});\r\nstage.addItem(item);\r\n\r\n//word \" mv head\" [ ] 1\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\r\nstage.addItem(item);\r\n\r\n//word \" mv head\" [ ] 2\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\r\nstage.addItem(item);\r\n\r\n//word \" mv head\" [m] 3\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"m\"});\r\nstage.addItem(item);\r\n\r\n//word \" mv head\" [v] 4\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"v\"});\r\nstage.addItem(item);\r\n\r\n//word \" mv head\" [ ] 5\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\r\nstage.addItem(item);\r\n\r\n//word \" mv head\" [h] 6\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"h\"});\r\nstage.addItem(item);\r\n\r\n//word \" mv head\" [e] 7\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"e\"});\r\nstage.addItem(item);\r\n\r\n//word \" mv head\" [a] 8\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"a\"});\r\nstage.addItem(item);\r\n\r\n//word \" mv head\" [d] 9\r\nitem=stage.createNewItem();\r\nitem.setName(\"word\");\r\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"d\"});\r\nstage.addItem(item);\r\n\r\n\r\n\r\n//wall 1\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 2\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 3\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 4\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 5\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 6\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 7\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 8\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 9\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 10\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 11\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 12\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 13\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 14\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 15\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 16\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 17\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 18\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 19\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 20\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 21\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 22\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 23\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 24\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 25\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 26\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 27\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 28\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 29\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 30\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 31\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 32\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 33\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 34\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 35\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 36\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 37\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 38\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 39\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 40\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 41\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 42\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 43\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 44\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 45\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 46\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 47\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 48\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 49\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 50\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 51\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 52\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 53\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 54\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 55\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 56\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 57\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 58\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 59\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 60\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 61\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 62\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 63\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 64\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 65\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 66\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 67\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 68\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 69\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 70\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 71\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 72\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 73\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 74\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 75\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 76\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 77\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 78\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 79\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 80\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 81\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 82\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 83\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n//wall 84\r\nitem=stage.createNewItem();\r\nitem.setName(\"wall\");\r\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\r\nstage.addItem(item);\r\n\r\n\r\n}", "title": "" }, { "docid": "01d1b6623f9444b6adf7cc90ae8598f6", "score": "0.57529324", "text": "function initStage004(stage){\n\nvar item;\n\n// Percent of one unit. if you want to change unit size, change this.\nvar u=5;\n\n/////Animation Parameter/////\n//\n//dsp :display (true/false) startIndex.... display or hide\n//x : position x (percent)\n//y : position y (percent)\n//w : width (percent)\n//h : height (percent)\n//bgc : background-color\n//bdc : border-color\n//img : background-image (filename)\n//opc : opacity (0.0....1.0) default=1.0\n//z : z-index (default=2)\n//wd : character of word\n\n//Answer String\n//helper original string=lljjllljjjllljjjlllklkkkhkklllkkhhhhkkllllljllkklljjjjhjjjljjhhhhjjlljjjhhhhhjhjhhhkkkhkhkhhhjhjjllljjhjjllljllllllkkklllljjh\nstage.setAnsStr(\"lljjllljjjllljjjlllklkkkhkklllkkhhhhkkllllljllkklljjjjhjjjljjhhhhjjlljjjhhhhhjhjhhhkkkhkhkhhhjhjjllljjhjjllljllllllkkklllljjh\");\nitem=stage.createNewItem();\n\n//class name\nitem.setName(\"vimrio\");\n\n//frame offset. default startindex=0\nitem.setFrameStartIndex(0);\nstage.addItem(item);\n\n//first frame\n//1 start\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":3*u,\"w\":u,\"h\":u,\"bgc\":\"transparent\",\"bdc\":\"blue\",\"img\":\"vimrio01.png\",\"z\":5,\"opc\":1.0,\"wd\":\"\"});\n//following next frames\n\n//2 l\nitem.addAnimation({\"x\":1*u});\n//3 l\nitem.addAnimation({\"x\":2*u});\n//4 j\nitem.addAnimation({\"y\":4*u});\n//5 j\nitem.addAnimation({\"y\":5*u});\n//6 l\nitem.addAnimation({\"x\":3*u});\n//7 l\nitem.addAnimation({\"x\":4*u});\n//8 l\nitem.addAnimation({\"x\":5*u});\n//9 j\nitem.addAnimation({\"y\":6*u});\n//10 j\nitem.addAnimation({\"y\":7*u});\n//11 j\nitem.addAnimation({\"y\":8*u});\n//12 l\nitem.addAnimation({\"x\":6*u});\n//13 l\nitem.addAnimation({\"x\":7*u});\n//14 l\nitem.addAnimation({\"x\":8*u});\n//15 j\nitem.addAnimation({\"y\":9*u});\n//16 j\nitem.addAnimation({\"y\":10*u});\n//17 j\nitem.addAnimation({\"y\":11*u});\n//18 l\nitem.addAnimation({\"x\":9*u});\n//19 l\nitem.addAnimation({\"x\":10*u});\n//20 l\nitem.addAnimation({\"x\":11*u});\n//21 k\nitem.addAnimation({\"y\":10*u});\n//22 l\nitem.addAnimation({\"x\":12*u});\n//23 k\nitem.addAnimation({\"y\":9*u});\n//24 k\nitem.addAnimation({\"y\":8*u});\n//25 k\nitem.addAnimation({\"y\":7*u});\n//26 h\nitem.addAnimation({\"x\":11*u});\n//27 k\nitem.addAnimation({\"y\":6*u});\n//28 k\nitem.addAnimation({\"y\":5*u});\n//29 l\nitem.addAnimation({\"x\":12*u});\n//30 l\nitem.addAnimation({\"x\":13*u});\n//31 l\nitem.addAnimation({\"x\":14*u});\n//32 k\nitem.addAnimation({\"y\":4*u});\n//33 k\nitem.addAnimation({\"y\":3*u});\n//34 h\nitem.addAnimation({\"x\":13*u});\n//35 h\nitem.addAnimation({\"x\":12*u});\n//36 h\nitem.addAnimation({\"x\":11*u});\n//37 h\nitem.addAnimation({\"x\":10*u});\n//38 k\nitem.addAnimation({\"y\":2*u});\n//39 k\nitem.addAnimation({\"y\":1*u});\n//40 l\nitem.addAnimation({\"x\":11*u});\n//41 l\nitem.addAnimation({\"x\":12*u});\n//42 l\nitem.addAnimation({\"x\":13*u});\n//43 l\nitem.addAnimation({\"x\":14*u});\n//44 l\nitem.addAnimation({\"x\":15*u});\n//45 j\nitem.addAnimation({\"y\":2*u});\n//46 l\nitem.addAnimation({\"x\":16*u});\n//47 l\nitem.addAnimation({\"x\":17*u});\n//48 k\nitem.addAnimation({\"y\":1*u});\n//49 k\nitem.addAnimation({\"y\":0*u});\n//50 l\nitem.addAnimation({\"x\":18*u});\n//51 l\nitem.addAnimation({\"x\":19*u});\n//52 j\nitem.addAnimation({\"y\":1*u});\n//53 j\nitem.addAnimation({\"y\":2*u});\n//54 j\nitem.addAnimation({\"y\":3*u});\n//55 j\nitem.addAnimation({\"y\":4*u});\n//56 h\nitem.addAnimation({\"x\":18*u});\n//57 j\nitem.addAnimation({\"y\":5*u});\n//58 j\nitem.addAnimation({\"y\":6*u});\n//59 j\nitem.addAnimation({\"y\":7*u});\n//60 l\nitem.addAnimation({\"x\":19*u});\n//61 j\nitem.addAnimation({\"y\":8*u});\n//62 j\nitem.addAnimation({\"y\":9*u});\n//63 h\nitem.addAnimation({\"x\":18*u});\n//64 h\nitem.addAnimation({\"x\":17*u});\n//65 h\nitem.addAnimation({\"x\":16*u});\n//66 h\nitem.addAnimation({\"x\":15*u});\n//67 j\nitem.addAnimation({\"y\":10*u});\n//68 j\nitem.addAnimation({\"y\":11*u});\n//69 l\nitem.addAnimation({\"x\":16*u});\n//70 l\nitem.addAnimation({\"x\":17*u});\n//71 j\nitem.addAnimation({\"y\":12*u});\n//72 j\nitem.addAnimation({\"y\":13*u});\n//73 j\nitem.addAnimation({\"y\":14*u});\n//74 h\nitem.addAnimation({\"x\":16*u});\n//75 h\nitem.addAnimation({\"x\":15*u});\n//76 h\nitem.addAnimation({\"x\":14*u});\n//77 h\nitem.addAnimation({\"x\":13*u});\n//78 h\nitem.addAnimation({\"x\":12*u});\n//79 j\nitem.addAnimation({\"y\":15*u});\n//80 h\nitem.addAnimation({\"x\":11*u});\n//81 j\nitem.addAnimation({\"y\":16*u});\n//82 h\nitem.addAnimation({\"x\":10*u});\n//83 h\nitem.addAnimation({\"x\":9*u});\n//84 h\nitem.addAnimation({\"x\":8*u});\n//85 k\nitem.addAnimation({\"y\":15*u});\n//86 k\nitem.addAnimation({\"y\":14*u});\n//87 k\nitem.addAnimation({\"y\":13*u});\n//88 h\nitem.addAnimation({\"x\":7*u});\n//89 k\nitem.addAnimation({\"y\":12*u});\n//90 h\nitem.addAnimation({\"x\":6*u});\n//91 k\nitem.addAnimation({\"y\":11*u});\n//92 h\nitem.addAnimation({\"x\":5*u});\n//93 h\nitem.addAnimation({\"x\":4*u});\n//94 h\nitem.addAnimation({\"x\":3*u});\n//95 j\nitem.addAnimation({\"y\":12*u});\n//96 h\nitem.addAnimation({\"x\":2*u});\n//97 j\nitem.addAnimation({\"y\":13*u});\n//98 j\nitem.addAnimation({\"y\":14*u});\n//99 l\nitem.addAnimation({\"x\":3*u});\n//100 l\nitem.addAnimation({\"x\":4*u});\n//101 l\nitem.addAnimation({\"x\":5*u});\n//102 j\nitem.addAnimation({\"y\":15*u});\n//103 j\nitem.addAnimation({\"y\":16*u});\n//104 h\nitem.addAnimation({\"x\":4*u});\n//105 j\nitem.addAnimation({\"y\":17*u});\n//106 j\nitem.addAnimation({\"y\":18*u});\n//107 l\nitem.addAnimation({\"x\":5*u});\n//108 l\nitem.addAnimation({\"x\":6*u});\n//109 l\nitem.addAnimation({\"x\":7*u});\n//110 j\nitem.addAnimation({\"y\":19*u});\n//111 l\nitem.addAnimation({\"x\":8*u});\n//112 l\nitem.addAnimation({\"x\":9*u});\n//113 l\nitem.addAnimation({\"x\":10*u});\n//114 l\nitem.addAnimation({\"x\":11*u});\n//115 l\nitem.addAnimation({\"x\":12*u});\n//116 l\nitem.addAnimation({\"x\":13*u});\n//117 k\nitem.addAnimation({\"y\":18*u});\n//118 k\nitem.addAnimation({\"y\":17*u});\n//119 k\nitem.addAnimation({\"y\":16*u});\n//120 l\nitem.addAnimation({\"x\":14*u});\n//121 l\nitem.addAnimation({\"x\":15*u});\n//122 l\nitem.addAnimation({\"x\":16*u});\n//123 l\nitem.addAnimation({\"x\":17*u});\n//124 j\nitem.addAnimation({\"y\":17*u});\n//125 j\nitem.addAnimation({\"y\":18*u});\n//126 h\nitem.addAnimation({\"x\":16*u});\n\n//1 goal\nitem=stage.createNewItem();\nitem.setName(\"goal\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"goal01.png\",\"bgc\":\"yellow\",\"bdc\":\"yellow\"});\nstage.addItem(item);\n\n\n\n//wall 1\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 2\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 3\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 4\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 5\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 6\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 7\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 8\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 9\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 10\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 11\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 12\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 13\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 14\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 15\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 16\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 17\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 18\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 19\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 20\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 21\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 22\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 23\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 24\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 25\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 26\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":17*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 27\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 28\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 29\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 30\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 31\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 32\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 33\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 34\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 35\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 36\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 37\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 38\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 39\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 40\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":17*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 41\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 42\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 43\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 44\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 45\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":17*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 46\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":19*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 47\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 48\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 49\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 50\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 51\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 52\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 53\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 54\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 55\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 56\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 57\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":17*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 58\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":19*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 59\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 60\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 61\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 62\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 63\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 64\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 65\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 66\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":17*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 67\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 68\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 69\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 70\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 71\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 72\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 73\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 74\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 75\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":17*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 76\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 77\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 78\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 79\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 80\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 81\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 82\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 83\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 84\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 85\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 86\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 87\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 88\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 89\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 90\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 91\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 92\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 93\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 94\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 95\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 96\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 97\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":17*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 98\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 99\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":19*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 100\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 101\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 102\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 103\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 104\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 105\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 106\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 107\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 108\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 109\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 110\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 111\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 112\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 113\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 114\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 115\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 116\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 117\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 118\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 119\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 120\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 121\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 122\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 123\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 124\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 125\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 126\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 127\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 128\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 129\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 130\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 131\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":13*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 132\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":14*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 133\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":14*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 134\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":14*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 135\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":14*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 136\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":14*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 137\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":14*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 138\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":14*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 139\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 140\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 141\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 142\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 143\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 144\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 145\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 146\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 147\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":13*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 148\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 149\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 150\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 151\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":17*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 152\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":15*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 153\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":16*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 154\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":16*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 155\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":16*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 156\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":16*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 157\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":16*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 158\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 159\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 160\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 161\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 162\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 163\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 164\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 165\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 166\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 167\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 168\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 169\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 170\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":17*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 171\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 172\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 173\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 174\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 175\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 176\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 177\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 178\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 179\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":18*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 180\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":19*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 181\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":19*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 182\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":19*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 183\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":19*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 184\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":14*u,\"y\":19*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 185\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":15*u,\"y\":19*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 186\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":16*u,\"y\":19*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 187\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":17*u,\"y\":19*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 188\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":18*u,\"y\":19*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n\n}", "title": "" }, { "docid": "dbd71cecfb6a9605be508702f5818e90", "score": "0.57465386", "text": "function TienTheoUber(soKM, gia1, gia2, gia3) {\n\tvar thanhTien = 0; \n\tif(soKM <=1){\n\t\t thanhTien = gia1;\n\t} else if(soKM>1 && soKM <= 20){\n\t\t thanhTien = gia1 + (soKM - 1) * gia2;\t\n\t} else if(soKM>20){\n\t\tthanhTien = gia1 + 19* gia2 + (soKM - 20)* gia3;\n\t}\n\treturn thanhTien;\n}", "title": "" }, { "docid": "4d1bc9c17adbe1c4d9ec96f7a479f7e6", "score": "0.5735006", "text": "function julia()\n{\n for(y=0;y<200;y++)\n {\n for(x=0;x<200;x++)\n {\n var cx=-2+x/50;\n var cy=-2+y/50;\n var i = 0;\n\n do\n {\n xt=cx*cx-cy*cy+creal;\n cy=2*cx*cy+cimag;\n cx=xt;\n i++;\n }\n while ((cx*cx+cy*cy<4)&&i<25);\n\n context.beginPath();\n context.rect(x*4, y*4, 4, 4);\n context.fillStyle = pallette[i];\n context.fill();\n }\n }\n frame++;\n creal=-.8+.6*Math.sin(frame/(3.14*20));\n cimag=.156+.4*Math.cos(frame/(3.14*40));\n\n}", "title": "" }, { "docid": "135d6375d56193b70cb4638bda296521", "score": "0.57101", "text": "function inhoud(breedte, hoogte, lengte){\n return breedte * hoogte * lengte;\n}", "title": "" }, { "docid": "cf2cebe39ce48e61daa41818a1af74fb", "score": "0.56849486", "text": "function calc_x(j){\n return (j * 100 + 50) + (width / 2 - 200);\n}", "title": "" }, { "docid": "d8c7304fbd905794c5f5843f67d2ad88", "score": "0.5671492", "text": "function seeKaiRunCalculator() {\n if (footLength >= 3.85 && footLength <= 6.375) {\n if (footLength <= 4.125) {\n seeKaiRun = \"Size 3\";\n } else if (footLength <= 4.375) {\n seeKaiRun = \"Size 3.5\";\n } else if (footLength <= 4.5) {\n seeKaiRun = \"Size 4\";\n } else if (footLength <= 4.625) {\n seeKaiRun = \"Size 4.5\";\n } else if (footLength <= 4.75) {\n seeKaiRun = \"Size 5\";\n } else if (footLength <= 5) {\n seeKaiRun = \"Size 5.5\";\n } else if (footLength <= 5.125) {\n seeKaiRun = \"Size 6\";\n } else if (footLength <= 5.25) {\n seeKaiRun = \"Size 6.5\";\n } else if (footLength <= 5.5) {\n seeKaiRun = \"Size 7\";\n } else if (footLength <= 5.625) {\n seeKaiRun = \"Size 7.5\";\n } else if (footLength <= 5.75) {\n seeKaiRun = \"Size 8\";\n } else if (footLength <= 6) {\n seeKaiRun = \"Size 8.5\";\n } else if (footLength <= 6.125) {\n seeKaiRun = \"Size 9\";\n } else if (footLength <= 6.25) {\n seeKaiRun = \"Size 9.5\";\n } else if (footLength <= 6.375) {\n seeKaiRun = \"Size 10\";\n }\n } else {\n seeKaiRun = \"no results\";\n }\n}", "title": "" }, { "docid": "216e1f85ae51d4c03c129ace28ec0d2e", "score": "0.5643057", "text": "function flower(){\n\n for (var r21 = 0; r21 < 10; r21++) {\n stroke(85,107,47,20);\n strokeWeight(0);\n }\n\n push();\n fill(224, 208, 99, 240);\n translate(width/2, height/2-165);\n strokeWeight(0);\n\n for (var r2 = 0; r2 < 10; r2++) {\n if (frameCount <= 600) {\n ellipse(0, 10 + frameCount / 20, 10 + frameCount / 40, 20 + frameCount / 20);\n }\n if (frameCount > 600) {\n ellipse(0, 40, 25, 50)\n }\n rotate(PI / 5);\n }\n pop();\n}", "title": "" }, { "docid": "495dfce76e09391e456ccc93d45d58d5", "score": "0.5638238", "text": "function drawYestoStairs() {\n drawChillerbox();\n text(\"You find a fluffy wuffy puppy in the closet upstairs. You take it home and make it your new best friend. Press S to start again.\", 25, 25, 400, 300);\n}", "title": "" }, { "docid": "9b9329bafe44996fc935495f91a0687d", "score": "0.5633745", "text": "function setlet(){\n let sk=1;\n for(let i=-10;i<50;i+=5){\n let win=i*2*Math.PI/60;\n let xsk =c.x+2+Math.cos(win)*(c.x-10),\n ysk =c.y+2+Math.sin(win)*(c.x-10);\n if(sk==3){xsk-=10;}\n if(sk==6){ysk-=10;}\n if(sk==9){xsk+=10;}\n if(sk==12){ysk+=10;}\n if(sk==10){xsk+=3;}\n zahlpos.push([sk,xsk,ysk]);\n sk+=1;\n }\n}", "title": "" }, { "docid": "3e60a5df4ab9442b6027271b3897e202", "score": "0.56278497", "text": "function pitagoroTeorema( x, y){\n\nconsole.log( \"Trikampio ilgoji krastine lygi: \", x*x + y*y );\n\n}", "title": "" }, { "docid": "799ea18829a520da6ffc1b1dbfdece1d", "score": "0.5604628", "text": "function imc3(peso, altura){\n const imc3 = peso / (altura ** 2 );\n console.log(imc3);\n}", "title": "" }, { "docid": "d72440ad5aeeafd3d1ca1468da8d28b5", "score": "0.56003207", "text": "function tuercaMaquina1_800(){\n\t\t\trotacionNormal(\"tuerca5\", 20);\n\t\t\trotacionInversa(\"tuerca6\", 10);\n\t\t}", "title": "" }, { "docid": "0bf375121df0d77c70e235807691ba9d", "score": "0.558259", "text": "function human() {\n\tvar limbs = {\n\t\t\"body\": {\n\t\t\t\"range\": 0,\n\t\t\t\"baserot\": 0,\n\t\t\t\"length\": 0,\n\t\t\t\"offset\": 0\n\t\t},\n\t\t\"torso\": {\n\t\t\t\"range\": 0,\n\t\t\t\"baserot\": 3.141592653589793,\n\t\t\t\"length\": 100,\n\t\t\t\"offset\": 0\n\t\t},\n\t\t\"thigh\": {\n\t\t\t\"range\": 1,\n\t\t\t\"baserot\": 0.3,\n\t\t\t\"length\": 90,\n\t\t\t\"offset\": 0\n\t\t},\n\t\t\"calf\": {\n\t\t\t\"range\": -0.6,\n\t\t\t\"baserot\": -0.9,\n\t\t\t\"length\": 90,\n\t\t\t\"offset\": 1.6\n\t\t},\n\t\t\"foot\": {\n\t\t\t\"range\": 0.5,\n\t\t\t\"baserot\": 1.4,\n\t\t\t\"length\": 25,\n\t\t\t\"offset\": 0\n\t\t},\n\t\t\"bicep\": {\n\t\t\t\"range\": 0.9,\n\t\t\t\"baserot\": -0.5,\n\t\t\t\"length\": 70,\n\t\t\t\"offset\": 0\n\t\t},\n\t\t\"forearm\": {\n\t\t\t\"range\": 1.5,\n\t\t\t\"baserot\": 1.5,\n\t\t\t\"length\": 60,\n\t\t\t\"offset\": -0.3\n\t\t}\n\t};\n\n\tvar iceskating = { \"body\": { \"range\": 0, \"baserot\": 0, \"length\": 0, \"offset\": 0 }, \"torso\": { \"range\": 0, \"baserot\": 2.5, \"length\": 100, \"offset\": 0 }, \"thigh\": { \"range\": 0.5, \"baserot\": 0.3, \"length\": 100, \"offset\": 0 }, \"calf\": { \"range\": -0.8, \"baserot\": -0.7, \"length\": 110, \"offset\": 2.9 }, \"foot\": { \"range\": 0, \"baserot\": 1.6, \"length\": 40, \"offset\": 0 }, \"bicep\": { \"range\": 1.6, \"baserot\": -0.3, \"length\": 85, \"offset\": 0 }, \"forearm\": { \"range\": 1.5, \"baserot\": 1, \"length\": 70, \"offset\": -0.3 } };\n\t// limbs = iceskating;\n\n\tvar human = [{ name: \"body\", parent: null, movement: limbs.body, phase: 0 }, { name: \"torso\", parent: \"body\", movement: limbs.torso, phase: 0 }, { name: \"thigh1\", parent: \"body\", movement: limbs.thigh, phase: 0 }, { name: \"calf1\", parent: \"thigh1\", movement: limbs.calf, phase: 0 }, { name: \"foot1\", parent: \"calf1\", movement: limbs.foot, phase: 0 }, { name: \"thigh2\", parent: \"body\", movement: limbs.thigh, phase: Math.PI }, { name: \"calf2\", parent: \"thigh2\", movement: limbs.calf, phase: Math.PI }, { name: \"foothigh2\", parent: \"calf2\", movement: limbs.foot, phase: Math.PI }, { name: \"bicep1\", parent: \"torso\", movement: limbs.bicep, phase: 0 }, { name: \"forearm1\", parent: \"bicep1\", movement: limbs.forearm, phase: 0 }, { name: \"bicep2\", parent: \"torso\", movement: limbs.bicep, phase: Math.PI }, { name: \"forearm2\", parent: \"bicep2\", movement: limbs.forearm, phase: Math.PI }];\n\n\treturn {\n\t\tbody: human,\n\t\tlimbs: limbs\n\t};\n}", "title": "" }, { "docid": "493357287ea27ca5cd25048201b91f78", "score": "0.5567576", "text": "function marathon(track, stamina) {\n console.log(track.length)\n\n var countX = 0\n var countO = 0\n var jarak = 0\n var life = stamina\n for (let i = 0; i < track.length; i++) {\n jarak++\n if (track[i] == 'X') {\n countX++//benar\n } else if (track[i] == 'O') {\n countO++//benar\n } else {\n life += 2//benar\n\n\n }\n if (track[i] != track[i + 1] && track[i] != '-') {\n life--\n countO = 0\n countX = 0\n }\n\n if (countX == 4 || countO == 2) {\n life--\n countX = 0\n countO = 0\n }\n if (life == 0) {\n break\n }\n\n }\n // console.log(life)\n // console.log(countO)\n // console.log(countX)\n\n console.log(jarak)\n if (jarak == track.length) {\n return ` selamat anda telah menempuh garis finish`\n } else {\n return `selamat anda telah menempuh jarak ${jarak} km`\n }\n\n\n\n\n}", "title": "" }, { "docid": "b63227a0ccc0a880bd6edc63d6b70b82", "score": "0.55674976", "text": "function neuMinuteHand(size) {\n push();\n // fill(0);\n fill(250, 50, 115);\n let minu = floor(count);\n minRotation = minu % 3600;\n let minRotate = map(minRotation, 0, 3599, 0, 2*PI);\n rotate(minRotate);\n image(hand1, -77, -107, 150, 150);\n // rect(-4, -size/2, 8, size/2);\n pop();\n}", "title": "" }, { "docid": "ed6d27ea3f7680ae677a8bc5528692c9", "score": "0.555699", "text": "createMathDmgBox(){\n const pp = new PIXI.Point($player.x,$player.y);\n\n function computePositionFrom(from){\n const tmp = +pp.y;\n pp.y-=40;\n return tmp;\n }\n \n // text total\n const txtt = new PIXI.Text('200',{fill: 0xffffff});\n txtt.anchor.set(0,1);\n txtt.position.y = computePositionFrom();\n // line splitter //data2\\Hubs\\combats\\SOURCE\\images\\split_line.png\n const ls = new PIXI.Sprite(this.dataBase.textures.split_line);\n ls.anchor.set(0,1);\n ls.position.y = computePositionFrom();\n \n // base atk math\n const bam = {icon:null,txt:null};\n const bamIcon = new PIXI.Sprite($Loader.Data2.hudStats.textures.atk_icon); //TODO: creer spritesheet pour icons algo\n bamIcon.anchor.set(0,1);\n bamIcon.position.y = computePositionFrom();\n // math\n const bamTxt = new PIXI.Text('(15-(def))*(crt*lck)',{fill: 0xffffff,fontSize: 18});\n bamTxt.anchor.set(0,1);\n bamTxt.position.x = 40;\n bamTxt.position.y = bamIcon.position.y;\n\n // slots math item\n const smi = []\n for (let i=0; i<3; i++) {\n // slots math item icon\n const smiIcon = new PIXI.Sprite($Loader.Data2.hudStats.textures.atk_icon); //TODO: creer spritesheet pour icons algo\n smiIcon.anchor.set(0,1);\n smiIcon.position.y = computePositionFrom();\n // math\n const smiTxt = new PIXI.Text('R50-gRes%',{fill: 0xffffff,fontSize: 18});\n smiTxt.anchor.set(0,1);\n smiTxt.position.x = 40;\n smiTxt.position.y = smiIcon.position.y;\n smi.push(smiIcon,smiTxt);\n };\n \n // dmg statistique box (black)\n const cage_dsb = new PIXI.Container();\n const dsb = new PIXI.Sprite(PIXI.Texture.WHITE); // 10x10 size\n cage_dsb.addChild(dsb,txtt,ls ,bamIcon,bamTxt,...smi);\n dsb.alpha = 0.7;\n dsb.tint = 0x000000;\n dsb.width = cage_dsb.width;\n dsb.height = cage_dsb.height;\n dsb.anchor.set(0,1);\n\n //end dmg box\n this.sprites.cage_dsb = cage_dsb;\n cage_dsb.parentGroup = $displayGroup.group[3];\n cage_dsb.renderable = false;\n }", "title": "" }, { "docid": "43b5cd9e1eb3d071cfbd1203b6c5175e", "score": "0.55564797", "text": "function beerCan(posX, posY) {\n var x = posX; //Da el valor a la variable X\n var y = posY; //Da el valor a la variable Y\n\n //Función para dibujarla\n this.dibujarse = function() {\n image(beer1, posX, posY, 157, 185); //Pone la imagen de la cerveza\n }\n\n //Función para animar la espuma a través del tiempo en 5 estados\n this.espuma = function() {\n if (M2 == 230) {\n sonidoCan.play(1); //Reproduce el sonido en el primer estado\n }\n if (M2 >= 0) {\n M2 = M2 - 1; //Linea para restar el tiempo\n }\n if (M2 < 150) {\n image(beer2, posX, posY, 157, 185); //Dibuja la primera capa de espuma en el segundo estado\n }\n if (M2 < 100) {\n image(beer3, posX, posY, 157, 185); //Dibuja la segunda capa de espuma en el tercer estado\n }\n if (M2 < 50) {\n image(beer4, posX, posY, 157, 185); //Dibuja la tercera capa de espuma en el cuarto estado\n }\n if (M2 < 0) {\n estado = INFORMACION; //Cambia a la siguiente etapa en el quinto estado\n }\n }\n}", "title": "" }, { "docid": "362495ddbe9219f0a84336bf540d7043", "score": "0.55561125", "text": "kanibalism(fish) {\n let xDistance = Math.abs(this.x - fish.x);\n let yDistance = Math.abs(this.y - fish.y);\n if (Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2)) < 50) {\n if (this.size > fish.size) {\n this.size++;\n UnderTheSea.highscore += 100;\n return \"dead\";\n }\n else {\n alert(\"U DEAD\");\n return \"gameover\";\n }\n }\n else\n return \"nothing\";\n }", "title": "" }, { "docid": "258f8524816d6cfb2043ef6baea4ebc7", "score": "0.5539356", "text": "function growSugerCane() {\n console.log(\"1. Plug the whole field\");\n console.log(\"2. Drow whole in field with razor\");\n console.log(\"3. Cut the cane in small pieces\");\n console.log(\"4. place the pieaces of the suger cane in the dugged pits\");\n console.log(\"5. Now plane the whole ground\");\n}", "title": "" }, { "docid": "30763252fdb57704b389fdd34c60b6f9", "score": "0.5528253", "text": "jellyAnimation(){\n const jelly = anime({\n targets: '#backgroundanimation',\n points: [\n {value: [\"20 30 130 41 590 22 912 38 1131 102 1119 290 1080 460 1110 610 1170 737 980 832 673 842 398 820 81 724 15 578 20 390 81 253\",\n \"310 290 390 171 590 192 812 218 971 192 909 290 990 480 800 500 820 557 710 502 573 532 398 590 371 424 225 398 299 350 221 293\"\n ]}, {\n value: \"80 90 370 71 630 172 812 98 881 172 1090 460 1030 560 1090 740 980 787 720 632 473 642 398 690 71 524 195 398 79 230 51 103\"},{\n value: \"380 200 470 91 530 62 712 98 881 52 990 40 1090 90 1080 340 930 417 730 632 513 682 328 500 371 434 245 318 259 290 291 193\"\n },{\n value: \"330 130 470 191 630 102 732 198 811 222 890 460 790 530 650 570 530 757 430 792 403 722 238 710 81 784 95 555 239 380 231 253\"\n },{\n value:\"40 210 190 71 430 82 732 158 881 299 1009 310 1000 490 880 620 850 727 710 682 363 742 128 620 301 524 295 428 219 350 71 283\"\n },{\n value: \"310 290 390 171 590 192 812 218 971 192 909 290 990 480 800 500 820 557 710 502 573 532 398 590 371 424 225 398 299 350 221 293\"\n },\n {\n value: \"20 30 130 41 590 22 912 38 1131 102 1119 290 1080 460 1110 610 1170 737 980 832 673 842 398 820 81 724 15 578 20 390 81 253\"\n }\n ],\n easing: 'easeInOutQuad',\n duration: 10000,\n loop: true\n });\n return jelly;\n }", "title": "" }, { "docid": "7a9b91e33902980d9516009d80faa184", "score": "0.55117697", "text": "function trainingLabOld(input) {\r\n let width = (Number(input.shift()) * 100);\r\n let height = (Number(input.shift()) * 100) - 100;\r\n \r\n let spaces_width = ~~(height / 70); \r\n let spaces_heigth = ~~(width / 120); \r\n \r\n let spaces = (spaces_width * spaces_heigth) - 3;\r\n console.log(spaces);\r\n}", "title": "" }, { "docid": "778079fde15928392e98008f63dd5f5c", "score": "0.5509238", "text": "function yukyStrawberries() {\r\n energy -= 2;\r\n encouragement -= 2;\r\n}", "title": "" }, { "docid": "0a82a6bfb4c18f3e372c08f836c4c7dd", "score": "0.5483425", "text": "function wherclic(x,y,centru)\n {var buton;\n var raza=25;\n // console.log(\"ecuatia dreptei\");\n // console.log(centru);\n // console.log();\n //se verifica daca sa apasat pe camp\n if(player.i%2===0){\n if(Math.sqrt(((centru.x-50-x)*(centru.x-50-x))+((centru.y-y)*(centru.y-y)))<=raza){\n buton=1;\n console.log(\"am apasat pe butonul 1\");\n }\n else if(Math.sqrt(((centru.x-25-x)*(centru.x-25-x))+((centru.y-50-y)*(centru.y-50-y)))<=raza){\n buton=2;\n player.self=2;\n console.log(\"am apasat pe butonul 2\");\n }\n else if(Math.sqrt(((centru.x+25-x)*(centru.x+25-x))+((centru.y-50-y)*(centru.y-50-y)))<=raza){\n buton=3;\n console.log(\"am apasat pe butonul 3\");\n }\n else if(Math.sqrt(((centru.x+50-x)*(centru.x+50-x))+((centru.y-y)*(centru.y-y)))<=raza){\n buton=4;\n console.log(\"am apasat pe butonul 4\");\n }\n else if(Math.sqrt(((centru.x+50-x)*(centru.x+50-x))+((centru.y-y)*(centru.y-y)))<=raza){\n buton=5;\n console.log(\"am apasat pe butonul 5\");\n }\n else if(Math.sqrt(((centru.x-25-x)*(centru.x-25-x))+((centru.y+50-y)*(centru.y+50-y)))<=raza){\n buton=6;\n console.log(\"am apasat pe butonul 6\");\n }\n else if(Math.sqrt(((centru.x-x)*(centru.x-x))+((centru.y-y)*(centru.y-y)))<=raza){\n buton=7;\n player.self=5;\n console.log(\"am apasat pe inventori\");\n }\n else{\n buton=0;\n };}\n else if(player.i%2===1){\n if(Math.sqrt(((centru.x-50-x)*(centru.x-50-x))+((centru.y+50-y)*(centru.y+50-y)))<=raza){\n buton=1;\n console.log(\"am apasat pe butonul 1\");\n }\n else if(Math.sqrt(((centru.x-25-x)*(centru.x-25-x))+((centru.y-y)*(centru.y-y)))<=raza){\n buton=2;\n player.self=2;\n console.log(\"am apasat pe butonul 2\");\n }\n else if(Math.sqrt(((centru.x+25-x)*(centru.x+25-x))+((centru.y-y)*(centru.y-y)))<=raza){\n buton=3;\n console.log(\"am apasat pe butonul 3\");\n }\n else if(Math.sqrt(((centru.x+50-x)*(centru.x+50-x))+((centru.y+50-y)*(centru.y+50-y)))<=raza){\n buton=4;\n console.log(\"am apasat pe butonul 4\");\n }\n else if(Math.sqrt(((centru.x+50-x)*(centru.x+50-x))+((centru.y+50-y)*(centru.y+50-y)))<=raza){\n buton=5;\n console.log(\"am apasat pe butonul 5\");\n }\n else if(Math.sqrt(((centru.x-25-x)*(centru.x-25-x))+((centru.y+100-y)*(centru.y+100-y)))<=raza){\n buton=6;\n console.log(\"am apasat pe butonul 6\");\n } else if(Math.sqrt(((centru.x-x)*(centru.x-x))+((centru.y+50-y)*(centru.y+50-y)))<=raza){\n buton=7;\n player.self=5;\n console.log(\"am apasat pe inventori\");\n }\n else{\n buton=0;\n };\n };\n // console.log(buton);\n return buton;\n}", "title": "" }, { "docid": "c306209e316e05e4e0c22220a6caa669", "score": "0.54809517", "text": "function iceburg(){\n\n push();\n let result = iceX + iceY;\n iceX = iceX - 1;\n iceY = iceY - 0 * 1 ;\n\n strokeWeight(5);\n stroke(random(iceCOLOR));\n fill(random(iceCOLOR));\n rect( iceX, iceY, 75, 75 ); // first iceburf\n rect( iceX - 350 , iceY - 60, 100, 100 ); // second iceburg\n rect( iceX - 550 , iceY - 90, 50, 50 ); // third iceburg\n // Return the value\n return result;\n pop();\n\n}", "title": "" }, { "docid": "58fff34064c2719f394dfa3f5054f235", "score": "0.54799724", "text": "function neuSecondHand(size) {\n push();\n fill(0)\n let sec = floor(count);\n secRotation = sec % 60;\n let secRotate = map(sec, 0, 59, 0, 2*PI);\n rotate(secRotate);\n // rect(-3, -size, 6, size);\n image(hand2, -67, -126, 160, 160);\n // ellipse(0, -20, 6, 40);\n pop();\n}", "title": "" }, { "docid": "eceaa9cbfd8b8a265069f2a5387408bc", "score": "0.546335", "text": "function placar () {\n textAlign (CENTER)\n textSize (26) //tamanho do número\n fill(color(3, 211, 242))\n rect (204, 10, 56, 29, 20)\n fill(255)\n text (meusPontos,233,35)\n fill(color(3, 211, 242)) //cor do fundo do placar\n rect (340, 10, 56, 29, 20)\n fill(255) //cor da letra do placar\n text ( pontosInimigo, 368, 35)\n//medidas do placar\n \n \n}", "title": "" }, { "docid": "032a21bb7381998dce2bf38af76e3b02", "score": "0.54630435", "text": "function displayToppingStrawberryCup1() {\n image(toppingStrawberryCup1Img, 0, 0, 1000, 500);\n}", "title": "" }, { "docid": "795aeb6b694552266ad311b054c0f06b", "score": "0.5456712", "text": "function createMetal() {\n var y = Math.random()\n if(y < 0.1){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"Fe\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"26\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"IRON\",90,60,10,\"Sansita\",\"black\",1)\n makeText(\"55.845\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*IRON IS THE MOST STABLE ELEMENT OF THE TABLE\",5,90,10,\"VT323\",1)\n }else if(y < 0.2){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"Au\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"79\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"GOLD\",90,60,10,\"Sansita\",\"black\",1)\n makeText(\"196.96\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*GOLD ONLY HAS ONE NATURALLY OCCURING ISOTOPE!\",5,90,10,\"VT323\",1)\n }else if(y < 0.3){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"Na\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"11\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"SODIUM\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"22.989\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*SODIUM ISN'T JUST SALT. IT IS ALSO USED IN NUCLEAR REACTORS! \",5,90,8,\"VT323\",1)\n }else if(y < 0.4){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"Al\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"13\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Aluminum\",80,60,10,\"Sansita\",\"black\",1)\n makeText(\"26.981\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*Pure aluminum doesn't occur in nature!\",5,90,10,\"VT323\",1)\n }else if(y < 0.5){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"Hg\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"80\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"MERCURY\",85,60,5,\"Sansita\",\"black\",1)\n makeText(\"200.59\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*FISH CONTAIN SMALL AMOUNTS OF MERCURY!\",5,90,10,\"VT323\",1)\n }else if(y < 0.6){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"Li\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"3\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Lithium\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"6.94\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*THE BATTERY IN YOUR PHONE HAS LITHIUM IN IT!\",5,90,10,\"VT323\",1)\n }else if(y < 0.7){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"Os\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"6\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Osmium\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"190.23\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*OSMIUM IS SOMETIMES FOUND IN PEN TIPS!\",5,90,10,\"VT323\",1)\n }else if(y < 0.8){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"Ho\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"67\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Holmium\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"164.93\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*HOLMIUM HAS NO COMMERCIAL USES :(\",5,90,10,\"VT323\",1)\n }else if(y < 0.9){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"K\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"19\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"POTASSIUM\",80,60,10,\"Sansita\",\"black\",1)\n makeText(\"39.098\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*AVOCADOS HAVE MORE POTASSIUM THAN BANANAS!\",5,90,10,\"VT323\",1)\n }else{\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightgreen\",1)\n makeText(\"Ca\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"20\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Calcium\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"40.078\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*CALCIUM REACTS WITH WATER TO PRODUCE HYDROGEN!\",5,90,10,\"VT323\",1)\n }\n}", "title": "" }, { "docid": "82c357bbc220bfa26a8035cbfe3b7d81", "score": "0.5448402", "text": "displayHibiscus() {\n push();\n // Stem\n strokeWeight(this.stemThickness);\n stroke(54, 120, 41);\n line(this.x, this.y, this.x, this.y + this.stemLength);\n // Petals\n stroke(100);\n strokeWeight(0.5);\n fill(this.petalColor.r, this.petalColor.g, this.petalColor.b);\n ellipse(this.x, this.y + this.size / 2, this.size);\n ellipse(this.x, this.y - this.size / 2, this.size);\n ellipse(this.x + this.size / 2, this.y, this.size);\n ellipse(this.x - this.size / 2, this.y, this.size);\n ellipse(this.x, this.y, this.size);\n // Stigma\n rectMode(CENTER);\n rect(this.x, this.y - this.size / 10, this.size / 12, this.size / 2);\n fill(232, 193, 63);\n ellipse(this.x + this.size / 8, this.y - this.size / 3, this.size / 9);\n ellipse(this.x + this.size / 8, this.y - this.size / 6, this.size / 9);\n ellipse(this.x - this.size / 8, this.y - this.size / 3, this.size / 9);\n ellipse(this.x - this.size / 8, this.y - this.size / 6, this.size / 9);\n pop();\n }", "title": "" }, { "docid": "e81537f41b7d6d25507f1fd12657d0cd", "score": "0.54460156", "text": "function fillCobweb(cobweb, cw){\n\tvar numPoints;\n\tmaxPoints = higherCountPoints(cw.countPoints, cw.global.responsive);\n\tfor(i=0;i<maxPoints;i++){\n\t\tif(i>0){\n\t\t\tposX = Math.floor((Math.random()*(cw.c.width-30))+15);\n\t\t\tposY = Math.floor((Math.random()*(cw.c.height-30))+15);\n\t\t\tfor(k = 0;k<i;k++){\n\t\t\t\tvar ipotenusa = Math.sqrt(Math.pow(cobweb[k][0].x-posX,2)+Math.pow(cobweb[k][0].y-posY,2));\n\t\t\t\tif((ipotenusa<cw.distance)&&(count<= 100)){\n\t\t\t\t\tk = -1;\n\t\t\t\t\tcount++;\n\t\t\t\t\tposX = Math.floor((Math.random()*(cw.c.width-30))+15);\n\t\t\t\t\tposY = Math.floor((Math.random()*(cw.c.height-30))+15);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcount = 0;\n\t\t}else{\n\t\t\tposX = Math.floor((Math.random()*(cw.c.width-30))+15);\n\t\t\tposY = Math.floor((Math.random()*(cw.c.height-30))+15);\n\t\t}\n\t\tcobweb[i][0] = new Nest(posX, posY, (100*posX/cw.c.width), (100*posY/cw.c.height));\n\t\tfor(j=0;j<6;j++){\n\t\t\tif(j<3){\n\t\t\t\tposY = 0;\n\t\t\t}else{\n\t\t\t\tposY = cw.c.height;\n\t\t\t}\n\t\t\tswitch(j){\n\t\t\t\tcase 0:\n\t\t\t\tcase 3:\n\t\t\t\t\tposX2 = cobweb[i][0].x;\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\tcase 4:\n\t\t\t\t\tposX2 = cw.c.width*2/3\n\t\t\t\t\tposX = cw.c.width/3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\tcase 5:\n\t\t\t\t\tposX2 = cw.c.width-cobweb[i][0].x;\n\t\t\t\t\tposX = cobweb[i][0].x;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar gossX = Math.floor((Math.random() * posX2) + posX);\n\t\t\tcobweb[i][1][j] = new Gossmer(\n\t\t\t\tgossX,\n\t\t\t\tposY,\n\t\t\t\t(100*gossX/cw.c.width),\n\t\t\t\t(100*posY/cw.c.height),\n\t\t\t\tcobweb[i][0]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b1e07ebb29e893639c5f3f8b6e157ed7", "score": "0.543789", "text": "function playPauza(koraka) {\n for (let i = 0; i < koraka; i++) {\n /*\n if (paketKendlova.arr1min.length < 301) {\n break;\n } \n NEKA VRSTA BREJKA AKO SMO NA KRAJU KENDL-PAKETA.\n ZASAD NE TREBA, KASNIJE ĆE BIT BITNO.\n */\n let dev5 = devijacija(ss5min, 20);\n let dev15 = devijacija(ss15min, 20);\n let odmakPhi = dev5;\n let odmakLambda = 0.6 * dev5;\n let odmakTau = 0.3 * dev5;\n let kendlic = ss1min[i1-1];\n let iznos = 0.01;\n let cijenaSad = kendlic.C;\n let vrijemeSad = kendlic.datum + ' ' + kendlic.sat + ':' + kendlic.minuta;\n\n for (let i = 0; i < 50; i++) {\n jahanje(portfolio, cijenaSad, iznos, odmakPhi, odmakLambda, odmakTau);\n }\n\n predChartifikacija(ss1min[i1-1], ss15min[i15-1]);\n\n\n ss1min.push(paketKendlova.arr1min.shift());\n if (i1 % 5 === 0) {\n ss5min.push(paketKendlova.arr5min.shift())\n }\n if (i1 % 15 === 0) {\n ss15min.push(paketKendlova.arr15min.shift())\n }\n\n i1++;\n if (i1 % 15 === 0) {\n i15++;\n }\n }\n}", "title": "" }, { "docid": "941e8fade0b1919b51194fd64c723b1a", "score": "0.5434032", "text": "function animate_show_spaghetti(j) {\n //create short-Z element per row j for displaying it \n setting_time_for_element_motion_down()\n myVar = setTimeout(function () {\n //var final_row;\n var row = j;\n var move_x_rows = x_cols_right.length - x_cols_left.length;\n col = col + move_x_rows;\n if (rotate_clockwise.length == 0 || rotate_clockwise.length == 2 || rotate_clockwise.length == 4) {\n //the element points up (spaghetti b a face up)\n if (col <= 0) {\n col = 0\n }\n if (col >= 9) {\n col = 9\n }\n var spaghetti = [];\n var a = \"r\" + row + \"c\" + (col);\n var b = \"r\" + (++row) + \"c\" + (col);\n var c = \"r\" + (++row) + \"c\" + (col);\n var d = \"r\" + (++row) + \"c\" + (col);\n //final_row = 16;\n }\n\n if (rotate_clockwise.length == 1 || rotate_clockwise.length == 3) {\n //(spaghetti, c is central)\n if (col <= 0) {\n col = 0\n }\n if (col >= 9) {\n col = 9\n }\n var spaghetti = [];\n var a = \"r\" + row + \"c\" + (col - 2);\n var b = \"r\" + row + \"c\" + (--col);\n var c = \"r\" + row + \"c\" + (++col);\n var d = \"r\" + row + \"c\" + (++col);\n //final_row = 19;\n col = col - 1\n }\n calculate_landing_grid_row_show_hide_element()\n spaghetti.push(a, b, c, d);\n a = spaghetti;\n x_cols_right = [];\n x_cols_left = [];\n square = [];\n for (l in a) {\n document.getElementById(a[l] + \"\").className = \"orange\"\n }\n if (j == final_row_show_function) {\n clearTimeout(myVar);\n return;\n }\n animate_show_spaghetti(j + 1)\n }, time_show)\n}", "title": "" }, { "docid": "ea4702fb7c90a56266c766e60f16cf3a", "score": "0.5429903", "text": "function printMetinisPajamuDydis () {var alga=Atlyginimas*12; console.log(\"metines pajamos:\",alga);\n}", "title": "" }, { "docid": "4ae02558a943ea3c3f85a2854baeaabb", "score": "0.5426244", "text": "pegouMoeda(moedas) {\n\t\tlet posicaoXMoeda = moedas.x+35;\n\t\tlet alturaMoeda = height-280;\n\t\t//let verMoeda = circle(moedas.x+35, alturaMoeda, 50);\n\t\tconst moedinha = collideCircleCircle(this.x+50,this.y+75,100, posicaoXMoeda, alturaMoeda, 50);\n\t\treturn moedinha;\n\t}", "title": "" }, { "docid": "fe1c4c5c24299d5e5bc598c290db35fb", "score": "0.54221976", "text": "function penguin( pos_x, pos_y, scale_x, scale_y ){\n\n// Penguin with balloon *****************************************\n// scale and position\n translate( pos_x, pos_y );\n scale( scale_x, scale_y );\n\n// penquin body\n\n push();\n fill('black');\n stroke('black');\n ellipse(300,350, 75, 275);\n pop();\n\n push();\n fill('white');\n stroke('black');\n ellipse(300, 350, 60, 175);\n\n pop();\n\n//head*************************************************************\n\n push();\n strokeWeight(1);\n fill('black');\n stroke('black');\n ellipse(300, 250, 75, 75);\n pop();\n\n push();\n strokeWeight(1);\n fill('white');\n stroke('black');\n ellipse(300, 260, 63, 63);\n pop();\n\n//nose\n push();\n strokeWeight(1);\n stroke('black');\n fill('rgb(222, 91, 7)');\n triangle(300, 260, 290, 270, 310, 270);\n pop();\n\n//eyes\n push();\n strokeWeight(1);\n stroke('black');\n fill('white');\n ellipse(287,250,15,15);\n pop();\n\n push();\n strokeWeight(1);\n stroke('black');\n fill('white')\n ellipse(312,250,15,15);\n pop();\n\n push();\n strokeWeight(1);\n stroke('black');\n fill('blue');\n ellipse(287,250,10,10);\n pop();\n\n push();\n strokeWeight(1);\n stroke('black');\n fill('blue');\n ellipse(312,250,10,10);\n pop();\n\n push();\n strokeWeight(1);\n stroke('black');\n fill('black');\n ellipse(312,250,5,5);\n pop();\n\n push();\n strokeWeight(1);\n stroke('black');\n fill('black');\n ellipse(287,250,5,5);\n pop();\n\n//arm left\n\n push();\n strokeWeight(25);\n stroke('black');\n line(265,285,265,390);\n pop();\n\n//arm right\n\n push();\n strokeWeight(25);\n stroke('black');\n line(340,285,340,365);\n strokeWeight(20);\n stroke('black');\n line(342,365,390,330);\n\n pop();\n\n//feet\n\n push();\n strokeWeight(15);\n stroke('black');\n fill('rgb(222, 91, 7)');\n ellipse(300, 475, 75, 20);\n pop();\n// end body\n\n}", "title": "" }, { "docid": "7cf8286a74eb08dc0f8ab71d6d55078a", "score": "0.54195344", "text": "function show(i){\n if (i>2){\n $(\".container\").append(`<img id=\"${i}\" class=\"mooncake\" src=\"mooncake.png\">`)\n $(`#${i}`).css({'top':randomY()})\n $(`#${i}`).animate({left:'-15%'},{\n duration:randomSpeed(),\n step: function() {\n if ( $(this).css('left') >= (`${startX}px`) && $(this).css('left') <= (`${startX+100}px`)) {\n let y = $(this).offset().top\n let rabStart = $('#rabbit').offset().top\n let rabEnd = rabStart+116\n if ( (rabStart) <= y && y <= rabEnd ){\n $(this).remove()\n scoreAdd($(this).attr('id'))\n }\n }\n }\n })\n }\n}", "title": "" }, { "docid": "c83233109611a14a7fd7bed0613b8673", "score": "0.54075813", "text": "function macro_nutrients(calories, weight) {\n let protein = weight;\n calories-=protein*4;\n\n let fats = 0.35*weight;\n calories -= fats*9;\n\n let carbs = calories/4;\n\n return {\n protein: Math.round(protein),\n carbs: Math.round(carbs),\n fats: Math.round(fats)\n };\n}", "title": "" }, { "docid": "8b1655765dde5bfd7cea5015b7637528", "score": "0.5405373", "text": "function imonesPelnas() {\n let pelnas=imonesPajamos - imonesIslaidos - tomoAtlyginimas() - antanoAtlyginimas() - poviloAtlyginimas()\n return pelnas\n}", "title": "" }, { "docid": "5b4fffaf6f85c09a4e4ad9e6ebb2001f", "score": "0.54039377", "text": "function displayToppingStrawberryCup2() {\n image(toppingStrawberryCup2Img, 0, 0, 1000, 500);\n}", "title": "" }, { "docid": "d94140e1d861147dba51bc09d8318341", "score": "0.5401831", "text": "function secondeRotation(i) {\r\n let needle_big = document.getElementById(`needle_big_${i}`)\r\n needle_big.style.transform = `rotate(${chrono_secondes_count[i]*6}deg)`\r\n}", "title": "" }, { "docid": "ebc758b41c21aec7d61eacf4f05d4ed4", "score": "0.53978634", "text": "function metinesPajamos () { // funkcija metinem pajamom apskaiciuoti paimant sumas is senesniu skaiciavimu\n var metuPajamos= algaRankose*12;\n // console.log ( atsakymas*12);\n console.log (\"gaunama\", +metuPajamos + \" \"+ \"eur\" + \" \" + \"i\" + \" \" + \"rankas\" + \" \" + \"per\" + \" \" + \"metus\");\n}", "title": "" }, { "docid": "a61984b6a7d22d0921b3b6df0dd477e9", "score": "0.5392246", "text": "function gotHim() {\n push();\n textSize(30);\n fill(255, 50, 50);\n textAlign(CENTER, CENTER);\n text(\n `You got him!\n Until next time...`,\n width / 2,\n height / 2\n );\n pop();\n}", "title": "" }, { "docid": "812e369e1ed6a2465bb9816ce34b2a3a", "score": "0.5391879", "text": "function pyramid2(altura) {\n for (let i = 0; i < altura; i++) {\n let piso = '';\n\n // El problema aqui es que en los dos bucles tengo basicamente el mismo codigo\n // Seria mejor sacarlo a una funcion\n\n for (let j = 0; j < altura - (i + 1); j++) {\n piso = piso + ' ';\n }\n\n for (let j = 0; j < i + 1; j++) {\n piso = piso + '*';\n }\n\n console.log(piso);\n }\n}", "title": "" }, { "docid": "7dce393e554a224521f6eea5cd2d2ad5", "score": "0.5386935", "text": "function kata13() {\n /* Dyslexia strikes. Thirteenth exercise and the number we need to use is twelve. */\n return renderDOM(13, bestThing.slice(bestThing.length - 12) );\n}", "title": "" }, { "docid": "fe1f9b745416517bb569532250cdae57", "score": "0.53810537", "text": "function g(e,t,n,r){var a={s:[\"thodde secondanim\",\"thodde second\"],ss:[e+\" secondanim\",e+\" second\"],m:[\"eka mintan\",\"ek minute\"],mm:[e+\" mintanim\",e+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[e+\" horanim\",e+\" horam\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disanim\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineanim\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsanim\",e+\" vorsam\"]};return t?a[n][0]:a[n][1]}", "title": "" }, { "docid": "0b18146c99249a5d0f60e6e192935786", "score": "0.53777206", "text": "function imc(peso, altura) {\n const imc = peso / (altura ** 2);\n console.log(imc);\n}", "title": "" }, { "docid": "10639e11ce715fac9c802b6624ce684a", "score": "0.5377252", "text": "function escalagraduadaY3(x0,y0,tamanho,escala,cor){\r\n\tvar valor = 0;\r\n\tvar passo = 0;\r\n\tvar i;\r\n\tvar dy = 5;\t\r\n\tvar ex;\t\r\n\tfor (i=0;i <= tamanho;i++){\r\n\t\tif(valor>=0){\r\n\t\t\tex = -6;\r\n\t\t}else{\r\n\t\t\tex = 0;\r\n\t\t}\r\n\t\tescrever8(valor,x0 + ex,y0 - dy + passo, cor);\t\r\n\t\tpasso = passo + 40;\t\r\n\t\tvalor = valor + escala;\r\n\t}\r\n}", "title": "" }, { "docid": "93c5076e334b3e112314c1bf40cd4231", "score": "0.53764355", "text": "function clic(cellule)\n{\n /* if (playpause ==0 ) // A mettre que quand mode pause et car la fonctionne quand quand start marche et on peux pas faire avant le jeu\n {*/\n var idCellule = cellule.id;\n var indexTiret = idCellule.indexOf(\"_\");\n var i = parseInt(idCellule.substring(0, indexTiret));\n var j = parseInt(idCellule.substring(indexTiret+1));\n if (cellule.className==\"mort\")\n {\n cellule.className=\"vivant\" + (Math.round(Math.random()*3)+palette);\n etat1[i][j]=1;\n \n if (typejeu == 1 || typejeu == 2)\n {\n compteurscore = compteurscore - 1;\n prog();\n /*document.getElementById(\"scorejeu\").innerHTML = compteurscore ;*/\n }\n }\n else\n {\n cellule.className=\"mort\";\n etat1[i][j]=0;\n \n // IF Jeu mange scor, compteur ++ \n if (typejeu == 1 || typejeu == 2)\n {\n compteurscore = compteurscore + 2;\n prog();\n console.log(compteurscore);\n /*document.getElementById(\"scorejeu\").innerHTML = compteurscore ;*/\n }\n }\n /* }*/\n}", "title": "" }, { "docid": "3af32f24a62bba3970a9169c6b7875e4", "score": "0.5375", "text": "function musicCredit(){\n textSize(25);\n textAlign(CENTER);\n fill(200,200,200,fade);\n textFont(\"monospace\");\n text(`Music: The Stealer Orchestra Version - MeiMei Zhu`, 400, 690);\n if(fade > 255){\n fadeAmonut = -0.5;\n }\n fade += fadeAmonut;\n}", "title": "" }, { "docid": "967cc3d8715f91bbc20b3ac3136f8373", "score": "0.536955", "text": "function page13() {\n\n background('lightblue');\n strokeWeight('1');\n fill('oldlace');\n stroke('oldlace');\n ellipse(icecreamX, icecreamY, 132, 132);\n fill('peru');\n stroke('peru');\n triangle(coneX, coneY, coneX + 60, coneY + 180, coneX + 120, coneY);\n\n\n stroke('green');\n fill('green');\n ellipse(250, 140, 8, 8);\n stroke('red');\n fill('red');\n ellipse(233, 155, 8, 8);\n stroke('blue');\n fill('blue');\n ellipse(320, 130, 8, 8);\n stroke('orange');\n fill('orange');\n ellipse(269, 119, 8, 8);\n stroke('blue');\n fill('blue');\n ellipse(276, 145, 8, 8);\n stroke('red');\n fill('red');\n ellipse(290, 135, 8, 8);\n stroke('green');\n fill('green');\n ellipse(320, 150, 8, 8);\n\n fill('burlywood');\n stroke('burlywood');\n ellipse(238, 117, 52, 52);\n fill('sienna');\n ellipse(238, 127, 5, 5);\n ellipse(228, 117, 5, 5);\n ellipse(238, 106, 5, 5);\n ellipse(248, 117, 5, 5);\n\n\n\n}", "title": "" }, { "docid": "0871fd6dfc848ea0e44db6e8b0ac6e75", "score": "0.53601927", "text": "function v(e,t,a,n){var r={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[e+\" mintanim\",e+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[e+\" horanim\",e+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disanim\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineanim\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsanim\",e+\" vorsam\"]};return t?r[a][0]:r[a][1]}", "title": "" }, { "docid": "0871fd6dfc848ea0e44db6e8b0ac6e75", "score": "0.53601927", "text": "function v(e,t,a,n){var r={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[e+\" mintanim\",e+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[e+\" horanim\",e+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disanim\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineanim\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsanim\",e+\" vorsam\"]};return t?r[a][0]:r[a][1]}", "title": "" }, { "docid": "c53c95c869ecc88ced8544568a23d4b8", "score": "0.5358621", "text": "function Conversor() {\n let medida = parseInt(window.prompt(\"ingrese la medida en metros\"));\n let pies = 3.2808 * medida;\n let centimetro = 100 * medida;\n let pulgadas = 39.37008 * medida;\n alert(\"resultado en pies\" + pies + \"centimetros\" + centimetro + \"pulgadas \" + pulgadas)\n}", "title": "" }, { "docid": "70e1bdd09ff414ca9ac3be4aaa432e43", "score": "0.5352288", "text": "function swim() {\n data.totalFlex += data.totalSwimSpeed;\n data.totalCurrent += data.totalSwimSpeed;\n $(\"#fishie\").css({ 'transform': 'skew(' + data.totalFlex + 'deg)'});\n $(\"#fishie\").css({ 'transform': 'rotateX(' + data.totalFlex + 'deg)'});\n updateReport();\n}", "title": "" }, { "docid": "f75ec61ee0886ddb742afb645a3869f9", "score": "0.5351716", "text": "function miniMelissaCalculator() {\n if (footLength >= 4 && footLength <= 6.5) {\n if (footLength <= 4.53) {\n miniMelissa = \"Size 5\";\n } else if (footLength <= 4.92) {\n miniMelissa = \"Size 6\";\n } else if (footLength <= 5.31) {\n miniMelissa = \"Size 7\";\n } else if (footLength <= 5.71) {\n miniMelissa = \"Size 8\";\n } else if (footLength <= 6.1) {\n miniMelissa = \"Size 9\";\n } else if (footLength <= 6.5) {\n miniMelissa = \"Size 10\";\n }\n } else {\n miniMelissa = \"no results\";\n }\n}", "title": "" }, { "docid": "aa7ef5dbc1f56b115cad9c19afa3bff6", "score": "0.53504467", "text": "function dispenseRainbowChocolates(number) {\n\n}", "title": "" }, { "docid": "9af08df0e473e6ae2a44744df774883c", "score": "0.53492206", "text": "function smileyFace() {\n stroke(0,0,255);\n strokeWeight(6);\n noFill();\n ellipse(width/2, height/2+100, 400, 400);\n arc(width/2, height/2+100, 250, 250, PI/10, 9*PI/10);\n fill(0,0,255);\n ellipse(width/2-60, height/2+10, 30, 30);\n ellipse(width/2+60, height/2+10, 30, 30);\n}", "title": "" }, { "docid": "254f19268c40883f373174be1c12bc54", "score": "0.5344192", "text": "function janelaTelaCheia() {}", "title": "" }, { "docid": "c8398dc12c7b0b340f374fd8c288d0c8", "score": "0.53441495", "text": "function je(e,t,n){if(0===n)return e;n=(n-n%90)%360;var o,i,a,r,l=e.x,s=e.y;switch(n){case 90:l=t.height-e.y-e.height,s=e.x;break;case 180:l=t.width-e.x-e.width,s=t.height-e.y-e.height;break;case 270:l=e.y,s=t.width-e.x-e.width}return o=l,i=s,a=90===n||270===n?e.height:e.width,r=90===n||270===n?e.width:e.height,{x:o,y:i,width:a,height:r}}", "title": "" }, { "docid": "f23ef9b2a6cd49ee03ac1b703f461abd", "score": "0.5341738", "text": "showHand(painter) {\n return (x, y) => {\n let defaultShow = () => painter.rect(x, y, STAGE_WIDTH * 32, (STAGE_HEIGHT - 2) * 32)\n .clip(this.nexts[0].map((quark, num) => {\n return quark.show(painter, x + 32 * (this.handPos[0] + (num % 2)), y + 32 * (this.handPos[1] + Math.floor(num / 2) - 2));\n }).reduce((a, b) => a.bind(_ => b)));\n return this.phase.match({\n wait: (_) => M_IO.unit(),\n move: defaultShow,\n turn: (direction, counter) => {\n let ease = Tween.ease(Tween.in(Tween.sinusoidal))(5 - counter, 0, Math.PI / 2, 5),\n vectors = [[-0.5, -0.5], [0.5, -0.5], [-0.5, 0.5], [0.5, 0.5]];\n return painter.rect(x, y, STAGE_WIDTH * 32, (STAGE_HEIGHT - 2) * 32)\n .clip(this.nexts[0].map((quark, num) => {\n return quark.show(painter, x + 32 * (this.handPos[0] + 0.5 + vectors[num][0] * Math.cos(ease) - direction * vectors[num][1] * Math.sin(ease)), y + 32 * (this.handPos[1] - 2 + 0.5 + direction * vectors[num][0] * Math.sin(ease) + vectors[num][1] * Math.cos(ease)));\n }).reduce((a, b) => a.bind(_ => b)));\n },\n land: defaultShow,\n clear: (_) => M_IO.unit(),\n fall: (_) => M_IO.unit()\n });\n };\n }", "title": "" }, { "docid": "d5ec98cd4559be25cfccab401361b143", "score": "0.5341297", "text": "function modista(metros){\n const pulg\n pulg=0.0254\n return metros/pulg \n}", "title": "" }, { "docid": "feec7e80c81d656a39d78206e8601808", "score": "0.5339416", "text": "function createTopper(title){\n\t\t\tctx.clearRect(0,0,352,626);\n\n\t\t\tcanvas.height = 352;\n\t\t\tcanvas.width = 626;\n\t\t\tw = 626;\n\t\t\th = 352;\n\t\t\t\n\t\t\tvar ignbox = {};\n\t\t\tignbox.x = Math.round(w * (4.6/9));\n\t\t\tignbox.y = Math.round(h * (1/9));\n\t\t\tignbox.w = Math.round(w * (4/9));\n\t\t\tignbox.h = Math.round(h * (1.65/9));\n\t\t\t\n\t\t\tctx.fillStyle = '#c42323';\n\t\t\tctx.fillRect(ignbox.x, ignbox.y, ignbox.w, ignbox.h);\n\t\t\t\n\t\t\tarc_radius = 5;\n\t\t\tctx.clearRect(ignbox.x - arc_radius, ignbox.y - arc_radius, arc_radius * 2, arc_radius * 2);\n\t\t\tctx.clearRect(ignbox.x - arc_radius, ignbox.y + ignbox.h - arc_radius, arc_radius * 2, arc_radius * 2);\n\t\t\tctx.clearRect(ignbox.x + ignbox.w - arc_radius, ignbox.y + ignbox.h - arc_radius, arc_radius * 2, arc_radius * 2);\n\t\t\tctx.clearRect(ignbox.x + ignbox.w - arc_radius, ignbox.y - arc_radius, arc_radius * 2, arc_radius * 2);\n\t\t\t\t\t\t\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(ignbox.x + arc_radius, ignbox.y + arc_radius, arc_radius, 0, 2 * Math.PI);\n\t\t\tctx.arc(ignbox.x + arc_radius, ignbox.y + ignbox.h - arc_radius, arc_radius, 0, 2 * Math.PI);\n\t\t\tctx.arc(ignbox.x + ignbox.w - arc_radius, ignbox.y + ignbox.h - arc_radius, arc_radius, 0, 2 * Math.PI);\n\t\t\tctx.arc(ignbox.x + ignbox.w - arc_radius, ignbox.y + arc_radius, arc_radius, 0, 2 * Math.PI);\n\t\t\tctx.fill();\n\t\t\t\n\t\t\tctx.fillStyle = 'white';\n\t\t\tctx.font= \" normal small-caps bolder 38px arial\";\n\t\t\tctx.fillText( 'GO TO IGN', Math.round(w * (5.65/10)), Math.round(h * (2.4/10)));\n\t\t\t\n\t\t\tctx.font= \" 30px arial\";\n\t\t\tctx.lineWidth = 4;\n\t\t\tctx.strokeStyle = \"black\";\n\t\t\tctx.strokeText(title, Math.round(w * (0.2/9)), Math.round(h * (8/9)));\n\t\t\tctx.fillText(title, Math.round(w * (0.2/9)), Math.round(h * (8/9)));\n\t\t\treturn canvas.toDataURL(\"image/png\");\t\t\t\t \n\t\t\n\t\t}", "title": "" }, { "docid": "563f68bfab54b006b83eca0dabeba792", "score": "0.5336791", "text": "function size_s(x,y,ml,ms) {\nvar c = '';\n for (var i = 0; i < ml; i++) {\n \n for (var j = 0; j < ms; j++) {\n c += x;\n }\n c+=y;\n } return c;\n}", "title": "" }, { "docid": "c535267e4106fe2301d3a8deb0ae90de", "score": "0.5335853", "text": "function setImP(){\n for(var i=0; i<cols * rows; ++i) {\n var c = Math.floor(i /rows);\n var r = i %rows; //posisi gambar dalam canvas\n //add in $posisi_potongan object with positions of pieces in image\n posisi_potongan.push({px:c *ukuran_potongan.w, py:r * ukuran_potongan.h, tx:c *ukuran_wadah.w, ty:r *ukuran_wadah.h, id:i, rotate: 0});\n }\n for(var j, x, i = posisi_potongan.length; i; j = Math.floor(Math.random() * i), x = posisi_potongan[--i], posisi_potongan[i] = posisi_potongan[j], posisi_potongan[j] = x); //shuffle array\n setTL(); //mengatur canvas wadah\n }", "title": "" }, { "docid": "812cb9ecd7fb97317e65fbd3f53560f9", "score": "0.53328365", "text": "function extraire_zone(enrs, inf, sup, ord, e, vitesse_animation) {\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.add('interdit');\n });\n let par = enrs[0].parentElement;\n let cpt = 0;\n let cpt_now = 0;\n let nbr_animation = 0;\n let consider_inf = true;\n let consider_sup = true;\n let bad = [];\n if (inf === -1) {\n consider_inf = false;\n }\n if (sup === -1) {\n consider_sup = false\n }\n if (!ord) {\n while (cpt < enrs.length) {\n animer_alg([5]);\n let key_now = Number(enrs[cpt].querySelector('.key').innerText);\n setTimeout(() => {\n anime({\n targets: Array.from(enrs[cpt_now].children),\n backgroundColor: \"#333\",\n duration: vitesse_animation / 2,\n direction: 'alternate',\n });\n cpt_now++;\n }, nbr_animation * vitesse_animation);\n nbr_animation++;\n if ((consider_sup && consider_inf && key_now >= inf && key_now <= sup) || (consider_inf && !consider_sup && key_now >= inf) || (consider_sup && !consider_inf && key_now <= sup)) {\n setTimeout(() => {\n set_comment(enrs[cpt_now - 1].querySelector('.key').innerText + \" appartient à : [ \" + inf + \" ,\" + sup + \" ]\");\n anime({\n targets: Array.from(enrs[cpt_now - 1].children),\n backgroundColor: \"#00ff00\",\n });\n }, nbr_animation * vitesse_animation);\n nbr_animation++;\n } else {\n setTimeout(() => {\n set_comment(enrs[cpt_now - 1].querySelector('.key').innerText + \" est hors : [ \" + inf + \" ,\" + sup + \" ]\");\n anime({\n targets: Array.from(enrs[cpt_now - 1].children),\n keyframes: [\n { translateX: get_width_children(enrs[0].children) },\n ],\n duration: vitesse_animation,\n });\n anime({\n targets: Array.from(enrs[cpt_now - 1].children),\n backgroundColor: \"#ff0000\",\n });\n animer_alg([7, 8, 9, 10]);\n setTimeout(() => {\n non_animer_alg([7, 8, 9, 10]);\n }, vitesse_animation);\n }, nbr_animation * vitesse_animation);\n bad.push(cpt);\n nbr_animation++;\n }\n cpt++;\n }\n let indice_now = 0;\n cpt = 0;\n let cpt_now2 = 0;\n let new_z = [];\n while (cpt < enrs.length) {\n if (cpt === 0) {\n setTimeout(() => {\n non_animer_alg([5]);\n animer_alg([12]);\n }, nbr_animation * vitesse_animation);\n }\n setTimeout(() => {\n set_comment(\"Réorganisation par décalage en cours .....\");\n }, nbr_animation * vitesse_animation)\n if (bad.indexOf(cpt) !== -1) {\n\n setTimeout(() => {\n anime({\n targets: enrs[cpt_now2],\n opacity: \"0\",\n easing: 'steps(2)'\n });\n cpt_now2++;\n }, nbr_animation * vitesse_animation);\n nbr_animation++;\n\n } else {\n setTimeout(() => {\n anime({\n targets: Array.from(enrs[cpt_now2].children),\n keyframes: [\n { translateX: get_width_children(enrs[0].children) },\n { translateY: get_x_y(enrs[indice_now]).y - get_x_y(enrs[cpt_now2]).y },\n { translateX: 0 },\n ],\n duration: vitesse_animation * 3,\n });\n cpt_now2++;\n indice_now++;\n }, nbr_animation * vitesse_animation);\n nbr_animation += 3;\n }\n cpt++;\n }\n setTimeout(() => {\n non_animer_alg([12]);\n animer_alg([13]);\n set_comment(\"l'éxtraction est terminée \");\n showalert(\"l'extraction est terminée\", \"#00ff00\");\n setTimeout(() => {\n non_animer_alg([13]);\n animer_alg([14]);\n }, 3000);\n new_z = new_zone(enrs, bad);\n renouveler(enrs, new_z);\n }, nbr_animation * vitesse_animation);\n nbr_animation++;\n setTimeout(() => {\n set_comment(\"FIN ...\");\n setTimeout(() => {\n fermer_fentre_comment();\n }, 300);\n add_retour_btn(par);\n }, nbr_animation * vitesse_animation);\n nbr_animation += 3;\n setTimeout(() => {\n if (document.querySelectorAll('.ENR').length !== 0) {\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.remove('interdit');\n });\n } else {\n ouvrir_fentre_comment();\n set_comment(\"Vous n'avez maintenat aucune zone à manipuler , la création devient la seule opération disponible\");\n document.querySelector('#create').classList.remove('interdit');\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.add('interdit');\n });\n }\n\n }, nbr_animation * vitesse_animation);\n } else {\n // pour INF\n let fausse_input = document.createElement('input');\n fausse_input.value = inf;\n animer_alg([6]);\n let info = start_recherche_dico(e, fausse_input, false, vitesse_animation);\n setTimeout(() => {\n set_comment(\" Recheche dichotomique de la clé Min : \" + inf);\n }, 500);\n let nbr_animation = info[0];\n nbr_animation += 2;\n let indice_inf = info[1];\n if (indice_inf >= 0 && indice_inf <= enrs.length - 1) {\n setTimeout(() => {\n set_comment(\"Exclure les Mins ...\");\n non_animer_alg([6]);\n for (let i = 0; i < indice_inf; i++) {\n anime({\n targets: Array.from(enrs[i].children),\n keyframes: [\n { translateX: get_width_children(enrs[0].children) },\n ],\n backgroundColor: '#ff0000',\n duration: vitesse_animation,\n });\n }\n }, nbr_animation * vitesse_animation);\n nbr_animation += 2;\n }\n // POUR SUP\n let indice_sup = 0;\n setTimeout(() => {\n let animation_interne = 1;\n let cpt = 0;\n while (cpt < enrs.length) {\n let children = Array.from(enrs[cpt].children);\n let cpt2 = 0;\n while (cpt2 < children.length) {\n children[cpt2].style.backgroundColor = \"#86E8E7\";\n cpt2++;\n }\n cpt++;\n animer_alg([8]);\n }\n let fausse_input = document.createElement('input');\n fausse_input.value = sup;\n let info = start_recherche_dico(e, fausse_input, false);\n setTimeout(() => {\n set_comment(\"Recherche dichotomique de la cle Max :\" + sup);\n }, 500);\n animation_interne += info[0];\n indice_sup = info[1] - 1;\n if (indice_sup >= 0 && indice_sup <= enrs.length - 1) {\n setTimeout(() => {\n set_comment(\"Exclure les Sups ...\");\n for (let i = indice_sup + 1; i < enrs.length; i++) {\n anime({\n targets: Array.from(enrs[i].children),\n keyframes: [\n { translateX: get_width_children(enrs[0].children) },\n ],\n backgroundColor: '#ff0000',\n duration: vitesse_animation,\n });\n }\n non_animer_alg([8]);\n }, animation_interne * vitesse_animation);\n animation_interne++;\n }\n let keys = print_keys(enrs);\n cpt = 0;\n let cpt_now = 0;\n while (Number(keys[cpt]) < inf) {\n setTimeout(() => {\n animer_alg([10, 11, 12, 13]);\n anime({\n targets: Array.from(enrs[cpt_now].children),\n opacity: \"0\",\n easing: 'steps(2)',\n duration: vitesse_animation\n });\n cpt_now++;\n }, animation_interne * vitesse_animation);\n cpt++;\n animation_interne++;\n }\n setTimeout(() => {\n non_animer_alg([10, 11, 12, 13]);\n for (let i = indice_inf; i <= indice_sup; i++) {\n if (i !== indice_inf && i !== indice_sup) {\n anime({\n targets: Array.from(enrs[i].children),\n backgroundColor: '#00ff00',\n duration: vitesse_animation\n });\n } else {\n anime({\n targets: Array.from(enrs[i].children),\n backgroundColor: '#00ff00',\n duration: vitesse_animation,\n });\n }\n }\n }, animation_interne * vitesse_animation);\n animation_interne++;\n cpt = 0;\n while (Number(keys[cpt]) <= sup) {\n cpt++;\n }\n let cpt_now_sup = cpt;\n while (cpt < enrs.length) {\n setTimeout(() => {\n animer_alg([14, 15, 16, 17]);\n anime({\n targets: enrs[cpt_now_sup],\n opacity: \"0\",\n easing: 'steps(2)',\n duration: vitesse_animation,\n });\n cpt_now_sup++;\n }, animation_interne * vitesse_animation);\n cpt++;\n animation_interne++;\n }\n setTimeout(() => {\n non_animer_alg([14, 15, 16, 17]);\n set_comment(\"Reorganisation ....\");\n deplacer_tout_up(enrs, indice_inf, indice_sup, vitesse_animation);\n animer_alg([18]);\n }, animation_interne * vitesse_animation);\n animation_interne += 4;\n setTimeout(() => {\n let keys = print_keys(enrs);\n let bad = [];\n for (let i = 0; i < enrs.length; i++) {\n if (Number(keys[i]) < inf || Number(keys[i]) > sup) {\n bad.push(i);\n }\n }\n let new_z = new_zone(enrs, bad);\n renouveler(enrs, new_z);\n non_animer_alg([18]);\n animer_alg([19]);\n set_comment(\"L'extraction est terminée ...\");\n showalert(\"L'extraction est terminée !!\", \"#00ff00\");\n setTimeout(() => {\n set_comment(\"FIN ...\");\n setTimeout(() => {\n fermer_fentre_comment();\n }, 500);\n $(\"#extraire_menu\").fadeOut();\n if (document.querySelectorAll('.ENR').length !== 0) {\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.remove('interdit');\n });\n } else {\n setTimeout(() => {\n ouvrir_fentre_comment();\n set_comment(\"Vous n'avez maintenant aucune zone à manipuler , la création devient la seule opération disponible\");\n document.querySelector('#create').classList.remove('interdit');\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.add('interdit');\n });\n }, 1000);\n\n }\n }, vitesse_animation);\n setTimeout(() => {\n non_animer_alg([19]);\n animer_alg([20]);\n\n }, 3000);\n }, animation_interne * vitesse_animation);\n animation_interne++;\n setTimeout(() => {\n add_retour_btn(par);\n }, animation_interne * vitesse_animation);\n animation_interne++;\n }, nbr_animation * vitesse_animation);\n nbr_animation += 2;\n\n }\n}", "title": "" }, { "docid": "26ffb6479895941d84dacf9a344b8f85", "score": "0.5330335", "text": "function y(e,t,n,r){var a={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[e+\" mintanim\",e+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[e+\" horanim\",e+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disanim\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineanim\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsanim\",e+\" vorsam\"]};return t?a[n][0]:a[n][1]}", "title": "" }, { "docid": "8244d332bee08b5a7b95f84728dfc153", "score": "0.53260386", "text": "function woodCalculator(length, width, thickness){\r\n var boardFeetInch = length*width*thickness;//All of the dimensions in this formula are in inches\r\n var boardFeet = boardFeetInch/144;\r\n var totalCost = boardFeet * 18;// 1 boardfeet cost is $18\r\n return totalCost;\r\n}", "title": "" }, { "docid": "9832b0671a3f7bbefafbc16dfdc324aa", "score": "0.53259134", "text": "function kata5() {\n // implemente o código do kata 5 aqui\n exercise = 'Exibir os números ímpares de 25 a -25:'\n let result = []\n let value = 0\n for(let i = 1; value > -25; i++) {\n value = -2 * i + 27\n result.push(value)\n }\n\n return showResults(result, exercise)\n}", "title": "" }, { "docid": "8c6de23f2bf3be7b771d709f3ac12994", "score": "0.5317921", "text": "function getKlasesPazymiuVidurkis() {\n let y1=getPazymiuVidurkis2(10,5,4,10,5);\n let y2=getPazymiuVidurkis2(10,5,4,10,5);\n let y3=getPazymiuVidurkis2(10,5,4,10,5);\n let y4=getPazymiuVidurkis2(10,5,4,10,5);\n let y5=getPazymiuVidurkis2(10,5,4,10,5);\n let sumasuma=(y1+y2+y3+y4+y5)/5;\n\nreturn sumasuma\n}", "title": "" }, { "docid": "080748b82d1d7052c0a2f7438051553e", "score": "0.5317573", "text": "function ply () {\n height = document.getElementById('ply').value\n height = parseInt(height)\n number = width * height\n document.getElementById('para').innerHTML =\n 'Final Result is below'\n document.getElementById('paragraph').innerHTML =\n number\n}", "title": "" }, { "docid": "8c77a4ce71f186398a8ae60ffbece276", "score": "0.5306445", "text": "function drawNotoStairs() {\n drawChillerbox();\n text(\"But what about the puppy? Press S to start again.\", 25, 25, 400, 300);\n}", "title": "" }, { "docid": "93b8f20ccb615653296b7d72395bcbfa", "score": "0.53052926", "text": "function X(e,t,a,n){var s={s:[\"thodde secondanim\",\"thodde second\"],ss:[e+\" secondanim\",e+\" second\"],m:[\"eka mintan\",\"ek minute\"],mm:[e+\" mintanim\",e+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[e+\" voranim\",e+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disanim\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineanim\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsanim\",e+\" vorsam\"]};return t?s[a][0]:s[a][1]}", "title": "" }, { "docid": "e9c317f24ecbe713596768db7f509bd7", "score": "0.53045666", "text": "function konversiMenit(menit) {\n // you can only write your code here!\n var jam = 0;\n var sisamenit = 0;\n var jammenit = ''\n jam = Math.trunc(menit/60);\n sisamenit = menit - (jam * 60);\n var tolong = sisamenit.toString();\n if (tolong.length === 2){\n return jammenit.concat(jam + ':' + sisamenit);\n } else if (tolong.length === 1){\n tolong = '0'.concat(tolong);\n return jammenit.concat(jam + ':' + tolong);\n } else {\n return 'error';\n }\n}", "title": "" }, { "docid": "03561e36ae6b5747559066f55be327ed", "score": "0.5303851", "text": "function y(e,t,n,r){var o={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[e+\" mintanim\",e+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[e+\" horanim\",e+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disanim\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineanim\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsanim\",e+\" vorsam\"]};return t?o[n][0]:o[n][1]}", "title": "" }, { "docid": "428c63f6dc0494287ada235210171fe7", "score": "0.5302154", "text": "nice() {\n return '┏' + text.alignCenter('[Slimp3]', this.size, '━') + '┓\\n┃' + this.visual().join('┃\\n┃') + '┃\\n┗' + '━'.repeat(this.size) + '┛'\n }", "title": "" }, { "docid": "ce2af016947482a9a4e46edacb548453", "score": "0.52993387", "text": "function imc(peso, altura) {\n const imc = peso / altura ** 2;\n console.log(imc);\n}", "title": "" }, { "docid": "ce2af016947482a9a4e46edacb548453", "score": "0.52993387", "text": "function imc(peso, altura) {\n const imc = peso / altura ** 2;\n console.log(imc);\n}", "title": "" }, { "docid": "d1a0b90044b8169e139d4f176e512e8a", "score": "0.5297105", "text": "ThreeOfaKind(){\n return (((13*4)*(12*48)*(11*4))/2)/2598960\n }", "title": "" }, { "docid": "627b4c39a0ad73302f3bf9a4664cf21c", "score": "0.52968603", "text": "function getSnakeHeader(width, height) {\n var img = document.createElement('canvas');\n var ctx = img.getContext('2d');\n var dis = 2;\n img.width = width + dis * 2;\n img.height = height + dis * 2;\n var eyeRadius = width * 0.2;\n function drawEye(eyeX, eyeY) {\n ctx.beginPath();\n ctx.fillStyle = '#fff';\n ctx.strokeStyle = '#000';\n ctx.arc(eyeX, eyeY, eyeRadius, 0, Math.PI * 2);\n ctx.fill();\n ctx.stroke();\n // eyehole\n ctx.beginPath();\n ctx.fillStyle = '#000';\n ctx.arc(eyeX, eyeY - eyeRadius / 2, eyeRadius / 4, 0, Math.PI * 2);\n ctx.fill();\n }\n // left eye\n drawEye(img.width / 2 - width / 2 + eyeRadius, img.height / 2 - height / 2 + eyeRadius);\n // right eye\n drawEye(img.width / 2 + width / 2 - eyeRadius, img.height / 2 - height / 2 + eyeRadius);\n return img;\n}", "title": "" }, { "docid": "843a13222af90b9db56cba1b638bea0b", "score": "0.5294701", "text": "function doSummer(height) {\n return h + 1;\n}", "title": "" }, { "docid": "658d5b634aa3665a2c1cce91ce04ab6e", "score": "0.529366", "text": "function getSheeps() {\n\t\tvar sheeps = 25;\n\t\tconsole.log(`The number of sheeps are ${sheeps}.`)\n\t}", "title": "" }, { "docid": "e8d272095ef6e94357ec0a3b231ad7d4", "score": "0.52889854", "text": "function ex1_picard(){\n let u_n = u0;\n let u_n1 = u0;\n let u_mikro = 0.;\n\n let ta = []; //accepts t\n let ya = []; //accepts u_n1\n let yb = []; //accepts N - u_n1\n\n ta.push(0.);\n ya.push(u_n1);\n yb.push(N - u_n1);\n\n for(let t = 0.1; t < 100.; t += dt){\n let iteracja_mi = 0;\n u_n = u_n1;\n u_mikro = 0.;\n\n while(1){\n \n if((Math.abs(u_n1-u_mikro) < TOL) || iteracja_mi++ > iteracje_max){\n break;\n }\n\n u_mikro = u_n1;\n u_n1 = u_n + (dt / 2.) * (f(u_n) + f(u_mikro));\n }\n\n ta.push(t);\n ya.push(u_n1);\n yb.push(N - u_n1);\n }\n\n /* We return an object, containing our 3 arrays */\n return {\n t: ta,\n y: ya,\n y2: yb\n }\n}", "title": "" }, { "docid": "56d015c586b680a31a2de532476acace", "score": "0.52877235", "text": "display(clown){\n push();\n noStroke();\n\n //head\n fill(250,250,250);\n ellipse(this.x, this.y, 4*(this.size/5), this.size);\n\n //mouth\n fill(0,0,0);\n ellipse(this.x, this.y+10, 2*(this.size/3));\n\n //mask\n fill(250,250,250);\n ellipse(this.x, this.y+1, 2*(this.size/3));\n\n //makeup\n fill(0,70,0);\n ellipse(this.x+this.size/5, this.y-5, this.size/4, this.size/2);\n ellipse(this.x-this.size/5, this.y-5, this.size/4, this.size/2);\n\n //eye\n fill(245, 147, 66);\n ellipse(this.x+this.size/5, this.y-5, this.size/6, this.size/6);\n ellipse(this.x-this.size/5, this.y-5, this.size/6, this.size/6);\n\n //pupil\n fill(0, 0, 0);\n ellipse(this.x+this.size/5, this.y-5, this.size/8, this.size/8);\n ellipse(this.x-this.size/5, this.y-5, this.size/8, this.size/8);\n\n //nose\n fill(184, 26, 63);\n ellipse(this.x, this.y+5, 2*(this.size/8));\n\n pop();\n }", "title": "" }, { "docid": "d1a12c8afd6be61bf81b2071ec139eb3", "score": "0.5282812", "text": "function brickCalculator(length, width, thickness, ThicknessOfMortar, ThicknessOfWall){\r\n var VolOfOneBrickWithMortar = (length +ThicknessOfMortar) * (width + ThicknessOfMortar) * (thickness + ThicknessOfMortar);\r\n var VolOfBrickWork = ThicknessOfWall * 144;// 1 sqft = 144 inch;\r\n var NumOfBrickInOneSqft = VolOfBrickWork / VolOfOneBrickWithMortar;\r\n return NumOfBrickInOneSqft;\r\n}", "title": "" }, { "docid": "bb0bf2b58067d4f157e1c6859f12e5ad", "score": "0.5280257", "text": "function skeletor(){\n\t\tif(counter == 1){\n\t\t\tconsole.log(\"░░░░░░░░░░░░░░░░░░░\"); \n\t\t\tconsole.log(\"░░░░░░░░░░░░▄▐░░░░░\"); \n\t\t\tconsole.log(\"░░░░░░▄▄▄░░▄██▄░░░░\"); \n\t\t\tconsole.log(\"░░░░░▐▀█▀▌░░░░▀█▄░░\"); \n\t\t\tconsole.log(\"░░░░░▐█▄█▌░░░░░░▀█▄\"); \n\t\t\tconsole.log(\"░░░░░░▀▄▀░░░▄▄▄▄▄▀▀\"); \n\t\t\tconsole.log(\"░░░░▄▄▄██▀▀▀▀░░░░░░\"); \n\t\t\tconsole.log(\"░░░█▀▄▄▄█░▀▀░░░░░░░\"); \n\t\t\tconsole.log(\"░░░▌░▄▄▄▐▌▀▀▀░░░░░░\"); \n\t\t\tconsole.log(\"▄░▐░░░▄▄░█░▀▀░░░░░░\"); \n\t\t\tconsole.log(\"▀█▌░░░▄░▀█▀░▀░░░░░░\"); \n\t\t\tconsole.log(\"░░░░░░░▄▄▐▌▄▄░░░░░░\"); \n\t\t\tconsole.log(\"░░░░░░░▀███▀█░▄░░░░\"); \n\t\t\tconsole.log(\"░░░░░░▐▌▀▄▀▄▀▐▄░░░░\"); \n\t\t\tconsole.log(\"░░░░░░▐▀░░░░░░▐▌░░░\"); \n\t\t\tconsole.log(\"░░░░░░█░░░░░░░░█░░░\"); \n\t\t\tconsole.log(\"░░░░░▐▌░░░░░░░░░█░░\"); \n\t\t\tconsole.log(\"░░░░░█░░░░░░░░░░▐▌░\");\n\t\t\tconsole.log(\"░░░░░░░░░░░░░░░░░░░\"); \n\t\t};\n\t\tif(counter == 2){\n\t\t\tconsole.log(\"░░░░░▐▄░░░░░░░░░░░░\"); \n\t\t\tconsole.log(\"░░░░▄██▄░░▄▄▄░░░░░░\"); \n\t\t\tconsole.log(\"░░▄█▀░░░░▐▀█▀▌░░░░░\"); \n\t\t\tconsole.log(\"▄█▀░░░░░░▐█▄█▌░░░░░\"); \n\t\t\tconsole.log(\"▀▀▄▄▄▄▄░░░▀▄▀░░░░░░\"); \n\t\t\tconsole.log(\"░░░░░░▀▀▀▀██▄▄▄░░░░\"); \n\t\t\tconsole.log(\"░░░░░░░▀▀░█▄▄▄▀█░░░\"); \n\t\t\tconsole.log(\"░░░░░░▀▀▀▐▌▄▄▄░▌░░░\"); \n\t\t\tconsole.log(\"░░░░░░▀▀░█░▄▄░░░▐░▄\"); \n\t\t\tconsole.log(\"░░░░░░▀░▀█▀░▄░░░▌█▀\"); \n\t\t\tconsole.log(\"░░░░░░▄▄▐▌▄▄░░░░░░░\"); \n\t\t\tconsole.log(\"░░░░▄░█▀███▀░░░░░░░\"); \n\t\t\tconsole.log(\"░░░░▄▐▀▄▀▄▀▐▌░░░░░░\"); \n\t\t\tconsole.log(\"░░░▐▌░░░░░░▀▐░░░░░░\"); \n\t\t\tconsole.log(\"░░░█░░░░░░░░█░░░░░░\"); \n\t\t\tconsole.log(\"░░█░░░░░░░░░▐▌░░░░░\"); \n\t\t\tconsole.log(\"░▐▌░░░░░░░░░░█░░░░░\");\n\t\t}\n\t\tif(counter >= 2){\n\t\t\tcounter = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "58729e4efba5723afef8946f2f910ad6", "score": "0.5278982", "text": "function nose() {\n fill(247, 221, 155);\n triangle(360, 320, 340, 380, 380, 380);\n}", "title": "" }, { "docid": "b3cd6e25d4cffc6517bd2da8f1f8aab6", "score": "0.5278856", "text": "function createNonMetal() {\n var z = Math.random()\n if(z < 0.2){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightblue\",1)\n makeText(\"He\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"2\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Helium\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"4.0026\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*INHALING A SMALL AMOUNT OF HELIUM MAKES YOU SOUND FUNNY! \",5,90,8,\"VT323\",1)\n }else if(z < 0.4){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightblue\",1)\n makeText(\"O\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"8\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Oxygen\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"15.999\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*AIR IS ONLY 21% OXYGEN! PURE OXYGEN IS BAD NEWS... \",5,90,10,\"VT323\",1)\n }else if(z < 0.6){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightblue\",1)\n makeText(\"N\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"7\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Nitrogen\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"14.006\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*THE AIR IN YOUR CHIP BAG IS ACTUALLY NITROGEN THAT KEEPS CHIPS FROM GETTING STALE! \",5,90,5,\"VT323\",1)\n }else if(z < 0.8){\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightblue\",1)\n makeText(\"Cl\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"17\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Chlorine\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"35.453\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*Chlorine is in salt, swimming pools, and even the water you drink; but too much can kill you!\",5,90,5,\"VT323\",1)\n }else{\n makeRect(0,0,200,100,\"darkgray\",1)\n makeRect(70,15,60,60,\"gray\",1)\n makeRect(75,20,50,50,\"lightblue\",1)\n makeText(\"Fl\",82,50,40,\"Sansita\",\"black\",1)\n makeCircle(120,25,4,4,\"black\",1)\n makeText(\"9\",117,26,5,\"Sansita\",\"white\",1)\n makeText(\"Flourine\",85,60,10,\"Sansita\",\"black\",1)\n makeText(\"18.998\",89,68,7,\"Sansita\",\"black\",1)\n makeText(\"*FLOURINE REACTS VIOLENTLY TO EVERYTHING (LIKE SOME KIDS AT THIS SCHOOL)! \",5,90,6,\"VT323\",1)\n }\n}", "title": "" }, { "docid": "92d5360e8335bf48741806ca9ea52d3c", "score": "0.5278328", "text": "function preparaRiga() {\n /*fill(colore);\n noStroke();\n rect(0,height-g*y-g-1,width,g+1);\n stroke(255-colore);*/\n}", "title": "" }, { "docid": "98a1726ff34ba7ce2b04bd7f6b8e53ef", "score": "0.5274762", "text": "function drawBigPlanet() {\n penColor(rgb(110,0,165));\n penWidth(160);\n turnTo(360);\n moveTo(260,450);\n penDown();\n arcRight(75,100);\n drawAurora();\n}", "title": "" }, { "docid": "28bdd3d01e90f8be80e6a638c7573b90", "score": "0.5272152", "text": "function dessinerPomme() {\r\n ctx.font = \"15px Arial\";\r\n ctx.fillStyle = colorPomme;\r\n ctx.fillText(\"🍎\",xPomme+1,yPomme+1);\r\n }", "title": "" }, { "docid": "82b676ea4e03cec285331e0410b668a4", "score": "0.52687657", "text": "animationTop(type,primerakey,segundakey){\n if(type==\"add\") this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]] = this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]]+10;\n if(type==\"rest\")this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]] = this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]]-10;\n var margin = this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]];\n var pos = this.posinitial[primerakey][segundakey][this.keyimages[primerakey][segundakey]];\n var opa = 1;\n var opaci;\n var initial = setInterval(()=>{\n if(pos==this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]]){\n this.posinitial[primerakey][segundakey][this.keyimages[primerakey][segundakey]] = pos;\n clearInterval(initial);\n }else{\n if(type==\"add\")pos++;\n if(type==\"rest\")pos--;\n if(opa==9){\n opaci =1;\n }else{\n opa++;\n opaci =\"0.\"+opa;\n }\n document.getElementById(`imageneshow-${primerakey}-${segundakey}-${this.keyimages[primerakey][segundakey]}`).style.marginTop= pos+\"0px\";\n document.getElementById(`imageneshow-${primerakey}-${segundakey}-${this.keyimages[primerakey][segundakey]}`).style.opacity = opaci;\n }\n },38);\n }", "title": "" }, { "docid": "69c25e284de61adf5365ad26cbaa23ce", "score": "0.52684104", "text": "function jellyfishExplosion(){\n for(var i = 0; i < 100; i++){\n push();\n rotate(random());\n drawPrey(random(-width,width),random(-height,height));\n pop();\n }\n}", "title": "" }, { "docid": "a35fce4a303dd8fedc5e1b6686fef41d", "score": "0.5268028", "text": "function animals(chickens, cows, pigs) {\n return (chickens*2) + (cows*4) + (pigs*4)\n}", "title": "" }, { "docid": "e3c47ff9ea39196ae92c3ca71e4d7cf5", "score": "0.5264531", "text": "function animals(chickens, cows, pigs) {\n var chikensLeg = 2;\n var cowsLeg = 4;\n var pigsLegs = 4;\nreturn (chickens*chikensLeg) + (cows*cowsLeg) + (pigs*pigsLegs);\n}", "title": "" } ]
6c0fa5e22e2a7de355a203ff229115a8
Execute a list of instructions from an Instruction Class
[ { "docid": "8d22715132b9bef14f810c86d98ef926", "score": "0.5467209", "text": "do(instructions) {\n for (const instruction of instructions) {\n const [cmd, val] = Ship.parseInstruction(instruction)\n // If a turn, delegate to turn function\n if (cmd === 'L' || cmd === 'R') {\n this.turn(Ship.getSign(cmd), val)\n continue\n }\n // Otherwise, move the ship\n this.move(cmd, val)\n }\n }", "title": "" } ]
[ { "docid": "a0fa694090e0d137aa9f77b8897823c1", "score": "0.59266615", "text": "function execute() {\n var op = getmem(parseInt(getreg('val-pc'),16));\n var inst = op.split(' ')[0];\n if(instructions[inst]) {\n instructions[inst].execute(simulator);\n }\n else {\n console.log('Error: unrecognized operation ' + inst);\n }\n\n\n}", "title": "" }, { "docid": "bae54b16cb8f4ef13cc8b08491374ec2", "score": "0.57855624", "text": "execute() {\n for (let node of this.nodes) {\n node.execute()\n }\n }", "title": "" }, { "docid": "0c28b5cf65114cee303ceff42c369904", "score": "0.56790954", "text": "executeInstructionList(instructionList) {\n this.validateList(instructionList);\n this.initLawn(instructionList);\n const finalMowersPositions = [];\n for (let lineIndex = 1; lineIndex < instructionList.length; lineIndex++) {\n const line = instructionList[lineIndex];\n if (this.isInitMowerLine(lineIndex)) {\n this.initMower(line);\n }\n else {\n this.sendInstructionsToMower(line);\n finalMowersPositions.push(this.mower.getStatus());\n }\n }\n return finalMowersPositions;\n }", "title": "" }, { "docid": "7d7c0f6a02a420deb68895dfbc299cc2", "score": "0.5630744", "text": "step (commands) {\n const { operations } = this\n if (operations.length) {\n const instr = operations.pop()\n if (instr === null || instr === undefined) {\n // ignore\n } else if (typeof instr === \"function\") {\n instr(this)\n } else if (isProgram(instr)) {\n // if it\"s program, and since the operations are stored into an stack,\n // we need add to the program operations in reverse order\n for (let i = instr.length - 1; i >= 0; i--) {\n operations.push(instr[i])\n }\n } else if (isCommand(instr)) {\n const cmd = commands.resolve(instr)\n if (typeof cmd === \"function\") cmd(this)\n else this.error(\"step > \", ERR_INSTR_NOT_FOUND, instr)\n } else {\n // if it\"s a value, push it into the stack\n this.stack.push(instr)\n }\n }\n }", "title": "" }, { "docid": "b445588f8701dc2933a04c3a06f43e99", "score": "0.55924505", "text": "function Instruction(length, opcode) {\n this.opcode = opcode; //Kept for debugging purposes\n this.args = Array.prototype.slice.call(arguments);\n this.length = this.args.shift();\n this.fcn = require(\"vm/ByteCode\").instrs[this.args.shift()];\n }", "title": "" }, { "docid": "3191ab98ee245a2cd8dbfca7569f97b6", "score": "0.5462976", "text": "function _run(){\n var len = _flist.length;\n for (var i=0; i<len; i++){\n _flist[i]();\t\n }\n len = _strlist.length;\n for (var i=0; i<len; i++){\n try{\n\teval(_strlist[i]);\t\n }catch(e){}\n }\n }", "title": "" }, { "docid": "41c68f709d659e307c80f3ef41624e6e", "score": "0.5456986", "text": "function Instructions() {\n _super.call(this);\n }", "title": "" }, { "docid": "41c68f709d659e307c80f3ef41624e6e", "score": "0.5456986", "text": "function Instructions() {\n _super.call(this);\n }", "title": "" }, { "docid": "87a5245da08fa3ac341903e9b11f0f49", "score": "0.5434309", "text": "function mapExec(array, func) {\r\n for (var i = 0; i < array.length; ++i) {\r\n func.call(this, array[i], i);\r\n }\r\n}", "title": "" }, { "docid": "2f7780698f036db24c7ca8ca288ecbec", "score": "0.5419465", "text": "function UTIL_mapExec(array, func) {\n for (var i = 0; i < array.length; ++i) {\n func.call(this, array[i], i);\n }\n}", "title": "" }, { "docid": "20810cbd60c1c67297fd0f0185fa04a1", "score": "0.5388222", "text": "function instructionFun(instructionList) {\n let count = 0;\n instructionList.forEach((instruction) => {\n document.querySelector(\n \".instructions-ol\"\n ).innerHTML += ` <list mx-2 p-4 text-center>${\n ++count + \". \" + instruction\n }</list>`;\n });\n}", "title": "" }, { "docid": "bc918d0bed1f37ceadae8d0aafadfbcf", "score": "0.5317972", "text": "function Interpreter(instructionArr = [], memory, r, floatingRegisters) { // instructionArray, memory, registers\n\n // loop over instructionArr, we will produce machine code array\n\n\n const interpreterConfig = { index: 0 } // TODO DON'T FORGET TO INCREMENT jal 10 => go and read 10th line but it also saves $ra the last index it's good for procedure calls\n //const memory = MemoryGenerator()\n\n while (interpreterConfig.index < instructionArr.length) {\n\n let instructionString = instructionArr[interpreterConfig.index]\n\n // if it's a label continue with the other line\n if (instructionString.labelname !== \"\") {\n interpreterConfig.index = interpreterConfig.index + 1 // INCREMENT\n continue\n }\n\n instructionString = instructionArr[interpreterConfig.index].instruction\n\n // clear the dolor signs\n while (instructionString.indexOf(\"$\") !== -1) instructionString = instructionString.replace(\"$\", \"\")\n\n let splittedText = instructionString.split(\" \")\n let operand = splittedText[0]\n let params = splittedText.slice(1) // addi -> s1, s2, xconstant\n\n\n if (!instructions[operand]) {\n console.log(operand)\n throw new Error(\"The instruction operation you provide is not valid!\")\n }\n // the operation is valid. after this check: \n\n if (instructions[operand].requiredNumberOfRegisters + instructions[operand].requiredNumberOfConstants !== splittedText.length - 1) {\n throw new Error(\"You have entered missing registers or immediate value! or you added more than needed\")\n }\n\n // we will warn user for adding the constant/s at the end of the instruction !!!\n\n for (let i = 1; i <= instructions[operand].requiredNumberOfRegisters; i++) {\n if (splittedText[i] in r || splittedText[i] in floatingRegisters) { //check if it exists in register object\n } else {\n throw new Error(`The value '${splittedText[i]}' is not a valid register`)\n }\n }\n\n if (operand === \"beq\" || operand === \"bne\" || operand === \"bgt\" || operand === \"bge\" || operand === \"blt\" || operand === \"ble\") {\n let flag = instructions[operand].operation(params, r, interpreterConfig, instructionArr)\n if (flag) continue\n }\n else if (operand === \"lw\" || operand === \"sw\") { // lw s1 100(s2)\n let splitted = splittedText[2].split(\"(\")\n params = [splittedText[1], splitted[1].replace(\")\", \"\"), splitted[0]]\n instructions[operand].operation(params, r, memory, interpreterConfig)\n }\n else if (operand === \"j\") {\n instructions[operand].operation(params, interpreterConfig, instructionArr)\n continue\n }\n else if (operand === \"jr\") {\n instructions[operand].operation(params, r, interpreterConfig)\n continue\n }\n else if (operand === \"jal\") {\n instructions[operand].operation(params, r, interpreterConfig, instructionArr)\n continue\n }\n else if (operand === \"add.s\" || operand === \"addi.s\"|| operand === \"sub.s\" || operand === \"mul.s\" || operand === \"div.s\") {\n instructions[operand].operation(params, floatingRegisters)\n\n }\n else {\n instructions[operand].operation(params, r)\n }\n interpreterConfig.index = interpreterConfig.index + 1 // INCREMENT\n\n }\n return [memory, r, floatingRegisters] // return r and memory\n}", "title": "" }, { "docid": "35564a1d4292d6a3b42ab8efa3be364b", "score": "0.52001494", "text": "run() {\n this.class1.runSomeClass1Task();\n this.class2.runSomeClass2Task();\n this.class3.runSomeClass3Task();\n this.class4.runSomeClass4Task();\n this.class5.runSomeClass5Task();\n }", "title": "" }, { "docid": "a88ca6bea42ab1c47db8d17ae734c8a7", "score": "0.516128", "text": "_encodeInstruction(sl, curAddr) {\n if (this.tracing) {\n console.log('assembling', JSON.stringify(sl));\n }\n const instrName = sl.instr.toLowerCase();\n switch (instrName) {\n case 'adc': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10001000 | r];\n }\n case 'add': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10000000 | r];\n }\n case 'aci': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11001110, imm];\n }\n case 'adi': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11000110, imm];\n }\n case 'ana': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10100000 | r];\n }\n case 'ani': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11100110, imm];\n }\n case 'call':\n case 'cc':\n case 'cnc':\n case 'cnz':\n case 'cm':\n case 'cp':\n case 'cpe':\n case 'cpo':\n case 'cz': {\n this._expectArgsCount(sl, 1);\n this._argLabel(sl, sl.args[0], curAddr);\n\n let ie = 0;\n if (instrName === 'call') {\n ie = 0b11001101;\n } else {\n let ccc = instrName.slice(1);\n ie = 0b11000100 | (this._translateCCC(ccc, sl) << 3);\n }\n return [ie, 0, 0];\n }\n case 'cma': {\n this._expectArgsCount(sl, 0);\n return [0b00101111];\n }\n case 'cmc': {\n this._expectArgsCount(sl, 0);\n return [0b00111111];\n }\n case 'cmp': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10111000 | r];\n }\n case 'cpi': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11111110, imm];\n }\n case 'dad': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00001001 | (rp << 4)];\n }\n case 'db': {\n // Pseudo-instruction that simply assigns its immediate args to memory.\n if (sl.args.length == 1 && sl.args[0] instanceof Array) {\n // If 'db' has a single array argument, it comes from a STRING.\n return sl.args[0].map((c) => {return c.charCodeAt(0);});\n } else {\n return sl.args.map((arg) => {return this._argImm(sl, arg);});\n }\n }\n case 'dw': {\n // Pseudo-instruction that treats immediate args as 2-byte words, and\n // assigns them to memory in little-endian.\n let enc = [];\n for (let arg of sl.args) {\n let argEnc = this._argImm(sl, arg);\n enc.push(argEnc & 0xFF);\n enc.push((argEnc >> 8) & 0xFF);\n }\n return enc;\n }\n case 'dcr': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b00000101 | (r << 3)];\n }\n case 'dcx': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00001011 | (rp << 4)];\n }\n case 'hlt': {\n this._expectArgsCount(sl, 0);\n return [0b01110110];\n }\n case 'inr': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b00000100 | (r << 3)];\n }\n case 'inx': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00000011 | (rp << 4)];\n }\n case 'jc':\n case 'jm':\n case 'jmp':\n case 'jnc':\n case 'jnz':\n case 'jp':\n case 'jpe':\n case 'jpo':\n case 'jz': {\n this._expectArgsCount(sl, 1);\n this._argLabel(sl, sl.args[0], curAddr);\n\n let ie = 0;\n if (instrName === 'jmp') {\n ie = 0b11000011;\n } else {\n let ccc = instrName.slice(1);\n ie = 0b11000010 | (this._translateCCC(ccc, sl) << 3);\n }\n return [ie, 0, 0];\n }\n case 'lda': {\n this._expectArgsCount(sl, 1);\n let num = this._argImmOrLabel(sl, sl.args[0], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00111010, num & 0xff, (num >> 8) & 0xff];\n }\n case 'ldax': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00001010 | (rp << 4)];\n }\n case 'lhld': {\n this._expectArgsCount(sl, 1);\n let num = this._argImmOrLabel(sl, sl.args[1], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00101010, num & 0xff, (num >> 8) & 0xff];\n }\n case 'lxi': {\n this._expectArgsCount(sl, 2);\n let rp = this._argRP(sl, sl.args[0]);\n let num = this._argImmOrLabel(sl, sl.args[1], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00000001 | (rp << 4), num & 0xff, (num >> 8) & 0xff];\n }\n case 'mov': {\n this._expectArgsCount(sl, 2);\n let rd = this._argR(sl, sl.args[0]);\n let rs = this._argR(sl, sl.args[1]);\n return [0b01000000 | (rd << 3) | rs];\n }\n case 'mvi': {\n this._expectArgsCount(sl, 2);\n let r = this._argR(sl, sl.args[0]);\n let imm = this._argImm(sl, sl.args[1]);\n return [0b110 | (r << 3), imm];\n }\n case 'nop': {\n this._expectArgsCount(sl, 0);\n return [0b00000000];\n }\n case 'ora': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10110000 | r];\n }\n case 'ori': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11110110, imm];\n }\n case 'pchl': {\n this._expectArgsCount(sl, 0);\n return [0b11101001];\n }\n case 'pop': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b11000001 | (rp << 4)];\n }\n case 'push': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b11000101 | (rp << 4)];\n }\n case 'rc':\n case 'ret': \n case 'rnc':\n case 'rnz':\n case 'rm':\n case 'rp':\n case 'rpe':\n case 'rpo':\n case 'rz': {\n this._expectArgsCount(sl, 0);\n let ie = 0;\n if (instrName === 'ret') {\n ie = 0b11001001;\n } else {\n let ccc = instrName.slice(1);\n ie = 0b11000000 | (this._translateCCC(ccc, sl) << 3);\n }\n return [ie];\n }\n case 'ral': {\n this._expectArgsCount(sl, 0);\n return [0b00010111];\n }\n case 'rar': {\n this._expectArgsCount(sl, 0);\n return [0b00011111];\n }\n case 'rlc': {\n this._expectArgsCount(sl, 0);\n return [0b00000111];\n }\n case 'rrc': {\n this._expectArgsCount(sl, 0);\n return [0b00001111];\n }\n case 'sbb': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10011000 | r];\n }\n case 'sbi': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11011110, imm];\n }\n case 'shld': {\n this._expectArgsCount(sl, 1);\n let num = this._argImmOrLabel(sl, sl.args[1], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00100010, num & 0xff, (num >> 8) & 0xff];\n }\n case 'sphl': {\n this._expectArgsCount(sl, 0);\n return [0b11111001];\n }\n case 'sta': {\n this._expectArgsCount(sl, 1);\n let num = this._argImmOrLabel(sl, sl.args[0], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00110010, num & 0xff, (num >> 8) & 0xff];\n }\n case 'stax': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00000010 | (rp << 4)];\n }\n case 'stc': {\n this._expectArgsCount(sl, 0);\n return [0b00110111];\n }\n case 'sub': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10010000 | r];\n }\n case 'sui': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11010110, imm];\n }\n case 'xchg': {\n this._expectArgsCount(sl, 0);\n return [0b11101011];\n }\n case 'xra': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10101000 | r];\n }\n case 'xri': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11101110, imm];\n }\n case 'xthl': {\n this._expectArgsCount(sl, 0);\n return [0b11100011];\n }\n default:\n this._assemblyError(sl.pos, `unknown instruction ${sl.instr}`);\n }\n return [];\n }", "title": "" }, { "docid": "a88ca6bea42ab1c47db8d17ae734c8a7", "score": "0.516128", "text": "_encodeInstruction(sl, curAddr) {\n if (this.tracing) {\n console.log('assembling', JSON.stringify(sl));\n }\n const instrName = sl.instr.toLowerCase();\n switch (instrName) {\n case 'adc': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10001000 | r];\n }\n case 'add': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10000000 | r];\n }\n case 'aci': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11001110, imm];\n }\n case 'adi': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11000110, imm];\n }\n case 'ana': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10100000 | r];\n }\n case 'ani': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11100110, imm];\n }\n case 'call':\n case 'cc':\n case 'cnc':\n case 'cnz':\n case 'cm':\n case 'cp':\n case 'cpe':\n case 'cpo':\n case 'cz': {\n this._expectArgsCount(sl, 1);\n this._argLabel(sl, sl.args[0], curAddr);\n\n let ie = 0;\n if (instrName === 'call') {\n ie = 0b11001101;\n } else {\n let ccc = instrName.slice(1);\n ie = 0b11000100 | (this._translateCCC(ccc, sl) << 3);\n }\n return [ie, 0, 0];\n }\n case 'cma': {\n this._expectArgsCount(sl, 0);\n return [0b00101111];\n }\n case 'cmc': {\n this._expectArgsCount(sl, 0);\n return [0b00111111];\n }\n case 'cmp': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10111000 | r];\n }\n case 'cpi': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11111110, imm];\n }\n case 'dad': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00001001 | (rp << 4)];\n }\n case 'db': {\n // Pseudo-instruction that simply assigns its immediate args to memory.\n if (sl.args.length == 1 && sl.args[0] instanceof Array) {\n // If 'db' has a single array argument, it comes from a STRING.\n return sl.args[0].map((c) => {return c.charCodeAt(0);});\n } else {\n return sl.args.map((arg) => {return this._argImm(sl, arg);});\n }\n }\n case 'dw': {\n // Pseudo-instruction that treats immediate args as 2-byte words, and\n // assigns them to memory in little-endian.\n let enc = [];\n for (let arg of sl.args) {\n let argEnc = this._argImm(sl, arg);\n enc.push(argEnc & 0xFF);\n enc.push((argEnc >> 8) & 0xFF);\n }\n return enc;\n }\n case 'dcr': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b00000101 | (r << 3)];\n }\n case 'dcx': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00001011 | (rp << 4)];\n }\n case 'hlt': {\n this._expectArgsCount(sl, 0);\n return [0b01110110];\n }\n case 'inr': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b00000100 | (r << 3)];\n }\n case 'inx': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00000011 | (rp << 4)];\n }\n case 'jc':\n case 'jm':\n case 'jmp':\n case 'jnc':\n case 'jnz':\n case 'jp':\n case 'jpe':\n case 'jpo':\n case 'jz': {\n this._expectArgsCount(sl, 1);\n this._argLabel(sl, sl.args[0], curAddr);\n\n let ie = 0;\n if (instrName === 'jmp') {\n ie = 0b11000011;\n } else {\n let ccc = instrName.slice(1);\n ie = 0b11000010 | (this._translateCCC(ccc, sl) << 3);\n }\n return [ie, 0, 0];\n }\n case 'lda': {\n this._expectArgsCount(sl, 1);\n let num = this._argImmOrLabel(sl, sl.args[0], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00111010, num & 0xff, (num >> 8) & 0xff];\n }\n case 'ldax': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00001010 | (rp << 4)];\n }\n case 'lhld': {\n this._expectArgsCount(sl, 1);\n let num = this._argImmOrLabel(sl, sl.args[1], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00101010, num & 0xff, (num >> 8) & 0xff];\n }\n case 'lxi': {\n this._expectArgsCount(sl, 2);\n let rp = this._argRP(sl, sl.args[0]);\n let num = this._argImmOrLabel(sl, sl.args[1], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00000001 | (rp << 4), num & 0xff, (num >> 8) & 0xff];\n }\n case 'mov': {\n this._expectArgsCount(sl, 2);\n let rd = this._argR(sl, sl.args[0]);\n let rs = this._argR(sl, sl.args[1]);\n return [0b01000000 | (rd << 3) | rs];\n }\n case 'mvi': {\n this._expectArgsCount(sl, 2);\n let r = this._argR(sl, sl.args[0]);\n let imm = this._argImm(sl, sl.args[1]);\n return [0b110 | (r << 3), imm];\n }\n case 'nop': {\n this._expectArgsCount(sl, 0);\n return [0b00000000];\n }\n case 'ora': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10110000 | r];\n }\n case 'ori': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11110110, imm];\n }\n case 'pchl': {\n this._expectArgsCount(sl, 0);\n return [0b11101001];\n }\n case 'pop': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b11000001 | (rp << 4)];\n }\n case 'push': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b11000101 | (rp << 4)];\n }\n case 'rc':\n case 'ret': \n case 'rnc':\n case 'rnz':\n case 'rm':\n case 'rp':\n case 'rpe':\n case 'rpo':\n case 'rz': {\n this._expectArgsCount(sl, 0);\n let ie = 0;\n if (instrName === 'ret') {\n ie = 0b11001001;\n } else {\n let ccc = instrName.slice(1);\n ie = 0b11000000 | (this._translateCCC(ccc, sl) << 3);\n }\n return [ie];\n }\n case 'ral': {\n this._expectArgsCount(sl, 0);\n return [0b00010111];\n }\n case 'rar': {\n this._expectArgsCount(sl, 0);\n return [0b00011111];\n }\n case 'rlc': {\n this._expectArgsCount(sl, 0);\n return [0b00000111];\n }\n case 'rrc': {\n this._expectArgsCount(sl, 0);\n return [0b00001111];\n }\n case 'sbb': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10011000 | r];\n }\n case 'sbi': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11011110, imm];\n }\n case 'shld': {\n this._expectArgsCount(sl, 1);\n let num = this._argImmOrLabel(sl, sl.args[1], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00100010, num & 0xff, (num >> 8) & 0xff];\n }\n case 'sphl': {\n this._expectArgsCount(sl, 0);\n return [0b11111001];\n }\n case 'sta': {\n this._expectArgsCount(sl, 1);\n let num = this._argImmOrLabel(sl, sl.args[0], curAddr);\n // 16-bit immediates encoded litte-endian.\n return [0b00110010, num & 0xff, (num >> 8) & 0xff];\n }\n case 'stax': {\n this._expectArgsCount(sl, 1);\n let rp = this._argRP(sl, sl.args[0]);\n return [0b00000010 | (rp << 4)];\n }\n case 'stc': {\n this._expectArgsCount(sl, 0);\n return [0b00110111];\n }\n case 'sub': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10010000 | r];\n }\n case 'sui': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11010110, imm];\n }\n case 'xchg': {\n this._expectArgsCount(sl, 0);\n return [0b11101011];\n }\n case 'xra': {\n this._expectArgsCount(sl, 1);\n let r = this._argR(sl, sl.args[0]);\n return [0b10101000 | r];\n }\n case 'xri': {\n this._expectArgsCount(sl, 1);\n let imm = this._argImm(sl, sl.args[0]);\n return [0b11101110, imm];\n }\n case 'xthl': {\n this._expectArgsCount(sl, 0);\n return [0b11100011];\n }\n default:\n this._assemblyError(sl.pos, `unknown instruction ${sl.instr}`);\n }\n return [];\n }", "title": "" }, { "docid": "1901e7039ab972a709b4f83446447f94", "score": "0.5160816", "text": "add(...items) {\n\t if (items.length === 0) {\n\t throw new Error('No instructions');\n\t }\n\n\t items.forEach(item => {\n\t if ('instructions' in item) {\n\t this.instructions = this.instructions.concat(item.instructions);\n\t } else if ('data' in item && 'programId' in item && 'keys' in item) {\n\t this.instructions.push(item);\n\t } else {\n\t this.instructions.push(new TransactionInstruction(item));\n\t }\n\t });\n\t return this;\n\t }", "title": "" }, { "docid": "eef4c6cbe7d725fac764ecd54c5c0460", "score": "0.5109639", "text": "function Instruction() {\n _super.call(this);\n }", "title": "" }, { "docid": "2bdb03069bf56dbc0de80d29366404ed", "score": "0.5083458", "text": "instruction(target, value) {\n var insTarget, insValue, instruction, j, len;\n if (target != null) {\n target = getValue(target);\n }\n if (value != null) {\n value = getValue(value);\n }\n if (Array.isArray(target)) { // expand if array\n for (j = 0, len = target.length; j < len; j++) {\n insTarget = target[j];\n this.instruction(insTarget);\n }\n } else if (isObject(target)) { // expand if object\n for (insTarget in target) {\n if (!hasProp.call(target, insTarget)) continue;\n insValue = target[insTarget];\n this.instruction(insTarget, insValue);\n }\n } else {\n if (isFunction(value)) {\n value = value.apply();\n }\n instruction = new XMLProcessingInstruction(this, target, value);\n this.children.push(instruction);\n }\n return this;\n }", "title": "" }, { "docid": "dd0599f71fcc60522523476670aed85b", "score": "0.50710744", "text": "function executeforEach(array, func) {\n for (let i = 0; i < array.length; i++) {\n func(array[i]);\n }\n}", "title": "" }, { "docid": "29c523091a631b209bcd59037b1d4c5c", "score": "0.5065411", "text": "function run(instructions) {\n let globalAcc = 0;\n const executedInstructionsIndex = [];\n let i = 0;\n while(true) {\n if(i >= instructions.length) return globalAcc\n if(executedInstructionsIndex.includes(i)) return false;\n\n const [instruction, value] = instructions[i];\n executedInstructionsIndex.push(i);\n if(instruction === 'nop') { i++ };\n if(instruction === 'acc') { globalAcc += value; i++ }\n if(instruction === 'jmp') { i += value }\n }\n}", "title": "" }, { "docid": "f31cc85538ea8a1d62674d6e01d301dc", "score": "0.5038785", "text": "function executeforEach(arr, func) {\n for (let i = 0; i <= arguments.length; i++) {\n func(arr[i]);\n }\n}", "title": "" }, { "docid": "537fe5e4777e4eb26d45c2a53f296a0d", "score": "0.5007919", "text": "function callAll(list, args, th) {\n\tif (list)\n\t\tfor(var i=0;i<list.length;i++){\n\t\t\tlist[i].apply(th, args);\n\t\t}\n}", "title": "" }, { "docid": "a7f63429dbd714c27fb24a9a8c54b863", "score": "0.49837378", "text": "function performInstructions() {\n instructionsArray = instructions.split('');\n instructionsArray.forEach((instruction) => {\n dirtCheck();\n if (instruction === 'N') {\n if (!room[hooverX][hooverY].includes(\"no-north\")) {\n room[hooverX][hooverY + 1].push(\"hoover\");\n removeHoover();\n getHooverLocation();\n };\n };\n if (instruction === 'E') {\n if (!room[hooverX][hooverY].includes(\"no-east\")) {\n room[hooverX + 1][hooverY].push(\"hoover\");\n removeHoover();\n getHooverLocation();\n };\n };\n if (instruction === 'S') {\n if (!room[hooverX][hooverY].includes(\"no-south\")) {\n room[hooverX][hooverY - 1].push(\"hoover\");\n removeHoover();\n getHooverLocation();\n };\n };\n if (instruction === 'W') {\n if (!room[hooverX][hooverY].includes(\"no-west\")) {\n room[hooverX - 1][hooverY].push(\"hoover\");\n removeHoover();\n getHooverLocation();\n }\n }\n dirtCheck();\n });\n}", "title": "" }, { "docid": "8c5c1d444714a44305a74cb38388763a", "score": "0.49299663", "text": "_executeCommandForward(command, ...args) {\n for (let i = 0, l = this._modules.length; i < l; i++) {\n const module = this._modules[i];\n\n if (module[command]) {\n const next = module[command](...args);\n\n if (next === false)\n return;\n }\n }\n }", "title": "" }, { "docid": "84b96246663ae2eab26b64cb6adf63bb", "score": "0.48935148", "text": "function executeforEach(arr, func) {\n for (let el of arr) {\n func(el);\n } \n}", "title": "" }, { "docid": "a5ae0acab0ce1571e081bd8c25d5f820", "score": "0.48832792", "text": "step(num_exec)\n\t{\n\t\tvar exec = 0; // Keep track of remaining\n\t\t\n\t\tif (this.state.ip == CPU6502.END_IP) return;\n\t\t\n\t\t\n\t\t//var end = Date.now() + CPU6502.MAX_TIME;\n\t\t\n\t\t// Loop until done, or SYNC or HALT\n\t\twhile(((exec < num_exec) || (this.realtime && !this.debug)) && \n\t\t\t !this.state.fb_update && \n\t\t\t this.state.ip != CPU6502.IP_END //&&\n\t\t\t //Date.now() < end\n\t\t\t && exec < CPU6502.MAX_EXEC\n\t\t\t )\n\t\t\t \n\t\t//while(this.state.ip != CPU6502.IP_END && Date.now() < end)\n\t\t{\n\t\t\tif (this.debug) this.disassemble_inst(this.state.ip, 1);\t\t\t\t// Dissassemble\n\t\t\t\n\t\t\tvar inst = CPU6502.inst_table[this.memory.get_byte(this.state.ip++)];\t// Get next inst\n\t\t\t\n\t\t\tif (inst.text == \"\") return(CPU6502.ERROR_UI);\t\t\t\t\t\t\t// Catch undefined inst\n\t\t\t\n\t\t\t//inst.f(this.memory, this.state);\t\t\t\t\t\t\t\t\t// Execute\n\t\t\tinst.f.call(this, this.memory, this.io, this.state);\n\n\t\t\tif (CPU6502.DUMP_STACK) this.dump_stack();\t\t\t\t\t\t\t\t// Display stack dump\n\n\t\t\tthis.state.ip += inst.s;\t\t\t\t\t\t\t\t\t\t\t// Consume operands, next ip\n\t\t\texec++;\n\t\t}\n\t\t\n\t\tthis.inst_updates += exec;\n\t\t\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "132a5d2c6944633aad2221ce1e4ea442", "score": "0.48649412", "text": "function executeAll() {\n\n\tif(decodedCode[decodedCode.length - 1] != \"END\") {\n\t\tdecodedCode.push(\"END\");\n\t}\n\n\tsimulationReset();\n\tcurrentStep = decodedCode.length - 1;\n\n\tsimulate();\n\n\t$(\"#simulationResultsContainer\").show();\n\tdisplayInstructions(decodedCode.length - 1);\n\tdisplayRegisters(registerStates.length - 1);\n\tdisplayMemory(memoryStates.length - 1);\n\tdisplayCycleData(cycleData.length);\n\n\tsetDownloadLink();\n\n\t$(\"#nextStepBtn\").attr(\"disabled\", \"disabled\");\n\t$(\"#prevStepBtn\").removeAttr(\"disabled\");\n\n\t$('html, body').animate({\n\t\tscrollTop: $(\"#simulationResultsContainer\").offset().top - 20\n\t}, 500);\n\n}", "title": "" }, { "docid": "f9cf3aa31ed4d18f7b946146a4676086", "score": "0.48647583", "text": "instruction(target, value) {\n var i, insTarget, insValue, len, node;\n this.openCurrent();\n if (target != null) {\n target = getValue(target);\n }\n if (value != null) {\n value = getValue(value);\n }\n if (Array.isArray(target)) { // expand if array\n for (i = 0, len = target.length; i < len; i++) {\n insTarget = target[i];\n this.instruction(insTarget);\n }\n } else if (isObject(target)) { // expand if object\n for (insTarget in target) {\n if (!hasProp.call(target, insTarget)) continue;\n insValue = target[insTarget];\n this.instruction(insTarget, insValue);\n }\n } else {\n if (isFunction(value)) {\n value = value.apply();\n }\n node = new XMLProcessingInstruction(this, target, value);\n this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n }\n return this;\n }", "title": "" }, { "docid": "88bf6f0ce6377dd5913dd015fbd23f87", "score": "0.48610735", "text": "function instructionHandler(inst,i,buildInstArray) {\n // The current command should be executed if it:\n // a) is mandatory\n // b) has never been executed, or\n // c) failed last time it was attempted\n trace(whoAmI,\"instructionHandler\",true);\n\n if (inst.m || inst.c !== 0) {\n // Execute the command and trap the return code (which might be null)\n var retVal = (inst.lib) ? this[inst.lib][inst.fn].apply(this,inst.p)\n : this[inst.fn].apply(this,inst.p);\n inst.c = parseRetCode(retVal);\n buildInstArray[i] = inst;\n }\n else {\n execCtx.utils.writeToConsole('log',[[\"Skipping successful step \\\"%s\\\"\",stepName(inst)]]);\n }\n\n trace(whoAmI,\"instructionHandler\",false);\n}", "title": "" }, { "docid": "cc4260501583f4165259df7753759340", "score": "0.48533374", "text": "function exec(array) {\n // JSON.stringify() for object array\n for (let i in array) {\n let op = JSON.stringify(array[i].exp);\n result = calc(op);\n console.log(result + \" = \" + array[i].expected);\n }\n return \"exec() complete.\";\n}", "title": "" }, { "docid": "862484b0a4975fc5d7320f7aed8615e2", "score": "0.48518553", "text": "function listOfInstrucions(instruction) {\r\n if (require.main === module) {\r\n // Soy un programa en la terminal\r\n\r\n\r\n instruction = Object.entries(argv)[1][0];\r\n // console.log(`###${instruction}`);\r\n\r\n\r\n switch (instruction) {\r\n case 'validate':\r\n show();\r\n console.log('Se analizará si su archivo tiene links');\r\n break;\r\n case 'v':\r\n show();\r\n console.log('Se analizará si su archivo tiene links');\r\n break;\r\n default:\r\n console.log('Comando no es reconocido');\r\n }\r\n }\r\n}", "title": "" }, { "docid": "f2223cb7f921e6ab545fcf93bcc69d00", "score": "0.48453954", "text": "function executor() {}", "title": "" }, { "docid": "dfce6f4d2a10917b995f0773ce33aad5", "score": "0.4824834", "text": "update (...args) {\n _.values(this._instances).forEach((instance) => {\n instance.evaluate(...args)\n })\n }", "title": "" }, { "docid": "871ce5553a47c4d50213e8e2cddeb234", "score": "0.47958574", "text": "function extractAsmInstructions(data) {\n return data.map(function (asmInstruction) {\n return {\n address: asmInstruction.address,\n func: asmInstruction['func-name'],\n offset: parseInt(asmInstruction.offset, 10),\n inst: asmInstruction.inst,\n opcodes: asmInstruction.opcodes,\n size: parseInt(asmInstruction.size, 10)\n };\n });\n}", "title": "" }, { "docid": "f32aa3ffc15e075bc7dcae60712623af", "score": "0.47842708", "text": "function copyArrayAndManipulate(array, instructions) {\n const output = [];\n for (let i = 0; i < array.length; i++) {\n output.push(instructions(array[i]));\n }\n return output;\n}", "title": "" }, { "docid": "3a3b19183bf3978609869d8c7bbe77ec", "score": "0.4777649", "text": "function executeSteps() {\n step1();\n // step2();\n // step3();\n // step4();\n // step5();\n // step6();\n}", "title": "" }, { "docid": "fe1aaf836f7a6de99b4c548ea23300ba", "score": "0.47656882", "text": "function executor(funcion){\n funcion.call(tutor);\n}", "title": "" }, { "docid": "0b79e1051a69218d51e014f3f0531b6a", "score": "0.4746296", "text": "function invoke (a, b, c, d, e) {\n\t\t\t\t/*jshint evil:true*/\n\t\t\t\t/*jshint unused:false*/\n\t\t\t\treturn eval('node.' + method + '(' + argsList + ');');\n\t\t\t}", "title": "" }, { "docid": "9735d2db158aaf83079b1bcb2dbb2d4b", "score": "0.4742471", "text": "function loadInstructions(fullStr) {\n splitted = fullStr.split(\"\\n\");\n instructions = splitted;\n }", "title": "" }, { "docid": "4f44de6e59a71c347bb6c4711a1774c2", "score": "0.4740475", "text": "function step() {\n var pc = getPC();\n var work_ins = get_memory(pc);\n var arg0, arg1;\n // Checks that first instruction makes sense\n if (!(work_ins in INSTRUCTIONS) || (work_ins === \"STP\")) {\n var potential_int = parseInt(work_ins);\n // Legal potential int.\n if (!isNaN(potential_int) && (BYTE_TO_INS.length > potential_int && potential_int > 0)) {\n // Configure work ins to symbolic mode.\n work_ins = BYTE_TO_INS[potential_int][0];\n var work_ins_arg_info = BYTE_TO_INS[potential_int][1];\n var work_ins_arg0_indicator = work_ins_arg_info[0];\n // Configure arg0\n if (work_ins_arg0_indicator === \"-\") {\n INSTRUCTIONS[work_ins][\"f\"]();\n }\n else {\n arg0 = set_op_code_type(get_op_code(pc + 1), work_ins_arg0_indicator);\n var work_ins_arg1_indicator = work_ins_arg_info[1];\n if (work_ins_arg1_indicator === \"-\") {\n INSTRUCTIONS[work_ins][\"f\"](arg0);\n }\n else {\n arg1 = set_op_code_type(get_op_code(pc + 2), work_ins_arg1_indicator);\n INSTRUCTIONS[work_ins][\"f\"](arg0, arg1);\n }\n }\n pc = getPC();\n write_to_console(\"End step at address \" + pc);\n return;\n }\n else {\n write_to_console(\"Stepped to end of program.\");\n return;\n }\n }\n var n_args = INSTRUCTIONS[work_ins].N_ARGS;\n // No args\n if (n_args == 0) {\n INSTRUCTIONS[work_ins][\"f\"]();\n }\n // 1 arg\n else if (n_args == 1) {\n arg0 = get_memory(pc + 1);\n INSTRUCTIONS[work_ins][\"f\"](arg0);\n }\n // 2 args\n else if (n_args == 2) {\n arg0 = get_memory(pc + 1);\n arg1 = get_memory(pc + 2);\n INSTRUCTIONS[work_ins][\"f\"](arg0, arg1);\n }\n pc = getPC();\n write_to_console(\"End step at address \" + pc);\n}", "title": "" }, { "docid": "a1a42b64cc8b28fca8e912b1413dd540", "score": "0.47237924", "text": "execute() {\n this.reset_();\n\n var code = this.blockly.getCode();\n\n try {\n this.evalWith_(code, this.api);\n } catch (e) {\n console.warn(e);\n }\n\n this.runAnimation(this.scene.level.processResult(this.stepQueue_,\n this.blockly));\n }", "title": "" }, { "docid": "b5ef334644d8bb046678005dc10f65e6", "score": "0.47223315", "text": "function powers(list) {\n\t// Program me!\n}", "title": "" }, { "docid": "b66646ca5beec78e78cd8c9e2c457fc0", "score": "0.4712184", "text": "function attachInstructionHandlers(jumps) {\n\t$(\".row.instruction\").on(\"mouseenter\", function(event) {\n\t\tvar instruc = event.currentTarget;\n\t\thighlightJumpArrows(jumps, instruc.id);\n\t});\n\n\t$(\".row.instruction\").on(\"click\", function(event) {\n\t\tvar instruc = event.currentTarget;\n\t\tassembly.active_instruction = event.currentTarget.id;\n\t\thighlightJumpArrows(jumps, instruc.id);\n\t});\n}", "title": "" }, { "docid": "416ce399a4cc3a5c90f4b84eac6beaab", "score": "0.47117838", "text": "function applyops(){\n\n applyops1();\n applyops2();\n applyops3();\n network.processAllOps();\n showops1();\n showops2();\n showops3();\n\n}", "title": "" }, { "docid": "e1b66c3c64b1d96be4b0e2113b4dcf7a", "score": "0.46899423", "text": "nextStep() {\n\n\n switch (this.count) {\n\n case 1:\n this.typeCode();\n\n break;\n case 2:\n this.memoryHint();\n break;\n case 3:\n this.registerHint();\n break;\n case 4:\n this.runFirstCode();\n case 5:\n \n \n break;\n\n }\n\n\n}", "title": "" }, { "docid": "1d14aca2a5882c632a6dce189d1f48a2", "score": "0.46831664", "text": "function run(code, state, ops) {\n if (!(state instanceof State)) {\n ops = state;\n state = null;\n }\n if (!state) {\n state = new State(code);\n } else {\n state.setCode(code);\n }\n\n mxtend(state.ops, ops);\n return cont(state);\n}", "title": "" }, { "docid": "cf160b13a7440b6c08db9840403c1f8b", "score": "0.4674491", "text": "function runProgram() {\n while (instrPointer < memory.length && amplifierOutput === undefined) {\n const code = memory[instrPointer];\n const codeStr = code + '';\n const opcode = code == 99 ? 99 : parseInt(\n (codeStr.length > 1 ? codeStr[codeStr.length - 2] : '0')\n + codeStr[codeStr.length - 1]);\n\n\n const p1 = codeStr.length > 2 ? parseInt(codeStr[codeStr.length - 3]) : 0;\n const p2 = codeStr.length > 3 ? parseInt(codeStr[codeStr.length - 4]) : 0;\n const p3 = codeStr.length > 4 ? parseInt(codeStr[codeStr.length - 5]) : 0;\n console.log(`Opcode: ${codeStr}. p1: ${p1} p2: ${p2} p3: ${p3}`);\n const instruction = INSTRUCTIONS.get(opcode);\n const numInstructions = instruction.numInstructions;\n\n const params = memory.slice(instrPointer + 1, instrPointer + numInstructions);\n\n if (instruction.operation(params, p1, p2, p3, io)) {\n instrPointer += numInstructions;\n }\n\n // console.log(memory.slice(0, 10));\n // console.log();\n }\n }", "title": "" }, { "docid": "31f61063343a1b7fa91000e553f40a85", "score": "0.46531394", "text": "get instructions() {\n return this._instructions;\n }", "title": "" }, { "docid": "8c069cb8362a7b1f11a9f6ace876b7f8", "score": "0.46418747", "text": "function programRunner( input ){\n\tlet ii = 0;\n\tlet running = true;\n\n\twhile( running ){\n\t\t\n\t\t// Variable for the instruction and parameters\n\t\tlet instruction = 0;\n\t\tlet p1 = 0;\n\t\tlet p2 = 0;\n\t\tlet p3 = 0;\n\n\t\t// Parses the instruction\n\t\tlet commandString = input[ii].toString();\n\t\tif( commandString.length > 1 ){\n\t\t\t// Prepends 0's\n\t\t\tif( commandString.length == 5 ){\n\t\t\t\tconsole.log(\"\\nCommand of length 5\\n\");\n\t\t\t}\n\t\t\twhile( commandString.length < 5 ){\n\t\t\t\tcommandString = \"0\" + commandString;\n\t\t\t}\n\n\t\t\tinstruction = parseInt( commandString.slice(3) );\n\t\t\tp1 = parseInt(commandString[2]);\n\t\t\tp2 = parseInt(commandString[1]);\n\t\t\tp3 = parseInt(commandString[0]);\n\n\t\t\t\n\t\t}\n\n\t\t// Else, all commands are immediate\n\t\telse{\n\t\t\tinstruction = input[ii];\n\t\t}\n\n\t\t// Turns all references-mode parameters into immediate-mode parameters\n\t\tif( p1 == 0 ){\n\t\t\tp1 = input[input[ ii+1 ]];\n\t\t} else {\n\t\t\tp1 = input[ii+1];\n\t\t}\n\n\t\tif( p2 == 0 ){\n\t\t\tp2 = input[input[ ii+2 ]];\n\t\t} else {\n\t\t\tp2 = input[ii+2];\n\t\t}\n\n\t\tif (p3 == 0){\n\t\t\tp3 = input[ ii+3 ];\n\t\t} else {\n\t\t\tp3 = input[ii+3];\n\t\t}\n\n\n\n\t\toutputLog( \"Executing instruction\", ii, \":\", instruction, p1, p2, p3, \"(\", input[ii], \")\" );\n\n\t\t// OPCODE 1: Add\n\t\tif( instruction == 1 ){\n\t\t\t\n\t\t\tlet jj = input[ii + 3];\n\t\t\tlet x = input[ii+1];\n\t\t\tlet y = input[ii+2];\n\t\t\t// outputLog(\"Command: \", input[ii], input[x], input[y], jj );\n\t\t\tinput[ p3 ] = p2 + p1;\n\t\t\toutputLog(p1, \"+\", p2, \"in location\", p3 );\n\t\t\tii+=4\n\t\t\t// outputLog(\"Result: \", input[jj] );\n\t\t}\n\n\t\t// OPCODE 2: Multiply\n\t\t else if( instruction == 2 ){\n\t\t \t\n\t\t \tlet jj = input[ii + 3]\n\t\t\tlet x = input[ii+1];\n\t\t\tlet y = input[ii+2];\n\t\t\t// outputLog(\"Command: \", input[ii], input[x], input[y], jj );\n\t\t \t// input[jj] = input[x] * input[y]\n\t\t\tinput[ p3 ] = p1 * p2;\n\t\t\toutputLog(p1, \"*\", p2, \"in location\", p3 );\n\t\t \tii+=4\n\t\t\t// outputLog(\"Result: \", input[jj] );\n\t\t}\n\n\t\t// OPCODE 3: Takes a single integer as input, and stores it at the given address\n\t\telse if( instruction == 3 ){\n\t\t\toutputLog( \"Please input a number: \");\n\t\t\tconsoleInput = programInput; // for now\n\t\t\tlet destination = input[ii+1];\n\t\t\toutputLog( \"Storing\", consoleInput, \"in\", destination);\n\t\t\tinput[destination] = consoleInput;\n\t\t\tii+=2;\n\t\t}\n\n\t\t// OPCODE 4: Prints the output at the given address\n\t\telse if( instruction == 4 ){\n\t\t\tconsole.log( \"Output: \", p1 );\n\t\t\tii+=2;\n\t\t}\n\n\t\t// OPCODE 5: JUMP IF TRUE\n\t\t// If the first parameter is non-zero, it sets the instruction pointer to the \n\t\t// value from the second parameter. Otherwise, it does nothing.\n\t\telse if( instruction == 5 ){\n\t\t\tif( p1 != 0){\n\t\t\t\tii = p2;\n\t\t\t} else {\n\t\t\t\tii+=3;\n\t\t\t}\n\t\t}\n\n\t\t// OPCODE 6: JUMP IF FALSE\n\t\t// if the first parameter is zero, it sets the instruction pointer to the value from the \n\t\t// second parameter. Otherwise, it does nothing.\n\t\telse if( instruction == 6 ){\n\t\t\tif( p1 == 0 ){\n\t\t\t\tii = p2;\n\t\t\t} else {\n\t\t\t\tii+=3;\n\t\t\t}\n\t\t}\n\n\t\t// Opcode 7: Less Than\n\t\t// if the first parameter is less than the second parameter, \n\t\t// it stores 1 in the position given by the third parameter. Otherwise, it stores 0.\n\t\telse if( instruction == 7 ){\n\t\t\tif( p1 < p2 ){\n\t\t\t\tinput[p3] = 1;\n\t\t\t} else {\n\t\t\t\tinput[p3] = 0;\n\t\t\t}\n\t\t\tii+=4;\n\t\t}\n\n\t\t// Opcode 8: Equal To\n\t\t// If p1 == p2, store 1 in p3\n\t\t// Otherwise, store 0\n\t\telse if( instruction == 8 ){\n\t\t\tif( p1 == p2 ){\n\t\t\t\tinput[p3] = 1;\n\t\t\t} else {\n\t\t\t\tinput[p3] = 0;\n\t\t\t}\n\t\t\tii+=4;\n\t\t}\n\n\t\t// Error\n\t\telse if( input[ii] == 99 ) {\n\t\t\toutputLog( \"Exit code 99 at command \", ii );\n\t\t\trunning = false;\n\t\t}\n\n\t\telse {\n\t\t\toutputLog( \"Something went wrong!\" );\n\t\t\trunning = false;\n\t\t}\n\n\t}\n\n\treturn input;\n}", "title": "" }, { "docid": "7ad79dd94e3935b11d93f1004ce9b67e", "score": "0.46398297", "text": "function startAllEngine(list) {\n for (var i = 0; i < list.length; i++) {\n list[i].start();\n }\n}", "title": "" }, { "docid": "c3720cad32eb63e3d435843c9b2a8241", "score": "0.46394065", "text": "execute () {\n }", "title": "" }, { "docid": "c069a59dcb8f9981700d50ba6f273e5b", "score": "0.4612787", "text": "function executeInstructions(coordinates, from, to, state) {\n var startX = +from.split(',')[0],\n endX = +to.split(',')[0],\n startY = +from.split(',')[1],\n endY = +to.split(',')[1];\n\n for (var iX = startX; iX <= endX; iX++) {\n for (var iY = startY; iY <= endY; iY++) {\n var currentState = coordinates[iX][iY];\n\n if (state === 'toggle') {\n if (currentState === true) {\n var newState = false;\n } else {\n var newState = true;\n }\n } else if(state === 'on') {\n var newState = true;\n } else if(state === 'off') {\n var newState = false;\n }\n coordinates[iX][iY] = newState;\n }\n }\n}", "title": "" }, { "docid": "70aa18de99d68750ac1c6d51c3075021", "score": "0.46047056", "text": "execute() {}", "title": "" }, { "docid": "70aa18de99d68750ac1c6d51c3075021", "score": "0.46047056", "text": "execute() {}", "title": "" }, { "docid": "6856b30c1fe81131d805723061e47b8c", "score": "0.45968595", "text": "function exec() {\n\n const actions = {\n commands: {\n run: { action: _run }\n }\n };\n\n bag.command(DIRNAME, actions);\n}", "title": "" }, { "docid": "a9431e8d1f207a264491613beb05757c", "score": "0.4595605", "text": "static invokeMultiple(ctx, args) {\n\n }", "title": "" }, { "docid": "f5c9f2931588a41a9384b9e35163af96", "score": "0.45882452", "text": "function Iterate(arr, op, args = []) {\n arr.forEach(function(a) { a[op](...args); });\n}", "title": "" }, { "docid": "a5f1ab6c0db7349ce02d2fb05e05343e", "score": "0.45874488", "text": "function executeCommands(commands, grid) {\n return commands.reduce(dispatchCommand, grid);\n}", "title": "" }, { "docid": "93a0f2a515d05478b5a50128610fa079", "score": "0.45867193", "text": "function decodeAndExecute(instructionBinary) {\n\n\tvar shouldStall = false;\n\tvar stallLocations = findInstruction(instructionBinary, ACTIONS.SHOULD_STALL);\n\n\tif(previousExecutionResult) {\n\n\t\tif(previousExecutionResult.stallLocation) {\t\t\n\n\t\t\tfor(var i = 0; i < stallLocations.length; i++) {\n\t\t\t\tif(stallLocations[i] == previousExecutionResult.stallLocation) {\n\t\t\t\t\tshouldStall = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(shouldStall) {\n\t\t\t\tstall(previousExecutionResult.stallAmount);\n\t\t\t\tdidPreviousStall = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdidPreviousStall = false;\n\t\t\t}\n\t\t}\n\n\t\tif(previousExecutionResult.shouldBranch) {\n\t\t\tpcCounter += previousExecutionResult.branchOffset;\n\t\t\tcycleCounter++;\n\n\t\t\tmemoryStates.push(Object.assign({}, memoryStates[memoryStates.length - 1]));\n\t\t\tregisterStates.push(Object.assign({}, registerStates[registerStates.length - 1]));\n\n\t\t\treturn;\n\t\t}\n\n\t}\n\n\tif(secondPreviousResult && !didPreviousStall) {\n\n\t\tif(secondPreviousResult.stallLocation) {\n\n\t\t\tvar shouldStallSecond = false;\n\n\t\t\tfor(var i = 0; i < stallLocations.length; i++) {\n\t\t\t\tif(stallLocations[i] == secondPreviousResult.stallLocation) {\n\t\t\t\t\tshouldStallSecond = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(shouldStallSecond) {\n\t\t\t\tstall(secondPreviousResult.stallAmount - 1);\n\t\t\t}\n\n\t\t}\n\t}\n\n\tcycleData[pcCounter][cycleCounter] = \"I\" + (pcCounter + 1) + \"-ID\";\n\tcycleCounter++;\n\n\tvar executionResult = findInstruction(instructionBinary, ACTIONS.EXECUTE);\n\n\tcycleData[pcCounter][cycleCounter] = \"I\" + (pcCounter + 1) + \"-EX\";\n\tcycleCounter++;\n\n\treturn executionResult;\n\n}", "title": "" }, { "docid": "3f620115c5c3d5a300f396d83118dedf", "score": "0.45782152", "text": "run() {\n this.tests.forEach(contexts => {\n contexts.execute();\n })\n }", "title": "" }, { "docid": "675de84230fe4acf1da38eb01fa6c77d", "score": "0.4567771", "text": "function nextInstruction() {\n\tgetInput();\n}", "title": "" }, { "docid": "8541203b90ce7e938dbb57f9d8245d03", "score": "0.45644805", "text": "function InstructionMemory(instructionArray, offset) {\n\tif (instructionArray === undefined) {\n\t\tthis.instructions = new Array();\n\t} else {\n\t\tthis.instructions = instructionArray;\n\t}\n\tif (offset === undefined) {\n\t\tthis.offset = 0;\n\t} else {\n\t\tthis.offset = offset;\n\t}\n\tthis.current = 0;\n}", "title": "" }, { "docid": "e87020a4769afa0f242e7ff983152831", "score": "0.45528936", "text": "function listProcessor(arr = []) {\r\n const obj = {\r\n array: [],\r\n };\r\n\r\n for (const line of arr) {\r\n\r\n const [command, str] = line.split(' ');\r\n\r\n switch (command) {\r\n case 'add': add.call(obj, str); break;\r\n case 'remove': remove.call(obj, str); break;\r\n case 'print': print.call(obj); break;\r\n }\r\n }\r\n\r\n function add(str) {\r\n return this.array.push(str);\r\n }\r\n\r\n function remove(str) {\r\n while (this.array.includes(str)) {\r\n this.array.splice(this.array.indexOf(str), 1);\r\n }\r\n return this.array;\r\n }\r\n\r\n function print() {\r\n console.log(this.array.join(','));\r\n }\r\n}", "title": "" }, { "docid": "8bbb993e25b97da1fd6addcd2b3d0656", "score": "0.45483264", "text": "run(values) {\n let stack = [];\n\n // Push a guaranteed Value\n stack.op0 = function(value) {\n if( !( value instanceof Value ) ){\n value = new Value(value);\n }\n\n this.push(value);\n }\n\n // Perform stack operation with one operand\n stack.op1 = function(fn) {\n this.op0(fn(this.pop()));\n }\n\n // Perform stack operation with two operands\n stack.op2 = function(fn) {\n let b = this.pop();\n this.op0(fn(this.pop(), b));\n }\n\n // Perform stack operation with three operands\n stack.op3 = function(fn) {\n let c = this.pop();\n let b = this.pop();\n this.op0(fn(this.pop(), b, c));\n }\n\n this.traverse(this.ast, stack, Object.assign({}, values || {}));\n return stack.pop();\n }", "title": "" }, { "docid": "fae79293771f445b75ced4b27ca48b1f", "score": "0.4543056", "text": "function chooseOperation() {\r\n var opcode = $(\"#filterOpcode\").val();\r\n var func = new Function(opcode + \"();\");\r\n incrementPc(4);\r\n printOperation();\r\n func();\r\n}", "title": "" }, { "docid": "32b93c03d8530927c83c3682ce1bc503", "score": "0.45403448", "text": "async displayIntructions(){\n this.setState({ instructionsMode: true, failed: false });\n for(let o of this.state.instructions){\n await this.hitButton(o, false);\n }\n this.setState({ instructionsMode: false });\n }", "title": "" }, { "docid": "b8951385f9da01461b73288359678544", "score": "0.45388064", "text": "function ProcessingInstruction(simple)\n{\n\tProcessingInstruction.super_.apply(this, [simple]);\n}", "title": "" }, { "docid": "3598c2864ef0978e8cd75940c1a570f1", "score": "0.45379838", "text": "function exec() {\n\n var actions = {\n commands: {\n run: { action: _run }\n }\n };\n\n bag.command(__dirname, actions);\n}", "title": "" }, { "docid": "fd0269aaf1b9be866885ec079babf936", "score": "0.45333305", "text": "execute (params) {\n let commandState = params.commandState;\n const { disabled, action } = commandState;\n if (disabled) return\n\n let editorSession = params.editorSession;\n switch (action) {\n case 'toggleList': {\n editorSession.transaction((tx) => {\n tx.toggleList();\n }, { action: 'toggleList' });\n break\n }\n case 'setListType': {\n const { listId, level } = commandState;\n editorSession.transaction((tx) => {\n let list = tx.get(listId);\n list.setListType(level, this.config.spec.listType);\n }, { action: 'setListType' });\n break\n }\n case 'switchTextType': {\n editorSession.transaction((tx) => {\n tx.toggleList({ listType: this.config.spec.listType });\n }, { action: 'toggleList' });\n break\n }\n default:\n //\n }\n }", "title": "" }, { "docid": "41f9a94a06127ad6f2bf035e91999c51", "score": "0.4530532", "text": "function invoke (){\n AllLocations.prototype.runderhours();\n AllLocations.prototype.runder();\n AllLocations.prototype.theButtomRow()\n\n}", "title": "" }, { "docid": "69e515df8e8dedde24e817a98ee4226f", "score": "0.4523021", "text": "function chainedInstruction(reference,calls,span){var expression=importExpr(reference,null,span);if(calls.length>0){for(var i=0;i<calls.length;i++){expression=expression.callFn(calls[i],span)}}else{// Add a blank invocation, in case the `calls` array is empty.\nexpression=expression.callFn([],span)}return expression}", "title": "" }, { "docid": "8552bc72355cbc7c60fde8b5a6d308f2", "score": "0.4513652", "text": "function ExpandoInstructions(){}", "title": "" }, { "docid": "0c6d65f9b923170a939a5200ae2ceef5", "score": "0.44951284", "text": "apply (compiler) {\n this.util.runAll(compiler, this.run.bind(this, compiler))\n }", "title": "" }, { "docid": "506def0b2c22ed8030e3a8e4a3021a65", "score": "0.44903278", "text": "function step() {\n\n // read 32-bit instruction from PC through PC + 3\n\n let instr = new Int32();\n instr.setBits(0, mem[pc + 3]);\n instr.setBits(8, mem[pc + 2]);\n instr.setBits(16, mem[pc + 1]);\n instr.setBits(24, mem[pc]);\n\n let op = decodeOperation(instr);\n\n switch (op.instr) {\n case \"ADD\":\n case \"ADDS\":\n {\n let sum = addWithCarry(registers[op.Xn], registers[op.Xm], 0);\n if (op.instr === \"ADDS\") {\n n = sum.n;\n z = sum.z;\n c = sum.c;\n v = sum.v;\n }\n registers[op.Xd] = sum.sum;\n pc += 4;\n }\n break;\n case \"ADDI\":\n case \"ADDIS\":\n {\n let uimm = binaryPad(op.uimm12, 12);\n let immInt64 = new Int64();\n immInt64.setBits(52, uimm);\n let sum = addWithCarry(registers[op.Xn], immInt64, 0);\n if (op.instr === \"ADDIS\") {\n n = sum.n;\n z = sum.z;\n c = sum.c;\n v = sum.v;\n }\n registers[op.Xd] = sum.sum;\n pc += 4;\n }\n break;\n case \"SUB\":\n case \"SUBS\":\n {\n let diff = addWithCarry(registers[op.Xn], logNot(registers[op.Xm]), 1);\n if (op.instr === \"SUBS\") {\n n = diff.n;\n z = diff.z;\n c = diff.c;\n v = diff.v;\n }\n registers[op.Xd] = diff.sum;\n pc += 4;\n }\n break;\n case \"SUBI\":\n case \"SUBIS\":\n {\n let uimm = binaryPad(op.uimm12, 12);\n let immInt64 = new Int64();\n immInt64.setBits(52, uimm);\n let sum = addWithCarry(registers[op.Xn], logNot(immInt64), 1);\n if (op.instr === \"SUBIS\") {\n n = sum.n;\n z = sum.z;\n c = sum.c;\n v = sum.v;\n }\n registers[op.Xd] = sum.sum;\n pc += 4;\n }\n break;\n\n case \"AND\":\n {\n registers[op.Xd] = logAnd(registers[op.Xn], registers[op.Xm]);\n pc += 4;\n }\n break;\n case \"ANDI\":\n {\n let uimm = binaryPad(op.uimm12, 12);\n let immInt64 = new Int64();\n immInt64.setBits(52, uimm);\n registers[op.Xd] = logAnd(registers[op.Xn], immInt64);\n pc += 4;\n }\n break;\n case \"ORR\":\n {\n registers[op.Xd] = logOr(registers[op.Xn], registers[op.Xm]);\n pc += 4;\n }\n break;\n case \"ORRI\":\n {\n let uimm = binaryPad(op.uimm12, 12);\n let immInt64 = new Int64();\n immInt64.setBits(52, uimm);\n registers[op.Xd] = logOr(registers[op.Xn], immInt64);\n pc += 4;\n }\n break;\n case \"EOR\":\n {\n registers[op.Xd] = logXor(registers[op.Xn], registers[op.Xm]);\n pc += 4;\n }\n break;\n case \"EORI\":\n {\n let uimm = binaryPad(op.uimm12, 12);\n let immInt64 = new Int64();\n immInt64.setBits(52, uimm);\n registers[op.Xd] = logXor(registers[op.Xn], immInt64);\n pc += 4;\n }\n break;\n case \"LSL\":\n {\n let shamt = op.shamt;\n registers[op.Xd] = lsl(registers[op.Xn], shamt);\n pc += 4;\n }\n break;\n case \"LSR\":\n {\n let shamt = op.shamt;\n registers[op.Xd] = lsr(registers[op.Xn], shamt);\n pc += 4;\n }\n break;\n\n case \"MOVZ\":\n case \"MOVK\":\n {\n let uimm = binaryPad(op.uimm16, 16);\n if (op.instr === \"MOVZ\") {\n registers[op.Xd] = new Int64();\n }\n registers[op.Xd].setBits((64 - op.lsln - 16), uimm);\n pc += 4;\n }\n break;\n\n case \"ADR\":\n {\n let adr = (op.simm19 * 4) + pc;\n registers[op.Xt].setBits(44, uimm(`#${adr}`, 20));\n pc += 4;\n }\n break;\n case \"HLT\":\n {\n running = false;\n }\n break;\n\n case \"LDUR\":\n {\n // load double word\n let loadFrom = Number(registers[op.Xn].toNumber(false)) + op.simm9;\n let bytesToLoad = 8; // double word\n for (let i = 0; i < bytesToLoad; ++i) {\n let byte = mem[loadFrom + i];\n for (let j = 0; j < 8; ++j) {\n registers[op.Xt].setBits(56 - (8 * i) + j, `${byte[j]}`);\n }\n }\n pc += 4;\n }\n break;\n case \"LDURSW\":\n {\n // load sign extended word\n let loadFrom = Number(registers[op.Xn].toNumber(false)) + op.simm9;\n let bytesToLoad = 4; // single word\n for (let i = 0; i < bytesToLoad; ++i) {\n let byte = mem[loadFrom + i];\n for (let j = 0; j < 8; ++j) {\n registers[op.Xt].setBits(56 - (8 * i) + j, `${byte[j]}`);\n }\n }\n let msb = registers[op.Xt].byteArr[4][0];\n for (let i = 0; i < 3; ++i) {\n for (let j = 0; j < 8; ++j) {\n registers[op.Xt].byteArr[i][j] = msb;\n }\n }\n pc += 4;\n }\n break;\n case \"LDURH\":\n {\n // load half word\n let loadFrom = Number(registers[op.Xn].toNumber(false)) + op.simm9;\n let bytesToLoad = 2; // half word\n for (let i = 0; i < bytesToLoad; ++i) {\n let byte = mem[loadFrom + i];\n for (let j = 0; j < 8; ++j) {\n registers[op.Xt].setBits(56 - (8 * i) + j, `${byte[j]}`);\n }\n }\n // zero extend\n for (let i = 0; i < 5; ++i) {\n for (let j = 0; j < 8; ++j) {\n registers[op.Xt].byteArr[i][j] = 0;\n }\n }\n pc += 4;\n }\n break;\n case \"LDURB\":\n {\n // load byte\n let loadFrom = Number(registers[op.Xn].toNumber(false)) + op.simm9;\n let bytesToLoad = 1; // half word\n for (let i = 0; i < bytesToLoad; ++i) {\n let byte = mem[loadFrom + i];\n for (let j = 0; j < 8; ++j) {\n registers[op.Xt].setBits(56 - (8 * i) + j, `${byte[j]}`);\n }\n }\n // zero extend\n for (let i = 0; i < 7; ++i) {\n for (let j = 0; j < 8; ++j) {\n registers[op.Xt].byteArr[i][j] = 0;\n }\n }\n pc += 4;\n }\n break;\n\n case \"STUR\":\n {\n // store double word\n let storeTo = Number(registers[op.Xn].toNumber(false)) + op.simm9;\n let bytesToStore = 8;\n for (let i = 0; i < bytesToStore; ++i) {\n let destByte = storeTo + i;\n activeMemory[destByte] = true;\n let srcByteIdx = 7 - i;\n for (let j = 0; j < 8; ++j) {\n mem[destByte][j] = registers[op.Xt].byteArr[srcByteIdx][j];\n }\n }\n pc += 4;\n }\n break;\n case \"STURW\":\n {\n // store word\n let storeTo = Number(registers[op.Xn].toNumber(false)) + op.simm9;\n let bytesToStore = 4;\n for (let i = 0; i < bytesToStore; ++i) {\n let destByte = storeTo + i;\n activeMemory[destByte] = true;\n let srcByteIdx = 7 - i;\n for (let j = 0; j < 8; ++j) {\n mem[destByte][j] = registers[op.Xt].byteArr[srcByteIdx][j];\n }\n }\n pc += 4;\n }\n break;\n case \"STURH\":\n {\n // store half word\n let storeTo = Number(registers[op.Xn].toNumber(false)) + op.simm9;\n let bytesToStore = 2;\n for (let i = 0; i < bytesToStore; ++i) {\n let destByte = storeTo + i;\n activeMemory[destByte] = true;\n let srcByteIdx = 7 - i;\n for (let j = 0; j < 8; ++j) {\n mem[destByte][j] = registers[op.Xt].byteArr[srcByteIdx][j];\n }\n }\n pc += 4;\n }\n break;\n case \"STURB\":\n {\n // store byte\n let storeTo = Number(registers[op.Xn].toNumber(false)) + op.simm9;\n let bytesToStore = 1;\n for (let i = 0; i < bytesToStore; ++i) {\n let destByte = storeTo + i;\n activeMemory[destByte] = true;\n let srcByteIdx = 7 - i;\n for (let j = 0; j < 8; ++j) {\n mem[destByte][j] = registers[op.Xt].byteArr[srcByteIdx][j];\n }\n }\n pc += 4;\n }\n break;\n\n case \"B\":\n {\n // unconditional branch\n let deltaPC = op.simm26 * 4;\n pc += deltaPC;\n }\n break;\n case \"BL\":\n {\n // branch and link\n let deltaPC = op.simm26 * 4;\n let newPC = pc + deltaPC;\n // set LR\n registers[30] = pc + 4;\n pc = newPC;\n }\n break;\n case \"BR\":\n {\n // branch to register\n let Xt = op.Xn;\n pc = Number(registers[Xt].toNumber(false));\n }\n break;\n\n case \"CBZ\":\n {\n // conditional branch zero\n if (Number(registers[op.Xt].toNumber(false)) === 0) {\n // branch\n pc += op.simm19 * 4;\n } else {\n pc += 4;\n }\n }\n break;\n case \"CBNZ\":\n {\n // conditional branch not zero\n if (Number(registers[op.Xt].toNumber(false)) !== 0) {\n // branch\n pc += op.simm19 * 4;\n } else {\n pc += 4;\n }\n }\n break;\n\n case \"B.cond\":\n {\n // conditional branch based on flags\n let flag = op.cond;\n let newPC = pc + op.simm19 * 4;\n switch (flag) {\n case \"EQ\":\n if (z === 1) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"NE\":\n if (z !== 1) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"HS\":\n if (c === 1) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"LO\":\n if (c === 0) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"MI\":\n if (n === 1) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"PL\":\n if (n === 0) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"VS\":\n break;\n case \"VC\":\n break;\n case \"HI\":\n if ((z === 0 && c === 1)) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"LS\":\n if (!(z === 0 && c === 1)) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"GE\":\n if (n === v) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"LT\":\n if (n !== v) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"GT\":\n if ((z === 0 && n === v)) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"LE\":\n if (!(z === 0 && n === v)) {\n pc = newPC;\n } else {\n pc += 4;\n }\n break;\n case \"AL\":\n case \"NV\":\n pc = newPC;\n break;\n }\n }\n break;\n default:\n error_output.append(`<p style=\"color: red\">Error: couldn't decode the instruction starting at PC=${pc}!</p>`);\n running = false;\n break;\n\n }\n\n if (!running) {\n step_button.disabled = true;\n run_button.disabled = true;\n }\n\n registers[31] = new Int64();\n\n outputFlags();\n outputMemory();\n outputRegisters();\n outputCurrentInstruction();\n}", "title": "" }, { "docid": "63f61b459bea03201877a48511e9a2fb", "score": "0.44818783", "text": "function querySelectorAllForEach(selector, exec) {\n var nodes = document.querySelectorAll(selector);\n if (nodes) {\n for (var i = 0; i < nodes.length; i++) {\n exec(nodes[i]);\n }\n }\n}", "title": "" }, { "docid": "18d5f07f7338f3838a20c7b25d957437", "score": "0.44684064", "text": "function InstructionState() {}", "title": "" }, { "docid": "18d5f07f7338f3838a20c7b25d957437", "score": "0.44684064", "text": "function InstructionState() {}", "title": "" }, { "docid": "18d5f07f7338f3838a20c7b25d957437", "score": "0.44684064", "text": "function InstructionState() {}", "title": "" }, { "docid": "bf8c7707f04b6498d22cc8682795543c", "score": "0.445519", "text": "function execute() {\n var listeners,\n async = isAsync(bench);\n\n if (async) {\n // use `getNext` as the first listener\n bench.on('complete', getNext);\n listeners = bench.events.complete;\n listeners.splice(0, 0, listeners.pop());\n }\n // execute method\n result[index] = isClassOf(bench && bench[name], 'Function') ? bench[name].apply(bench, args) : undefined;\n // if synchronous return true until finished\n return !async && getNext();\n }", "title": "" }, { "docid": "bf8c7707f04b6498d22cc8682795543c", "score": "0.445519", "text": "function execute() {\n var listeners,\n async = isAsync(bench);\n\n if (async) {\n // use `getNext` as the first listener\n bench.on('complete', getNext);\n listeners = bench.events.complete;\n listeners.splice(0, 0, listeners.pop());\n }\n // execute method\n result[index] = isClassOf(bench && bench[name], 'Function') ? bench[name].apply(bench, args) : undefined;\n // if synchronous return true until finished\n return !async && getNext();\n }", "title": "" }, { "docid": "9d55f92f2bffa7c9bd60fbaa4f559468", "score": "0.4450284", "text": "function simulate() {\n\n\tregisterStates.push(Object.assign({}, registers));\n\tmemoryStates.push(Object.assign({}, memory));\n\n\twhile(pcCounter < instructions.length) {\n\n\t\tvar instruction = instructionFetch();\n\n\t\tvar executionResult = decodeAndExecute(instruction);\n\n\t\tif(executionResult) {\n\n\t\t\tsecondPreviousResult = previousExecutionResult;\n\n\t\t\tpreviousExecutionResult = executionResult;\n\n\t\t\twriteMemory(executionResult);\n\n\t\t\twriteBack(executionResult);\n\n\t\t\tpcCounter++;\n\n\t\t\tcycleCounter -= 4;\n\t\t}\n\t\telse {\n\t\t\tpreviousExecutionResult = null;\n\t\t}\n\n\t}\n\n\tcycleCounter += 4;\n\n}", "title": "" }, { "docid": "1585f895a17ed25b39e172ebb5032a5a", "score": "0.44473583", "text": "constructor(instructions, playerID) {\n this.#instr = instructions;\n this.#playerID = playerID;\n }", "title": "" }, { "docid": "242ed9436eeb564de6a0988f0d7f3760", "score": "0.4445393", "text": "step () {\n let symbol = this.axiom[this.position];\n // perform the action associated with the rule\n if (this.rules[symbol]) {\n this.rules[symbol]();\n }\n // if it is a constant, call the associated method\n else if (this.constants[symbol]) {\n this.constants[symbol]();\n }\n\n this.position += 1;\n }", "title": "" }, { "docid": "d0d29baebf8fdf83ee6e3f5f29142bfc", "score": "0.44436517", "text": "function instruction(type){\n\n\tvar instructionBreakdownProcessSuccess = instructionBreakdownProcess(type);\n\t\n\tif (instructionBreakdownProcessSuccess){\n\tif (document.getElementById(\"InstructionType\").value ==\"Load\") {\n\t\tinstructionLoadExecuteSteps(); \n\t\t\t\t\tlistOfInstructionsLS.push(\"Load\");\n \n\t}\n\telse{\n\t\tstoreInstruction();\n\t\tlistOfInstructionsLS.push(\"Store\");\t\t\n\t}\n\t}\n\n}", "title": "" }, { "docid": "57bcec70ba57e3da1c8dc4098f8bcefc", "score": "0.44435653", "text": "function instruction_display (instruction)\n{\nvar element_ids =\n [\n [\"#inst_o_bit_1\", \"#inst_m_bit_1\", \"#inst_n_bit_1\"] ,\n [\"#inst_o_bit_2\", \"#inst_m_bit_2\", \"#inst_n_bit_2\"] ,\n [\"#inst_o_bit_4\", \"#inst_m_bit_4\", \"#inst_n_bit_4\"] ,\n [\"#inst_o_bit_8\", \"#inst_m_bit_8\", \"#inst_n_bit_8\"] ,\n [\"#inst_o_bit_a\", \"#inst_m_bit_a\", \"\"] ,\n [\"#inst_o_bit_b\", \"#inst_m_bit_b\", \"\"]\n ] ;\n\nset_bit_switches (element_ids, instruction) ;\n\n} // instruction_display //", "title": "" }, { "docid": "c404569c7af2b74b7123900af5fdcb64", "score": "0.4428599", "text": "function run () {\n // Takes raw input, and splits it into lines, stored in the instructions array\n raw = document.getElementById(\"programInput\").value; // Get input\n instructions = raw.split(/\\r?\\n/); // Split on newline\n\n // Resets registers and output, and updates UI\n reset();\n\n // Loop through each instruction in array\n for (i = 0; i < instructions.length; i++) {\n // Split each instruction on space, and store in array\n instruction = instructions[i].split(\" \");\n line = i+1;\n\n if (debug) {\n output(line + \": \" + instruction, 2);\n }\n\n // Watch [0] (Where instruction name stored\n switch (instruction[0]) {\n case \"#\": // Comment\n break;\n case \"add\":\n set (instruction[1], get(instruction[2])+get(instruction[3]));\n break;\n case \"sub\":\n set (instruction[1], get(instruction[2])-get(instruction[3]));\n break;\n case \"addi\":\n set (instruction[1], get(instruction[2])+Number(instruction[3]));\n break;\n case \"load\":\n set (instruction[1], Number(instruction[2]));\n break;\n case \"jmp\":\n i = Number(instruction[1]) - 2; // Offset by -2 (Counting from zero, and i++ each time)\n break;\n case \"ife\":\n if (get(instruction[1]) === get(instruction[2]))\n i = Number(instruction[3]) - 2; // Offset by -2 (Counting from zero, and i++ each time)\n break;\n case \"ifne\": // Compare two registers\n if (get(instruction[1]) !== get(instruction[2]))\n i = Number(instruction[3]) - 2; // Offset by -2 (Counting from zero, and i++ each time)\n break;\n case \"stdout\": // Output value stored in register\n output(get(instruction[1]), 0);\n break;\n case \"stderr\": // Output value stored in register, as error\n output(get(instruction[1]), 1);\n break;\n case \"stdoutt\": // Output text\n output(instruction[1], 0);\n break;\n // case \"stderrt\": // Output text, as error\n // output(instruction[1], 1);\n // break;\n case \"nop\": // No Operation, Advance PC\n break;\n case \"\": // Empty, Advance PC\n break;\n case \"debug\": // Toggles debugging\n debug = !debug;\n break;\n default:\n if (instruction[0].charAt(0) === \"#\") // Comment\n break;\n output(\"Error Parsing Instruction on Line \" + line, 1);\n }\n if (!error)\n updateRegisterOutput();\n }\n}", "title": "" }, { "docid": "f6afbae97b5642441f34016f8a74fffa", "score": "0.44258493", "text": "addInstruction() {\n this.instructions.push('')\n }", "title": "" }, { "docid": "829776c627739323f4740bf27e462451", "score": "0.44250253", "text": "function InstructionsBlock(instructions) {\n this.instructions = instructions;\n this.onEndedBlock = function() {return this;};\n}", "title": "" }, { "docid": "4c44e43e86584c1d78beb007d0a99522", "score": "0.44210654", "text": "function exec() {\n lastExec = Number(new Date());\n callback.apply(self, args);\n }", "title": "" }, { "docid": "9de9c2b5bfa20193ddc1f53aea21c011", "score": "0.4418392", "text": "step() {\n\t\tthis.opcode = this.read( this.pc++ );\n\t\tthis.lookup[ this.opcode ].operate.bind( this );\n\t\tthis.lookup[ this.opcode ].addrmode.bind( this );\n\t}", "title": "" }, { "docid": "2163d1f3f170f3792490f460a1416475", "score": "0.44177496", "text": "function exec() {\n\t\t\t\tlastExec = Number(new Date());\n\t\t\t\tcallback.apply(self, args);\n\t\t\t}", "title": "" }, { "docid": "0f72be63aa99fa360b1799dc0bb09905", "score": "0.44158006", "text": "function executeStatement(statement, args) {\n var result = statement.apply(this, args);\n if (angular.isFunction(result) || result instanceof angular.scenario.Future)\n return result;\n var self = this;\n var chain = angular.extend({}, result);\n angular.forEach(chain, function(value, name) {\n if (angular.isFunction(value)) {\n chain[name] = function() {\n return executeStatement.call(self, value, arguments);\n };\n } else {\n chain[name] = value;\n }\n });\n return chain;\n }", "title": "" }, { "docid": "e06670e7c748cafc3ae1b85ccbe78db3", "score": "0.44146183", "text": "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "title": "" }, { "docid": "e06670e7c748cafc3ae1b85ccbe78db3", "score": "0.44146183", "text": "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "title": "" }, { "docid": "e06670e7c748cafc3ae1b85ccbe78db3", "score": "0.44146183", "text": "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "title": "" }, { "docid": "e06670e7c748cafc3ae1b85ccbe78db3", "score": "0.44146183", "text": "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "title": "" }, { "docid": "e06670e7c748cafc3ae1b85ccbe78db3", "score": "0.44146183", "text": "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "title": "" }, { "docid": "e06670e7c748cafc3ae1b85ccbe78db3", "score": "0.44146183", "text": "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "title": "" }, { "docid": "e06670e7c748cafc3ae1b85ccbe78db3", "score": "0.44146183", "text": "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "title": "" }, { "docid": "e06670e7c748cafc3ae1b85ccbe78db3", "score": "0.44146183", "text": "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "title": "" } ]
91fec091e4de65a2c724528a35ea00bb
Callback for when everything is done
[ { "docid": "bb8acd7d90888f0549eeeac1f64f091f", "score": "0.0", "text": "function done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" } ]
[ { "docid": "38eb9f8ebf69bead70844bc1805c903e", "score": "0.8006051", "text": "onDone () {}", "title": "" }, { "docid": "ce60cd1c4b9152a056372c50b14bc6b2", "score": "0.7320223", "text": "onEnd() {}", "title": "" }, { "docid": "b049ed07c7ffe24e296145d99c1ff92d", "score": "0.7279291", "text": "finish (callback) {\n callback();\n }", "title": "" }, { "docid": "b43f586b1fd618c14bb78a0bdd69cc95", "score": "0.7245571", "text": "onComplete() {}", "title": "" }, { "docid": "6cf91e5b47881a90ff5e02f6cc3d152c", "score": "0.7129416", "text": "function finished() {\n \n}", "title": "" }, { "docid": "e6a86694e6f97eda9fa53ec2d5c27d04", "score": "0.7021624", "text": "function onFinish() {\n console.log('finished!');\n }", "title": "" }, { "docid": "a7b6b4c71e1feaa55ce68e3973a524b8", "score": "0.70072705", "text": "end() {\n console.log(\"All Done\");\n }", "title": "" }, { "docid": "2049a1119aff191b8482d35f45640455", "score": "0.69267213", "text": "function finish() {\n self.ccm.helper.onFinish( self, results );\n if ( callback ) callback();\n }", "title": "" }, { "docid": "797aeba1810ca98e1eac91ee22fe1803", "score": "0.69180363", "text": "function onAllDone( err ) {\n if( err ) {\n Y.log( `Could not concatenate PDFs: ${JSON.stringify( err )}`, 'warn', NAME );\n return callback( err );\n }\n\n // all done\n eventData = {\n 'status': 'endBatch',\n 'cacheUrl': `/pdf/${cacheFile}`,\n 'cacheFile': cacheFile\n };\n\n if( notUpdate ) {\n eventData.notUpdate = notUpdate;\n }\n\n if( !config.compileOnly ) {\n // if caller uses websocket\n sendUserEvent( {msg: {data: eventData}} );\n }\n\n // if caller waits on the server\n callback( null, cacheFile );\n }", "title": "" }, { "docid": "57687070ab168217def51fc3c31968a5", "score": "0.68776435", "text": "callback() {\n console.log(\"Done!!!!\");\n }", "title": "" }, { "docid": "829bc73cb7cbbccff6da6e21111c328a", "score": "0.68565404", "text": "complete() {}", "title": "" }, { "docid": "2c05917960b6f78f1cff8135c68d4636", "score": "0.6821786", "text": "function onFinish() {\n console.log('finished!');\n}", "title": "" }, { "docid": "7e009c7391f38c00f2f4fa464ebf9635", "score": "0.6803283", "text": "function uploadDone () {}", "title": "" }, { "docid": "9cf5c4cc53f633f386dfd3118e33dfd0", "score": "0.6794406", "text": "function onDownloadComplete()\n{\n console.log(\"onDownloadComplete\");\n\n main();\n}", "title": "" }, { "docid": "27e1a9fc225add502d7091fd6bb4a3c7", "score": "0.67223024", "text": "function done() {\n NProgress.done();\n }", "title": "" }, { "docid": "c56862b043fe833a820736617e42d76c", "score": "0.6712288", "text": "function complete(results) {\n //console.log(results);\n if (win.$yetify !== undef) {\n $yetify.tower.emit(\"results\", results);\n }\n }", "title": "" }, { "docid": "770658b66836055cf98fa76bc274e879", "score": "0.6687316", "text": "function checkDone() {\n if (generalResults != null && contextResults != null) {\n onComplete({\n general: generalResults,\n context: contextResults\n });\n }\n }", "title": "" }, { "docid": "df9d0f2de0611055dfd9e05d8ce25fab", "score": "0.668466", "text": "function done() {\n\t\t\tif (!invoked) {\n\t\t\t\tinvoked = true;\n\n\t\t\t\tcallback.apply(null, arguments);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4b2fc537594b62b7efdb4bfe4770c8f0", "score": "0.6532316", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 3) {\n res.render('transactions', context);\n }\n }", "title": "" }, { "docid": "eb6e1b54047b745ed78bc769eb4e3a55", "score": "0.6522281", "text": "function done() {\n self._server = null;\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "eb6e1b54047b745ed78bc769eb4e3a55", "score": "0.6522281", "text": "function done() {\n self._server = null;\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "eb6e1b54047b745ed78bc769eb4e3a55", "score": "0.6522281", "text": "function done() {\n self._server = null;\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "397a51a876144bb80c5290b0d1e5b44b", "score": "0.65217316", "text": "function checkDone() { // called after each async call, executes the call back when the last one finishes\n asyncCallsDone++;\n if (asyncCallsDone >= NUM_ASYNC_CALLS) {\n //console.log(\"Finished constructor for \"+JSON.stringify(self, 3));\n callback();\n }\n }", "title": "" }, { "docid": "d1505b25b26d1ba430f13534b7206f75", "score": "0.6504916", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 1) {\n // once old resume info is retrieved, then process insert query\n // make sql request to update applicant\n mysql.pool.query(query, input, function(error, results, fields){\n // log any error that occurs with insert request\n if(error){\n console.log(error);\n res.write(JSON.stringify(error));\n res.end();\n }else{\n oldResume = context.info;\n // check if user has folder yet\n var userDir = './uploads/' + req.body.applicantID + '/';\n if (!fs.existsSync(userDir)){\n fs.mkdirSync(userDir);\n }\n // sucess in update, update actual file\n fs.rename('./uploads/' + oldResume.applicantID + '/' + oldResume.fileName,\n './uploads/' + req.body.applicantID + '/' + req.body.fileName, \n function(err) {\n if ( err ) console.log('ERROR: ' + err);\n });\n res.status(200);\n res.end();\n }\n });\n }\n }", "title": "" }, { "docid": "5beb2fb7407521981f784dc441a4df3f", "score": "0.6499987", "text": "function done() {\n model.add_company(company);\n model.add_db_data(company, db_data);\n model.add_quandl_data(company, quandl_data);\n return callback(null);\n }", "title": "" }, { "docid": "83c7c8ee8ac96fea72489fca78b4d24c", "score": "0.64992446", "text": "function done() {\n self._server = null;\n\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "a75d420517132dd0caac2678f5ea1e16", "score": "0.64950526", "text": "async finish() { }", "title": "" }, { "docid": "a75d420517132dd0caac2678f5ea1e16", "score": "0.64950526", "text": "async finish() { }", "title": "" }, { "docid": "a75d420517132dd0caac2678f5ea1e16", "score": "0.64950526", "text": "async finish() { }", "title": "" }, { "docid": "1747b610e11241409f2ea7edf0ef0edb", "score": "0.647667", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 2) {\n res.render('update-resumes', context);\n }\n }", "title": "" }, { "docid": "aa6b9767188c03fdf1319dd081dda8ff", "score": "0.6473858", "text": "function _allComplete( err, resultList ) {\n session.close();\n callbackFn(err, resultList);\n }", "title": "" }, { "docid": "e26b81d61f1282ae07cd75f5a8abb0c9", "score": "0.64696175", "text": "function finish() {\n cleanup();\n callback(null, self.buffer);\n }", "title": "" }, { "docid": "ff585eec07f6ba7525d259c26e023a08", "score": "0.6468852", "text": "function uploadDone() {\n}", "title": "" }, { "docid": "8de02b3b6ab97e1e8dfb8e9a0a0c21c0", "score": "0.6421611", "text": "function complete () {\n phantom();\n navigate(frame, \"about:blank\");\n status(\"Done. \" + WAIT_FOR + \"new tests.\");\n mode(\"Idle\");\n socket.send({\n status: \"done\",\n batch: currentBatch\n });\n\n currentBatch = null;\n if (batches.length) {\n for (var id in batches) {\n // only need one!\n currentBatch = id;\n tests = batches[id];\n return dequeue();\n }\n }\n }", "title": "" }, { "docid": "ae5f61d385110376a08d06d3a97a90e7", "score": "0.6416216", "text": "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 2){\r\n res.render('people_certs', context);\r\n }\r\n }", "title": "" }, { "docid": "f6f312645d844116f8eeedbf416b6fb4", "score": "0.63981557", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 2) {\n res.render('resumes', context);\n }\n }", "title": "" }, { "docid": "01bf2ce4d1fd5c59fa8554c44022633f", "score": "0.63845104", "text": "finish() {}", "title": "" }, { "docid": "90683f49443b052aec0c860ab331a7ba", "score": "0.6379984", "text": "function onDone(){\n numDone ++;\n if (numDone >= fields.length){\n dfd.resolve(list);\n }\n }", "title": "" }, { "docid": "2ba88c3bc27e4ad7acc7c939a76d04c8", "score": "0.63772047", "text": "function checkForCompletion() {\n if (queuedObjects.length === 0) {\n returnCallback(derezObj);\n } \n }", "title": "" }, { "docid": "134d8489bd7b136a8e7eb2d34713fea1", "score": "0.6370571", "text": "onComplete() {console.log(\"Bork bork bork!\")}", "title": "" }, { "docid": "4e11806f763149ba198160ce8d51af38", "score": "0.6370518", "text": "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 2){\r\n res.render('search', context);\r\n }\r\n }", "title": "" }, { "docid": "b9a65bce35542bb1ec114c12bba13bc7", "score": "0.63697696", "text": "function onDone() {\n\t\t m_promiseCount -= 1;\n\t\t if (!m_promiseCount) {\n\t\t m_idleHandlers.splice(0, m_idleHandlers.length)\n\t\t .forEach(function (handler) {\n\t\t handler();\n\t\t });\n\t\t }\n\t\t }", "title": "" }, { "docid": "ae08ca0ff414661cfbdfb7c6ab5c6b0e", "score": "0.6367389", "text": "handleDoneLoading() { }", "title": "" }, { "docid": "be7d44c05cc7154585da49f9c490bf26", "score": "0.63447887", "text": "function done() {\n\t if (!invoked) {\n\t invoked = true;\n\t\n\t next.apply(null, arguments);\n\t }\n\t }", "title": "" }, { "docid": "f53b37c7b82def595603aee2069d038a", "score": "0.63423425", "text": "onloadend() {}", "title": "" }, { "docid": "1caf6e26e0a1400a1edee9faf8f6bf9f", "score": "0.63396037", "text": "function complete(){\n callbackCount++; \n if(callbackCount >= 1){\n //res.render('restaurant_review', context);\n res.json(context);\n }\n\n }", "title": "" }, { "docid": "6d587dad5b89fc865f6b51778eb03128", "score": "0.6325849", "text": "function done() {\n console.log(\"job's done!\");\n}", "title": "" }, { "docid": "63fc3da27214c490d6928fafbf7973cb", "score": "0.62952244", "text": "done() {\n this.completionCallback && this.completionCallback();\n this.resolve();\n }", "title": "" }, { "docid": "cc63a00571c3722f26ae1ab3386b04f9", "score": "0.62806284", "text": "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 1){\r\n res.render('course', context);\r\n }\r\n }", "title": "" }, { "docid": "de41c5b1aadfb7bde16f70270585e930", "score": "0.62751645", "text": "function onAllDone( err ) {\n if ( err ) {\n Y.log( 'Could not save dataURI: ' + JSON.stringify( err ), 'warn', NAME );\n return args.callback( err );\n }\n\n Y.log( 'Created media ' + JSON.stringify( result ), 'debug', NAME );\n args.callback( null, result );\n }", "title": "" }, { "docid": "c8195b7d9be3f6e6d27e0ecd9977555a", "score": "0.62723696", "text": "function complete(){\n callbackCount ++;\n if(callbackCount >= 1){\n res.render('employers', context);\n }\n }", "title": "" }, { "docid": "d56c7a4df0053db8523737c565e58638", "score": "0.6267916", "text": "function onFinishedProcessing() {\n console.log('Successfully gone through the list of likes');\n dumpProcessStatus();\n}", "title": "" }, { "docid": "cd75d965799bea321049c8cad8b2d138", "score": "0.6266929", "text": "function mainComplete() {\n console.log('It is all loaded up');\n TowerDefense.manager.init();\n }", "title": "" }, { "docid": "f8690c24e4b8b3573401123f28ba1de6", "score": "0.6238147", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 1) {\n // once old resume info is retrieved, then process delete query\n // make sql request to delete resume\n mysql.pool.query(query, input, function(error, results, fields){\n // log any error that occurs with insert request\n if(error){\n console.log(error);\n res.write(JSON.stringify(error));\n res.end();\n }else{\n // sucess in delete, remove actual file locations\n var dirname = './uploads/' + context.info.applicantID;\n console.log('Deleting File: ' + dirname + '/' + context.info.fileName);\n fs.unlink(dirname + '/' + context.info.fileName, function(err) {\n if (err){\n console.log('ERROR: ' + err);\n } else{\n res.status(200);\n res.end();\n }\n });\n // check if folder for applicant is empty, delete if so\n fs.readdir(dirname, function(err, files){\n if(err){\n console.log('ERROR: ' + err);\n } else{\n if(!files.length){\n console.log(\"Folder Empty: Deleting \" + dirname);\n fs.rmdirSync(dirname);\n }\n }\n });\n }\n });\n }\n }", "title": "" }, { "docid": "903c9241de99ae6719a55b68c8c4c07c", "score": "0.62327737", "text": "function fileOnEnd() {\n console.log('Data has been drained');\n }", "title": "" }, { "docid": "f7fcf8dce649e310fb455e479e054818", "score": "0.6232135", "text": "complete() {\n\t\tthis.completed = true;\n\t}", "title": "" }, { "docid": "1bd69eb7e8c350a6499053cbeb134998", "score": "0.62235624", "text": "function complete(){\n callbackCount++;\n if (callbackCount >= 2){\n res.render('employersInfo', context);\n }\n }", "title": "" }, { "docid": "596aafd94a8ee798419a87541451bc09", "score": "0.62178123", "text": "function done() {\n\t\t\thandler.call(this, baseEvent);\n\t\t}", "title": "" }, { "docid": "799868e29f4ddae2ebc4e742406cd48a", "score": "0.61970186", "text": "async end() { }", "title": "" }, { "docid": "799868e29f4ddae2ebc4e742406cd48a", "score": "0.61970186", "text": "async end() { }", "title": "" }, { "docid": "799868e29f4ddae2ebc4e742406cd48a", "score": "0.61970186", "text": "async end() { }", "title": "" }, { "docid": "eb0480a2132f0992dc5a6643717adbb1", "score": "0.61767375", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "f581af25075f7447ccc0972bdff6c499", "score": "0.6172713", "text": "function completeActions(){\n getUser();\n showPDF();\n joinRoom();\n // getCompany();\n}", "title": "" }, { "docid": "0d707b6ae6e5e352ca376bb3247d32b6", "score": "0.6168962", "text": "function doneLoading() { \n loadedCount++;\n if (loadingCount == loadedCount && loadingReady) {\n init();\n } \n }", "title": "" }, { "docid": "5963f75940f800e79e26bd342fc9a3a5", "score": "0.6166037", "text": "finish() {\n console.log(\"finish\");\n }", "title": "" }, { "docid": "40c1b4c9d4991b8f0799a1e1903f06ae", "score": "0.61554086", "text": "function catch_result (result) {\n //im done\n}", "title": "" }, { "docid": "2229d96c3204500b648d96589c405233", "score": "0.61439556", "text": "function onFinishCallback() {\n if (validateAllSteps()) {\n var serverData = getServerData();\n\n //Begin Encoding\n $.post(\"Home/BeginEncoding\", serverData, function (data) {\n //clear the current interval\n window.clearInterval(timerId);\n //reset the timer to the new interval value\n timerId = window.setInterval(refreshData, data.RefreshInterval);\n\n if (data.StatusMessage !== \"\") {\n //Update status message\n statusbar.show(data.StatusMessage, statusMsgInterval);\n }\n\n //Close Wizard On Finish\n closeWizardOnFinish();\n });\n }\n}", "title": "" }, { "docid": "5e4de53d458ba771cc9024509f2d1ade", "score": "0.6140548", "text": "function onAllDone( err ) {\n if ( err ) {\n Y.log( 'Could not save dataURI: ' + JSON.stringify( err ), 'warn', NAME );\n return args.callback( err );\n }\n\n // clean up chart image in temp directory\n //Y.doccirrus.media.cleanTempFiles( { '_tempFiles': [ tempFile ] } );\n\n Y.log( 'Created media ' + JSON.stringify( result ), 'debug', NAME );\n args.callback( null, result );\n }", "title": "" }, { "docid": "a74810328728049d7003f63a4b58956c", "score": "0.61379546", "text": "onComplete() {\n if (this._complete) {\n this._complete.raise();\n }\n }", "title": "" }, { "docid": "8ce9cbe56dcf2090d1e2b41958adfb14", "score": "0.61245763", "text": "function done() {\n echo('\\nOK!');\n }", "title": "" }, { "docid": "fd3dcba80bd2ba94543f51ac75d5595c", "score": "0.6124495", "text": "function onend() {\n cleanup();\n callback();\n\n // Add to list of files.\n if (data.bytesRead) {\n self._files.push({ path: data.path, size: data.bytesRead });\n }\n\n // Check if Kat has ended.\n // TODO\n // console.log('on end', self._ended, self._queue.length);\n if (self._ended) {\n self._end();\n\n } else {\n var next = self._queue.shift();\n\n if (next) {\n self._addCurrentStream(next);\n } else if (self.options.autoEnd && self._openQueue.active === 0) {\n self._end();\n } else {\n delete self._current;\n }\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "e90f02810bcef74974ec972722a0594e", "score": "0.61173594", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "e90f02810bcef74974ec972722a0594e", "score": "0.61173594", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "254fce282c9815bd6b376914cb3c2afa", "score": "0.61169", "text": "function finalResult() {\r\n\r\n}", "title": "" }, { "docid": "be4b37b3b087545a804e0c137e5a59d3", "score": "0.61075217", "text": "complete() {\n this.finish(COMPLETED);\n }", "title": "" }, { "docid": "e881dd5f78ac10fc1685209306ab04b2", "score": "0.61045444", "text": "function finish() {\n setTimeout(function () {\n done();\n }, 3000);\n }", "title": "" }, { "docid": "9fa73b24c88df9fe03ab15e6e3b7ba50", "score": "0.60899055", "text": "function completion_callback(allRes, status) {\r\n\t$('#progressbar').css('width', '100%').attr('aria-valuenow', 100).html(testCounter+' tests completed!').removeClass('active').removeClass('progress-bar-striped');\r\n\t\r\n logWrite(\"Tests completed!\");\r\n testCompleteResults += \"</table>\";\r\n console.log(\"Test results: \", allRes, status);\r\n}", "title": "" }, { "docid": "107760bda5750a0d1059af78848829ac", "score": "0.6089203", "text": "function searchComplete() {\n callback(imageSearch.results);\n }", "title": "" }, { "docid": "3f13d6d4a0acd49c4e4b273071fea90d", "score": "0.60683656", "text": "function onDone() {\n m_promiseCount -= 1;\n if (!m_promiseCount) {\n m_idleHandlers.splice(0, m_idleHandlers.length).forEach(function (handler) {\n handler();\n });\n }\n }", "title": "" }, { "docid": "6c543102d0d3901413ffc678fd521799", "score": "0.6066336", "text": "function handleComplete() {\n\tloaded = true;\n\ttoggleLoader(false);\n\tinitMain();\n}", "title": "" }, { "docid": "c824b91e8f16bdf8e25755b7b373550b", "score": "0.6037877", "text": "complete(results, file) {\n // Ensure any final (partial) batch gets emitted\n const batch = tableBatchBuilder.getNormalizedBatch();\n if (batch) {\n asyncQueue.enqueue(batch);\n }\n asyncQueue.close();\n }", "title": "" }, { "docid": "2dec1932d4a3f6b8ef259aa364a921da", "score": "0.602907", "text": "function pollCompleted() {\n\t \tif (accounts && currencies && spaces && nfctags) {\n\t \t\tcb( null )\n\t \t} else {\n\t \t setTimeout(function () { \n\t \t \tpollCompleted()\n\t \t }, 125);\n\t \t}\n\t }", "title": "" }, { "docid": "4609fff86c218990ac61a82ad4356025", "score": "0.6028669", "text": "function done ( ){\n\treadfiles ++ // add one to the file counter\n\n\t// Only do the below when all (2) files are loaded\n\tif (readfiles == 2 ){ // note to self, if doing more files change this number\n\t\t// write the everyone data to the file\n\t\tfilesystem.writeFile ('peopleComplete.txt', everyone.sort(), function (error){ // note the .sort which alphabetically sorts names\n\t\t\t// Handle errors if they occur\n\t\t\tif (error){\n\t\t\t\tconsole.log (\"No noes! Error: \" + error)\n\t\t\t\tthrow error\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "5f3d687fc5841cc08aa089c3c5c3aadc", "score": "0.6027893", "text": "function completeConnection() {\n angular.forEach( doneHandlers, function( handler ) {\n /*\n At the point of connection completion we could be in any hub, each doneHandler therefore\n has a hub property which relates back to the original hub which requested it.\n We set the server property on that hub so clients can now talk to the server\n */\n handler.hub.server = createServerProxy( handler.hub, handler.hubName );\n handler.doneFn();\n } );\n doneHandlers.length = 0;\n }", "title": "" }, { "docid": "de0be1158b57724ac992880428593b82", "score": "0.6027517", "text": "function complete () {\n\t\t\tif (isDocumentComplete()) {\n\t\t\t\tcb();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetTimeout(complete, 10);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ac1e7cf2bb18ca6d39e2a05762a247f1", "score": "0.60244393", "text": "function searchComplete() {\n callback(imageSearch.results );\n }", "title": "" }, { "docid": "1c6fbbd4873d71bb07ea4f06d38b75ab", "score": "0.60156226", "text": "function conversionDone(data) {\n Papa.parse(data, {\n complete: function(results, localFile) {\n func(results, localFile, divName, clusterName);\n },\n error: function(err, file) {\n if (divName!==undefined)\n alert(\"could not load \"+fullUrl);\n }\n });\n }", "title": "" }, { "docid": "a3e784bb38f5855b507061f150f06d70", "score": "0.60062134", "text": "function allDone() {\n console.log('building employee list with data:' + employeeList)\n render(employeeList)\n}", "title": "" }, { "docid": "ad1303923e18cf023ed9b09997927790", "score": "0.59909177", "text": "function allDone()\n{\n throw( \"exiting\" );\n}", "title": "" }, { "docid": "694bbf761f66f742a29a6487cf9bcebd", "score": "0.5990236", "text": "function onFinish() {\n console.log('抢购结束!');\n}", "title": "" }, { "docid": "f5fe8df673b2bf76b8963105441762c5", "score": "0.598681", "text": "async complete() {\n const t = await lr(this.localStore, new Fo(this.R), this.documents, this.ro.id), e = this.co(this.documents);\n for (const t of this.queries) await fr(this.localStore, t, e.get(t.name));\n return this.progress.taskState = \"Success\", new Gi(Object.assign({}, this.progress), t);\n }", "title": "" }, { "docid": "61f6db9786f622c330ee12c997ca8082", "score": "0.59845006", "text": "function _onAllCrawled()\n {\n module_callback(urls);\n }", "title": "" }, { "docid": "2b4d4de6d6d83aa10cebd088643412c7", "score": "0.59833527", "text": "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "title": "" } ]
a40da880d4af739e7f2d6cc57765cc15
Format date to dd/MM/yyyy
[ { "docid": "7ff92a4df539654cef5be7155bdd51a7", "score": "0.0", "text": "function rightFormatDate(oldDate) {\n try {\n const dateParts = oldDate.split('/');\n return new Date(+dateParts[2], dateParts[1] - 1, +dateParts[0]);\n } catch (e) {\n return null;\n }\n }", "title": "" } ]
[ { "docid": "06941942fccecafb2b14ae518cef7483", "score": "0.7541284", "text": "function formatDate(date) {\n let info = new Date(date);\n let d = info.getDate() + '/' + (info.getMonth() + 1) + '/' + info.getFullYear();\n return d;\n}", "title": "" }, { "docid": "58c9924d0b61492db7b4af417bfb715a", "score": "0.7498251", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n\n return [year, month, day].join('/');\n}", "title": "" }, { "docid": "2e76e0feb928e048418adfa09cb86167", "score": "0.74963486", "text": "function formatDate(d) {\n return ( d.getDate() + '/' +\n\td.getMonth()+1) + '/' + \n d.getFullYear();\n }", "title": "" }, { "docid": "550d71d277fdefbd2adb574bde337439", "score": "0.74922264", "text": "function toFormattedDate(date) {\n var day = new Date(date);\n Logger.log(day);\n return (day.getMonth()+1) + '/' + day.getDate();\n}", "title": "" }, { "docid": "022bd17d00c55b0fd99f0212356d201f", "score": "0.7465175", "text": "function formatDate(date) {\r\n var year = date.getFullYear();\r\n var month = date.getMonth() + 1;\r\n var day = date.getDate();\r\n if (day < 10) {\r\n day = '0' + day;\r\n }\r\n if (month < 10) {\r\n month = '0' + month;\r\n }\r\n var formattedDate = year + '/' + month + '/' + day\r\n return formattedDate;\r\n}", "title": "" }, { "docid": "cf5d1c409c6e476c43e5f2d0aacfc80e", "score": "0.7458133", "text": "function formatDate(d) {\n return (d.getMonth()+1) + '/' +\n d.getDate() + '/' +\n d.getFullYear();\n }", "title": "" }, { "docid": "aaf9b161912ca4e3a1c2142e038da1e3", "score": "0.7387475", "text": "static _getFormattedDate(date){\n let day = date.getDate()\n if(day < 10){ day = (\"0\" + day) }\n const month = (date.getMonth() + 1)\n const year = date.getFullYear()\n return day + \"/\" + month+ \"/\" + year\n }", "title": "" }, { "docid": "4b3705541640e6a64d59b2261adb07d9", "score": "0.7246425", "text": "function formatDate(userDate) {\n // format from M/D/YYYY to YYYYMMDD\n var dates = userDate.split(\"/\");\n \n return dates[2] + (dates[0].length >1 ? dates[0] : \"0\"+ dates[0]) + (dates[1].length >1 ? dates[1] : \"0\"+ dates[1]);\n}", "title": "" }, { "docid": "ed043698eb6fe7852d799d67dda94113", "score": "0.7182207", "text": "function formatDate(date) {\n return date.year + '-' + date.month + '-' + date.day;\n}", "title": "" }, { "docid": "74868566dd27e027195ba54cb7211df0", "score": "0.7166115", "text": "function dateFormat(date) {\n let day = date.getDate();\n day = (day < 10 ? \"0\" : \"\") + day;\n let month = date.getMonth() + 1;\n month = (month < 10 ? \"0\" : \"\") + month;\n let dateToString = day + \"/\" + month + \"/\" + date.getFullYear();\n return dateToString;\n }", "title": "" }, { "docid": "e9842566c29834dc9869e51f85218cc6", "score": "0.71653074", "text": "function formatDate(date) {\n let d = new Date(date);\n return d.toLocaleDateString();\n }//end formatDate", "title": "" }, { "docid": "741cc18fdd0fe9ba95832c45f5f7b108", "score": "0.7145731", "text": "function formatDate(date) {\n date = date.split(\"/\");\n newDateFormat = date[2] + '-' + date[0] + '-' + date[1];\n return newDateFormat;\n}", "title": "" }, { "docid": "b9e535ebb8bed21198941d4e762b94ab", "score": "0.71329844", "text": "function formatDate(date) {\n\n var pieces = date.split(\"/\");\n\n return pieces[2] + \"-\" + pieces[0] + \"-\" + pieces[1];\n\n}", "title": "" }, { "docid": "67de67e90c3b3a9b05657d08c4797df1", "score": "0.7120225", "text": "function formatDate(date) {\n let arr = date.split(\"/\");\n let month = formatMonth(arr[0]), day = arr[1], year = arr[2];\n\n if (day.substring(0, 1) == \"0\") {\n day = day.substring(1);\n }\n\n return month + \" \" + day + \", \" + year;\n}", "title": "" }, { "docid": "bf48ff95d376eae5d61e74e802382967", "score": "0.70709294", "text": "function changeDateFormat(date) {\r\n\r\n var dateParts = date.split(\"/\");\r\n\r\n var date = new Date(dateParts[2], (dateParts[1] - 1), dateParts[0]);\r\n\r\n return dateParts[1] + \"/\" + dateParts[0] + \"/\" + dateParts[2];\r\n}", "title": "" }, { "docid": "e3f6a0866f7319257b48fcc3ad62125b", "score": "0.70522237", "text": "function formatDate(date) {\n\tvar date_array = date.split('-');\n\tvar dt = parseInt(date_array[2]);\n\tvar mth = parseInt(date_array[1]);\n\tif (dt < 10) {\n\t\tdt = '0' + dt;\n\t}\n\tif (mth < 10) {\n\t\tmth = '0' + mth;\n\t}\n\tvar full_date = date_array[0] + '-' + mth + '-' + dt;\n\t// console.log(full_date);\n\tvar date_format = new Date(full_date);\n\tre_date = date_format.getDate();\n\tre_month = parseInt(date_format.getMonth()) + 1;\n\tif (re_month < 10) {\n\t\tre_month = '0' + re_month;\n\t}\n\tif (date_format.getDate() < 10) {\n\t\tre_date = '0' + date_format.getDate();\n\t}\n\tre_year = date_format.getFullYear();\n\treturn re_date + '/' + re_month + '/' + re_year;\n}", "title": "" }, { "docid": "f756703ce9f9b24f8dc7f15335259e93", "score": "0.6989655", "text": "function formatDate(date){\n\t//var months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\tvar year = date.substring(0, 4);\n\tvar month = date.substring(5, 7);\n\tvar day = date.substring(8, 10);\n\treturn month + \"/\" + day + \"/\" + year;\n\n}", "title": "" }, { "docid": "b5a5227557e5579fcb3ccf5ab6f66a96", "score": "0.69628286", "text": "function getFormattedDate(date, format = \"MM/DD/YYYY\") {\n if (format == \"MM/DD/YYYY\") {\n var year = date.getFullYear();\n\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n\n return month + '/' + day + '/' + year;\n } else if (format == \"MMM D\") {\n\n var options = { month: \"short\", day: \"numeric\" };\n str = date.toLocaleDateString(\"en-US\", options);\n\n\n return str;\n\n } else if (format == \"MMMD\") {\n\n var options = { month: \"short\", day: \"numeric\" };\n str = date.toLocaleDateString(\"en-US\", options);\n arr = str.split(\" \");\n\n return arr[0] + arr[1];\n }\n\n}", "title": "" }, { "docid": "209a79ba43ade75e3ff2947b4ddd15ad", "score": "0.6954976", "text": "function formatDate(date) {\n return date.getFullYear() + '-' + (\"0\" + (date.getMonth() + 1)).slice(-2) \n + '-' + date.getDate();\n }", "title": "" }, { "docid": "3539a8d3e2c89e4da2327c9ba8eb3ca7", "score": "0.6953278", "text": "function formatDate(d) {\n var year = d.getFullYear() % 100;\n if (year < 10) year = \"0\" + year;\n \n var month = d.getMonth() + 1;\n if (month < 10) month = \"0\" + month;\n \n var date = d.getDate();\n if (date < 10) date = \"0\" + date;\n \n return date + '.' + month + '.' + year;\n \n}", "title": "" }, { "docid": "cf9943990f596c2d9a73f2b20766edd4", "score": "0.69518673", "text": "function FormatForDisplay(date) {\n let current_datetime = new Date(date);\n let formatted_date = (\"0\" + (current_datetime.getMonth() + 1)).slice(-2) + \"/\" + (\"0\" + current_datetime.getDate()).slice(-2) + \"/\" + current_datetime.getFullYear();\n return formatted_date;\n}", "title": "" }, { "docid": "e322bbe891dd5f80d746586006a1722b", "score": "0.69478196", "text": "function formatDate (date) {\n const d = new Date(date)\n let month = '' + (d.getMonth() + 1)\n let day = '' + d.getDate()\n const year = d.getFullYear()\n\n if (month.length < 2) { month = '0' + month }\n if (day.length < 2) { day = '0' + day }\n\n return formatAMPM(d) + ' ' + [day, month, year].join('/')\n}", "title": "" }, { "docid": "4e91e3353bbae7196822636b1499bcc3", "score": "0.69380003", "text": "formatDate(date){\n // Realizando a separação das datas através do /\n const splittedDate = date.split('-')\n return `${splittedDate[2]} / ${splittedDate[1]} / ${splittedDate[0]}`\n }", "title": "" }, { "docid": "a050b703672e94e57050b185d03a0ebb", "score": "0.6917696", "text": "function formatDate(date) {\n date = String(date);\n return date.length === 1 ? '0' + date : date;\n }", "title": "" }, { "docid": "e831c587104668c7abd9cdc79cab4473", "score": "0.687538", "text": "function formatDate(date){\n var dd = date.getDate();\n var mm = date.getMonth()+1;\n var yyyy = date.getFullYear();\n if(dd<10) {dd='0'+dd}\n if(mm<10) {mm='0'+mm}\n date = mm +'-' + dd;\n return date\n }", "title": "" }, { "docid": "e651e3940cfdaca3453ab1dbfc5cff94", "score": "0.68726903", "text": "function formatDate(dateFormat){\n let date = new Date(dateFormat);\n return ((date.getMonth() > 8) ? (date.getMonth() + 1) : ('0' + (date.getMonth() + 1))) + '/' + ((date.getDate() > 9) ? date.getDate() : ('0' + date.getDate())) + '/' + date.getFullYear();\n}", "title": "" }, { "docid": "d6050ece1eb4df5b20fd00ca1088eba2", "score": "0.6870359", "text": "function formatDateString(date) {\n\tvar dateString = date.toString();\n\tvar splitDateString = dateString.split(\"-\");\n\treturn splitDateString[1] + \"/\" + splitDateString[2] + \"/\" + splitDateString[0];\n}", "title": "" }, { "docid": "79e713c8f6e6693cddbbe61935b37ce3", "score": "0.68668383", "text": "getFormattedDate(date)\n {\n return `${date.getDate()} / ${date.getMonth()} / ${date.getFullYear()}`;\n }", "title": "" }, { "docid": "ba928425522583154c446a07b7958526", "score": "0.68640983", "text": "function formatDOB(date) {\n const regexDOB = /^(\\d{4})\\D(\\d{2})\\D(\\d{2}).+/;\n return date.replace(regexDOB, '$2/$3/$1');\n }", "title": "" }, { "docid": "562d001034757293542648a38fdad233", "score": "0.6825855", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "167fff754c8274fc4587fa6760d31bb3", "score": "0.6822142", "text": "function formatDate(date) {\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n var day = date.getDate();\n\n return [year, (month>9?'':'0') + month, (day>9?'':'0') + day].join('.');\n}", "title": "" }, { "docid": "35f937e2bfbecef821c8a72a34505885", "score": "0.6821492", "text": "function formatDate(date) {\n date = date.split(\"/\")\n const year = date.pop() // pop method will take the last item of an array, and mutate the orginal array. \n const day = date.pop()\n return year + \"/\" + day + \"/\" + date // after two pop methods, only month left in date. \n}", "title": "" }, { "docid": "6c9cdd9447470de53e89481b6f21409b", "score": "0.6814051", "text": "function formatDate(date) {\n var d = new Date(date);\n // + 1 , bcs getMonth returns in the range from 0 to 11\n var month = d.getMonth() + 1;\n // <= 9 add 0 and returns two digit format\n if (month <= 9)\n month = '0' + month;\n\n var day = d.getDate();\n // <= 9 add 0 and returns two digit format\n if (day <= 9)\n day = '0' + day;\n return day + \".\" + month;\n }", "title": "" }, { "docid": "54b15714d98b47669683c2e7d9bff5e2", "score": "0.6788035", "text": "function formatDate(dateToFormat) {\n var splitDate = dateToFormat.split('/');\n return splitDate[2] + '-' + splitDate[1] + '-' + splitDate[0];\n }", "title": "" }, { "docid": "b433a68f409a48c8436e8d694b2496b5", "score": "0.67870265", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "873cd41faad8a8a74f775c72dcbde524", "score": "0.6786858", "text": "function dateToString(date) {\n return (date.getMonth() + 1) + \"/\" + date.getDate() + \"/\" + date.getFullYear();\n}", "title": "" }, { "docid": "c51736233f377691cb0e55e13a589e05", "score": "0.6782297", "text": "function formatDate(value) {\n var MyDate = new Date(value);\n var MyDateString;\n\n MyDateString = ('0' + (MyDate.getMonth() + 1)).slice(-2) + '/'\n + ('0' + MyDate.getDate()).slice(-2) + '/'\n + MyDate.getFullYear() + ' '\n + ('0' + MyDate.getHours()).slice(-2) + \":\"\n + ('0' + MyDate.getMinutes()).slice(-2);\n\n return MyDateString;\n }", "title": "" }, { "docid": "5c53be413f290f94788ee388607c22d5", "score": "0.6780497", "text": "function formatDate(date) {\n // getMonth returns zero-based index of month, so need +1\n month = date.getMonth();\n month += 1;\n\n return month + '/' + date.getDate() + '/' + date.getFullYear() + ' at ' +\n (date.getHours()<10?'0':'') + date.getHours() + ':' +\n (date.getMinutes()<10?'0':'') + date.getMinutes();\n}", "title": "" }, { "docid": "84feeb3f1b6524232973580ed0b6e854", "score": "0.6776925", "text": "function format_date(date) {\n date = new Date(date);\n const year = date.getFullYear() + '';\n const month = pad(date.getMonth() + 1, 2);\n const day = pad(date.getDate(), 2);\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "49b06d78ad48cd04ad47ee9422690060", "score": "0.6765343", "text": "function formatDate(date) {\n return date.getDate() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getFullYear()\n}", "title": "" }, { "docid": "c24a9c30ba108ccf5afacac9c648be9b", "score": "0.67340916", "text": "function formatDate(date) {\n //console.log(date);\n const d = new Date(date);\n //console.log(d);\n const formattedDate = `${\n d.getMonth() + 1\n }/${d.getDate()}/${d.getFullYear()}`;\n return formattedDate;\n }", "title": "" }, { "docid": "621dc8c1e5332012c0337809570dbee2", "score": "0.6721722", "text": "function getDateString(date) {\n date = new Date(date);\n return (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();\n}", "title": "" }, { "docid": "6e494939b06a84f963017eedb85d3f85", "score": "0.67192674", "text": "formatDate(date) {\n if (!date) return null\n\n const [year, month, day] = date.split('-');\n return `${day}/${month}/${year}`\n }", "title": "" }, { "docid": "a785bb387b0c33a8c0cc3218d4c3747b", "score": "0.67126614", "text": "function formatDate(date) {\r\n\t\tvar month = '' + (date.getMonth() + 1),\r\n\t\t\tday = '' + date.getDate(),\r\n\t\t\tyear = date.getFullYear();\r\n\r\n\t\tif(month.length < 2) month = '0' + month;\r\n\t\tif(day.length < 2) day = '0' + day;\r\n\r\n\t\treturn [year, month, day].join('-');\r\n\t}", "title": "" }, { "docid": "aba71a1b8538869b4491438bab0d2091", "score": "0.67115784", "text": "function formatDate(date) {\r\n var d = new Date(date),\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n\r\n if (month.length < 2) month = '0' + month;\r\n if (day.length < 2) day = '0' + day;\r\n\r\n return [year, month, day].join('-');\r\n}", "title": "" }, { "docid": "4449c1f2d8092605a57d9e109954b833", "score": "0.6708721", "text": "formatDateYMD(date) {\n return moment(date).format('YYYY/MM/DD');\n }", "title": "" }, { "docid": "c9f8213b6ea01f727ad5a3e4189679ba", "score": "0.67062265", "text": "function formatDate(date) {\n const splitDate = date.split(\"\")\n const year = splitDate.slice(0, 4).join(\"\")\n const month = splitDate.slice(5, 7).join(\"\")\n const day = splitDate.slice(8, 10).join(\"\")\n return `${month}/${day}/${year}`\n}", "title": "" }, { "docid": "b902ab7adfb713f7178170d483b94273", "score": "0.6699405", "text": "function normalDate(date) {\n var month = date.getMonth() + 1,\n day = date.getDate(),\n year = date.getFullYear();\n\n return month + \"/\" + day + \"/\" + year;\n }", "title": "" }, { "docid": "ba4bf5ab58c35c27e436f6005c96bb54", "score": "0.6696008", "text": "function getDateString(date, format) {\r\n\tif(typeof format === 'undefined')\r\n\t\tformat = dateFormat1;\r\n\treturn date.format(format);\r\n\t\r\n\t/*var d = date.getDate();\r\n var m = date.getMonth() + 1;\r\n var y = date.getFullYear();\r\n return '' + y + '/' + (m<=9 ? '0' + m : m) + '/' + (d <= 9 ? '0' + d : d);\r\n\t*/\r\n}", "title": "" }, { "docid": "c474c223e8ce4bb40d1b4ab31eecaff7", "score": "0.66889703", "text": "function formatDate(date) {\n date = new Date(date);\n var month = date.getMonth() + 1;\n var day = date.getDate();\n var year = date.getFullYear();\n\n newdate = year + \"-\" + month + \"-\" + day;\n return newdate;\n}", "title": "" }, { "docid": "2319b0aae9b08fd3f1ffa6afd51936fd", "score": "0.6686962", "text": "function format_date(date) {\r\n var year = date.getFullYear();\r\n var month = date.getMonth() + 1;\r\n var day = date.getDate();\r\n\r\n return (year + \"-\" + prepend_zero(month) + \"-\" + prepend_zero(day));\r\n}", "title": "" }, { "docid": "ed473983f741ac3c03787a7b77dcd37f", "score": "0.668653", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "640d209373d4ac81584e6d927e16c953", "score": "0.66634226", "text": "function changeDateFormat(date){\n\t\tlet dd = date.getDate();\n\t\tlet mm = date.getMonth() + 1;\n\t\tlet yyyy = date.getFullYear();\n\t\tif (dd < 10) dd = \"0\" + dd;\n\t\tif (mm < 10) mm = \"0\" + mm;\n\t\tdate = yyyy + \"-\" + mm + \"-\" + dd;\n\t\treturn date;\n\t}", "title": "" }, { "docid": "9c5b8796873bd9d087ad937f7674806b", "score": "0.6657782", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "b1467741eaef96fc228288e9e95841cd", "score": "0.6643964", "text": "function formatDate(){\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd;\n }\n\n if (mm < 10) {\n mm = '0' + mm;\n }\n\n return today = mm + '/' + dd + '/' + yyyy;\n\n}", "title": "" }, { "docid": "60150dba6b2ac95465fa2974574acffa", "score": "0.66426486", "text": "function formatDate(date) {\n\tvar d = new Date(date),\n\t\tmonth = '' + (d.getMonth() + 1),\n\t\tday = '' + d.getDate(),\n\t\tyear = d.getFullYear();\n\n\tif (month.length < 2) month = '0' + month;\n\tif (day.length < 2) day = '0' + day;\n\n\treturn [year, month, day].join('-');\n}", "title": "" }, { "docid": "341de5c08f81b051237e076c206bbf5b", "score": "0.6640658", "text": "formatDate(dateString) {\n const date = new Date(dateString);\n const year = date.getFullYear().toString();\n const day = date.getDate().toString();\n\n return date.getMonth() + 1 + '/' + day + '/' + year;\n }", "title": "" }, { "docid": "c72b74509547b0b960458e9174ff45bf", "score": "0.6639925", "text": "function formattedDate(date) {\r\n\t\t var d = new Date(date),\r\n\t\t month = '' + (d.getMonth() + 1),\r\n\t\t day = '' + d.getDate(),\r\n\t\t year = d.getFullYear();\r\n\r\n\t\t if (month.length < 2) month = '0' + month;\r\n\t\t if (day.length < 2) day = '0' + day;\r\n\t\t return [year,month,day].join('-');\r\n\t\t }", "title": "" }, { "docid": "c72b74509547b0b960458e9174ff45bf", "score": "0.6639925", "text": "function formattedDate(date) {\r\n\t\t var d = new Date(date),\r\n\t\t month = '' + (d.getMonth() + 1),\r\n\t\t day = '' + d.getDate(),\r\n\t\t year = d.getFullYear();\r\n\r\n\t\t if (month.length < 2) month = '0' + month;\r\n\t\t if (day.length < 2) day = '0' + day;\r\n\t\t return [year,month,day].join('-');\r\n\t\t }", "title": "" }, { "docid": "7fecd0b70e549b9d708ad07600875abc", "score": "0.66328925", "text": "function formatDate(dateFormat, date) {\n var $date = date;\n // debug variable\n var format = 0;\n if (dateFormat == \"ddmmyyyy\") {\n $date = date.replace(/(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{4})/, \"$3$2$1\");\n format = 1;\n } \n if (dateFormat == \"mmddyyyy\") {\n $date = date.replace(/(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{4})/, \"$3$1$2\");\n format = 1;\n } \n if (dateFormat == \"dd-mm-yyyy\") {\n $date = date.replace(/(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{4})/, \"$3-$2-$1\");\n format = 1;\n }\n if (dateFormat == \"mm-dd-yyyy\") {\n $date = date.replace(/(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{4})/, \"$3-$1-$2\");\n format = 1;\n } \n if (dateFormat == \"dd/mm/yyyy\") {\n $date = date.replace(/(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{4})/, \"$3/$2/$1\");\n format = 1;\n }\n if (dateFormat == \"mm/dd/yyyy\") {\n $date = date.replace(/(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{4})/, \"$3/$1/$2\");\n format = 1;\n }\n // For debugging\n if(format == 0) { if (debug) { cLog('Error! Unvalid \"date format\".'); } }\n\n return $date;\n }", "title": "" }, { "docid": "b5f7d8413a8a1c96a7c46e30922f2bd6", "score": "0.66324836", "text": "static toYYYYMMDD(date) {\n if (!date) return \"\";\n return DateUtils.fourDigit(date.getFullYear())+\"-\" +\n DateUtils.twoDigit(date.getMonth()+1)+\"-\"+\n DateUtils.twoDigit(date.getDate());\n }", "title": "" }, { "docid": "359e3d77a84c2a1f760a17d38b3c5f90", "score": "0.6630263", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "359e3d77a84c2a1f760a17d38b3c5f90", "score": "0.6630263", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "32ef370f65acd5c4ea23b909ce620fa5", "score": "0.6628656", "text": "function formatDate(userDate) {\n\t// 100%\n var listX = userDate.split(\"/\");\n return (String(listX[2]) + digPad(listX[0]) + digPad(listX[1]));\n}", "title": "" }, { "docid": "77f3071777c81d157822c8c30587f4a7", "score": "0.662365", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "dc89d4ab6975e363e3bbb8eb0e8fcbc0", "score": "0.66099894", "text": "function FormatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "c73533c5dd5196d28025ce59f3ed7bb7", "score": "0.6605138", "text": "function formatDate(date, divider) {\n\t\tvar chosenday = new Date(date),\n\t\tmonth = (chosenday.getUTCMonth() + 1) <=9 ? \"0\" + (chosenday.getUTCMonth() + 1): (chosenday.getUTCMonth() + 1),\n\t\tday = chosenday.getUTCDate() <=9 ? \"0\" + chosenday.getUTCDate(): chosenday.getUTCDate(),\n\t\tyear = chosenday.getUTCFullYear();\n\t\treturn (\"\" + year + divider + month + divider + day);\n\t}", "title": "" }, { "docid": "bc038eeec8f9c20f9adddb6ad87ab9cf", "score": "0.66010493", "text": "function formatDate(date){\n return date.getFullYear() + '/' \n + date.getMonth() + '/'\n + date.getDay() + ' ' \n + date.getHours() + ':' \n + date.getMinutes();\n}", "title": "" }, { "docid": "8784ca0d3481851dac899f54451d6a2c", "score": "0.65918374", "text": "function formattedDate(date) {\r\n var d = new Date(date),\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n\r\n if (month.length < 2) month = '0' + month;\r\n if (day.length < 2) day = '0' + day;\r\n return [year,month,day].join('-');\r\n }", "title": "" }, { "docid": "53b4842c14031c10dcd9bb2d0b2c471b", "score": "0.65876263", "text": "function format(date){\n var partialDate = new Date(date * 1000);\n var day = (partialDate.getDate()<10?'0':'' )+ partialDate.getDate();\n var month = (partialDate.getMonth()<10?'0':'' )+ (partialDate.getMonth()+1);\n return(month+\"/\"+ day +\"/\"+partialDate.getFullYear());\n}", "title": "" }, { "docid": "12dee02d309ec1e820da0fb95586fa85", "score": "0.65669566", "text": "function formatDate(date) {\n var res = date.substr(0, 10);\n return moment(res).format(\"MM DD YYYY\");\n}", "title": "" }, { "docid": "88e14a0d662b0bba6170c06f03ba5bc0", "score": "0.6563227", "text": "function formatDate(date) {\n var year = date.getFullYear();\n var month = date.getMonth();\n var date = date.getDate();\n\n month = new String(month + 1);\n if (month.length == 1) {\n month = 0 + month;\n }\n\n var date = new String(date);\n if (date.length == 1) {\n date = 0 + date;\n }\n\n return year + \"-\" + month + \"-\" + date;\n}", "title": "" }, { "docid": "82e6a3071231066dbfe5815b272aa4e5", "score": "0.65624136", "text": "function formatDate(d) {\n console.log(d);\n console.log(new Date());\n console.log(new Date(d));\n var dt = d.toString().replace('/Date(', '').replace(')/', '');\n return (new Date(parseInt(dt)).toLocaleDateString('en-US'));\n}", "title": "" }, { "docid": "667addb0f618a6efc1df6d388db91df4", "score": "0.65606666", "text": "function dt_formater(dateText) {\n var date = new Date(dateText);\n var day = (\"0\" + date.getDate()).slice(-2);\n var month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n var formateddate = date.getFullYear() + \"-\" + (month) + \"-\" + (day);\n return formateddate;\n}", "title": "" }, { "docid": "1cb3106af6c113559641f838b1b26e55", "score": "0.6553931", "text": "formatDate (d) {\n let month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "e5f5dae778e226506fbee28efbc7f2b0", "score": "0.65536696", "text": "function setFormatDate(d){\n var curr_date = d.getDate();\n var curr_month = d.getMonth()+1;\n var curr_year = d.getFullYear()+543;\n \n return curr_date + \"-\" + curr_month + \"-\" + curr_year;\n}", "title": "" }, { "docid": "8c8ecd51a5289293800078563c5f2830", "score": "0.6553566", "text": "function formatDate(date) {\n if (date == 'all') {\n return 'All Stats';\n \n } else { \n var year = date.substring(0, 4);\n var month = date.substring(5, 7) - 1;\n var day = date.substring(8, 10);\n return new Date(year, month, day);\n }\n }", "title": "" }, { "docid": "2efce06203459ce754a98eb620157e41", "score": "0.65505505", "text": "function formatDate() {\n var date = new Date();\n var datestr = date.getDate() + '/' + date.getMonth() + '/' + date.getFullYear() + ' ' + date.getHours() + ':' + date.getMinutes();\n return datestr;\n }", "title": "" }, { "docid": "fb12907d193e2a536e6fbe714a01ee5b", "score": "0.6550193", "text": "function formatDate(data){\n\tvar d = data.split('-');\n\treturn d[2]+'/'+d[1]+'/'+d[0];\n}", "title": "" }, { "docid": "be50deefc031bad8c98a29ce95d35c29", "score": "0.6547625", "text": "function convertDateFormat(enteredDate)\n{\n var dateToReturn = new Date(enteredDate);\n // Convert the date to a string in the form DD/MM/YYYY, and then\n // change all the slashes to hyphens\n return dateToReturn.toLocaleDateString(\"en-CA\");\n}", "title": "" }, { "docid": "a46b91c5e38a0cb218bbb5c3bda65a09", "score": "0.6530673", "text": "function formatDate2(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n return d;\n }", "title": "" }, { "docid": "e29c7bd48b92e5e79f056069cb694fdb", "score": "0.6528896", "text": "function formatDateToString(date)\n{\n var dd = (date.getDate() < 10 ? '0' : '') + date.getDate();\n var MM = ((date.getMonth() + 1) < 10 ? '0' : '') + (date.getMonth() + 1);\n var yyyy = date.getFullYear();\n\n return (yyyy + \"-\" + MM + \"-\" + dd);\n}", "title": "" }, { "docid": "fa8ce7ec767068baeb2b4e18ceb3102f", "score": "0.65187734", "text": "function obtenerFechaFormateada(date) {\n var year = date.getFullYear();\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n return day + '/' + month + '/' + year;\n}", "title": "" }, { "docid": "a10ea3f2b995ad308f27b69ecf18a7cb", "score": "0.65154785", "text": "function TransformDateHasSlashFormat (inputDate) {\n if(!inputDate || inputDate.length == 0) return;\n return inputDate.substring(0,2) + '/' + inputDate.substring(2,4) + '/' + inputDate.substring(4,8);\n}", "title": "" }, { "docid": "86738742160bd4cc6598c7080841eeeb", "score": "0.65152353", "text": "function formatDate(date, format) {\n\tvar r = {\n\t\t'%d': ('0' + date.getDate()).slice(-2),\n\t\t'%m': ('0' + (date.getMonth() + 1)).slice(-2),\n\t\t'%Y': date.getYear() + 1900\n\t};\n\t\n\treturn format.replace(/%d|%m|%Y/g, function(d) { return r[d]; });\n}", "title": "" }, { "docid": "7a45a69d5a6e813770f5f4da82b79599", "score": "0.6512686", "text": "function formatDate(fecha) {\n let arrayFecha = fecha.trim().split(\"/\");\n return arrayFecha[2] + \"/\" + arrayFecha[1] + \"/\" + arrayFecha[0];\n}", "title": "" }, { "docid": "4267954fc61e9bf54c6da13a0ffdc5cc", "score": "0.6507912", "text": "function formatDate(date,format){\n \n if(!format){format=\"MM/dd/yyyy\";}\n \n var month = date.getMonth() + 1;\n var year = date.getFullYear(); \n \n format = format.replace(\"MM\",month.toString().padL(2,\"0\")); \n \n if(format.indexOf(\"yyyy\") > -1){format = format.replace(\"yyyy\",year.toString());}\n else if (format.indexOf(\"yy\") > -1){format = format.replace(\"yy\",year.toString().substr(2,2));}\n \n format = format.replace(\"dd\",date.getDate().toString().padL(2,\"0\"));\n \n var hours = date.getHours(); \n if (format.indexOf(\"t\") > -1)\n {\n if (hours > 11){format = format.replace(\"t\",\"pm\")}\n else{format = format.replace(\"t\",\"am\")}\n }\n if (format.indexOf(\"HH\") > -1){format = format.replace(\"HH\",hours.toString().padL(2,\"0\"));}\n if (format.indexOf(\"hh\") > -1) {\n if (hours > 12){hours - 12;}\n if (hours === 0){hours = 12;}\n format = format.replace(\"hh\",hours.toString().padL(2,\"0\")); \n }\n if (format.indexOf(\"mm\") > -1){format = format.replace(\"mm\",date.getMinutes().toString().padL(2,\"0\"));}\n if (format.indexOf(\"ss\") > -1){format = format.replace(\"ss\",date.getSeconds().toString().padL(2,\"0\"));}\n \n return format;\n }", "title": "" }, { "docid": "d2d8979345a9afee395b22758c76c8b5", "score": "0.6498253", "text": "function dateFormat(date){\n var dateFormat = new Date(date);\n var dateStamp = dateFormat.getDate() + \"/\" + dateFormat.getMonth() + \"/\" + dateFormat.getFullYear();\n return dateStamp;\n }", "title": "" }, { "docid": "e491d9ae74a9042dae019f672a636403", "score": "0.64974874", "text": "function getFormattedDate(date) {\n return date.getFullYear()\n + \"-\"\n + (\"0\" + (date.getMonth() + 1)).slice(-2)\n + \"-\"\n + (\"0\" + date.getDate()).slice(-2);\n}", "title": "" }, { "docid": "3fdf337c079e54fe5c7e638a5c0a5688", "score": "0.6496735", "text": "formatDateDMY(date) {\n return moment(date).format('DD.MM.YYYY');\n }", "title": "" }, { "docid": "1117602261fc8e093844fb806f3962a8", "score": "0.649472", "text": "function formatDate(date) {\n return [date.getFullYear().toString(), padNumber(date.getMonth() + 1, 2), padNumber(date.getDate(), 2)].join('-');\n}", "title": "" }, { "docid": "eeec1128124edaf0064d26cd9661357c", "score": "0.64933884", "text": "function formatDate(date) {\n return format(calculateDate(date), 'MMMM yyyy');\n}", "title": "" }, { "docid": "80d7faceffe634dce3c6ebc44426e4a6", "score": "0.6485926", "text": "function formatDate() {\n var d = new Date(),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear(); // Get the date, month, day, and year\n\n if (month.length < 2) month = '0' + month; // If it is a single digit, add a 0\n if (day.length < 2) day = '0' + day; // If it is a single digit, add a 0\n\n return [year, month, day].join('-'); // Return the date appended by dashes\n}", "title": "" }, { "docid": "6d6f43d0a2d1466bb29238a7dd2a749a", "score": "0.6481393", "text": "function formatDate(dateObj)\n\t\t{\n\t\t\tif (dateObj instanceof Date || Object.prototype.toString.call(dateObj) === '[object Date]')\n\t\t\t{\n\t\t\t\tdateObj = new Date(dateObj);\n\t\t\t\treturn DateUtil.getDateString(dateObj);\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn dateObj;\n\t\t}", "title": "" }, { "docid": "384da40adfcc014fdd9b955c66aa0aa3", "score": "0.6477368", "text": "function formateDate(date) {\n date = new Date(date);\n return date.getDate() + '-' + (date.getMonth() + 1) + '-' + date.getFullYear();\n}", "title": "" }, { "docid": "f5fa9374c7f2e4e9ef0b257460133790", "score": "0.64764744", "text": "formatDate(date) {\n\t\tif (!date) return;\n\n\t\treturn moment(date).format(this.getConfig('date_format'));\n\t}", "title": "" }, { "docid": "7d78b7beb690859d885511fd040bc2a0", "score": "0.6469434", "text": "function formatDate(dateObj) {\n var dd = (dateObj.getDate() > 9) ? dateObj.getDate() : \"0\" + dateObj.getDate();\n var mm = (dateObj.getMonth() > 9) ? dateObj.getMonth() + 1 : \"0\" + (dateObj.getMonth() + 1);\n return dd + separator + mm + separator + dateObj.getFullYear();\n }", "title": "" }, { "docid": "c3aaf75dbd8b6f9cc438389f3cb18b6e", "score": "0.6468996", "text": "function formatDate(date, splitBy) {\n if(!splitBy) {\n splitBy = '/';\n }\n return date.split('/').reverse().join('-');\n }", "title": "" }, { "docid": "3f37bf76fc824fc6f267c71d0e35ee31", "score": "0.6467827", "text": "function dateToDate(date){\n\tif (!date){\n\t\treturn '';\n\t}\n\tvar day = date.getDate();\n\tvar month = date.getMonth()+1;\n\tvar year = date.getFullYear();\n\treturn day+\"/\"+month+\"/\"+year;\n}", "title": "" }, { "docid": "d56d60f4c0e71bd4172bcba7a5ded812", "score": "0.6465097", "text": "function formatDate(d) {\n var month = \"\" + (d.getMonth() + 1);\n var day = \"\" + d.getDate();\n var year = \"\" + d.getFullYear();\n\n if (month.length < 2) month = \"0\" + month;\n if (day.length < 2) day = \"0\" + day;\n\n return [year, month, day].join(\"-\");\n}", "title": "" }, { "docid": "3c0b30942dd44895fc6c230d10bbaa71", "score": "0.64637387", "text": "function beautifyDate(d) {\n var newd = d.split('-');\n return newd[2] + '/' + newd[1] + '/' + newd[0];\n}", "title": "" } ]
a40faf5b5a64c19aa65166a0eeb6fbd2
we would need caolan async!
[ { "docid": "4fe01b99a3f9256a5aad72d89de003f6", "score": "0.0", "text": "function parallel(array, cb) {\n var pending = array.length,\n error;\n function done(err) {\n pending -= 1;\n if (err) {\n error = err;\n }\n if (pending === 0) {\n cb(err);\n }\n }\n forEach(array, function (a) {\n a(done);\n });\n}", "title": "" } ]
[ { "docid": "2758661ebc7a788aafa2931afca07676", "score": "0.7402877", "text": "async sync() {}", "title": "" }, { "docid": "397e3051160aa51a2cae796e903a9897", "score": "0.7171134", "text": "function Async() {}", "title": "" }, { "docid": "79c29d67bc2ef8e4a9f51c2b3fccda0d", "score": "0.66491276", "text": "async method(){}", "title": "" }, { "docid": "3ffd734120a270de78507285218364a8", "score": "0.6637972", "text": "async function cobaAsync(arguments){\n\t// const coba2 = await cobaPromise() // nunggu sampai promise selesai\n\t// console.log(coba2) // tapi klo reject error `uncaught ...`\n\t\n\t// -- solusi --\n\t// => error handling\n\ttry { // jika resolve\n\t\tconst coba2 = await cobaPromise()\n\t\tconsole.log(coba2)\n\t} catch(err) { // jika reject\n\t\tconsole.log(err)\n\t}\n}", "title": "" }, { "docid": "e6a8b7a5fc43cdd2f01ee892de29a2e7", "score": "0.6456983", "text": "static async method(){}", "title": "" }, { "docid": "c4b530e7af7d25b80f989427870a6eb5", "score": "0.6335515", "text": "function _runAsync()\n {\n //run all $.async functions\n rScript.runFunction('a1ready', {queue: true, namespace: 'a1ready'});\n }", "title": "" }, { "docid": "6b4762ee0a2e111c7419bfbbf9cb0df1", "score": "0.62160736", "text": "async begin() {\n return;\n }", "title": "" }, { "docid": "69a719766641e53f376144b508dae566", "score": "0.61900836", "text": "async function foo() {}", "title": "" }, { "docid": "c1d48f167e6f7b96f49570437760f2b6", "score": "0.6125244", "text": "function doSomethingAsync(cb) {\n console.log('lets pretend this is doing some assynchronous i.o.');\n cb();\n}", "title": "" }, { "docid": "72b350b1c0374487d8e06fe4f8d59db5", "score": "0.6077076", "text": "async init() {\n }", "title": "" }, { "docid": "5bc793a49de9e32fa28932a130561582", "score": "0.60740465", "text": "async loop() {}", "title": "" }, { "docid": "5bc793a49de9e32fa28932a130561582", "score": "0.60740465", "text": "async loop() {}", "title": "" }, { "docid": "5b308f275f4780448b4c1efe8be0e211", "score": "0.6071232", "text": "_run(cb) {\n cb();\n }", "title": "" }, { "docid": "5b308f275f4780448b4c1efe8be0e211", "score": "0.6071232", "text": "_run(cb) {\n cb();\n }", "title": "" }, { "docid": "7c839dc1ee2d0833396970cd4c1b5124", "score": "0.60618263", "text": "async after () {\n\t}", "title": "" }, { "docid": "dd3d2ff5dbf8d0a36bf5b1ffd7bdf676", "score": "0.6033111", "text": "run() {}", "title": "" }, { "docid": "2bb88401e3c30756583c566c4381073f", "score": "0.600961", "text": "static /* 2.2 L meth */ async /* 2.3 L meth */ * /* 2.4 L id */ method(){}", "title": "" }, { "docid": "9d2d0433cd5ec0133b346e75222493ff", "score": "0.5999573", "text": "async init () {}", "title": "" }, { "docid": "224b1a9eae4db6e9f6346396a3e3b936", "score": "0.5982694", "text": "async function cobaAsync(){\n // const coba = await cobaPromise();\n // console.log(coba);\n // try untuk yang resolve\n try{\n const coba = await cobaPromise();\n console.log(coba);\n }\n // catch untuk yang reject\n catch(err){\n // console.log(err);\n console.error(err);\n }\n}", "title": "" }, { "docid": "cf520f3a3bf7fb4b320c828006648271", "score": "0.5968449", "text": "async function miFuncionConPromesa(){\n return \"saludos con primesa y async\";\n}", "title": "" }, { "docid": "d4088d8ce0369bb0ef3253cc75c7548b", "score": "0.59601617", "text": "function asyncPending() { \n console.log('asyn start');\n console.log(asyncAwait());\n console.log('asynDone');\n // document.getElementById(\"result\").value = asyncFetch();\n}", "title": "" }, { "docid": "5ca5998d1408331d49ac585dd38e782c", "score": "0.5948746", "text": "_wait() {}", "title": "" }, { "docid": "936b298bb4268e31b49addc4eedd8aa5", "score": "0.5933385", "text": "function doAsync() { \n let p = new Promise(\n function (resolve, reject) { \n setTimeout(\n function () { \n resolve('OK to go....'); \n }, \n 5000\n ); \n }\n ); \n return p; \n }", "title": "" }, { "docid": "e8a45d784eec7d0c5ab84d55ae56a457", "score": "0.59273505", "text": "function Async(cb, request) {\n request(cb);\n}", "title": "" }, { "docid": "08ea2a032f76afd9f444e8044bc48f95", "score": "0.5922684", "text": "async function s(e,t){return o(t,(async t=>(0,n.h)(e,t)))}", "title": "" }, { "docid": "0582749c220bc67162519e64eb68721c", "score": "0.59184057", "text": "async execute() {\n // to be extended by subclasses\n }", "title": "" }, { "docid": "1120242ee4fba82f89c058c8d05858f5", "score": "0.59121335", "text": "async yell () { /* ... */ }", "title": "" }, { "docid": "d88722c1f841543e824f65aed4b4e53d", "score": "0.5902019", "text": "function doAsync() { \n let p = new Promise(\n function (resolve, reject) { \n setTimeout(\n function () { \n resolve('OK to go....'); \n }, \n 5000\n ); \n }\n ); \n return p; \n }", "title": "" }, { "docid": "5c7d08aedb28287c288f6fb80cb9c857", "score": "0.5852036", "text": "async before () {\n\t}", "title": "" }, { "docid": "9200813b84b0f849d1317b45fd8a9435", "score": "0.58505553", "text": "async started() {}", "title": "" }, { "docid": "8a53a749d8ce40d63c77df584f37383b", "score": "0.58436054", "text": "async function helloWorld() {\n return \"hello world\";\n}", "title": "" }, { "docid": "7133dd7dc31267085dee3052cc557eec", "score": "0.5836511", "text": "async function hello() {\n return 'Hello there'; //this return as promise then we consume it using then\n}", "title": "" }, { "docid": "afc9cfe85232a86bd8a566d2ca742a02", "score": "0.58317006", "text": "get done() {}", "title": "" }, { "docid": "a4cc8287e9f3740dfbee1d488e79a0c9", "score": "0.582444", "text": "async function asyncCall() {\n await finished()\n reset()\n }", "title": "" }, { "docid": "4ababf1e34bb8698bf21065645c29c66", "score": "0.5814036", "text": "async initialize() {\n\n }", "title": "" }, { "docid": "1adacaca0ecf508040f5f1ab7cf6d2fc", "score": "0.5807988", "text": "async initialize() {\n }", "title": "" }, { "docid": "12ab52e1ff101d1791e70e1f058454e9", "score": "0.580749", "text": "initializeAsync() {\n // if returns promise, the main thread waits for it to be finished.\n return new Promise((res, rej) => {\n setTimeout(() => {\n res(0);\n }, 2000);\n });\n }", "title": "" }, { "docid": "66bbc5576fa1156d9d9fd428efb26f36", "score": "0.5804622", "text": "async finalize() {\n }", "title": "" }, { "docid": "0a48f9117d8ff050a5fd8d3af2738e82", "score": "0.58020335", "text": "function addAsyncClient(x,y){\n console.log(\"[SC] triggering add\");\n addAsync(x,y, function(err,result){\n if(err){\n console.log(\"error occurd..\", err);\n return;\n }\n console.log(\"[SC] result = \", result); \n }); \n}", "title": "" }, { "docid": "afd14d330ff77aa4ae179e217c49714d", "score": "0.57849836", "text": "async function af1()\n{\n console.log(\"1. executing async af1 function body\");\n return \"hello\"\n}", "title": "" }, { "docid": "509961d89730e748f6d2d0ece3074b8a", "score": "0.5768193", "text": "static onComplete() {}", "title": "" }, { "docid": "8f5a349741236d31c240af890b00a4dc", "score": "0.57653856", "text": "doSomethingAsync() {\n let logger = Logger.create(\"doSomethingAsync\")\n logger.info(\"enter\")\n\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve({hello: \"world\"})\n }, 3000)\n })\n }", "title": "" }, { "docid": "f74a877f8ac3e0bbe49341a5b8ddf06e", "score": "0.5764558", "text": "async function example1() {\r\n return 'Lalala';\r\n}", "title": "" }, { "docid": "24d11370fddc0fb7a1d148b2e2e46f57", "score": "0.57603085", "text": "async function leerArchivoSync(){\n try{\n const contenido= await leerArchivo(nombreArchivo); //PROmesa\n console.log(contenido);\n console.log('LEIMOS CON ASYNC AWAIT');\n return 1;\n }catch (error){\n console.eror ('Error ', error);\n return 0;\n }\n}", "title": "" }, { "docid": "2b576c634e51bc65fddef2659230ba3b", "score": "0.5757883", "text": "function asyncFinal(results) { \n\tconsole.log('Done', results); \n}", "title": "" }, { "docid": "8fafb59fae6873f6b438aed089677372", "score": "0.57458204", "text": "function main() {\n async.series([\n runGetUserInfo\n ]);\n}", "title": "" }, { "docid": "b25895fc9f120a576b63213325959642", "score": "0.57440376", "text": "async function greet(){\n return \"hello\";\n}", "title": "" }, { "docid": "a1ef0a4d763c3ce10903c0f51e7e276e", "score": "0.5729671", "text": "async function asyncstatus(){\n try{\n console.log(\"hi...\");\n res=await reachA // await must call inside the async funtion\n console.log(res);\n console.log(\"end\");\n }catch(error){\n console.log(error);\n }\n \n}", "title": "" }, { "docid": "43c211c3a37e6a25d2ce9fd18c0cf4c2", "score": "0.5728926", "text": "async function showTheThings() {\n\n}", "title": "" }, { "docid": "56439f62b1ef3ba29ff645c6ddb66276", "score": "0.57178336", "text": "async function AsyncFunctionInstance() {}", "title": "" }, { "docid": "285b66ca1547508a9656e18647d2ffee", "score": "0.5715326", "text": "run() {\n return;\n }", "title": "" }, { "docid": "3262c3ccd1471648b6cf4eaceb6799a7", "score": "0.5704963", "text": "async connect() {\n // not needed\n }", "title": "" }, { "docid": "3262c3ccd1471648b6cf4eaceb6799a7", "score": "0.5704963", "text": "async connect() {\n // not needed\n }", "title": "" }, { "docid": "0cb399d6246657d7152f8156ef76a394", "score": "0.5695242", "text": "async function func() {\n return \"Hello\"\n }", "title": "" }, { "docid": "ec6ac4822c1d218279f27241a982d7d3", "score": "0.56910336", "text": "asyncAwait() {\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function* () {\n this.concatMapCompleted = false;\n const randomJoke = yield this.jokeApisService.tryJokeActions('get').toPromise();\n this.showCMJokeApiData(randomJoke);\n const upVote = yield this.jokeApisService.tryJokeActions('post', randomJoke['id'], true, false).toPromise();\n this.showCMUpVoteApiData(upVote);\n const downVote = yield this.jokeApisService.tryJokeActions('post', randomJoke['id'], false, true).toPromise();\n this.showCMDownVoteApiData(downVote);\n this.concatMapCompleted = true;\n });\n }", "title": "" }, { "docid": "7fdf35ac5fe4a1707fda7f9da1bc5d10", "score": "0.5683653", "text": "kp_fork (us) {\n this.wrap_async(done => {\n console.error('call to unimplemented function kp_fork')\n setTimeout(done, 1000)\n })\n }", "title": "" }, { "docid": "2514e896ed06d8aab16d3ed9f18e5365", "score": "0.5673058", "text": "function Async() {\n return this;\n}", "title": "" }, { "docid": "1d34d0eb546f387d6ded80ccb8df6dcd", "score": "0.566127", "text": "function runAbcAsync() {\r\n var promise = abcAsync();\r\n promise.progress(function (msg) { alert(msg); });\r\n\r\n return promise;\r\n}", "title": "" }, { "docid": "7f6b8d3d13fb64f67610337e5b65af7c", "score": "0.5639594", "text": "async function program() {\n console.log('ASYNC AWAIT EXAMPLE')\n const user = await getUser();\n console.log('user', user);\n const friends = await getUserFriends(user);\n console.log('friends', friends);\n \n // takoder mozemo koristiti try catch blok\n /*\n try{\n const user = await getUser();\n console.log('user', user);\n const friends = await getUserFriends(user);\n console.log('friends', friends);\n } catch(e) {\n console.log('exception', exception);\n }\n */\n }", "title": "" }, { "docid": "ca2bc3142547e1c2523b4d7140a0e610", "score": "0.5636911", "text": "process() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n // default method do nothing\r\n });\r\n }", "title": "" }, { "docid": "ac5674e2d78883f9d8a8d57e880cb714", "score": "0.5636765", "text": "async function ayncCall(){\n console.log('llamando');\n const result = await setTimeout(()=>{\n console.log(\"Ejecuto\");\n },500);\n console.log(\"Termino\");\n}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.56336594", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.56336594", "text": "ready() {}", "title": "" }, { "docid": "bbc79f63fddbc2a53ebd9680eed96e73", "score": "0.5619831", "text": "function doAsync() {\n\treturn new Promise((resolve, reject) => {\n\t\tsetTimeout(resolve, 5000);\n\t});\n}", "title": "" }, { "docid": "ced601245940628614962e50b4eb1075", "score": "0.5617946", "text": "function someAsyncApiCall(callback) { process.nextTick(callback()) }", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.5610344", "text": "function callback(){}", "title": "" }, { "docid": "9272bd283d746cf9f242d079d6dfbbd0", "score": "0.5609071", "text": "run() {\n\n }", "title": "" }, { "docid": "657b9debde02b399ae439301a3b4057f", "score": "0.5601491", "text": "async _asyncMain() {\n\n // TEST: Erst mal setzen wir eine Variable in adapter.x\n const txt = `[main.js - _asyncMain()] - sunset (Sonnenuntergang) heute ist um: ${new Date(this.x.mTimer.getAstroNameTs('sunset')).toISOString()}`;\n this.x.test.test1 = txt;\n this.log.warn(txt);\n\n // TEST: Nach 3s Call einer Funktion in timer.js\n setTimeout(()=> {\n this.x.mTimer.testFunc();\n }, 3000);\n\n // TEST: Nach 6s Variable prüfen\n setTimeout(()=> {\n this.log.warn(`[main.js - _asyncMain()] - sind wieder hier.`);\n this.log.warn(`Aktueller Wert von 'adapter.x.test.test1': '${this.x.test.test1}'`);\n }, 3000);\n\n }", "title": "" }, { "docid": "eccf475b89a7a19456ebc3c5a6b7e013", "score": "0.55981", "text": "function makeParentFunctionAsync(j, path) {\n let fn = findParentFunction(j, path);\n if (fn) {\n fn.node.async = true;\n }\n}", "title": "" }, { "docid": "70e202df4753be97a8e5da0cf2f17379", "score": "0.55909055", "text": "function asynchronously(fun) {\n setTimeout(fun, 1);\n }", "title": "" }, { "docid": "8bb3946905eed70e41d2f211eeb423f4", "score": "0.55893785", "text": "function test_co() {\n function print(v) { log('main> ' + v); }\n \n var v = 1;\n print(v);\n var co = my_coroutine_async(v);\n \n v = co[0](undefined);\n for (var i = 1; i < co.length; ++i)\n v = co[i](get(v));\n \n print(v);\n \n function get(v) { return v; }\n}", "title": "" }, { "docid": "685a42a44e34f07e29518d35c1846462", "score": "0.5587097", "text": "function done() {\n\n}", "title": "" }, { "docid": "0e70345461932140f650a6539cab57b7", "score": "0.5584326", "text": "async function test() {\n await registerOracles ()\n console.log(final);\n await listen ()\n}", "title": "" }, { "docid": "202ad5e5f3c50c7bc42c31089c52285c", "score": "0.5580099", "text": "async _doOpen() {\n }", "title": "" }, { "docid": "953a7d317e0fdf2fde2e204ede13d718", "score": "0.55798125", "text": "function customAsync() {\n const _async2 = fn => (...params) => cb => fn(...params, cb);\n\n const add2 = _async2(add);\n\n const add2Result = add2(100, 200);\n\n add2Result(function (result) {\n console.log(result);\n });\n}", "title": "" }, { "docid": "1597f2e91c9cd6b700a670d2fd9c5859", "score": "0.557981", "text": "static fetchAll(cb) {\n // WAITING THE CALL BACK !!!!!!!!!!!!!!!\n fs.readFile(filePath,(err,fileContent)=>{\n if(!err && fileContent != ''){\n //console.log(fileContent);\n cb(JSON.parse(fileContent));\n //console.log(\"Hello\"); NOTE HERE CALL BACKS ! \n }\n\n else \n cb([]);\n //console.log(\"Hello\");\n\n });\n }", "title": "" }, { "docid": "372a51d0d9061ab58c85d509b786c611", "score": "0.55784655", "text": "async started() {\n\n }", "title": "" }, { "docid": "372a51d0d9061ab58c85d509b786c611", "score": "0.55784655", "text": "async started() {\n\n }", "title": "" }, { "docid": "5e27ef791e615dd5347d52ac744a4e77", "score": "0.55731994", "text": "requestAsyncNodeAccess(node){\n \t\n \treturn false;\n \n }", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.55713844", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.55713844", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.55713844", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.55713844", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.55713844", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.55713844", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "acae3c9ca79a02a56ccdb6b545dbda4b", "score": "0.5568339", "text": "async connect() {\r\n return;\r\n }", "title": "" }, { "docid": "e89c1b9677d552526c353e0209152dbc", "score": "0.55625963", "text": "async function asyncloaded() {\n web3 = new Web3(Web3.givenProvider); // provider from metamask \n var result = await web3.eth.requestAccounts().catch(x => console.log(x.message));\n console.log(`web3 is present: ${web3.version}`); // note: use ` (back quote)\n const network = await web3.eth.net.getId().catch((reason) => console.log(`Cannnot find network ${reason}`));\n if (typeof network === 'undefined' || network != 4) { console.log(\"Please select Rinkeby test network\"); return; }\n console.log(\"Ethereum network: Rinkeby\")\n accounts = await web3.eth.getAccounts();\n console.log(accounts[0]); // show current user.\n contract = new web3.eth.Contract(abi, contract_address);\n}", "title": "" }, { "docid": "c502a0e70cb62806eb3b30e16f632547", "score": "0.55564326", "text": "function async(callback, arg) {\n config.async(callback, arg);\n}", "title": "" }, { "docid": "ca119f905e41c9191a4a64c249de38f1", "score": "0.5554323", "text": "function o1168() {\n try {\nif (Module['calledRun']) try {\nreturn;\n}catch(e){}\n}catch(e){} // run may have just been called while the async setStatus time below was happening\n try {\nModule['calledRun'] = true;\n}catch(e){}\n\n try {\no287();\n}catch(e){}\n\n try {\no288();\n}catch(e){}\n\n try {\nif (Module['_main'] && o1161) {\n try {\nModule['callMain'](o81);\n}catch(e){}\n }\n}catch(e){}\n\n try {\no290();\n}catch(e){}\n }", "title": "" }, { "docid": "7472c56ab6dfa9b4f0756f498b978d07", "score": "0.5553064", "text": "async function asyncloaded() {\r\n web3 = new Web3(Web3.givenProvider); // provider from metamask \r\n var result = await web3.eth.requestAccounts().catch(x => console.log(x.message));\r\n console.log(`web3 is present: ${web3.version}`); // note: use ` (back quote)\r\n const network = await web3.eth.net.getId().catch((reason) => console.log(`Cannnot find network ${reason}`));\r\n if (typeof network === 'undefined' || network != 4) { console.log(\"Please select Rinkeby test network\"); return; }\r\n console.log(\"Ethereum network: Rinkeby\")\r\n accounts = await web3.eth.getAccounts();\r\n console.log(accounts[0]); // show current user.\r\n contract = new web3.eth.Contract(abi, contract_address);\r\n}", "title": "" }, { "docid": "6c919b1a134c7e302070b988596cf9d6", "score": "0.5546174", "text": "ready() { return true; }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5538885", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5538885", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5538885", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5538885", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5538885", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5538885", "text": "ready() { }", "title": "" }, { "docid": "b0ae421366fe032dbff5a96084ceb262", "score": "0.5535626", "text": "async function a(e,t,r,a,c,l){var u;let h,d=!1,p=1e3,f=0;const g=i.S.now();let m,v;do{try{h=await e(),void 0!==v&&r(v),d=!0}catch(e){if(void 0!==l){const t=l();if(!1===t.retry){if(void 0!==t.error)throw t.error;throw e}}if(!(0,o.ms)(e))throw c.sendErrorEvent({eventName:t,retry:f,duration:i.S.now()-g},e),e;f++,m=e,p=null!==(u=(0,o.ZZ)(e))&&void 0!==u?u:Math.min(2*p,8e3),void 0===v&&(v=(0,n.Z)()),a(v,p,e),await(0,s.g)(p)}}while(!d);return f>0&&c.sendTelemetryEvent({eventName:t,retry:f,duration:i.S.now()-g},m),h}", "title": "" }, { "docid": "6b4aa0fa934a84ff85c3a7c5b40495f1", "score": "0.5529013", "text": "function cb() {\n console.log(\"This is a lot of coding.\");\n }", "title": "" }, { "docid": "6041f7f925d9c462ae83ede1a21f883e", "score": "0.55277723", "text": "async function amain() {\n let data;\n \n fetch(`https://api.exchangeratesapi.io/latest`)\n .then((resp) => {\n return resp.json();\n })\n .then(result => data = result)\n .then(() => new Promise(resolve => setTimeout(resolve, 1000)))\n .then(() => {\n alert(`Yeah, ${JSON.stringify(data)}`);\n });\n }", "title": "" }, { "docid": "1ce3b706a5999124a812ac04d5909c88", "score": "0.55219114", "text": "async processFile(hndl) {\n }", "title": "" } ]
fc955d90811c65126431165f9f840634
Retrieve searches from Local Storage, return an array
[ { "docid": "f4e7b38b2736552f20f3bda18d30aca7", "score": "0.58655053", "text": "function loadFromLocalStorage(storageName) {\n let data = localStorage.getItem(storageName);\n if (data) {\n return JSON.parse(data);\n }\n return [];\n }", "title": "" } ]
[ { "docid": "c0d2bd551bdc6b976d9509ff50f88a06", "score": "0.7129106", "text": "function getRecentSearches() {\n storedSearches = localStorage.getItem(\"recentSearches\");\n if (storedSearches) {\n recentSearchesArray = JSON.parse(storedSearches);\n }\n return recentSearchesArray;\n}", "title": "" }, { "docid": "18ab9656b54f673547a5d0d05e680047", "score": "0.69534135", "text": "function get() {\n let items;\n // check for previously stored items\n\n if (localStorage.getItem(\"items\") == null) {\n items = [];\n // if no items found in local storage create array\n } else {\n items = JSON.parse(localStorage.getItem(\"items\"));\n // if items found in local storage retrieve array\n }\n return items;\n }", "title": "" }, { "docid": "da6dac071ed9cbe86ada5ea53481ffc1", "score": "0.68582827", "text": "function getStored() {\n //pulls info from local\n var storedSearch = window.localStorage.getItem(\"city\");\n //if stored array is empty\n if (storedSearch == null) {\n storedSearch = \"[]\";\n }\n //parsing json stored array data\n storedSearch = JSON.parse(storedSearch);\n //return stored search\n return storedSearch;\n }", "title": "" }, { "docid": "50c408cdaf0abc9a31c32adbbdaf9c5d", "score": "0.6732997", "text": "function getAllFromfavourites() {\n return JSON.parse(localStorage.getItem(\"favourites\"));\n}", "title": "" }, { "docid": "624e1cc1c5828b138a3819b869ba71a5", "score": "0.6717998", "text": "function getStorageItems() {\n let tweetList;\n let lsTweetList = localStorage.getItem('tweets') \n if (lsTweetList === null) {\n tweetList = [];\n } else {\n tweetList = JSON.parse(lsTweetList)\n }\n return tweetList; \n}", "title": "" }, { "docid": "adf00e58e65d1cd7e7856b54a4075719", "score": "0.6716679", "text": "function getAllFromLocalStorage() {\n const val = JSON.parse(localStorage.getItem(LOCALSTORAGE_KEY));\n return val || []\n}", "title": "" }, { "docid": "cacec0179d5681d1467502e96ff77b1a", "score": "0.6691616", "text": "function getItemsFromLS(){\n if(localStorage.getItem(\"array\")===null){\n array=[];\n }else{\n array=JSON.parse(localStorage.getItem(\"array\"));\n }\n return array;\n}", "title": "" }, { "docid": "f86b2b77bd48d26fd74de4c508e083db", "score": "0.6600857", "text": "function findLocalStorageItems(query, includeQueryInKeys) {\n\t//SOURCE: https://gist.github.com/n0m4dz/77f08d3de1b9115e905c\n\tvar i, results = [];\n\tfor (i in localStorage) {\n\t\tif (localStorage.hasOwnProperty(i)) {\n\t\t if (i.match(query) || (!query && typeof i === 'string')) {\n\t\t var key = i\n\t\t if (!includeQueryInKeys && key.indexOf(query) == 0) {\n\t\t \tkey = key.substr(query.length)\n\t\t } \n\t\t \n\t\t results.push({key:key, val:localStorage.getItem(i)});\n\t\t }\n\t\t}\n\t}\n\treturn results;\n}", "title": "" }, { "docid": "d7846b1951c6aaf1b85a38ea79314239", "score": "0.6566199", "text": "function searchAll()\n{\n chrome.storage.local.get(null, function (items)\n {\n // iterates over each search term\n let i = 1;\n while (items['search' + i] !== undefined)\n {\n // makes the search in a new tab\n search(items['search' + i], true);\n i++;\n }\n });\n}", "title": "" }, { "docid": "3256a8f63d971ee562cc1f4c712adfbb", "score": "0.6516412", "text": "function getList() {\n var result = [];\n\n // calculate count of first entry\n var count = getListCount() - threshold + 1;\n\n // if there are less entry than the threshold (count < 1), we want to begin with the first element\n if (count <= 0) {\n count = 0;\n }\n\n for (var i = 0; i < threshold; i++) {\n count++;\n console.log(\"count: \" + count);\n\n // get data from localStorage\n var text =localStorage[storageKeyText + count];\n var url = localStorage[storageKeyUrl + count];\n var gravatarId = localStorage[storageKeyGravatarUrl + count];\n\n // if the text is undefined, we assume that there is no entry\n if (!text) {\n continue;\n }\n\n // build entry\n var entry = {\n text: text,\n url: url,\n gravatarUrl: gravatarId\n }\n result[i] = entry;\n }\n\n return result;\n}", "title": "" }, { "docid": "77bf763dc1e7b7c716629f614b92b3ad", "score": "0.65028405", "text": "getItemsFromStorage() {\n let items;\n\n // First check if there any items\n if (localStorage.getItem('items') === null) {\n items = [];\n } else {\n items = JSON.parse(localStorage.getItem('items'));\n }\n\n return items;\n }", "title": "" }, { "docid": "fc1026c0fd5701bf096594891577e81b", "score": "0.64730835", "text": "function getSearchHistory(){\n var arrToLoad;\n if( arrToLoad = JSON.parse(window.localStorage.getItem(\"search_history\"))){\n arrSearchHistory = arrToLoad;\n }\n displayHistory();\n}", "title": "" }, { "docid": "7be33c0f3a4db60e81ecabf952ec7a36", "score": "0.6472687", "text": "function get(){\n chrome.storage.local.get(['~'], function(result){\n let words = result['~'];\n if(words !== undefined){\n list = words;\n }\n else{\n list = [];\n }\n });\n}", "title": "" }, { "docid": "f814afe158eb20240f9aed33e5f49568", "score": "0.6469691", "text": "function getStorageItems() {\n var lst = [];\n var i = 0;\n for (var key in localStorage) {\n if (i >= localStorage.length)\n break;\n lst.push(JSON.parse(localStorage.getItem(key)));\n i++;\n }\n return lst;\n}", "title": "" }, { "docid": "5769eb7207a65f96087dc6ed7c88a469", "score": "0.6460598", "text": "function retrieveData(){\n var numStored = window.localStorage.length;\n //for(){\n \t//window.localStorage.key(i) --get the key, and then use this key to get value\n \t//then populate \"entries\" array, while put the deleted and completed ones into their only array(user dont need them intensively)\n \t\n //}\n}", "title": "" }, { "docid": "57b9ee58f9c56c08657063ca7039a19e", "score": "0.6416815", "text": "getAll() {\n return (this.localStorageGet() !== null) ? this.localStorageGet() : [];\n }", "title": "" }, { "docid": "7af99c1b750854f37f20bc1db5fdff9c", "score": "0.63927937", "text": "function getCities() {\n var storedCities = JSON.parse(localStorage.getItem('searchedCities'));\n if (storedCities) {\n searchedCities = storedCities;\n }\n}", "title": "" }, { "docid": "9ba2cd73b128e40244fe9813d37f81ac", "score": "0.6388051", "text": "function getItemsFromStorage() {\n let items;\n\n //if something exists on storage -> get value otherwise empty array\n if(localStorage.getItem('items') === null){\n items = [];\n } else {\n items = JSON.parse(localStorage.getItem('items'));\n }\n return items;\n}", "title": "" }, { "docid": "32fa41e497b4ed20833f5b0f42d68404", "score": "0.63535875", "text": "function getResultsFromStorage(){\n let storageProducts = localStorage.getItem('results');\n //pulls item with key name 'results' from storage and assigns the string to storageProducts\n if (storageProducts){\n let parsedResults = JSON.parse(storageProducts);\n //checks that storageProducts isn't empty, and if it isn't it parses the string retrieved into objects.\n for (let object of parsedResults){\n let newProduct = new Product(object.productName, object.imgPath, object.votes, object.shown);\n Product.allProducts.push(newProduct);\n }\n //cycles through the array of parsedReslts, and creates and pushes a new product into the string of all Products.\n }\n}", "title": "" }, { "docid": "a731a5fbb958dd7cb0e49377ea55dcb7", "score": "0.63252777", "text": "function getAllMoviesFromStorage(){\n let movies\n if(localStorage.getItem(\"movies\") === null){\n // if movies not exist in storage\n movie = []\n } else {\n // here we have \"movies\" data in storage\n movies = JSON.parse(localStorage.getItem(\"movies\"))\n // data converted as JSON object\n }\n console.log(\"DATA ->\", movies)\n return movies\n}", "title": "" }, { "docid": "5c905342fac03552bf097dd4fcc31ac1", "score": "0.63118714", "text": "function getSearchCriteriaFromLocalStorage() {\n\treturn JSON.parse(localStorage.getItem(\"City Search Criteria\"));\n}", "title": "" }, { "docid": "8f92244613be704d2285dbed3e8b317f", "score": "0.6306411", "text": "fetchAll() {\n let store = this.storage.getItem(this.storageId);\n return (store && JSON.parse(store)) || [];\n }", "title": "" }, { "docid": "6e6228fbc8b884a471d3bbcfd982bca7", "score": "0.62979835", "text": "function allStorage() {\n keys= Object.keys(localStorage),\n i=keys.length;\n while (i--) {\n storedQuotes.push(localStorage.getItem(keys[i]))\n }\n console.log(storedQuotes);\n return storedQuotes;\n }", "title": "" }, { "docid": "cd01f05e1c3f62c43fd5b27998af6250", "score": "0.6288885", "text": "function getLatestSearches() {\n\n var searchHistory = JSON.parse(localStorage.getItem(\"searches\"));\n\n if (!searchHistory) {\n searchHistory = [\"Los Angeles\"];\n localStorage.setItem(\"searches\", JSON.stringify(searchHistory));\n return searchHistory;\n } else {\n return searchHistory;\n }\n}", "title": "" }, { "docid": "4779867409bcbec6328e0df95c69b20c", "score": "0.6272149", "text": "static getItems() {\n let items;\n if (localStorage.getItem(\"items\") === null) {\n items = [];\n } else {\n items = JSON.parse(localStorage.getItem(\"items\"));\n }\n return items;\n }", "title": "" }, { "docid": "ecb422f70abbd123f7796871322b0d5d", "score": "0.6271085", "text": "function obtainLocalStorage() {\n\n var favoriteArr = [];\n \n if (localStorage.getItem('myFavorites')) {\n favoriteArr = JSON.parse(localStorage.getItem('myFavorites'));\n };\n\n if (favoriteArr.length > 0) {\n\n $(\"#favorites\").empty();\n\n for (var i = 0; i<favoriteArr.length ; i++) {\n\n $(\"#favorites\").append(makeResultsDiv(favoriteArr[i]));\n \n };\n };\n \n }", "title": "" }, { "docid": "70f8a8c26245074749b8d40db82274f5", "score": "0.622073", "text": "function getItems() {\n if (localStorage.getItem('myCities') !== null) {\n let mySearch = JSON.parse(localStorage.getItem('myCities'));\n \n\n for (let i = 0; i < mySearch.length; i++) {\n let displayDiv = $('<button>');\n displayDiv.addClass(\"search-btn\");\n displayDiv.text(mySearch[i]);\n displayDiv.attr('value', mySearch[i]);\n $(\"#searchHistory\").append(displayDiv);\n \n }\n \n }\n}", "title": "" }, { "docid": "fdf8c0fa441aeef96d597c96e0f7a4a8", "score": "0.619071", "text": "displayItems() {\n var i, id, len, ref, results;\n this.clearItems();\n ref = Object.keys(localStorage);\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n id = ref[i];\n results.push(this.addItem(localStorage.getObj(id)));\n }\n return results;\n }", "title": "" }, { "docid": "a8ae5b0c6b870d68a5addc52a1919aff", "score": "0.61473954", "text": "getItems() {\n let items = localStorage.getItem(\"items\");\n if(items !== null) {\n items = JSON.parse(items);\n } else {\n items = [];\n }\n return items;\n }", "title": "" }, { "docid": "ad21a126e17ce034e89aeac05b828371", "score": "0.61414", "text": "function getSongTitles() {\n\t\n\tvar titleHistory = [];\n\tvar titles = localStorage[\"songTitles\"];\n\t\n\tif(typeof titles != \"undefined\"){\n\t\tvar titleHistory = JSON.parse(titles);\n\t}\n\t\n\treturn titleHistory;\n}", "title": "" }, { "docid": "6c23602ad8496618c95810076daeba76", "score": "0.6137371", "text": "static getList() {\n\t\tlet list;\n\t\tif (localStorage.getItem(\"list\") === null) {\n\t\t\tlist = [];\n\t\t} else {\n\t\t\tlist=JSON.parse(localStorage.getItem(\"list\"));\n\t\t}\n\t\treturn list;\n\t}", "title": "" }, { "docid": "3414d2bd542d75866d2148b17da102a1", "score": "0.6127758", "text": "function GetItems(clave){\r\n return localStorage.getItem(clave);\r\n}", "title": "" }, { "docid": "080147016332a8b2fbd342955019fb23", "score": "0.6121186", "text": "function getFromLs(){\n if(localStorage.getItem('tasks')===null){\n tasks=[];\n }else{\n tasks=JSON.parse(localStorage.getItem('tasks'));\n }\n return tasks;// Bir array gonderir\n}", "title": "" }, { "docid": "3ae232290dc83f02310a09b7c2253261", "score": "0.6110689", "text": "read() {\n var entries = new Array();\n chrome.storage.sync.get(null, function (result) {\n for (var key in result) {\n entries.push(new RssEntry(key, result[key]));\n console.log(\"Reading site in ChromeStorage: \" + key + \" - \" + result[key]);\n }\n });\n return entries;\n }", "title": "" }, { "docid": "dcf2073c624ef1c7a7af1976bed124fe", "score": "0.6108538", "text": "function retrievePetArray() {\n\treturn JSON.parse(localStorage.getItem('allPets'));\n} // end retrievePetArray()", "title": "" }, { "docid": "99d4265e69a4cff05cafa9e93bc10425", "score": "0.6106005", "text": "function loadFavorites() {\n var parsedFavorites = JSON.parse( localStorage.getItem('favoritesArray') );\n if (parsedFavorites) {\n for (let i = 0; i < parsedFavorites.length; i++){\n favoriteAdd(parsedFavorites[i]);\n }\n }\n\n}", "title": "" }, { "docid": "fdcbe6fa5f0e90f2e11916bcf75aba3f", "score": "0.6100847", "text": "function getFromMemory() {\n\tfor (var i = 0; i < 10; i++) {\n\t\tnames[i] = localStorage.getItem(\"name\" + i);\n\t\tscores[i] = localStorage.getItem(\"scores\" + i);\n\t}\n}", "title": "" }, { "docid": "c863f59e9afb05e191d195b739bd1da7", "score": "0.60946566", "text": "function searchTermSaved(searchText){\n if(searchText==null){\n console.log(\"There are no saved Words\");\n\n }else{\n var searchedTerm;\n\n if(localStorage.getItem(\"searchedTerm\")==null){\n searchedTerm = [];\n }else{\n searchedTerm = JSON.parse(localStorage.getItem(\"searchedTerm\"));\n }\n\n searchedTerm.push(searchText);\n \n console.log(searchText);\n \n localStorage.setItem(\"searchedTerm\", JSON.stringify(searchedTerm));\n showSavedTerms(searchedTerm);\n\n }\n}", "title": "" }, { "docid": "f88eecf566eebafe1ad0618cb650b08e", "score": "0.6091168", "text": "function loadLocalStorage(){\n var localStorageItems = JSON.parse(localStorage.getItem('selected potatoes'));\n return localStorageItems;\n}", "title": "" }, { "docid": "4f4edb1ec86b008b4a8bed029ff387e1", "score": "0.608925", "text": "function lsContent() {\n let localStorageLenght = localStorage.length;\n let localStorageContent = new Array;\n\n for (let i = 0; i < localStorageLenght; i++) {\n let JSONparse = JSON.parse(localStorage.getItem('User' + i));\n localStorageContent.push(JSONparse);\n }\n return localStorageContent;\n}", "title": "" }, { "docid": "e785b664e14ddd62014c0c021777f2c0", "score": "0.6086666", "text": "function getFavs(){\n let favsFromStorage = localStorage.getItem('movie-app-favs');\n if(favsFromStorage === null){\n favsFromStorage = [];\n }else{\n favsFromStorage = JSON.parse(favsFromStorage);\n }\n return favsFromStorage;\n}", "title": "" }, { "docid": "3742a72ef379809c98ed9f44455f9b42", "score": "0.60779595", "text": "function putResultsInStorage(){\n let resultsArrayString = JSON.stringify(Product.allProducts);\n localStorage.setItem('results', resultsArrayString);\n}", "title": "" }, { "docid": "a4753a63250c763ef00a8f9ac6635531", "score": "0.607158", "text": "function storageToArray()\n{\n var jsonDataArray = [];\n var songData;\n\n store.forEach(function(key, val)\n {\n if (key.indexOf(prefix) !== 0) {\n // do nothing\n } else\n {\n // val = store.get(key); // should be done already\n songData = store.get(key);\n jsonDataArray[parseInt(songData.songPosition, 10)] = songData;\n }\n });\n return jsonDataArray;\n}", "title": "" }, { "docid": "718ff5289a07b23f675468bca94f3521", "score": "0.60673964", "text": "function getSavedSongs() {\n return getStoreArray(\"playlist\");\n }", "title": "" }, { "docid": "4573a908bb54d2a389bf1e693b4b709c", "score": "0.60629886", "text": "function loadSavedSearchTerm() {\n $history.empty();\n let temp = localStorage.getItem('searchHistory');\n if(temp) {\n savedSearchTerm = JSON.parse(temp);\n }\n for(let history of savedSearchTerm) {\n $history.append($(`<li class=\"list-group-item\">${history}</li>`));\n }\n}", "title": "" }, { "docid": "fc673bef6df807fee36500c122dc4607", "score": "0.6060723", "text": "function getmyFavsObject(){\n\t//Set runs array\n\tvar myFavs= new Array();\n\t//Get current runs from localStorage\n\tvar myCurrentFavs = localStorage.getItem('myFavs');\n\n\t//Check localStorage\n\tif(myCurrentFavs != null){\n\t\tvar myFavs = JSON.parse(myCurrentFavs);\n\t}\n\t//Return runs object\n\treturn myFavs;\n}", "title": "" }, { "docid": "720362dc95a469f00b96f85f4c69246c", "score": "0.6055424", "text": "function readLocalStorage() {\n var storedTasksString = localStorage.getItem(\"StoredTasks\");\n var storedTasks = [\n { task: \"\" },\n { task: \"\" },\n { task: \"\" },\n { task: \"\" },\n { task: \"\" },\n { task: \"\" },\n { task: \"\" },\n { task: \"\" },\n { task: \"\" },\n ];\n //if there is something in local storage, parse the string of text into an object\n if (storedTasksString !== null) {\n storedTasks = JSON.parse(storedTasksString);\n }\n return storedTasks;\n } //end readLocalStorage() fct def", "title": "" }, { "docid": "2566bfc0a4fcb28bc8360d206104645e", "score": "0.6041001", "text": "function loadLocalStorage()\n{\n if (localStorage.length > 0)\n {\n var localCities = JSON.parse(localStorage.getItem(\"cities\"));\n // inverted loop values to retrive the lastest search to older\n var index =localCities.cities.length -1;\n for (i = index; i >= 0;i--)\n {\n var liEl = document.createElement(\"li\");\n $(liEl).text(localCities.cities[i]);\n $(liEl).attr(\"class\",\"list-group-item\")\n $('.list-group').append(liEl)\n \n }\n search(localCities.cities[index])\n }\n}", "title": "" }, { "docid": "bfafe4f3fefc8980da8f6bb04d11f924", "score": "0.6040278", "text": "function pastArtistSearch() {\n var pastInput = userInput.value.trim();\n searchedArtists.push(pastInput);\n localStorage.setItem('artists', JSON.stringify(searchedArtists));\n lsOutput.textContent = '';\n}", "title": "" }, { "docid": "640320f84ecaa0816a2ba5b55197cf27", "score": "0.6034758", "text": "function arrayBuilder() {\n const termAddedToArray = [...items, {name: searchTerm, url: imageURL}]; \n updateItems(termAddedToArray)\n localStorage.setItem(\"locallySavedItemsArray\", JSON.stringify(termAddedToArray));\n ;}", "title": "" }, { "docid": "98bb096cfba4076a5d04a3978cc2697f", "score": "0.6033921", "text": "function getProductos() {\n arrayProductos = localStorage.getItem(\"Productos\")\n ? JSON.parse(localStorage.getItem(\"Productos\"))\n : []\n}", "title": "" }, { "docid": "baf47a7578a806f4cfb4aeb4c7610892", "score": "0.6029062", "text": "function getStoredLocations() {\n\t// console.log(\"# Getting all stored locations\");\n\n\tvar db = openDatabaseSync(\"AmbientWeather\", \"1.0\", \"AmbientWeather persistent data storage\", 16);\n\n\tdb.transaction(function(tx) {\n\t\ttx.executeSql('CREATE TABLE IF NOT EXISTS locationdata(place_id TEXT, lat TEXT, lon TEXT, display_name TEXT, active TEXT)');\n\t});\n\n\tvar locationDataArray = new Array();\n\tvar locationItem = new Array();\n\n\tdb.transaction(function(tx) {\n\t\tvar rs = tx.executeSql(\"SELECT * FROM locationdata\");\n\t\tif (rs.rows.length > 0) {\n\t\t\tfor ( var i = 0; i < rs.rows.length; i++) {\n\t\t\t\tlocationItem = rs.rows.item(i);\n\t\t\t\tlocationDataArray.push(locationItem);\n\t\t\t\t// console.log(\"# Found location item in db \" + locationItem.display_name);\n\t\t\t}\n\t\t}\n\t});\n\n\treturn locationDataArray;\n}", "title": "" }, { "docid": "a5863bfb78929c5ea05ff5fbf8ba1bef", "score": "0.6012805", "text": "function obtenertweetlocalstorage() {\n\tlet tweets;\n\t// revisamos los valores del local sotage\n\tif (localStorage.getItem('tweets') === null) {\n\t\ttweets = [];\n\t} else {\n\t\ttweets = JSON.parse(localStorage.getItem('tweets'));\n\t}\n\treturn tweets;\n}", "title": "" }, { "docid": "b790e46b0443e53d413dec10a42b6c63", "score": "0.6005963", "text": "function pesquisar(){\n\n var palavra = document.querySelector(\".search\").value.toLowerCase();\n var letras = [];\n var palavra2 = \"\";\n var z = \"\";\n var cont = 0;\n var cont2 = 0;\n\n if (palavra != \"\"){\n\n //requisição no arquivo J\n banco.forEach(function(item){\n\n //colocando as letras no array\n z = item.nome;\n for(var x = 0; x < z.length; x++){\n letras.push(z.substr(x,1));\n }\n\n //concatenando espaço para não dar problema na iteração\n letras.push(\"\");\n\n //loop na palavra\n for (var l = 0; l < letras.length; l++){\n for (var y = l; y <= (letras.length); y++ ){\n if (palavra === palavra2 && cont < 1){\n cont++;\n cont2 ++;\n }\n palavra2 += letras[y];\n }\n\n if (cont > 0){\n l = letras.length;\n }\n\n palavra2 = \"\";\n }\n\n //exibe fora do loop para não ter repetições com as letras iguais na palavra\n if (cont > 0){\n\n window.localStorage.setItem(\"nomeobj\" + cont2 , item.nome);\n window.localStorage.setItem(\"linkobj\" + cont2, item.link);\n window.localStorage.setItem(\"imagemobj\" + cont2, item.imagem);\n }\n\n cont = 0;\n\n //limpa o array\n letras.length = 0;\n })\n window.localStorage.setItem(\"tamanho\" , cont2);\n window.localStorage.setItem(\"tipo\" , \"pesquisa\")\n\n\n }\n\n}", "title": "" }, { "docid": "a5dbbe0b863a148d70026bf797e36e98", "score": "0.59975356", "text": "function getItemsFromStorage() {\n\treturn JSON.parse(localStorage.getItem('budgetItems'));\n}", "title": "" }, { "docid": "9a22f3b2d454a69e8de2791ba8221647", "score": "0.5988766", "text": "function $arrFfromLocalStorage(){\n var renderArray=[];\n\n var myCounter=0;\n // TODO: addd information in the array\n for(var key in window.localStorage){\n myCounter++;\n if(myCounter<=window.localStorage.length){\n\n // FIXME:\n // по какому принципу for(var key in window.localStorage) отдает ключи не понятно\n // решаю проблему костылем))) добавлением обьектов из local Storage в массив renderArray=[];\n var returnObjFromLocalStorage=JSON.parse(window.localStorage.getItem(key));\n \n renderArray[parseInt(key)]=returnObjFromLocalStorage;\n \n \n }\n }\n return renderArray;\n }", "title": "" }, { "docid": "0605771eed293faae708dc358077035f", "score": "0.5981664", "text": "function getSearchFromLocalStorage() {\n return localStorage.getItem(LOCAL_STORAGE_HISTORY_KEY) || \"\";\n}", "title": "" }, { "docid": "c87f6e3397f9e70ebce7f0f9c54f6c66", "score": "0.59698915", "text": "function getTodosAfterReload () {\n let retrievedTodos = localStorage.getItem(\"todos\");\n let retrievedArrays = JSON.parse(retrievedTodos);\n console.log(retrievedArrays);\n}", "title": "" }, { "docid": "8af4eef92642d853b3a87eb6e925bef5", "score": "0.5963968", "text": "function obtenerTweetsLocalStorage() {\n let tweets;\n \n if(localStorage.getItem('tweets') === null) {\n tweets = [];\n } else {\n tweets = JSON.parse(localStorage.getItem('tweets'));\n }\n \n return tweets;\n \n}", "title": "" }, { "docid": "08c2a84da6e9ad604e1106367f6ce831", "score": "0.59622675", "text": "function obtenerTweetsLocalStorage() {\n let tweets;\n //revisamos los valores de locar storage\n if (localStorage.getItem(\"tweets\") == null) {\n tweets = [];\n } else {\n tweets = JSON.parse(localStorage.getItem(\"tweets\"));\n }\n return tweets;\n}", "title": "" }, { "docid": "a0f2924958948167e667d5a81e9eb5b7", "score": "0.59615153", "text": "function obtenerTweetsLocalStorage() {\n let tweets;\n // review values in the local Storage\n if(localStorage.getItem('tweets') === null) {\n tweets = []; \n } else {\n tweets = JSON.parse(localStorage.getItem('tweets') );\n }\n return tweets;\n}", "title": "" }, { "docid": "7ee8749f41f0c3b6fdad95d79667b36c", "score": "0.595031", "text": "function getRecipeList() {\n var searchInputTxt = document.getElementById(\"user-ingredient\").value.trim();\n // add to array, for local storage purposes\n previousSearches.push(searchInputTxt);\n // make an array with local storage, user search history\n // searches=key value=array\n localStorage.setItem(\"searches\", JSON.stringify(previousSearches));\n fetch(\n // use one as the api key\n // fetch this call\n `https://www.themealdb.com/api/json/v1/1/filter.php?i=${searchInputTxt}`\n )\n // use arrow function, replace traditional function\n .then((results) => results.json())\n .then((data) => {\n var html = \"\";\n if (data.meals) {\n data.meals.forEach((meal) => {\n // display recipe image when searching by ingredient\n html += `\n <div class = \"recipe-item\" data-id = \"${meal.idMeal}\">\n <div class = \"recipe-img\">\n <img src = \"${meal.strMealThumb}\" alt = \"food\">\n </div>\n <div class = \"recipe-title\">\n <h3>${meal.strMeal}</h3>\n <a href = \"\" class = \"recipe-btn\">View Details</a>\n </div>\n </div>\n `;\n });\n console.log(meal);\n instructions.classList.remove(\"notFound\");\n } else {\n html = \"Couldn't find any recipes. Try again.\";\n instructions.classList.add(\"notFound\");\n }\n instructions.innerHTML = html;\n });\n}", "title": "" }, { "docid": "53b4ad57482f0939d2f02f207b898570", "score": "0.5949314", "text": "static getBooks() {\n // check if books is already in local storage\n let books;\n if(localStorage.getItem('books') === null){\n // if not create a new empty array for books\n books = [];\n } else {\n // if exist get current array\n books = JSON.parse(localStorage.getItem('books'));\n };\n // return whatever is in books\n return books;\n }", "title": "" }, { "docid": "7ebdfd7a42ccdfeb2e545b1d83966963", "score": "0.5948384", "text": "function getDataByName(name) {\n if (dbPromise) {\n dbPromise\n .then(function(db) {\n console.log(\"fetching: \" + event);\n var tx = db.transaction(db.objectStoreNames);\n var store = tx.objectStore(MANIFEST_STORE_NAME);\n var index = store.index(\"name\");\n console.log(name);\n return index.getAll(IDBKeyRange.only(name));\n })\n .then(function(readingsList) {\n if (readingsList && readingsList.length > 0) {\n var max;\n for (var elem of readingsList)\n addToSearch(readingsList);\n } else {\n const value = localStorage.getItem(event);\n console.log(readingsList);\n console.log(value);\n if (value != null) {\n addToSearch(value);\n }\n }\n });\n }\n}", "title": "" }, { "docid": "42e0db2c3bb94b062477f1d106cd6164", "score": "0.59463036", "text": "getAllByKeyValue(key, value) {\n let savedData = (this.localStorageGet() !== null) ? this.localStorageGet() : [];\n let result = [];\n\n for (let i = 0; i < savedData.length; i++) {\n if (savedData[i][key] === value) {\n result.push(savedData[i]);\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "ef84bbdac7bcf8c88b01e091571a18fd", "score": "0.59342057", "text": "function fetchTrainer(){\n var subject=''\n subject=document.getElementById('tChooseSubjects').value\n var row=[];\n row= Object.keys(localStorage); \n let TrainerArray = []\n if(localStorage.length > 0 ){\n Object.keys(localStorage)\n .forEach((key)=>{\n Items=JSON.parse(localStorage.getItem(key))\n if(Items.tsubject==subject){\n TrainerArray.push(JSON.parse(localStorage.getItem(key)).tName);\n }\n }) \n}\nconsole.log(TrainerArray);\ndocument.getElementById('tChooseSubjects').value=\"\"\ndocument.getElementById(\"output\").innerHTML = TrainerArray;\n}", "title": "" }, { "docid": "35a2719cafa7b1d1e896c18068e66d6b", "score": "0.5932445", "text": "function storeSong() {\n localStorage.setItem(\"searchSong\", JSON.stringify(songSearches));\n getSongHistory();\n}", "title": "" }, { "docid": "3a98d74137c2f14f93725388a6544d79", "score": "0.59315926", "text": "function getResults() {\n // want to loop through the local storage and apply the values to each td\n\n let results;\n if (localStorage.getItem(\"results\") === null) {\n results = [];\n } else {\n results = JSON.parse(localStorage.getItem(\"results\"));\n\n // loop through the results array taken from local storage\n for (let h = 0; h <= results.length; h++) {\n // counter variable for while loop\n let i = 0;\n let rows = [];\n\n // create tr element to hold tds for row values\n const tr = document.createElement(\"tr\");\n resultsTable.appendChild(tr);\n\n // use while loop and shift() to repeatedly push the first three result values into empty rows array\n while (i < 3) {\n rows.push(results.shift());\n i++;\n }\n\n // create a td inside the above tr for every value in rows (so three tds per tr)\n for (let k = 0; k < rows.length; k++) {\n let td = document.createElement(\"td\");\n td.innerText = rows[k];\n tr.appendChild(td);\n }\n\n // set counter variable back to 0 and empty rows array\n i = 0;\n rows = [];\n }\n }\n }", "title": "" }, { "docid": "fd361ee904f1f6dbd1b86b7dd7edf083", "score": "0.59261626", "text": "function obtenerTweetsLocalStorage() {\n let tweets;\n // Revisamos los valoes de local storage\n if(localStorage.getItem('tweets') === null) {\n tweets = []; \n } else {\n tweets = JSON.parse(localStorage.getItem('tweets') );\n }\n return tweets;\n}", "title": "" }, { "docid": "c9a66ed5d417bf4176c9f13477d6cbd0", "score": "0.59246624", "text": "function getDataFromLS() {\n let result = JSON.parse(localStorage.getItem(\"food\"));\n\n if (result != null) {\n FoodArray = [];\n FoodArray = result;\n }\n setDataInLS()\n}", "title": "" }, { "docid": "c82e8ca8e60a1f6ae72f05fb19c22fbb", "score": "0.59228194", "text": "get_data_from_localstorage() {\n let customers = JSON.parse(localStorage.getItem('customers'))\n return customers || []\n }", "title": "" }, { "docid": "afa6e7f84c3e425e4f2182e3dc6d4c12", "score": "0.5918713", "text": "function retrieveSearchHistory(){\n\n citySearch = JSON.parse(localStorage.getItem(\"citySearch\"));\n\n if(citySearch === null)\n {\n citySearch = [];\n }\n else{\n \n $(\"#city-search-section-output\").html('');\n\n citySearch.forEach(element => {\n\n $(\"#city-search-section-output\").append(\n `<div class=\"d-grid gap-2 city-search-hist\"><button class=\"btn btn-secondary btn-lg\" type=\"button\" id=\"city-hist-btn\" data-city-search=\"${element}\">${element}</button></div>`\n );\n \n }); \n\n }\n \n}", "title": "" }, { "docid": "eeee588bf526cc20ccb2446bb544cc95", "score": "0.5908612", "text": "function obtenerTweetsLocalStorage(){\n let tweets;\n // Revisamos los valores de local storage\n if(localStorage.getItem('tweets') === null) {\n tweets = [];\n } else {\n tweets = JSON.parse(localStorage.getItem('tweets'));\n } \n return tweets;\n}", "title": "" }, { "docid": "30d0536873e5722d807d2ca45b3acd9b", "score": "0.5908271", "text": "function allStorage () {\n basketData = []\n keys = Object.keys(localStorage),\n i = keys.length;\n\n while (i--) {\n basketData.push(localStorage.getItem(keys[i]));\n }\n\n return basketData;\n}", "title": "" }, { "docid": "df718919a6778014365d622b9736ac51", "score": "0.5904369", "text": "function obtenerTweetsLocalStorage(){\n let tweets;\n //revisamos los valores de local storage\n if (localStorage.getItem('tweets')=== null){\n tweets = [];\n }else{\n tweets = JSON.parse(localStorage.getItem('tweets'));\n }\n return tweets;\n}", "title": "" }, { "docid": "6e82d4d2b0f664b62b87dc5afda4e54c", "score": "0.5896582", "text": "function obtenerTweetsLocalStorage() {\r\n let tweets;\r\n //revisamos localstorage\r\n if (localStorage.getItem('tweets') === null) \r\n tweets = [];\r\n else\r\n tweets = JSON.parse(localStorage.getItem('tweets'));\r\n return tweets;\r\n}", "title": "" }, { "docid": "8d586e07a33e84f9f2a88fa84c4b1a46", "score": "0.58954096", "text": "function cargarListado() {\n let cargarDatos = JSON.parse(localStorage.getItem(\"cargarDatos\"));\n if (cargarDatos == null) {\n return [];\n }\n return cargarDatos;\n // realizar operador ternario\n}", "title": "" }, { "docid": "b5f2ddc1f7d901481de2848e02b6139a", "score": "0.5894257", "text": "recuperarTodosRegistros() {\n\n //Array de despesas\n\n let despesas = Array()\n\n let id = localStorage.getItem('id')\n //Recuperando todas as despesas em local Storage\n for (let i = 1; i <= id; i++) {\n\n //Recuperando a despesa\n let despesa = JSON.parse(localStorage.getItem(i))\n\n //Pular despesas null\n if (despesa === null) {\n continue\n }\n\n despesa.id = i // Criando id como novo atributo para que possamos usa-lo para exclui o elemento do StorageWeb\n despesas.push(despesa) // Puxa o array despesas para conter todas as 'despesa'\n }\n return despesas\n }", "title": "" }, { "docid": "a52920edf4a8248111c6b312406f1e0f", "score": "0.58918405", "text": "function retrieveUsers() {\n const users = JSON.parse(localStorage.getItem(\"users\"));\n return users;\n }", "title": "" }, { "docid": "06caea520dc4431e85e3374fdf055be7", "score": "0.5889945", "text": "function getContacts() {\n\tvar contacts = localStorage.contacts;\n\tif (contacts) {\n\t\treturn JSON.parse(contacts);\n\t} else {\n\t\treturn [];\n\t}\n}", "title": "" }, { "docid": "bc58bedcfef9ea3a8bdabc6b1f6c96d7", "score": "0.58821833", "text": "function loadWeatherSearches() {\n locSearchHistory = localStorage.getItem(\"SearchHistory\");\n if (localStorage.getItem(\"SearchHistory\") === null || locSearchHistory.length < 1) {\n searchHistory = [];\n } else {\n searchHistory = JSON.parse(locSearchHistory);\n };\n locLastSearch = localStorage.getItem(\"LastSearch\");\n if (localStorage.getItem(\"LastSearch\") ===null) {\n locLastSearch = \"London\";\n }\n }", "title": "" }, { "docid": "c7b0dc92985732391c2b0e7871f89275", "score": "0.58775645", "text": "function getAllData(){\n var allData = JSON.parse(localStorage.getItem('ChristmasMovies'));\n console.log(allData);\n return allData;\n}", "title": "" }, { "docid": "bd6b15fc3236a56ffa5fabcea204bb1b", "score": "0.5875016", "text": "function getBooks(){\n\tif(localStorage.getItem('books') === null){\n\t\tvar books = [];\n\t}else{\n\t\tbooks = JSON.parse(localStorage.getItem('books'));\n\t}\n\treturn books;\n\tconsole.log('getBooks');\n}", "title": "" }, { "docid": "9fa79b2f1adcd48b5114168ca69b7982", "score": "0.58675724", "text": "function lsCities() {\n localStorage.setItem('searchedCities', JSON.stringify(searchedCities));\n}", "title": "" }, { "docid": "1db81b135cc19bd5b375d8855426587a", "score": "0.5864195", "text": "static getBooks() {\n\t\tlet books;\n\t\t//if there are no books in the ls, return an empty array\n\t\tif (localStorage.getItem('books') === null) {\n\t\t\tbooks = [];\n\t\t} else {\n\t\t\t//read the JSOM object and translate it into an array of object\n\t\t\tbooks = JSON.parse(localStorage.getItem('books'));\n\t\t\tbooks.sort((book1, book2) => {\n\t\t\t\tif (book1.title < book2.title) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn books;\n\t}", "title": "" }, { "docid": "520212073923a1d6083c4b19949e6774", "score": "0.58639306", "text": "getFavorites(){\n return AsyncStorage.getItem(FAV_KEY).then(values => JSON.parse(values));\n }", "title": "" }, { "docid": "a9400b853ad78365bd244a360fcfa620", "score": "0.5861267", "text": "function readStorageObjects() {\n let local_storage_objects = [];\n if (window.localStorage) {\n for (let index = 0; index < 6; index++) {\n let objectValue = window.localStorage.getItem(\"object-\" + index);\n if (objectValue !== null) {\n local_storage_objects.push(JSON.parse(objectValue));\n }\n }\n }\n return local_storage_objects;\n }", "title": "" }, { "docid": "c115f45af2a75a220639eefcd51173ba", "score": "0.58566904", "text": "function gettingItems() {\n let data = localStorage.getItem('phones');\n let parsPhone = JSON.parse(data);\n\n if (parsPhone) {\n for (let i = 0; i < parsPhone.length; i++) {\n new Phone(parsPhone[i].userName, parsPhone[i].phoneType);\n }\n }\n}", "title": "" }, { "docid": "11f839f75e68ce72c83a893ca6f725ec", "score": "0.58561355", "text": "function getUsers() {\n\n if (localStorage.players === undefined)\n return [];\n else\n return JSON.parse(localStorage.players);\n\n\n}", "title": "" }, { "docid": "6b0de72287141320217bceb69ce4f329", "score": "0.58549535", "text": "function allStorageValues() {\r\n\t\tvar values = [],\r\n\t\t\tkeys = Object.keys(localStorage),\r\n\t\t\ti = keys.length;\r\n\t\twhile ( i-- ) {\r\n\t\t\tvalues.push( localStorage.getItem(keys[i]) );\r\n\t\t}\r\n\r\n\t\treturn values;\r\n\t}", "title": "" }, { "docid": "2103d67c2a9262755d841b12020f37de", "score": "0.58527213", "text": "static getBooks() {\r\n //local variable\r\n let books;\r\n if(localStorage.getItem('books') === null) {\r\n //books equals empty array\r\n books = [];\r\n } else {\r\n //need JS object so JSON.parse\r\n books = JSON.parse(localStorage.getItem('books'));\r\n }\r\n\r\n //simple return from local storage\r\n return books;\r\n }", "title": "" }, { "docid": "533a49a353f150565e4d108fa8d84b75", "score": "0.5852592", "text": "search_entries() {\n if (this.search === null) return store.state.entries;\n\n return store.state.entries.filter(e => e.name.includes(this.search));\n }", "title": "" }, { "docid": "f26d3f48fc1c59a5924d152a61e3aaff", "score": "0.5850883", "text": "function getTweetsLocalStorage() {\n let tweets;\n // Revisamos los valoes de local storage\n if (localStorage.getItem('tweets') === null) {\n tweets = [];\n } else {\n tweets = JSON.parse(localStorage.getItem('tweets'));\n }\n return tweets;\n}", "title": "" }, { "docid": "4e873b81dddd0913647b8ed5199d2ffc", "score": "0.58375466", "text": "function getFromLS() {\n let products;\n if (localStorage.getItem('products')) {\n products = JSON.parse(localStorage.getItem('products'));\n } else {\n products = [];\n }\n return products\n}", "title": "" }, { "docid": "9080b2cbab1a158874d52f8d17c23206", "score": "0.5821275", "text": "function storeHistory() {\n let relevant = recentSearches.map(item => item.loc);\n localStorage.setItem(\"recentSearches\", JSON.stringify(relevant));\n }", "title": "" }, { "docid": "bd96afe0937e5b2bbf2228d0df54ba8c", "score": "0.5818535", "text": "function loadListaReservasInd() {\n var lista = localStorage.getItem('listaReservasInd');\n if (lista == null) {\n return [];\n }\n else {\n return JSON.parse(lista);\n }\n }", "title": "" }, { "docid": "ce3eb9c1d35a966b4c79b43f3c13ba0e", "score": "0.581845", "text": "function loadFavoritosLs() {\n let favoritosGifs = JSON.parse(localStorage.getItem(\"misFavoritos\"));\n if (favoritosGifs) {\n arrayFavoritos = favoritosGifs;\n }\n}", "title": "" }, { "docid": "0a9d74889abd535124f95be0cdd4dab2", "score": "0.5800628", "text": "function getItems(page, eatery, notifs) {\n\tvar fields = ['food','notifs'];\n chrome.storage.local.get(fields, function(res) {\n \tif (res.food) {\n \t\tfoods = res.food.split(\",\");\n \t} else {\n \t\tfoods = [\"chicken\",\"pancakes\"];\n \t}\n \tfor (var i = 0; i < foods.length; i++) {\n \t\tfoods[i] = foods[i].trim();\n \t}\n \tif (res.notifs == \"off\") {\n \t\tnotifs = false;\n \t}\n \tcheckItem(page, foods, eatery, notifs);\n\t});\n}", "title": "" }, { "docid": "f1ed922b4db08b6595c618c22db143f6", "score": "0.580044", "text": "get_data_from_localstorage() {\n let submissions = JSON.parse(localStorage.getItem('submissions'))\n return submissions || []\n }", "title": "" }, { "docid": "444100a7e39fcae089c40e8860ae5bbd", "score": "0.57983226", "text": "function getDataFromStorage() {\n let cities = [];\n const getCity = localStorage.getItem('City');\n if (getCity) cities = JSON.parse(getCity);\n return cities;\n}", "title": "" } ]
5ef5f01353ec18f3bab0f2bded822426
This is a CompartmentDefinitionResource resource
[ { "docid": "5f55ad462eaafe1bbf7a11b4508581c5", "score": "0.7298268", "text": "static get __resourceType() {\n\t\treturn 'CompartmentDefinitionResource';\n\t}", "title": "" } ]
[ { "docid": "708b2ee9c67068ba28d92d8bc160f50c", "score": "0.5456853", "text": "static get __resourceType() {\n\t\treturn 'OperationDefinition';\n\t}", "title": "" }, { "docid": "e2bb0fc69255ab86fc3160b528479487", "score": "0.50664157", "text": "function CeInfoResource() {\n this.id = '';\n this.trigger = '';\n this.type = '';\n this.number = '';\n }", "title": "" }, { "docid": "267eb308f7c88b9d6153dfa2ea603e62", "score": "0.4970271", "text": "get definition () {\n\t\treturn this._definition;\n\t}", "title": "" }, { "docid": "267eb308f7c88b9d6153dfa2ea603e62", "score": "0.4970271", "text": "get definition () {\n\t\treturn this._definition;\n\t}", "title": "" }, { "docid": "0bc14e7e4d737e275c99eb1cdcaef510", "score": "0.49658614", "text": "static get __resourceType() {\n\t\treturn 'ElementDefinition';\n\t}", "title": "" }, { "docid": "abb839c0aa8410dbbcc849d36e4f686a", "score": "0.49608168", "text": "function ResourceDef(name, transaction)\n {\n this.name = name;\n this.transaction = transaction;\n }", "title": "" }, { "docid": "522e031229621d55ca860028d7485d3a", "score": "0.49554467", "text": "created() {\n // TODO définir ici ce qu'on fait\n\t\tif (Array.isArray(this.settings.resources)) {\n const definitions = this.settings.resources.map(resource => {\n const schemas = resource.definition.components.schemas;\n const entityName = resource.definition.info.title;\n const version = resource.definition.info.version;\n const isDefault = resource.default || false;\n const modelCallbacks = resource.modelCallbacks;\n\n const dataModels = Object.keys(schemas)\n .map(key => this.createDataModel(key, schemas[key], null))\n .reduce((acc, model) => Object.assign(acc, model), {});\n const paths = resource.definition.paths;\n const {actions, entityHydrator} = Object.keys(paths)\n .map(key => this.createActions(entityName, paths[key], resource.definition.info, key))\n .reduce((acc, action) => {\n if (action.entityHydrator) {\n acc.entityHydrator = action.entityHydrator;\n delete action.entityHydrator;\n }\n return {\n ...acc,\n actions: Object.assign(acc.actions, action)\n }\n }, {\n actions: {},\n entityHydrator: null\n });\n actions[\"open-api\"] = () => resource;\n if (entityHydrator) {\n dataModels.entityHydrator = entityHydrator;\n }\n const graphQlResolvers = this.createGraphQLResolvers(paths);\n const graphQlType = this.createGraphQLTypeDefinition(schemas, graphQlResolvers);\n const graphQlDef = {\n type: graphQlType.type,\n input: graphQlType.input,\n }\n if (graphQlType.entity.length > 0) {\n graphQlDef.resolvers = {[graphQlType.entity]: graphQlResolvers}\n }\n\n const basePath = this.minimalPath(Object.keys(paths))\n const routes = this.routesDefinition(entityName, paths, basePath, version);\n const newServiceDef = this.createService(\n entityName,\n version,\n actions,\n dataModels,\n schemas,\n routes,\n graphQlDef,\n isDefault,\n resource,\n );\n const newService = this.broker.createService(newServiceDef);\n \tthis.logger.info(`[OPEN-API] New Data-centric api for ${entityName}`);\n\n return newService;\n });\n }\n }", "title": "" }, { "docid": "2216c7865b6a13f1a5541cf37e9757b9", "score": "0.4878504", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnEnvironment.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_finspace_CfnEnvironmentProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnEnvironment);\n }\n throw error;\n }\n cdk.requireProperty(props, 'name', this);\n this.attrAwsAccountId = cdk.Token.asString(this.getAtt('AwsAccountId', cdk.ResolutionTypeHint.STRING));\n this.attrDedicatedServiceAccountId = cdk.Token.asString(this.getAtt('DedicatedServiceAccountId', cdk.ResolutionTypeHint.STRING));\n this.attrEnvironmentArn = cdk.Token.asString(this.getAtt('EnvironmentArn', cdk.ResolutionTypeHint.STRING));\n this.attrEnvironmentId = cdk.Token.asString(this.getAtt('EnvironmentId', cdk.ResolutionTypeHint.STRING));\n this.attrEnvironmentUrl = cdk.Token.asString(this.getAtt('EnvironmentUrl', cdk.ResolutionTypeHint.STRING));\n this.attrSageMakerStudioDomainUrl = cdk.Token.asString(this.getAtt('SageMakerStudioDomainUrl', cdk.ResolutionTypeHint.STRING));\n this.attrStatus = cdk.Token.asString(this.getAtt('Status', cdk.ResolutionTypeHint.STRING));\n this.name = props.name;\n this.dataBundles = props.dataBundles;\n this.description = props.description;\n this.federationMode = props.federationMode;\n this.federationParameters = props.federationParameters;\n this.kmsKeyId = props.kmsKeyId;\n this.superuserParameters = props.superuserParameters;\n }", "title": "" }, { "docid": "818b6d387baabcd30edcc2362df37c48", "score": "0.4852721", "text": "static get __resourceType() {\n\t\treturn 'StructureDefinition';\n\t}", "title": "" }, { "docid": "08c991b5e575d788d35693bbeca22cc2", "score": "0.48525125", "text": "function getComponentDef(Ctor) {\n var def = getComponentInternalDef(Ctor); // From the internal def object, we need to extract the info that is useful\n // for some external services, e.g.: Locker Service, usually, all they care\n // is about the shape of the constructor, the internals of it are not relevant\n // because they don't have a way to mess with that.\n\n var ctor = def.ctor,\n name = def.name,\n props = def.props,\n propsConfig = def.propsConfig,\n methods = def.methods;\n var publicProps = {};\n\n for (var key in props) {\n // avoid leaking the reference to the public props descriptors\n publicProps[key] = {\n config: propsConfig[key] || 0,\n type: \"any\"\n /* any */\n ,\n attr: htmlPropertyToAttribute(key)\n };\n }\n\n var publicMethods = {};\n\n for (var _key2 in methods) {\n // avoid leaking the reference to the public method descriptors\n publicMethods[_key2] = methods[_key2].value;\n }\n\n return {\n ctor: ctor,\n name: name,\n props: publicProps,\n methods: publicMethods\n };\n }", "title": "" }, { "docid": "14fbf2dd9067d8f3fa328a2b73abcb8e", "score": "0.48320758", "text": "buildResource() {\n // VCN\n const vcn_id = this.createInput('select', 'Virtual Cloud Network', `${this.id}_vcn_id`, '', (d, i, n) => this.resource.vcn_id = n[i].value)\n this.vcn_id = vcn_id.input\n this.append(this.core_tbody, vcn_id.row)\n // Kubernetes Version\n const kubernetes_version = this.createInput('select', 'Kubernetes Version', `${this.id}_kubernetes_version`, '', (d, i, n) => this.resource.kubernetes_version = n[i].value)\n this.kubernetes_version = kubernetes_version.input\n this.append(this.core_tbody, kubernetes_version.row)\n // Cluster Type\n // const type_data = {options: {BASIC_CLUSTER: 'Basic', ENHANCED_CLUSTER: 'Enhanced'}}\n const type_data = {options: {BASIC_CLUSTER: 'Basic'}}\n const type = this.createInput('select', 'Cluster Type', `${this.id}_type`, '', (d, i, n) => {this.resource.type = n[i].value; this.handleTypeChange(n[i].value)}, type_data)\n this.type = type.input\n this.append(this.core_tbody, type.row)\n // Node Pool Type\n const node_pool_type_data = {options: {Virtual: 'Virtual Nodes', Managed: 'Managed Nodes'}}\n const node_pool_type = this.createInput('select', 'Node Pool Type', `${this.id}_node_pool_type`, '', (d, i, n) => this.resource.node_pool_type = n[i].value, node_pool_type_data)\n this.node_pool_type = node_pool_type.input\n this.node_pool_type_row = node_pool_type.row\n this.append(this.core_tbody, node_pool_type.row)\n\n // Kubernetes Options\n const options_details = this.createDetailsSection('Kubernetes Options', `${this.id}_options_details`)\n this.append(this.properties_contents, options_details.details)\n this.options_div = options_details.div\n const options_table = this.createTable('', `${this.id}_options_table`)\n this.options_tbody = options_table.tbody\n this.append(this.options_div, options_table.table)\n // Kubernetes Dashboard Enabled\n const is_kubernetes_dashboard_enabled = this.createInput('checkbox', 'Kubernetes Dashboard', `${this.id}_is_kubernetes_dashboard_enabled`, '', (d, i, n) => {this.resource.options.add_ons.is_kubernetes_dashboard_enabled = n[i].checked})\n this.is_kubernetes_dashboard_enabled = is_kubernetes_dashboard_enabled.input\n this.append(this.options_tbody, is_kubernetes_dashboard_enabled.row)\n // Tiller Enabled\n const is_tiller_enabled = this.createInput('checkbox', 'Tiller', `${this.id}_is_tiller_enabled`, '', (d, i, n) => {this.resource.options.add_ons.is_tiller_enabled = n[i].checked})\n this.is_tiller_enabled = is_tiller_enabled.input\n this.append(this.options_tbody, is_tiller_enabled.row)\n // Pod Security\n const is_pod_security_policy_enabled = this.createInput('checkbox', 'Pod Security', `${this.id}_is_pod_security_policy_enabled`, '', (d, i, n) => {this.resource.options.admission_controller_options.is_pod_security_policy_enabled = n[i].checked})\n this.is_pod_security_policy_enabled = is_pod_security_policy_enabled.input\n this.append(this.options_tbody, is_pod_security_policy_enabled.row)\n\n // Kubernetes Networking\n const network_details = this.createDetailsSection('Kubernetes Networking', `${this.id}_network_details`)\n this.append(this.properties_contents, network_details.details)\n this.network_div = network_details.div\n const network_table = this.createTable('', `${this.id}_network_table`)\n this.network_tbody = network_table.tbody\n this.append(this.network_div, network_table.table)\n // Service CIDR Block\n const services_cidr = this.createInput('ipv4_cidr', 'Service CIDR', `${this.id}_services_cidr`, '', (d, i, n) => {n[i].reportValidity(); this.resource.options.kubernetes_network_config.services_cidr = n[i].value; this.redraw()})\n this.services_cidr = services_cidr.input\n this.append(this.network_tbody, services_cidr.row)\n // Pods CIDR Block\n const pods_cidr = this.createInput('ipv4_cidr', 'Pods CIDR', `${this.id}_pods_cidr`, '', (d, i, n) => {n[i].reportValidity(); this.resource.options.kubernetes_network_config.pods_cidr = n[i].value; this.redraw()})\n this.pods_cidr = pods_cidr.input\n this.append(this.network_tbody, pods_cidr.row)\n // Service Loadbalancer Subnets\n const service_lb_subnet_ids = this.createInput('select', 'Service Loadbalancer Regional Subnet', `${this.id}_service_lb_subnet_ids`, '', (d, i, n) => this.resource.options.service_lb_subnet_ids = [n[i].value])\n this.service_lb_subnet_ids = service_lb_subnet_ids.input\n this.append(this.network_tbody, service_lb_subnet_ids.row)\n\n // Kubernetes Endpoint\n const endpoint_details = this.createDetailsSection('Kubernetes Endpoint', `${this.id}_endpoint_details`)\n this.append(this.properties_contents, endpoint_details.details)\n this.endpoint_div = endpoint_details.div\n const endpoint_table = this.createTable('', `${this.id}_endpoint_table`)\n this.endpoint_tbody = endpoint_table.tbody\n this.append(this.endpoint_div, endpoint_table.table)\n // Subnet\n const subnet_id = this.createInput('select', 'Subnet', `${this.id}_subnet_id`, '', (d, i, n) => this.resource.endpoint_config.subnet_id = n[i].value)\n this.append(this.endpoint_tbody, subnet_id.row)\n this.subnet_id = subnet_id.input\n // Public IP\n const is_public_ip_enabled = this.createInput('checkbox', 'Public IP', `${this.id}_is_public_ip_enabled`, '', (d, i, n) => {this.resource.endpoint_config.is_public_ip_enabled = n[i].checked})\n this.is_public_ip_enabled = is_public_ip_enabled.input\n this.append(this.endpoint_tbody, is_public_ip_enabled.row)\n // NSG Lists\n const nsg_ids = this.createInput('multiselect', 'Network Security Groups', `${this.id}_nsg_ids`, '', (d, i, n) => this.resource.endpoint_config.nsg_ids = Array.from(n[i].querySelectorAll('input[type=\"checkbox\"]:checked')).map((n) => n.value))\n this.nsg_ids = nsg_ids.input\n this.append(this.endpoint_tbody, nsg_ids.row)\n }", "title": "" }, { "docid": "adb5e33dd9b477f5063070c17215f788", "score": "0.47012797", "text": "get definition() {\n\t\treturn this.__definition;\n\t}", "title": "" }, { "docid": "adb5e33dd9b477f5063070c17215f788", "score": "0.47012797", "text": "get definition() {\n\t\treturn this.__definition;\n\t}", "title": "" }, { "docid": "adb5e33dd9b477f5063070c17215f788", "score": "0.47012797", "text": "get definition() {\n\t\treturn this.__definition;\n\t}", "title": "" }, { "docid": "cf08b2ce8dad929af58f53c208b44b83", "score": "0.4682342", "text": "function CeDocComponent() {\n this.isExpand = true;\n this.heighSet = false;\n }", "title": "" }, { "docid": "a40cf4d8d66870f39b30e43d3bc575b6", "score": "0.46544722", "text": "buildResource() {\n // Description\n const description = this.createInput('text', 'Description', `${this.id}_description`, '', (d, i, n) => this.resource.description = n[i].value)\n this.description = description.input\n this.append(this.core_tbody, description.row)\n // Capacity Type\n const capacity_type = this.createInput('select', 'Capacity Type', `${this.id}_capacity_type`, '', (d, i, n) => this.resource.capacity.capacity_type = n[i].value)\n this.capacity_type = capacity_type.input\n this.append(this.core_tbody, capacity_type.row)\n // Capacity Value\n const cv_data = {min: 1}\n const capacity_value = this.createInput('number', 'Capacity Value', `${this.id}_capacity_value`, '', (d, i, n) => this.resource.capacity.capacity_value = n[i].value, cv_data)\n this.capacity_value = capacity_value.input\n this.append(this.core_tbody, capacity_value.row)\n // Feature Set\n const feature_set = this.createInput('select', 'Feature Set', `${this.id}_feature_set`, '', (d, i, n) => this.resource.feature_set = n[i].value)\n this.feature_set = feature_set.input\n this.append(this.core_tbody, feature_set.row)\n // License Type\n const license_type = this.createInput('select', 'License Type', `${this.id}_license_type`, '', (d, i, n) => this.resource.license_type = n[i].value)\n this.license_type = license_type.input\n this.append(this.core_tbody, license_type.row)\n // IDCS Access Token\n const idcs_access_token = this.createInput('text', 'IDCS Access Token', `${this.id}_idcs_access_token`, '', (d, i, n) => this.resource.idcs_access_token = n[i].value)\n this.idcs_access_token = idcs_access_token.input\n this.append(this.core_tbody, idcs_access_token.row)\n // Notification Email\n const email_notification = this.createInput('email', 'Notification Email', `${this.id}_email_notification`, '', (d, i, n) => this.resource.email_notification = n[i].value)\n this.email_notification = email_notification.input\n this.append(this.core_tbody, email_notification.row)\n // Optional Properties\n const optional_network_details = this.createDetailsSection('Optional Networking', `${this.id}_optional_network_details`)\n this.append(this.properties_contents, optional_network_details.details)\n this.optional_network_div = optional_network_details.div\n const optional_network_table = this.createTable('', `${this.id}_option_network_properties`)\n this.optional_network_tbody = optional_network_table.tbody\n this.append(optional_network_details.div, optional_network_table.table)\n // Network Endpoint Type\n const network_endpoint_type = this.createInput('select', 'Network Endpoint Type', `${this.id}_network_endpoint_type`, '', (d, i, n) => {this.resource.network_endpoint_details.network_endpoint_type = n[i].value;this.handleNetworkTypeChanged()})\n this.network_endpoint_type = network_endpoint_type.input\n this.append(this.optional_network_tbody, network_endpoint_type.row)\n // VCN\n const vcn = this.createInput('select', 'Virtual Cloud Network', `${this.id}_vcn_id`, '', (d, i, n) => {this.resource.network_endpoint_details.vcn_id = n[i].value})\n this.vcn_id = vcn.input\n this.vcn_id_row = vcn.row\n this.append(this.optional_network_tbody, vcn.row)\n // Subnet\n const subnet_id = this.createInput('select', 'Subnet', `${this.id}_subnet_id`, '', (d, i, n) => {this.resource.network_endpoint_details.subnet_id = n[i].value})\n this.subnet_id = subnet_id.input\n this.subnet_id_row = subnet_id.row\n this.append(this.optional_network_tbody, subnet_id.row)\n // Whitelisted IPs\n const whitelisted_ips = this.createInput('ipv4_list', 'Whitelisted IPs', `${this.id}_whitelisted_ips`, '', (d, i, n) => this.resource.whitelisted_ips = n[i].value.replace(' ', '').split(','))\n this.whitelisted_ips = whitelisted_ips.input\n this.whitelisted_ips_row = whitelisted_ips.row\n this.append(this.optional_network_tbody, whitelisted_ips.row)\n // Whitelsted VCNs\n const whitelisted_vcns_details = this.createDetailsSection('Whitelisted VCNs', `${this.id}_whitelisted_vcns_details`)\n this.append(this.optional_network_div, whitelisted_vcns_details.details)\n this.whitelisted_vcns_div = whitelisted_vcns_details.div\n this.whitelisted_vcns_details = whitelisted_vcns_details.details\n const whitelisted_vcns_table = this.createArrayTable('Rules', `${this.id}_whitelisted_vcns`, '', () => this.addWhitelistedVcn())\n this.whitelisted_vcns_tbody = whitelisted_vcns_table.tbody\n this.append(whitelisted_vcns_details.div, whitelisted_vcns_table.table)\n // Pricing Estimates\n const pricing_estimates_details = this.createDetailsSection('Pricing Estimates', `${this.id}_pricing_estimates_details`)\n this.append(this.properties_contents, pricing_estimates_details.details)\n const pricing_estimates_table = this.createTable('', `${this.id}_pricing_estimates_properties`)\n this.pricing_estimates_tbody = pricing_estimates_table.tbody\n this.append(pricing_estimates_details.div, pricing_estimates_table.table)\n // OCPUs\n const estimated_ocpu_per_hour_data = {min: 1}\n const estimated_ocpu_per_hour = this.createInput('number', 'Estimated OCPUs per Hour', `${this.id}_estimated_ocpu_per_hour`, '', (d, i, n) => {n[i].reportValidity(); this.resource.pricing_estimates.estimated_ocpu_per_hour = n[i].value}, estimated_ocpu_per_hour_data)\n this.append(this.pricing_estimates_tbody, estimated_ocpu_per_hour.row)\n this.estimated_ocpu_per_hour = estimated_ocpu_per_hour.input\n this.estimated_ocpu_per_hour_row = estimated_ocpu_per_hour.row\n }", "title": "" }, { "docid": "ddc67505404da3da92ed5523d33ef004", "score": "0.46414447", "text": "get baseDefinition() {\n\t\treturn this.__baseDefinition;\n\t}", "title": "" }, { "docid": "f24aca550dd6f711e4bfa1b869d7d6b5", "score": "0.4632532", "text": "definition(context = {}, finalize = true) {\n // Ensure type of argument\n check(context, Object);\n\n let def = this._definition;\n\n // May be a factory\n if (_.isFunction(def))\n def = def.call(context);\n else\n def = _.cloneDeep(def);\n\n check(def, Object);\n\n\n // Add name to definition\n def.name = this.name;\n\n // Convert event types to array\n if (_.isString(def.on))\n def.on = def.on.split(/\\s+/g);\n\n // Add options to definition\n _.defaults(def, this._options.all());\n\n\n // Get extends option\n const exts = this.option(\"extends\");\n\n if (exts) {\n check(exts, Match.OneOf(String, [String]));\n\n // Resolve extends\n const defs = _.isArray(exts)\n ? _.map(exts, name => Binding.get(name).definition(context, false))\n : [Binding.get(exts).definition(context, false)];\n\n // Inherit\n _.defaults(def, ...defs);\n }\n\n\n // Possibly lock down all properties\n if (finalize) {\n defineProperties(def, _.mapValues(def, () => ({\n enumerable: false,\n writable: false,\n configurable: false,\n })));\n }\n\n\n return def;\n }", "title": "" }, { "docid": "a300f6a9a6dac28774f1d7ddd582918e", "score": "0.46299306", "text": "build() {\n return this.definition\n }", "title": "" }, { "docid": "84c3d8b2df46728b8bca595375a02706", "score": "0.46099553", "text": "constructor(parent, name, props) {\n super(parent, name);\n /**\n * Options for this resource, such as condition, update policy etc.\n */\n this.options = {};\n /**\n * AWS resource property overrides.\n *\n * During synthesis, the method \"renderProperties(this.overrides)\" is called\n * with this object, and merged on top of the output of\n * \"renderProperties(this.properties)\".\n *\n * Derived classes should expose a strongly-typed version of this object as\n * a public property called `propertyOverrides`.\n */\n this.untypedPropertyOverrides = {};\n /**\n * An object to be merged on top of the entire resource definition.\n */\n this.rawOverrides = {};\n this.dependsOn = new Array();\n if (!props.type) {\n throw new Error('The `type` property is required');\n }\n this.resourceType = props.type;\n this.properties = props.properties || {};\n // if aws:cdk:enable-path-metadata is set, embed the current construct's\n // path in the CloudFormation template, so it will be possible to trace\n // back to the actual construct path.\n if (this.getContext(cxapi.PATH_METADATA_ENABLE_CONTEXT)) {\n this.options.metadata = {\n [cxapi.PATH_METADATA_KEY]: this.path\n };\n }\n }", "title": "" }, { "docid": "a1dba0875d78907bd542e9b63fc33834", "score": "0.45886755", "text": "createComponent(resourceKey) {\n return this.container.get(resourceKey);\n }", "title": "" }, { "docid": "49cf30897ad8a437f2a0b6e8e76245f9", "score": "0.45781454", "text": "getContract() {\n return {\n type: this._type,\n description: this._description,\n required: this._required,\n };\n }", "title": "" }, { "docid": "b16bd9ebad1e9fce7d00a41ebc24ac25", "score": "0.45557013", "text": "function companyDetailResource(compDetailId, companyType) {\r\n\t\tvar url = $rootScope.apiUrl + \"companydetail/\" + compDetailId + \"/\" + companyType;\r\n\t\treturn $resource(url, null, {\r\n\t\t\t'update' : {\r\n\t\t\t\tmethod : 'PUT'\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "066d73ab21ab645273a421ad7c69fa8e", "score": "0.45388803", "text": "function ValidationDefinition() {\n this.metadata = {};\n this.parameters = {};\n }", "title": "" }, { "docid": "f3fd2e42818309658d1a05da20da5ab4", "score": "0.45346528", "text": "function getCeInfo(aaResourceRecord) {\n var ceInfo = new CeInfo();\n if (!_.isUndefined(aaResourceRecord.callExperienceName)) {\n ceInfo.setName(aaResourceRecord.callExperienceName);\n }\n if (!_.isUndefined(aaResourceRecord.callExperienceURL)) {\n ceInfo.setCeUrl(aaResourceRecord.callExperienceURL);\n }\n if (_.isArray(aaResourceRecord.assignedResources)) {\n for (var j = 0; j < aaResourceRecord.assignedResources.length; j++) {\n var iResource = aaResourceRecord.assignedResources[j];\n var resource = new CeInfoResource();\n resource.setTrigger(iResource.trigger);\n resource.setId(iResource.id);\n resource.setType(iResource.type);\n if (!_.isUndefined(iResource.number)) {\n resource.setNumber(iResource.number);\n }\n ceInfo.addResource(resource);\n }\n }\n if (!_.isUndefined(aaResourceRecord.scheduleId)) {\n ceInfo.setSchedule(aaResourceRecord.scheduleId);\n }\n return ceInfo;\n }", "title": "" }, { "docid": "1028751efbf887e0854e4b89a4116c45", "score": "0.45231086", "text": "static get __resourceType() {\n\t\treturn 'OrganizationContact';\n\t}", "title": "" }, { "docid": "e7eb2f2f502818884ff413052586be87", "score": "0.44591197", "text": "toCloudFormation() {\n try {\n // merge property overrides onto properties and then render (and validate).\n const properties = this.renderProperties(deepMerge(this.properties || {}, this.untypedPropertyOverrides));\n return {\n Resources: {\n [this.logicalId]: deepMerge({\n Type: this.resourceType,\n Properties: util_1.ignoreEmpty(properties),\n DependsOn: util_1.ignoreEmpty(this.renderDependsOn()),\n CreationPolicy: util_1.capitalizePropertyNames(this.options.creationPolicy),\n UpdatePolicy: util_1.capitalizePropertyNames(this.options.updatePolicy),\n DeletionPolicy: util_1.capitalizePropertyNames(this.options.deletionPolicy),\n Metadata: util_1.ignoreEmpty(this.options.metadata),\n Condition: this.options.condition && this.options.condition.logicalId\n }, this.rawOverrides)\n }\n };\n }\n catch (e) {\n // Change message\n e.message = `While synthesizing ${this.path}: ${e.message}`;\n // Adjust stack trace (make it look like node built it, too...)\n const creationStack = ['--- resource created at ---', ...this.creationStackTrace].join('\\n at ');\n const problemTrace = e.stack.substr(e.stack.indexOf(e.message) + e.message.length);\n e.stack = `${e.message}\\n ${creationStack}\\n --- problem discovered at ---${problemTrace}`;\n // Re-throw\n throw e;\n }\n }", "title": "" }, { "docid": "27d4e6bfdb1c5a8da55f76a3011ded65", "score": "0.44557205", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnComponent.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_imagebuilder_CfnComponentProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnComponent);\n }\n throw error;\n }\n cdk.requireProperty(props, 'name', this);\n cdk.requireProperty(props, 'platform', this);\n cdk.requireProperty(props, 'version', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrEncrypted = this.getAtt('Encrypted', cdk.ResolutionTypeHint.STRING);\n this.attrName = cdk.Token.asString(this.getAtt('Name', cdk.ResolutionTypeHint.STRING));\n this.attrType = cdk.Token.asString(this.getAtt('Type', cdk.ResolutionTypeHint.STRING));\n this.name = props.name;\n this.platform = props.platform;\n this.version = props.version;\n this.changeDescription = props.changeDescription;\n this.data = props.data;\n this.description = props.description;\n this.kmsKeyId = props.kmsKeyId;\n this.supportedOsVersions = props.supportedOsVersions;\n this.tags = new cdk.TagManager(cdk.TagType.MAP, \"AWS::ImageBuilder::Component\", props.tags, { tagPropertyName: 'tags' });\n this.uri = props.uri;\n }", "title": "" }, { "docid": "c84f7231eccf3c2d3852391130d7798e", "score": "0.44280696", "text": "function BasePart(name, resourceCost)\n{\n this.name = name;\n this.resourceCost = resourceCost;\n}", "title": "" }, { "docid": "40016bb223593ee128c519588bba26a7", "score": "0.44119358", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnComponentPropsFromCloudFormation(resourceProperties);\n const ret = new CfnComponent(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "8609cb53a003077428882ae45d6fc2f1", "score": "0.44066834", "text": "of(ext) {\n return new CompartmentInstance(this, ext);\n }", "title": "" }, { "docid": "639057925db0cdb924c3ff1c76934b8a", "score": "0.44011703", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnInfrastructureConfiguration.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_imagebuilder_CfnInfrastructureConfigurationProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnInfrastructureConfiguration);\n }\n throw error;\n }\n cdk.requireProperty(props, 'instanceProfileName', this);\n cdk.requireProperty(props, 'name', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrName = cdk.Token.asString(this.getAtt('Name', cdk.ResolutionTypeHint.STRING));\n this.instanceProfileName = props.instanceProfileName;\n this.name = props.name;\n this.description = props.description;\n this.instanceMetadataOptions = props.instanceMetadataOptions;\n this.instanceTypes = props.instanceTypes;\n this.keyPair = props.keyPair;\n this.logging = props.logging;\n this.resourceTags = props.resourceTags;\n this.securityGroupIds = props.securityGroupIds;\n this.snsTopicArn = props.snsTopicArn;\n this.subnetId = props.subnetId;\n this.tags = new cdk.TagManager(cdk.TagType.MAP, \"AWS::ImageBuilder::InfrastructureConfiguration\", props.tags, { tagPropertyName: 'tags' });\n this.terminateInstanceOnFailure = props.terminateInstanceOnFailure;\n }", "title": "" }, { "docid": "07e174a9c757765f95269ba258c18f15", "score": "0.43936124", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnBranchPropsFromCloudFormation(resourceProperties);\n const ret = new CfnBranch(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "82295773f6dadee4085658d399d32242", "score": "0.43751907", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnContainerRecipe.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_imagebuilder_CfnContainerRecipeProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnContainerRecipe);\n }\n throw error;\n }\n cdk.requireProperty(props, 'components', this);\n cdk.requireProperty(props, 'containerType', this);\n cdk.requireProperty(props, 'name', this);\n cdk.requireProperty(props, 'parentImage', this);\n cdk.requireProperty(props, 'targetRepository', this);\n cdk.requireProperty(props, 'version', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrName = cdk.Token.asString(this.getAtt('Name', cdk.ResolutionTypeHint.STRING));\n this.components = props.components;\n this.containerType = props.containerType;\n this.name = props.name;\n this.parentImage = props.parentImage;\n this.targetRepository = props.targetRepository;\n this.version = props.version;\n this.description = props.description;\n this.dockerfileTemplateData = props.dockerfileTemplateData;\n this.dockerfileTemplateUri = props.dockerfileTemplateUri;\n this.imageOsVersionOverride = props.imageOsVersionOverride;\n this.instanceConfiguration = props.instanceConfiguration;\n this.kmsKeyId = props.kmsKeyId;\n this.platformOverride = props.platformOverride;\n this.tags = new cdk.TagManager(cdk.TagType.MAP, \"AWS::ImageBuilder::ContainerRecipe\", props.tags, { tagPropertyName: 'tags' });\n this.workingDirectory = props.workingDirectory;\n }", "title": "" }, { "docid": "13968e53d82f94a51ca85cbdd4a2890b", "score": "0.4347365", "text": "function initialize ()\r\n {\r\n // appearance of the drawable component of this node\r\n var appearance = new x3dom.nodeTypes.Appearance( ctx );\r\n var geometry = new x3dom.nodeTypes.Box( ctx );\r\n\r\n geometry._vf.size = bvhRefiner._vf.octSize;\r\n geometry.fieldChanged( \"size\" );\r\n\r\n // definition of nameSpace\r\n shape._nameSpace = new x3dom.NodeNameSpace( \"\", bvhRefiner._nameSpace.doc );\r\n shape._nameSpace.setBaseURL( bvhRefiner._nameSpace.baseURL );\r\n\r\n shape.addChild( appearance );\r\n appearance.nodeChanged();\r\n shape.addChild( geometry );\r\n geometry.nodeChanged();\r\n\r\n //bvhRefiner.addChild(shape);\r\n shape.nodeChanged();\r\n\r\n // bind static cull-properties to cullObject\r\n cullObject.boundedNode = shape;\r\n cullObject.volume = shape.getVolume();\r\n }", "title": "" }, { "docid": "c1f8422e76ed75036e8c13cee63c32df", "score": "0.4342341", "text": "updateCustomResourceDefinition(name, item){\n return this.apiExt.patchCustomResourceDefinition(\n name,\n item,\n undefined,\n undefined,\n this.options\n )\n }", "title": "" }, { "docid": "f790503069fe6df45f5ea8deebc03885", "score": "0.43033737", "text": "editCard() {\n return Resource.get(this).resource('Employee:editCard', this.displayData.editCard);\n }", "title": "" }, { "docid": "e221d384430ed6ef17ffb32380f5fe6f", "score": "0.4302815", "text": "static get __resourceType() {\n\t\treturn 'Reference';\n\t}", "title": "" }, { "docid": "a498e9917e1b42d33f048930d9cd029d", "score": "0.43023077", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnConfiguration.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_amazonmq_CfnConfigurationProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnConfiguration);\n }\n throw error;\n }\n cdk.requireProperty(props, 'data', this);\n cdk.requireProperty(props, 'engineType', this);\n cdk.requireProperty(props, 'engineVersion', this);\n cdk.requireProperty(props, 'name', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrId = cdk.Token.asString(this.getAtt('Id', cdk.ResolutionTypeHint.STRING));\n this.attrRevision = cdk.Token.asNumber(this.getAtt('Revision', cdk.ResolutionTypeHint.NUMBER));\n this.data = props.data;\n this.engineType = props.engineType;\n this.engineVersion = props.engineVersion;\n this.name = props.name;\n this.authenticationStrategy = props.authenticationStrategy;\n this.description = props.description;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::AmazonMQ::Configuration\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "5bacba4bf1e3fc221095732a5dd2c8d4", "score": "0.4293854", "text": "createCustomResource(group, version, namespace, plural, item) {\n if(namespace !== '' && namespace){\n return this.apiCRD.createNamespacedCustomObject(\n group,\n version,\n namespace,\n plural,\n item\n )\n } else {\n return this.apiCRD.createClusterCustomObject(\n group,\n version,\n plural,\n item\n )\n }\n }", "title": "" }, { "docid": "434483370af7878ed4ca34103ad21d39", "score": "0.42790696", "text": "GetModuleDefinition() {\n\n }", "title": "" }, { "docid": "e3680ca405ba1834a3bc622f93740078", "score": "0.42717162", "text": "get taskDefinition() {\n return this.getStringAttribute('task_definition');\n }", "title": "" }, { "docid": "34e43011252c93408b14fc3004a09234", "score": "0.42508876", "text": "constructor() {\n super();\n\n this.state = {\n target: ActiveResource.Collection.build()\n };\n }", "title": "" }, { "docid": "b479e53f50fe9fcfe8c587306bb77a5f", "score": "0.42486936", "text": "async function createAContact() {\n const subscriptionId =\n process.env[\"ORBITAL_SUBSCRIPTION_ID\"] || \"c1be1141-a7c9-4aac-9608-3c2e2f1152c3\";\n const resourceGroupName = process.env[\"ORBITAL_RESOURCE_GROUP\"] || \"contoso-Rgp\";\n const spacecraftName = \"CONTOSO_SAT\";\n const contactName = \"contact1\";\n const parameters = {\n contactProfile: {\n id: \"/subscriptions/c1be1141-a7c9-4aac-9608-3c2e2f1152c3/resourceGroups/contoso-Rgp/providers/Microsoft.Orbital/contactProfiles/CONTOSO-CP\",\n },\n groundStationName: \"EASTUS2_0\",\n reservationEndTime: new Date(\"2023-02-22T11:10:45Z\"),\n reservationStartTime: new Date(\"2023-02-22T10:58:30Z\"),\n };\n const credential = new DefaultAzureCredential();\n const client = new AzureOrbital(credential, subscriptionId);\n const result = await client.contacts.beginCreateAndWait(\n resourceGroupName,\n spacecraftName,\n contactName,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "2dc161beeb77fb6cc9142abe01c26e55", "score": "0.42419097", "text": "function getResourceSection(resourceTypeName, color, resources, options) {\n var jwrapper = GeoMarkup.Utility.Wrapper();\n jwrapper.addClass(\"resourceSeciton\");\n jwrapper.addClass(\"formBackground\");\n jwrapper.css(\"width\", sectionWidth);\n jwrapper.css(\"margin\", sectionLeftMargin);\n jwrapper.css(\"margin-left\", sectionLeftMargin);\n jwrapper.css(\"margin-right\", sectionRightMargin);\n\n jwrapper.append(GeoMarkup.Utility.Padding());\n\n var jpwrapper = GeoUtility.CheckPadding(jwrapper);\n\n jpwrapper.append(getResourceNameInBox(resourceTypeName, color));\n\n // Add the resource links to the section\n // TODO : ADD RESOURCE LINKS\n\n return jwrapper;\n }", "title": "" }, { "docid": "6116532e33b354bd1a6c0fc5e5f5d8fe", "score": "0.4232662", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnBranch.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_amplify_CfnBranchProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnBranch);\n }\n throw error;\n }\n cdk.requireProperty(props, 'appId', this);\n cdk.requireProperty(props, 'branchName', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrBranchName = cdk.Token.asString(this.getAtt('BranchName', cdk.ResolutionTypeHint.STRING));\n this.appId = props.appId;\n this.branchName = props.branchName;\n this.basicAuthConfig = props.basicAuthConfig;\n this.buildSpec = props.buildSpec;\n this.description = props.description;\n this.enableAutoBuild = props.enableAutoBuild;\n this.enablePerformanceMode = props.enablePerformanceMode;\n this.enablePullRequestPreview = props.enablePullRequestPreview;\n this.environmentVariables = props.environmentVariables;\n this.framework = props.framework;\n this.pullRequestEnvironmentName = props.pullRequestEnvironmentName;\n this.stage = props.stage;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::Amplify::Branch\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "62cc9b49bf14dc98ee096df7f82ca22e", "score": "0.42163113", "text": "createResourceSetBinding(resourceSetId, instance, _options) {\n const result = this.api.createResourceSetBinding(resourceSetId, instance, _options);\n return result.toPromise();\n }", "title": "" }, { "docid": "5662569fe443afef404bd65885888852", "score": "0.4211357", "text": "static get __resourceType() {\n\t\treturn 'ImplementationGuide';\n\t}", "title": "" }, { "docid": "9840917c7c9f60b81730afdc1bdddfd2", "score": "0.42006359", "text": "get(state) {\n return state.config.compartments.get(this);\n }", "title": "" }, { "docid": "247b9d8226e09bde37d36ee9f059f9d3", "score": "0.41952753", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnServer.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_opsworkscm_CfnServerProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnServer);\n }\n throw error;\n }\n cdk.requireProperty(props, 'instanceProfileArn', this);\n cdk.requireProperty(props, 'instanceType', this);\n cdk.requireProperty(props, 'serviceRoleArn', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrEndpoint = cdk.Token.asString(this.getAtt('Endpoint', cdk.ResolutionTypeHint.STRING));\n this.attrServerName = cdk.Token.asString(this.getAtt('ServerName', cdk.ResolutionTypeHint.STRING));\n this.instanceProfileArn = props.instanceProfileArn;\n this.instanceType = props.instanceType;\n this.serviceRoleArn = props.serviceRoleArn;\n this.associatePublicIpAddress = props.associatePublicIpAddress;\n this.backupId = props.backupId;\n this.backupRetentionCount = props.backupRetentionCount;\n this.customCertificate = props.customCertificate;\n this.customDomain = props.customDomain;\n this.customPrivateKey = props.customPrivateKey;\n this.disableAutomatedBackup = props.disableAutomatedBackup;\n this.engine = props.engine;\n this.engineAttributes = props.engineAttributes;\n this.engineModel = props.engineModel;\n this.engineVersion = props.engineVersion;\n this.keyPair = props.keyPair;\n this.preferredBackupWindow = props.preferredBackupWindow;\n this.preferredMaintenanceWindow = props.preferredMaintenanceWindow;\n this.securityGroupIds = props.securityGroupIds;\n this.subnetIds = props.subnetIds;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::OpsWorksCM::Server\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "9ad28095309107cc0a13ab24f410519c", "score": "0.4190401", "text": "_getResource () {\n const Resource = Resources[this._dataType]\n const resourceInstance = new Resource(this._data, this._transformer)\n\n resourceInstance.setMeta(this._meta)\n resourceInstance.setPagination(this._pagination)\n resourceInstance.setVariant(this._variant)\n\n return resourceInstance\n }", "title": "" }, { "docid": "3b9f49c20b150b72ed7f2887947d33bb", "score": "0.41735432", "text": "function createNodeResource (name, grpcEndpoint, status) {\n const obj = {\n apiVersion: 'openebs.io/v1alpha1',\n kind: 'MayastorNode',\n metadata: defaultMeta(name),\n spec: { grpcEndpoint }\n };\n if (status) {\n obj.status = status;\n }\n return obj;\n }", "title": "" }, { "docid": "9be2d52c2c76edb4f758009133bd177a", "score": "0.41643146", "text": "function construct(resource)\n\t{\n\t\tthis.createField = createField;\n\t\tthis.fieldTypeHasProperty = fieldTypeHasProperty;\n\t\tthis.fields = resource.fields;\n\t\tthis.persist = persist;\n\t\tthis.removeField = removeField;\n\t\tthis.status = 'Saved';\n\t\tthis.validate = validate;\n\t}", "title": "" }, { "docid": "4da4bb5cf40a2e6407a6a8188b705968", "score": "0.41573653", "text": "constructor() {\n super();\n\n /** @type {Object} */\n this._defs = {};\n }", "title": "" }, { "docid": "cd0cfe2f44149261c73a0204c638ecb0", "score": "0.41538337", "text": "constructor(projectDocumentationsService) {\n super(projectDocumentationsService);\n this.name = 'project-details-documentations';\n this.prependName = 'Documentations';\n this.itemKey = 'documentations';\n this.query = {\n documentations: true,\n };\n }", "title": "" }, { "docid": "b9d2e9eceb867c27a2ea778134d1bfdb", "score": "0.41404802", "text": "static calcSchemaDefinition() {\n\t\tconst RoomModel = jrequire(\"models/room\");\n\t\treturn {\n\t\t\t...(this.getBaseSchemaDefinition()),\n\t\t\t//\n\t\t\troomid: {\n\t\t\t\tlabel: \"Room Id\",\n\t\t\t\tvalueFunction: this.makeModelValueFunctionCrudObjectIdFromList(RoomModel, \"roomid\", \"roomLabel\", \"roomlist\"),\n\t\t\t\tmongoose: {\n\t\t\t\t\ttype: mongoose.Schema.ObjectId,\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tpath: {\n\t\t\t\tlabel: \"Path\",\n\t\t\t\tmongoose: {\n\t\t\t\t\ttype: String,\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tlabel: {\n\t\t\t\tlabel: \"Label\",\n\t\t\t\tmongoose: {\n\t\t\t\t\ttype: String,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsizeInBytes: {\n\t\t\t\tlabel: \"Size in bytes\",\n\t\t\t\tmongoose: {\n\t\t\t\t\ttype: Number,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}", "title": "" }, { "docid": "9f750c1455d6bc0a2d420bb13badc08c", "score": "0.41338426", "text": "function generateModelDefinition() {\n var definition = {};\n var schema = controller.model().schema;\n\n definition.id = capitalize(controller.model().singular());\n definition.properties = {};\n\n var subSchemas = [];\n Object.keys(schema.paths).forEach(function (name) {\n var path = schema.paths[name];\n if (path.selected === false || path.options.selected === false) return;\n var prop = generatePropertyDefinition(name, path);\n var property = prop.property;\n if (prop.schema) {\n subSchemas.push(prop.schema);\n }\n if (schema.paths[name].options.alias) {\n name = schema.paths[name].options.alias;\n }\n var names = name.split('.');\n if (names.length < 2) {\n if (property) {\n definition.properties[name] = property;\n }\n } else {\n definition.properties[names[0]] = {\n $ref: modelName + capitalize(names[0]),\n type: modelName + capitalize(names[0])\n };\n }\n });\n\n Object.keys(schema.virtuals).forEach(function (name) {\n var path = schema.virtuals[name];\n if (!path.options.ref || path.options.selected === false) return;\n var prop = generatePropertyDefinition(name, path);\n var property = prop.property;\n if (path.options.justOne !== true) {\n property = { type: \"Array\", items: property };\n }\n definition.properties[name] = property;\n });\n\n retVal = { definition: definition };\n if (subSchemas.length) {\n var refs = {};\n for (var subSchema = 0; subSchema < subSchemas.length; subSchema++) {\n Object.keys(subSchemas[subSchema]).forEach(function (subSchemaName) {\n Object.keys((subSchemas[subSchema][subSchemaName] || {}).paths || {}).forEach(function (name) {\n if (!refs[subSchemaName]) {\n refs[subSchemaName] = {\n id: capitalize(subSchemaName),\n properties: {}\n };\n }\n var path = subSchemas[subSchema][subSchemaName].paths[name];\n if (path.selected === false || path.options.selected === false) return;\n var prop = generatePropertyDefinition(name, path, subSchemaName);\n var property = prop.property;\n if (prop.schema) {\n found = false\n subSchemas.forEach(function (sub) {\n found = found || Object.keys(sub)[0] == Object.keys(prop.schema)[0];\n });\n if (!found) {\n subSchemas.push(prop.schema);\n }\n }\n var path = subSchemas[subSchema][subSchemaName].paths[name];\n if (path.selected === false || path.options.selected === false) return;\n if (path.options.alias) {\n name = path.options.alias;\n }\n name = name.replace('$type', 'type');\n var names = name.split('.');\n if (names.length > 1) {\n for (var i = 0, l = names.length - 1; i < l; i++) {\n id = subSchemaName + capitalize(names[i]);\n if (!refs[id]) {\n refs[id] = { id: id, properties: {} };\n }\n if (i < (l - 1)) {\n refs[id].properties[names[i + 1]] = {\n $ref: subSchemaName + capitalize(names[i + 1]),\n type: subSchemaName + capitalize(names[i + 1])\n };\n } else if (property) {\n refs[id].properties[names[i + 1]] = property;\n }\n }\n refs[subSchemaName].properties[names[0]] = {\n $ref: subSchemaName + capitalize(names[0]),\n type: subSchemaName + capitalize(names[0])\n };\n } else if (property) {\n refs[subSchemaName].properties[name] = property;\n }\n });\n });\n };\n retVal.refs = refs;\n }\n definition.description = (definition.properties['_xsi:schemaLocation'] || {}).defaultValue\n return retVal;\n }", "title": "" }, { "docid": "e373b4b179100407436aa75cd8b5e8b2", "score": "0.41302055", "text": "get parent_id() {return this.artefact.compartment_id;}", "title": "" }, { "docid": "af1bfa1829df4403daa5a8ed1b4a9c5e", "score": "0.41227242", "text": "function ComponentDef(component, componentId, globalComponentsContext, componentStack, componentStackLen) {\n this.$__globalComponentsContext = globalComponentsContext; // The AsyncWriter that this component is associated with\n this.$__componentStack = componentStack;\n this.$__componentStackLen = componentStackLen;\n this.$__component = component;\n this.id = componentId;\n\n this.$__roots = null; // IDs of root elements if there are multiple root elements\n this.$__children = null; // An array of nested ComponentDef instances\n this.$__domEvents = undefined; // An array of DOM events that need to be added (in sets of three)\n\n this.$__isExisting = false;\n\n this.$__willRerenderInBrowser = false;\n\n this.$__nextIdIndex = 0; // The unique integer to use for the next scoped ID\n}", "title": "" }, { "docid": "3101a37e037f8644cc8e402d360f5af5", "score": "0.41222823", "text": "get ref() {\n return this.resource.ref;\n }", "title": "" }, { "docid": "0ac00946fd62137e30ee561a24a1bed2", "score": "0.41212395", "text": "function CompositeMetadataType() {\n this.allowedComponents = [];\n this.content = [];\n}", "title": "" }, { "docid": "bb5ab3aa18d70d185a151c629d4d9993", "score": "0.41130906", "text": "function createDescriptor(parent, target){\r\n\tconst descriptor = {}\r\n\r\n\t\t\tdescriptor.param_quantity = parent.querySelector('.param-quantity')\r\n\r\n\t\t\tdescriptor.min = descriptor.param_quantity.getAttribute('rangeMin')\r\n\t\t\tdescriptor.max = descriptor.param_quantity.getAttribute('rangeMax')\r\n\r\n\t\t\tdescriptor.step = +descriptor.param_quantity.getAttribute('stepOne')\r\n\r\n\t\t\tdescriptor.current_value = +descriptor.param_quantity.getAttribute('placeholder')\r\n\r\n\t\t\tdescriptor.service__card = getServiceCard(target.getAttribute('card-order'))\r\n\t\t\tconsole.log(descriptor.service__card)\r\n\t\t\tdescriptor.head_name = descriptor.service__card.querySelector('.head-name')\r\n\r\n\t\t\treturn descriptor\r\n}", "title": "" }, { "docid": "65aa9f17ee4f3a13502240fbf51e1e35", "score": "0.41012812", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnDistributionConfiguration.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_imagebuilder_CfnDistributionConfigurationProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnDistributionConfiguration);\n }\n throw error;\n }\n cdk.requireProperty(props, 'distributions', this);\n cdk.requireProperty(props, 'name', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrName = cdk.Token.asString(this.getAtt('Name', cdk.ResolutionTypeHint.STRING));\n this.distributions = props.distributions;\n this.name = props.name;\n this.description = props.description;\n this.tags = new cdk.TagManager(cdk.TagType.MAP, \"AWS::ImageBuilder::DistributionConfiguration\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "329d311f5772d692eccfa48b39bbeac6", "score": "0.40994456", "text": "constructor() { \n \n ResourceStatus.initialize(this);\n }", "title": "" }, { "docid": "324d2490a583878a1741c43e607fb260", "score": "0.40874007", "text": "function Suite()\n {\n this.variantdefs = [];\n this.resourcedefs = {};\n }", "title": "" }, { "docid": "c886fe4f50d839b64c8fd2660656c35a", "score": "0.40861833", "text": "function getComponentDef(type) {\n return type[NG_COMP_DEF] || null;\n }", "title": "" }, { "docid": "c886fe4f50d839b64c8fd2660656c35a", "score": "0.40861833", "text": "function getComponentDef(type) {\n return type[NG_COMP_DEF] || null;\n }", "title": "" }, { "docid": "ce0f6752331eb8edbff23a993d33d5f7", "score": "0.4084558", "text": "function addResource() {\n\t\t\tvm.resource = {};\n\t\t\tvm.newResource = true;\n\t\t}", "title": "" }, { "docid": "22bd83e8856afbc3217f37d918f6d803", "score": "0.40754312", "text": "function baseResourceFinder(def) {\n var DS = getDS()\n\n var fab = Fabricator(def)\n var resourceName = def\n\n if(!fab || !resourceName) throw new Error('Unable to find path for resource ' + def)\n\n while(fab.$parent) {\n resourceName = fab.$parent\n fab = Fabricator(resourceName)\n }\n\n return DS.definitions[resourceName]\n }", "title": "" }, { "docid": "9498f5544180218226c5541a29709641", "score": "0.40741798", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnDomain.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_amplify_CfnDomainProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnDomain);\n }\n throw error;\n }\n cdk.requireProperty(props, 'appId', this);\n cdk.requireProperty(props, 'domainName', this);\n cdk.requireProperty(props, 'subDomainSettings', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrAutoSubDomainCreationPatterns = cdk.Token.asList(this.getAtt('AutoSubDomainCreationPatterns', cdk.ResolutionTypeHint.STRING_LIST));\n this.attrAutoSubDomainIamRole = cdk.Token.asString(this.getAtt('AutoSubDomainIAMRole', cdk.ResolutionTypeHint.STRING));\n this.attrCertificateRecord = cdk.Token.asString(this.getAtt('CertificateRecord', cdk.ResolutionTypeHint.STRING));\n this.attrDomainName = cdk.Token.asString(this.getAtt('DomainName', cdk.ResolutionTypeHint.STRING));\n this.attrDomainStatus = cdk.Token.asString(this.getAtt('DomainStatus', cdk.ResolutionTypeHint.STRING));\n this.attrEnableAutoSubDomain = this.getAtt('EnableAutoSubDomain', cdk.ResolutionTypeHint.STRING);\n this.attrStatusReason = cdk.Token.asString(this.getAtt('StatusReason', cdk.ResolutionTypeHint.STRING));\n this.appId = props.appId;\n this.domainName = props.domainName;\n this.subDomainSettings = props.subDomainSettings;\n this.autoSubDomainCreationPatterns = props.autoSubDomainCreationPatterns;\n this.autoSubDomainIamRole = props.autoSubDomainIamRole;\n this.enableAutoSubDomain = props.enableAutoSubDomain;\n }", "title": "" }, { "docid": "17a1cd6be208f645defb4ffbaaa67606", "score": "0.40736884", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnInfrastructureConfigurationPropsFromCloudFormation(resourceProperties);\n const ret = new CfnInfrastructureConfiguration(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "f1f6d35f47466b4f38a70240c2607515", "score": "0.40648562", "text": "async create(body, options) {\n if (body.body) {\n body.body = body.body.toString();\n }\n const err = {};\n if (!isResourceValid(body, err)) {\n throw err;\n }\n const path = getPathFromLink(this.container.url, exports.ResourceType.sproc);\n const id = getIdFromLink(this.container.url);\n const response = await this.clientContext.create({\n body,\n path,\n resourceType: exports.ResourceType.sproc,\n resourceId: id,\n options,\n });\n const ref = new StoredProcedure(this.container, response.result.id, this.clientContext);\n return new StoredProcedureResponse(response.result, response.headers, response.code, ref);\n }", "title": "" }, { "docid": "fca26761b67a6118109f888a7266dc2f", "score": "0.40622866", "text": "static get __resourceType() {\n\t\treturn 'ParametersParameterMultiPart';\n\t}", "title": "" }, { "docid": "ab24792e0f7cedd04cac1fd67c12e678", "score": "0.40616813", "text": "constructor(scope, id, props = {}) {\n super(scope, id, { type: CfnDomain.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_elasticsearch_CfnDomainProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnDomain);\n }\n throw error;\n }\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrDomainEndpoint = cdk.Token.asString(this.getAtt('DomainEndpoint', cdk.ResolutionTypeHint.STRING));\n this.accessPolicies = props.accessPolicies;\n this.advancedOptions = props.advancedOptions;\n this.advancedSecurityOptions = props.advancedSecurityOptions;\n this.cognitoOptions = props.cognitoOptions;\n this.domainEndpointOptions = props.domainEndpointOptions;\n this.domainName = props.domainName;\n this.ebsOptions = props.ebsOptions;\n this.elasticsearchClusterConfig = props.elasticsearchClusterConfig;\n this.elasticsearchVersion = props.elasticsearchVersion;\n this.encryptionAtRestOptions = props.encryptionAtRestOptions;\n this.logPublishingOptions = props.logPublishingOptions;\n this.nodeToNodeEncryptionOptions = props.nodeToNodeEncryptionOptions;\n this.snapshotOptions = props.snapshotOptions;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::Elasticsearch::Domain\", props.tags, { tagPropertyName: 'tags' });\n this.vpcOptions = props.vpcOptions;\n if (this.node.scope && cdk.Resource.isResource(this.node.scope)) {\n this.node.addValidation({ validate: () => this.cfnOptions.deletionPolicy === undefined\n ? ['\\'AWS::Elasticsearch::Domain\\' is a stateful resource type, and you must specify a Removal Policy for it. Call \\'resource.applyRemovalPolicy()\\'.']\n : [] });\n }\n }", "title": "" }, { "docid": "c17ba2e4fb86942d162a829b8ce150ef", "score": "0.40598926", "text": "function getDefinition() {\n return new Promise((resolve, reject) => {\n fs.readFile(definitionFilename, 'utf8', (err, data) => {\n if (!err) {\n try {\n var obj = JSON.parse(data);\n resolve(obj);\n }\n catch(err) {\n reject('Unable to parse definition file: ' + definitionFilename + '. Cannot continue.');\n }\n } else {\n reject('Unable to read definition file: ' + definitionFilename + '. Cannot continue.');\n }\n });\n });\n}", "title": "" }, { "docid": "af89db69f0f3e7a8309b494edafd6c02", "score": "0.4059238", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnConfigurationAssociation.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_amazonmq_CfnConfigurationAssociationProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnConfigurationAssociation);\n }\n throw error;\n }\n cdk.requireProperty(props, 'broker', this);\n cdk.requireProperty(props, 'configuration', this);\n this.broker = props.broker;\n this.configuration = props.configuration;\n }", "title": "" }, { "docid": "e10c28b47898e4545f0429af8267338c", "score": "0.40569708", "text": "getContract() {\n return new Contract (this.fullname, this.position, this.salary);\n }", "title": "" }, { "docid": "28b2f60989bb575343c5d916f6acd484", "score": "0.40559042", "text": "function renderDefinition(def) {\n document.getElementById(\"def\").innerHTML = \"Definition: \" + def;\n}", "title": "" }, { "docid": "33d29514325edf64d686dfbf5eab7c20", "score": "0.40557078", "text": "constructor(){\n this.resourceType = \"Observation\";\n this.status = \"preliminary\";\n this.code = \"\";\n this.category = [{\n \"coding\": [{\n \"system\": \"http://hl7.org/fhir/observation-category\",\n \"display\": \"Survey\",\n \"code\": \"survey\"\n }]}];\n }", "title": "" }, { "docid": "cf114c2180c9e6e571746a7a085d49e6", "score": "0.40516236", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnConfigurationPropsFromCloudFormation(resourceProperties);\n const ret = new CfnConfiguration(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "a821e4b1e395aacc0f03b656a3acc02c", "score": "0.40513518", "text": "get resource () {\n\t\treturn this._resource;\n\t}", "title": "" }, { "docid": "d10eaa8795e75cad09271eb01f4bd149", "score": "0.40351188", "text": "function constructDefinitionText(parsedInfo) {\n var def = parsedInfo.name;\n if (parsedInfo.options) {\n Object.keys(parsedInfo.options).forEach(function (name) {\n def += ' --' + name + '=' + parsedInfo.options[name];\n });\n }\n return def;\n }", "title": "" }, { "docid": "905977eb14041abd70fe89f7e7064269", "score": "0.4033598", "text": "getRuntimeConfiguration(id) {\n return this.rest.get(`${this.baseUrl}/${id}/components`);\n }", "title": "" }, { "docid": "905977eb14041abd70fe89f7e7064269", "score": "0.4033598", "text": "getRuntimeConfiguration(id) {\n return this.rest.get(`${this.baseUrl}/${id}/components`);\n }", "title": "" }, { "docid": "42368fb6c76098745b236eb8575fca2f", "score": "0.40308687", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnImageRecipe.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_imagebuilder_CfnImageRecipeProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnImageRecipe);\n }\n throw error;\n }\n cdk.requireProperty(props, 'components', this);\n cdk.requireProperty(props, 'name', this);\n cdk.requireProperty(props, 'parentImage', this);\n cdk.requireProperty(props, 'version', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrName = cdk.Token.asString(this.getAtt('Name', cdk.ResolutionTypeHint.STRING));\n this.components = props.components;\n this.name = props.name;\n this.parentImage = props.parentImage;\n this.version = props.version;\n this.additionalInstanceConfiguration = props.additionalInstanceConfiguration;\n this.blockDeviceMappings = props.blockDeviceMappings;\n this.description = props.description;\n this.tags = new cdk.TagManager(cdk.TagType.MAP, \"AWS::ImageBuilder::ImageRecipe\", props.tags, { tagPropertyName: 'tags' });\n this.workingDirectory = props.workingDirectory;\n }", "title": "" }, { "docid": "a351dac3ba8e3399b24148a976a29181", "score": "0.40307876", "text": "function parseDefinition(lexer){if(peek(lexer,_lexer.TokenKind.BRACE_L)){return parseOperationDefinition(lexer);}if(peek(lexer,_lexer.TokenKind.NAME)){switch(lexer.token.value){// Note: subscription is an experimental non-spec addition.\ncase'query':case'mutation':case'subscription':return parseOperationDefinition(lexer);case'fragment':return parseFragmentDefinition(lexer);// Note: the Type System IDL is an experimental non-spec addition.\ncase'schema':case'scalar':case'type':case'interface':case'union':case'enum':case'input':case'extend':case'directive':return parseTypeSystemDefinition(lexer);}}throw unexpected(lexer);}// Implements the parsing rules in the Operations section.", "title": "" }, { "docid": "50730a6a35ec298b054084ca10342405", "score": "0.4030218", "text": "createResourceSet(instance, _options) {\n const result = this.api.createResourceSet(instance, _options);\n return result.toPromise();\n }", "title": "" }, { "docid": "dd26b2e9e0fc5b0ccbe7417a0ba83b04", "score": "0.4025023", "text": "readCustomResourceDefinition(name, pretty, exact, _export, options = { headers: {} }) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CustomResourceDefinition\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n });\n }", "title": "" }, { "docid": "164908f7e17a276982a19a3b17d08ce4", "score": "0.40236455", "text": "readCustomResourceDefinition(name, pretty, exact, _export, options = { headers: {} }) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (exact !== undefined) {\n localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, \"boolean\");\n }\n if (_export !== undefined) {\n localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CustomResourceDefinition\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n });\n }", "title": "" }, { "docid": "70abda300ee7f3691e092011d8edf420", "score": "0.401644", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnImagePipeline.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_imagebuilder_CfnImagePipelineProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnImagePipeline);\n }\n throw error;\n }\n cdk.requireProperty(props, 'infrastructureConfigurationArn', this);\n cdk.requireProperty(props, 'name', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrName = cdk.Token.asString(this.getAtt('Name', cdk.ResolutionTypeHint.STRING));\n this.infrastructureConfigurationArn = props.infrastructureConfigurationArn;\n this.name = props.name;\n this.containerRecipeArn = props.containerRecipeArn;\n this.description = props.description;\n this.distributionConfigurationArn = props.distributionConfigurationArn;\n this.enhancedImageMetadataEnabled = props.enhancedImageMetadataEnabled;\n this.imageRecipeArn = props.imageRecipeArn;\n this.imageScanningConfiguration = props.imageScanningConfiguration;\n this.imageTestsConfiguration = props.imageTestsConfiguration;\n this.schedule = props.schedule;\n this.status = props.status;\n this.tags = new cdk.TagManager(cdk.TagType.MAP, \"AWS::ImageBuilder::ImagePipeline\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "1701bbb840d409d1900ad3e3f3406a30", "score": "0.40161112", "text": "authorizedToCreate() {\n return this.resourceInformation.authorizedToCreate\n }", "title": "" }, { "docid": "0f6ee2d64b8addf983dbc1bb64fd991d", "score": "0.40074125", "text": "constructor() {\n super();\n //endregion\n //region Properties\n /**\n * Property field\n */\n this._expanded = true;\n /**\n * Property field\n */\n this._fragmentItem = null;\n this.addClass('cms-fragment-expando');\n this.padding = 0;\n this.items.add(this.toolbar);\n this.toolbar.items.addArray([\n this.lblTitle\n ]);\n this.toolbar.sideItems.addArray([\n this.btnFold\n ]);\n }", "title": "" }, { "docid": "438f6c3c878cb3e593f432bd3a9eb0ca", "score": "0.40070975", "text": "static get __resourceType() {\n\t\treturn 'Condition';\n\t}", "title": "" }, { "docid": "c812f67b74f81f640b2f1604d6c92d84", "score": "0.4004066", "text": "loadResource() {\n // Load Selects\n this.loadCapacityTypeSelect(this.capacity_type)\n this.loadFeatureSetSelect(this.feature_set)\n this.loadLicenseTypeSelect(this.license_type)\n this.loadNetworkEndpointTypeSelect(this.network_endpoint_type)\n this.loadSelect(this.vcn_id, 'virtual_cloud_network', true)\n this.loadSelect(this.subnet_id, 'subnet', true, this.vcn_filter)\n // Load Values\n this.description.property('value', this.resource.description)\n this.capacity_type.property('value', this.resource.capacity.capacity_type)\n this.capacity_value.property('value', this.resource.capacity.capacity_value)\n this.feature_set.property('value', this.resource.feature_set)\n this.license_type.property('value', this.resource.license_type)\n this.idcs_access_token.property('value', this.resource.idcs_access_token)\n this.email_notification.property('value', this.resource.email_notification)\n this.network_endpoint_type.property('value', this.resource.network_endpoint_details.network_endpoint_type)\n this.vcn_id.property('value', this.resource.network_endpoint_details.vcn_id)\n this.subnet_id.property('value', this.resource.network_endpoint_details.subnet_id)\n this.whitelisted_ips.property('value', this.resource.network_endpoint_details.whitelisted_ips.join(','))\n this.estimated_ocpu_per_hour.property('value', this.resource.pricing_estimates.estimated_ocpu_per_hour)\n this.loadWhitelistedVcns()\n this.collapseExpandNetworkEndPointInputs()\n }", "title": "" }, { "docid": "62d15f221c98aacf86f5dd09d031f313", "score": "0.40036848", "text": "function createContract(id, descr){\n var payload = {\n name: id,\n description: descr\n };\n return commServer.callCommServer(payload, 'groups', 'POST');\n}", "title": "" }, { "docid": "d5d080c2c137e27fe6dcb788513588dc", "score": "0.40013677", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnConfigurationAssociationPropsFromCloudFormation(resourceProperties);\n const ret = new CfnConfigurationAssociation(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "acb1375df915d4836b7d0151ef51e188", "score": "0.40013346", "text": "function Resource(data) {\n this.data = require('../utils').deepClone(data);\n}", "title": "" }, { "docid": "eb0116483e847b3870d8ed9a8bfb6166", "score": "0.40003315", "text": "static get __resourceType() {\n\t\treturn 'PatientContact';\n\t}", "title": "" }, { "docid": "8753a4937ff6ae163204d53f218bb03a", "score": "0.39968938", "text": "_getResourcesRef() {\n let resources = this.resources;\n\n if (resources) {\n resources.forEach(function (res) {\n res.elt = ResourceManager.getResourceById(res.id);\n });\n }\n }", "title": "" }, { "docid": "ac0b53f1b8969bee70dfea5888fa2c75", "score": "0.39904127", "text": "createComponent() {\n const ctx = this;\n return (uri, req) => {\n ctx.emit(StatuspageAPI.CREATE_COMPONENT, uri, req);\n const comp = ctx.cfg.incubator && ctx.cfg.incubatorComponent\n ? ctx.cfg.incubatorComponent\n : ctx.cfg.component;\n return ctx.reply(JSON.stringify(comp));\n };\n }", "title": "" } ]
531fdce617df77f3d4f94d0090879bef
Don't emit readable right away in sync mode, because this can trigger another read() call => stack overflow. This way, it might trigger a nextTick recursion warning, but that's not so bad.
[ { "docid": "a29a3afe69c217fc13b023a5fbcb380b", "score": "0.68428785", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable) return;\n\n state.emittedReadable = true;\n if (state.sync) process.nextTick(function () {\n emitReadable_(stream);\n });else emitReadable_(stream);\n}", "title": "" } ]
[ { "docid": "f78f6f036ed11ec205214911a648f607", "score": "0.7172806", "text": "function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug(\"emitReadable\",state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream)}}", "title": "" }, { "docid": "935276f3134afe98115dcb01f8477266", "score": "0.71162415", "text": "function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream);}}", "title": "" }, { "docid": "935276f3134afe98115dcb01f8477266", "score": "0.71162415", "text": "function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream);}}", "title": "" }, { "docid": "7299c96550cea3de930ffb7a762ec963", "score": "0.69793797", "text": "function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;if(state.sync)pna.nextTick(emitReadable_,stream);else emitReadable_(stream);}}", "title": "" }, { "docid": "761854a312e6cda78f1a24f1fa7a2fd9", "score": "0.69337976", "text": "function emitReadable(stream){var state=stream._readableState;debug('emitReadable',state.needReadable,state.emittedReadable);state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;process.nextTick(emitReadable_,stream);}}", "title": "" }, { "docid": "c62519a74fabb5c3a4c2bc5f9dc874eb", "score": "0.69214106", "text": "function emitReadable$1(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug$1('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) nextTick(emitReadable_$1, stream);else emitReadable_$1(stream);\n }\n}", "title": "" }, { "docid": "81fe90a0e0e0440e8fb02d4f805f51a1", "score": "0.6902708", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\t\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "785d22e990ac572bf9cc53e3a3d787de", "score": "0.689619", "text": "function emitReadable$2(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug$2('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextickArgs.nextTick(emitReadable_$2, stream);else emitReadable_$2(stream);\n\t }\n\t}", "title": "" }, { "docid": "7b3ece83502baf151de03ceecfe149f1", "score": "0.6884233", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.68743736", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "700f44c46cd62040e34249be38e6871b", "score": "0.68607044", "text": "function emitReadable$1(stream) {\n\t var state = stream._readableState;\n\t debug$2('emitReadable', state.needReadable, state.emittedReadable);\n\t state.needReadable = false;\n\n\t if (!state.emittedReadable) {\n\t debug$2('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t nextTick(emitReadable_$1, stream);\n\t }\n\t}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826772", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826772", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826772", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826772", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826772", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826772", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826772", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "68e9d958a05e167256fac13052e62c79", "score": "0.68257976", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n timers.setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "68e9d958a05e167256fac13052e62c79", "score": "0.68257976", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n timers.setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "68e9d958a05e167256fac13052e62c79", "score": "0.68257976", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n timers.setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "f7c3b8cc9b90cc81bfcd5f905964f047", "score": "0.67516327", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "f7c3b8cc9b90cc81bfcd5f905964f047", "score": "0.67516327", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "e69bd9d6310cc1dbe80f123cdf7224b5", "score": "0.67440367", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t processNextTick(emitReadable_, stream);\n\t else\n\t emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.6741438", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "304a4a1a94263e37e52eb2e8fb5b2642", "score": "0.67395014", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "57f31a5ba3d2357a7a60eb1536ac4679", "score": "0.6721637", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "454f42a9660fc95c185976157e1843b0", "score": "0.6720383", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "454f42a9660fc95c185976157e1843b0", "score": "0.6720383", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "454f42a9660fc95c185976157e1843b0", "score": "0.6720383", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67158604", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "f93f9700d49cd1620153e75d77f6b982", "score": "0.6711762", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" } ]
e6881a25dd3fb4b4b910692742338446
1 unit of expiration time represents 10ms.
[ { "docid": "28fde11ff9aa3a06310c28855f1ad82c", "score": "0.6495601", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n }", "title": "" } ]
[ { "docid": "45b4830520b41bb2ded9bcf73bca8ac2", "score": "0.69098455", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_OFFSET;}", "title": "" }, { "docid": "45b4830520b41bb2ded9bcf73bca8ac2", "score": "0.69098455", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_OFFSET;}", "title": "" }, { "docid": "45b4830520b41bb2ded9bcf73bca8ac2", "score": "0.69098455", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_OFFSET;}", "title": "" }, { "docid": "45b4830520b41bb2ded9bcf73bca8ac2", "score": "0.69098455", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_OFFSET;}", "title": "" }, { "docid": "45b4830520b41bb2ded9bcf73bca8ac2", "score": "0.69098455", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_OFFSET;}", "title": "" }, { "docid": "45b4830520b41bb2ded9bcf73bca8ac2", "score": "0.69098455", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_OFFSET;}", "title": "" }, { "docid": "45b4830520b41bb2ded9bcf73bca8ac2", "score": "0.69098455", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_OFFSET;}", "title": "" }, { "docid": "8fd824755359c8551fd1ea4a73cac6bd", "score": "0.6819211", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn MAGIC_NUMBER_OFFSET-(ms/UNIT_SIZE|0);}", "title": "" }, { "docid": "8fd824755359c8551fd1ea4a73cac6bd", "score": "0.6819211", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn MAGIC_NUMBER_OFFSET-(ms/UNIT_SIZE|0);}", "title": "" }, { "docid": "8fd824755359c8551fd1ea4a73cac6bd", "score": "0.6819211", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn MAGIC_NUMBER_OFFSET-(ms/UNIT_SIZE|0);}", "title": "" }, { "docid": "8fd824755359c8551fd1ea4a73cac6bd", "score": "0.6819211", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn MAGIC_NUMBER_OFFSET-(ms/UNIT_SIZE|0);}", "title": "" }, { "docid": "8fd824755359c8551fd1ea4a73cac6bd", "score": "0.6819211", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn MAGIC_NUMBER_OFFSET-(ms/UNIT_SIZE|0);}", "title": "" }, { "docid": "8fd824755359c8551fd1ea4a73cac6bd", "score": "0.6819211", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn MAGIC_NUMBER_OFFSET-(ms/UNIT_SIZE|0);}", "title": "" }, { "docid": "8fd824755359c8551fd1ea4a73cac6bd", "score": "0.6819211", "text": "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn MAGIC_NUMBER_OFFSET-(ms/UNIT_SIZE|0);}", "title": "" }, { "docid": "368b757599e5ebb2b5cbb784eecb9690", "score": "0.6733106", "text": "function getApiExpirationTime() {\n var expiration = Date.now() + 10 * 60 * 1000;\n \n return expiration;\n}", "title": "" }, { "docid": "45b0aa3a728ce1952a6da6539c3c838a", "score": "0.6684635", "text": "function msToExpirationTime(ms){// Always subtract from the offset so that we don't clash with the magic number for NoWork.\nreturn MAGIC_NUMBER_OFFSET-(ms/UNIT_SIZE|0);}", "title": "" }, { "docid": "9d80e459507f8ca6667a34c7718f5b8d", "score": "0.6652194", "text": "function setExpiration(exp) {\n\t\tvar time = 0;\n\n\t\ttime += (exp.minutes) ? 1000 * 60 * exp.minutes : 0;\n\t\ttime += (exp.hours) ? 1000 * 60 * 60 * exp.hours : 0;\n\t\ttime += (exp.days) ? 1000 * 60 * 60 * 24 * exp.days : 0;\n\t\ttime += (exp.weeks) ? 1000 * 60 * 60 * 24 * 7 * exp.weeks : 0;\n\t\ttime += (exp.months) ? 1000 * 60 * 60 * 24 * 31 * exp.months : 0;\n\t\ttime += (exp.years) ? 1000 * 60 * 60 * 24 * 365 * exp.years : 0;\n\n\t\treturn new Date(new Date().getTime() + time).getTime();\n\t}", "title": "" }, { "docid": "4962053d4c1678acecf71d842f9fcda1", "score": "0.66518724", "text": "computeExpiration (token) {\n let dt = new Date()\n return ((dt.getTime() / 1000) + (token * 1000))\n }", "title": "" }, { "docid": "aa69207ef7e75ae0dbab2fa78dbb353c", "score": "0.6646633", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return ((ms / UNIT_SIZE) | 0) + MAGIC_NUMBER_OFFSET\n }", "title": "" }, { "docid": "e6a223b8622354ede68d2f7b241c5723", "score": "0.66362375", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n }", "title": "" }, { "docid": "1fbea9dbeb50b26b88b67a26c3309c93", "score": "0.66288275", "text": "getExpirationTime() {\n\t \treturn this.expirationTime;\n\t }", "title": "" }, { "docid": "f5a2b225cf7e6322cfaa98752b0aa106", "score": "0.6606881", "text": "static set expirationDelay(value) {}", "title": "" }, { "docid": "ba23a4e619857ac9336df9eef062d7d9", "score": "0.6600097", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n }", "title": "" }, { "docid": "ba23a4e619857ac9336df9eef062d7d9", "score": "0.6600097", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n }", "title": "" }, { "docid": "ba23a4e619857ac9336df9eef062d7d9", "score": "0.6600097", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n }", "title": "" }, { "docid": "ba23a4e619857ac9336df9eef062d7d9", "score": "0.6600097", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n }", "title": "" }, { "docid": "ba23a4e619857ac9336df9eef062d7d9", "score": "0.6600097", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n }", "title": "" }, { "docid": "ba23a4e619857ac9336df9eef062d7d9", "score": "0.6600097", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n }", "title": "" }, { "docid": "ba23a4e619857ac9336df9eef062d7d9", "score": "0.6600097", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n }", "title": "" }, { "docid": "ba23a4e619857ac9336df9eef062d7d9", "score": "0.6600097", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n }", "title": "" }, { "docid": "ed93a6440fdf20e9286babd089a24cfb", "score": "0.65943277", "text": "static get expirationDelay() {}", "title": "" }, { "docid": "0d325f8deb9fefdc0d127c00fc4c2fd9", "score": "0.65921086", "text": "static getExpirationTime(iat) {\n const exp = iat + 3600; // 3600 seconds = 1 hour\n return exp;\n }", "title": "" }, { "docid": "be6ddfa6194efe5af5bff3ed52ab5a73", "score": "0.6543331", "text": "function msToExpirationTime(ms) {\n\t // Always add an offset so that we don't clash with the magic number for NoWork.\n\t return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n\t}", "title": "" }, { "docid": "be6ddfa6194efe5af5bff3ed52ab5a73", "score": "0.6543331", "text": "function msToExpirationTime(ms) {\n\t // Always add an offset so that we don't clash with the magic number for NoWork.\n\t return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n\t}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "a429e1ccc231ba4d98c873e0130fde40", "score": "0.6496365", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "7ae2d4e3fe08dc82bee4bccbc3f1c485", "score": "0.64321184", "text": "function msToExpirationTime(ms: number): ExpirationTime {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return ((ms / UNIT_SIZE) | 0) + MAGIC_NUMBER_OFFSET;\n}", "title": "" }, { "docid": "de1445e7031b486a4b096fff04886929", "score": "0.63814265", "text": "function msToExpirationTime(ms) {\n // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n }", "title": "" }, { "docid": "de1445e7031b486a4b096fff04886929", "score": "0.63814265", "text": "function msToExpirationTime(ms) {\n // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n }", "title": "" }, { "docid": "de1445e7031b486a4b096fff04886929", "score": "0.63814265", "text": "function msToExpirationTime(ms) {\n // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n }", "title": "" }, { "docid": "de1445e7031b486a4b096fff04886929", "score": "0.63814265", "text": "function msToExpirationTime(ms) {\n // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n }", "title": "" }, { "docid": "de1445e7031b486a4b096fff04886929", "score": "0.63814265", "text": "function msToExpirationTime(ms) {\n // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n }", "title": "" }, { "docid": "de1445e7031b486a4b096fff04886929", "score": "0.63814265", "text": "function msToExpirationTime(ms) {\n // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n }", "title": "" }, { "docid": "de1445e7031b486a4b096fff04886929", "score": "0.63814265", "text": "function msToExpirationTime(ms) {\n // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n }", "title": "" }, { "docid": "a9c6842798e8d2c4d70fab20c0c9a6ab", "score": "0.63793856", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n}", "title": "" }, { "docid": "a9c6842798e8d2c4d70fab20c0c9a6ab", "score": "0.63793856", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n}", "title": "" }, { "docid": "a9c6842798e8d2c4d70fab20c0c9a6ab", "score": "0.63793856", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n}", "title": "" }, { "docid": "a9c6842798e8d2c4d70fab20c0c9a6ab", "score": "0.63793856", "text": "function msToExpirationTime(ms) {\n // Always add an offset so that we don't clash with the magic number for NoWork.\n return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n}", "title": "" } ]
c82b7377041a61b7128ddce0be655113
Write to the results list and display it to the user
[ { "docid": "5cf5f196be2ced78d0725714154da1f8", "score": "0.66229314", "text": "function outputPossible(myArr) {\n\tfor (let i = 0; i < myArr.length; i++) {\n\t\tresults.innerHTML += '<li class=\"resultItem list-group-item\">' + myArr[i] + '</li>';\n\t}\n\tshowResult(1);\n}", "title": "" } ]
[ { "docid": "77a83865914919b7b725d19d38411896", "score": "0.73638326", "text": "function showResults(results) {}", "title": "" }, { "docid": "6e6e5d9c201138127f6f570ff41e5ff5", "score": "0.7360466", "text": "function showResults() {}", "title": "" }, { "docid": "fb7fb71d737d478fe59bec59a71d0fe2", "score": "0.7350528", "text": "function outputResults() {\n outputHeader();\n // iterate through detail records\n for (j=0; j < detailDataList.length; j++) {\n outputOneResult(detailDataList[j]);\n }\n}", "title": "" }, { "docid": "72e3ec85728c4f2201fa92016627b644", "score": "0.7342795", "text": "function displayResults(results)\n{\n document.write(results);\n \n}", "title": "" }, { "docid": "69c11abaaa33ea5b48bf17d31c19cfde", "score": "0.7087002", "text": "function displayResults(resultsList) {\n // define accomplishment list templates\n var HTMLresultsStart = '<ul class=\"results\"></ul>';\n var HTMLresults = '<li class=\"result\">%data%</li>';\n\n // start a new results list\n $('.work-entry:last').append(HTMLresultsStart);\n\n // iterate through results array\n resultsList.forEach(function(thisResult){\n // format and display result\n var formattedResult = HTMLresults.replace('%data%', thisResult);\n $('.results:last').append(formattedResult);\n });\n}", "title": "" }, { "docid": "92daf29cdb2c7162585e4e8239747a00", "score": "0.6999163", "text": "function print(results){\r\n\tvar resultsList = document.getElementById(\"s-results-list-atf\");\r\n\tresultsList.innerHTML = '';\r\n\tfor(var i = 0; i < results.length; i++){\r\n\t\tresultsList.appendChild(results[i].li);\r\n\t}\r\n}", "title": "" }, { "docid": "92306dbc97d9f10cad1895e2d547467f", "score": "0.6919779", "text": "function renderResults ( list ) {\n $results_list.append(\n $results_template.render( list )\n );\n }", "title": "" }, { "docid": "e4fa976f9271c4ac3dbeef8b8692d8e3", "score": "0.6830982", "text": "function displayResults(results, callbackInsertResult, callbackSaveArticle){\r\n\r\n // Assign div for results to variable\r\n let searchResults = document.getElementById('searchResults');\r\n\r\n // Clear content of div before displaying results\r\n searchResults.innerHTML = '';\r\n\r\n // Loop over each result\r\n results.forEach(result => {\r\n\r\n callbackInsertResult(result, searchResults);\r\n });\r\n\r\n callbackSaveArticle(assignSaveButtons, assignSaveListeners);\r\n}", "title": "" }, { "docid": "baa812bfb2de4b50a40ed7c254ded46e", "score": "0.68300635", "text": "function showResults() {\n console.clear();\n console.log(userdata);\n console.log(machinedata);\n console.log(data);\n}", "title": "" }, { "docid": "d7db17642be6c4f2e11e4b165844d49c", "score": "0.68286383", "text": "function showResults() {\n // console.log(data)\n }", "title": "" }, { "docid": "0321e8d6cc24b4278596f9d9e5c13764", "score": "0.67144036", "text": "function displaySearchResults(results) {\n\t$('#searchResults').empty();\n\tfor (var i = 0; i < results.length; i++)\n\t\t$('#searchResults').append(\n\t\t\t'<p>' + results[i].user + ': ' + results[i].text + '</p>'\n\t\t);\n}", "title": "" }, { "docid": "4258eea6daa35981556db433b2db5bfd", "score": "0.6667484", "text": "function renderResult(result) {\n\tconsole.log(results);\n}", "title": "" }, { "docid": "bec049959c4498351a37cf0e393e425d", "score": "0.665363", "text": "function printResults () {\n\t\t// Print results for as many times are there are urls, indexed against var i\n\t\tfor (var i = 0; i < noOfUrls; i++) {\n\t\t\t// Output result from index var i\n\t\t\t\tconsole.log(results[i])\n\t\t}\n\t}", "title": "" }, { "docid": "c60e43f90bad20246315ec0fc967a978", "score": "0.6619897", "text": "function showResults() {\n let winner = \"\";\n\n // Determine who is the winner\n if (finalStatus[0].player1Score > finalStatus[0].player2Score) {\n winner = finalStatus[0].playerNames;\n } else {\n winner = finalStatus[0].playerName2;\n }\n\n // send the data to the room\n io.to(usrRoom).emit(\"quiz result\", {\n round: finalStatus[0].round,\n room: usrRoom,\n won: winner,\n playerNames: [finalStatus[0].playerName1, finalStatus[0].playerName2],\n playerScore: [finalStatus[0].player1Score, finalStatus[0].player2Score],\n });\n }", "title": "" }, { "docid": "f665c35de6d62ae4201e35e59683c13c", "score": "0.66173923", "text": "function display_results(results) {\n console.log(\"The following sequences of lotto numbers have occured more than once since \" + parseInt(OLDEST_YEAR_DOCUMENTED+1));\n console.log(results);\n }", "title": "" }, { "docid": "1afb346c05da3d11a7759fc20e1d1557", "score": "0.6584172", "text": "function displayResults(results) {\n const searchResults = document.querySelector('.searchResults');\n searchResults.innerHTML = '';\n results.map(result => {\n const url = encodeURI(`https://en.wikipedia.org/wiki/${result.title}`);\n searchResults.insertAdjacentHTML('beforeend',\n `<div class=\"resultItem\">\n <h3 class=\"resultItem-title\">\n <a href=\"${url}\" target=\"_blank\" rel=\"noopener\">${result.title}</a>\n </h3>\n <span class=\"resultItem-snippet\">${result.snippet}</span><br>\n <a href=\"${url}\" class=\"resultItem-link\" target=\"_blank\" rel=\"noopener\">${url}</a>\n </div>`\n );\n });\n }", "title": "" }, { "docid": "770f69e1f274fb0c429667facea03069", "score": "0.658152", "text": "function outputSPARQLResults(results) {\n for (row in results) {\n printedLine = '';\n for (column in results[row]) {\n printedLine = printedLine + results[row][column].value + ' '\n }\n console.log(printedLine)\n }\n}", "title": "" }, { "docid": "375feeff892d0c74429a8404e396fc78", "score": "0.65609753", "text": "function print() {\n\ttoggle(true);\n\n\tfor (var i = 0; i < results.length; i++) {\n\t\tbuilder(results[i], i);\n\t}\n\n\tsetResultsCount(results.length);\n}", "title": "" }, { "docid": "ecc09e679a7a93bca2ec81db11085e2d", "score": "0.65334606", "text": "function printResults(){\n\tconsole.log(this.results)\n}", "title": "" }, { "docid": "f9229455a40366a4901a9c8c7373a24d", "score": "0.6529728", "text": "function printResults() {\n\n\tfor(var i=0; i<restaurantsData.length; i++ ){\n\t\t var restaurantsInfomation = restaurantsData[i].name;\n\t\t var restaurantsDescription = restaurantsData[i].description;\n\t\t var restaurantsDirection = restaurantsData[i].direction;\n\t\t var restaurantsPhoto = restaurantsData[i].photoURL;\n\t\t \n\t\t creatElents(restaurantsInfomation, restaurantsDescription,restaurantsDirection, restaurantsPhoto)\n\t}\n\t\n\t\n}", "title": "" }, { "docid": "5bc51a1cee04b0884514a80ee008b2c3", "score": "0.6522831", "text": "function showResults() {\n let index = 0;\n while (index < rollResultsList.length) {\n let rollValue = document.createElement(\"li\");\n rollValue.appendChild(document.createTextNode(rollResultsList[index]));\n rollList.appendChild(rollValue);\n index++;\n }\n listAppear.appendChild(rollList);\n}", "title": "" }, { "docid": "3b58c472113c51165bdc08c5df30cb63", "score": "0.64997846", "text": "function showResults(results){\n var html = \"\";\n $.each(results, function(index,value){\n html += '<p>' + value.Title + '</p>';\n console.log(value.Title);\n });\n $('#search-results').html(html);\n }", "title": "" }, { "docid": "88a879712dcc38646ed95e7e4e54bb9b", "score": "0.6468601", "text": "function appendResults(results) {\n if (window.debugCSSUsage) console.log(\"Trying to append\");\n var output = document.createElement('script');\n output.id = \"css-usage-tsv-results\";\n output.textContent = JSON.stringify(results);\n output.type = 'text/plain';\n document.querySelector('head').appendChild(output);\n var successfulAppend = checkAppend();\n }", "title": "" }, { "docid": "86688dc7c6a54056263ebe10245a497c", "score": "0.64393955", "text": "function renderResultsToConsole(results) {\n var docs = results.rows.map(\n function (row) {\n return (row.doc)\n }\n );\n console.table(docs);\n}", "title": "" }, { "docid": "b78de9952b2f5cf6817bbcd5394d9780", "score": "0.6437022", "text": "showResults() {\n\t\tvar countArr = this.countPlayerChoices(); // A 3 element array tallying how many times each rated button was clicked\n\t\tvar resultsArr = this.convertCountsToResults(countArr); // A 3 element array that takes the countArr and finds the majority/minority/unclicked and sets them to 1, 0, and -1 respectively\n\t\tvar playersChoicesDict = this.makePlayersChoicesDict(); // A dictionary, keys are rated button names, values are the names of players who selected each button\n\t\tthis.players.forEach((player) => {\n\t\t\tplayer.socket.emit('results', resultsArr);\n\t\t\tplayer.socket.emit('nameAndShame', playersChoicesDict);\n\t\t\tplayer.socket.emit('showNewWordButton');\n\t\t});\n\t\tthis.logger.logResults(this.currentWord, playersChoicesDict);\n\t}", "title": "" }, { "docid": "567d0f40b2dbe8d9ccd5369d9969ae37", "score": "0.64305043", "text": "function serve_results(search_results,res){\n let pet = search_results.animals;\n let results;\n //error handling\n if(pet==undefined){\n results = `<h1>Petfinder: No Results Found</h1>`\n }\n else{\n results = pet.map(formatJob).join('');\n }\n results = `<h1>PetFinder Results:</h1>${results}`\n res.write(results);\n res.end();\n console.log(\"PET FINDER FINISHED\");\n function formatJob({name,url,gender,type,breeds}){\n return `<h2><a href=\"${url}\">${name}</a></h2>Type:${type}, </a></h2>Breed:${breeds.primary}, </a></h2>Gender:${gender}`;\n }\n \n}", "title": "" }, { "docid": "1656419b794f1f3bf1d1e49c9e42c2f1", "score": "0.64089257", "text": "function testSearch(results) {\n\tfor (var i = 0; i < results.length; i++) {\n\t\tresult = results[i];\n\t\tdocument.append('<h>' + result.title + '</h>');\n\t\tdocument.append('<p>' + result.snippet + '</p>');\n\t}\n}", "title": "" }, { "docid": "3110688916aeec77584683e84d6a0dd8", "score": "0.63979876", "text": "function showResults() {\n sort(); // first we sort the users per points achieved\n ranking.forEach(function(user) { // formatted output\n var numberQuestions = collection.length;\n console.log(user.name + ' ha acertado ' + user.points + ' y fallado ' + (numberQuestions - user.points));\n });\n }", "title": "" }, { "docid": "2efdddf464c0303fd192ddf1313a1847", "score": "0.63895017", "text": "function displayResults(results) {\n var $container = $('.result-list');\n $container.empty();\n $.each(results, function(i, item) {\n var $newResult = $(\"<div class='result'>\" +\n \"<div class='title'><a target='_blank' href='\" + item.html_url + \"'>\" + item.name + \"</a></div>\" +\n \"<div class='result-language'>Language: \" + item.language + \"</div>\" +\n \"<div class='result-owner'>Owner: \" + item.owner.login + \"</div>\" +\n \"<div class='result-stars'>Stars: \" + item.stargazers_count + \"</div>\" +\n \"</div>\");\n $container.append($newResult);\n });\n}", "title": "" }, { "docid": "c698b7156ec872b1d82724ea4130fb9a", "score": "0.6362463", "text": "function nl_set_results() {\n var val = '';\n for (var i=0; i<NL_NAMES.length; i++)\n val += NL_NAMES[i] + \"\\n\";\n jQuery(\"#results\").val(val);\n}", "title": "" }, { "docid": "2628e386fbd11bd1b74449326f2f5ce1", "score": "0.6356973", "text": "function displayResults( ) {\n\tconsole.log( \"Doors:\" , doors );\n\tconsole.log( \"Player 1 : \" , player1Choice );\n\tconsole.log( \"Player 2 : \" , player2Choice );\n\tconsole.log( \"Host : \" , hostChoice );\n}", "title": "" }, { "docid": "a0a07943d795507aba6af5a1008b406b", "score": "0.6353946", "text": "function showResults(places) {\n for (var i = 0; i < places.length; i++) {\n var place = places[i];\n addResult(place);\n }\n}", "title": "" }, { "docid": "c79a6d1118bb6b622f553c25754ace9d", "score": "0.634611", "text": "function setResults() {\n // Set final results\n results.show = '' +\n '<span style=\"display:block;overflow-x:auto\">' +\n '<table class=\"aIV-exQ6-table\">' +\n '<tr>' +\n '<td>' +\n '<u>Unsorted Array</u>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0 0;\">' +\n results.vals +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0 20px;\">' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>' +\n '<u>Binary Search Tree</u>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0 0;\">' +\n results.tree +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0 20px;\">' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '<span style=\"margin:0 15px;\">&dArr;</span>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>' +\n '<u>Doubly-Linked List</u>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n '<td style=\"padding:15px 0;\">' +\n results.list +\n '</td>' +\n '</tr>' +\n '</table>' +\n '</span>';\n }", "title": "" }, { "docid": "b6e0cbf2db44464a36271839be7c6dd7", "score": "0.6323622", "text": "function showResults(data) {\n DataRepo = data;\n console.log(data);\n $('#results').show();\n if (!data){\n alert(\"No data\");\n return\n }\n $(\".times\").html(0);\n for (item in data.idioms ){\n $(\"#\" + item + \" .times\").html(data.idioms[item].length);\n }\n $('.result').click(function () {\n showResultModal($(this)[0].id);\n });\n showAnalysisIdioms();\n var d = new Date(0);\n d.setUTCSeconds(data.lastAnalysis);\n $('#last-analysis').html(\"Last update: \" + d.toLocaleString());\n}", "title": "" }, { "docid": "8cb4477427df64ff97fd7e2fbe7ba24d", "score": "0.6318462", "text": "function printSpotifyResults() {\n\n\tconsole.log(\"running code\");\n\tconsole.log(\"................\")\n\n\n\tif(trackName === undefined) {\n\t\ttrackName = 'the sign ace of base';\n\t}\n\n\n\tspotify.search({ type: 'track', query: trackName }, function(err, data) {\n if ( err ) {\n console.log('Error occurred: ' + err);\n return;\n }\n\n //logs the results \n console.log(\"YOUR SEARCH RESULTS:\")\n \tfor (results in data.tracks.items) {\n \tconsole.log(\"________________________________________________________________________________________\")\n console.log(\"ARTIST: \" + data.tracks.items[results].artists[0].name);\n console.log(\"SONG: \" + data.tracks.items[results].name);\n console.log(\"ALBUM: \" + data.tracks.items[results].album.name + \" (\" + data.tracks.items[results].album.album_type + \")\");\n console.log(\"PREVIEW: \" + data.tracks.items[results].preview_url);\n console.log(\"________________________________________________________________________________________\")\n}\n});\n}", "title": "" }, { "docid": "982ac0931f662f2a8e8c6cea4628dcf5", "score": "0.6314211", "text": "function displayData(results) {\n for (var i = 0; i < results.length; i ++) {\n alert(\" Name: \" + capitalizeFirstLetter(results[i].name) + \" \\n Phone: \" + results[i].number + \"\\n City: \" + results[i].city.toUpperCase());\n }\n}", "title": "" }, { "docid": "e229b285ad2c082ed95e2b3fe6f212dc", "score": "0.6298149", "text": "function displaySearchResult() {\n albums.sort(compareSearch);\n var output = document.getElementById(\"response\");\n var formInput = document.getElementById(\"formInput\").value.trim();\n\n for (var i = 0; i < albums.length; i += 1) {\n if (albums[i].artist === formInput) {\n output.value = formInput + \" , \" + albums[i].title + \" \" + albums[i].artist;\n }\n }\n }", "title": "" }, { "docid": "8d5a9537c65c0f0966a13fef86425289", "score": "0.6296847", "text": "function showResults(){\n\n}", "title": "" }, { "docid": "a18949f5c440dd99a29d34ccdcb01302", "score": "0.629422", "text": "function displayResults(parkArray) {\n const results = formatResults(parkArray);\n console.log(results);\n $('#results-container').empty();\n $('#results-container').append(results);\n}", "title": "" }, { "docid": "f1bcfc64875b81d72a75fcf813423e63", "score": "0.62822527", "text": "function displayResult(result) {\n\tractive.set(\"results\",result);\n\t//for debug: insert json in <pre id=result>\n\t//document.querySelector(\"#result\").textContent = JSON.stringify(result, undefined, 2);\n}", "title": "" }, { "docid": "78a15cda26a0b033257c863309cd6d4e", "score": "0.6275836", "text": "function reportInfo(){\n for(var i= 0; i<allItems.length; i++){\n var resultHdr = document.getElementById('resultsHeader');\n resultHdr.textContent = 'RESULTS';\n var listItem = document.createElement('li'); // create my table Row\n viewsArray[i] += allItems[i].viewed;\n votesArray[i] += allItems[i].clicked;\n labelArray[i] = allItems[i].title;\n color1Array[i] = getRGBA();\n color2Array[i] = getRGBA();\n listItem.textContent = `${allItems[i].title}: ${allItems[i].clicked} votes -- viewed ${allItems[i].viewed} times. `;\n resultList.appendChild(listItem); // add the table to my global table body\\\n }\n saveLocalStorage();\n}", "title": "" }, { "docid": "9aba468690d110f459f785445a65e87c", "score": "0.6261894", "text": "function writeToPage(text) {\n document.getElementById('results').innerText = text;\n }", "title": "" }, { "docid": "ad07717ec5ac945d4928dd124c2af26a", "score": "0.6259326", "text": "function showResults() {\n \t\t\t\t// gameOutput is an array \n \t\t\t\tconst gameOutput = [];\n\n \t\t\t\t// add chosenAnswer, description, image and books to the HTML output \n \t\t\t\tgameOutput.push(\n \t\t\t\t\t`<div id=\"results\">\n\t\t\t\t\t<div class=\"imageResult\">\n\t\t\t\t\t\t<img src=${image} alt=\"image of ${chosenAnswer}\" class=\"character\">\n\t\t\t\t\t</div>\n\t\t\t\t\t<h2 class=\"col results m-3 text-center\"> You are ${chosenAnswer}!</h2>\n\t\t\t\t\t<div class=\"col-12 m-auto text-center books\">${description}\n \t\t\t\t\t\t <p>You are in these books: ${books}!</p>\n\t\t\t\t\t</div></div>\n\t\t\t\t\t<div class=\"text-center\">\n\t\t\t\t\t\t<button class=\"btn btn-secondary resultsBtn\"><a href=\"game.html\">Try again?</a></button></div>\n \t</div>`\n \t\t\t\t);\n \t\t\t\t// join gameOutput to html push to page \n \t\t\t\tquizContainer.innerHTML = gameOutput.join('');\n \t\t\t}", "title": "" }, { "docid": "4ab7f5d54ac5e1324787c672719517c7", "score": "0.62509555", "text": "function resultsOnScreen(){\n var lastResult = results.length - 1;\n appendTurn(lastResult);\n // $(\"table\").append(\"<tr id =\\\"row\"+lastResult + \"\\\"><td>\" + results[lastResult][0] + \"</td><td>\" + results[lastResult][1] + \"</td><td>\" + results[lastResult][2] + \"</td><td class=\\\"delete\\\"><button class=\\\"removebutton\\\"><img src=\\\"delete.png\\\" height=10px width=10px ></td></tr>\");\n }", "title": "" }, { "docid": "f2f3a8de4ba19edf413ef2d736faa873", "score": "0.6238238", "text": "function outputData() {\n inputList = document.querySelectorAll(\"li\");\n outputList = [\n `total wins: ${wins}`,\n `total losses: ${losses}`,\n `total ties: ${ties}`,\n `total score: ${result}`,\n ];\n let i = 0;\n while (i < outputList.length) {\n inputList[i].innerText = outputList[i];\n i++;\n }\n}", "title": "" }, { "docid": "7366a224ba3f8f4443853f8ae34c7ed8", "score": "0.6237315", "text": "function renderSearchResults(){\n //if results length is 0 then\n if (!results || results.length === 0) {\n searchList.innerHTML = '<li class=\"no-results\">No results found!</li>';\n return;\n }\n\n //run forEach on results for rendering every question\n results.forEach((element)=>{\n const li = document.createElement('li');\n li.classList.add('search-result');\n li.innerHTML= `\n <div class=\"query\">\n <h2>${element.query}</h2>\n </div>\n <div class=\"Topic\">\n <h3>Topic : ${element.topic} </h3>\n\n </div>\n <div class=\"Tags\">\n <p>Tags : ${element.tags} </p>\n </div>\n `;\n searchList.appendChild(li);\n });\n }", "title": "" }, { "docid": "0f697754980f545f3e0213f966c2da88", "score": "0.62318814", "text": "function renderResults() {\n let ulElem = document.getElementById('click_tracker');\n ulElem.innerHTML = '';\n for (let item of StoreItem.allItems) {\n const liElem = document.createElement('li')\n liElem.textContent = `${item.name}: ${item.clicked} click(s). ${(item.clicked/item.displayed) * 100}% clicked when displayed.`\n ulElem.appendChild(liElem)\n }\n}", "title": "" }, { "docid": "ba20035f021001019b7f1692c17d296a", "score": "0.62227386", "text": "function printResults() {\n let i = 0;\n let j = 0;\n let k = 0;\n let concatinatedString = \"\";\n let concatinatedString2 = \"\";\n let concatinatedString3 = \"\";\n while (i < matchingSounds.length) {\n concatinatedString += `${matchingSounds[i].before} `;\n i++;\n }\n while (j < replacePhoneme.length) {\n concatinatedString2 += `${replacePhoneme[j].before} `;\n j++;\n }\n while (k < addPhenome.length) {\n concatinatedString3 += `${addPhenome[k].before} `;\n k++;\n }\n console.log(`>${searchAnswer.before} \\n \\nPronunciation: ${searchAnswer.after} \n \\n \\nIdentical: ${concatinatedString} \\n \\nReplace Phoneme: ${concatinatedString2} \\n \\nAdd phoneme: ${concatinatedString3}`);\n results = `>${searchAnswer.before} \\n \\nPronunciation: ${searchAnswer.after} \n \\n \\nIdentical: ${concatinatedString} \\n \\nReplace Phoneme: ${concatinatedString2} \\n \\nAdd phoneme: ${concatinatedString3}`;\n}", "title": "" }, { "docid": "ce724d2199370aff15acc7b319a0e975", "score": "0.62222207", "text": "function Results() {}", "title": "" }, { "docid": "7bdcd9470eacf0c758159d4230cc55eb", "score": "0.6197951", "text": "function displayData(data){\n\tconst showResults = data.data.results.map((value, index) => displayResult(value));\n $(\".js-comic-results\").html(showResults);\n //if the data returned doesnt have any items\n if(data.data.results.length === 0){ \n $(\".js-comic-results\").html(`<h2 class=\"js-no-results\">Sorry, your keyword didn't return any results. Please try again.</h2>`);\n }\n}", "title": "" }, { "docid": "208de106b8fa48a1861cd638616834cd", "score": "0.61668366", "text": "function displayResults(data) {\n console.log(\"Success!\");\n console.log(data);\n\n $('#results').empty();\n\n var item = document.getElementById(\"results\");\n\n data.arr.forEach(function (item) {\n $('#results').append(item);\n });\n\n}", "title": "" }, { "docid": "da45b7b254b59eb73b3cb8540fde8bd3", "score": "0.61475605", "text": "function showResults (data, res, parser) {\n var results = '';\n\n $resultDesc.text('NPR listing of \"' + categ + '\"');\n \n if (data) {\n results = parser(data);\n $result.html(results);\n } else {\n $result.text('STATUS CODE: ' + res.status);\n }\n $('body').removeClass('wait');\n }", "title": "" }, { "docid": "2acde976a306b3edd93a8792a41fb8dc", "score": "0.61468494", "text": "function updateResult() {\n\tvar str = \"\";\n\n\t// building the list of occurences\n\t// TODO: move html out of javascript into templating variables\n\tfor (var i = MIN_LENGTH ; i < MAX_LENGTH ; i++) {\n\t\tstr += i + \" cells \" + (cells[i] == undefined || cells[i] == 0 ? '<span class=\"label label-info\">0 times</span>' : '<span class=\"label label-success\">' + cells[i] + ' times</span>') + \"<br>\";\n\t}\n\n\t$('#results .panel-body').html(str);\n\t$('#results,#submit,#cancel').show();\n}", "title": "" }, { "docid": "2e499e07fb18a21d6194e1687c05463a", "score": "0.61467594", "text": "function getResults() {\n $('#submitButton').hide();\n $('#timing-frame').hide();\n $('#result-page').empty();\n $('#main-frame').removeClass(\"main-content-frame1\");\n $('#result-page').append('<h2> Correct: ' + correctAnswer + '</h2>');\n $('#result-page').append('<h2> Incorrect: ' + incorrectAnswer + '</h2>');\n $('#result-page').append('<h2> Unanswered: ' + noAnswer + '</h2>');\n }", "title": "" }, { "docid": "5914c49e9a0c5214fd8d0196393313f3", "score": "0.61349785", "text": "function renderResults() {\n\n if (waiting == 0 && test_started == true) {\n\n driver.quit();\n var timestamp = (new Date).toISOString();\n status.total = status.pass_count + status.fail_count + status.na_count + status.error_count;\n\n logger.appendLog(status, time_stamp, cur_build, body.browser);\n\n var run_details = [results, timestamp, cur_build, status, body.browser];\n return done(run_details);\n }\n }", "title": "" }, { "docid": "e6d4bcb32bfe32893bba6af1ef73d3e2", "score": "0.61344814", "text": "function renderResults() {\n var listEl = document.getElementById('ranking');\n\n for (var i = 0; i < allImages.length; i++) {\n var rank = document.createElement('li');\n var message = (allImages[i].name + ' had ' + allImages[i].numClicked + ' and showed ' + allImages[i].timesRendered + ' times!');\n rank.textContent = message;\n listEl.appendChild(rank);\n }\n}", "title": "" }, { "docid": "861f0bc4ae2acee6826ad3315e1903e1", "score": "0.6133453", "text": "function _drawResults() {\n let songs = store.state.songs;\n\n let template = \"\";\n\n songs.forEach(song => {\n template += song.Template;\n })\n\n document.getElementById(\"songs\").innerHTML = template;\n}", "title": "" }, { "docid": "217334af0e5c973e5566da765c86de24", "score": "0.61315227", "text": "function show_results(id, results) {\n var $div = $('#' + id + '-results')\n\n var p = results.possibles,\n s = results.successes\n\n var content\n\n if (!s.length) {\n content = 'No teams meet these conditions :('\n } else {\n content =\n s.length +\n ' of ' +\n p.length +\n ' (' +\n format_percent(s.length / p.length) +\n ')' +\n ' teams went on to achieve that outcome:'\n\n content += '<ul>' + s.join('') + '</ul>'\n }\n\n $div.empty().append(content)\n}", "title": "" }, { "docid": "c2b0ca40dda6905e831276b66006f7df", "score": "0.6127527", "text": "function processResults(results) {\n\t\tvar resObj = JSON.parse(results);\n\t\t\n\t\tvar resultsTemplate = [];\n\t\t// if the response was successful loop over it\n\t\t// and create an html string to append to the DOM\n\t\tif(resObj.Response && resObj.Search) {\n\t\t\t// store search results in global variable\n\t\t\tresObj.Search.forEach(function(movie) {\n\t\t\t\t// store these values globally (by id) for later lookup\n\t\t\t\t// values that go into the html template\n\n\t\t\t\tw.omdbGlobals[movie.imdbID] = {\n\t\t\t\t\ttitle: movie.Title,\n\t\t\t\t\tposter: movie.Poster,\n\t\t\t\t\tyear: movie.Year,\n\t\t\t\t\timdbID: movie.imdbID\n\t\t\t\t};\n\n\t\t\t\t// push the rendered strings into an array\n\t\t\t\tresultsTemplate.push(\n\t\t\t\t\tcreateResultItem(w.omdbGlobals[movie.imdbID])\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\t// concat the array and append the html on the page\n\t\tvar resultsString = resultsTemplate.join('');\n\t\tvar resultsContainer = d.getElementById('results-container');\n\t\tresultsContainer.innerHTML = resultsString;\n\n\t\t// fire the next set of event listeners\n\t\tmetaEventListeners();\n\t\tfavoriteEventListeners();\n\t}", "title": "" }, { "docid": "03fd54c4e7c0fc42718b17104b5c8422", "score": "0.6119311", "text": "function complete(results) {\n $yetify.tower.emit(\"results\", results);\n }", "title": "" }, { "docid": "d442675daadea54411479a4045b11842", "score": "0.61187434", "text": "function Results () {\n \n}", "title": "" }, { "docid": "606686717a9734a345b0269906364e84", "score": "0.60863286", "text": "function displayResults (results) {\n var result;\n var color;\n for(var i = 0; i < results.length; i++){\n result = results[i];\n if(result.status === 'PASSED'){\n color = 'green';\n }\n else {\n color = 'red';\n }\n console.log(result.name + \n ' %c' + result.status, \n 'color: ' + color + ';');\n if(result.status === 'FAILED'){\n console.log('\\t%c' + (result.error || ''), 'color: red');\n }\n }\n\n}", "title": "" }, { "docid": "9f983695771f1b9cef15800e763088fe", "score": "0.60847783", "text": "emit (_results, _is_first_page, _is_final_page) {\n\n super.emit(_results, _is_first_page, _is_final_page);\n\n for (let i = 0, len = _results.length; i < len; ++i) {\n\n if (!(_is_first_page && i <= 0)) {\n this.io.stdout(\",\");\n }\n\n this.io.stdout(\n JSON.stringify(_results[i]).trim()\n );\n }\n\n return this;\n }", "title": "" }, { "docid": "3dfc04b688fd196a47067051318476d2", "score": "0.60821784", "text": "function displayResults(response) {\n\n // show alert box\n if (response.status === 'error') {\n responseList.innerHTML = '';\n loadText.innerHTML = '';\n vex.dialog.alert(response.message);\n\n // show Top Secret project list\n } else {\n responseList.innerHTML = '';\n loadText.innerHTML = 'Congratulation! Your secret projects are:';\n response['projects'].forEach(function (item) {\n var listItem = document.createElement('li');\n listItem.innerHTML = item.project_name;\n responseList.appendChild(listItem);\n });\n }\n }", "title": "" }, { "docid": "4a7231043348d4a05e3afdca3e440fd2", "score": "0.60820097", "text": "function createResultList(data) {\n const resultDiv = document.getElementById('resultsDiv');\n const resultList = document.createElement('UL');\n addAttributes(resultList, 'id', 'resultList');\n addAttributes(resultList, 'class', 'list-group');\n\n // displays only top 5 names of response to keep page manageable\n let dataLimit5 = data.length;\n if (dataLimit5 > 5) dataLimit5 = 5;\n\n for (let i = 0; i < dataLimit5; i++) {\n const city = data[i]['unique_name'];\n const capitalized = capitalizeWords(city);\n const li = document.createElement('li');\n addAttributes(li, 'class', 'list-group-item list-group-item-action');\n addAttributes(li, 'onclick', 'inputSelection(this)');\n li.appendChild(document.createTextNode(capitalized));\n resultList.appendChild(li);\n }\n resultDiv.appendChild(resultList);\n switchButtons();\n}", "title": "" }, { "docid": "b8a79a42a40e8a56b9bc3cadaf62decc", "score": "0.6074698", "text": "function writeSearchResults(data) {\n\n\tclearSiteStatus();\n\t \n\n\tvar i;\n\n\t//get a reference to our results\n\tclearElement(searchresults);\n\n\t//handle if there are no results to display\n\tif (!data.contact) {\n\n\t\tvar row = ce(\"tr\");\n\t\tif (document.all) var cell = ce(\"<td colspan=6>\",\"errorMessage\",\"\",\"No results to display\");\n\t\telse {\n\t\t\tvar cell = ce(\"td\",\"errorMessage\",\"\",\"No results to display\");\n\t\t\tcell.setAttribute(\"colspan\",\"6\");\n\t\t}\n\n\t\trow.appendChild(cell);\n\t\tsearchresults.appendChild(row);\n\n\t} else {\n\n\t\tfor (i=0;i<data.contact.length;i++) {\n\t\t\tsearchresults.appendChild(createResultEntry(data.contact[i]));\n\t\t}\t\t\t\t\t\n\n\t}\n}", "title": "" }, { "docid": "063c3bcb90fbe71736cd22f686f646ed", "score": "0.60746956", "text": "function updateResults() {\n $(settings.resultSelector).html(settings.currentResults.length == 0 ? settings.noResults : \"\");\n showMoreResults();\n}", "title": "" }, { "docid": "c79899220f6ff15e8cc7292321a324ea", "score": "0.60686475", "text": "function logResultRecords (resultsToLog) {\n\tvar logMessage = \"These records were retrieved : \\n\";\n\tif (resultsToLog.length) {\n\t\tfor (var i = 0; i < resultsToLog.length; i++) {\n\t\t\tlogMessage += JSON.stringify(resultsToLog[i]);\n\t\t} \n\t} else {\n\t\tlogMessage += \"none\";\n\t}\n\tconsole.log(logMessage);\n}", "title": "" }, { "docid": "7a94b76801d15aae5cc57403936f38f4", "score": "0.6063249", "text": "display (data) {\n this.resultsContainer.innerHTML = data;\n }", "title": "" }, { "docid": "2ae236d90625219c9d3dcfee920a03b2", "score": "0.60618", "text": "function handleResult(data) {\n\tvar results = $(\"#results\");\n\n\t// add the result to the list to present on webpage\n\tvar link = \"http://www.en.wikipedia.org/wiki/\" + encodeURI(data.title);\n\tresults.append(\"<li id='wiki_link'><a href='\" + link + \"' target='_blank'>\" + data.title + \" (\" + data.score + \")\" + \"</a></li>\");\n}", "title": "" }, { "docid": "894ee4be05bf1aeaf5569e565d8a1af9", "score": "0.60464936", "text": "function displayResult(result) {\n\tfs.writeFile('./data/scenes.json',JSON.stringify(result, null, 2));\n}", "title": "" }, { "docid": "fcde8fbd7811f7a0adb866ccfde66d5e", "score": "0.6040825", "text": "function PrintResults() {\n document.getElementById(\"wheelsRes\").innerHTML = \"Wheels\";\n document.getElementById(\"wheel1Res\").innerHTML = '<p> Wheel 1: <br>'\n + 'Marca Rueda: ' + mr1 + ' <br> ' + 'Diametro: ' + diameter1 + '</p>';\n document.getElementById(\"wheel2Res\").innerHTML = '<p> Wheel 2: <br>'\n + 'Marca Rueda: ' + mr2 + ' <br> ' + 'Diametro: ' + diameter2 + '</p>';\n document.getElementById(\"wheel3Res\").innerHTML = '<p> Wheel 3: <br>'\n + 'Marca Rueda: ' + mr3 + ' <br> ' + 'Diametro: ' + diameter3 + '</p>';\n document.getElementById(\"wheel4Res\").innerHTML = '<p> Wheel 4: <br>'\n + 'Marca Rueda: ' + mr4 + ' <br> ' + 'Diametro: ' + diameter4 + '</p>';\n }", "title": "" }, { "docid": "eaffb596920c71967b66646b0cb2744a", "score": "0.6037376", "text": "function results() {\n\n $(\"#content\").hide();\n\n $(\"#correct\").html(correct);\n $(\"#incorrect\").html(incorrect);\n $(\"#results\").show();\n }", "title": "" }, { "docid": "26ba0e98fa9bf4044ccd840593778529", "score": "0.60299355", "text": "function displayResults(result) {\n $('#results-container').html(htmlStringGenerator(result.data));\n $('#results-container').removeClass('hidden');\n $('.results-title').removeClass('hidden');\n}", "title": "" }, { "docid": "aec71818859d72ff5b98db5ea8903363", "score": "0.60209036", "text": "function showResults(data) {\n // Build results HTML\n\n //****** Display file links section ******//\n var resdir = data[\"info\"][\"resultsdir\"];\n var html = '<h2 style=\"text-align:center\">Results</h2>';\n var jid = $(\"#jid\").val();\n html += '<div id=\"jobid\">Job ID '+\n jid + ' &#8212; <a target=\"_blank\" href=\"'+resdir+'errLog.txt\"><i>View log</i></a></div><br/>';\n html += '<table id=\"resultsfiles\">';\n html += '<tr><th style=\"min-width:400px;\">PMAnalyzer files</th><th></th><th></th></tr>';\n for (i in data[\"txt\"]) {\n var fn = data[\"txt\"][i];\n $.each(fn, function(name, loc) {\n html += '<tr><td>'+name+'</td>';\n html += '<td><a class=\"filelink\" target=\"_blank\" href=\"showTable.php?jid='+jid+'&fname='+loc+'&title='+name+'\">View</a></td>';\n html += '<td><a class=\"filelink\" target=\"_blank\" href=\"'+resdir+loc+'\" download>Download</a></td></tr>';\n });\n }\n // Include zip file\n html += '<tr><td>All files (zip)</td><td></td>';\n html += '<td><a class=\"filelink\" target=\"_blank\" href=\"'+resdir+'myfiles.zip\" download>Download</a></td></tr>';\n html += '</table><br/>';\n $(\"#results\").html(html);\n\n //****** Display result images ******//\n if ($(\"input[name=figs]\").prop(\"checked\") == true) {\n html += '<div id=\"imgs\">';\n // Present summary figures\n if( data[\"samplenames\"].length > 1) {\n html += '<div class=\"resheader\"><hr><h1>All Data</h1></div>';\n html += '<div id=\"img\">';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+resdir+'growthlevels.png\"><img src=\"'+resdir+'growthlevels.png\" alt=\"Growth Levels\"></a>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+resdir+'all_median.png\"><img src=\"'+resdir+'all_median.png\" alt=\"All Median Growth Curves\"></a>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+resdir+'density_plots_all_samples.png\"><img src=\"'+resdir+'density_plots_all_samples.png\" alt=\"Density Plots\"></a>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+resdir+'box_plots_all_samples.png\"><img src=\"'+resdir+'box_plots_all_samples.png\" alt=\"Box Plots\"></a>';\n html += '</div><br/>';\n }\n for (i in data[\"samplenames\"]) {\n var sn = data[\"samplenames\"][i];\n html += '<div class=\"resheader\"><hr><h1>' + sn + '</h1></div>';\n html += '<div id=\"img\">';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+resdir+'raw_curves_'+sn+'.png\"><img src=\"'+resdir+'raw_curves_'+sn+'.png\" alt=\"Raw Growth Curves\"></a>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+resdir+'avg_'+sn+'.png\"><img src=\"'+resdir+'avg_'+sn+'.png\" alt=\"Average Growth Curves\"></a>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+resdir+'log_'+sn+'.png\"><img src=\"'+resdir+'log_'+sn+'.png\" alt=\"Logistic Growth Curves\"></a>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+resdir+'density_plots_'+sn+'.png\"><img src=\"'+resdir+'density_plots_'+sn+'.png\" alt=\"Density Plots\"></a>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+resdir+'box_plots_'+sn+'.png\"><img src=\"'+resdir+'box_plots_'+sn+'.png\" alt=\"Box Plots\"></a>';\n html += '</div><br/>';\n }\n html += '</div>';\n /*\n html += '<div id=\"imgs\">';\n // Raw growth curves\n for (var fn in data[\"imgs\"][\"rawgrowthcurves\"]) {\n var src = resdir+data[\"imgs\"][\"rawgrowthcurves\"][fn];\n html += '<div class=\"img\">';\n //html += '<h2 style=\"text-align:center;\">'+fn+'</h2>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+src+'\"><img src=\"'+src+'\" alt=\"Raw Growth Curves\"></a>';\n html += '</div><br/>';\n }\n // Mean growth curves\n /* Not producing this anymore\n var src = resdir+data[\"imgs\"][\"meangrowthcurves\"];\n html += '<div class=\"img\">';\n html += '<h2 style=\"text-align:center;\">Mean Growth Curves</h2>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+src+'\"><img src=\"'+src+'\" alt=\"Mean Growth Curves\"></a> ';\n html += '</div><br/>';\n */\n /*\n // Growth levels\n src = resdir+data[\"imgs\"][\"growthlevels\"];\n html += '<div class=\"img\">';\n html += '<h2 style=\"text-align:center;\">Growth Levels</h2>';\n html += '<a class=\"imga\" target=\"_blank\" href=\"'+src+'\"><img src=\"'+src+'\" alt=\"Growth Levels\">';\n html += '</div>';\n */\n $(\"#results\").html(html);\n }\n}", "title": "" }, { "docid": "92823c6602ff3361cd7f64f5f4d888bb", "score": "0.60128134", "text": "function displayResults(res) {\n let trails = res.trails;\n console.log(res);\n console.log(trails);\n $('#results-list').empty();\n let results = '';\n for (let i=0; i<trails.length; i++) {\n results += `<li id=id${i}>\n <h3 class=\"trailName\">${trails[i].name}</h3>\n <img src=\"${trails[i].imgSqSmall}\" class=\"trailImg\">\n <h5>Location:</h5>\n <p>${trails[i].location}</p>\n <h5>Overview:</h5>\n <p>${trails[i].summary}</p>\n <div class =\"rating-num\">\n <p>${trails[i].stars}</p>\n </div>\n <h5 class=\"rating-label\">Rating</h5>\n <div class=\"rem-res-cont\">\n <h5>Length:</h5>\n <p>${trails[i].length} miles</p>\n <h5>Conditions:</h5>\n <p>${trails[i].conditionStatus}</p>\n <h5>Coordinates:</h5>\n <p>${trails[i].longitude}, ${trails[i].latitude}</p>\n </div>\n <img src='imgs/play-icon.jpeg' id='play-icon'>\n </li>`;\n }\n $(\".results\").replaceWith(`<section class='results'><ul class='results-list'>${results}</ul></results>`);\n $('.results').removeClass('hidden');\n return res;\n}", "title": "" }, { "docid": "d2b4b240206dd7fb5ea74f3851c252a8", "score": "0.6002506", "text": "function viewResults() {\n renderResults();\n renderChartData();\n}", "title": "" }, { "docid": "79d12607d9cf339f0ca6e172774dcd1a", "score": "0.5999992", "text": "function printResult(result) {\n results_table.innerHTML += `<h3><a href=\"${result.item.permalink}\">${result.item.title}</a></h3>`;\n if(result.item.description) {\n results_table.innerHTML += `<p>${result.item.description.substring(0, 300)}...</a></p>`;\n } else {\n results_table.innerHTML += `<p><i>Cannot display page contents.</i></p>`;\n }\n results_table.innerHTML += `<p><a href=\"${result.item.permalink}\"><code>${result.item.permalink}</code></a></p><hr>`;\n}", "title": "" }, { "docid": "976c3dae4a9e3b352ba17ffda5c987c1", "score": "0.5985706", "text": "function _drawResults() {\n let songs = ProxyState.songs\n let template = \"\"\n songs.forEach(s => template += s.Template)\n document.getElementById(\"songs\").innerHTML = template\n}", "title": "" }, { "docid": "056d48ac9326baf456a027ab15898d58", "score": "0.5979327", "text": "function outputResults(){\r\n console.log('started outputResults');\r\n console.log('courses in coursesInfo: ' + courseInfos.length);\r\n\r\n courseInfos.forEach(function(currCourseInfo){\r\n if (currCourseInfo.dept === DEFAULT_DEPT){\r\n console.log(currCourseInfo.prerequisites);\r\n currCourseInfo.prerequisites.forEach(function(currRequirement){\r\n console.log(currRequirement.requirement);\r\n })\r\n console.log(currCourseInfo.prerequisites.requirement);\r\n // console.log(currCourseInfo.prerequisites.requirement + ' --> ' + currCourseInfo.fullCourseNum);\r\n }\r\n\r\n });\r\n //not sorted??\r\n console.log('finished outputResults');\r\n}", "title": "" }, { "docid": "1f20312af5d8627870b04f10499d067c", "score": "0.5965817", "text": "function displayResults(){\n incorrect_answer_count = (questions.length - correct_answer_count);\n $('#result_div').append(\"<div id='correct_answer_count'>Correct Answers: \" + correct_answer_count + \"<div>\");\n $('#result_div').append(\"<div id='incorrect_answer_count'>Incorrect Answers: \" + incorrect_answer_count + \"<div>\");\n $('#result_div').append(\"<div id='unanswered_answer_count'>Unanswered Questions: \" + unanswered_count + \"<div>\");\n }", "title": "" }, { "docid": "e5cec0520b84ca0dcf69d710a24f1d1f", "score": "0.59548736", "text": "function displayResults() {\n $('header h1').text('Results');\n $('header p').text('Results show only 6 restaurants at a time: Please select the restaurant you would like to go to.');\n $('.choice-page').toggle('hidden');\n $('.js-results-container').toggle('hidden');\n}", "title": "" }, { "docid": "336949d1c96293888357b4255626b1d6", "score": "0.59471536", "text": "function displayResults(responseJson){\n for( let i = 0; i < responseJson.length; i++){\n $('.results-list').append(`\n <a href=\"${responseJson[i].link}\">${responseJson[i].name}</a><br>\n `);\n }\n\n}", "title": "" }, { "docid": "5bd7edca1cd78afa7bdb5155019b63b5", "score": "0.59449035", "text": "function display_all() {\n\tvar result_documents = QUOTEDB_DOCUMENTS;\n\tresult_documents = result_documents.slice(0, RESULTS_PER_PAGE);\n\tupdate_search_results_vue({result_documents, truncate: true});\n}", "title": "" }, { "docid": "fc21183023dae81894fc18cf6f3fede7", "score": "0.59394574", "text": "function emptyOutput() {\n\tlet output = document.getElementById('results');\n\toutput.innerHTML = '***Results Go Here***';\n}", "title": "" }, { "docid": "35a63d4f4e693b769948048b1c50e413", "score": "0.5935765", "text": "function displayResults(responseJson) {\n $('#results').empty();\n $('#results').append(`${responseJson.lyrics}`);\n $('#results').removeClass('hidden');\n}", "title": "" }, { "docid": "3a549cf68812cf7a3d57bec5effa4fd0", "score": "0.5935351", "text": "function renderResults() {\n //clear out inner html of \"product clicks\"\n resultsUlElem.innerHTML = '';\n //add an h2 element with text content of results\n let createH2Elem = document.createElement('h2');\n createH2Elem.textContent = 'Results';\n resultsUlElem.appendChild(createH2Elem);\n \n //loop through the all products array and render an li for each product\n for (let i=0; i < Product.allProducts.length; i++) {\n let currentItem = Product.allProducts[i]\n let liElement = document.createElement('li');\n \n //\"image name\" : \"x amount\" of votes and timesShown\n liElement.textContent = `${currentItem.name} Votes: ${currentItem.timesVoted} Times Shown: ${currentItem.timesShown} `\n resultsUlElem.appendChild(liElement);\n }\n}", "title": "" }, { "docid": "cd450335856ee45445598bd6d47c3f72", "score": "0.5932278", "text": "function searchFullResults(results_raw) {\n console.log(\"results raw\", results_raw);\n // If nothing is returned, set the import message\n if(!results_raw || results_raw == \"[]\")\n holderSayEmpty();\n // Otherwise generate the output for it\n else {\n var results = JSON.parse(results_raw),\n output = \"\",\n result, i;\n for(i in results) {\n result = results[i];\n output += printBookDisplaySmall(result);\n }\n $(\"#search_form_results\").html(output);\n }\n}", "title": "" }, { "docid": "41bc46079519b82ef18ad97c45876d8e", "score": "0.5925478", "text": "function serve_results(resultset, res) {\n page = `<!DOCTYPE html><html><head><meta charset=utf-8><style>body{font-family: 'Lucida Sans','Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana,sans-serif;padding: 30px;text-align: center;}table { width:100%; text-align: center;}table tr:nth-child(even){ background-color: #e6f7ff;}table tr:nth-child(odd) { background-color: #fff;}table th { background-color: #18558a; color: white; font-size: X-large;}</style><title>Results</title></head><body><table><tr><th>Image</th> <th>Item</th> <th>Seller</th> <th>Seller Score</th> <th>Condition</th> <th>Price</th> <th>Link<th></tr>`;\n for (let i = 0; i < resultset.itemSummaries.length; i++) {\n image = resultset.itemSummaries[i].image;\n if (image === undefined) image = \"./images/placeholder.jpg\";\n else image = image.imageUrl;\n page += `<tr>\n\t\t<td><img src=\"${image}\" height=\"100\"></td>\n\t\t<td>${resultset.itemSummaries[i].title}</td>\n\t\t<td>${resultset.itemSummaries[i].seller.username}</td>\n\t\t<td>${resultset.itemSummaries[i].seller.feedbackPercentage}%</td>\n\t\t<td>${resultset.itemSummaries[i].condition}</td>\n\t\t<td>$${resultset.itemSummaries[i].price.value}</td>\n\t\t<td><a href=\"${resultset.itemSummaries[i].itemWebUrl}\">See Listing</a></td>\n\t </tr>\n\t`;\n }\n res.writeHead(200, { \"Content-Type\": \"text/html\" });\n res.end(`<h1>Results</h1><br>${page}`);\n}", "title": "" }, { "docid": "334911d85a9b79a8b95a5c1de7b9a8d0", "score": "0.59204173", "text": "function displayResults() {\n var output = document.getElementById(\"output\");\n output.innerHTML = dbgWin.document.getElementById(\"output\").innerHTML;\n}", "title": "" }, { "docid": "836b52274a63919369034445daa7fad6", "score": "0.59189504", "text": "function displayResults(responseJson) {\n\n $('#results-list').empty();\n\n for (let i = 0; i < responseJson.limit; i++) {\n $('#results-list').append(\n ` <li>\n <h3>${responseJson.data[i].fullName}</h3>\n <p>${responseJson.data[i].description}</p>\n <a href=\"${responseJson.data[i].url}\" target=\"blank\">${responseJson.data[i].url}</a>\n </li>`\n )\n };\n\n $(\"#results\").removeClass(\"hidden\");\n\n //console.log(responseJson);\n\n\n\n\n}", "title": "" }, { "docid": "cce82ebde3c6bf1a8bf872319a8b9dde", "score": "0.5917479", "text": "function listSearchResults(rows) {\n\t///List the search results\n\t$(\"#results-container\").append(\"<dl id='results' class='search-results'></dl>\");\n\n\t///Parse each search result object\n\tfor( var iObj = 0; iObj < rows.length; iObj++) {\n\t\teachResult(\"#results\", rows[iObj]);\n\t}\n}", "title": "" }, { "docid": "5465c95081d7bf93404d24080f63ad2e", "score": "0.5912504", "text": "function submitUserResults() {\n submitFoodResult();\n submitPizzaResult();\n submitDancingResult();\n submitDrinksResult();\n submitOutsideResult();\n submitGamesResult();\n submitWaitResult();\n submitCrowdedResult();\n submitTraditionalResult();\n submitDiveResult();\n submitLiveMusicResult();\n submitSpoonsResult();\n submitNoiseResult();\n}", "title": "" }, { "docid": "8fe73ad4bcb3f6ce66579f4ba15e52e6", "score": "0.5911347", "text": "function showResult(ind) {\r\n if (results.length != 0) {\r\n resetSchedule();\r\n //redTheBadTimes();\r\n var res = results[ind].split(\",\"),\r\n theCredits = 0;\r\n for (i in res) {\r\n var id = parseInt(res[i]);\r\n displayClassForId(id);\r\n theCredits += courses[classes[id].course].credits;\r\n }\r\n $(\"#credits\").text(theCredits);\r\n }\r\n}", "title": "" }, { "docid": "ed3f0e2bb71c43beac763d1197fea1be", "score": "0.59071815", "text": "function getCalvinBallResults() {\n 'use strict';\n var displayResults = processCalvinBallScores(gameOfCalvinBall);\n var output = [];\n var resultString = '';\n\n\n displayResults.forEach(function (element, index) {\n output.push('Player ' + (index + 1) + ': ' +\n element);\n });\n\n resultString = output.join('<br>');\n gameResults.innerHTML = \"<h4>\" + resultString + \"</h4>\";\n\n return;\n}", "title": "" }, { "docid": "8a3600b65357d5825618f3c6b203f4b8", "score": "0.58898354", "text": "function showResults() {\n const ol = document.createElement(\"ol\");\n ol.classList.add(\"list-group\");\n for (el of answers) {\n const li = document.createElement(\"li\");\n li.innerText = `${el.question} Correct answer: ${el.answer}`;\n if (el.correct) {\n li.classList.add(\"bg-success\", \"list-group-item\");\n } else {\n li.classList.add(\"bg-danger\", \"list-group-item\");\n }\n ol.appendChild(li);\n infoDiv.appendChild(ol);\n }\n}", "title": "" }, { "docid": "4b2db280f4fab3177ebc82269933191c", "score": "0.5888745", "text": "function displayResults(responseJson) {\n console.log(responseJson);\n $('#results-list').empty();\n // iterate through the items array\n for (let i = 0; i < responseJson.data.length; i++){\n $('#results-list').append(\n `<li><a href='${responseJson.data[i].url}'><h3>${responseJson.data[i].fullname}</h3></a>\n <p>${responseJson.data[i].description}</p>\n </li>`\n )};\n //display the results section \n $('#results').removeClass('hidden');\n}", "title": "" }, { "docid": "c8c92d5eeb159d6850660617e88db4ef", "score": "0.58835524", "text": "function databaseDisplay(result) {\n console.log(\"Our Current Inventory:\")\n for (var x = 0; x < result.length; x++) {\n console.log(\"Item ID: \" + result[x].item_id + \", \" + \"Item Name: \" + result[x].product_name + \", \" + \"Department Name: \" + result[x].department_name + \", \" + \"Price: \" + result[x].price + \", \" + \"Quantity: \" + result[x].stock_quantity);\n }\n}", "title": "" }, { "docid": "fe7680f4213b30af08b01af5e46a01e7", "score": "0.5882236", "text": "function logResults(finalResultsList) {\n\n\t\t\tfinalResultsList.sort(function(a, b) {\n\t\t\t return a.slide - b.slide || b.hasVideo - a.hasVideo;\t\t\t\t\t\n\t\t\t})\n\n\t\t\tconsole.log(finalResultsList);\n\t\t}", "title": "" }, { "docid": "3b2ff1d39173737130fdca5b46f1e174", "score": "0.5882176", "text": "function showResults() {\r\n\t\t$('#testForm,#qtimer, .test-body').hide();\r\n\t\t$('#testResults').html(\"<table class='table table-hover'><thead><tr scope='col'><th colspan= '2'>Test \"+testNum+\" Results</th></tr></thead>\"+\r\n\t\t\"<tbody><tr><th scope='row'>Questions answered:</th><td> \"+numAnswered+\" of 5</td></tr>\"+\r\n\t\t\t\"<tr><th scope='row'>Questions correct:</th><td> \"+numCorrect+\" of 5</td></tr>\"+\r\n\t\t\t\"<tr><th scope='row'>Time elapsed:</th><td>\"+finalTime+\" </td></tr></tbody><tfoot><tr scope='col'><th colspan='2'><a href ='quiz.html' class='btn btn-primary'>Take Again</a></th></tr></tfoot></table>\"\r\n\t\t);\r\n\t}", "title": "" } ]
109c529996977f7f8eb79cf4fa886907
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
[ { "docid": "1633f9b011b7c7f867053585896838b2", "score": "0.0", "text": "function getPreciseType(propValue) {\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n}", "title": "" } ]
[ { "docid": "8a6c6e79ab0b6aa53029945fbd005dfa", "score": "0.68783313", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "title": "" }, { "docid": "8a6c6e79ab0b6aa53029945fbd005dfa", "score": "0.68783313", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "title": "" }, { "docid": "f979c1e204a3e7accc60d583ecfbf378", "score": "0.6854933", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "cc0a7a2086a64477e263fcccfdeb8cc4", "score": "0.6836981", "text": "function getPropType(propValue) {\n var propType = typeof propValue\n if (Array.isArray(propValue)) {\n return 'array'\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object'\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol'\n }\n return propType\n }", "title": "" }, { "docid": "d1cee4a495131d7a145c6856914fdb49", "score": "0.6819408", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "8a83dccfedb9891b89b34b5099c180b2", "score": "0.68192077", "text": "function getPropType(propValue) {\r\n\t var propType = typeof propValue;\r\n\t if (Array.isArray(propValue)) {\r\n\t return 'array';\r\n\t }\r\n\t if (propValue instanceof RegExp) {\r\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\r\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n\t // passes PropTypes.object.\r\n\t return 'object';\r\n\t }\r\n\t if (isSymbol(propType, propValue)) {\r\n\t return 'symbol';\r\n\t }\r\n\t return propType;\r\n\t }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "523db146639ee03eb285e67886435b41", "score": "0.68153584", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "c3c80b81ba228fff80eab9ec5c548dd7", "score": "0.68105716", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "415e8a4abaaff984382d8d8e564ac906", "score": "0.6807756", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "415e8a4abaaff984382d8d8e564ac906", "score": "0.6807756", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" } ]
b4a57ecca6f5d127a43488d9ec5d585c
Starts playing the contents of the playlist.
[ { "docid": "8b0f379c3d390b54827ab97574b20aa5", "score": "0.698098", "text": "startPlaying() {\n this.playing = true;\n this.currentSong = this.playlist.shift();\n if (this.currentSong !== undefined) {\n this.voiceChannel.join().then(connection => {\n this.playStream(connection);\n }).catch(console.error);\n }\n }", "title": "" } ]
[ { "docid": "799baefc21d0be161e965bfea4e8afc9", "score": "0.70344186", "text": "function start() {\n if(queue.length > 0) {\n currentSong = queue[0];\n if(currentSong && currentSong.isValid) {\n var songPath = DOWNLOAD_DIR + currentSong.id + '.mp3';\n audioStream.playAudioFile(songPath);\n audioStream.once('fileEnd', songEnded);\n }\n } else {\n currentSong = null;\n }\n\n}", "title": "" }, { "docid": "4101b6fe0117b6f84e70f2adbbad4da8", "score": "0.69379", "text": "function startStream() {\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('GET', \"/startStream\");\n\txhr.addEventListener('readystatechange', function() {\n\t\tif (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {\n\t\t\tconsole.log(\"isPlaying: \"+isPlaying);\n\t\t\tif(xhr.responseText != \"No song in the playlist\"){\n\t\t\t\tplay(xhr.responseText);\n\t\t\t}\n\t\t\tconsole.log(\"here: \"+xhr.responseText);\n\t\t\tdocument.getElementById('liveSong').innerHTML = xhr.responseText;\n\t\t}\n\t});\n\txhr.send();\n}", "title": "" }, { "docid": "9065603249664aa05d024b6cfe20e89d", "score": "0.6815567", "text": "function play() {\n start_time = new Date().getTime();\n player.add({\n clear: true,\n playlist: playlist\n }).then(player.play()).then(function(){\n console.log(\"playing has started\");\n powerLED.emit({\n colour: [0, 255, 0]\n });\n });\n}", "title": "" }, { "docid": "87392c5bbeed1778ab373285918759b8", "score": "0.6800686", "text": "function startPlaylist() {\n if (!initialized) {\n initializeBackgroundAudio();\n var message = new Windows.Foundation.Collections.ValueSet();\n if (serverStarted == true) {\n message.insert(Messages.StartPlayback, \"\");\n Windows.Media.Playback.BackgroundMediaPlayer.sendMessageToBackground(message);\n initialized = true;\n }\n }\n\n document.getElementById(\"PauseButton\").disabled = false;\n document.getElementById(\"NextButton\").disabled = false;\n}", "title": "" }, { "docid": "78d518378624350c420434dba73ad080", "score": "0.677939", "text": "function actionPlay(){\n\n\tif (!is_playing) {\n\t\tif(playlist_no == playlist_showing_no){\n\t\t\tplayerdom.play();\n\t\t}\n\t\telse{\n\t\t\tplaylist = playlist_showing;\n\t\t\tplaylist_no = playlist_showing_no;\n\t\t\tcurrent_track = 0;\n\t\t\tupdateShuffleList();\n\t\t\tupdateCurrentTrack();\n\t\t\tplayerdom.play();\n\t\t}\n\t}\n\telse {\n\t\tplayerdom.pause();\n\t}\n}", "title": "" }, { "docid": "be23eabf07ad45457a6693013175283a", "score": "0.6769577", "text": "playlistPlay()\n\t{\n\t\tconsole.log(\"PlaylistPlay() \"+this.playlist[0].url);\n\t\t\n\t\tYoutubeDL.getInfo(this.playlist[0].url, ['-q', '--no-warnings', '--force-ipv4'], (err, info) => {\n\t\t\n\t\tthis.voiceStream = this.voiceConnection.playStream( Request(info.url), {seek:0,volume:this.playVolume} );\n\t\tthis.targetChannel.sendMessage(\"Now playing: **\"+info.title+\"**.\");\n\t\t\n\t\tthis.voiceStream.on(\"end\",(function(){\n\t\t\tthis.playlist.shift();\n\t\t\t\n\t\t\tif (this.playlist.length > 0){this.playlistPlay();}\n\t\t\telse{this.targetChannel.sendMessage(\"The playlist has ended.\"); this.isPlaying = false;}\n\t\t}).bind(this));\n\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "c22d55faf9859b3e4336c4896dd7b263", "score": "0.66322553", "text": "start() {\n let stream = ytdl(this.url, {filter: 'audioonly'});\n stream.on(\"error\", (err) => {console.error(err)});\n\n this.dispatcher = this.guild.voiceConnection.playStream(stream, {seek: 0, volume: 1});\n this.dispatcher.on(\"end\", (reason) => {\n console.log(\"Song ended. Reason: \" + reason)\n this.status = Song.states.DONE;\n this.guild.queue.loadNextSong();\n });\n this.dispatcher.on(\"error\", (err) => {console.error(err)});\n }", "title": "" }, { "docid": "2c1ae6a53606ba36ba89d86d93d76350", "score": "0.6622452", "text": "function startSection3() {\n playMp3(l); \n replayUserSong();\n}", "title": "" }, { "docid": "ee82f7e2a1c71cd62d13d099444e07e8", "score": "0.6608969", "text": "function play() {\n setPlaying(true);\n }", "title": "" }, { "docid": "8e51bf4059ae55594bacb91d86a2832a", "score": "0.6578264", "text": "play () {\n\n // If there are no objects in this collection, don't even try to play.\n if (!this.listOfMediaFileObjects.length > 0) {\n return;\n }\n\n let nowPlaying = this.getNowPlaying();\n\n // If nothing is playing yet, set the first song as playing\n // and try to get the currently playing song again.\n if (!nowPlaying) {\n this.currentMediaFileIndex = 0;\n nowPlaying = this.getNowPlaying();\n }\n\n nowPlaying.play();\n this.isPlaying = true;\n }", "title": "" }, { "docid": "5e3a9a43e349bed64089f2b336b9daf9", "score": "0.65387505", "text": "function startSection7() {\n playMp3(p);\n replayUserSong();\n}", "title": "" }, { "docid": "99413e6c41006107a82fa044ea711948", "score": "0.65304184", "text": "function play(){\n\t\t/*\n\t\t\tRun the before play callback\n\t\t*/\n\t\tAmplitudeHelpers.runCallback('before_play');\n\n\t\t/*\n\t\t\tIf the audio is live we re-conenct the stream.\n\t\t*/\n\t\tif( config.active_metadata.live ){\n\t\t\treconnectStream();\n\t\t}\n\n\t\t/*\n\t\t\tMobile remote sources need to be reconnected on play. I think this is\n\t\t\tbecause mobile browsers are optimized not to load all resources\n\t\t\tfor speed reasons. We only do this if mobile and the paused button\n\t\t\tis not clicked. If the pause button was clicked then we don't reconnect\n\t\t\tor the user will lose their place in the stream.\n\t\t*/\n\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && !config.paused ) {\n\t\t\treconnectStream();\n\t\t}\n\n\t\t/*\n\t\t\tPlay the song and set the playback rate to the playback\n\t\t\tspeed.\n\t\t*/\n\t\tconfig.active_song.play();\n\t\tconfig.active_song.playbackRate = config.playback_speed;\n\n\t\t/*\n\t\t\tRun the after play callback\n\t\t*/\n\t\tAmplitudeHelpers.runCallback('after_play');\n\t}", "title": "" }, { "docid": "04d61e82a6f1fd5633ee714a615e8d39", "score": "0.64931273", "text": "play() {\n if (this.status !== 'PLAY') {\n this.editor.focus();\n this.emit('play');\n this.playChanges();\n }\n }", "title": "" }, { "docid": "ace3e26bb9b0360fbdf469ef692c20f3", "score": "0.6484677", "text": "function play() {\n\t\t\taudio.play();\n\t\t\tstartRuntime();\n\t\t}", "title": "" }, { "docid": "1c166947285c81148c3cbd374132fb04", "score": "0.6470973", "text": "function startSection4() {\n playMp3(m); \n replayUserSong();\n}", "title": "" }, { "docid": "bb779623ef87f946653fe0617bbb3825", "score": "0.6425661", "text": "play() {\n let active = document.querySelector('.is-playing')\n\n if (active) {\n active.classList.remove('is-playing')\n }\n\n config.peeps[config.currentSong].classList.add('is-playing')\n // For plays tracking via GTM\n config.peeps[config.currentSong].querySelector('.playlist-peep__img').classList.add('is-on')\n config.audio.play()\n config.isPlaying = true\n\n if (!hasNoAudioAPI) GooPlayer.startEqualizer()\n }", "title": "" }, { "docid": "13fccc88daf44a7e10feb800fbeff83f", "score": "0.6399153", "text": "start(){\n let channel_id = this.query.channel_id;\n DB.getChannelInfoByChannelId(channel_id, (info) => {\n if(info){\n let user_id = info.user_id;\n let playlist_id = info.playlist_id;\n let token = info.master_token;\n this.spotifyApi.setAccessToken(token);\n this.spotifyApi.pause(() => {\n this.spotifyApi.play();\n DB.updatePlaybackState(channel_id, true);\n this.end();\n });\n }else{\n console.log(\"Error loading channel info: \" + channel_id);\n this.end();\n }\n });\n }", "title": "" }, { "docid": "0059967931fad56bfc2669cd06b71fa7", "score": "0.63789845", "text": "function playSong() {\n song.play();\n}", "title": "" }, { "docid": "54b767548c2b3bbdfee60a5b30643182", "score": "0.63661826", "text": "function playFirst() {\n setTrack(tempPlaylist[0], tempPlaylist, true);\n}", "title": "" }, { "docid": "1a50a1d3a003cc32b297073c3a6feeaa", "score": "0.6363607", "text": "startPlaying(props) {\n if (props.isPlaying && props.currentSong) {\n // If it should be playing any song\n const url = props.currentSong.get(\"url\");\n const format = url.split(\".\").pop();\n const isPlayable = Howler.codecs(format);\n if (isPlayable) {\n // Build a new Howler object with current song to play\n this.howl = new Howl({\n src: [url],\n html5: true, // Use HTML5 by default to allow streaming\n mute: props.isMute,\n volume: props.volume / 100, // Set current volume\n autoplay: false, // No autoplay, we handle it manually\n format: format, // Specify format as Howler is unable to fetch it from URL\n onloaderror: () => props.actions.setError(ONLOAD_ERROR), // Display error if song cannot be loaded\n onend: () => props.actions.playNextSong(), // Play next song at the end\n });\n // Start playing\n this.howl.play();\n } else {\n // Howler already performs this check on his own, but we have\n // to do it ourselves to be able to display localized errors\n // for every possible error.\n // TODO: This could most likely be simplified.\n props.actions.setError(UNSUPPORTED_MEDIA_TYPE);\n }\n }\n else {\n // If it should not be playing\n if (this.howl) {\n // Pause any running music\n this.howl.pause();\n }\n }\n }", "title": "" }, { "docid": "e65ef5ea05216b7710afa81b2055c190", "score": "0.6340304", "text": "function startSection6() {\n playMp3(o);\n replayUserSong();\n}", "title": "" }, { "docid": "1a8d2150f61774e115a30973618810c6", "score": "0.6311486", "text": "function play() {\n console.log('play()');\n mixpanel.track(\"Game started\", eventParameters);\n video.get(0).play();\n bgMusicPlayer.get(0).play();\n gestureHandler.isVideoPlaying(true);\n gestureHandler.isVideoStarted(false);\n }", "title": "" }, { "docid": "ee5af57f5e6a25ba7d140cc09a7a2f50", "score": "0.6303485", "text": "function playMusic() {\n music.play();\n }", "title": "" }, { "docid": "ddc090e7775ee0994d5f55679d30fcdd", "score": "0.6303282", "text": "function play() {\n\t\t\t\t\t\t// set playhead variable to either the last point the user paused the track or the beginning,\n\t\t\t\t\t\t// depending on the state of the track\n\t\t\t\t\t\tif (playState == 'paused') {\n\t\t\t\t\t\t\tif (elapsedPlayTime < loopDuration) {\n\t\t\t\t\t\t\t\tresumePlayTime = elapsedPlayTime;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcurrentLoopElapsedTime = elapsedPlayTime % loopDuration;\n\t\t\t\t\t\t\t\tloopCount = Math.floor(elapsedPlayTime / loopDuration);\n\t\t\t\t\t\t\t\tresumePlayTime = elapsedPlayTime - loopDuration;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (playState == 'stopped') {\n\t\t\t\t\t\t\tresumePlayTime = 0;\n\t\t\t\t\t\t\telapsedPlayTime = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treadyTracksForPlay();\n\t\t\t\t\t\tfor (i = 0; i < audioFilesNum; i++) {\n\t\t\t\t\t\t\tsourceArray[i].start(0, resumePlayTime);\n\n\t\t\t\t\t\t\tif (cbxSetTracksMemory[i] == false) {\n\t\t\t\t\t\t\t\tcbxSetTracks[i].checked = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tplayState = 'playing';\n\t\t\t\t\t\tunplayed = false;\n\n\t\t\t\t\t\t// Update status text so user know's what's happening\n\t\t\t\t\t\tstatusDisplay.classList.add('playing');\n\t\t\t\t\t\tstatusDisplay.classList.remove('loading');\n\t\t\t\t\t\tstatusDisplay.classList.remove('paused');\n\t\t\t\t\t\tstatusDisplay.classList.remove('stopped');\n\t\t\t\t\t\tstatusDisplayText.textContent = 'Playing';\n\t\t\t\t\t\tvisualizeAudio();\n\t\t\t\t\t}", "title": "" }, { "docid": "1dbc1c827233064b0274a2f58591beb3", "score": "0.6293101", "text": "play() {\n this.settings.playing = true;\n if (this.ready) {\n this.widget.play();\n }\n }", "title": "" }, { "docid": "626900aad54a90c34fc796eaf3696dae", "score": "0.62335217", "text": "[types.PLAY_FROM_LIST] (context, playListItem) {\n context.commit(types._SET_CURRENT, playListItem)\n\n audio.playFile(playListItem.path)\n .then(() => {\n context.commit(types.CHANGE_IS_PLAYING, audio.isPlaying)\n })\n }", "title": "" }, { "docid": "be68faef17926b6f7c0ba60f372348eb", "score": "0.62284166", "text": "play() {\n this.isPlaying = true;\n if (this.connectedPlayer) {\n var self = this;\n spectrumPlayers.forEach(function(item, index) {\n if (item.connectedPlayer && item.isPlaying && item != self) {\n item.pause();\n }\n });\n }\n\n try{\n this.audio.play();\n this.ui_playPauseBtn.querySelector('.spectrum-icon').classList.add('fa-pause');\n this.ui_playPauseBtn.querySelector('.spectrum-icon').classList.remove('fa-play');\n this.ui_body.scrollTop = this.playList[this.currentIndex].element.offsetTop;\n document.title = \"\\u266B\" + \" \" + this._getSongTitle(this.currentIndex);\n\n this._dispatchEvent(\"onplay\", this.playList[this.currentIndex]);\n }catch(e){ \n this.audio.pause();\n }\n }", "title": "" }, { "docid": "999b707244595208881de829b6a341c0", "score": "0.6223062", "text": "play () {\n const playing = this.howler.playing()\n\n if (!playing) {\n // Automatically load if we're trying to play\n // and the howl is not loaded\n if (this.howlerState() === 'unloaded') {\n this.load()\n }\n\n this.howler.play()\n }\n }", "title": "" }, { "docid": "b7ed0e53415c4858857029ca1ba38173", "score": "0.6215263", "text": "play() {\n let offset = PAUSED_AT\n\n // create the tracks\n this.tracks = createTracks(this.bufferList, this.get('ctx'))\n\n // connect the tracks to the merger\n this.tracks.forEach((track, idx) => track.connect(this.fx[idx][0].input))\n\n // start em up\n this.tracks.forEach(track => track.start(0, offset))\n\n // track time\n STARTED_AT = this.get('ctx').currentTime - offset\n PAUSED_AT = 0\n\n // set playing flag\n this.set('playing', true)\n }", "title": "" }, { "docid": "ab4c57650f19383db74ed52d81a3bed4", "score": "0.61802185", "text": "function startSection5() {\n playMp3(n); \n replayUserSong();\n}", "title": "" }, { "docid": "30f722b90e42db2ca555c849c90cfc0b", "score": "0.6169128", "text": "play(){\n let channel_id = this.query.channel_id;\n DB.getChannelInfoByChannelId(channel_id, (info) => {\n if(info){\n let user_id = info.user_id;\n let playlist_id = info.playlist_id;\n let token = info.master_token;\n this.spotifyApi.setAccessToken(token);\n this.spotifyApi.play();\n DB.updatePlaybackState(channel_id, true);\n this.end();\n }else{\n console.log(\"Error loading channel info: \" + channel_id);\n this.end();\n }\n });\n }", "title": "" }, { "docid": "85bb191e30c2f2b7028fb4fbc300cc7a", "score": "0.6166894", "text": "async play() {\n console.log(`Now play : ${ this.queue[0].title }`);\n this.dispatcher = this.connection.play(ytdl(this.queue[0].url, { filter: \"audio\" }));\n this.dispatcher.setVolume(this.volume);\n this.msgEmbed();\n\n this.dispatcher.on('finish', () => {\n this.queue.shift();\n if (this.queue.length != 0) {\n this.play(this.queue[0]);\n } else {\n console.log(`Finished playing`);\n // Before exit delete player and reset constructor\n this.embed.delete();\n this.connection.disconnect();\n this.reset();\n }\n });\n }", "title": "" }, { "docid": "4497a6e331c25bc7cc860014f4483492", "score": "0.61414164", "text": "play() {\n if (!this.playing) {\n this.playing = true;\n this.onCarouselPlaying.emit(this);\n this.restartInterval();\n this.stoppedByInteraction = false;\n }\n }", "title": "" }, { "docid": "f53717eb561862428cde6af10ece1529", "score": "0.61346054", "text": "function playSong(){\n song.src = songs[currentSong]; //sets the source of the 0th song\n songTitle.textContent = songs[currentSong]; //set the title of song\n\n song.play();// this is breaking cannot autoplay\n}", "title": "" }, { "docid": "842f051de15a35baedd4a9dc2778bcfb", "score": "0.61303407", "text": "play() {\n // Deactivate current active song.\n this.deactivate();\n // Activate new song.\n this.model.toggle();\n\n this.model.trigger('play', this.model);\n\n this.render();\n }", "title": "" }, { "docid": "9ddebbece452c4ace5d60e19b27ff5f6", "score": "0.612896", "text": "function start_playing ()\n\t\t{\n\t\t\tmyStopFunction('infobox');\n\t\t\tswitch (Device_type)\n\t\t\t\t\t{\n\t\t\t\t\tcase 'PCH': \n\t\t\t\t\t\t$.get(CurrentUrlPlay);\n\t\t\t\t\t\tconsole.log(\"start_playing PCH: \" +Currentfilename+ \", CurrentUrlPlay: \"+CurrentUrlPlay);\n\t\t\t\t\t\touvre_remote ();\n\t\t\t\t\tbreak; \n\t\t\t\t\tcase 'PC':\n\t\t\t\t\t\tconsole.log(\"start_playing PC: \" +Currentfilename+ \", CurrentUrlPlay: \"+CurrentUrlPlay);\n\t\t\t\t\t\twindow.open(\"Popup_Player.html\", \"YAMJv3 Player\", \"height=510, width=665, left=0, channelmode=no, directories=no, location=no,\tmenubar=no, resizable=yes, status=no, scrollbars=no,toolbar=no\",false);\n\t\t\t\t\tbreak; \n\t\t\t\t\t\t\n\t\t\t\t\tcase 'SMARTPHONE':\n\t\t\t\t\t\tvar UrlPlay=target_path[j]+filenametoplay;\n\t\t\t\t\t\t$.get(UrlPlay);\t\n\t\t\t\t\tbreak; \n\t\t\t\t\t};\n\t\t\t\n\t\t\t\n\t\n\t\t}", "title": "" }, { "docid": "829c08f527f0e5c99d403864d35901f7", "score": "0.6120508", "text": "function startPlayback() {\n\t\tif (catchingUp === false && mouseDown === false) {\n\t\t\tvideo.play();\n\t\t\tplaying();\n\t\t}\n\t}", "title": "" }, { "docid": "8d6c5737606a9ca7553e5f89f7efc5dd", "score": "0.6088327", "text": "play() {\n\t\tif(!this.is_playing() && this.cur_channel !== null) {\n\t\t\tthis.play_pause();\n\t\t}\n\t}", "title": "" }, { "docid": "393e1e7fccacc0626859d19d6db84d61", "score": "0.6076417", "text": "resumeContent() {\n\t\tif (this.contentHasStarted_ && !this.contentEnded) {\n\t\t\tthis.contentPlayer.play();\n\t\t}\n\t}", "title": "" }, { "docid": "a4537fbf0c19eed32e7d28e67751c33c", "score": "0.6051625", "text": "function playSong(index){\n let songToPlay = data.results[index].previewUrl;\n musicPlayer.src = songToPlay;\n musicPlayer.load();\n }", "title": "" }, { "docid": "fd2dad81215358055afe4f5bb3dff41b", "score": "0.6046379", "text": "play () {\n\t\tthis.video.play();\n\t\tthis.isPlaying = true;\n\t}", "title": "" }, { "docid": "eeae37928ff1ed9bb13da0a776d6dd81", "score": "0.6042884", "text": "init() {\n\t\t\t// Enter loadPlaylist on initialization\n\t\t\tloadPlaylist();\n\t\t}", "title": "" }, { "docid": "23d89c4861633cc68e04d37b2a085a34", "score": "0.602547", "text": "function playSet() {\n SC.initialize({\n client_id: '4a01792d7496116664999da099ce9b6f'\n });\n\n SC.get('/playlists/8587894', {limit: 1},\n function(tracks) {\n SC.oEmbed(tracks.permalink_url, document.getElementById(\"target\"));\n });\n}", "title": "" }, { "docid": "4a8867d00788495c5f0765bc5cce310a", "score": "0.60239756", "text": "resume() {\n\t\tthis.play(this._progress)\n\t}", "title": "" }, { "docid": "1594a30bfa82de51238a2dcd8ad84ce6", "score": "0.6014927", "text": "function play() {\n // Use the maximum of the known playing positions.\n var position = Math.max.apply(null, state.positions) || 0;\n\n // Pause other tracks, if necessary, before playing new tracks.\n if (state.playing) {\n soundManager.pauseAll();\n }\n\n var foundSound = false;\n $('.player').each(function () {\n var durationOffset = 0,\n currentSound;\n\n $(this).find('.player-item').each(function () {\n var item = state.items[$(this).attr('id')];\n if (durationOffset + item.sound.duration > position) {\n currentSound = item;\n item.durationOffset = durationOffset;\n item.sound.setPosition(position - durationOffset);\n item.sound.play();\n state.playing = true;\n foundSound = true;\n return false;\n }\n durationOffset += item.sound.duration;\n });\n });\n\n if (!foundSound) {\n stop();\n }\n else if (state.playing) {\n state.playPauseButton.html('<i class=\"fa fa-pause\"></i> Pause');\n }\n }", "title": "" }, { "docid": "087a69163b278ef359cad22b2a4fe1bd", "score": "0.5971124", "text": "play() {\n\n\t}", "title": "" }, { "docid": "b81665d21568a59cfdaacbda05e1a057", "score": "0.5970429", "text": "startMusic(){\n this.backgroundMusic.play();\n }", "title": "" }, { "docid": "28d1c919e1d1e43641515350a19a16de", "score": "0.59702253", "text": "function Play() {\n var _this = _super.call(this) || this;\n _this.Start();\n return _this;\n }", "title": "" }, { "docid": "d3573454c39cd596090d01e334790731", "score": "0.5966876", "text": "function startSection2() {\n playMp3(k);\n replayUserSong();\n}", "title": "" }, { "docid": "d8c82f2e2fb10ceebcc6b74d28cb2786", "score": "0.59537363", "text": "function startPlayback() {\n const playDuration = 10;\n var intervalID;\n\n var songId = playInfo.currentSong.spotify_uri[0];\n\n var trackID = songId.match(/track\\:(.*)/)[1]; //strip the \"spotify:\" part.\n var reqURL = 'https://api.spotify.com/v1/tracks/' + trackID;\n\n\n function playURL(audioURL) {\n $(\".playing\").remove()\n\n if (audioURL) {\n var element = document.createElement(\"audio\");\n element.className = \"playing\";\n element.src = audioURL;\n element.play();\n\n setTimeout(function() {\n globals.onSongEnd();\n\n playInfo.playhead = 0;\n clearInterval(intervalID);\n element.pause();\n\n if (playInfo.nextSong){\n playInfo.currentSong = playInfo.nextSong;\n playInfo.nextSong = undefined; \n }\n\n startPlayback();\n\n }, playDuration * 1000);\n\n intervalID = setInterval(function() {\n playInfo.playhead += 0.1 / playDuration;\n }, 100);\n\n element.hidden = true;\n document.body.appendChild(element);\n }\n }\n\n $.ajax({\n url: reqURL,\n success: function(data) {\n var audioURL = data.preview_url;\n console.log(audioURL);\n playURL(audioURL);\n },\n });\n}", "title": "" }, { "docid": "5a4ebc4164b8987067c454bf99d310fc", "score": "0.5952351", "text": "play() {\n // Force asynchronous event firing for IE e.g.\n qx.event.Timer.once(\n function () {\n this._media.play();\n },\n this,\n 0\n );\n }", "title": "" }, { "docid": "b402e392cb2d53a2a7d9227d60081cbe", "score": "0.5949245", "text": "function loaded(){\n\tsong.loop();\n\n}", "title": "" }, { "docid": "a4d317bd86dc09090001b63906e5d99e", "score": "0.5940754", "text": "function play1(){\n\tplayer1.start();\n}", "title": "" }, { "docid": "94f28f327fc9cd11dabb4bb88f5f3e98", "score": "0.5935015", "text": "function playPressed() {\n paused(function(paused) {\n if(paused) {\n playSong(getActiveTrackId());\n }\n else {\n playCollection();\n }\n });\n}", "title": "" }, { "docid": "861d0ddce10e4b1b9f6b000a5be46f9c", "score": "0.5931416", "text": "function playMark(contenedor) {\n\tif(isActiveStreaming)\n\t\tjwplayer(\"mediaspace\").load({ file: getUrlFormatoStreaming($(\"#MainContent_divMarcas\").attr('data-file')), streamer: streamerPath, start: $(contenedor).attr('data-timeIn'), duration: $(contenedor).attr('data-timeOut') });\n\telse\n\t\tjwplayer(\"mediaspace\").load({ file: $(\"#MainContent_divMarcas\").attr('data-file'), start: $(contenedor).attr('data-timeIn'), duration: $(contenedor).attr('data-timeOut') });\n\tjwplayer(\"mediaspace\").play();\n}", "title": "" }, { "docid": "90bbc8ab12cd58b7c6ca139120f43188", "score": "0.5923335", "text": "onPlaybackStart() {}", "title": "" }, { "docid": "90bbc8ab12cd58b7c6ca139120f43188", "score": "0.5923335", "text": "onPlaybackStart() {}", "title": "" }, { "docid": "90bbc8ab12cd58b7c6ca139120f43188", "score": "0.5923335", "text": "onPlaybackStart() {}", "title": "" }, { "docid": "90bbc8ab12cd58b7c6ca139120f43188", "score": "0.5923335", "text": "onPlaybackStart() {}", "title": "" }, { "docid": "90bbc8ab12cd58b7c6ca139120f43188", "score": "0.5923335", "text": "onPlaybackStart() {}", "title": "" }, { "docid": "2769a0438e300bcc2fcff340f2305a2d", "score": "0.5917187", "text": "function playNext() {\n\tvar url = queue.next();\n\tchangeSong(url);\n\tqueue.draw();\n}", "title": "" }, { "docid": "dae7a1ac498d1fb42b92d7506337a74d", "score": "0.59152025", "text": "function playSong() {\n song.src = songs[currentSong]; //applique la chanson au position 0\n songTitle.textContent = songs[currentSong]; //titre de la chanson\n song.play(); //Joue la chanson\n}", "title": "" }, { "docid": "aba28828e2a44d437a7c8e27345c9cdd", "score": "0.59132636", "text": "function start() { // Start Web Worker & send song data to player\n\tvar logs = document.getElementById('logs'); // Define log element\n\n\t// Create Web Worker if it doesn't already exist\n\tif (window.Worker && typeof(player) == \"undefined\") {\n\t\tvar player = new Worker(\"worker.js\");\n\t\twindow.player = player; // Make variable Global\n\t\tplayer.onmessage = function(event) {\n\t\t\tvar data = event.data;\n\t\t\twindow.logs.value += data;\n\t\t};\n\n\t\t// Send song data to player\n\t\tvar song = document.getElementById(\"tones\").innerHTML;\n\t\tplayer.postMessage(song);\n\t}\n}", "title": "" }, { "docid": "b5ae47d3e3d1438a7e269cfa43e00b7c", "score": "0.59000593", "text": "play() {\n // show pause button\n if (this.player.controlBar.playToggle !== undefined &&\n this.player.controlBar.playToggle.contentEl()) {\n this.player.controlBar.playToggle.handlePlay();\n }\n\n if (this.liveMode) {\n // start/resume microphone visualization\n if (!this.surfer.microphone.active)\n {\n this.log('Start microphone');\n this.surfer.microphone.start();\n } else {\n // toggle paused\n let paused = !this.surfer.microphone.paused;\n\n if (paused) {\n this.pause();\n } else {\n this.log('Resume microphone');\n this.surfer.microphone.play();\n }\n }\n } else {\n this.log('Start playback');\n\n // put video.js player UI in playback mode\n this.player.play();\n\n // start surfer playback\n this.surfer.play();\n }\n }", "title": "" }, { "docid": "a6255b8747053def7bcd1818d7ad0f64", "score": "0.58999646", "text": "function start() {\n\n\tprecache.precache(true);\n\n\tvar game = Atomic.game;\n\n\tUI.showMainMenu();\n\n\t// play some music!\n\tutils.playMusic(\"Music/battle.ogg\");\n\n}", "title": "" }, { "docid": "14dd15acdf46363a78aeb54390895fdb", "score": "0.5894639", "text": "function play(fileOrStream) {\n player\n .add({\n playlist: [fileOrStream]\n })\n .then(player.play);\n}", "title": "" }, { "docid": "4d28911c278d0ec89debba83ddb543a7", "score": "0.58920455", "text": "function playMedia() {\n media.play();\n}", "title": "" }, { "docid": "b9eca7ebbbbbe7361e55d1bdfab5387a", "score": "0.5891626", "text": "setupFirstPlay() {\n let seekable;\n let media = this.masterPlaylistLoader_.media();\n\n // check that everything is ready to begin buffering\n // 1) the active media playlist is available\n if (media &&\n // 2) the video is a live stream\n !media.endList &&\n\n // 3) the player is not paused\n !this.tech_.paused() &&\n\n // 4) the player has not started playing\n !this.hasPlayed_) {\n\n // trigger the playlist loader to start \"expired time\"-tracking\n this.masterPlaylistLoader_.trigger('firstplay');\n this.hasPlayed_ = true;\n\n // seek to the latest media position for live videos\n seekable = this.seekable();\n if (seekable.length) {\n this.tech_.setCurrentTime(seekable.end(0));\n }\n\n // now that we seeked to the current time, load the segment\n this.load();\n\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "166f0fb24954cb6b149eab366b592103", "score": "0.5887911", "text": "function play() {\n \n if (started == false) {\n init();\n pauseTime = 0;\n }\n \n if (!playing) {\n playing = true;\n startTime = Date.now();\n \n for (var i=0;i<oscillators.length;i++) {\n oscillators[i].start();\n }\n \n update();\n }\n}", "title": "" }, { "docid": "84a5d4c4921cdfb813403b165f1d5a7d", "score": "0.58757746", "text": "function startAnimation() {\n if (!started) {\n initial[\"playlist\"] = getCopyOfArray(playlist);\n initial[\"current_deg\"] = current_deg;\n initial[\"current_scale\"] = current_scale;\n\n started = true;\n paused = false;\n next(); // start next animation for the first time\n }\n}", "title": "" }, { "docid": "0e019c2c8f1b32e5f32fd66008c5187d", "score": "0.58743936", "text": "function play(){\n\ttemporizeRequests();\n\ttemporizeSideShow();\n\tpaused=false;\n}", "title": "" }, { "docid": "51fb15555b85e588ed570825ab0eea7d", "score": "0.58688617", "text": "function songSnippet(url){\n playSong = new Audio(url)\n return playSong.play()\n}", "title": "" }, { "docid": "e15bdfbcefa023781381c1a3d791411a", "score": "0.58628315", "text": "play() {\n\t\treturn new Promise((resolve,reject) => {\n\t\t\tthis.ended()\n\t\t\t\t.then((ended) => {\n\t\t\t\t\tif (ended) {\n\t\t\t\t\t\tthis._streamProvider.startTime = 0;\n\t\t\t\t\t\tthis.seekToTime(0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.streamProvider.startTime = this._startTime;\n\t\t\t\t\t}\n\t\t\t\t\treturn this.streamProvider.callPlayerFunction('play')\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tsuper.play();\n\t\t\t\t\tresolve();\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "9e9e59af085ead4e07a4d6d5189b8f36", "score": "0.5849465", "text": "function init() {\n play('crowd.mp3');\n}", "title": "" }, { "docid": "1b45b9222d15d4b0ac277c05cc11cd52", "score": "0.5848882", "text": "function start() {\n _playing = true;\n gain.connect(ctx.destination);\n }", "title": "" }, { "docid": "1b45b9222d15d4b0ac277c05cc11cd52", "score": "0.5848882", "text": "function start() {\n _playing = true;\n gain.connect(ctx.destination);\n }", "title": "" }, { "docid": "d32aec6ab502da8a83a333380c27678f", "score": "0.58403075", "text": "start() {\r\n const interval = (60 / this.bpm) * 1000;\r\n if (!this.isPlaying) {\r\n this.isPlaying = setInterval(() => {\r\n this.repeat();\r\n }, interval);\r\n this.playBtn.innerText = \"Stop\";\r\n this.playBtn.classList.add('active');\r\n } else {\r\n clearInterval(this.isPlaying);\r\n this.isPlaying = null;\r\n this.playBtn.innerText = \"Play\";\r\n this.playBtn.classList.remove('active');\r\n }\r\n }", "title": "" }, { "docid": "faeb2af8a8bb4b30bcf75a690e5d4a9a", "score": "0.58321744", "text": "next() {\n if (!this.currentPlaylist || this.currentPlaylist.isAtLastSong()) return;\n\n this.play(this.currentPlaylist.nextSong());\n }", "title": "" }, { "docid": "fcb42ad6d9e64e6705b6a0e3c06a5c1f", "score": "0.5831829", "text": "function setPlayList() {\n\tif ($(\"#MainContent_divMarcas div.markContainer\").length == 0) {\n\t\talertModal('No existen videos para ser reproducidos.');\n\t\treturn false;\n\t}\n\n\tif ($(\"#btnActPlayLst\").attr('data-Pact') == 0) {\n\t\tvar thePlayList = new Array();\n\t\t$(\"#btnActPlayLst\").empty();\n\t\t$(\"#btnActPlayLst\").append(\"<div class='btnPlaylist2'/>\");\n\t\t/*Se genera el playList de la aplicacion*/\n\t\t/*Se recorren cada uno de los contenedores de marcas para generar el playlist a cargar dentro del player*/\n\t\t$.each($(\"#MainContent_divMarcas div.markContainer\"), function (index, contenedor) {\n\t\t\tif(isActiveStreaming)\n\t\t\t\tthePlayList.push({ file: getUrlFormatoStreaming($(contenedor).attr('data-file')), streamer: streamerPath, start: $(contenedor).attr('data-timeIn'), duration: $(contenedor).attr('data-timeOut') });\n\t\t\telse\n\t\t\t\tthePlayList.push({ file: $(contenedor).attr('data-file'), start: $(contenedor).attr('data-timeIn'), duration: $(contenedor).attr('data-timeOut') });\n\t\t});\n\n\t\tjwplayer(\"mediaspace\").stop();\n\t\tjwplayer(\"mediaspace\").load(thePlayList);\n\t\tjwplayer(\"mediaspace\").play();\n\t\t$(\"#btnActPlayLst\").attr('data-Pact', 1);\n\t\t$(\"#btnActPlayLst\").attr('title', 'Desactivar Playlist');\n\t}\n\telse if ($(\"#btnActPlayLst\").attr('data-Pact') == 1) {\n\t\t$(\"#btnActPlayLst\").empty();\n\t\t$(\"#btnActPlayLst\").append(\"<div class='btnPlaylist3'/>\");\n\t\tif(isActiveStreaming)\n\t\t\tjwplayer(\"mediaspace\").load({ file: getUrlFormatoStreaming($(\"#MainContent_divMarcas\").attr('data-file')), streamer: streamerPath });\n\t\telse\n\t\t\tjwplayer(\"mediaspace\").load({ file: $(\"#MainContent_divMarcas\").attr('data-file') });\n\t\t$(\"#btnActPlayLst\").attr('data-Pact', 0);\n\t\t$(\"#btnActPlayLst\").attr('title', 'Activar PlayList');\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "8e5dcacd38d6b23bf3c75407dee32b90", "score": "0.583143", "text": "play() {\n if (spotifyApi.getAccessToken()) {\n var options;\n //if queue is not empty, play from queue;\n if (this.state.queue.length > 0) {\n options = {\n uris: [this.state.queue[0].uri],\n };\n spotifyApi.play(options)\n .then(() => { api.removeFromQueue(this.state.room_id) },\n err => {\n console.log(err);\n });\n }\n //if queue is empty, play from default playlist;\n else if (this.state.default_playlist) {\n spotifyApi.getPlaylist(this.state.default_playlist.id)\n .then(res => {\n const playlist = res.tracks.items;\n var position = Math.floor(Math.random() * playlist.length);\n var nextSongURI = playlist[position].track.uri;\n options = {\n uris: [nextSongURI],\n };\n spotifyApi.play(options)\n .catch(err => console.log(err));\n });\n } else {\n alert(\"Add songs to queue or a default playlist\");\n }\n }\n }", "title": "" }, { "docid": "5b3ed50732f23781c81a6ff3d5985f7c", "score": "0.5821613", "text": "function actualPlayback() {\n\tif (sourceUrlQueue.length) {\n\t\t$(\"#videoPlayer\")[0].src = sourceUrlQueue[0];\n\t}\n\n\tlog(\"will play \"+$(\"#videoPlayer\")[0].src);\n\tif (prerollSlots.length){\n\t\tprerollSlots[0].play();\n\t}else{\n\t\t$('#videoPlayer')[0].play();\n\t\t$('#videoPlayer').attr('controls', true);\n\t}\n}", "title": "" }, { "docid": "5e764e88d38da45cd78fe7aa4ec46d4b", "score": "0.5820618", "text": "startMusic() {\r\n this.bgMusic.play();\r\n }", "title": "" }, { "docid": "07cd5ff2b7c4f9f73539040a8707e7f6", "score": "0.5819901", "text": "function start() {\n event.preventDefault();\n audioContext.resume().then(() => {\n console.log(\"Playback resumed successfully\");\n });\n playing = setInterval(playAudio, timeInterval());\n document.getElementById(\"pause\").classList.remove(\"isActiveCtr\");\n document.getElementById(\"start\").classList.add(\"isActiveCtr\");\n swapButtons(\"start\", \"pause\");\n\n}", "title": "" }, { "docid": "f28d610530b27bff63de8697ce204def", "score": "0.58196926", "text": "play() {\n // Play is an asynchronous operation, require callback to retrieve tick information\n const state = store.getState();\n\n store.dispatch(onPlayBeat(-1));\n\n // TODO -- should be no need to pass in state vars, audio controller should have them\n this.audioController.play(state.bpm, state.ids, state.data, (index) => {\n // Callback called on every tick, set play index\n store.dispatch(onPlayBeat(index));\n });\n }", "title": "" }, { "docid": "6de009a43c2c9ea949055b7d635d08f5", "score": "0.58146924", "text": "function play(width,height,source_url,stream_type,autoplay)\r\n{\r\n\tloadfxplayer(width,height,source_url,stream_type,autoplay);\r\n}", "title": "" }, { "docid": "f94cfae504f6cefae2af61a5f0c46514", "score": "0.5813004", "text": "function playPlayer() {\n _midi.innerHTML = \"\";\n Tone.Transport.start();\n }", "title": "" }, { "docid": "77dfa3672c4fc803ddd1d8dc72957a9f", "score": "0.58100027", "text": "function onPlayStart(){\n\t\t\n\t\tg_objThis.trigger(t.events.PLAY_START);\n\t\t\n\t\tif(g_objButtonClose)\n\t\t\tg_objButtonClose.hide();\n\t}", "title": "" }, { "docid": "60d77c0210992b2c4cd22aff6d039e73", "score": "0.57814866", "text": "function playSong(songSongsIndex){\n console.log(\"play song index \"+songSongsIndex);\n console.log('play song '+songSongsIndex+'\" : \"'+songs[songSongsIndex].title+'\" ('+songs[songSongsIndex].artist+')');\n \n showModal(\"Playing : <br />\"+songs[songSongsIndex].title+\" (\"+songs[songSongsIndex].artist+\")\");\n\n currentSongIndex=songSongsIndex;\n\n var streamSongUrl = SUBSONIC_API_URL + \"/stream.view?id=\"+songs[songSongsIndex].id+\"&\"+$.param(SUBSONIC_API_CREDENTIALS);\n\n audioElement.src = streamSongUrl;\n audioElement.load();\n audioElement.play();\n coinInserted=false;\n \n // add progress bar and play icon if current song playing is in current page\n if(isCurrentSongInCurrentPage(songSongsIndex)){\n var pageSongIndex = getPageSongIndex(songSongsIndex);\n enableProgressBar(pageSongIndex)\n refreshProgressBar(pageSongIndex);\n blink($(\"#song\"+pageSongIndex).find(\".glyphicon-play\"));\n }\n}", "title": "" }, { "docid": "a495db90efa6d49335aa64678b54192a", "score": "0.5779784", "text": "function play() {\r\n\t\tif (list.length == 0) {\r\n\t\t\tstop();\r\n\t\t} else {\r\n\t\t\tvar str = list[0];\r\n\t\t\tvar char = str.charAt(str.length - 1);\r\n\t\t\tif (char == ',' || char == '.' || char == '!' ||\r\n\t\t\t\tchar == '?' || char == ';' || char == ':') {\r\n\t\t\t\tstr = str.substring(0, str.length - 1);\r\n\t\t\t\tlist[0] = str;\r\n\t\t\t\tlist.unshift(str);\r\n\t\t\t}\r\n\t\t\tplayOnce(str);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "f9f9b2da3f8924a45f3031c4eeb556fb", "score": "0.57734656", "text": "play() {\n const mediaElement = _mediaElement.get(this);\n\n if (!this.isPlay() && mediaElement) {\n mediaElement[0].play();\n this.currentState = AppSettings.mediaState.PLAY;\n }\n }", "title": "" }, { "docid": "5bc826dd1fa99393f0e79cb8c83aaadb", "score": "0.57726824", "text": "function play(){\n //console.log(\"tubeShark resuming!\");\n GS.player.resumeSong();\n}", "title": "" }, { "docid": "d8acbecc9ab29f846604da1cbb174fad", "score": "0.5772054", "text": "function playNext(){\n if(currentPlaylist.length>0){\n var nextSong=currentPlaylist.shift();\n playSong(nextSong);\n console.log(\"remaining playlist : \", currentPlaylist);\n }\n}", "title": "" }, { "docid": "c0f5adcbff244cfe52c2cb21b7a94a25", "score": "0.57580405", "text": "function play () {\n if (autoplay && !animating) {\n startAutoplay();\n autoplayUserPaused = false;\n }\n }", "title": "" }, { "docid": "c0f5adcbff244cfe52c2cb21b7a94a25", "score": "0.57580405", "text": "function play () {\n if (autoplay && !animating) {\n startAutoplay();\n autoplayUserPaused = false;\n }\n }", "title": "" }, { "docid": "c0f5adcbff244cfe52c2cb21b7a94a25", "score": "0.57580405", "text": "function play () {\n if (autoplay && !animating) {\n startAutoplay();\n autoplayUserPaused = false;\n }\n }", "title": "" }, { "docid": "bc76622d33b21405e427147f044ae009", "score": "0.5758012", "text": "playHandler() {\n if (this.props.state.status !== \"ready\") {\n return;\n }\n\n if (this.props.state.nowPlaying === this.props.mediaItem.mediaUrl) {\n this.setStartTime();\n this.props.doFunction.playModel(\"Only\");\n return;\n }\n\n this.props.doFunction.playMimic();\n }", "title": "" }, { "docid": "cb5b712e8b6e851e95385d44ebc2d655", "score": "0.5751542", "text": "play() {\n this.svg.init();\n if (this.state != State.PLAYING) {\n this.state = State.PLAYING;\n if (this.progress != 1) {\n this.dispatchEvent(EventType.RESUME);\n this.startTime = goog.now() - (this.duration * this.progress);\n } else {\n this.dispatchEvent(EventType.BEGIN);\n this.progress = 0;\n this.startTime = goog.now();\n }\n this.dispatchEvent(EventType.PLAY);\n this.animation();\n }\n }", "title": "" }, { "docid": "4606100263c815a8750b62089fc67a87", "score": "0.5739987", "text": "Play() {}", "title": "" }, { "docid": "71c3838cc6c15807fcad933eae050351", "score": "0.5738866", "text": "function next() {\n // Check for last audio file in the playlist\n if (i === files1Ids.length - 1) {\n i = 0;\n } else {\n i++;\n }\n\n setPlayerMainSong();\n // Change the audio element source\n player.src = files1[files1Ids[i]].src;\n $('.playlist_item').removeClass(\"active\");\n document.getElementById(\"\" + files1Ids[i]).classList.add(\"active\");\n startButton.hidden = true;\n pauseButton.hidden = false;\n play_aud()\n}", "title": "" }, { "docid": "7bdadb78071f5243336fcc1f6134e17d", "score": "0.57333684", "text": "function playStation(){\r\n console.log(\"play station started\");\r\n\r\n //this points the instruction to the function below that does the process of uploading and playing the song\r\n mySound = new sound(\"us-lab-background.mp3\");\r\n mySound.play(); \r\n}", "title": "" } ]
1f1353e37a52ba95f4a406708bf5c140
Define a function max() that takes two numbers as arguments and returns the largest of them. Use the ifthenelse construct available in JavaScript. Then, write and example of using the function.
[ { "docid": "647bc8fc19988b9e2a57009d6a188ca9", "score": "0.8184973", "text": "function max(x,y){\n if (x>y){\n return x;\n }else if (x<y){\n return y;\n }\n}", "title": "" } ]
[ { "docid": "89eb1120a15204bc4ed673ed97d72171", "score": "0.86137146", "text": "function max (a, b){\nif (a > b){\nreturn a;\n}else{\nreturn b;\n}\n}", "title": "" }, { "docid": "297f647d4c9b073eaa2f7cc33146cb1e", "score": "0.85890526", "text": "function max(a, b) {\n if (a > b) {\n return a;\n } else {\n return b;\n };\n}", "title": "" }, { "docid": "037803add0012a146bea7e041482b078", "score": "0.85365546", "text": "function max(a, b) {\n if (a > b) {\n return a;\n }\n else\n return b;\n}", "title": "" }, { "docid": "272e51500bc894a6b57c68ee8842104c", "score": "0.85348254", "text": "function max(a, b) {\n if (a > b) {\n return a;\n } \n else {\n return b;\n }\n}", "title": "" }, { "docid": "fce0bf68a90993247b8b3d00da1beda2", "score": "0.8511159", "text": "function max(a, b) {\t\t\t\n\tif (a > b) {\n\t\treturn a;\n\t} else {\n\t\treturn b;\n\t};\n}", "title": "" }, { "docid": "df32e5bbb0bffcbaa4e7870c78c61eed", "score": "0.8482581", "text": "function max(a, b) {\n if (a > b) {\n return a;\n } else {\n return b;\n }\n ;\n}", "title": "" }, { "docid": "b0207a82c8466ff91f95636d81f1fb17", "score": "0.84771246", "text": "function max(a,b){ if (b>a){ return b; } return a; }", "title": "" }, { "docid": "1c04df8f1c3443e7b6951b9dbe2da061", "score": "0.8449324", "text": "function max(a, b){\n var largest;\n if (a > b) {\n largest = a;\n } else {\n largest = b;\n }\n return largest;\n}", "title": "" }, { "docid": "8b9ac571271912c6175da89a82bfb885", "score": "0.84170115", "text": "function Max(a,b)\n{\n if(a>=b)\n return a;\n else\n return b;\n}", "title": "" }, { "docid": "6617d4e3520ce9468f864af98e6fa6d5", "score": "0.840098", "text": "function max(a, b) {\n return (a > b) ? a : b;\n}", "title": "" }, { "docid": "f8017406e97c641fb75d8fde72d6d965", "score": "0.83765215", "text": "function max( num1, num2 ){\n if (num1 > num2){\n return num1;\n }else{\n return num2;\n }\n}", "title": "" }, { "docid": "a31f76a9604b556bde2e6f075dd63b6e", "score": "0.83763665", "text": "function max(a, b) {\n if (a > b) return a;\n return b;\n}", "title": "" }, { "docid": "017d0784420fdffb680bcb3ebae7b814", "score": "0.8348431", "text": "function max(a, b) {\r\n return Math.max(a, b);\r\n}", "title": "" }, { "docid": "7ea20ca4f0404905fd44d35e47593e8e", "score": "0.8311889", "text": "function max(a, b) {\n // if (a > b) {\n // return a;\n // } else {\n // return b;\n // }\n // Ternary operator -> ES6\n return a > b ? a : b; // if a > b then return a else return b\n}", "title": "" }, { "docid": "2777f661b6e6b6880c2344fc74ce9443", "score": "0.83056754", "text": "function max( num1, num2 ) {\n if (num1 === num2) {\n return num1\n }\n else if (num1 > num2) {\n return num1\n }\n else {\n return num2\n }\n\n}", "title": "" }, { "docid": "cd4deb99d98a741c158546bf9d976aa1", "score": "0.8304401", "text": "function max(a, b) {\n return a > b ? a : b;\n}", "title": "" }, { "docid": "cd4deb99d98a741c158546bf9d976aa1", "score": "0.8304401", "text": "function max(a, b) {\n return a > b ? a : b;\n}", "title": "" }, { "docid": "1ffabd69f76206b0c28a5775e9abb645", "score": "0.83005285", "text": "function max(a, b){\n if(a > b)\n return a;\n return b;\n}", "title": "" }, { "docid": "6c828061a4d4a33cea0cc90f28b2c01f", "score": "0.8287626", "text": "function max(num1, num2){\n if (num1 > num2) {\n return num1\n } else (num1 < num2)\n return num2\n}", "title": "" }, { "docid": "3fc24a1abeb061da260f5f8cd92f0164", "score": "0.8285098", "text": "function max(num1, num2){\n if (num1 > num2) {\n \treturn num1;\n } else {\n \treturn num2;\n }\n \t\t\n}", "title": "" }, { "docid": "c92aecddfa419f1a4649da7c84e33887", "score": "0.82631975", "text": "function max(a, b)\n{\n\tif(a > b) {\n\t\treturn(a);\n\t} else {\n\t\treturn(b);\n\t}\n}", "title": "" }, { "docid": "16bd80b10e32557e0cb0c822dbd875c6", "score": "0.82626593", "text": "function max(a, b){\n \"use strict\";\n var largest = null;\n\n if(arguments.length === 0) {\n throw \"No arguments were passed to the function.\";\n } else if(arguments.length === 1) {\n throw \"Only 1 argument was passed to the function.\";\n } else if(arguments.length > 2) {\n throw \"The function should only have 2 arguments.\";\n }\n\n if(!_.isNumber(a)) {\n throw \"The first argument is not a number.\";\n } \n if(!_.isNumber(b)) {\n throw \"The second argument is not a number.\";\n }\n\n if(a === b) {\n largest = a;\n } else if (a > b) {\n largest = a;\n } else {\n largest = b;\n }\n \n return largest;\n}", "title": "" }, { "docid": "e5fa1a0eb3f5069fe8c6245026048a7e", "score": "0.82534105", "text": "function max(num1, num2){\n if (num1 > num2) {\n return num1;\n } else {\n return num2;\n }\n\n }", "title": "" }, { "docid": "8bfbf035b15975e1e6c434341436f048", "score": "0.82340974", "text": "function max(num1, num2){\n if (num1 > num2){\n return num1;\n } else {\n return num2;\n }\n}", "title": "" }, { "docid": "f66a87e4e2b1ac40658d7e01f856d981", "score": "0.8221776", "text": "function max(num1,num2){\n if (num1 > num2){\n return num1;\n }\n else if (num2 > num1){\n return num2;\n }\n else{\n return num1;\n }\n}", "title": "" }, { "docid": "f63b6ae18ccc36af3aefaf7409a413e5", "score": "0.8221139", "text": "function max(num1,num2){\n if (num1 > num2) {\n return num1;\n } else {\n return num2;\n }\n}", "title": "" }, { "docid": "60578b33be72bdcbd5e23ec0bce0f2e2", "score": "0.8198072", "text": "function max(x, y) {\n if (x > y) {\n return x;\n } else {\n return y;\n }\n}", "title": "" }, { "docid": "bf428ffb75f71dff82658b6ba75e3d98", "score": "0.8171458", "text": "function max(num1, num2) {\n if (num1 > num2) {\n return num1;\n } else {\n return num2;\n }\n}", "title": "" }, { "docid": "f2eb6547e215c66f5ed4d3d4b622e186", "score": "0.8151288", "text": "function maxOfTwoNumbers(a, b) {\n if(a > b) {\n return a;\n } else {\n return b;\n }\n}", "title": "" }, { "docid": "7727c81c0f62cf7d2b8657a8b4f7f633", "score": "0.814692", "text": "function max(x,y) {\n\tif (x > y) {\n\treturn x\n\t}\n\telse if (y > x) {\n\treturn y\n\t}\n}", "title": "" }, { "docid": "1fecd118882c66e11328811a174597fe", "score": "0.8146619", "text": "function max(x,y){\n if (x > y) {\n return x\n }\n else {\n return y\n }\n //...\n}", "title": "" }, { "docid": "c6f6206e9ae6e67d57e391c7580480cf", "score": "0.81452805", "text": "function maxOfTwoNumbers(a, b){\n if (a > b){\n return a;\n }else{\n return b;\n }\n}", "title": "" }, { "docid": "571192c30a46a4a049b528268fd207ae", "score": "0.8144426", "text": "function max(num1, num2){\n // Your answer here\n if (num1 > num2) {\n return num1;\n }else {\n return num2;\n }\n}", "title": "" }, { "docid": "4298cef4296aecbdc8844b89e98bc301", "score": "0.8142647", "text": "function maxOfTwoNumbers(a, b) {\n if (a > b) {\n return a;\n } else {\n return b;\n }\n}", "title": "" }, { "docid": "4298cef4296aecbdc8844b89e98bc301", "score": "0.8142647", "text": "function maxOfTwoNumbers(a, b) {\n if (a > b) {\n return a;\n } else {\n return b;\n }\n}", "title": "" }, { "docid": "011afa1153d094bf9c9007b71f84f12d", "score": "0.8142512", "text": "function maxOfTwoNumbers(a, b) {\n if (a>b) {\n return a;\n }else{\n return b;\n }\n}", "title": "" }, { "docid": "1b73b53a8d26ac55284e4b7fdce1f8b6", "score": "0.8122445", "text": "function max(x, y){\n if(x>y){\n return x; \n } else{\n return y; \n } \n\n }", "title": "" }, { "docid": "564511d3d4d257193a27b707f22099b4", "score": "0.81079096", "text": "function max(x, y) {\n return x > y ? x : y;\n }", "title": "" }, { "docid": "00ceeb09075d179d70ee34be9f77c5bf", "score": "0.810064", "text": "function max(a,b){\n if(a > b){\n return a;\n } else if (a < b) {\n return b;\n } else console.log(\"error\");\n}", "title": "" }, { "docid": "b5dae23c584db6f2ab4295caa46749c0", "score": "0.8092758", "text": "function getMax(num1, num2) {\n // your code here...\n if (num1 > num2){\n return num1;\n } \n \n else if(num2 > num1){\n return num2;\n } \n\n else if(num1 === num2){\n return num1;\n } \n else {\n return 0;\n }\n\n}", "title": "" }, { "docid": "08961fc6630762737471ba1acde19663", "score": "0.8080778", "text": "function maxOfTwoNumbers(a, b) {\n return Math.max(a,b);\n}", "title": "" }, { "docid": "84e63b377201568334862c2bd8808380", "score": "0.80727583", "text": "function maxOfTwoNumbers(a, b) {\n var max;\n if (typeof a != \"number\" || typeof b != \"number\") {\n return 'Not a number';\n\n } else {\n if (a > b) {\n max = a;\n } else {\n max = b;\n }}\n return max;\n}", "title": "" }, { "docid": "cedb4ab46886a6c897007d2d5bf9157d", "score": "0.8070047", "text": "function returnMax(a, b) {\n return (a > b) ? a : b;\n}", "title": "" }, { "docid": "8ed1bad996cc1bd45c066d79ecd5af21", "score": "0.8057645", "text": "function largest() {\n return Math.max.apply(Math, arguments);\n}", "title": "" }, { "docid": "2c6e9169424c58e56862aa72f845c025", "score": "0.80440575", "text": "function max(x, y){\n if (gt(x, y)){\n return x;\n } else {\n return y;\n }\n }", "title": "" }, { "docid": "c769e4ce7a5b163e036826182698dcef", "score": "0.8028421", "text": "function maxOfTwoNumbers(a, b) {\n return Math.max(a, b);\n}", "title": "" }, { "docid": "c769e4ce7a5b163e036826182698dcef", "score": "0.8028421", "text": "function maxOfTwoNumbers(a, b) {\n return Math.max(a, b);\n}", "title": "" }, { "docid": "ec417fced2c5e77db86764cf9655f1c1", "score": "0.8027749", "text": "function max(numb1, numb2){\n \n if (numb1 > numb2) {\n return numb1;\n\n } else if (numb2 > numb1) {\n return numb2;\n\n } else {\n return \"They Are The Same\";\n }\n}", "title": "" }, { "docid": "92b803c3efe4c08582727058806058da", "score": "0.801266", "text": "function calculateMax(a, b) {\r\n //if(a > b) return a;\r\n //return b;\r\n\r\n return a > b ? a : b; //ternary operator more efficent.\r\n}", "title": "" }, { "docid": "ca3b1cfc1b7b1f4839d7a5bdaca28675", "score": "0.7987088", "text": "function max(num1, num2) {\n if (num1 >= num2) {\n return num1;\n } else if (num2 > num1) {\n return num2;\n }\n}", "title": "" }, { "docid": "bf3242389576069660bce12b27272e67", "score": "0.7975106", "text": "function maximum (num1, num2) {\n var max = null\n if (num1 < num2) {\n max = num2\n } else {\n max = num1\n }\n return max\n}", "title": "" }, { "docid": "5c8cfc1e6f4cc1cd64959f6700d0f038", "score": "0.7962077", "text": "function max(num1, num2) {\n\n //check if num1 is greater than num2\n if (num1 > num2) {\n return num1;//if so, return num1\n }\n //else num2 is greater (or equal to... but, either way..)\n else {\n return num2;\n }\n}", "title": "" }, { "docid": "5bd76466fe720349a370e9b93e341085", "score": "0.7950356", "text": "function maxOfTwoNumbers(a, b) {\n if (a > b) {\n return a;\n }\n return b;\n}", "title": "" }, { "docid": "9b47348410ef0aff0fc7db7f202b7748", "score": "0.7949468", "text": "function largest() {\r\n return Math.max.apply(null, arguments);\r\n}", "title": "" }, { "docid": "ca34be17ab1bb1a43b55dc213da3cba8", "score": "0.7940448", "text": "function max(num1, num2) {\n if (num1 > num2) {\n console.log(num1);\n}\n else {\n console.log(num2);\n}\n}", "title": "" }, { "docid": "9110019894a8ee3fc9c31b3afdba2334", "score": "0.79298544", "text": "function largest(){\n // parse arguments into an array\n var args = [].slice.call(arguments);\n\n var large = Math.max.apply(Math,args);\n return large;\n}", "title": "" }, { "docid": "f9a18f937e05e444116d3c0c6c1cbd73", "score": "0.7916906", "text": "function max(x,y) {\n\tvar larger = x > y ? x : y;\n\tconsole.log(\"max(\"+ x + \",\" + y + \") = \" + larger);\n\treturn larger;\n}", "title": "" }, { "docid": "48f88d4e932eb2e1becfc8da47a7d297", "score": "0.7911404", "text": "function maxOfTwoNumbers(x, y) {\n return Math.max(x, y); \n}", "title": "" }, { "docid": "3b114fb4c200f62681ed55ac0de017c1", "score": "0.7894016", "text": "function maxOfTwoNumbers(a, b) {\n let highestNum;\n if (a > b) { \n highestNum = a;\n } else {\n highestNum = b;\n }\n return highestNum;\n }", "title": "" }, { "docid": "1578e9ab99e520141135135b80d4bbe2", "score": "0.78850365", "text": "function maxOf2(a,b){\n if(a>b){\n return a;\n }else if(a==b){\n return a;\n }else{\n return b;\n }\n}", "title": "" }, { "docid": "b29904d3214bac78dbb3329785ccf64e", "score": "0.78592545", "text": "function largest() {\n var args = Array.prototype.slice.call(arguments, 0);\n return Math.max.apply(null, args);\n}", "title": "" }, { "docid": "a7df99558a0129cd070f03d5983f00d6", "score": "0.78563935", "text": "function maxOfTwoNumbers(firstNum, secondNum) {\n if (firstNum > secondNum){\n return firstNum;\n } else if (firstNum < secondNum){\n return secondNum;\n }\n}", "title": "" }, { "docid": "c652f949870c2da86fb30ef06b43fe4f", "score": "0.78322035", "text": "function max(x,y) {\n var doMax = function(x_,y_) {\n return x_ > y_ ? x_ : y_;\n };\n\n if(x == undefined)\n return max;\n if(y == undefined)\n return function(n){return doMax(x,n);};\n return doMax(x,y);\n}", "title": "" }, { "docid": "bb308d903780b9a166103d8c16052139", "score": "0.7825234", "text": "function max(x, y) {\n if (x >= y) {\n return x\n }\n\n return y\n}", "title": "" }, { "docid": "340bd1008a5efc162be2ec207b82419f", "score": "0.78197956", "text": "function max(x, y) {\n 'use strict';\n if (x > y) {\n return x;\n }\n\n return y;\n}", "title": "" }, { "docid": "2c9582aa5bc0919aae6cd625702037ff", "score": "0.7813358", "text": "function findMax(a,b) {\n if(a < b) { return b; }\n else {\n return a;\n }\n}", "title": "" }, { "docid": "79adf8243158aaa67d4cb642fb7505eb", "score": "0.7800065", "text": "function findMax(num1, num2, num3) {\n largestNum = Math.max(num1,num2,num3)\n console.log(\"The largest number is: \" + largestNum + \".\")\n}", "title": "" }, { "docid": "b3d08ee87d4b39187f1c5d7afa812a24", "score": "0.7793368", "text": "function max(n1, n2) {\n if(n1 > n2) {\n return n1;\n } else {\n return n2;\n }\n}", "title": "" }, { "docid": "fb1e4766369645bcd0d48872518b6ed0", "score": "0.77891105", "text": "function max(n1,n2){\n\tif(n1>n2){\n\t\treturn n1;\n\t} else return n2;\n}", "title": "" }, { "docid": "1549b70c7c7eabbd1f981c5cfd1cc8f0", "score": "0.7771403", "text": "function max() {\n let largest = 0;\n if (arguments.length == 1) {\n return arguments[0];\n } else {\n for (let i = 0; i < arguments.length - 1; i++) {\n if (arguments[i] > arguments[i + 1]) {\n largest = arguments[i];\n } else {\n largest = arguments[i + 1];\n }\n }\n }\n return largest;\n}", "title": "" }, { "docid": "18bc25a25be268c51ff26af58997c9f4", "score": "0.7732305", "text": "maxnum(first, second) {\n return Math.max(first, second);\n }", "title": "" }, { "docid": "d06a47ed23948d33c23ee3dd1f318969", "score": "0.77293277", "text": "function max(numA, numB){\n \"use strict\";\n //...\n if (numA > numB) {\n return numA\n } else {\n return numB\n }\n}", "title": "" }, { "docid": "60c5c495d11b95c85f732cea743ad0d3", "score": "0.77269775", "text": "function max(paramOne, paramTwo) {\n if (Number(paramOne) > Number(paramTwo))\n return (paramOne);\n else return (paramTwo);\n }", "title": "" }, { "docid": "f615be4bad1e9c36743a1d6e869195f9", "score": "0.7706956", "text": "function max(a, b){\n \"use strict\";\n if(b > a){\n return b;\n }else{\n return a;\n }\n}", "title": "" }, { "docid": "2a93de6e41782cb47f74fb43faeeb4a0", "score": "0.7698238", "text": "function max(num1, num2) {\n let highestNum;\n if (num1 > num2){\n highestNum = num1;\n } else {\n highestNum = num2;\n }\n console.log(`The highest number is: ${highestNum}`)\n}", "title": "" }, { "docid": "acbe72dff6a67ddeef20b10f0fcf1a04", "score": "0.7673665", "text": "function maxNUm (number1, number2) {\n // if (number1 > number2)\n // console.log(number1);\n // return number1;\n // console.log(number2);\n // return number2;\n return (number1>number2) ? number1: number2;\n}", "title": "" }, { "docid": "858a932069f5ca1dfe9a39e69b02f400", "score": "0.7622894", "text": "function max(a, y) {\n if (a > y) {\n return a;\n }\n return y;\n}", "title": "" }, { "docid": "7056de184dcdfc6cd07402321a8136a1", "score": "0.76175195", "text": "function getMaximum() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return Math.max.apply(Math, args);\n }", "title": "" }, { "docid": "21c3a9d89426cd58e858d97b1e82348c", "score": "0.7612035", "text": "function max(num1, num2){\n var total = Math.max(num1, num2);\n return total;\n }", "title": "" }, { "docid": "9032123cf7ef39a54e09eb218adf6577", "score": "0.76061577", "text": "function max(x, y) {\n if (x > y) {\n return x + \" is the largest number\";\n } else if (x < y) { \n \n return y + \" is the largest number\";\n } else {\n return \"The numbers are equal\" \n \n }\n }", "title": "" }, { "docid": "0a75e3b2e6cf86b2214623873142a46e", "score": "0.7602623", "text": "function max(number1, number2) {\n if (number1 > number2 && number1 !== number2) {\n return number1;\n } else if (number2 > number1 && number2 !== number1) {\n return number2;\n } else {\n console.log('Números iguales');\n }\n}", "title": "" }, { "docid": "4f33fb2a0b22e3d4c1be7893f56cd8b0", "score": "0.75990975", "text": "function findTheBiggest(num1, num2, num3){\n return Math.max(num1, num2, num3) // Shortcut!\n}", "title": "" }, { "docid": "0cc8b8d9e7dab6a06bf09324d60b8e36", "score": "0.7588402", "text": "function highestNumber(num1, num2){\n\tif (num1 > num2) return num1;\n\treturn num2;\n}", "title": "" }, { "docid": "e9d732f369b04a737c71c499e7de5955", "score": "0.75686127", "text": "function max(val1, val2) {\n if(val1 > val2) {\n return val1;\n }\n return val2;\n}", "title": "" }, { "docid": "c50e5712775788b6a21d4105d9b99f37", "score": "0.7552768", "text": "function largest(...args) {\n // проверка на валидность входных данных\n if (args === undefined || args === null) {\n return;\n }\n let numbers = args.filter(value => typeof value === 'number');\n if (numbers.length === 0) {\n return;\n }\n let maxValue = args[0];\n for (let i = 0; i < args.length; i++) {\n maxValue = maxValue > args[i] ? maxValue : args[i];\n }\n return maxValue;\n}", "title": "" }, { "docid": "6c83eccad37a577271b3c719b78aa5fd", "score": "0.7542137", "text": "function highest(num1, num2, num3, num4, num5) {\n var highest = Math.max(num1, num2, num3, num4, num5);\n return (\"The highest of the numbers is \" + highest + \".\");\n }", "title": "" }, { "docid": "604959082f6c09127a9db92405aa30c0", "score": "0.7534272", "text": "function max3(num1, num2) {\n return (num1 > num2) ? num1 : num2;\n}", "title": "" }, { "docid": "c671eb827ce3418716a1cdb4608d4cbc", "score": "0.7481531", "text": "function max(num1,num2){\n\tif (num1.lingth > num2.lingth ){\n\t\treturn num1 \n\t}\n\t return num2 \n}", "title": "" }, { "docid": "f53bcbcc4ae79d77f5f6acc3455d71e7", "score": "0.74796414", "text": "function max(n1,n2){\n\tif(typeof(n1)==='number' && typeof(n2)==='number'){\n\t\tif(n1>n2) return n1;\n\t\telse if(n2>n1) return n2;\n\t}\n\t return \"They are equal\";\n}", "title": "" }, { "docid": "3a95b16401bc6f494321d017711863b6", "score": "0.74523765", "text": "function largest(inputNumbers) {\n \n}", "title": "" }, { "docid": "769dfe142e9868f3e3d8247b66276c24", "score": "0.7417852", "text": "function maxOfTwoNumbers(num1, num2) {\n\t\tif (num1 > num2){\n\t\t\treturn num1\n\t\t} else {\n\t\t\treturn num2\n\t\t}\n\t}", "title": "" }, { "docid": "6c3664b4fa8fccb6c596a1c9d1e27bab", "score": "0.741724", "text": "function biggest(numOne, numTwo){\n if(numOne > numTwo){\n console.log(\"The \" + numOne + \" is biggest\")\n }else if (numOne < numTwo){\n console.log(\"The \" + numTwo + \" is biggest\")\n }else{\n console.log( \"The numbers are equal \")\n }\n}", "title": "" }, { "docid": "2b154458b77853b9b656a620b70422ce", "score": "0.74074334", "text": "function maxNumber(n1, n2, n3) {\n if (n1 > n2 && n1 > n3) {\n console.log('first number is the biggest');\n return n1;\n }\n else if (n2 > n1 && n2 > n3) {\n console.log('second number is the biggest');\n return n2;\n }\n else {\n console.log('third number is the biggest')\n return n3;\n }\n}", "title": "" }, { "docid": "582ad34d054234d9e1c040345d8c8dc7", "score": "0.73996186", "text": "function maxOfTwoNumbers(x, y) {\n // Use comparison operator to determine larger value. If neither is larger, they're equal.\n return x > y ? x : (x < y ? y : 'Equal');\n}", "title": "" }, { "docid": "e9f70b608dd38b4b17b1c25eaf77a1cd", "score": "0.73974186", "text": "function max(var1,var2){\n \"use strict\";\n if(var1<=var2){\n return var2;}\n else {\n return var1;\n }\n //...\n}", "title": "" }, { "docid": "e2b348843149054d80c76069242bbcc4", "score": "0.7395012", "text": "function max(numbers) {\n let max = Math.max(...numbers);\n return max;\n}", "title": "" }, { "docid": "3d3814eabbffdbc4cacfb462ee544a8d", "score": "0.73920715", "text": "function maxOf2(a, b) {\n if (a > b){\n return a;\n } else if (a < b){\n return b;\n } else {\n return a && b;\n }\n}", "title": "" }, { "docid": "d112a34fc57b77f6553794f16120b9e4", "score": "0.7391133", "text": "function largest() {\n \"use strict\"\n // parse arguments into an array\n var args = [].slice.call(arguments);\n\n // .. do something with each element of args\n // YOUR CODE HERE\n\n var theLargestNumber = 0;\n\n args.forEach(function(number) {\n\n if (theLargestNumber < number) {\n theLargestNumber = number;\n }\n\n })\n\n return theLargestNumber;\n\n}", "title": "" }, { "docid": "d7c4736995a1a83ad4c5b315ce095b05", "score": "0.7370852", "text": "function max(numbers) {\n var max = numbers[0];\n each(numbers, function(number) {\n if (number > max) {\n max = number;\n }\n });\n return max;\n}", "title": "" }, { "docid": "e35f380b5a5566105f3f7a155e3efa7a", "score": "0.7356629", "text": "function largest(){\n // parse arguments into an array\n var args = [].slice.call(arguments);\n \n // set a variable for largest number. Set it's default value to 0\n var currentLargest = 0;\n // iterate over each number in the array\n for(var i = 0; i < args.length; i++){\n // if the number at the current index is larger than the value of currentLargest,\n if(args[i] > currentLargest) {\n // replace currentLargest with number at current index\n currentLargest = args[i];\n }\n }\n // return final value of currentLargest\n return currentLargest;\n}", "title": "" } ]
6bffb431c4a85fb6cccf46fe903a2db8
console.log(data) const datatrim = data[3].map(data => data.trim()); //original working trim for one line console.log(data.flat(2)) //flat is an ECMAscript2019 function to remove empty array items. THis is to transpose the data array[0].map((_, colIndex) => array.map(row => row[colIndex])); OR console.log(data[0].length);
[ { "docid": "a41e07d895bf08d2584ee0b328c789ad", "score": "0.0", "text": "function transposeArray(array, arrayLength){\r\n var newArray = [];\r\n for(var i = 0; i < array.length; i++){\r\n newArray.push([]);\r\n };\r\n \r\n for(var i = 0; i < array.length; i++){\r\n for(var j = 0; j < arrayLength; j++){\r\n newArray[j].push(array[i][j]);\r\n };\r\n };\r\n \r\n return newArray;\r\n }", "title": "" } ]
[ { "docid": "be475b6b30c8b4ffb2f9533f8cb92b56", "score": "0.65153444", "text": "cleanData(data) {\n let rows = [];\n for (let i = 0; i < data.length; i++) {\n rows.push(data[i].value);\n }\n return rows;\n }", "title": "" }, { "docid": "ec7119af29791d24388041d9ce3508b3", "score": "0.64506954", "text": "toArray_flat() {\r\n let result = [];\r\n this.data.forEach(rows => rows.forEach(cols => result.push(cols)));\r\n return result;\r\n }", "title": "" }, { "docid": "f9dde38e4b4c04ca4f780d242d5e0bb0", "score": "0.62828577", "text": "function normalizeData(arr){\n let normalizedArr = [];\n\n for(let i = 0;i < arr.length;i++){\n for(let k = 0;k < arr[i].length;k++){\n normalizedArr.push(arr[i][k]);\n }\n }\n\n return normalizedArr;\n}", "title": "" }, { "docid": "5536a9a8ff611edfbb0455ca3b0be213", "score": "0.6265313", "text": "function parseData(data) {\n const result = [];\n data.split(\"\\n\").forEach(function (row) {\n if (!row) {\n return;\n }\n const rowArray = [];\n row.split(\",\").forEach(function (cell) {\n rowArray.push(cell);\n });\n\n result.push(rowArray);\n });\n return result;\n}", "title": "" }, { "docid": "21853320e53c3e02faacd8dff487ce9b", "score": "0.61845374", "text": "function flatenArray(arr){\n newArr = []\n for( let i = 0 ; i < arr.length ; i++){\n for(let j = 0 ; j < arr[i].length ; j++){\n newArr.push(arr[i][j])\n }\n }\n return newArr\n}", "title": "" }, { "docid": "9b3a8b4626d8c8e885f0019d6dbedf11", "score": "0.6150313", "text": "function arrayTranspose_(data) {\n if (data.length == 0 || data[0].length == 0) {\n return null;\n }\n\n var ret = [];\n for (var i = 0; i < data[0].length; ++i) {\n ret.push([]);\n }\n\n for (var i = 0; i < data.length; ++i) {\n for (var j = 0; j < data[i].length; ++j) {\n ret[j][i] = data[i][j];\n }\n }\n\n return ret;\n}", "title": "" }, { "docid": "9b3a8b4626d8c8e885f0019d6dbedf11", "score": "0.6150313", "text": "function arrayTranspose_(data) {\n if (data.length == 0 || data[0].length == 0) {\n return null;\n }\n\n var ret = [];\n for (var i = 0; i < data[0].length; ++i) {\n ret.push([]);\n }\n\n for (var i = 0; i < data.length; ++i) {\n for (var j = 0; j < data[i].length; ++j) {\n ret[j][i] = data[i][j];\n }\n }\n\n return ret;\n}", "title": "" }, { "docid": "a3e69cc00b03ea517a8eba9b113dc256", "score": "0.6133499", "text": "function withoutEmptyStrings(data) {\n return data\n .map(x => x && (Array.isArray(x) ? x.join(\", \").trim() : String(x).trim()))\n .filter(x => x);\n}", "title": "" }, { "docid": "70416d78cf2176a701a335aa497da5e4", "score": "0.61091393", "text": "function trimTrailingColumns(arr) {\n var newArr = [];\n arr.forEach(function (row) {\n var value;\n if (Array.isArray(row)) {\n do {\n value = row.pop();\n } while(value === '');\n if (value) row.push(value);\n }\n if (row.length) {\n newArr.push(row);\n }\n });\n return newArr;\n }", "title": "" }, { "docid": "e2fe5085f56a306c30cf6f14ab47e362", "score": "0.60330373", "text": "transformData(arr){\n let modArr = [];\n modArr = arr.map(function(item){return parseInt(item.substring(11,13), 10)});\n return modArr;\n }", "title": "" }, { "docid": "e6a4aae55e79416d294e008668394b86", "score": "0.6007716", "text": "function cleanData(parsed_data, number_of_headers) {\n const data = [];\n for (let i = 0; i < parsed_data.length; i++) {\n let row = parsed_data[i];\n if (row.length == number_of_headers) {\n data.push(row);\n }\n }\n\n return data;\n}", "title": "" }, { "docid": "41c486fa88ec2de6626ef1c42e586e83", "score": "0.58905846", "text": "function getRealData(data){\n let toReturn;\n if(data.charAt(0) === \"[\" && data.charAt(data.length-1) === \"]\"){\n if(/'/.test(data)){\n toReturn = JSON.parse(data.replace(/'/g, '\"'))\n }\n else{\n toReturn = data.slice(1,-1);\n toReturn = toReturn.replace(/\\s/g,\"\");\n toReturn = toReturn.split(\",\");\n } \n }else{\n toReturn = data;\n }\n return toReturn;\n }", "title": "" }, { "docid": "0b4118c3607e84611c124a644a7b04a1", "score": "0.5820734", "text": "function iterate_tsne() {\n var i, j;\n var k=0, l=0;\n dataTable = [];\n while(k<data.length)\n {\n for (i=k; i<data.length; i++) {\n if(!isNaN(parseInt(data[i][0]))) {\n break;\n }\n }\n if(i>=data.length) {\n break;\n }\n\n while(data[i][0] !== \"\") {\n for (l=0; l<dataTable.length; l++) {\n if (dataTable[l][0] == data[i][0]) {\n break;\n }\n }\n if(l===dataTable.length) {\n dataTable.push(data[i].filter(item => item));\n } else {\n for (j=1; j<data[i].length; j++) {\n if (data[i][j] !== \"\") {\n dataTable[l].push(data[i][j].replace(/,/g, ''));\n }\n }\n }\n i++;\n }\n \n k=i+1;\n }\n for (var i = 0; i < dataTable.length; i++) {\n dataTable[i] = dataTable[i].slice(1);\n }\n for (var i = 0; i < dataTable.length; i++) {\n dataTable[i] = dataTable[i].map((i) => Number(i));\n }\n \n}", "title": "" }, { "docid": "03f26fee398621a6a9768b785badcd40", "score": "0.57843727", "text": "function formatDataToArray (data) {\n var newdata = [];\n data.forEach(function (item) {\n // create rows:\n var row = [];\n\n try {\n // col 0: data origin: public / private\n row.push((item.access_level === otConsts.ACCESS_LEVEL_PUBLIC) ? otConsts.ACCESS_LEVEL_PUBLIC_DIR : otConsts.ACCESS_LEVEL_PRIVATE_DIR);\n\n // disease\n row.push(item.disease.efo_info.label);\n\n // comparison\n row.push(item.evidence.comparison_name);\n\n // activity\n var activityUrl = item.evidence.urls[0].url;\n var activity = item.target.activity.split('_').shift();\n row.push('<a class=\\'ot-external-link\\' href=\\'' + activityUrl + '\\' target=\\'_blank\\'>' + activity + '</a>');\n\n // tissue / cell\n row.push(item.disease.biosample.name);\n\n // evidence source\n row.push(otUtils.getEcoLabel(item.evidence.evidence_codes_info, item.evidence.evidence_codes[0]));\n\n // fold change\n row.push(item.evidence.log2_fold_change.value);\n\n // p-value\n row.push((item.evidence.resource_score.value).toExponential(2));\n\n // percentile rank\n row.push(item.evidence.log2_fold_change.percentile_rank);\n\n // experiment overview\n var expOverview = (item.evidence.urls[2] || item.evidence.urls[0]).url || otDictionary.NA;\n row.push('<a class=\\'ot-external-link\\' href=\\'' + expOverview + '\\' target=\\'_blank\\'>' + (item.evidence.experiment_overview || 'Experiment overview and raw data') + '</a>');\n\n\n // publications\n var refs = [];\n if (checkPath(item, 'evidence.provenance_type.literature.references')) {\n refs = item.evidence.provenance_type.literature.references;\n }\n var pmidsList = otUtils.getPmidsList(refs);\n row.push(otUtils.getPublicationsString(pmidsList));\n\n // Publication ids (hidden)\n row.push(pmidsList.join(', '));\n\n // hidden columns for filtering\n row.push(activity); // activity\n row.push(item.evidence.experiment_overview || 'Experiment overview and raw data') // experiment overview + data\n\n newdata.push(row); // push, so we don't end up with empty rows\n } catch (e) {\n scope.ext.hasError = true;\n $log.log('Error parsing RNA-expression data:');\n $log.log(e);\n }\n });\n\n return newdata;\n }", "title": "" }, { "docid": "242773920d441be8b4ac27d232b00d51", "score": "0.5637997", "text": "unit() {\r\n this.data = this.data.map((rows, main_index) => {\r\n return rows.map((cols, sub_index) => {\r\n return (sub_index === main_index) ? 1 : 0;\r\n });\r\n });\r\n }", "title": "" }, { "docid": "0dddaae50efc8d249c4d991e7b59155b", "score": "0.5616184", "text": "function transpose(array){\n//declare a const 'result' with the value of an empty array\n const result = [];\n//iterate over the first elements of each array within the array\n for(let i = 0; i < array[0].length; i++){\n const row = []\n//create an inner for loop to iterate over the next couple of arrays, within the same element\n for(let j = 0; j < array.length; j++){\n//push the result into result\n row.push(array[j][i]);\n }\n result.push(row)\n//return result\n }\n return result;\n}", "title": "" }, { "docid": "56319572c8544656e5828f59d2327767", "score": "0.5614531", "text": "function trimData(data) {\n var dt = [];\n data.forEach(function (item) {\n dt.push([new Date(item[0]).getTime(), item[1]]);\n });\n return dt;\n }", "title": "" }, { "docid": "21978b18ce6e4d2e45b5a2aae10ce976", "score": "0.56040806", "text": "function flatten(arr) {\n arr2 = [];\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr[i].length; j++) {\n arr2.push(arr[i][j]);\n }\n }\n return arr2;\n}", "title": "" }, { "docid": "21978b18ce6e4d2e45b5a2aae10ce976", "score": "0.56040806", "text": "function flatten(arr) {\n arr2 = [];\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr[i].length; j++) {\n arr2.push(arr[i][j]);\n }\n }\n return arr2;\n}", "title": "" }, { "docid": "e28cf7d016c4dbe0602bca28e97732ad", "score": "0.5581321", "text": "function csv_to_table(data) {\n var table = []\n var rows = data.slice(0,-1).split('\\n')\n for (var r in rows) {\n console.log(rows[r])\n columns = rows[r].split(',')\n if (columns.length>1) {\n var row = []\n for (var c in columns) {\n row.push(parseInt(columns[c]))\n }\n table.push(row);\n }\n }\n return table;\n}", "title": "" }, { "docid": "1eba8f9769d9469c58f0aafd9a38295b", "score": "0.5567833", "text": "function ripulisci_dati(data) {\n for (var i = 0, len = data.length; i < len; i++) {\n for (var j = 0, l = data[i].length; j < l; j++) {\n if (!isNaN(parseFloat(data[i][j])))\n data[i][j] = parseFloat(data[i][j]);\n else if (!data[i][j].length)\n data[i][j] = 0;\n }\n }\n return data;\n }", "title": "" }, { "docid": "38f7aacec408ff171e6e5cceec01c0fa", "score": "0.5551374", "text": "function transpose(data) {\n if (!data) throw new Error(\"data is required\");\n\n if (data.length === 0) {\n return data;\n }\n\n if (data.some(col => col.length !== data.length))\n throw new Error(\"Column and row length not squared\");\n\n if (!areAllNumbers(data)) {\n throw new Error(\"values must be numbers\");\n }\n\n for (let i = 0; i < data.length; i++) {\n for (let j = i + 1; j < data[i].length; j++) {\n const temp = data[j][i];\n data[j][i] = data[i][j];\n data[i][j] = temp;\n }\n }\n\n return data;\n}", "title": "" }, { "docid": "b615e63a9741702b848b07c1d2832714", "score": "0.5540284", "text": "function tamaño(array)\n\t{\n\t\tlet aux;\n\t\tlet resul=0;\n\t\tlet resultados=[]; \n\t\tfor (var i = 0; i < array.length; i++) \n\t\t{\n\t\t\tlet resul1=[];\n\t\t\tfor (var j = 0; j < array[i].length; j++) \n\t {\n\n\t\t\t\t if(array[i][j].length/71 > 1)\n\t\t\t\t {\n\t aux=parseInt(array[i][j].length/71);\n\t\t if (array[i][j].length/71>aux) {\n\t\t \tresul=resul+parseInt(array[i][j].length/71);\n\t\t }else{\n\t\t \t resul=resul+parseInt(array[i][j].length/71)-1;\n\t\t }\n\t\t\t\t }\t\n\t\t\t\t if(j==2)\n\t\t\t\t {\n\t\t\t\t \tresul1.push(resul);\n\t\t\t\t }\n\t\t\t}\n\t\t\t\tresul1.push(resul);\t\t \n\t\t\t\t resultados.push(resul1);\n\t\t\t\t resul=0;\n\t\t\t\t console.log('vemos',resultados);\n\t\t}\n\t\treturn resultados;\n\t}", "title": "" }, { "docid": "cbb79271a4ef50e572c7ae181da30e66", "score": "0.5535905", "text": "function getData(array) {\n return array.map(function (item) {\n return Object.values(item).slice(0, 4);\n })\n}", "title": "" }, { "docid": "95b3b6006aac1a367e0b716e12176462", "score": "0.55274326", "text": "function flatten_arrays(jmData, rowData){\n\t \n\t // Remote city name from address \n\t rowData.site_address = rowData.site_address.replace(\"Philadelphia PA\", \"\");\n\t\t\n\t\t// Delete unused data\n\t\tdelete jmData.sClient;\n\t\tdelete jmData.iExit;\n\t\tdelete jmData.error;\n\t\tdelete jmData.name10;\n\t\tdelete rowData.lat;\n\t\tdelete rowData.lng;\n\t\tdelete rowData.cartodb_id;\n\t\t\n\t\t// Merge the two arrays\n\t\tvar fullSiteData = {};\n\t\tfor (var attrname in rowData) {\n\t\t\tfullSiteData[attrname] = rowData[attrname]; \n\t\t}\n\t\tfor (attrname in jmData) {\n\t\t\tfullSiteData[attrname] = jmData[attrname];\n\t\t}\n\t\toutput.push(fullSiteData);\n\t\t\n\t\t/**\n\t\t * Now that everything has been \n\t\t * formatted sucessfully, increment the count\n\t\t */\n\t\tcount++;\n\t\t\n\t\t//Check that everything has been formatted\n\t\tif (numRows === count) {\n\t\t\tconsole.log(output);\n\t\t \twriteTable (\"#example\",output, true);\n\t\t }\n\t\t else {}\n\t}", "title": "" }, { "docid": "2814fead099b8c408738f5f496e2c0a7", "score": "0.55252075", "text": "function getMultipleLengths() {\r\n const array = [\"\"];\r\n for (let i = 0; i < array.length; i++) {\r\n array \r\n }\r\n}", "title": "" }, { "docid": "21067dd3e8b9b38a9ff93fa024f18237", "score": "0.5522714", "text": "function correctArray(arr) {\n var temp =[];\t\n\t for (let i=0; i<arr.length; i++){\n\t\t if (arr[i].trim().length != 0) {\n \t temp.push(arr[i]);\n\t\t }\n }\n\t return arr = temp;\n }", "title": "" }, { "docid": "f600bf0888522b93f5a63ea8ca58f434", "score": "0.5521821", "text": "function arrayFlattener (TwoDimentionalArray) {\n var aux;\n var arrFinal = [];\n \n for (let num = 0; num < TwoDimentionalArray.length; num++) {\n\n if (Number.isInteger(TwoDimentionalArray[num])) {\n arrFinal.push(TwoDimentionalArray[num]);\n }\n \n for(let num2 = 0; num2 < TwoDimentionalArray[num].length; num2++) {\n aux = TwoDimentionalArray[num][num2];\n \n arrFinal.push(aux);\n \n }\n }\n return arrFinal;\n}", "title": "" }, { "docid": "4426f1b5be47d9be9dabd69754a51db8", "score": "0.551882", "text": "createFlatData(stackValues){\n let finalArr = [];\n while(!(stackValues.length == 0)){\n finalArr.push(`${stackValues.pop()},${stackValues.pop()},${stackValues.pop()},${stackValues.pop()}\\n`);\n }\n return finalArr;\n }", "title": "" }, { "docid": "5b86865da5fccc3452d851bedacf2975", "score": "0.55067354", "text": "function dataFold(data, header) {\r\n var result = [];\r\n var arrayLength = data.length;\r\n\r\n var elementLength = data[0].length;\r\n for (var i = 0; i < arrayLength; i++) {\r\n \tvar newObject = {};\r\n \tfor (var j = 0; j < elementLength; j++) {\r\n \t newObject[header[j]] = data[i][j];\r\n \t}\r\n \tresult.push(newObject);\r\n }\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "5b86865da5fccc3452d851bedacf2975", "score": "0.55067354", "text": "function dataFold(data, header) {\r\n var result = [];\r\n var arrayLength = data.length;\r\n\r\n var elementLength = data[0].length;\r\n for (var i = 0; i < arrayLength; i++) {\r\n \tvar newObject = {};\r\n \tfor (var j = 0; j < elementLength; j++) {\r\n \t newObject[header[j]] = data[i][j];\r\n \t}\r\n \tresult.push(newObject);\r\n }\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "ab01170836c096795bf14b7cf5de9239", "score": "0.5488144", "text": "toArray() {\n let res = []\n for (let i=0; i < this.rows; i++) {\n res[i] = [];\n for (let j=0; j < this.cols; j++) {\n res[i][j] = this.data[i][j];\n }\n }\n\n return res;\n }", "title": "" }, { "docid": "d3cb372a83a0f3d6909da144d0806ac9", "score": "0.5482037", "text": "function dataReverse(data) {\n const result = [];\n for (let i = 0; i < data.length; i++) {\n if (data[i + 8] === undefined) result.push(data.slice(i));\n else result.push(data.slice(i, i + 8));\n i += 7;\n }\n return result\n .reduce((acc, arr) => [...arr, ...acc], []);\n}", "title": "" }, { "docid": "13dbbffef15948177ee33a7f434bddd5", "score": "0.54779625", "text": "function flatArray(){\n const arr = [1,2,3,[4,5,6],[[7,8],[9,10],11],12,13];\n const flat = arr.flat(1);\n console.log('Array', flat); //Array [1, 2, 3, 4, 5, 6, Array(2), Array(2), 11, 12, 13]\n const flat2 = arr.flat(2);\n console.log('Array', flat2); //Array [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]\n const flat3 = arr.flat(3);\n console.log('Array', flat3); //Array [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]\n}", "title": "" }, { "docid": "53cac313acc004ac32638c4370574c7c", "score": "0.54747564", "text": "function flatten(a){ // a is array of arrays\r\n let flat = [];\r\n\r\n for (var i = 0; i < a.length; i++){\r\n for (var j = 0; j < a[i].length; j++){\r\n flat.push(a[i][j])\r\n }\r\n }\r\n return flat;\r\n}", "title": "" }, { "docid": "4f2e63ed26cc9a2a4116db56604b0b47", "score": "0.5473075", "text": "function formatHudCsv(data) {\n // Break each line of stationData into an element in an array\n let dataArray = data.split('\\n');\n\n // Ensure excess white space is trimmed\n dataArray = dataArray.map(function(entry) {\n return entry.replace(/\\s+/g, \" \");\n });\n\n\n // Break each line into its own array, with each word being an element.\n // Note that this breaks multi word city names into multiple elements (fix later)\n let dataArray2 = [];\n for (let i of dataArray) {\n dataArray2.push(i.split(\",\"));\n }\n\n // Check if last element of array is an empty string (some editors add a blank line\n // to the end of files, causing the empty array). Test for this (empty string is falsey),\n // and then remove that element.\n if ( !dataArray2[dataArray2.length - 1][0] ) {\n dataArray2.pop();\n };\n\n return dataArray2;\n}", "title": "" }, { "docid": "e07a8a0e737a776675f4aada51a7f644", "score": "0.5468974", "text": "function columnize(arr){\n const chunkSize = 3;\n const chunked = chunk(arr, chunkSize);\n return chunked.reduce((result, chunk) => result.concat(_.zip.apply(_, chunk)), []);\n}", "title": "" }, { "docid": "51536c522bff9427fb9d02103a8ef051", "score": "0.545485", "text": "reduce() {\r\n if (Array.flatten) {\r\n return this.data.flatten().reduce();\r\n } else {\r\n let result = 0;\r\n this.data.forEach(row => {\r\n row.forEach(col => {\r\n result += col;\r\n });\r\n });\r\n return result;\r\n }\r\n }", "title": "" }, { "docid": "46210ff48472b97528d3d0c3fc141c97", "score": "0.5452497", "text": "function parseData(array){//creating function to parse the data in the array, the function has 1 parameter (the array) and\n//when called will need to place an array as an argument\n//EXPLANATION: map is very important for manipulating data in arrays\n let newArr = array.map((item)=> { //returns a new array with formatted data \n let tempArr = item.split(','); //splits out the string (without the comma) into a new array\n return tempArr[0]; //this returns the first item in the temp array\n })\n let newArr2 = newArr.map((item)=> {\n let tempArr = item.split('(');\n return tempArr[0];\n })\n meetingsData = newArr2;\n}", "title": "" }, { "docid": "f65b13baa48cdcd0b697c9b0f3fdac2d", "score": "0.54485196", "text": "transpose(x){\n return x[0].map((_, colIndex) => x.map(row => row[colIndex]));\n }", "title": "" }, { "docid": "84e22770dd6c916a50cbeb4615924199", "score": "0.5444458", "text": "transposeDataMatrix(data) {\n\t\treturn data.time.map((_, index) =>\n\t\t\tObject.keys(data).reduce((row, key) => {\n\t\t\t\treturn {\n\t\t\t\t\t...row,\n\t\t\t\t\t// Parse time values as momentjs instances\n\t\t\t\t\t[key]: [\"time\", \"sunrise\", \"sunset\"].includes(key) ? moment.unix(data[key][index]) : data[key][index]\n\t\t\t\t};\n\t\t\t}, {})\n\t\t);\n\t}", "title": "" }, { "docid": "bc11610e1329167729f9f207af6c71cc", "score": "0.5424149", "text": "function createDataArray(data) {\n var arr = [];\n for (var i = 0; i < data.length; i++) {\n arr.push(data[i]);\n }\n return arr;\n }", "title": "" }, { "docid": "f08794b3e52e225932f58755b7488c6f", "score": "0.54038525", "text": "function _toArray(data) { return Array.prototype.slice.call(data) }", "title": "" }, { "docid": "5d7542ea0ea8e88852855b331193f62f", "score": "0.5400562", "text": "function cleanVersion2(f){\n //The first line always have the name of the column \n for(var j=0 ; j< f.length ;j++){\n f[j].splice(0, 1);\n }\n for(var k=0 ; k < f.length ; k++){\n for( var i=0; i < f[k].length ; i++){\n if ( empty(f[k][i]) || empty(f[k][i].toString() )){\n for(var j=0 ; j< f.length ;j++){\n f[j].splice(i,1 );\n }\n i -- ;\n }\n }}\n return f\n}", "title": "" }, { "docid": "d892ae2f0f6b898796bae5b8f4d2f64c", "score": "0.5398185", "text": "_transformData(data) {\n let modifiedData = [];\n\n data.forEach((k) => {\n // pushes to array necessary data: text: placeholder, weight: will provide the size of emoji,\n // html: emoji unicode representation, name: in case emoji does not render\n modifiedData.push([\n k.unicode, k.count\n ]);\n });\n return modifiedData;\n }", "title": "" }, { "docid": "504299cfcf8a35354a3516e609deded0", "score": "0.53728044", "text": "function array(arr){\n //Good luck\n if (\"\" || arr.split(\",\").length <= 2) return null;\n let array = arr.split(\",\");\n array.shift();\n array.pop();\n return array.join(\" \");\n }", "title": "" }, { "docid": "bbb5497a3d54fc8c75ced728d6c36bd1", "score": "0.5367894", "text": "static transpose(input) {\n if (typeof(input[0]) == 'number') return input;\n return input[0].map((_,i) => input.map((_,j) => input[j][i]))\n }", "title": "" }, { "docid": "d6ed518b10d8ecdbd45f7f8bc2dde982", "score": "0.53656733", "text": "widthArray() {\n return flatten(this.columns);\n }", "title": "" }, { "docid": "59d5ddb8be11fbad6bf7285a9d39643c", "score": "0.53642255", "text": "function cleanArray(data) {\n let newArray = [];\n for (let item of data) {\n if ((Object.entries(item).length === 0 && item.constructor === Object) === false) {\n newArray.push(item);\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "edfa1757c497b0c9d910533c2292be79", "score": "0.53527087", "text": "getArrayByLineBreaks()\n {\n return this.raw.split('\\r\\n\\r\\n').map(str => str.replace(/\\r|\\n/g, \"\"));\n }", "title": "" }, { "docid": "8e1efc760baee08439ecab63aba9bc88", "score": "0.5350345", "text": "function dataHandling(data) {\n \n for (let i = 0; i < data.length; i++) {\n var ttl = \"\";\n for (let j = 0; j < data[i].length; j++) {\n switch(j) {\n case 0:\n console.log(`Nomor ID: ${data[i][j]}`);\n break;\n case 1:\n console.log(`Nama Lengkap: ${data[i][j]}`);\n break;\n case 2:\n ttl += data[i][j];\n break;\n case 3:\n console.log(`TTL: ${ttl} ${data[i][j]}`);\n break;\n case 4:\n console.log(`Hobi: ${data[i][j]}\\n`)\n break;\n } \n \n }\n \n }\n}", "title": "" }, { "docid": "adba74d234b320d9ac7909802fff6388", "score": "0.53257525", "text": "function conv_textarea_array(data){\n var texts = [];\n for (var i=0; i < data.length; i++) {\n // only push this line if it contains a non whitespace character.\n if (/\\S/.test(data[i])) {\n texts.push($.trim(data[i]));\n }\n }\n\n return texts;\n }", "title": "" }, { "docid": "0de65f3c40dcd43f11edc695ad794f50", "score": "0.53139347", "text": "getIteratableDataset(obj) {\n return Array.from(Object.values(obj.Data).slice(0, this.props.length));\n }", "title": "" }, { "docid": "09cae51ae69ed9bc6744e0b2fb36bdfd", "score": "0.5306317", "text": "toArray() {\r\n let result = new Array(this.rows);\r\n result = this.data.splice(0);\r\n return result;\r\n }", "title": "" }, { "docid": "ad5ee339eb9773b6ea28fcc5494c446b", "score": "0.5302569", "text": "makeSingleCellNumArr() {\n const arr = this.state.gridSets\n .map(obj => {\n console.log(obj)\n return obj.gridColorDataObjs\n })\n .flat()\n return arr\n }", "title": "" }, { "docid": "7c02bd5f93cb83f8099305c2f2913b5d", "score": "0.53002006", "text": "function processData(csv) {\n var allTextLines = csv.split(/\\r\\n|\\n/);\n var lines = [];\n for (var i=1; i<allTextLines.length-1; i++) {\n //the symbol in split() is the line separator\n var data = allTextLines[i].split('*');\n var tarr = [];\n for (var j=0; j<data.length; j++) {\n tarr.push(data[j]);\n }\n lines.push(tarr);\n }\n return lines;\n}", "title": "" }, { "docid": "4081a2b08937424f34d7e671d360d480", "score": "0.52959096", "text": "function parsingRAWData(data,delimiter){\n\tlet result;\n\tresult = data.toString().replace(/(\\r\\n|\\n|\\r)/gm,\"\").split(delimiter);\n\n\treturn result;\n}", "title": "" }, { "docid": "ba1c1ff18177d06194ed8f4e016c0391", "score": "0.5292937", "text": "function tranposeArray(array) {\n output = array[0].map((_, colIndex) => array.map(row => row[colIndex]));\n return output;\n}", "title": "" }, { "docid": "30f7e44642c7495d2f0bed3a43f9ad30", "score": "0.52915287", "text": "function flatten(array) {\n //if array has an array as an element, get the elements out of the inner array and put it back into the outter one. \n var returnArr = []\n for(var i = 0; i < array.length; i++){\n if(array[i].length === undefined){\n returnArr.push(array[i])\n }\n if(array[i].length !== undefined){ //if there is an array at any of the spots\n var innerArr = array[i] //put the array in a vari\n \n }\n \n }\n\n\n\n\n\n\n\n\n return returnArr\n}", "title": "" }, { "docid": "49504fff22bf878df0de6283d3db6f0d", "score": "0.52905154", "text": "function processData(arr) {\n// var data = input.split('\\n');\n// var arr = data[1].split(' ').map(Number);\n\n var res = partition(arr);\n \n function partition(subArray) {\n var l = subArray.length;\n var left = [];\n var right = [];\n var equal = [subArray[0]];\n var segment = [];\n\n for (var i = 1; i < l; i++) {\n (subArray[i] < subArray[0]) ? left.push(subArray[i]) :\n (subArray[i] > subArray[0]) ? right.push(subArray[i]) :\n equal.push(subArray[i]);\n }\n\n // If lengths of left & right arrays > 1, continue to partition them\n if ((left.length > 1) && (right.length > 1 )) {\n\n // Continue to partition both left & right arrays\n segment = [].concat(partition(left),equal, partition(right));\n\n } else if (left.length > 1) {\n\n // Continue to partition left array\n segment = [].concat(partition(left),equal, right);\n\n } else if (right.length > 1 ) {\n\n // Continue to partition right array\n segment = left.concat(equal, partition(right));\n\n } else {\n \n // Terminal case\n segment = left.concat(equal, right);\n }\n console.log(segment.join(' '));\n return segment; \n }\n \n return res;\n}", "title": "" }, { "docid": "ba7dc55d2d9214d6e88cb931712b3358", "score": "0.5283504", "text": "function normalize(data) {\n var result = [];\n for (var row in data) {\n if ({}.hasOwnProperty.call(data, row)) {\n result.push(data[row]);\n }\n }\n return result;\n}", "title": "" }, { "docid": "853ce3af0b74b044b6d794825eec5600", "score": "0.52795976", "text": "function prepareColumns(data) {\n const columns = []\n let column\n let value\n\n for (column in data) {\n value = data[column]\n\n // ignore empty rows\n if (!value && value !== 0) {\n continue\n }\n\n columns.push(prepareColumn(column, value))\n }\n\n return columns\n}", "title": "" }, { "docid": "2d1783b2214a03531a20269f6c85bcb7", "score": "0.5278485", "text": "arrayToString(array){\r\n let res = \"\"; \r\n for (let i = 0; i < array.length; i++) {\r\n if(i == 0)\r\n res += \"[\";\r\n for (let j = 0; j < array[i].length; j++) {\r\n if(j == 0)\r\n res += \"[\";\r\n res += array[i][j];\r\n if(j != array[i].length - 1)\r\n res += \",\";\r\n }\r\n res += \"]\";\r\n if(i != array.length - 1)\r\n res += \",\";\r\n }\r\n res += \"]\";\r\n return res;\r\n }", "title": "" }, { "docid": "eebc83580c2b24f02ef33d6eb1963473", "score": "0.5269832", "text": "function trimLargeSpaces(arr){\n let temp = []\n let flag = false\n for(let i=0;i<arr.length;i++){\n if(arr[i]=='' || arr[i]=='\\r'){\n if(flag)\n continue\n else{\n flag = true\n temp.push(arr[i])\n }\n }\n else{\n temp.push(arr[i])\n flag = false\n }\n }\n return temp\n}", "title": "" }, { "docid": "cce3ae084a9c5cc291b9c7fe6c0c95e9", "score": "0.52672786", "text": "function flatten2dArray(twoDimArr) {\n let a=[];\n for (let i = 0; i < twoDimArr.length; i++) {\n for (let j = 0; j < twoDimArr[i].length; j++) {\n if (twoDimArr[i][j]!== null) {\n a.push(twoDimArr[i][j]);\n }\n }\n }\n return a;\n }", "title": "" }, { "docid": "039a36f889a0f4a32dc5f24dd84b36a4", "score": "0.52567947", "text": "function _rowDataToArray(rowData) {\n return rowData.match(/(\".*?\"|[^\",]+)(?=\\s*,|\\s*$)/g)\n}", "title": "" }, { "docid": "c697cca48720a09b3d51203bfa84405e", "score": "0.5255518", "text": "function dataHandling(){\n var judulInput = ['Nomor ID : ', 'Nama Lengkap : ', 'TTL : ', 'Hobi: ']\n for(i=0; i<input.length; i++){\n input[i].splice(2,2, input[i].slice(2,4).join(\", \"))\n \n \n }\n \n for(var h = 0; h<input.length;h++){\n for(var i = 0; i < judulInput.length; i++){\n console.log(judulInput[i] + input[h][i])\n }\n console.log('--------------------------------')\n }\n}", "title": "" }, { "docid": "bb45c148acdfa5c17146d2aec09eedae", "score": "0.52538556", "text": "function dimensions(data) {\n return dl.keys(data[0]).reduce(function(acc, k) { \n if (k.match(/^d/)) acc.push(k);\n return acc;\n }, []);\n}", "title": "" }, { "docid": "97690a058d6ae0046e035ac8860ebcda", "score": "0.52504945", "text": "function trim_allInArray(x) {//Array\n return x.map(trim_all);\n}", "title": "" }, { "docid": "b1f1e6909ad0443b07557e58b2e36e50", "score": "0.5235871", "text": "function trimArray(arr) {\n var lastIndex = arr.length - 1;\n var start = 0;\n for (; start <= lastIndex; start++) {\n if (arr[start])\n break;\n }\n \n var end = lastIndex;\n for (; end >= 0; end--) {\n if (arr[end])\n break;\n }\n \n if (start === 0 && end === lastIndex)\n return arr;\n if (start > end)\n return [];\n return arr.slice(start, end + 1);\n }", "title": "" }, { "docid": "815c33b51c787de477345d744a6a64b9", "score": "0.5235296", "text": "getArrayOfStringsSplitByBlankLine() {\n return this.raw.split('\\r\\n\\r\\n');\n }", "title": "" }, { "docid": "ff43fa2de2aa09e33215f90c7ee4a79b", "score": "0.5227812", "text": "function separadorEspacio(lineaCodigo) { \n let sinEspacios = [];\n lineaCodigo.forEach(lexema => {\n lexema.split(/\\s+/)\n .filter(function (t) { return t.length > 0 })\n .map(function (t) {\n sinEspacios.push(t);\n })\n });\n return sinEspacios;\n}", "title": "" }, { "docid": "b2118d78cf6d159c3e42a6b231236c47", "score": "0.5223817", "text": "function getLineValues(data) {\n var values = [];\n if (data) {\n for (var i = 0; i < data.length; i++) {\n if (!isNaN((parseInt(data[i])))) {\n values.push(parseInt(data[i]));\n }\n }\n }\n return values;\n}", "title": "" }, { "docid": "3ab861d10590c54d16197082fe6c03ce", "score": "0.5210118", "text": "function createArray(data){\n/* Array for failed or skipped tests */\n \n var tableDiv = document.createElement(\"TABLE\");\n //tableContainer.insertBefore(tableDiv, null);\n\n //Data est un tableau de tableaux : contient les valeurs de toutes les colonnes\n //i = numéro de la colonne, j = valeurs de la colonne\n\n //Entête\n var tr_head = document.createElement(\"TR\");\n tableDiv.insertBefore(tr_head, null);\n\n for(e=0; e < data[0].length; e++){ //Parcours des colonnes\n var thd = document.createElement(\"TH\");\n thd.appendChild(document.createTextNode(data[0][e])); \n tr_head.insertBefore(thd, null);\n\n }\n\n for(j=0; j< data[1].length; j++){ //Parcours des colonnes \n var tr = document.createElement(\"TR\");\n for(k=1; k<data.length; k++){ \n var td = document.createElement(\"TD\");\n var p = document.createElement(\"P\");\n p.innerText = data[k][j].replace(\"<![CDATA[\", \"\").replace(\"]]>\", \"\");\n td.appendChild(p);\n tr.insertBefore(td, null);\n }\n tableDiv.insertBefore(tr, null);\n }\n\n return tableDiv;\n}", "title": "" }, { "docid": "ae744488274cc8500261a44c9a7bae9b", "score": "0.5209108", "text": "function arrayFlatten(arr){\n var newArr = [];\n for(var i = 0; i < arr.length; i++){\n if(Array.isArray(arr[i])){\n for(var j = 0; j < arr[i].length; j++){\n newArr.push(arr[i][j])\n }\n } else{\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "bff2c9bf9628aea2763be356e7238c77", "score": "0.52082956", "text": "function util_preprocess_data(data) {\n let result = [];\n return new Promise(function (resolve, reject) {\n\n /*\n let temp_arr = [];\n for (let j = 0; j < 108; ++j) {\n temp_arr.push([0,0,0,0,0,0]);\n }*/\n\n for (let i = 0; i < data.length; ++i) {\n\n let trip = data[i];\n if (trip.predict['tcnn1'].length > 0 && trip.predict['cnn_lstm'].length > 0 && trip.predict['fcn_lstm'].length > 0 && trip.actual.no_slight.length > 0 && trip.locations) {\n result.push(trip);\n }\n }\n resolve(result);\n });\n}", "title": "" }, { "docid": "f5d3232f4c232f1c3b38b2413916e7f0", "score": "0.5196994", "text": "function getflatarray(sectionstoretrieve){\n\t\t\tvar flatarray = [];\n\t\t\tvar storedSession = sectionstoretrieve;\n\t\t\n\t\t\tfor(var i=0; i < storedSession.length; i++){\n\t\t\t\tif(storedSession[i].length > 1){\t\t\t\t\t\n\t\t\t\t\tfor(var j = 0; j < storedSession[i].length; j++){\t\n\t\t\t\t\t\tvar subarray = storedSession[i];\n\t\t\t\t\t\tflatarray.push( subarray.slice(j, j+1));\t\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\tflatarray.push(storedSession[i]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\treturn flatarray;\n\t\t}", "title": "" }, { "docid": "05e5384fcdd88e93703847dccd799008", "score": "0.5195011", "text": "function prepare_data(data){\n\n\t\tlet numOfDiff = 0;\n\t\tlet numOfNoDiff = 0;\n\n\t\tfor (let d in data) {\n\t\t\tif (data[d].diff == 1)\n\t\t\t\tnumOfDiff++\n\t\t\telse\n\t\t\t\tnumOfNoDiff++\n\t\t}\n\n\t\treturn [{\n\t\t\tlabel: 'Diff',\n\t\t\tvalue: numOfDiff\n\t\t}, {\n\t\t\tlabel: 'No Diff',\n\t\t\tvalue: numOfNoDiff\n\t\t}];\n\n\n }", "title": "" }, { "docid": "2acdaaeaae072c218887b1fdead510a9", "score": "0.5193938", "text": "function rowfix(row) {\n if (!Array.isArray(row)) return row\n if (row.length <= 3) return row\n return row.slice(0,3)\n}", "title": "" }, { "docid": "87e947eb5fc8ddc3f0e69b99d2c2f557", "score": "0.5189947", "text": "function arrTo(arr, delimit) {\n var textArray = [];\n arr.forEach(function (row, index) {\n var line = row.join(delimit);\n textArray.push(line);\n });\n return textArray.join(\"\\r\\n\");\n}", "title": "" }, { "docid": "9b1dabd672205260dc8c6da1bc043986", "score": "0.518855", "text": "static unpackNumbersToNestedArrays(data, numPerBlock) {\n const result = [];\n const n = data.length;\n let i = 0;\n let i1 = 0;\n while (i < n) {\n // there is at least one more value for a block\n const row = [];\n i1 = i + numPerBlock;\n if (i1 > n)\n i1 = n;\n for (; i < i1; i++) {\n row.push(data[i]);\n }\n result.push(row);\n }\n return result;\n }", "title": "" }, { "docid": "34249bc761da54417feeba834ea02d88", "score": "0.51855993", "text": "function flatten(array) {\n // console.log(\"length of array\", array.length)\n var finalArray = [];\n for (var i = 0; i < array.length; i++) {\n if (typeof (array[i]) === 'object') {\n var innerIndex;\n for (innerIndex of array[i]) {\n finalArray.push(innerIndex);\n }\n } else {\n finalArray.push(array[i]);\n }\n }\n // console.log(\"finalArray\", finalArray)\n return finalArray;\n}", "title": "" }, { "docid": "a09fda3794535d81bd675dfaadd814ed", "score": "0.5184899", "text": "function concatFirstNestedArrays(arr) { \n let allArr = arr.reduce(function(sum, current) {\n return sum.concat(current, []);\n });\n return console.log(allArr);\n}", "title": "" }, { "docid": "0d36eae39e73f08ba40c5430f64e53f9", "score": "0.5182687", "text": "function csv_to_array(data, separator = \",\", withHeading = false) {\n return data\n .slice(withHeading ? data.indexOf(\"\\n\") + 1 : 0)\n .split(\"\\n\")\n .map((row) => {\n return row.split(separator);\n });\n}", "title": "" }, { "docid": "ed84aeee4910c80a1120756c269c0689", "score": "0.51783764", "text": "function transposeArray(array) {\n\tlet newArray = [];\n\tfor (let i = 0; i < array[0].length; i++) {\n\t\tnewArray.push([]);\n\t};\n\n\tfor (let i = 0; i < array.length; i++) {\n\t\tfor (let j = 0; j < array[0].length; j++) {\n\t\t\tnewArray[j].push(array[i][j]);\n\t\t};\n\t};\n\n\treturn (newArray);\n}", "title": "" }, { "docid": "541cf2a0a5ecc4a945f185cb467f40b6", "score": "0.51756006", "text": "function count(raw_data) {\r\n all_data = [];\r\n group_data = {};\r\n var output = {};\r\n raw_data.map(\r\n function(d) {\r\n if (!output.hasOwnProperty(d[2])) {\r\n output[d[2]] = 0;\r\n } \r\n output[d[2]]++;\r\n if (!group_data.hasOwnProperty(d[2])) {\r\n group_data[d[2]] = [];\r\n } \r\n group_data[d[2]].push([d[0],d[1]]);\r\n all_data.push([d[0],d[1]]);\r\n });\r\n var array = [];\r\n for (var prop in output) {\r\n if (output.hasOwnProperty(prop)) {\r\n array.push([prop,output[prop]]);\r\n } \r\n }\r\n return array;\r\n}", "title": "" }, { "docid": "6e7da3a7a422672dc5a8be605307dac7", "score": "0.5172209", "text": "function transformDataSet(array, array2){\n for(let i = 0; i <array.length; i++){\n let values = array[i].dataset.value;\n array2.push(values)\n }\n return array2\n}", "title": "" }, { "docid": "9cbb80c252da55202febcff68a418d55", "score": "0.517067", "text": "function concat (arr){\r\n let newArr = []\r\n \r\n for(let i = 0; i < arr.length; i++){\r\n if(typeof arr[i] !== \"object\"){\r\n newArr.push(arr[i])\r\n }\r\n for(let j = 0; j < arr[i].length; j++){\r\n if(typeof arr[i][j] !== \"object\"){\r\n newArr.push(arr[i][j])\r\n }\r\n for(let k = 0; k < arr[i][j].length; k++){\r\n if(typeof arr[i][j][k] !== \"object\"){\r\n newArr.push(arr[i][j][k])\r\n }\r\n } \r\n }\r\n }\r\n return newArr\r\n}", "title": "" }, { "docid": "62ec577c7dc8ae39ab835f7ae2840fb7", "score": "0.5157882", "text": "function nonEmptyArray (data) {\n return array(data) && data.length > 0;\n }", "title": "" }, { "docid": "62ec577c7dc8ae39ab835f7ae2840fb7", "score": "0.5157882", "text": "function nonEmptyArray (data) {\n return array(data) && data.length > 0;\n }", "title": "" }, { "docid": "1fc8ce21300bb1fd0fb47b48e2d308f6", "score": "0.5156953", "text": "function parseData(data) {\n var arr = [];\n const content = data.map(d => {\n arr.push({\n timestamp: d.timestamp,\n value: d.value,\n });\n });\n return arr;\n}", "title": "" }, { "docid": "4193a842bd988b3938a577fc5f60bda5", "score": "0.51564467", "text": "function transpose(array){\n return array[0].map((col, i) => array.map(row => row[i]));\n}", "title": "" }, { "docid": "e1e1111f8365d22903cfcf478220edaf", "score": "0.5147667", "text": "function findLength(arr) {\n arr = arr.map((str) => {\n if(str === null || str === undefined) return 0\n else return str.length\n })\n return arr;\n}", "title": "" }, { "docid": "98d2b400c79199e53311c37ff9fa3197", "score": "0.5146443", "text": "function prepareData(data) {\n if (data.length == null) {\n throw new Error('input data must be an array');\n }\n if (data.length === 0) {\n return [];\n }\n else if (typeof data[0] === 'object') {\n if (data[0].value == null) {\n throw new Error('input data must have a value field');\n }\n else {\n return data;\n }\n }\n else {\n const ret = Array(data.length);\n for (let i = 0; i < data.length; i++) {\n ret[i] = { value: data[i] };\n }\n return ret;\n }\n}", "title": "" }, { "docid": "98d2b400c79199e53311c37ff9fa3197", "score": "0.5146443", "text": "function prepareData(data) {\n if (data.length == null) {\n throw new Error('input data must be an array');\n }\n if (data.length === 0) {\n return [];\n }\n else if (typeof data[0] === 'object') {\n if (data[0].value == null) {\n throw new Error('input data must have a value field');\n }\n else {\n return data;\n }\n }\n else {\n const ret = Array(data.length);\n for (let i = 0; i < data.length; i++) {\n ret[i] = { value: data[i] };\n }\n return ret;\n }\n}", "title": "" }, { "docid": "414c52376d196b059aa574567f978e0a", "score": "0.5142939", "text": "function reform3(d){\n\t var array=[[],[]];\n\t for (var i = 0; i < d.length; i++) {\n\t\t array[0].push(d[i][0])\n\t\t array[1].push(d[i][1])\n\t }\n\t return array;\n}", "title": "" }, { "docid": "81df2370e769902a614a389650335dab", "score": "0.5139604", "text": "function processData(data) {\n var csvRows = [];\n var headers = Object.keys(data[0]);\n csvRows.push(headers.join(\",\"));\n\n for (var i = 0; i < data.length; i++) {\n var row = data[i];\n\n var values = headers.map(function(header) {\n var escaped = ('' + row[header.replace(/\"/g, '\\\\\"')]);\n return escaped;\n });\n\n // ES6 version\n // var values = headers.map(header => {\n // var escaped = ('' + row[header.replace(/\"/g, '\\\\\"')]);\n // return escaped;\n // });\n csvRows.push(values.join(','));\n }\n return csvRows.join('\\n');\n}", "title": "" }, { "docid": "985402685d2a901e194b212438f3342c", "score": "0.51340723", "text": "function dataProjection( data ) {\n var testData = data;\n var value = testData.length - 1;\n\n var count = 0;\n do {\n if (testData.length == 1) {\n //add value to inner array\n testData.push(testData[value]);\n }\n else if (testData.length == 2) {\n //avg of the two values\n var avg = ( (2*testData[value]) + (1*testData[value - 1]) ) / 3;\n //add value to inner array\n testData.push(avg);\n }\n else if (testData.length >= 3) {\n //grab last three values anf avg\n avg = ( (3*testData[value]) + (2*testData[value - 1]) + (1*testData[value - 2]) ) / 6;\n //add value to inner array\n testData.push(avg);\n }\n count++;\n } while(count < 3);\n\n return testData;\n}", "title": "" }, { "docid": "2309cb6904af2cbbd497fbff5289d148", "score": "0.512867", "text": "function arrayTesting() {\n var array = [];\n var c = array;\n var length = 2;\n for (var i = 0; i < length; i ++) {\n c.push([]);\n c = c[0];\n }\n Logger.log(array[0][0][0]);\n \n}", "title": "" }, { "docid": "7dbc5ab5715bf3a9812dcf90ef2f33c2", "score": "0.5127229", "text": "function removeBlankValues(array) {\n var splicedArray = array.slice(0);\n while (splicedArray.indexOf(\"\") !== -1) {\n var index = splicedArray.indexOf(\"\");\n splicedArray.splice(index, 1);\n }\n\n return splicedArray;\n}", "title": "" }, { "docid": "602bc1022ee973d912c2a217c9411fc3", "score": "0.5124991", "text": "function formatData(data){\n\tvar objOfArrs = {}; \n\tvar lines = data.toString().split(\"\\n\");\n\t//console.log(lines);\n\tvar lineSplit;\n\tfor (var x = 0; x < lines.length - 1; x++){\n\t\tvar thisLine = lines[x].split(' ');\n\t\tvar thisWord = thisLine[0];\n\t\tif (thisWord.indexOf('\\(') !== -1){\n\t\t\tvar thisIndex = thisWord.indexOf('\\(');\n\t\t\tthisWord = thisWord.slice(0, thisIndex);\n\t\t}\n\t\tvar phonArr = thisLine[1].split(\" \");\n\t\tvar syllCount = 0;\n\t\tfor (var i = 0; i < phonArr.length; i++){\n\t\t\tif (phonArr[i].match(/\\d/)){\n\t\t\t\tsyllCount++;\n\t\t\t}\n\t\t}\n\t\tif (syllCount in objOfArrs){\n\t\t\tobjOfArrs[syllCount].push(thisWord);\n\t\t} else {\n\t\t\tobjOfArrs[syllCount] = [];\n\t\t\tobjOfArrs[syllCount].push(thisWord);\n\t\t}\n\t}\n\treturn objOfArrs; \n}", "title": "" } ]
e2765d59e4293199515e3643275d7ecd
/ 3. functions for loading pages / / loads main menu
[ { "docid": "d96ad4856b6df89bf173af0e939f1591", "score": "0.7995131", "text": "function loadMenu() {\n\tisPage = \"main\";\n\n\tvar content = document.getElementById(\"content\")\n\tcontent.innerHTML = \"\";\n\tvar pel = p(markup[0].description)\n\tpel.classList.add(\"ingress\")\n\tcontent.appendChild(pel)\n\tfor (var view of markup) {\n\t\tcontent.appendChild(generateMenuItem(view))\n\t}\n\tcontent.appendChild(generateMenyItem2(translations['T_HISTORY'], translations['T_HISTORY_SHORT'], 'history', loadHistory))\n\tcontent.appendChild(generateMenyItem2(translations['T_CONTACT'], translations['T_CONTACT_SHORT'], 'contact', loadContact))\n\t\n\tvar mainHeader = '<a onclick=\"loadInfo();\" id=\"home\">Norea Sverige</a>';\n\tvar header = document.getElementById(\"header\");\n\theader.innerHTML = mainHeader;\n\theader.style[\"border-bottom\"] = \"1px solid #774\";\n}", "title": "" } ]
[ { "docid": "c78b704685a2587415ec7b331d83d42f", "score": "0.7583112", "text": "function main()\n{\n\t\tshowMenus();\n}", "title": "" }, { "docid": "82dbf380d0ad8dedc26b529a6f6b6161", "score": "0.75524235", "text": "function loadApplication() {\n mainMenu();\n}", "title": "" }, { "docid": "5abe6d23cc329130b4187346560492df", "score": "0.75223935", "text": "function load_page() {\n\t\n\tif(window.location.hash.substr(1))\n\t{\n\t\t//get url segments\n\t\tvar segments = window.location.hash.substr(1).split('/');\n\t\t\n\t\t// Load the menu file in case visitor came from external link\n\t\t$('#menu_bin').load(segments[0] + '/menu.html', $('#menu-tab').show());\n\t\n\t\t//ajax load the page content\n\t\t$('#content_bin').load(window.location.hash.substr(1), $('#menu_bin').slideUp('fast'));\n\t\t\n\t\t//uppercase the first letter of the segment for the current class\n\t\tvar first = segments[0].substring(0, 1);\n\t\tvar last = segments[0].substring(1);\n\n\t\t// Set the current class\n\t\t$('#nav-main a').removeClass('current');\n\t\t$('#nav-main a:contains(' + first.toUpperCase() + last + ')').addClass('current');\t\n\t}\n}", "title": "" }, { "docid": "c3ed5c9faca5043363fa1140c02f40e1", "score": "0.7407216", "text": "function loadPage () {\n hamburgerClick();\n menuItemClick();\n console.log('load page!');\n}", "title": "" }, { "docid": "21bcb92bb4cd9d29921e08523a836448", "score": "0.73768497", "text": "function PageLoad() {\n\t\t// Save url\n\t\twww.PushCurrentURL();\n\n\t\t// Check backbutton\n\t\tui.CreateBackButton(\"NavBackButton\");\n\n\t\tui.lowerTab();\n\t\t\n\t\twww.getPage(location.pathname);\n\t}", "title": "" }, { "docid": "8357e580c40556d284c07eb96002c8ef", "score": "0.72971594", "text": "function load(){\n loadMenuList();\n}", "title": "" }, { "docid": "f9fc0cfd266b53da3066eb0a68e3198f", "score": "0.72860825", "text": "function loadNavMenu() {\n if (navmenu_layout == 'left') {\n loadLeftNavMenu();\n } else {\n loadTopNavMenu();\n }\n }", "title": "" }, { "docid": "203def0fbe243c251d92cd423a047963", "score": "0.72317916", "text": "function LoadMenu()\r\n{\r\n document.getElementById(\"submenu_\"+activeSubmenuItem).style.color = \"white\";\r\n document.getElementById(\"ActiveSubmenuItemIcon_\"+activeSubmenuItem).style.visibility = \"visible\";\r\n if(self.name.lastIndexOf(\"&\") == -1) {\r\n self.name = \"news=1&library=0&community=0&account=0&\";\r\n }\r\n FillMenuArray();\r\n InitializeMenu();\r\n}", "title": "" }, { "docid": "bcbb773d6764683a4a75f49ce5320bb0", "score": "0.7117587", "text": "function loadTopNavMenu() {\n var portal_url = window.portal_url;\n $('ul.navtree li a').each(function() {\n $(this).attr('href', portal_url + $(this).attr('href'));\n });\n // Anonymous access.. we'll not categorize the nav items.\n // Retrieve the menus from the nav-bar\n if ($(\"body.userrole-anonymous\").length > 0) {\n $('#portal-nav-1 li:not(.section-bika-lims) a').each(function() {\n var href = $(this).attr('href');\n var id = $(this).attr('href').split(\"/\");\n var img = $(this).find('img');\n id = id[id.length-1];\n runtimenav[id] = [$(this).attr('href'),\n $(this).find('span').length ? $.trim($(this).find('span').html()) : $.trim($(this).html()),\n $(this).find('img').length ? $(this).find('img').attr('src') : \"\"];\n var sectionli = '<li class=\"plain '+id+'\"><a href=\"'+$(this).attr('href')+'\" data-section=\"'+id+'\">'+runtimenav[id][1]+'</a></li>';\n $('#portal-tools-wrapper ul#portal-globalnav').append(sectionli);\n });\n loadBreadcrumbs();\n $('#portal-globalnav').fadeIn();\n\n } else {\n // Get all items from Site setup\n var sitesetup_url = portal_url + '/bika_setup?bika.graphite.disabled=1';\n $.ajax(sitesetup_url)\n .done(function(data) {\n var htmldata = data;\n var filled = false;\n var grabbed = [];\n htmldata = $(htmldata).find('#portal-column-one dl.portletNavigationTree').html();\n $(htmldata).find('a').each(function() {\n var href = $(this).attr('href');\n var id = $(this).attr('href').split(\"/\");\n var img = $(this).find('img');\n id = id[id.length-1];\n runtimenav[id] = [$(this).attr('href'),\n $(this).find('span').length ? $.trim($(this).find('span').html()) : $.trim($(this).html()),\n $(this).find('img').length ? $(this).find('img').attr('src') : \"\",\n $(this).attr('class')];\n filled = true;\n grabbed.push(id);\n });\n if (!filled) {\n // Not a LabMan? Use the portal-nav instead\n $('#portal-nav-1 li a').each(function() {\n var href = $(this).attr('href');\n var id = $(this).attr('href').split(\"/\");\n var img = $(this).find('img');\n id = id[id.length-1];\n runtimenav[id] = [$(this).attr('href'),\n $(this).find('span').length ? $.trim($(this).find('span').html()) : $.trim($(this).html()),\n $(this).find('img').length ? $(this).find('img').attr('src') : \"\",\n $(this).attr('class')];\n grabbed.push(id);\n });\n }\n\n // Find orphan menuitems and populate 'Others'\n var registered = [];\n for (var section in navmenu) {\n var items = navmenu[section]['items'];\n $.each(items, function(i, item) {\n registered.push(item);\n return;\n });\n }\n if (!('Other' in navmenu)) {\n navmenu['Other'] = {'id': 'nav-other',\n 'items': []};\n }\n for (var key in runtimenav) {\n if (key != 'sitemap' && key!='Plone' && registered.indexOf(key) < 0) {\n navmenu['Other']['items'].push(key);\n }\n }\n // Populate the nav-menu\n var activedetected = false;\n for (var section in navmenu) {\n var items = navmenu[section]['items'];\n $.each(items, function(i, item) {\n if (item in runtimenav) {\n var runitem = runtimenav[item];\n var active = !activedetected && currsectionid.indexOf('/'+item) > -1;\n var cssclass = ' class=\"'+item;\n if (active) {\n cssclass += \" active\";\n activedetected = true;\n }\n var aclass = '';\n if (runitem[3] !== undefined) {\n // We only need the contentype-xx class\n try {\n var re = /contenttype-.+/g;\n var matches = runitem[3].match(re);\n if (matches && matches.length > 0) {\n aclass = 'class=\"'+matches[0]+'\"';\n }\n } catch (e) {}\n }\n cssclass += '\"';\n var itemli = '<li'+cssclass+'><a '+aclass+' href=\"'+runitem[0]+'\">';\n itemli += runitem[2] != '' ? '<img src=\"'+runitem[2]+'\">' : '';\n itemli += runitem[1]+'</a></li>';\n var sectionid = navmenu[section]['id']\n var sectionul = null;\n if ($('#portal-tools-wrapper ul#lims-nav li.'+sectionid).length < 1) {\n var sectionli = '<li class=\"plain '+sectionid+'\"><a href=\"#\" data-section=\"'+sectionid+'\">'+_b(section)+'</a></li>';\n var contextmenu = '<ul class=\"'+sectionid+' hidden\" data-section=\"'+sectionid+'\">'+itemli+'</ul>';\n $('#portal-tools-wrapper ul#lims-nav').append(sectionli);\n $('#contextual-menu-wrapper').append(contextmenu);\n } else {\n $('#contextual-menu-wrapper ul.'+sectionid).append(itemli);\n }\n $('#portal-nav-1 li.section-'+item).remove();\n }\n });\n }\n })\n .always(function() {\n // Move all plone's portaltab-* menus inside Tools section\n if ($('#portal-tools-wrapper ul#lims-nav li.tools').length < 1) {\n // Add the tools section\n $('#portal-tools-wrapper ul#lims-nav').append('<li class=\"tools\"><a data-section=\"tools\" href=\"#\">'+_b('Tools')+'</a></li>');\n $('#contextual-menu-wrapper').append('<ul class=\"tools hidden\" data-section=\"tools\"></ul>');\n }\n $('#portal-tools-wrapper ul#portal-globalnav li[id^=\"portaltab-\"]').each(function() {\n $(this).detach().appendTo($('#contextual-menu-wrapper ul.tools'));\n });\n\n // Move all remaining items to the portal-globalnav\n $('#portal-nav-1 li a').each(function() {\n var href = $(this).attr('href');\n var id = $(this).attr('href').split(\"/\");\n var img = $(this).find('img');\n id = id[id.length-1];\n runtimenav[id] = [$(this).attr('href'),\n $(this).find('span').length ? $.trim($(this).find('span').html()) : $.trim($(this).html()),\n $(this).find('img').length ? $(this).find('img').attr('src') : \"\"];\n var cssclass = $(this).closest('li').hasClass('navTreeCurrentNode') ? 'selected' : 'plain';\n var sectionli = '<li class=\"'+cssclass+' '+id+'\"><a href=\"'+$(this).attr('href')+'\" data-section=\"'+id+'\">'+runtimenav[id][1]+'</a></li>';\n $('#portal-tools-wrapper ul#portal-globalnav').append(sectionli);\n });\n\n loadActiveNavSection();\n loadBreadcrumbs();\n loadNavMenuTransitions();\n $('#contextual-menu-wrapper a').unbind(\"click\");\n $('#contextual-menu-wrapper a').click(processLink);\n $('#portal-globalnav').fadeIn();\n $('#lims-nav-wrapper').fadeIn();\n $('#contextual-menu-wrapper').hide();\n $('#content-wrapper').animate({'margin-top': 70}, 'fast');\n //$('#lims-nav').fadeIn();\n setActiveNavItem(window.location.href);\n });\n }\n }", "title": "" }, { "docid": "66d4403b7a1ed121512467a454d7dda2", "score": "0.70963675", "text": "function main () {\n mainMenu()\n}", "title": "" }, { "docid": "6b1dd152eb3d227c71ba9778d9fa3bc3", "score": "0.70243853", "text": "function loadPage() \n{\n\n\tcontent = ge(\"browseContent\");\n\n\tloadSidebar();\n\tloadBrowser();\n\n\tgetAccounts();\n\tgetExtensions();\n\n\t//fix the actionsub for ie\n\tif (document.all) \n\t{\n\n\t\tge(\"actionSub\").style.marginLeft = \"-70px\";\n\t\tge(\"actionSub\").style.marginTop = \"18px\";\n\t\tge(\"shareSub\").style.marginLeft = \"-70px\";\n\t\tge(\"shareSub\").style.marginTop = \"18px\";\n\n\t}\n\n\n\n}", "title": "" }, { "docid": "aaac710aeb58f0ff8313d4c38cea3990", "score": "0.6972709", "text": "load_page() {\n this.unload_page()\n // move to the top of the page\n window.scrollTo(0,0)\n var page_id = location.hash.replace('#','')\n // remove arguments from the page_id\n if (page_id.includes(\"=\")) {\n var split = page_id.split(\"=\")\n page_id = split[0]\n }\n // if no page is provided, load the default_page\n if (page_id == \"\") {\n window.location.hash = '#'+gui.settings[\"default_page\"]\n return\n }\n // keep track of the current page\n if (this.remember_page) this.connections.set_page(page_id)\n\t\t// if loading the page for the first time, draw the menu and toolbar (otherwise unload_page() would reset pending requests)\n\t\tif (! this.first_page_loaded) {\n\t\t\tthis.menu.draw()\n\t\t\tthis.toolbar.draw()\n\t\t\tthis.first_page_loaded = true\n\t\t}\n // load system pages\n if (page_id.startsWith(\"__\")) {\n this.page = new Page(\"SYSTEM\", page_id, \"\")\n }\n // load user's custom page\n else {\n this.waiting_for_page = true\n if (this.page_listener != null) this.remove_listener(this.page_listener)\n this.page_listener = this.add_configuration_listener(\"gui/pages/\"+page_id, this.page_config_schema)\n }\n }", "title": "" }, { "docid": "ca7abffd10a1619ae75dad2e6777cb36", "score": "0.69645697", "text": "function onLoad () {\n\tregisterEvents();\n\trouter.refresh();\n\tmenu.load();\n}", "title": "" }, { "docid": "e35a6852b760a7619cf88e10d7335fd3", "score": "0.6953569", "text": "function configurePage(){\n\tloadPageForMenu(\"About\");\n}", "title": "" }, { "docid": "9d43e73f367e7be29025654c14de0917", "score": "0.6874715", "text": "function mainMenuItem(){\n overviewMenuItem();\n}", "title": "" }, { "docid": "8bd51bfff8433e6c2111e6a8a97db908", "score": "0.6872212", "text": "function load() {\n loadPage(getAllReceipts, loadLogoutButton); // From js/common.js\n}", "title": "" }, { "docid": "ef360d1adab10d12a3e5b728375c827e", "score": "0.68543196", "text": "function beforePageLoad(page){\t\t\n\t\n\t\t//remove leading slash, else return false\n\t\tvar firstCharacterOfPage = page.substring(0, 1);\t\n\t\tif(firstCharacterOfPage == \"/\"){\n\t\t\tpage = page.substring(1);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\t\t\t\t\t\t\n\t\t\n\t\t//remove class from previously selected menu item\n\t\t$(\"#primary-menu li.current-menu-item, #primary-menu li.active-menu-item\").removeAttr(\"display\");\t\t\n\t\t$(\"#primary-menu li\").removeClass(\"current-menu-item\").removeClass(\"active-menu-item\");\n\n\t\t//add class to currently selected menu item\n\t\tvar addr = base + page;\n\t\t$(\"#primary-menu li a[href='\" + addr + \"']\").parent(\"li\").addClass(\"current-menu-item\");\t\t\t\t\t\t\t\n\t\t$(\"#primary-menu li a[href='\" + addr + \"']\").parents(\"li\").addClass(\"active-menu-item\");\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t//prepare for next page - remove current content and add loader\n\t\t$('#content').fadeOut(\"fast\").queue(function(){\n\t\t\t$(this).html('<div id=\"loader\">Loading... </div>').fadeIn(\"fast\").dequeue();\n\t\t});\t\t\t\t\t\t\n\t}", "title": "" }, { "docid": "84ffe6a90da0b7cc292558d9e3c7b522", "score": "0.6849048", "text": "function loading(){\n init();\n if ($(\"html\").is(\"#index-page\")) {\n showSplash();\n // console.log('index-page');\n } else {\n showPage();\n // console.log('single-page')\n }\n }", "title": "" }, { "docid": "6086e238f92e04b00409ea818c05f031", "score": "0.68338734", "text": "function handlePageFunctions() {\n handleMenuStyleOnLoad();\n handleMenuStyleOnResizing();\n handleScrollEffects();\n handleMenuButtonClicks();\n}", "title": "" }, { "docid": "73e08f31f72ffa99be421f04fced5657", "score": "0.68121344", "text": "function menuRouter(what,where,selector) {\n $(what).click(function(e){\n e.preventDefault();\n link=$(this).attr(\"href\");\n if (loading) return; //ignore click if another page is loading\n loadig=true;\n $(where).load(link+' '+selector, function(){\n pageUI();\n //set page heading\n $(page_heading_wrap).load(link+' '+page_heading).hide().fadeIn(very_slow);\n //when content loaded - load background overlay\n $(back_overlay_wrap).load(link+' '+back_overlay).hide().fadeIn(very_slow);\n \n //on success process the ui elements\n \n //requires to refresh the slider if slider is used-->\n loading=false;\n }).hide().fadeIn(very_slow,function(){ afterContentLoaded();}); //call gallery after content loaded\n \n });\n}", "title": "" }, { "docid": "f649eaa1d949836448d78ef5cddb6b47", "score": "0.68098897", "text": "function loadHomePage() {\n // notify ifame load app icons (by view:'*')\n var isHome = false;\n var mainPage = _visit_box.pop();\n if (!mainPage) isHome = true;\n\n _this.tell('load-mainpage', {\n view: '*',\n mainPage: mainPage,\n isHome: isHome\n });\n }", "title": "" }, { "docid": "76335d6364ed613f0f46c1886168078a", "score": "0.6805168", "text": "function loadMenu(menuNum){\r\n\r\n\tif (menuCookie[menuNum-1]==1)\r\n\t\teval(\"window.frames.menuIframe\" + menuNum + \".Go()\");\r\n\t\r\n}", "title": "" }, { "docid": "4d4687b158f9c6f07eb228cbbd565d8d", "score": "0.6785803", "text": "function load() {\n //if (loaded) return false;\n //loaded = true;\n \n menus.addItemByPath(\"View/Open helper tab\", new ui.item({\n command: \"Open tab\"\n }), 100, plugin);\n }", "title": "" }, { "docid": "0569584551ccfc8ff32ae47b0948eda8", "score": "0.6777196", "text": "function startatLoad(){\n\tloadNavbar();\n}", "title": "" }, { "docid": "56cad733e9f305cf336ad1f630d4e17e", "score": "0.6756449", "text": "function loadLeftNavMenu() {\n $('#portal-globalnav').fadeIn();\n var portal_url = window.portal_url;\n $('ul.navtree li a').each(function() {\n $(this).attr('href', portal_url + $(this).attr('href'));\n });\n // Get all items from Site setup\n var sitesetup_url = portal_url + '/bika_setup?bika.graphite.disabled=1';\n $.ajax(sitesetup_url)\n .done(function(data) {\n var htmldata = data;\n htmldata = $(htmldata).find('#portal-column-one dl.portletNavigationTree').html();\n $(htmldata).find('a').each(function() {\n var href = $(this).attr('href');\n var id = $(this).attr('href').split(\"/\");\n var img = $(this).find('img');\n id = id[id.length-1];\n runtimenav[id] = [$(this).attr('href'),\n $(this).find('span').length ? $.trim($(this).find('span').html()) : $.trim($(this).html()),\n $(this).find('img').length ? $(this).find('img').attr('src') : \"\"];\n });\n // Populate the nav-menu\n var activedetected = false;\n for (var section in navmenu) {\n var items = navmenu[section]['items'];\n $.each(items, function(i, item) {\n if (item in runtimenav) {\n var runitem = runtimenav[item];\n var active = !activedetected && currsectionid.indexOf('/'+item) > -1;\n var cssclass = ' class=\"'+item;\n if (active) {\n cssclass += \" active\";\n activedetected = true;\n }\n cssclass += '\"';\n var itemli = '<li'+cssclass+'><a href=\"'+runitem[0]+'\"><img src=\"'+runitem[2]+'\">'+runitem[1]+'</a></li>';\n var sectionid = navmenu[section]['id']\n var sectionul = null;\n if ($('ul.navtree li.'+sectionid).length < 1) {\n var sectionli = '<li class=\"navtree-item '+sectionid+'\"><div class=\"nav-section-title\">'+_b(section)+'</div><ul>'+itemli+'</ul></li>';\n $('ul.navtree').append(sectionli);\n } else {\n $('ul.navtree li.'+sectionid+' ul').append(itemli);\n }\n }\n });\n }\n })\n .always(function() {\n $('div.column-left').fadeIn();\n loadActiveNavSection();\n loadBreadcrumbs();\n loadNavMenuTransitions();\n $('.nav-container a').unbind(\"click\");\n $('.nav-container a').click(processLink);\n });\n\n $('a.hide-column-left').click(function(e) {\n e.preventDefault();\n var colwidth = $('div.column-left').outerWidth();\n var centwidth = $('div.column-left').outerWidth()-5;\n $('div.column-center').animate({'width': '+='+centwidth+'px'},'slow');\n $('#loading-pane').animate({'margin-left': '-='+centwidth+'px'},'slow');\n $('div.column-left').animate({'margin-left': '-'+colwidth+'px'},'slow', function() {\n $('div.column-left div.column-content').hide();\n $('div.show-column-left').fadeIn();\n fixLayout();\n });\n });\n $('div.show-column-left a').click(function(e) {\n e.preventDefault();\n var left = -parseInt($('div.column-left').css('margin-left'))+5;\n $('div.show-column-left').fadeOut('slow');\n $('div.column-left div.column-content').show();\n $('div.column-center').animate({'width': '-='+left+'px'},'slow');\n $('#loading-pane').animate({'margin-left': '+='+left+'px'},'slow');\n $('div.column-left').animate({'margin-left': '0px'}, 'slow', function() {\n fixLayout();\n });\n });\n }", "title": "" }, { "docid": "2dadbd26236844ddc0c7557f2793a2ac", "score": "0.67343277", "text": "function mainMenu()\n{\n\tvar page = document.getElementsByClassName(\"PSPAGE\")[0];\t//\tThe body tag was stupidly named as such\n\n\tvar mainMenu = document.createElement(\"div\");\n\tmainMenu.setAttribute(\"id\", \"students-first-menu\");\n\n\tvar mainMenuButton = link(selfServiceFrameURL, \"Main Menu\");\n\tmainMenuButton.setAttribute(\"id\", \"students-first-main-menu-link\");\n\tmainMenuButton.setAttribute(\"class\", \"students-first-link\");\t\n\tmainMenu.appendChild(mainMenuButton);\n\n\tvar logOutButton = link(logoutURL, \"Log Out\");\n\tlogOutButton.setAttribute(\"id\", \"students-first-logout-link\");\n\tlogOutButton.setAttribute(\"class\", \"students-first-link\");\t\n\tmainMenu.appendChild(logOutButton);\n\n\tpage.insertBefore(mainMenu, page.firstChild);\n}", "title": "" }, { "docid": "f07c9e66e39b0fa8f60e7b9b2ee8163c", "score": "0.67326295", "text": "function loadPageContents() {\n\n\t\t\tif ( get(\"start\").length === 0) {\n\t\t\t\tvar pagePicked = \"welcome\";\n\t\t\t}\n\t\t\telse if ( get(\"item\").length === 0) {\n\t\t\t\tvar pagePicked = \"item\";\n\t\t\t}\n\t\t\telse if ( get(\"yarn\").length === 0) {\n\t\t\t\tvar pagePicked = \"yarn\";\n\t\t\t}\n\t\t\telse if ( get(\"mc\").length === 0) {\n\t\t\t\tvar pagePicked = \"mc\";\n\t\t\t}\n\t\t\telse if ( get(\"cc\").length === 0) {\n\t\t\t\tvar pagePicked = \"cc\";\n\t\t\t}\n\t\t\telse if ( get(\"cc_areas\").length === 0) {\n\t\t\t\tvar pagePicked = \"cc_areas\";\n\t\t\t}\n\t\t\telse if ( get(\"accent_color\").length === 0) {\n\t\t\t\tvar pagePicked = \"accent_color\";\n\t\t\t}\n\t\t\telse if ( get(\"submit\").length === 0) {\n\t\t\t\tvar pagePicked = \"email\";\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tvar pagePicked = \"success\";\n\t\t\t}\n\n\t\t\tconsole.log(pagePicked);\n\n\t\t\tbuildPage(pagePicked);\n\t\t}", "title": "" }, { "docid": "4d7eb96afde88dc15cb53ffa36073c13", "score": "0.67005765", "text": "function scene_homepage() {\n\t\t\tpage_home_background();\n\t\t\tpage_home_waves();\n\t\t\tpage_home_menu();\n\t\t}", "title": "" }, { "docid": "242a4b910e2994f835c0d5747661d79d", "score": "0.66834944", "text": "function loadNavbarResources(){\r\n\t\r\n //Setando o nome do usuario\r\n $('#userNameDiv').text(objUser.obj.name);\r\n\r\n // Trata o clique do botao 'Home'\r\n $('#homeButton').click(function () {\r\n alterPage('home', clearHomeClientPage, loadHomeClientPage);\r\n });\r\n // Trata o clique do botao 'Animais'\r\n $.getScript('./src/js/home_pet.js', function () {\r\n $('#petsButton').click(function () {\r\n alterPage('pet', clearHomePetPage, loadHomePetPage);\r\n });\r\n });\r\n // Trata o clique do botao 'Servicos'\r\n $.getScript('./src/js/home_service.js', function () {\r\n $('#servicesButton').click(function () {\r\n alterPage('service', clearHomeServicePage, loadHomeServicePage);\r\n });\r\n });\r\n // Trata o clique do botao 'Produtos'\r\n $.getScript('./src/js/home_product.js', function () {\r\n $('#productsButton').click(function () {\r\n alterPage('product', clearHomeProductPage, loadHomeProductPage);\r\n });\r\n });\r\n // Trata o clique do botao 'Editar'\r\n $.getScript('./src/js/edit_client.js', function () {\r\n $('#editUserButton').click(function () {\r\n alterPage('edit', clearEditClientPage, loadEditClientPage);\r\n });\r\n });\r\n // Trata o clique do botao 'Logout'\r\n $('#logoutButton').click(function () {\r\n currentPage.clear();\r\n clearNavbarPage(); \r\n loadHomePage();\r\n });\r\n}", "title": "" }, { "docid": "48e3b5ae66721393e747d41a18f8f052", "score": "0.6683319", "text": "function loadMenus() {\n function load(menuType, withData) {\n var menu = $('#' + menuType + '-ajax');\n if (menu.length == 0) {\n return; // If the element doesn't exist do nothing\n }\n var url = $('#page').attr('ajax-url');\n var data = {\n submit: 'menu',\n type: menuType,\n withData: withData\n };\n $.ajax({\n url: url,\n type: \"POST\",\n data: data,\n dataType: \"json\",\n beforeSend: function () {\n menu.find('.fa-spin').removeClass('hidden');\n },\n success: function (json) {\n menu.html(json.content);\n },\n error: function (xhr, ajaxOptions, thrownError) {\n console.log(\"status: \" + xhr.status + \",\\n responseText: \"\n + xhr.responseText + \",\\n thrownError \" + thrownError);\n }\n });\n }\n\n load('menu-header', ['archives', 'categories', 'languages', 'pages', 'tags']);\n load('menu-footer');\n}", "title": "" }, { "docid": "20f2d0ec24753cb6314453b5995b466e", "score": "0.6672226", "text": "function mmLoadMenus() {\nif (window.softwaremenu) return;\nwindow.softwaremenu = new Menu(\"root\",190,16,\"Verdana, Arial, Helvetica, sans-serif\",10,\"#555555\",\"#6585A3\",\"#ffffff\",\"#F2F3F4\",\"left\",\"middle\",3,3,300,-5,7,true,true,true,3,true,true);\nsoftwaremenu.addMenuItem(\"Desktop Modeling Environment\",\"location='/software/desktop/'\");\nsoftwaremenu.addMenuItem(\"DataViewer Application\",\"location='/software/dataviewer/'\");\nsoftwaremenu.hideOnMouseOut=true;\nsoftwaremenu.menuBorder=1;\nsoftwaremenu.menuLiteBgColor='#ffffff';\nsoftwaremenu.menuBorderBgColor='#999999';\nsoftwaremenu.bgColor='#ffffff';\nwindow.databasesmenu = new Menu(\"root\",155,16,\"Verdana, Arial, Helvetica, sans-serif\",10,\"#555555\",\"#6585A3\",\"#ffffff\",\"#F2F3F4\",\"left\",\"middle\",3,3,300,-5,7,true,true,true,3,false,true);\ndatabasesmenu.addMenuItem(\"Revcor Database\",\"location='/databases/revcor/'\");\ndatabasesmenu.addMenuItem(\"CIPIC HRTF Database\",\"location='/databases/cipic/'\");\ndatabasesmenu.addMenuItem(\"Published Data Database\",\"location='/databases/published/'\");\ndatabasesmenu.addMenuItem(\"EFI Modules Database\",\"location='/databases/modules/'\");\ndatabasesmenu.hideOnMouseOut=true;\ndatabasesmenu.menuBorder=1;\ndatabasesmenu.menuLiteBgColor='#ffffff';\ndatabasesmenu.menuBorderBgColor='#999999';\ndatabasesmenu.bgColor='#ffffff';\nwindow.modelingmenu = new Menu(\"root\",145,16,\"Verdana, Arial, Helvetica, sans-serif\",10,\"#555555\",\"#6585A3\",\"#ffffff\",\"#F2F3F4\",\"left\",\"middle\",3,3,300,-5,7,true,true,true,3,true,true);\nmodelingmenu.addMenuItem(\"Tutorial & Instructions\",\"location='/modeling/tutorial/'\");\nmodelingmenu.addMenuItem(\"My Modeling Home\",\"window.open('/modeling/authenticated/','modeling_console','height=480,width=790,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,status=no,directories=no,hotkeys=no');\");\nmodelingmenu.hideOnMouseOut=true;\nmodelingmenu.menuBorder=1;\nmodelingmenu.menuLiteBgColor='#ffffff';\nmodelingmenu.menuBorderBgColor='#999999';\nmodelingmenu.bgColor='#ffffff';\nwindow.supportmenu = new Menu(\"root\",145,16,\"Verdana, Arial, Helvetica, sans-serif\",10,\"#555555\",\"#6585A3\",\"#ffffff\",\"#F2F3F4\",\"left\",\"middle\",3,3,300,-5,7,true,true,true,3,true,true);\nsupportmenu.addMenuItem(\"File Specs & Schemas\",\"location='/support/specs/'\");\nsupportmenu.addMenuItem(\"Contact EarLab Team\",\"location='/support/Contact.aspx'\");\nsupportmenu.hideOnMouseOut=true;\nsupportmenu.menuBorder=1;\nsupportmenu.menuLiteBgColor='#ffffff';\nsupportmenu.menuBorderBgColor='#999999';\nsupportmenu.bgColor='#ffffff';\nwindow.tutorialsmenu = new Menu(\"root\",90,16,\"Verdana, Arial, Helvetica, sans-serif\",10,\"#555555\",\"#6585A3\",\"#ffffff\",\"#F2F3F4\",\"left\",\"middle\",3,3,300,-5,7,true,true,true,3,true,true);\ntutorialsmenu.addMenuItem(\"Introduction\",\"location='/tutorials/introduction/Default.aspx'\");\ntutorialsmenu.addMenuItem(\"Anatomy\",\"location='/tutorials/anatomy/Default.aspx'\");\ntutorialsmenu.addMenuItem(\"Physiology\",\"location='/tutorials/physiology/Default.aspx'\");\ntutorialsmenu.hideOnMouseOut=true;\ntutorialsmenu.menuBorder=1;\ntutorialsmenu.menuLiteBgColor='#ffffff';\ntutorialsmenu.menuBorderBgColor='#999999';\ntutorialsmenu.bgColor='#ffffff';\n \ntutorialsmenu.writeMenus();\n}", "title": "" }, { "docid": "34e4b890766eeedee3c74e1618ee0dee", "score": "0.6671154", "text": "function loadPage() {\n if (window.location.hash) {\n APIController.genOauth();\n }\n if (localStorage.getItem(\"loggedIn\") === \"true\") {\n APIController.myInfo();\n APIController.mySongs();\n toggleUI();\n }\n\n //////////////////////////////////\n // ===== event listeners ===== //\n ////////////////////////////////\n\n $(\".loginButton\").on(\"click\", logMeIn);\n $(\".logOutButton\").on(\"click\", logMeOut);\n $(\".myArtistsButton\").on(\"click\", checkArtistContent);\n $(\".mySongsButton\").on(\"click\", checkSongContent);\n $(\".myPlaylistsButton\").on(\"click\", checkPlaylistContent);\n $(\".playerStatus\").on(\"click\", movePlayer);\n $(\".playerVolume\").on(\"mouseup\", function () {\n APIController.volume(this.value);\n });\n APIController.currentlyPlaying();\n APIController.check();\n }", "title": "" }, { "docid": "1f1fb5c66cdcc7b79faa01bf7935e868", "score": "0.66491675", "text": "function serviceMenuPage() {\n generateServiceMenuPageHeader();\n generateServiceMenuPageMainContent();\n}", "title": "" }, { "docid": "1dfbc9b3758fd33d4ca9a6145e2bd4b9", "score": "0.66345316", "text": "function initMenu()\n{\n\tif(!letraAtual){\n\t\tletraAtual = \"\";\n\t}\n\tativaBotaoAdicionaMapfile(\"adiciona\");\n\tativaBotaoVerificarOrfaos(\"semmapfiles\");\n\tativaBotaoUploadGvsig(\"uploadGvsig\");\n\n\tcore_carregando(\"ativa\");\n\tcore_carregando($trad(\"msgBuscaTemas\",i3GEOadmin.core.dicionario));\n\tcore_ativaPainelAjuda(\"ajuda\",\"botaoAjuda\");\n\tcore_pegaMapfiles(\"montaArvore()\",letraAtual);\n}", "title": "" }, { "docid": "556fdbed814ed68c618a21d1af2639af", "score": "0.6630477", "text": "function getPageOnLoad() {\n var page = window.location.hash;\n switch (page) {\n case \"#home\":\n case \"#projects\":\n case \"#blog\":\n case \"#resume\":\n case \"#contact\":\n break;\n case \"#resume-requested\":\n jQuery(\"#resume-success\").show();\n page = \"#resume\";\n break;\n default:\n page = \"#home\";\n break;\n }\n jQuery(\".nav a[href='\" + page + \"']\").parent().addClass(\"active\");\n jQuery(page + \"-page\").addClass(\"active\").fadeIn(500);\n document.title = \"{{ site.name }} | \" + capitalize(page.slice(1));\n}", "title": "" }, { "docid": "2a8a7bf267285ced212b073901edccf3", "score": "0.66303766", "text": "function init() {\n\t\t_showMenuItems();\n\t}", "title": "" }, { "docid": "50612759fc9ac94b3409f4146f29674b", "score": "0.6623633", "text": "function mainMenu()\n{\n\tgame = game.restart(false);\n\tactivePage = \"menu\";\n\t// Hides upcoming figures portion\n\tnextUps.forEach(x => x.clearRect(0,0,85,85));\n\t$(\"#next-txt\").fadeTo(0, 0);\n\n\t$(\"#score\").hide();\n\t$(\"#speed\").hide();\n\t$(\"#time\").hide();\n\n\tshowMainMenu();\n\t$(\"#start\").focus();\n\n}", "title": "" }, { "docid": "21a53537f8a3085c5c745239418681b5", "score": "0.6621499", "text": "function loadPage(menuOption)\n{\n\t// switch case gets the pressed button's id and determines the module\n\tswitch(menuOption.id)\n\t{\n\t\tcase \"evt_type_btn\":\n\t\t\t$.mobile.changePage(\"index.html#event_type\");\n\t\t\tbreak;\n\t\tcase \"venues_btn\":\n\t\t\t$.mobile.changePage(\"index.html#venue\");\n\t\t\tbreak;\n\t\tcase \"suppliers_btn\":\n\t\t\t$.mobile.changePage(\"index.html#supplier\");\n\t\t\tbreak;\n\t\tcase \"customers_btn\":\n\t\t\t$.mobile.changePage(\"index.html#customer\");\n\t\t\tbreak;\n\t\tcase \"events_btn\":\n\t\t\t$.mobile.changePage(\"index.html#event\");\n\t\t\tbreak;\n case \"checklist_btn\":\n $.mobile.changePage(\"index.html#events_lookup_checklist\");\n break;\n case \"agenda_btn\":\n $.mobile.changePage(\"index.html#events_lookup_agenda\");\n break;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "75b20155256c2dad0e9e1f51195a372c", "score": "0.66130704", "text": "function windowLoadInit() {\n //toggle mobile menu\n jQuery('.toggle_menu').on('click', function(){\n jQuery(this)\n .toggleClass('mobile-active')\n .closest('.page_header')\n .toggleClass('mobile-active')\n .end()\n .closest('.page_toplogo')\n .next()\n .find('.page_header')\n .toggleClass('mobile-active');\n });\n\n jQuery('.mainmenu a').on('click', function(){\n var $this = jQuery(this);\n //If this is a local link or item with sumbenu - not toggling menu\n if (($this.hasClass('sf-with-ul')) || !($this.attr('href').charAt(0) === '#')) {\n return;\n }\n $this\n .closest('.page_header')\n .toggleClass('mobile-active')\n .find('.toggle_menu')\n .toggleClass('mobile-active');\n });\n\n //side header processing\n var $sideHeader = jQuery('.page_header_side');\n // toggle sub-menus visibility on menu-click\n jQuery('ul.menu-click').find('li').each(function(){\n var $thisLi = jQuery(this);\n //toggle submenu only for menu items with submenu\n if ($thisLi.find('ul').length) {\n $thisLi\n .append('<span class=\"activate_submenu\"></span>')\n //adding anchor\n .find('.activate_submenu, > a')\n .on('click', function(e) {\n var $thisSpanOrA = jQuery(this);\n //if this is a link and it is already opened - going to link\n if (($thisSpanOrA.attr('href') === '#') || !($thisSpanOrA.parent().hasClass('active-submenu'))) {\n e.preventDefault();\n }\n if ($thisSpanOrA.parent().hasClass('active-submenu')) {\n $thisSpanOrA.parent().removeClass('active-submenu');\n return;\n }\n $thisLi.addClass('active-submenu').siblings().removeClass('active-submenu');\n });\n } //eof sumbenu check\n });\n if ($sideHeader.length) {\n jQuery('.toggle_menu_side').on('click', function(){\n var $thisToggler = jQuery(this);\n if ($thisToggler.hasClass('header-slide')) {\n $sideHeader.toggleClass('active-slide-side-header');\n } else {\n if($thisToggler.parent().hasClass('header_side_right')) {\n $body.toggleClass('active-side-header slide-right');\n } else {\n $body.toggleClass('active-side-header');\n }\n }\n });\n //hidding side header on click outside header\n $body.on('click', function( e ) {\n if ( !(jQuery(e.target).closest('.page_header_side').length) && !($sideHeader.hasClass('page_header_side_sticked')) ) {\n $sideHeader.removeClass('active-slide-side-header');\n $body.removeClass('active-side-header slide-right');\n }\n });\n } //sideHeader check\n\n //1 and 2/3/4th level mainmenu offscreen fix\n var MainWindowWidth = jQuery(window).width();\n var boxWrapperWidth = jQuery('#box_wrapper').width();\n jQuery(window).on('resize', function(){\n MainWindowWidth = jQuery(window).width();\n boxWrapperWidth = jQuery('#box_wrapper').width();\n });\n //2/3/4 levels\n jQuery('.mainmenu_wrapper .sf-menu').on('mouseover', 'ul li', function(){\n // jQuery('.mainmenu').on('mouseover', 'ul li', function(){\n if(MainWindowWidth > 991) {\n var $this = jQuery(this);\n // checks if third level menu exist\n var subMenuExist = $this.find('ul').length;\n if( subMenuExist > 0){\n var subMenuWidth = $this.find('ul, div').first().width();\n var subMenuOffset = $this.find('ul, div').first().parent().offset().left + subMenuWidth;\n // if sub menu is off screen, give new position\n if((subMenuOffset + subMenuWidth) > boxWrapperWidth){\n var newSubMenuPosition = subMenuWidth + 0;\n $this.find('ul, div').first().css({\n left: -newSubMenuPosition,\n });\n } else {\n $this.find('ul, div').first().css({\n left: '100%',\n });\n }\n }\n }\n //1st level\n }).on('mouseover', '> li', function(){\n if(MainWindowWidth > 991) {\n var $this = jQuery(this);\n var subMenuExist = $this.find('ul').length;\n if( subMenuExist > 0){\n var subMenuWidth = $this.find('ul').width();\n var subMenuOffset = $this.find('ul').parent().offset().left - (jQuery(window).width() / 2 - boxWrapperWidth / 2);\n // if sub menu is off screen, give new position\n if((subMenuOffset + subMenuWidth) > boxWrapperWidth){\n var newSubMenuPosition = boxWrapperWidth - (subMenuOffset + subMenuWidth);\n $this.find('ul').first().css({\n left: newSubMenuPosition,\n });\n }\n }\n }\n });\n\n /////////////////////////////////////////\n //single page localscroll and scrollspy//\n /////////////////////////////////////////\n var navHeight = jQuery('.page_header').outerHeight(true);\n //if sidebar nav exists - binding to it. Else - to main horizontal nav\n if (jQuery('.mainmenu_side_wrapper').length) {\n $body.scrollspy({\n target: '.mainmenu_side_wrapper',\n offset: navHeight\n });\n } else if (jQuery('.mainmenu_wrapper').length) {\n $body.scrollspy({\n target: '.mainmenu_wrapper',\n offset: navHeight\n })\n }\n\n //background image teaser and secitons with half image bg\n //put this before prettyPhoto init because image may be wrapped in prettyPhoto link\n jQuery(\".bg_teaser, .image_cover\").each(function(){\n var $teaser = jQuery(this);\n var $image = $teaser.find(\"img\").first();\n if (!$image.length) {\n $image = $teaser.parent().find(\"img\").first();\n }\n if (!$image.length) {\n return;\n }\n var imagePath = $image.attr(\"src\");\n $teaser.css(\"background-image\", \"url(\" + imagePath + \")\");\n var $imageParent = $image.parent();\n //if image inside link - adding this link, removing gallery to preserve duplicating gallery items\n if ($imageParent.is('a')) {\n $teaser.prepend($image.parent().clone().html(''));\n $imageParent.attr('data-gal', '');\n }\n });\n\n if (jQuery().UItoTop) {\n jQuery().UItoTop({ easingType: 'easeInOutQuart' });\n }\n\n if (jQuery().parallax) {\n jQuery('.parallax').parallax(\"50%\", 0.01);\n }\n\n jQuery('.panel-group').each(function() {\n jQuery(this).find('a').first().filter('.collapsed').trigger('click');\n });\n\n if (jQuery().flexslider) {\n var $introSlider = jQuery(\".intro_section .flexslider\");\n $introSlider.each(function () {\n var $currentSlider = jQuery(this);\n var data = $currentSlider.data();\n var nav = (data.nav !== 'undefined') ? data.nav : true;\n var dots = (data.dots !== 'undefined') ? data.dots : true;\n\n $currentSlider.flexslider({\n animation: \"fade\",\n pauseOnHover: true,\n useCSS: true,\n controlNav: dots,\n directionNav: nav,\n prevText: \"\",\n nextText: \"\",\n smoothHeight: false,\n slideshowSpeed: 10000,\n animationSpeed: 600,\n start: function (slider) {\n slider.find('.slide_description').children().css({ visibility: 'hidden' });\n slider.find('.flex-active-slide .slide_description').children().each(function (index) {\n var self = jQuery(this);\n var animationClass = !self.data('animation') ? 'fadeInRight' : self.data('animation');\n setTimeout(function () {\n self.addClass(\"animated \"+animationClass);\n }, index * 200);\n });\n },\n after: function (slider) {\n slider.find('.flex-active-slide .slide_description').children().each(function(index){\n var self = jQuery(this);\n var animationClass = !self.data('animation') ? 'fadeInRight' : self.data('animation');\n setTimeout(function(){\n self.addClass(\"animated \"+animationClass);\n }, index * 200);\n });\n },\n end: function (slider) {\n slider.find('.slide_description').children().each(function () {\n var self = jQuery(this);\n var animationClass = !self.data('animation') ? 'fadeInRight' : self.data('animation');\n self.removeClass('animated ' + animationClass).css({'visibility': 'hidden'});\n });\n },\n })\n //wrapping nav with container - uncomment if need\n .find('.flex-control-nav')\n .wrap('<div class=\"container nav-container\"/>')\n }); //intro_section flex slider\n\n jQuery(\".flexslider\").each(function(index){\n var $currentSlider = jQuery(this);\n //exit if intro slider already activated\n if ($currentSlider.find('.flex-active-slide').length) {\n return;\n }\n $currentSlider.flexslider({\n animation: \"fade\",\n useCSS: true,\n controlNav: true,\n directionNav: false,\n prevText: \"\",\n nextText: \"\",\n smoothHeight: false,\n slideshowSpeed:5000,\n animationSpeed:800,\n })\n });\n }\n\n ////////////////////\n //header processing/\n ////////////////////\n //stick header to top\n //wrap header with div for smooth sticking\n var $header = jQuery('.page_header').first();\n var boxed = $header.closest('.boxed').length;\n if ($header.length) {\n //hiding main menu 1st levele elements that do not fit width\n menuHideExtraElements();\n //wrap header for smooth stick and unstick\n var headerHeight = $header.outerHeight();\n $header.wrap('<div class=\"page_header_wrapper\"></div>');\n var $headerWrapper = $header.parent();\n $headerWrapper.addClass('header_white');\n if (!boxed) {\n $headerWrapper.css({height: headerHeight});\n }\n\n //get offset\n var headerOffset = 0;\n //check for sticked template headers\n if (!boxed && !($headerWrapper.css('position') === 'fixed')) {\n headerOffset = $header.offset().top;\n }\n\n //for boxed layout - show or hide main menu elements if width has been changed on affix\n jQuery($header).on('affixed-top.bs.affix affixed.bs.affix affixed-bottom.bs.affix', function () {\n if( $header.hasClass('affix-top') ) {\n $headerWrapper.removeClass('affix-wrapper affix-bottom-wrapper').addClass('affix-top-wrapper');\n } else if ( $header.hasClass('affix') ) {\n $headerWrapper.removeClass('affix-top-wrapper affix-bottom-wrapper').addClass('affix-wrapper');\n } else if ( $header.hasClass('affix-bottom') ) {\n $headerWrapper.removeClass('affix-wrapper affix-top-wrapper').addClass('affix-bottom-wrapper');\n } else {\n $headerWrapper.removeClass('affix-wrapper affix-top-wrapper affix-bottom-wrapper');\n }\n\n menuHideExtraElements();\n });\n\n //if header has different height on afixed and affixed-top positions - correcting wrapper height\n jQuery($header).on('affixed-top.bs.affix', function () {\n // $headerWrapper.css({height: $header.outerHeight()});\n });\n\n jQuery($header).affix({\n offset: {\n top: headerOffset,\n bottom: 0\n }\n });\n }\n\n //aside affix\n affixSidebarInit();\n\n $body.scrollspy('refresh');\n\n //appear plugin is used to elements animation, counter, pieChart, bootstrap progressbar\n if (jQuery().appear) {\n //animation to elements on scroll\n jQuery('.to_animate').appear();\n\n jQuery('.to_animate').filter(':appeared').each(function (index) {\n initAnimateElement(jQuery(this), index);\n });\n\n $body.on('appear', '.to_animate', function (e, $affected) {\n jQuery($affected).each(function (index){\n initAnimateElement(jQuery(this), index);\n });\n });\n }\n\n //page preloader\n jQuery(\".preloaderimg\").fadeOut(150);\n jQuery(\".preloader\").fadeOut(350).delay(200, function () {\n jQuery(this).remove();\n });\n }", "title": "" }, { "docid": "7bb0a2a422f4dc2eff2ffcab0a1e564a", "score": "0.6593867", "text": "function initialPages($) {\n\t\tdataTables();\n\t\tclickConfirmEdit();\n\t\tclickConfirmAdd();\n\t\tclickConfirmReorder();\n\t\tkeyupInputHndlr();\n\t\tinputAddModuleHdlr();\n\t\tinputEditModuleHdlr();\n\t\tclickAddModuleBtn();\n\t\tsortable();\n\t}", "title": "" }, { "docid": "bd022c70c0cb380c78b3e011bf4f3744", "score": "0.65526557", "text": "function load_nav() {\n page_tray[0] = new Array(2);\n page_tray[0]['name'] = \"PRODUCT\";\n page_tray[0]['file'] = \"product.html\";\n \n page_tray[1] = new Array(2);\n page_tray[1]['name'] = \"CART\";\n page_tray[1]['file'] = \"cart.html\";\n \n page_tray[2] = new Array(2);\n page_tray[2]['name'] = \"ABOUT US\";\n page_tray[2]['file'] = \"aboutus.html\";\n \n page_tray[3] = new Array(2);\n page_tray[3]['name'] = \"SIGN UP\";\n page_tray[3]['file'] = \"signup.html\";\n \n page_tray[4] = new Array(2);\n page_tray[4]['name'] = \"\";\n page_tray[4]['file'] = \"\";\n }", "title": "" }, { "docid": "b9e39fb01fa5e5cb6c4fdac460e4ff26", "score": "0.65475863", "text": "function loadNavBar() {\n addLoginOrLogoutLinkToNavigation();\n addBasicLinkNavigation('feed.html', 'Public Feed');\n addBasicLinkNavigation('charts.html', 'Charts');\n // addBasicLinkNavigation('map.html', 'Maps');\n addBasicLinkNavigation('user-map.html', 'Maps');\n addBasicLinkNavigation('stats.html', 'Stats Page');\n addBasicLinkNavigation('events.html', 'Events Page');\n addBasicLinkNavigation('user-settings.html', 'User Settings');\n}", "title": "" }, { "docid": "ef8c6e1700d65944a5980386410a01ec", "score": "0.6542323", "text": "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headAssemblyLi\").addClass(\"active\");\r\n\t\t$(\"#leftFaultDutyLi\").addClass(\"active\");\r\n\t\t$(\"#carTag\").hide();\r\n\t\t$(\"#resultTable\").hide();\r\n\t}", "title": "" }, { "docid": "8d01c46066163c3f8d2514c8af059f5a", "score": "0.6538541", "text": "function loadPage(id) {\n loadFilesFromPage(id);\n createNavigationButtons(id);\n makeTableHighlightable();\n}", "title": "" }, { "docid": "4701573b8454247df66d740f2aaf20ed", "score": "0.6533716", "text": "function ShowMainMenu(n)\r\n{\r\n\tvar curLink = $DE('link'+curitem);\r\n\tvar targetLink = $DE('link'+n);\r\n\t\r\n\tvar curCt = $DE('ct'+curitem);\r\n\tvar targetCt = $DE('ct'+n);\r\n\tif(curitem==n) return false;\r\n\tif(targetCt.innerHTML!='')\r\n\t{\r\n\t\tcurCt.style.display = 'none';\r\n\t\ttargetCt.style.display = 'block';\r\n\t\tcurLink.className = 'mm';\r\n\t\ttargetLink.className = 'mmac';\r\n\t\tcuritem = n;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvar myajax = new DedeAjax(targetCt);\r\n\t\tmyajax.SendGet2(\"index_menu_load.php?openitem=\"+n);\r\n\t\tif(targetCt.innerHTML!='')\r\n\t\t{\r\n\t\t\tcurCt.style.display = 'none';\r\n\t\t\ttargetCt.style.display = 'block';\r\n\t\t\tcurLink.className = 'mm';\r\n\t\t\ttargetLink.className = 'mmac';\r\n\t\t\tcuritem = n;\r\n\t\t}\r\n\t\tDedeXHTTP = null;\r\n\t}\r\n\t// bindClick();\r\n}", "title": "" }, { "docid": "7c11db57b808c5644c0e684ae3e58bc4", "score": "0.6528238", "text": "function initialDataLoading(menu_id) {\n sub_menu_bar_menu();\n switch (menu_id) {\n case \"top_menu_0\":\n /* hide satellite submenu */\n $(\"#satellite_submenu_bar_layout\").hide();\n /* show tv submenu */\n $(\"#tv_submenu_bar_layout\").show();\n setSubmenuInfo($($(\"#tv_submenu_bar_layout\").find(\"ul\")), TVSubMenuList);\n //$('#tv_submenu_bar').children(':eq(0)').addClass('selected');\n submenu_selected_id = null;\n break;\n case \"top_menu_1\":\n /* hide tv submenu */\n $(\"#tv_submenu_bar_layout\").hide();\n /* show satellite submenu */\n $(\"#satellite_submenu_bar_layout\").show();\n setSubmenuInfo($($(\"#satellite_submenu_bar_layout\").find(\"ul\")), SatelliteSubMenuList);\n //$('#stellite_submenu_bar').children(':eq(0)').addClass('selected');\n submenu_selected_id = null;\n break;\n \n }\n}", "title": "" }, { "docid": "e08e15795095a316d90dcf9ccde41859", "score": "0.65236557", "text": "function goToMainPage() {\r\n document.getElementById(\"languageFlags\").style.display=\"none\";\r\n document.getElementById(\"loadingPage\").style.display=\"none\";\r\n document.getElementById(\"mainPage\").style.display = \"block\";\r\n }", "title": "" }, { "docid": "1912815af92d8ed4181684a9a140849c", "score": "0.65232366", "text": "function main_dom_content_loaded(){\n wire_up_navigation()\n wire_up_main_subsection()\n wire_up_settings_subsection()\n configure_network();\n}", "title": "" }, { "docid": "e80e1cf504b32119b380bb81af50b7ac", "score": "0.65224993", "text": "function loadMenus(url,params){\n\t //\"https://www.nettvpro.live\"\n utils.addHttpCookies(HOMEURL,{PHPSESSID:\"grsud0cn3mg375sdhj3p891vj7\"});\n\tvar path = utils.getUrlHostAndPath(url);\n var p = path.lastIndexOf(\"/\");\n var deep = 0;\n //print(\"path = \"+path+\", p=\"+p+\",path.length=\"+path.length); \n if( p==path.length-2 ){\n var d = path.charCodeAt(path.length-1)-48;\n if( d>=1 && d<=9 ){\n deep = d;\n path = path.substring(0,p);\n }\n }\n // var DocSelector1 = \" > body > div.container-fluid > div > div.main-container > div.row\";\n var DocSelector1 = \" > body > div#wrapper div.main_content \";\n \n // print(\"path = \"+path+\", deep=\"+deep+\",\"); \n // throw new Error(\"无效参数 :\"+path);\n var totalPages = 1;\n var a = [];\n for(var pageIdx=1;pageIdx<=totalPages;pageIdx++){\n var doc ;\n try {\n var html = utils.httpGetAsString(HOMEURL+path+(pageIdx>1?\"/list_\"+pageIdx+\".html\":\"\"),0x408);\n // print( html ); \n doc = utils.newHTMLDocument(html);\n } catch( ex ){\n if( pageIdx>1 ) continue;\n throw ex;\n }\n var selector = DocSelector1+\n ( deep>0 ? \" div.nav-channal ul >li a\"\n \t :\" div.channals-list a\"\n \t );\n var ea = doc.getBody().querySelectorAll(selector) ; \n //print(\"ea.length = \"+ea.length+\", deep\"+deep+\", selector=\"+selector);\n \tfor(var i=0;i<ea.length;i++){\n \t var href = ea[i].getAttribute(\"href\");\n \t if( !href || href==\"\" ) \n \t continue;\n \t if( href.startsWith(\"/\") ) \n \t href = href.substring(1); \n \t if( href.endsWith(\"/\") ) \n \t href = href.substring(0,href.length-1); \n \t \telse if( href.endsWith(\".html\") ) \n \t href = href.substring(0,href.length-5); \n \t var url = deep>0 ? (\"@nettvpro-list:\"+href+(deep>1 ? \"/\"+(deep-1) : \"\"))\n \t : (\"@nettvpro-urls:\"+href); \n \t var title = ea[i].getAllNodeValue();\n \t if( title ) title = title.trim();\n \t // print(i+\" : \"+title+\",\"+url); \n \t a.push({url:url,title:title}); \n \t} // for ea\n \tif( deep==0 && pageIdx==1 ){\n \t var ea =doc.getBody().querySelectorAll(DocSelector1+\" ul.uk-pagination li a\");\n \t\tfor(var i=0;i<ea.length;i++){\n \t\t var href = ea[i].getAttribute(\"href\");\n \t \tif( !href || !href.startsWith(\"list_\") || !href.endsWith(\".html\")) \n \t \tcontinue;\n \t var n = parseInt(href.substring(5,href.length-5));\t\n \t if( n>totalPages ){\n \t totalPages = n;\n \t }\n \t\t} // for ea\n \t//\tprint(\"总页数 = \"+totalPages);\n \t} //deep==0 && pageIdx==1\n } // for( pageIdx\n return a;\n \n \n}", "title": "" }, { "docid": "cabd2067545d512e8a03b47748a32e8c", "score": "0.6515756", "text": "function initMenu(){\n}", "title": "" }, { "docid": "2e7a858faca02b8939251f9a098b4331", "score": "0.6515043", "text": "function fantastic() {\r\n//# Perform Modifications to page after load event has fired #//\r\n\t$('li#newstab div.more a:eq(0) ').attr('href', \"http://sports.yahoo.com/nfl/morenews/\");\r\n\tif (prefs.layout.loadWait.enabled == true) {\r\n\t\tstartMenu();\r\n\t\tmodPage();\r\n\t}\r\n}", "title": "" }, { "docid": "5263c06fbccc65892be43b0acbfdc652", "score": "0.6510894", "text": "function displayMainMenu() {\r\n\r\n}", "title": "" }, { "docid": "07ba17da69daa6f793ca0b74c9566d5c", "score": "0.65035", "text": "function menu() {\n // Sets up click functions for the menu options.\n $(\"#app-menu-home\").click(function(){\n loadHome();\n });\n $(\"#app-menu-course\").click(function(){\n loadClasses();\n });\n $(\"#app-menu-assn\").click(function(){\n loadAssigns();\n });\n $(\"#app-menu-grade\").click(function(){\n loadGrades();\n });\n $(\"#app-menu-setting\").click(function(){\n loadSets();\n });\n $(\"#app-logout\").click(function(){\n alert(\"You will be logging out!\");\n showAndroidLogout();\n });\n $(\"#app-site\").click(function(){\n alert(\"You will now go to the Crumb Lords website!\");\n androidWebsite();\n });\n // Gets the current time.\n footer();\n}", "title": "" }, { "docid": "191c4c6cfb148d16678125c2466ea219", "score": "0.6500893", "text": "function NotesGlimpseOnLoad() {\r\n var NotesGlimpseMain = $('#NotesGlimpseMain');\r\n //Highlight sub menu item on hover\r\n if (!IsMobileJS()) {\r\n NotesGlimpseMain.hover(function () {\r\n NotesGlimpseShowHide(true);\r\n }, function () {\r\n NotesGlimpseShowHide(false);\r\n });\r\n NotesGlimpseMain.focusin(function () {\r\n NotesGlimpseShowHide(true);\r\n }).focusout(function () {\r\n NotesGlimpseShowHide(false);\r\n });\r\n\r\n $('li.NotesGlimpseMenuItem').keydown(function (event) {\r\n var keyCode = event.keyCode || event.which;\r\n\r\n if (event.shiftKey && keyCode == 9) { // keyCode == 9 : 'Tab' key\r\n //navigateBackward\r\n NotesGlimpseShowHide(false);\r\n NotesGlimpseMain.closest('li.ui-tab-item').removeClass(\"ui-item-active\").removeClass(\"ui-link-next\");\r\n }\r\n });\r\n }\r\n else\r\n {\r\n NotesGlimpseMain.click(function () {\r\n if (typeof IsTytoClicked === 'undefined' || !IsTytoClicked)\r\n {\r\n document.location.href = \"/OnlineWeb/Services/NotificationServices/NotificationServices.aspx\";\r\n } \r\n });\r\n }\r\n}", "title": "" }, { "docid": "bbc4cf6a1ad4711f50b5023f47f89e01", "score": "0.6499565", "text": "function loadFn() {\n\t\tprocessElements();\n\t\tNav.load();\n\t}", "title": "" }, { "docid": "c08e43ce474a1bbe2672a983af78eb9d", "score": "0.6495087", "text": "function LMSAPI_gotoMenu() {\n\tif (this.isLoggedIn()) {\n\t\tthis.mode = this.MODE_ADMIN;\n\t\t\n\t\tlogger.write(logger.INTERNAL,\"lms.gotoMenu()\");\n\t\tthis.anticipatedItem = null;\n\t\twindow.lmsContentFrame.location.href=this.topURL+\"tinylms/lmsmenu.html\";\n\t\t//this.fireUpdateTOC();\n\t}\n}", "title": "" }, { "docid": "18e336c54ef338b0beef0cd3db61ca40", "score": "0.6493303", "text": "function _showMenuItems() {\n\t\t// Dash and OrgAdmin view for admins\n\t\tif (DATAPORTEN.isSuperAdmin() || DATAPORTEN.isOrgAdmin()) {\n\t\t\tPAGE_DASHBOARD.init();\n\t\t\t$('#menuDashboard').removeClass('hidden').fadeIn();\n\t\t\t$('#menuDashboard').trigger('click');\n\t\t\t//\n\t\t\tPAGE_ORG_ADMIN.init();\n\t\t\t$('#menuOrgAdmin').removeClass('hidden').fadeIn();\n\t\t}\n\t\t// View for SuperAdmins\n\t\tif (DATAPORTEN.isSuperAdmin()) {\n\t\t\tPAGE_SUPER_ADMIN.init();\n\t\t\t$('#menuSuperAdmin').removeClass('hidden').fadeIn();\n\t\t}\n\n\t}", "title": "" }, { "docid": "94656c69506668a9bcf1ab87b932c448", "score": "0.64911914", "text": "function initMenu() {\n\t$(\"#nav_about\").click(function(event){\n\t\tscrollToAnchor(\"about\");\n\t});\n\t$(\"#nav_portfolio\").click(function(event){\n\t\tscrollToAnchor(\"portfolio\");\n\t});\n\t$(\"#nav_contact\").click(function(event){\n\t\tscrollToAnchor(\"contact\");\n\t});\n}", "title": "" }, { "docid": "d05e209a0ffecc49d9d0ce772410ee70", "score": "0.6488668", "text": "function opcMenu()\r\n{\r\n // cargamos el contenido de la pagina de recursos humanos\r\n $(\"#col-md-12\").load(\"rrhh.php\");\r\n // mostramos las opciones del menu de recursos humanos\r\n $(\"#rrhh\").show();\r\n // cambianos el bacground y color de la letra del titulo del menu de recursos humanos\r\n $(\"#rrhh\").parent(\"li\").css(\"background\", \"none repeat scroll 0 0 rgb(126, 126, 126)\");\r\n $(\"#rrhh\").parent(\"li\").children(\"a\").css(\"color\", \"#E6E6E6\");\r\n // cambiamos el color del background del primer item del menu de recursos humanos y el color de la letra.\r\n $(\"#rrhh li\").first().css(\"background\", \"none repeat scroll 0 0 rgb(126, 126, 126)\");\r\n $(\"#rrhh li a\").first().css(\"color\", \"#E6E6E6\");\r\n // escuchamos el menu para que cuendo se haga clic en uno de los items este habra la pagina correspondiente.\r\n $(\".navi li a\").on(\"click\", mostrarPagina);\r\n $(\".navi li a\").on(\"touch\", mostrarPagina);\r\n}", "title": "" }, { "docid": "26bb9af0fb1bcf6d5b8aa0c520c67c68", "score": "0.64761597", "text": "function loadContent(){\n var page = $(this).attr('data-name');\n $(\"#main-content\").load(\"./pages/\" + page);\n if (reloadTest===0){\n $(\"#main-page\").toggleClass('hidden');\n $(\"#welcome-img\").toggleClass('hidden');\n reloadTest++;\n }\n }", "title": "" }, { "docid": "35fcb9c08fddc587f30ca3634f456fcd", "score": "0.64635307", "text": "function loadHome() {\n updateContent(contentType.HOME);\n}", "title": "" }, { "docid": "44d3b816126f2afb87298dbd1d90501a", "score": "0.6460567", "text": "function openMenu(elemID){\n\n switch(elemID){\n case \"profileMenu\":\n loadProfile();\n break;\n\n case \"scheduleMenu\":\n loadPage(\"scheduleMenu\");\n // retrieveMeetingsList();\n break;\n\n case \"friendsMenu\":\n loadPage(\"friendsMenu\");\n //retrieveFriendsList()\n break;\n\n case \"pendingsMenu\":\n loadPage(\"pendingsMenu\");\n break;\n\n case \"auxiliaryMap\":\n loadAUXmap();\n break;\n \n case \"AddMeetingMenu\":\n geoCoder(lastChoosedPlace);\n break;\n\n case \"billingPage\":\n document.getElementById(\"Reqlist\").style.display=\"none\";\n break;\n\n case \"InvoiceMenu\":\n break;\n\n default:\n return\n }\n\n document.getElementById(elemID).style.display=\"block\";\n setTimeout(function(elemID){document.getElementById(elemID).classList.add(\"openMenuPage\")},10,elemID);\n \n}", "title": "" }, { "docid": "e93869290f2e904a8bcd159dbd4b7ed1", "score": "0.6460216", "text": "function loadAboutPage(){\n loadTextFromFileIntoLocation(\"pageTitle\", \"pageTitle\");\n loadTextFromFileIntoLocation(\"pageHeader\", \"pageHeader\").then(function() {\n\t\tdocument.getElementById(\"welcomeTitle\").innerHTML = \"About\";\n });\t\n loadTextFromFileIntoLocation(\"modelPanel\", \"modelPanel\");\n loadTextFromFileIntoLocation(\"dAnalysisPanel\", \"dAnalysisPanel\");\n}", "title": "" }, { "docid": "7f73f8a5936b4452fb9291ee3504e1ea", "score": "0.6448497", "text": "function nav() {\n $('#about').click(function() {\n deactivateAll();\n $(this).attr(\"state\", \"active\");\n $('#content').load('about.html');\n });\n\n $('#current').click(function() {\n deactivateAll();\n $(this).attr(\"state\", \"active\");\n chrome.runtime.sendMessage({ payload: \"set\"}, function() { \n $('#content').load('tree.html');\n });\n });\n\n $('#show-history').click(function() {\n deactivateAll();\n $(this).attr(\"state\", \"active\");\n $('#content').load('history.html'); \n });\n\n $('#nav').show();\n}", "title": "" }, { "docid": "8123a561724d7d740548b3d1e52e43fa", "score": "0.64425164", "text": "function Start() {\n PageSwitcher();\n\n Main();\n }", "title": "" }, { "docid": "02def45c6a751eea8ff2111e5b6fbbdc", "score": "0.6441416", "text": "function verMenu(){\n\t$(\"#cuerpo\").load(\"../application/inc/menu.php\");\n}", "title": "" }, { "docid": "1f892fd9931402f85c21318eb20a6808", "score": "0.6437799", "text": "function initMenu() {\n\n // if no class is found the default class will be loaded and returned at the end.\n var firstMenuItem = \"default\";\n\n // determine if it was the first item to only save this for returning it later on.\n var firstTemplate = true;\n\n // loop through all menu elements (a-tags)\n $('a').each(function (index) {\n\n//alert(\"index: \" + index + \"\\nclass: \" + $(this).attr(\"class\"));\n\n // determine after the loop if a template class was found\n var foundTemplate = false;\n\n // determine if there were classes to load the default template at the end if not\n var loadDefault = true;\n\n // get all classes from this element\n var thisClassAttr = $(this).attr(\"class\");\n\n // get an array containing each class in one element (only if there is at least one class, otherwise split() will not work and break the script)\n if (typeof( thisClassAttr ) != \"undefined\") {\n\n thisClasses = thisClassAttr.split(\" \");\n\n // set the limit for the loop below\n classCount = thisClasses.length;\n\n loadDefault = false;\n\n } else {\n\n // do not loop below (this element has no classes)\n classCount = 0;\n\n }\n\n // loop through the classes\n for (var x = 0; x < classCount; x++) {\n\n // check if one of the classes contain a template class\n if (thisClasses[x].indexOf(\"template\") >= 0) {\n\n // template class found, get the filename (format: \"welcome-filename\")\n var templateToLoad = thisClasses[x].split(\"-\")[1];\n\n//alert(\"element \" + index + \" has a template class: \" + thisClasses[x] + \"\\nusing template: \" + templateToLoad + \".phtml?i_id=\" + i_id );\n\n // bind an onclick function to this menu element\n $(this).click(function () {\n\n // show the loading screen\n show_loading();\n\n // if clicked, load the template into the #main div (append \".phtml\" to the template filename)\n $(\"#main\").slideUp(0, function () {\n\n $(\"#main\").load(\"templates/\" + templateToLoad + \".phtml?i_id=\" + i_id, function () {\n\n $(\"#main\").slideDown();\n\n// \t\t\t\t\t\thide_loading();\n\n });\n\n });\n\n });\n\n // found a template class, remember that!\n foundTemplate = true;\n\n // if it is the first menu-template item, save it to return it later\n if (firstTemplate == true) {\n\n firstMenuItem = templateToLoad;\n\n // remember that this was the first one\n firstTemplate = false;\n\n }\n\n }\n\n } // end loop through the classes of this element\n\n // if no template class was found, use the default one\n if (foundTemplate == false && loadDefault == true) {\n\n//alert(\"element \" + index + \" has no template class, using default\" );\n\n $(this).click(function () {\n\n $(\"#main\").slideUp(0, function () {\n\n $(\"#main\").load(\"templates/default.phtml?i_id=\" + i_id, function () {\n\n $(\"#main\").slideDown();\n\n });\n\n });\n\n });\n\n }\n\n }); // end loop through all menu elements\n\n return firstMenuItem;\n\n}", "title": "" }, { "docid": "7dd1c0498a1192a9614c280c3672b325", "score": "0.64205533", "text": "function loadPage (pageurl,level) {\n\t$('#ajax-content').html('<div class=\"loader\"><img src=\"images/loading.gif\" /></div>').load('ajax-pages/'+pageurl);\n\t\n\t/*\n\tif (current_level != 'level3') {\n\t\t$('#ajax-content').addClass('width85');\n\t\t$('#kinection').addClass('width10');\n\t\t$('.kin-container').hide();\n\t\t$('.kin-container10').show();\n\t}\n\t*/\n\t\n\tcurrent_link = pageurl;\n\tif (level != current_level) {\n\t\t$('.breadcrumbs span').removeClass('current');\n\t\tswitch(true) {\n\t\t\tcase (level == 'level1'):\n\t\t\t\t$('.breadcrumbs .level1').addClass('current');\n\t\t\t\tbreak;\n\t\t\tcase (level == 'level2'):\n\t\t\t\t$('.breadcrumbs .level2').addClass('current');\n\t\t\t\tbreak;\n\t\t\tcase (level == 'level3'):\n\t\t\t\t$('.breadcrumbs .level3').addClass('current');\n\t\t\t\tbreak;\n\t\t}\n\t\tcurrent_level = level;\n\t}\n}", "title": "" }, { "docid": "f6a38a05a98b52e8de27c127b4bd8995", "score": "0.6418021", "text": "function loadpage(e){\n e.preventDefault(); // prevents going to new page when clicking on link\n $(\"#menu a.active\").removeClass(\"active\"); // When on the about page, remove active class (remove highlight)\n $(this).addClass(\"active\"); // Whatever page you are on, make the button active (add highlight)\n\n let href = $(this).attr(\"href\"); //Let whatever page you are on be stored in href variable\n $(\".content\").load(href); //Load the content of the page be replaced with the contents of the href variable\n}", "title": "" }, { "docid": "fc18e5c93594c171a524d4cbc17ab6c5", "score": "0.64068735", "text": "function startupPage() {\n\t// Build a structured list of what items are composed of other items\n\tbuildRecipeItemsList();\n\n\t// Layout the page properly\n\tsetupPage();\n\n\t// Setup tooltip hover\n\t$('.item').on( \"mouseenter\", function() {\n\t\tif ( $(this).hasClass('noTooltip') )\n\t\t\treturn;\n\n\t\tif ( g_bSuppressingItemTooltips )\n\t\t\treturn;\n\n\t\tif ( g_tooltipTimeout != 0 )\n\t\t\treturn;\n\n\t\tg_tooltipTimeout = setTimeout( function( element ) {\n\t\t\tshowItemTooltip( $(element) );\n\t\t}, 250, $(this) );\n\t});\n\n\t// Setup tooltip out\n\t$('.item').on( \"mouseleave\", function() {\n\t\tif ( $(this).hasClass('noTooltip') )\n\t\t\treturn;\n\n\t\thideItemTooltip();\n\t});\n\n\t$('#bodyContent').fadeIn( \"fast\" );\n\t$('#spinner').hide();\n}", "title": "" }, { "docid": "6637014f80a9b368858cc7f27ca41307", "score": "0.6402679", "text": "function loadMenuItems() {\n\n\t\t/** @type {CustomType<servoyextra-sidenav.MenuItem>} */\n\t\tvar menuItem;\n\t\tvar menuItems = [];\n\t\n\n\t\t// HOME\n\t\tmenuItem = new Object();\n\t\tmenuItem.id = \"homeDashboard\";\n\t\tmenuItem.text = \"DASHBOARD\"\n\t\tmenuItem.iconStyleClass = \"fa fa-th-large\";\n\t\tmenuItems.push(menuItem);\n\n\t\t// CUSTOMERS\n\t\tmenuItem = new Object();\n\t\tmenuItem.id = \"customersTableView\";\n\t\tmenuItem.text = \"CUSTOMERS\"\n\t\tmenuItem.iconStyleClass = \"icon-contacts\";\n\t\tmenuItems.push(menuItem);\n\n\t\t// ORDERS\n\t\t\n\t\treturn menuItems;\n\t}", "title": "" }, { "docid": "3c74208e918f99de60691f30aaea7573", "score": "0.64015853", "text": "function load_navigation_data(){\n\t$(\"#dashboard-menu\").html('');\n\tvar jsonRow = backendDirectory+'/load_navigator';\n\tvar keyword= $(\"#menuSearchBox\").val();\n\tif(keyword!='' && keyword!='undefined'){\n\t\tjsonRow +='?s='+keyword;\n\t}\n\t\n\tif(menuxhr) menuxhr.abort();\n\tmenuxhr=$.getJSON(jsonRow,function(result){\n\t\tif(result.aaData){\n\t\t\tvar urlStr = window.location.pathname;\n\t\t\tvar findStr=backendDirectory;\n\t\t\tif(urlStr.indexOf(findStr)!==-1){\n\t\t\t\tvar openedFileNameStr = urlStr.substring(findStr.length);\n\t\t\t}else{\n\t\t\t\tvar openedFileNameStr = urlStr;\n\t\t\t}\n\t\t\tvar table_html='<li class=\"treeview';\n\t\t\t\n\t\t\tif(openedFileNameStr==\"index\" || openedFileNameStr==\"\" || openedFileNameStr==\"/\"){\n\t\t\t\ttable_html+=' active ';\n\t\t\t}\t\n\t\t\ttable_html+='\"><a href=\"'+backendDirectory+'/\"><i class=\"fa fa-dashboard\"></i> <span>Dashboard</span><span class=\"pull-right-container\"><i class=\"fa fa-angle-left pull-right\"></i></span></a></li>';\n\t\t\t\n\t\t\t$.each(result.aaData, function(i,item){\n\t\t\t\tif(item.active==1){\n\t\t\t\t\tvar activeMenuFlag=false;\n\t\t\t\t\tif(item.module_items){\n\t\t\t\t\t\tif(item.module_items!=\"\"){\n\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\tvar module_items = JSON.parse(item.module_items); \n \t\t\t\t\t}\tcatch (error){\n \t\t\t\t\t\t\tvar module_items = item.module_items; \n \t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tmodule_items.sort(dynamicSort(\"item_sort_order\"));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar iconNameStr='';\n\t\t\t\t\t\t\tif(item.icon_class!=\"\"){\n\t\t\t\t\t\t\t\ticonNameStr='<i class=\"'+item.icon_class+'\"></i>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(item.icon_path!=\"\"){\n\t\t\t\t\t\t\t\ticonNameStr='<img width=\"24\" height=\"24\" src=\"'+item.icon_path+'\" alt=\"\">';\n\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\tvar subTableHtmlStr=\"\";\t\n\t\t\t\t\t\t\t$.each(module_items, function(i,row){\n\t\t\t\t\t\t\t\tvar linkStr=row.link;\n\t\t\t\t\t\t\t\tif(openedFileNameStr==row.link){\n\t\t\t\t\t\t\t\t\tactiveMenuFlag=true;\n\t\t\t\t\t\t\t\t\tsubTableHtmlStr+='<li class=\"active\">';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tsubTableHtmlStr+='<li>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsubTableHtmlStr+='<a href=\"'+backendDirectory+row.link+'\" ';\n\t\t\t\t\t\t\t\tif(row.target==0){\n\t\t\t\t\t\t\t\t\tsubTableHtmlStr+=' target=\"_blank\" ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsubTableHtmlStr+='><i class=\"fa fa-circle-o\"></i> '+row.label+'</a></li>';\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(activeMenuFlag){\n\t\t\t\t\t\t\t\ttable_html+='<li class=\"active treeview\">';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\ttable_html+='<li class=\"treeview\">';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttable_html+='<a href=\"#\">'+iconNameStr+' <span>'+item.name+'</span><span class=\"pull-right-container\"><i class=\"fa fa-angle-left pull-right\"></i></span></a>';\n\t\t\t\t\t\t\ttable_html+='<ul class=\"treeview-menu\">'+subTableHtmlStr+'</ul>';\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$(\"#dashboard-menu\").append(table_html);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "4095f087c9d9c4aa56ea35626b18ca6b", "score": "0.64010304", "text": "function C999_Common_GameLoad_MainMenu() {\n\tSetScene(\"C000_Intro\", \"ChapterSelect\");\n}", "title": "" }, { "docid": "86a0ffb5cb5c9723a88f0a460c4dd3af", "score": "0.6400131", "text": "function ux_load_new_page()\n\t{\n\t\t$('.node-child').click(function(){\n\t\t\t// Show loading gif\n\t\t\t$('#kanvas-gif').show();\n\n\t\t\t// Self\n\t\t\tvar self = $(this),\n\n\t\t\t// Get Id which is a link\n\t\t\t\turl = self.attr('id'),\n\n\t\t\t// Get the last part of the URL\n\t\t\t\tdata = url.split('/'),\n\t\t\t\tlength = data.length,\n\t\t\t\tfn = data[length-1],\n\n\t\t\t// Formulate title\n\t\t\t\ttitle = fn+' - '+client;\n\n\t\t\t// Deactivate all tabs first\n\t\t\t$('.node-child').parent().removeClass('active-tab');\n\n\t\t\t// Active current tab\n\t\t\tself.parent().addClass('active-tab');\n\n\t\t\tresponse = {'pageTitle' : title, 'fn' : fn, 'html' : ''};\n\n\t\t\tprocessAjaxData(response, url);\n\t\t});\n\n\t\tfunction processAjaxData(response, urlPath){\n\n\t\t\t// Load Page\n\t\t\t$('#content').load('content.php?p='+response.fn);\n\n\t\t\tdocument.title = response.pageTitle;\n\t\t\twindow.history.pushState({\"html\":response.html,\"pageTitle\":response.pageTitle},\"\", urlPath);\n\n\t\t\t// Show loading gif\n\t\t\t//$('loading-div').hide();\n\t\t}\n\t}", "title": "" }, { "docid": "9e99849a42a6febfa2a8a5db04004629", "score": "0.6389934", "text": "function showMainmenu() {\n\t\t\t\t\t$(\"div#mainmenu\").removeClass( \"wb-inv\" );\n\t\t\t\t\t$(\"li#nav-highlight\").removeClass( \"wb-inv\" );\n\t\t\t\t\t$(\"li#nav-normal\").addClass( \"wb-inv\" );\n\t\t\t\t\t$(\"button#showMainmenu\").unbind(\"click\");\n\t\t\t\t\t$(\"button#showMainmenu\").click(hideMainmenu);\n\t\t\t\t\t$(\"button#toggleSearch\").unbind(\"click\");\n\t\t\t\t\t$(\"button#toggleSearch\").click(hideMainmenu);\n\t\t\t\t}", "title": "" }, { "docid": "38fccb2e6143a4718a36cede473971db", "score": "0.6386258", "text": "function initPage()\r\n{\r\n try {\r\n var savedLinks = JSON.parse( localStorage.getItem( 'savedLinks' ) );\r\n\r\n if ( savedLinks )\r\n {\r\n for ( var i = 0; i < savedLinks.length; i++ )\r\n {\r\n pageSections[i] = new Section( savedLinks[i]['label'], savedLinks[i]['links'], savedLinks[i]['state'] );\r\n pageSections[i].init( i );\r\n }\r\n }\r\n }\r\n catch( error ) {\r\n alert( 'Page data could not be loaded successfully - this is probably due to an error in import text. If this was an import issue, the previous page state will now be reloaded.' );\r\n\r\n // Reset pageSections and DOM in case the first \"try\" added some content before failing\r\n pageSections = [];\r\n document.getElementById( 'sections' ).innerHTML = '';\r\n\r\n try {\r\n var backedUpLinks = JSON.parse( localStorage.getItem( 'backedUpLinks' ) );\r\n \r\n for ( var i = 0; i < backedUpLinks.length; i++ )\r\n {\r\n pageSections[i] = new Section( backedUpLinks[i]['label'], backedUpLinks[i]['links'], backedUpLinks[i]['state'] );\r\n pageSections[i].init( i );\r\n }\r\n }\r\n catch( error2 ) {\r\n alert('Load of backed up data failed; data was corrupt or did not exist.');\r\n pageSections = [];\r\n document.getElementById( 'sections' ).innerHTML = '';\r\n }\r\n }\r\n\r\n if ( pageSections.length == 0 )\r\n {\r\n showAddDialogue();\r\n }\r\n\r\n $.contextMenu({\r\n selector: 'section',\r\n items: {\r\n \"up\": { name: \"Move Up\", callback: function( key, options ) { moveLink( options.$trigger[0], 'up' ); } },\r\n \"down\": { name: \"Move Down\", callback: function( key, options ) { moveLink( options.$trigger[0], 'down' ); } },\r\n \"sep1\": \"---------\",\r\n \"delete\": { name: \"Delete\", callback: function( key, options ) { deleteLink( options.$trigger[0].id ); } }\r\n }\r\n });\r\n\r\n $.contextMenu({\r\n selector: '.main > h1',\r\n items: {\r\n \"sup\": { name: \"Move Section Up\", callback: function( key, options ) { moveSection( options.$trigger[0].parentNode, 'up' ); } },\r\n \"sdown\": { name: \"Move Section Down\", callback: function( key, options ) { moveSection( options.$trigger[0].parentNode, 'down' ); } },\r\n \"ssep\": \"---------\",\r\n \"sdelete\": { name: \"Delete Section\", callback: function( key, options ) { deleteSection( options.$trigger[0].parentNode.id ); } }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "cee004256eeba001562fe02df8a42237", "score": "0.6379295", "text": "function openMainMenu(data, hasDebt) {\n resourceCall('debugMessage', \"OPEN MAIN MENU: \" + data + \" \" + hasDebt);\n\tif(data != 'no') {\n\t\tvar accountData = JSON.parse(data);\n\n\t\t$('#infoAccountNumber').text(accountData[0]);\n\t\t$('#infoAccountType').text(accountData[1]);\n\t\t$('#infoAccountOwner').text(accountData[2]);\n\t\t$('#infoMoney').text(accountData[3]);\n\t\t$('#infoDebt').text(accountData[4]);\n\t\t$('#infoLastMovement').text(accountData[5]);\n\t\t\n\t}\n\n\tif(hasDebt) {\n\t\t$('#withdrawButton').attr('disabled', 'disabled');\n\t\t$('#transferButton').attr('disabled', 'disabled');\n\t}else{\n\t\t$('#withdrawButton').removeAttr('disabled');\n\t\t$('#transferButton').removeAttr('disabled');\n\t}\n\n\tpage = 2;\n\t$('#main').fadeIn().removeClass('invisible');\n}", "title": "" }, { "docid": "5973891ddd373a155fc5281be3c055c4", "score": "0.63764167", "text": "function onLoad() {\n\t\n\t//---------------------------------------------------------------\n\t// title prefix\n\t//---------------------------------------------------------------\n\tvar titlePrefix = \"muellerware.org: \"\n\n\t//---------------------------------------------------------------\n\t// code to inject into the head\n\t//---------------------------------------------------------------\n\tvar headHtml = '' +\n\t\t'<link rel=\"shortcut icon\" href=\"' + BaseURL + '/images/logo-32x32.gif\">' +\n\t\t'<link rel=\"icon\" href=\"' + BaseURL + '/images/logo-32x32.gif\">' +\n\t\t'<link rel=\"stylesheet\" href=\"' + BaseURL + '/css/site.css\">' +\n\t\t'<link rel=\"alternate\" type=\"application/atom+xml\" title=\"pmuellr blog\" href=\"http://pmuellr.blogspot.com/atom.xml\" />' +\n\t\t''\n\t\n\t//---------------------------------------------------------------\n\t// menu\n\t//---------------------------------------------------------------\n\tvar menu = [\n\t\t[0, \"index.html\", \"home\"],\n\t\t[1, \"papers/index.html\", \"hieroglyphics\"],\n\t\t[1, \"projects/index.html\", \"projects\"],\n\t\t[2, \"projects/s3u/index.html\", \"s3u\"],\n/*\t\t\n\t\t[1, \"movies/index.html\", \"movies\"],\n\t\t[1, \"projects/index.html\", \"mini-projects\"],\n\t\t[2, \"projects/eclipsemonkey-scriptloader/index.html\", \"eclipsemonkey-scriptloader\"],\n\t\t[2, \"projects/backpack-note-from-amazon.html\", \"backpack-note-from-amazon\"],\n\t\t[2, \"projects/bugzilla-pasteable-title.html\", \"bugzilla-pasteable-title\"],\n\t\t[2, \"projects/cnn-transcript-next-prev.html\", \"cnn-transcript-next-prev\"],\n\t\t[2, \"projects/embed-bugzilla-lists.html\", \"embed-bugzilla-lists\"],\n\t\t[2, \"projects/nytimes-verdana.html\", \"nytimes-verdana\"],\n\t\t[2, \"projects/resize-textarea.html\", \"resize-textarea\"],\n\t\t[2, \"projects/slashdot-mirror.html\", \"slashdot-mirror\"],\n\t\t[2, \"projects/fix-ibm-numbered-links.html\", \"fix-ibm-numbered-links\"],\n*/\n\t]\n\n\tmenuHtml = \"<table>\"\n\tfor (var i=0; i<menu.length; i++) {\n\t\tvar menuLevel = menu[i][0]\n\t\tvar menuLink = menu[i][1]\n\t\tvar menuText = menu[i][2]\n\t\t\n\t\tvar itemHtml = '<tr><td class=\"site-menu-item-' + menuLevel + '\"><a href=\"' + BaseURL + '/' + menuLink + '\">' + menuText + '</a></td></tr>'\n\t\t\n\t\tmenuHtml += itemHtml\n\t}\n\t\n\tmenuHtml += \"</table>\"\n\t\n\t//---------------------------------------------------------------\n\t// code to inject into the body\n\t//---------------------------------------------------------------\n\tvar shellHtml = '' + \n\t\t'<div class=\"site-header\"><span class=\"page-title\">[[title]]</span></div>' +\n\t\t'<table cellpadding=\"5\" cellspacing=\"0\" width=\"100%\">' +\n\t\t\t'<tr>' +\n\t\t\t\t'<td class=\"site-menu-cell noprint\" align=\"left\" valign=\"top\">' +\n\t\t\t\t\tmenuHtml +\n\t\t\t\t'</td>' +\n\t\t\t\t'<td class=\"site-body-cell\" align=\"left\" valign=\"top\" width=\"100%\">' +\n\t\t\t\t\t'<div id=\"body-target\"/>' +\n\t\t\t\t'</td>' +\n\t\t\t'</tr>' +\n\t\t'</table>' +\n\t\t'<table class=\"site-footer\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">' +\n\t\t\t'<tr>' +\n\t\t\t\t'<td style=\"font-size:x-small;\">Last updated ' + \n\t\t\t\t'on [[last-modified-date]]' +\n\t\t\t\t'</td>' +\n\t\t\t'</tr>' +\n\t\t'</table>' +\n\t\t''\n\n\t//---------------------------------------------------------------\n\t// get and replace the document title \n\t//---------------------------------------------------------------\n\tvar title = document.title\n\tif (null == title) title = \"page with no title!\"\n\t\n\tdocument.title = titlePrefix + title\n\t\n\tshellHtml = shellHtml.replace(\"\\[\\[title\\]\\]\", titlePrefix + title)\n\t\t\n\t//---------------------------------------------------------------\n\t// get and replace the modification date \n\t//---------------------------------------------------------------\n\tvar Months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"Decemeber\"]\n\tvar Days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]\n\tvar date = Date.parse(document.lastModified)\n\tvar lastModified = document.lastModified\n\tif (0 != date) {\n\t\tdate = new Date(date)\n\t\tlastModified = Days[date.getDay()] + \", \" + Months[date.getMonth()] + \" \" + date.getDate() + \", \" + (1900 + date.getYear())\n\t\tlastModified += \" at \" + right2pad0(date.getHours()) + \":\" + right2pad0(date.getMinutes()) + \":\" + right2pad0(date.getSeconds())\n\t}\n\n\tshellHtml = shellHtml.replace(\"\\[\\[last-modified-date\\]\\]\", lastModified)\n\t\n\t//---------------------------------------------------------------\n\t// get the head element \n\t//---------------------------------------------------------------\n\tvar head = document.getElementById(\"head\")\n\tif (null == head) {\n\t\talert(\"Couldn't find element with id 'head'\")\n\t\treturn\n\t}\n\n\t//---------------------------------------------------------------\n\t// instead new head bits\n\t//---------------------------------------------------------------\n\thead.innerHTML = head.innerHTML + headHtml\n\n\t//---------------------------------------------------------------\n\t// find the body div\n\t//---------------------------------------------------------------\n\tvar bodyDiv = document.getElementById(\"body\")\n\tif (null == bodyDiv) {\n\t\talert(\"Couldn't find element with id 'body'\")\n\t\treturn\n\t}\n\t\n\t//---------------------------------------------------------------\n\t// get the body contents (in the div)\n\t//---------------------------------------------------------------\n\tvar bodyHtml = bodyDiv.innerHTML\n\t\n\t//---------------------------------------------------------------\n\t// replace the body contents with our new shell\n\t//---------------------------------------------------------------\n\tbodyDiv.innerHTML = shellHtml\n\t\n\t//---------------------------------------------------------------\n\t// find the body target in the new body contents \n\t//---------------------------------------------------------------\n\tvar bodyTargetDiv = document.getElementById(\"body-target\")\n\tif (null == bodyTargetDiv) {\n\t\talert(\"Couldn't find element with id 'body-target'\")\n\t\tbodyDiv.innerHTML = bodyHtml\n\t\treturn\n\t}\n\t\n\t//---------------------------------------------------------------\n\t// put the old body in the new shell\n\t//---------------------------------------------------------------\n\tbodyTargetDiv.innerHTML = bodyHtml\n}", "title": "" }, { "docid": "32a8865b527f979d80d8b4b23dc03227", "score": "0.6368297", "text": "function Menu(){\n\n if(menupresentation==1){\n MenuPresentation();\n } else if(menuselect==1){\n MenuSelect();\n } else if(menuplay==1){\n MenuPlay();\n } else if(menuregle==1){\n MenuRegle();\n } else if(menucontrole==1){\n MenuControle();\n } else if(menucredits==1){\n MenuCredits();\n } else if(menuperdu==1){\n MenuPerdu();\n }\n}", "title": "" }, { "docid": "917d78e4de6952b4a8d651537333f4f1", "score": "0.63619375", "text": "function load() {\r\n m_data.load(\"Menu.json\", load_cb);\r\n}", "title": "" }, { "docid": "955d96e919386a85d86ff606c0636825", "score": "0.6356096", "text": "function showMainMenu () {\n\t\tif (!engine.ShowMenu) {\n\t\t\tstopAmbient();\n\t\t\tplaying = true;\n\t\t\t$_(\"section\").hide();\n\t\t\t$_(\"#game\").show();\n\t\t\tanalyseStatement(label[engine.Step]);\n\t\t} else {\n\t\t\t$_(\"[data-menu='main']\").show();\n\t\t}\n\t}", "title": "" }, { "docid": "cc00ceeac4db60c9cdd8c143ae1df69d", "score": "0.6354741", "text": "function pageLoaded(){\n //Take all informations to create the menu.\n let menuNav = getMenuNav()\n //Create the menu with the information.\n generate_menu(menuNav)\n \n document.addEventListener('scroll', function() {\n watchScrolls();\n });\n}", "title": "" }, { "docid": "24f1c50a36b4c269b9942325fef8ee20", "score": "0.63531244", "text": "function mainInit(){\n\tmod_sceneGraph.initSceneGraph();\n\n\t//jQuery.mobile.changePage( \"#objBrowser\", { transition: \"slideup\"} );\n\t//jQuery.mobile.changePage( \"#objBrowser\" );\n\n\t// set the top padding of the content container to the height of the header\n\tjQuery(\"#contentContainer\").css(\"padding-top\", jQuery(\".ui-header\").height() + \"px\");\n\n\t// module registration\n\tmod_objectBrowser = modules(\"objectBrowser\");\n\tmod_TabManager = modules(\"tabManager\");\n\tmod_menu = modules(\"menu\");\n\tmod_metaData = modules(\"metaData\");\n\tmod_annotations = modules(\"annotations\");\n\n\t// module initialisation\n\tregisterEventListenerMenu(mod_menu);\n\tmod_TabManager.init();\n\n\tjQuery.get(\"data/menu.txt\", mod_menu.init, \"json\");\n\n\t//jQuery.get(\"data/objects.txt\", mod_objectBrowser.init, \"json\");\n\tjQuery.get(\"data/\" + MYAPP.model + \"/metaData.txt\", mod_metaData.init, \"json\");\n\tjQuery.get(\"data/\" + MYAPP.model + \"/annotation.txt\", mod_annotations.init, \"json\");\n\n}", "title": "" }, { "docid": "2e8cbe78d883e2dabfae587837e78e6d", "score": "0.63444275", "text": "function initMenu()\n{\n\tcore_ativaBotaoAdicionaLinha(\"../php/menutemas.php?funcao=alteraTags\",\"adiciona\");\n\tcore_carregando(\"ativa\");\n\tcore_ativaPainelAjuda(\"ajuda\",\"botaoAjuda\");\n\tpegaTags();\n}", "title": "" }, { "docid": "73c2901886d5ed9ff09e5da52db82804", "score": "0.6332133", "text": "bootstrapListener({ menus }) {\n this.setState({\n menu: menus[this.routeToMenu[this.props.route.path]]\n },\n // If display page id not set - show first page from menu\n () => !this.props.params.id && this.loadPage(this.state.menu.children[0].link.split('/').pop())\n );\n }", "title": "" }, { "docid": "f2729f3bf1117a8b82f2f7eed92057e9", "score": "0.6330503", "text": "function initialize() {\n loadMenuPlates();\n loadSpecialPlates();\n loadReasons();\n loadNavbar();\n loadChefs();\n loadAbout();\n loadMenuFilters();\n loadPhotos();\n checkPreData();\n}", "title": "" }, { "docid": "b8f753000e774fcc4470a31ebb518172", "score": "0.63258326", "text": "function leftMenu2(url, mode) {\n\n\tvar rootMenuItem = new MenuItem(\"\", \"\"); // Only as a holder, not actual menu.\n\tvar childMenuItem;\n\tvar lang = [\"/english/\", \"/tc_chi/\", \"/sc_chi/\"];\n\tvar urlPrefix = (url != null) ? url + lang[getLang()] : lev_div;\n\tmode = (mode == null) ? 0 : 1;\n\n\t// ## Declare the Left Menu with strcutre\n\trootMenuItem.addChild(new MenuItem([\"Home\", \"主頁\", \"主页\"], urlPrefix));\n\trootMenuItem.addChild(new MenuItem([\"News and Events\", \"消息與活動\", \"消息与活动\"],\n\t\turlPrefix + \"news\"));\n\n\tchildMenuItem = new MenuItem([\"About Us\", \"關於我們\", \"关于我们\"], urlPrefix +\n\t\t\"about_us/about_us.html\");\n\trootMenuItem.addChild(childMenuItem);\n\tchildMenuItem.addChild(new MenuItem([\"Welcome Message\", \"歡迎詞\", \"欢迎词\"],\n\t\turlPrefix + \"about_us/welcome/welcome.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Vision, Mission and Values\",\n\t\t\"理想、使命和信念\", \"理想,使命和信念\"\n\t], urlPrefix + \"about_us/vision/vision.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Performance Pledge\", \"服務承諾\", \"服务承诺\"],\n\t\turlPrefix + \"about_us/pref_ple/pref_ple.html\"));\n\n\tchildMenuItem = new MenuItem([\"Main Service Areas\", \"主要服務範疇\", \"主要服务范畴\"],\n\t\turlPrefix + \"main_ser/main_ser.html\");\n\trootMenuItem.addChild(childMenuItem);\n\tchildMenuItem.addChild(new MenuItem([\"Child Health\", \"兒童健康\", \"儿童健康\"],\n\t\turlPrefix + \"main_ser/child_health/child_health.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Woman Health\", \"婦女健康\", \"妇女健康\"],\n\t\turlPrefix + \"main_ser/woman_health/woman_health.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Maternal Health \", \"產前及產後服務\",\n\t\t\"产前及产后服务\"\n\t], urlPrefix + \"main_ser/process.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Workshops/Support Groups Timetable\",\n\t\t\"研習班/互助小組<span>時間表</span> \", \"研习班/互助小组<span>时间表</span>\"\n\t], urlPrefix + \"main_ser/workshop_timetable.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Hotlines\", \"熱線\", \"热线\"], urlPrefix +\n\t\t\"hotlines/index.html\"));\n\n\tchildMenuItem = new MenuItem([\"Centre Details\", \"健康院/中心資料\", \"健康院/中心资料\"],\n\t\turlPrefix + \"centre_det/centre_det.html\");\n\trootMenuItem.addChild(childMenuItem);\n\tchildMenuItem.addChild(new MenuItem([\"Maternal and Child Health Centres\",\n\t\t\"母嬰健康院\", \"母婴健康院\"\n\t], urlPrefix + \"centre_det/maternal/maternal.html\"));\n\tchildMenuItem.addChild(new MenuItem([\n\t\t\"Centres Providing Woman Health Service\", \"提供婦女健康服務的<span>健康院/中心</span>\",\n\t\t\"提供妇女健康服务的<span>健康院/中心</span>\"\n\t], urlPrefix + \"centre_det/cent_pwhs/cent_pwhs.html\"));\n\tchildMenuItem.addChild(new MenuItem([\n\t\t\"Centres Providing Cervical Screening Service\", \"提供子宮頸普查服務的<span>母嬰健康院</span>\",\n\t\t\"提供子宫颈普查服务的<span>母婴健康院</span>\"\n\t], urlPrefix + \"centre_det/cent_pcss/cent_pcss.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Centres with Barrier free Facilites\",\n\t\t\"設有無障礙設施的<span>健康院/中心\", \"设有无障碍设施的<span>健康院/中心</span>\"\n\t], urlPrefix + \"centre_det/disable_fac/disable_fac.html\"));\n\n\trootMenuItem.addChild(new MenuItem([\"Registration for Service\", \"登記服務\",\n\t\t\"登记服务\"\n\t], urlPrefix + \"doc_br/index.html\"));\n\n\tchildMenuItem = new MenuItem([\"Fee and Charges\", \"收費\", \"收费\"], urlPrefix +\n\t\t\"fee_cha/fee_cha.html\");\n\trootMenuItem.addChild(childMenuItem);\n\tchildMenuItem.addChild(new MenuItem([\"For General Public\", \"一般市民\", \"一般市民\"],\n\t\turlPrefix + \"fee_cha/general_pub/general_pub.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"For Civil Servants\", \"公務員\", \"公务员\"],\n\t\turlPrefix + \"fee_cha/civil_ser/civil_ser.html\"));\n\n\tchildMenuItem = new MenuItem([\"Breastfeeding\", \"母乳餵哺\", \"母乳喂哺\"], urlPrefix +\n\t\t\"breastfeeding\");\n\trootMenuItem.addChild(childMenuItem);\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding Policy\", \"母乳餵哺政策\",\n\t\t\"母乳喂哺政策\"\n\t], urlPrefix + \"breastfeeding/policy.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding-friendly Workplace\",\n\t\t\"母乳餵哺友善工作間\", \"母乳喂哺友善工作间\"\n\t], urlPrefix + \"breastfeeding/workplace.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding-friendly Community\",\n\t\t\"母乳餵哺社區\", \"母乳喂哺社区\"\n\t], urlPrefix + \"breastfeeding/community.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding Hotline\", \"母乳餵哺熱線\",\n\t\t\"母乳喂哺热线\"\n\t], urlPrefix + \"breastfeeding/hotline.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding Information\", \"母乳餵哺資訊\",\n\t\t\t\"母乳喂哺资讯\"\n\t\t], urlPrefix +\n\t\t\"health_info/class_topic/ct_child_health/ch_breastfeeding.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding Audio-visual Resources\",\n\t\t\"母乳餵哺視像資訊\",\n\t\t\"母乳喂哺视像资讯\"\n\t], urlPrefix + \"mulit_med/child_health.html#breastfeeding\"));\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding Resources QR Code Index\",\n\t\t\t\"母乳餵哺資訊<span>二維條碼索引</span>\",\n\t\t\t\"母乳喂哺资讯<span>二维条码索引</span>\"\n\t\t], urlPrefix +\n\t\t\"mulit_med/breastfeeding/vid_index.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding FAQ\", \"母乳餵哺常見疑問\",\n\t\t\"母乳喂哺常见疑问\"\n\t], urlPrefix + \"health_info/faq/breastfeeding/index.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding Poster\", \"母乳餵哺海報\",\n\t\t\"母乳喂哺海报\"\n\t], urlPrefix + \"health_info/poster/poster.html#breastfeeding\"));\n\n\tchildMenuItem = new MenuItem([\"Health Information\", \"健康資訊\", \"健康资讯\"],\n\t\turlPrefix + \"health_info/health_info.html\");\n\trootMenuItem.addChild(childMenuItem);\n\tchildMenuItem.addChild(new MenuItem([\"Child Health\", \"兒童健康\", \"儿童健康\"],\n\t\turlPrefix + \"health_info/class_life/child/child.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Woman Health\", \"婦女健康\", \"妇女健康\"],\n\t\turlPrefix + \"health_info/class_life/woman/woman.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Classified by Topics\", \"按主題劃分\",\n\t\t\"按主题划分\"\n\t], urlPrefix + \"health_info/class_topic/class_topic.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Health Information QR Code Index\",\n\t\t\"健康資訊<span>二維條碼索引</span>\",\n\t\t\"健康资讯<span>二维条码索引</span>\"\n\t], urlPrefix + \"health_info/qr_cat/index.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"FAQ\", \"常見疑問\", \"常见疑问\"], urlPrefix +\n\t\t\"health_info/faq/index.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Incident of Lead in Drinking Water\",\n\t\t\"食水含鉛事件\", \"食水含铅事件\"\n\t], [\"http://www.chp.gov.hk/en/content/40434.html\",\n\t\t\"http://www.chp.gov.hk/tc/content/40434.html\",\n\t\t\"http://sc.chp.gov.hk/TuniS/www.chp.gov.hk/tc/content/40434.html\"\n\t]));\n\tchildMenuItem.addChild(new MenuItem([\n\t\t\t\"Other Languages(हिन्दी, Bahasa Indonesia, नेपा ली, ภาษาไทย, اُردُو)\",\n\t\t\t\"其他語言(हिन्दी, Bahasa Indonesia, नेपा ली, ภาษาไทย, اُردُو)\",\n\t\t\t\"其他语言(हिन्दी, Bahasa Indonesia, नेपा ली, ภาษาไทย, اُردُو)\"\n\t\t],\n\t\turlPrefix + \"other_languages/index.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Poster\", \"海報\", \"海报\"],\n\t\turlPrefix + \"health_info/poster/poster.html\"));\n\n\tchildMenuItem = new MenuItem([\"Audio-Visual Resources\", \"視像資訊\", \"视像资讯\"],\n\t\turlPrefix + \"mulit_med/mulit_med.html\");\n\trootMenuItem.addChild(childMenuItem);\n\tchildMenuItem.addChild(new MenuItem([\"Breastfeeding \", \"母乳餵哺\", \"母乳喂哺\"],\n\t\turlPrefix + \"mulit_med/breastfeeding/index.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Child health \", \"兒童健康\", \"儿童健康\"],\n\t\turlPrefix + \"mulit_med/child_health.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Maternal and Woman health \",\n\t\t\"產前/產後及<span>婦女健康</span>\", \"产前/产后及<span>妇女健康</span>\"\n\t], urlPrefix + \"mulit_med/maternal_and_woman_health.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Positive Parenting\", \"正面親職\",\n\t\t\"正面亲职\"\n\t], urlPrefix + \"mulit_med/positive_parenting_programme/index.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"Audio-Visual Resources QR Code Index\",\n\t\t\"視像資訊<span>二維條碼索引</span>\",\n\t\t\"视像资讯<span>二维条码索引</span>\"\n\t], urlPrefix + \"mulit_med/qr_index/index.html\"));\n\tchildMenuItem.addChild(new MenuItem([\"TV Announcement \", \"電視宣傳短片\", \"电视宣传短片\"],\n\t\turlPrefix + \"mulit_med/api/api.html\"));\n\n\tchildMenuItem = new MenuItem([\"Parenting Corner\", \"親子平台 \", \"亲子平台\"],\n\t\turlPrefix + \"parenting_corner/index.html\");\n\trootMenuItem.addChild(childMenuItem);\n\tchildMenuItem.addChild(new MenuItem([\"Parent-Child e-link\", \"親子一點通\",\n\t\t\"亲子一点通\"\n\t], [\n\t\t\"http://parentelink.familyhealthservice.gov.hk/member/welcome_en.html\",\n\t\t\"http://parentelink.familyhealthservice.gov.hk/member/welcome.html\",\n\t\t\"http://parentelink.familyhealthservice.gov.hk/member/welcome_sc.html\"\n\t]));\n\tchildMenuItem.addChild(new MenuItem([\"Parenting Made Easy\", \"親子易點明\",\n\t\t\"親子易點明\"\n\t], [\"http://ecourse.familyhealthservice.gov.hk/en/\",\n\t\t\"http://ecourse.familyhealthservice.gov.hk/\",\n\t\t\"http://ecourse.familyhealthservice.gov.hk/sc/\"\n\t]));\n\tchildMenuItem.addChild(new MenuItem([\"Expert Tips\", \"專家話你知\", \"专家话你知\"],\n\t\turlPrefix + \"parenting_corner/expert_tips/index.html\"));\n\n\trootMenuItem.addChild(new MenuItem([\"Professional Corner\", \"專業平台\", \"专业平台\"],\n\t\turlPrefix + \"health_professional/index.html\"));\n\trootMenuItem.addChild(new MenuItem([\"Publications and Reports\", \"刊物及報告\",\n\t\t\"刊物及报告\"\n\t], urlPrefix + \"reports/index.html\"));\n\trootMenuItem.addChild(new MenuItem([\"Hotlines\", \"熱線\", \"热线\"], urlPrefix +\n\t\t\"hotlines/index.html\"));\n\trootMenuItem.addChild(new MenuItem([\"Download Forms\", \"下載表格\", \"下载表格\"],\n\t\turlPrefix + \"doc_br/doc_br_forms.html\"));\n\trootMenuItem.addChild(new MenuItem([\"Archive\", \"舊資料庫\", \"旧资料库\"], urlPrefix +\n\t\t\"archive/index.html\"));\n\trootMenuItem.addChild(new MenuItem([\"Useful Links\", \"有用連結\", \"有用连结\"],\n\t\turlPrefix + \"useful_link/useful_link.html\"));\n\n\t// Generate the Menu\n\tif (mode == 0) {\n\t\tdocument.writeln('<div>' + $('<div>').append(genMenuHTML(rootMenuItem, 0,\n\t\t\t'')).html() + '</div>');\n\t} else {\n\t\treturn '<ul class=\"sf-menu sf-vertical\">' + genMenuHTML(rootMenuItem, 0,\n\t\t\t'search').html() + '</ul>';\n\t}\n}", "title": "" }, { "docid": "26e5a609aeefc5217f87edc58d0f60ce", "score": "0.6325565", "text": "function onPageLoaded(id){\n //var url = window.location.pathname;\n let pageId = id;\n const listUrl = [\n \"work\",\n \"about\",\n \"contact\",\n \"bitcoin-data-non-linear\",\n \"phyllotactic-spirals\",\n \"phyllotactic-quad-curves\",\n \"galaxy-nebula\"\n ];\n \n switch(pageId){\n case listUrl[0]:\n //console.log(pageId); << for debug\n loadProject();\n break;\n \n case listUrl[1]:\n initGraphicAbout();\n break;\n \n case listUrl[2]:\n //console.log(pageId); << for debug\n break;\n \n case listUrl[3]:\n initBDNL();\n break;\n \n case listUrl[4]:\n initPhyl();\n break;\n \n case listUrl[5]:\n initQuad();\n break;\n \n case listUrl[6]:\n //console.log(pageId); << for debug\n break; \n \n default:\n console.log(pageId);\n }\n\n}", "title": "" }, { "docid": "8153119d388fd3b64cd22854a6ed7d04", "score": "0.63244456", "text": "function siteLoad () {\n document.title = `GameDay - ${window.site.title}`\n $('#site-title').html(window.site.title)\n if (window.site.name !== 'home') {\n $('.flex-header #site-links').append('<a href=\"javascript:changeSite(\\'home\\')\" data-edit=\"false\">GameDay Home</a>')\n }\n for (let a of window.site.links) {\n $('.flex-header #site-links').append(`<a href=\"${a.link}\">${a.display}</a>`)\n }\n\n for (let div of window.site.contents) { buildContents(div) }\n protonsLoad()\n if (window.site.mode === 'edit') { engageEditMode() }\n}", "title": "" }, { "docid": "11854f67a46a8116ac1f611463fa0dd4", "score": "0.6316457", "text": "function loadPage() {\n loadCart();\n loadTotal();\n }", "title": "" }, { "docid": "3480699abbf451e3d14278167e5176a6", "score": "0.63150805", "text": "function main()\r\n\t{\r\n\t\tif(window.location.href.indexOf(\"ym/ShowFolder\") != -1) ShowFolderMain();\r\n\t}", "title": "" }, { "docid": "5d1b8fd0d22ef283350facd82f77b5ce", "score": "0.63100624", "text": "function startatLoad(){\n\tloadNavbar(function(){\n\t\t\trefreshStatus();\n\t\t});\n}", "title": "" }, { "docid": "d6d5c81f6d4843931d25f269c33ec5b9", "score": "0.6299353", "text": "function loadHome() {\n var title = \"home\";\n // Activates the Home screen.\n header(\"Home\");\n changeLink(title);\n changeContent(title);\n \n // Loads user's name\n $(\".app-user-name\").text(name);\n \n // Reloads alerts and puts them on to the content.\n if(typeS) { getData(url + \"assign.json\", jsonAlerts); }\n if(typeI) { getData(url + \"assigner.json\", jsonAlerts); }\n}", "title": "" }, { "docid": "76b98fe3eafb7d7f5e7bb0b83e310fdb", "score": "0.6289371", "text": "function loadView() {\n\t\t\t\tvar selectedItem = items.eq(activeIndex).children('a');\n\n\t\t\t\t// If not final menu, return\n\t\t\t\tif (selectedItem.attr('menu-child') && selectedItem.attr('href') === undefined) return;\n\n\t\t\t\t// If child, load only if submenu is active\n\t\t\t\tif (element.attr('menu-parent') !== undefined && scope.submenu !== element.attr('menu-parent')) return;\n\n\t\t\t\t// Go to link\n\t\t\t\tvar url = selectedItem.attr('href');\n\t\t\t\tif (url) {\n\t\t\t\t\t$location.url(url);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "b5e48bcffe338de8d638c2412946eff5", "score": "0.6283521", "text": "function goHome() {\n menu();\n}", "title": "" }, { "docid": "5b0a2002dc8149f690016aeb63b20936", "score": "0.6282197", "text": "function loadPage() {\n nextCard(0);\n }", "title": "" }, { "docid": "bf8beb4596e9a8608db9920b7d95ff24", "score": "0.62813914", "text": "function _page1_page() {\n}", "title": "" }, { "docid": "66cec7830afcd9c52cd4dae26a4cae9d", "score": "0.62793005", "text": "function initializePage() {\n\t$('#searchControl .dropdown-menu a').click(getResults);\n\t//$('#sortFolderDiv .dropdown-menu a').click(doFoldersSort);\n\t//$('#sortNotesDiv .dropdown-menu a').click(doNotesSort);\n}", "title": "" }, { "docid": "b22c4f7d592d7e23c742a2da8eb3bdff", "score": "0.6273306", "text": "function loadPage(){\r\n\tvar dir = \"../website/\";\r\n\tif(arguments.length > 1) dir = arguments[0]+arguments[1];\r\n\telse dir += arguments[0];\r\n\t$(\"#main\").load(dir);\r\n}", "title": "" }, { "docid": "a480a05f323394c1f971836f4d352554", "score": "0.6271404", "text": "function initializeNavigation () {\n\tif(user==undefined){\n\t\tsetTimeout(function () {\n\t\t\tinitializeNavigation();\n\t\t});\n\t\treturn false;\n\t} \n\t$.get(WEB_URL+'dialogs/navigation.html').success(\n\t\tfunction(data){\n\t\t\t$('#nav-container').append(data); \n\t\t\tif(user.type==\"institute\" || user.type==\"admin\"){\n\t\t\t\t$(\".appDevCont\").show();\n\t\t\t} else {\n\t\t\t\t$(\".appDevCont\").hide();\n\t\t\t}\n\t\t\ts = window.location.pathname;\n\t\t\tif(s.indexOf(\"app\")>0 || s.indexOf(\"App\")>0 || s.indexOf(\"market\")>0 || s.indexOf(\"devGuide\")>0){\n\t\t\t\t$(\"#apps_subnavigation\").show();\n\t\t\t\t$(\"#nav_apps\").addClass(\"selectedLi\");\n\t\t\t\tif(user.type==\"institute\" || user.type==\"admin\"){\n\t\t\t\t\t$(\"#nav_community\").css(\"margin-top\", \"210px\");\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#nav_community\").css(\"margin-top\", \"90px\");\n\t\t\t\t}\n\t\t\t\tif(s.indexOf(\"market\")>0){\n\t\t\t\t\t$(\"#apps_subsubnavigation\").show();\n\t\t\t\t\t$(\"#nav_myApps\").css(\"margin-top\", \"90px\");\n\t\t\t\t\tif(user.type==\"institute\" || user.type==\"admin\"){\n\t\t\t\t\t\t$(\"#nav_community\").css(\"margin-top\", \"300px\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(\"#nav_community\").css(\"margin-top\", \"180px\");\n\t\t\t\t\t}\n\t\t\t\t\tif(window.location.href.indexOf(\"viz\")>0){\n\t\t\t\t\t\t$(\"#nav_market_v\").addClass(\"selectedLi\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(\"#nav_market_a\").addClass(\"selectedLi\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#apps_subsubnavigation\").hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$(\"#apps_subnavigation\").hide();\n\t\t\t}\n\t\t\tif(s.indexOf(\"space\")>0 || s.indexOf(\"Space\")>0 || s.indexOf(\"News\")>0){\n\t\t\t\t$.each($(\"#navivation a\"), function(i, item){\n\t\t\t\t\t$(this).attr(\"href\", \"../\"+$(this).attr(\"href\"));\n\t\t\t\t});\n\t\t\t}\n\t\t\t$(\"#nav_\"+s.substring(s.lastIndexOf(\"/\")+1, s.lastIndexOf(\".\"))).addClass(\"selectedLi\")\n\t\t}\n\t);\n}", "title": "" } ]
17a54b7e67314e456157475d1dcf54c9
Returns a string that is a prefix of all strings matching the RegExp
[ { "docid": "fa4485414503003b70260bcba7928bf5", "score": "0.7289834", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return prefix != null ? prefix[1].replace(/\\\\(.)/g, '$1') : '';\n }", "title": "" } ]
[ { "docid": "b002c0b1d30a2374c1f57ec837286a65", "score": "0.73255146", "text": "function regExpPrefix(re) {\r\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\r\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\r\n\t }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "7513f055aa77336e7512718f6c2de8b6", "score": "0.73127365", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "cdcacbbe044f3159f19518755059b909", "score": "0.72960025", "text": "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "title": "" }, { "docid": "cdcacbbe044f3159f19518755059b909", "score": "0.72960025", "text": "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "title": "" }, { "docid": "2f724ee90b1f36e5c5adbbc6431d0437", "score": "0.7275779", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix !== null) ? prefix[1].replace(/\\\\(.)/g, '$1') : '';\n }", "title": "" }, { "docid": "a00ac25d8a316676e035f2fc12c08f8e", "score": "0.7230644", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "a00ac25d8a316676e035f2fc12c08f8e", "score": "0.7230644", "text": "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "title": "" }, { "docid": "fb17d6c5c7e8c7e436e26d97bf32014f", "score": "0.62087", "text": "function matchString(arr) {\n // construct a regexp to match the \n var prefixes = [];\n for each (var a in arr) {\n for (var i=1;i<=a.length;i++) {\n prefixes.push(a.slice(0,i));\n }\n }\n return prefixes.reverse().join('|');\n}", "title": "" }, { "docid": "aebab97e73d7fcb8edb06882021ab607", "score": "0.5961931", "text": "addPhonyPrefix(str) {\n // don't add a prefix to an empty string\n if (str.length === 0) {\n return str;\n }\n var match = str.match(COMPRESS_REGEX);\n // if the string has no compression commands, add one to the beginning\n if (match === null) {\n return (`(${str.length}x1)${str}`);\n }\n // if the first match is not at the beginning of the string, add it\n var firstPos = match.index;\n if (firstPos > 0) {\n return `(${firstPos}x1)${str}`;\n }\n // the compress command is already at the beginning, return str as-is\n return str;\n }", "title": "" }, { "docid": "86624c5be426c0b36471da260f1638b1", "score": "0.5869995", "text": "replace (string, prefix) {\n return string.replace(this.regexp(), `$1${prefix}$2`)\n }", "title": "" }, { "docid": "e6e05875cbeabf45cead5231782a306c", "score": "0.58162206", "text": "function addPrefix(word){\n if (word.substring(0,2)===\"Py\")\n {\n return word;\n }\n return \"Py\"+word;\n}", "title": "" }, { "docid": "21f229232c2cee8ff5ef59631cff4406", "score": "0.5797923", "text": "function has_prefix(text){\n let prefix_starts = [\"we \", \"there's \", \"see \", \"they \"]\n for (let pre of prefix_starts ){ if (text.startsWith(pre)){ return true } }\n return false\n}", "title": "" }, { "docid": "24da48b614cdcfe265bb0a3d584cc15d", "score": "0.5779872", "text": "replace (string, prefix) {\n return this.prefixed(prefix)\n }", "title": "" }, { "docid": "2bd33a47a22f4b450b437063a1d134eb", "score": "0.57737005", "text": "function prefixNames(prefix) {\n var classNames = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n classNames[_i - 1] = arguments[_i];\n }\n\n return classNames.map(function (className) {\n return className.split(\" \").map(function (name) {\n return name ? \"\" + prefix + name : \"\";\n }).join(\" \");\n }).join(\" \");\n }", "title": "" }, { "docid": "06c18ffb5a215ba89a3cdbee10517ef0", "score": "0.57245183", "text": "headMatchPattern(string){\n for (let linearParsingNode of this.linearParsingNodes){\n let patternString = linearParsingNode.headMatchFunction.call(this, string)\n if (patternString) return patternString\n }\n return ''\n }", "title": "" }, { "docid": "abb46dfa69d95822d0795436b32c45e8", "score": "0.56943923", "text": "listWordsStartingWith(prefix) {\n\n const node = this.searchPrefix(prefix);\n\n if (node === null) {\n\n return []\n\n }\n\n const result = [];\n\n if (node.terminates) {\n\n result.push(prefix)\n }\n\n this._listWords(node, prefix, result);\n\n\n return result\n\n\n }", "title": "" }, { "docid": "6f867664bd706704535ba48137da6a3d", "score": "0.5690221", "text": "prefixed (prefix) {\n return this.name.replace(/^(\\W*)/, `$1${prefix}`)\n }", "title": "" }, { "docid": "28e9bd22bbe3ea3ef7096e0a733ce8af", "score": "0.5685217", "text": "function strStartsWith ( input, match ) {\nreturn input.substring(0, match.length) === match;\n}", "title": "" }, { "docid": "7bee416b3ab8367482b716127ad6e7e8", "score": "0.568176", "text": "function cGovDoRegExp1(theRegExp, result) {\r\n\tvar done = false;\r\n\tvar offset = 0;\r\n\twhile (!done) {\r\n\t\tvar temp = result.substr(offset);\r\n\t\tif (temp == null) {\r\n\t\t\tdone = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar target = theRegExp.exec(temp);\r\n\t\t\t//alert(\"target = \" + target);\r\n\t\t\tif (target == null) {\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\toffset += target.index;\r\n\t\t\t\tvar iDed = cGovAddUniqueID(target[1]);\r\n\t\t\t\tresult = result.replace(target[0],iDed);\r\n\t\t\t\t//alert(\"result = \" + result);\r\n\t\t\t\toffset += iDed.length;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}", "title": "" }, { "docid": "f9cba1664c539562c3ddc618537bbb8c", "score": "0.56627256", "text": "function findPrefix(inSrc, element, listCounters) {\n var prefix=\"\";\n if (!inSrc) {\n if (element.getType()===DocumentApp.ElementType.PARAGRAPH) {\n var paragraphObj = element;\n switch (paragraphObj.getHeading()) {\n // Add a # for each heading level. No break, so we accumulate the right number.\n case DocumentApp.ParagraphHeading.HEADING6: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING5: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING4: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING3: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING2: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING1: prefix+=\"# \";\n default:\n }\n } else if (element.getType()===DocumentApp.ElementType.LIST_ITEM) {\n var listItem = element;\n var nesting = listItem.getNestingLevel()\n for (var i=0; i<nesting; i++) {\n prefix += \" \";\n }\n var gt = listItem.getGlyphType();\n // Bullet list (<ul>):\n if (gt === DocumentApp.GlyphType.BULLET\n || gt === DocumentApp.GlyphType.HOLLOW_BULLET\n || gt === DocumentApp.GlyphType.SQUARE_BULLET) {\n prefix += \"* \";\n } else {\n // Ordered list (<ol>):\n var key = listItem.getListId() + '.' + listItem.getNestingLevel();\n var counter = listCounters[key] || 0;\n counter++;\n listCounters[key] = counter;\n prefix += counter+\". \";\n }\n }\n }\n return prefix;\n}", "title": "" }, { "docid": "c04219971d0c20b51f005f7cf8dc600c", "score": "0.56589466", "text": "function getPrefix(des) {\n var strings = [];\n var prefix = '';\n\n // converts the associative array to a real one\n for (var k in des) {\n strings[strings.length] = des[k];\n }\n\n // gets the maximium length of the strings\n var max = Math.max.apply(null, strings.map(function(param) {return param.length;}));\n\n //tries to find a prefix\n for (var i = 0; i < max; i++) {\n for (k in des) {\n if (des[k].indexOf(prefix) !== 0) {\n return strings[0].substring(0, (i - 2));\n }\n }\n prefix = strings[0].substring(0, i);\n }\n return '';\n }", "title": "" }, { "docid": "c5d00b694ff0d264ca43c0d2d016bf3f", "score": "0.5655296", "text": "function prefix(prefixString, fn) {\n return (fmt, ...args) => fn(`%s ${fmt}`, prefixString, ...args);\n}", "title": "" }, { "docid": "2d58d4b8bbc817e168cdec6a6e1251db", "score": "0.56427455", "text": "function stringStartsWith(string, prefix) {\n return string.slice(0,prefix.length) == prefix;\n }", "title": "" }, { "docid": "2270081ea8b0245c72159c1835553bc8", "score": "0.5631075", "text": "function _all_string_prefixes() {\n return ['', 'FR', 'RF', 'Br', 'BR', 'Fr', 'r', 'B', 'R', 'b', 'bR', 'f', 'rb', 'rB', 'F', 'Rf', 'U', 'rF', 'u', 'RB', 'br', 'fR', 'fr', 'rf', 'Rb'];\n} // Note that since _all_string_prefixes includes the empty string,", "title": "" }, { "docid": "97ed33ad8672cc15d153773264a21692", "score": "0.5630368", "text": "startsWith(c){ return false }", "title": "" }, { "docid": "be0c3dd56171fc4b409da376ca651bc8", "score": "0.5627412", "text": "function companyPrefix(companyPrefixInput, companyPrefixPoint)\n{\t\n\tfor(var x=6; x<=12;x++)\t\n\t{\t\n\t\tif(x == companyPrefixPoint)\n\t\t{\tvar FirstChar\t\t=\tcompanyPrefixInput.charAt(0);\n\t\t\tcompanyPrefixInput \t= \t[companyPrefixInput.slice(1, x+1), \".\" , FirstChar , companyPrefixInput.slice(x+1,companyPrefixInput.length-1)].join('');\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn companyPrefixInput;\n}", "title": "" }, { "docid": "bc9197b5dbc055060193b4b0c21085b8", "score": "0.562643", "text": "regexp (prefix) {\n if (!this.regexpCache.has(prefix)) {\n let name = prefix ? this.prefixed(prefix) : this.name;\n this.regexpCache.set(\n prefix,\n new RegExp(`(^|[^:\"'=])${utils.escapeRegexp(name)}`, 'gi')\n );\n }\n\n return this.regexpCache.get(prefix)\n }", "title": "" }, { "docid": "0311e2fa94b4d469f6fcc6adb5906635", "score": "0.56258124", "text": "function strStartsWith ( input, match ) {\n return input.substring(0, match.length) === match;\n }", "title": "" }, { "docid": "6ba849dcaa70b82839f668dba16bf9ae", "score": "0.56235284", "text": "function strStartsWith(input, match) {\r\n return input.substring(0, match.length) === match;\r\n }", "title": "" }, { "docid": "b7a33add664601f5a048681d118a5f21", "score": "0.56160486", "text": "function fixStart(myString) {\n var letter = myString[0];\n if (myString.includes(letter)) {\n return myString.substring(letter).replace(letter, \"*\");\n }\n\n}", "title": "" }, { "docid": "c5ee6aefa923490a0ff5c01929af2fc5", "score": "0.56129986", "text": "function addPrefix(src) {\r\n\t\t\treturn src.replace(/(\\/?)([^\\/]+)$/,'$1' + s.thumbPrefix + '$2');\r\n\t\t}", "title": "" }, { "docid": "aa809409d7542bba2111ce1d587b6e8a", "score": "0.56061375", "text": "function prefix(prefixText) {\n const prefixStr = 'Always: '\n return prefixStr + prefixText\n}", "title": "" }, { "docid": "41903a56f6e1590a476aeb7b674ca092", "score": "0.56021833", "text": "static withPrefix (value) {\n if (!this.prefixesRegexp) {\n this.prefixesRegexp = new RegExp(this.prefixes().join('|'));\n }\n\n return this.prefixesRegexp.test(value)\n }", "title": "" }, { "docid": "11d1c441345f5b1191bfbde72aa0f954", "score": "0.55822307", "text": "function startsWithL(word) {\n\n}", "title": "" }, { "docid": "9e9f4ef8b1018d523973ffed6655b720", "score": "0.55682343", "text": "function removePrefixMod(str) {\n return str.replace(g_titleMod, \"\").trim();\n }", "title": "" }, { "docid": "745e4ca23bb4b7d22b9fdb4df40e5d4f", "score": "0.5565413", "text": "function prefix(iri, factory) {\n return prefixes({ '': iri.value || iri }, factory)('');\n}", "title": "" }, { "docid": "745e4ca23bb4b7d22b9fdb4df40e5d4f", "score": "0.5565413", "text": "function prefix(iri, factory) {\n return prefixes({ '': iri.value || iri }, factory)('');\n}", "title": "" }, { "docid": "b598f1541aa11fb5f8a30d8f3fbc3462", "score": "0.5536238", "text": "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n}", "title": "" }, { "docid": "fa53ca5e9f6817bac8284530a9ace466", "score": "0.5527894", "text": "function companyPrefixNormal(companyPrefixInput, companyPrefixPoint)\n{\n\tfor(var x=6; x<=12;x++)\t\n\t{\t\n\t\tif(x == companyPrefixPoint)\n\t\t{\t\n\t\t\tcompanyPrefixInput = [companyPrefixInput.slice(0, x), \".\", companyPrefixInput.slice(x)].join('');\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn companyPrefixInput;\n}", "title": "" }, { "docid": "2a3f603854d8106149fa077c95f914ed", "score": "0.5524191", "text": "function stringStartsWith(prefix) {\n var found = false;\n if (this.substr(0, prefix.length) == prefix) {\n found = true;\n }\n return found;\n }", "title": "" }, { "docid": "afe46816f378d1ba68b5437125608423", "score": "0.552415", "text": "function strStartsWith(input, match) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "title": "" }, { "docid": "afe46816f378d1ba68b5437125608423", "score": "0.552415", "text": "function strStartsWith(input, match) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "title": "" }, { "docid": "ad9f10ae3d765db28ec59154c1615429", "score": "0.55239886", "text": "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "title": "" }, { "docid": "ad9f10ae3d765db28ec59154c1615429", "score": "0.55239886", "text": "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "title": "" }, { "docid": "ad9f10ae3d765db28ec59154c1615429", "score": "0.55239886", "text": "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "title": "" }, { "docid": "ad9f10ae3d765db28ec59154c1615429", "score": "0.55239886", "text": "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "title": "" }, { "docid": "68bffc8ca5c0dc115dc5aeda28d38578", "score": "0.5521222", "text": "prefixeds (rule) {\n if (rule._autoprefixerPrefixeds) {\n if (rule._autoprefixerPrefixeds[this.name]) {\n return rule._autoprefixerPrefixeds\n }\n } else {\n rule._autoprefixerPrefixeds = {};\n }\n\n let prefixeds = {};\n if (rule.selector.includes(',')) {\n let ruleParts = list$4.comma(rule.selector);\n let toProcess = ruleParts.filter(el => el.includes(this.name));\n\n for (let prefix of this.possible()) {\n prefixeds[prefix] = toProcess\n .map(el => this.replace(el, prefix))\n .join(', ');\n }\n } else {\n for (let prefix of this.possible()) {\n prefixeds[prefix] = this.replace(rule.selector, prefix);\n }\n }\n\n rule._autoprefixerPrefixeds[this.name] = prefixeds;\n return rule._autoprefixerPrefixeds\n }", "title": "" }, { "docid": "2dd8cc0e02ad5df823aa9f7411e64c77", "score": "0.5517494", "text": "function strStartsWith ( input, match ) {\n return input.substring(0, match.length) === match;\n }", "title": "" }, { "docid": "60e77666bb24059c494b07d849b84ffe", "score": "0.5515252", "text": "function stripPrefix(str,prefix=``){if(!prefix){return str;}if(str===prefix){return`/`;}if(str.startsWith(`${prefix}/`)){return str.slice(prefix.length);}return str;}", "title": "" }, { "docid": "f02cc51fcac705f4769060870d8be880", "score": "0.55032367", "text": "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "title": "" }, { "docid": "f02cc51fcac705f4769060870d8be880", "score": "0.55032367", "text": "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "title": "" }, { "docid": "87b1d72e17ffdf44abe35dd076442dd3", "score": "0.5490761", "text": "function startsWith(string, prefix) {\n return string.slice(0, prefix.length) === prefix;\n}", "title": "" }, { "docid": "57cd8a07575db934e3bb901e7ab71703", "score": "0.5481815", "text": "function addPrefix(src) {\n return src && src.replace(/(\\/?)([^\\/]+)$/,'$1' + s.thumbPrefix + '$2');\n }", "title": "" }, { "docid": "452a46d153a769a518c826989adec295", "score": "0.5478086", "text": "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "title": "" }, { "docid": "452a46d153a769a518c826989adec295", "score": "0.5478086", "text": "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "title": "" }, { "docid": "452a46d153a769a518c826989adec295", "score": "0.5478086", "text": "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "title": "" }, { "docid": "452a46d153a769a518c826989adec295", "score": "0.5478086", "text": "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "title": "" }, { "docid": "452a46d153a769a518c826989adec295", "score": "0.5478086", "text": "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "title": "" }, { "docid": "452a46d153a769a518c826989adec295", "score": "0.5478086", "text": "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "title": "" }, { "docid": "452a46d153a769a518c826989adec295", "score": "0.5478086", "text": "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "title": "" }, { "docid": "0aea181b1fbfc18cfa1a0addb62235a6", "score": "0.5464119", "text": "function substringsAtStart(str) {\n return str.split('').map(function(current, index) {\n return str.slice(0, index + 1);\n });\n}", "title": "" }, { "docid": "4bd49a5e0d48ab8eeb4844798cd589b9", "score": "0.54535466", "text": "getPrefixMatches(lastWord) {\n\t\tvar words = this.ternWords.getPrefixMatchesWeighted(lastWord, 5);\t\t// find the best 5 words\n\t\t\n\t\t// if any matches found or if the word has benn shortened to just a single letter\n\t\tif (words.length > 0 || lastWord.length < 2)\n\t\t\treturn words;\n\n\t\t// try shortening the word \n\t\tvar lastWord = lastWord.substr(0, lastWord.length-1);\n\t\treturn this.getPrefixMatches(lastWord);\n\t}", "title": "" }, { "docid": "6d297bb33b365056bb4ac22d3bda9573", "score": "0.54503596", "text": "function buildNormalisationRegEx(prefix) {\n //TODO: Can this be improved/is it necessary?\n const normalised = prefix.replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\*/g, '\\\\*')\n .replace(/\\./g, '\\\\.')\n .replace(/\\[/g, '\\\\[')\n .replace(/\\]/g, '\\\\]')\n .replace(/\\+/g, '\\\\+')\n .replace(/\\-/g, '\\\\-')\n .replace(/\\?/g, '\\\\?')\n .replace(/\\(/g, '\\\\(')\n .replace(/\\)/g, '\\\\)')\n .replace(/\\^/g, '\\\\^')\n .replace(/\\$/g, '\\\\$')\n .replace(/\\!/g, '\\\\!')\n .replace(/\\&/g, '\\\\&');\n return new RegExp (normalised + '[0-9._]+');\n}", "title": "" }, { "docid": "03e9ff591aa06b2fc1b85d5855a86ce0", "score": "0.544493", "text": "function trunk_prefix(format) {\n\tvar digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n\tvar trunk_prefix = '';\n\n\tvar _iteratorNormalCompletion = true;\n\tvar _didIteratorError = false;\n\tvar _iteratorError = undefined;\n\n\ttry {\n\t\tfor (var _iterator = (0, _getIterator3.default)(template(format, digits)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar symbol = _step.value;\n\n\t\t\tif (symbol >= '0' && symbol <= '9') {\n\t\t\t\ttrunk_prefix += symbol;\n\t\t\t} else if (symbol >= 'A' && symbol <= 'z') {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return) {\n\t\t\t\t_iterator.return();\n\t\t\t}\n\t\t} finally {\n\t\t\tif (_didIteratorError) {\n\t\t\t\tthrow _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn trunk_prefix;\n}", "title": "" }, { "docid": "fead523a0af04864047a0a7d4ad20d14", "score": "0.54250664", "text": "function trimPrefix(str, prefix) {\n while (str.startsWith(prefix)) {\n str = str.slice(prefix.length);\n }\n return str;\n}", "title": "" }, { "docid": "fead523a0af04864047a0a7d4ad20d14", "score": "0.54250664", "text": "function trimPrefix(str, prefix) {\n while (str.startsWith(prefix)) {\n str = str.slice(prefix.length);\n }\n return str;\n}", "title": "" }, { "docid": "11a1d09f5ce9208165deb649dc7e70b5", "score": "0.5393172", "text": "function startsWith(str, prefix) {\n\t str = toString(str);\n\t prefix = toString(prefix);\n\n\t return str.indexOf(prefix) === 0;\n\t }", "title": "" }, { "docid": "7602e5260b86e0124f16e65c5a33cecb", "score": "0.5386243", "text": "function doesStringStartWith(s, prefix) {\n return s.substr(0, prefix.length) === prefix;\n}", "title": "" }, { "docid": "9983441fe42966e781433be1ab71db2a", "score": "0.53575975", "text": "function prefixMatcher(token) {\n const lowToken = token.toLowerCase();\n\n // if starts with possible prefix\n const matchingPrefix =\n validPrefix.filter((p) => lowToken.startsWith(p)).length > 0;\n\n if (matchingPrefix) {\n const residual = lowToken.slice(1);\n\n // case only L\n if (!residual.length) {\n return 1;\n } else {\n // case L.\n if (residual == \".\") {\n return 1;\n } else {\n // case L.123-12\n if (residual.slice(0, 1) == \".\" && articleMatcher(residual.slice(1))) {\n return 2;\n }\n // case L.123-12\n else if (articleMatcher(residual.slice(1))) {\n return 2;\n }\n }\n }\n }\n // no match\n return 0;\n}", "title": "" } ]